@enya-learning/nova 0.4.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 +418 -0
- package/changelog.md +44 -0
- package/components.json +23 -0
- package/dist/chunks/button-npy7isi3nsvlhf86.js +81 -0
- package/dist/chunks/button-npy7isi3nsvlhf86.js.map +1 -0
- package/dist/chunks/rolldown-runtime-fifbipqm1abz4ydz.js +30 -0
- package/dist/chunks/utils-kyb5nny4y41y7hd8.js +10 -0
- package/dist/chunks/utils-kyb5nny4y41y7hd8.js.map +1 -0
- package/dist/chunks/vendor-base-ui-efqwzv4oinwg1f0d.js +16049 -0
- package/dist/chunks/vendor-base-ui-efqwzv4oinwg1f0d.js.map +1 -0
- package/dist/chunks/vendor-styling-eeiy57tyznmxsfky.js +1744 -0
- package/dist/chunks/vendor-styling-eeiy57tyznmxsfky.js.map +1 -0
- package/dist/components/button.js +6 -0
- package/dist/components/enya-logo.js +191 -0
- package/dist/components/enya-logo.js.map +1 -0
- package/dist/index.js +23499 -0
- package/dist/index.js.map +1 -0
- package/dist/src/components/accordion/accordion.d.ts +6 -0
- package/dist/src/components/accordion/index.d.ts +1 -0
- package/dist/src/components/alert/alert.d.ts +10 -0
- package/dist/src/components/alert/index.d.ts +1 -0
- package/dist/src/components/alert-dialog/alert-dialog.d.ts +18 -0
- package/dist/src/components/alert-dialog/index.d.ts +1 -0
- package/dist/src/components/aspect-ratio/aspect-ratio.d.ts +4 -0
- package/dist/src/components/aspect-ratio/index.d.ts +1 -0
- package/dist/src/components/avatar/avatar.d.ts +11 -0
- package/dist/src/components/avatar/index.d.ts +1 -0
- package/dist/src/components/badge/badge.d.ts +7 -0
- package/dist/src/components/badge/index.d.ts +1 -0
- package/dist/src/components/breadcrumb/breadcrumb.d.ts +10 -0
- package/dist/src/components/breadcrumb/index.d.ts +1 -0
- package/dist/src/components/button/button.d.ts +8 -0
- package/dist/src/components/button/index.d.ts +1 -0
- package/dist/src/components/button-group/button-group.d.ts +10 -0
- package/dist/src/components/button-group/index.d.ts +1 -0
- package/dist/src/components/calendar/calendar.d.ts +10 -0
- package/dist/src/components/calendar/index.d.ts +1 -0
- package/dist/src/components/card/card.d.ts +11 -0
- package/dist/src/components/card/index.d.ts +1 -0
- package/dist/src/components/carousel/carousel.d.ts +28 -0
- package/dist/src/components/carousel/index.d.ts +1 -0
- package/dist/src/components/chart/chart.d.ts +44 -0
- package/dist/src/components/chart/index.d.ts +1 -0
- package/dist/src/components/checkbox/checkbox.d.ts +3 -0
- package/dist/src/components/checkbox/index.d.ts +1 -0
- package/dist/src/components/collapsible/collapsible.d.ts +5 -0
- package/dist/src/components/collapsible/index.d.ts +1 -0
- package/dist/src/components/combobox/combobox.d.ts +24 -0
- package/dist/src/components/combobox/index.d.ts +1 -0
- package/dist/src/components/command/command.d.ts +19 -0
- package/dist/src/components/command/index.d.ts +1 -0
- package/dist/src/components/context-menu/context-menu.d.ts +29 -0
- package/dist/src/components/context-menu/index.d.ts +1 -0
- package/dist/src/components/dialog/dialog.d.ts +17 -0
- package/dist/src/components/dialog/index.d.ts +1 -0
- package/dist/src/components/direction/direction.d.ts +1 -0
- package/dist/src/components/direction/index.d.ts +1 -0
- package/dist/src/components/drawer/drawer.d.ts +13 -0
- package/dist/src/components/drawer/index.d.ts +1 -0
- package/dist/src/components/dropdown-menu/dropdown-menu.d.ts +29 -0
- package/dist/src/components/dropdown-menu/index.d.ts +1 -0
- package/dist/src/components/empty/empty.d.ts +11 -0
- package/dist/src/components/empty/index.d.ts +1 -0
- package/dist/src/components/enya-logo/enya-logo.d.ts +121 -0
- package/dist/src/components/enya-logo/index.d.ts +1 -0
- package/dist/src/components/field/field.d.ts +24 -0
- package/dist/src/components/field/index.d.ts +1 -0
- package/dist/src/components/hover-card/hover-card.d.ts +5 -0
- package/dist/src/components/hover-card/index.d.ts +1 -0
- package/dist/src/components/input/index.d.ts +1 -0
- package/dist/src/components/input/input.d.ts +3 -0
- package/dist/src/components/input-group/index.d.ts +1 -0
- package/dist/src/components/input-group/input-group.d.ts +18 -0
- package/dist/src/components/input-otp/index.d.ts +1 -0
- package/dist/src/components/input-otp/input-otp.d.ts +11 -0
- package/dist/src/components/item/index.d.ts +1 -0
- package/dist/src/components/item/item.d.ts +22 -0
- package/dist/src/components/kbd/index.d.ts +1 -0
- package/dist/src/components/kbd/kbd.d.ts +3 -0
- package/dist/src/components/label/index.d.ts +1 -0
- package/dist/src/components/label/label.d.ts +3 -0
- package/dist/src/components/menubar/index.d.ts +1 -0
- package/dist/src/components/menubar/menubar.d.ts +29 -0
- package/dist/src/components/native-select/index.d.ts +1 -0
- package/dist/src/components/native-select/native-select.d.ts +8 -0
- package/dist/src/components/navigation-menu/index.d.ts +1 -0
- package/dist/src/components/navigation-menu/navigation-menu.d.ts +11 -0
- package/dist/src/components/pagination/index.d.ts +1 -0
- package/dist/src/components/pagination/pagination.d.ts +17 -0
- package/dist/src/components/popover/index.d.ts +1 -0
- package/dist/src/components/popover/popover.d.ts +9 -0
- package/dist/src/components/progress/index.d.ts +1 -0
- package/dist/src/components/progress/progress.d.ts +7 -0
- package/dist/src/components/radio-group/index.d.ts +1 -0
- package/dist/src/components/radio-group/radio-group.d.ts +5 -0
- package/dist/src/components/resizable/index.d.ts +1 -0
- package/dist/src/components/resizable/resizable.d.ts +7 -0
- package/dist/src/components/scroll-area/index.d.ts +1 -0
- package/dist/src/components/scroll-area/scroll-area.d.ts +4 -0
- package/dist/src/components/select/index.d.ts +1 -0
- package/dist/src/components/select/select.d.ts +15 -0
- package/dist/src/components/separator/index.d.ts +1 -0
- package/dist/src/components/separator/separator.d.ts +3 -0
- package/dist/src/components/sheet/index.d.ts +1 -0
- package/dist/src/components/sheet/sheet.d.ts +14 -0
- package/dist/src/components/sidebar/index.d.ts +1 -0
- package/dist/src/components/sidebar/sidebar.d.ts +63 -0
- package/dist/src/components/skeleton/index.d.ts +1 -0
- package/dist/src/components/skeleton/skeleton.d.ts +2 -0
- package/dist/src/components/slider/index.d.ts +1 -0
- package/dist/src/components/slider/slider.d.ts +3 -0
- package/dist/src/components/sonner/index.d.ts +1 -0
- package/dist/src/components/sonner/sonner.d.ts +3 -0
- package/dist/src/components/spinner/index.d.ts +1 -0
- package/dist/src/components/spinner/spinner.d.ts +2 -0
- package/dist/src/components/switch/index.d.ts +1 -0
- package/dist/src/components/switch/switch.d.ts +5 -0
- package/dist/src/components/table/index.d.ts +1 -0
- package/dist/src/components/table/table.d.ts +10 -0
- package/dist/src/components/tabs/index.d.ts +1 -0
- package/dist/src/components/tabs/tabs.d.ts +10 -0
- package/dist/src/components/textarea/index.d.ts +1 -0
- package/dist/src/components/textarea/textarea.d.ts +3 -0
- package/dist/src/components/toggle/index.d.ts +1 -0
- package/dist/src/components/toggle/toggle.d.ts +8 -0
- package/dist/src/components/toggle-group/index.d.ts +1 -0
- package/dist/src/components/toggle-group/toggle-group.d.ts +10 -0
- package/dist/src/components/tooltip/index.d.ts +1 -0
- package/dist/src/components/tooltip/tooltip.d.ts +6 -0
- package/dist/src/hooks/use-mobile.d.ts +1 -0
- package/dist/src/index.d.ts +57 -0
- package/dist/src/lib/utils.d.ts +2 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/styles/nova-binding.css +290 -0
- package/dist/styles/nova.css +58 -0
- package/dist/styles/theme-nova.css +201 -0
- package/dist/styles/typography.css +215 -0
- package/dist/utils.js +5 -0
- package/eslint.config.js +30 -0
- package/package.json +94 -0
- package/plopfile.mjs +49 -0
- package/src/components/.gitkeep +0 -0
- package/src/components/accordion/accordion.mdx +83 -0
- package/src/components/accordion/accordion.tsx +81 -0
- package/src/components/accordion/index.ts +1 -0
- package/src/components/alert/alert.tsx +76 -0
- package/src/components/alert/index.ts +1 -0
- package/src/components/alert-dialog/alert-dialog.tsx +187 -0
- package/src/components/alert-dialog/index.ts +1 -0
- package/src/components/aspect-ratio/aspect-ratio.tsx +22 -0
- package/src/components/aspect-ratio/index.ts +1 -0
- package/src/components/avatar/avatar.tsx +107 -0
- package/src/components/avatar/index.ts +1 -0
- package/src/components/badge/badge.tsx +52 -0
- package/src/components/badge/index.ts +1 -0
- package/src/components/breadcrumb/breadcrumb.tsx +122 -0
- package/src/components/breadcrumb/index.ts +1 -0
- package/src/components/button/button.mdx +255 -0
- package/src/components/button/button.tsx +59 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/button-group/button-group.tsx +87 -0
- package/src/components/button-group/index.ts +1 -0
- package/src/components/calendar/calendar.tsx +228 -0
- package/src/components/calendar/index.ts +1 -0
- package/src/components/card/card.tsx +100 -0
- package/src/components/card/index.ts +1 -0
- package/src/components/carousel/carousel.tsx +243 -0
- package/src/components/carousel/index.ts +1 -0
- package/src/components/chart/chart.tsx +371 -0
- package/src/components/chart/index.ts +1 -0
- package/src/components/checkbox/checkbox.tsx +28 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/collapsible/collapsible.tsx +19 -0
- package/src/components/collapsible/index.ts +1 -0
- package/src/components/combobox/combobox.tsx +298 -0
- package/src/components/combobox/index.ts +1 -0
- package/src/components/command/command.tsx +193 -0
- package/src/components/command/index.ts +1 -0
- package/src/components/context-menu/context-menu.tsx +272 -0
- package/src/components/context-menu/index.ts +1 -0
- package/src/components/dialog/dialog.tsx +157 -0
- package/src/components/dialog/index.ts +1 -0
- package/src/components/direction/direction.tsx +4 -0
- package/src/components/direction/index.ts +1 -0
- package/src/components/drawer/drawer.tsx +134 -0
- package/src/components/drawer/index.ts +1 -0
- package/src/components/dropdown-menu/dropdown-menu.tsx +270 -0
- package/src/components/dropdown-menu/index.ts +1 -0
- package/src/components/empty/empty.tsx +104 -0
- package/src/components/empty/index.ts +1 -0
- package/src/components/enya-logo/enya-logo.mdx +174 -0
- package/src/components/enya-logo/enya-logo.tsx +383 -0
- package/src/components/enya-logo/index.ts +1 -0
- package/src/components/field/field.tsx +236 -0
- package/src/components/field/index.ts +1 -0
- package/src/components/hover-card/hover-card.tsx +51 -0
- package/src/components/hover-card/index.ts +1 -0
- package/src/components/input/index.ts +1 -0
- package/src/components/input/input.tsx +20 -0
- package/src/components/input-group/index.ts +1 -0
- package/src/components/input-group/input-group.tsx +157 -0
- package/src/components/input-otp/index.ts +1 -0
- package/src/components/input-otp/input-otp.tsx +84 -0
- package/src/components/item/index.ts +1 -0
- package/src/components/item/item.tsx +201 -0
- package/src/components/kbd/index.ts +1 -0
- package/src/components/kbd/kbd.tsx +26 -0
- package/src/components/label/index.ts +1 -0
- package/src/components/label/label.tsx +20 -0
- package/src/components/menubar/index.ts +1 -0
- package/src/components/menubar/menubar.tsx +281 -0
- package/src/components/native-select/index.ts +1 -0
- package/src/components/native-select/native-select.tsx +65 -0
- package/src/components/navigation-menu/index.ts +1 -0
- package/src/components/navigation-menu/navigation-menu.tsx +171 -0
- package/src/components/pagination/index.ts +1 -0
- package/src/components/pagination/pagination.tsx +133 -0
- package/src/components/popover/index.ts +1 -0
- package/src/components/popover/popover.tsx +88 -0
- package/src/components/progress/index.ts +1 -0
- package/src/components/progress/progress.tsx +83 -0
- package/src/components/radio-group/index.ts +1 -0
- package/src/components/radio-group/radio-group.tsx +36 -0
- package/src/components/resizable/index.ts +1 -0
- package/src/components/resizable/resizable.tsx +50 -0
- package/src/components/scroll-area/index.ts +1 -0
- package/src/components/scroll-area/scroll-area.tsx +53 -0
- package/src/components/select/index.ts +1 -0
- package/src/components/select/select.tsx +205 -0
- package/src/components/separator/index.ts +1 -0
- package/src/components/separator/separator.tsx +23 -0
- package/src/components/sheet/index.ts +1 -0
- package/src/components/sheet/sheet.tsx +137 -0
- package/src/components/sidebar/index.ts +1 -0
- package/src/components/sidebar/sidebar.tsx +722 -0
- package/src/components/skeleton/index.ts +1 -0
- package/src/components/skeleton/skeleton.tsx +13 -0
- package/src/components/slider/index.ts +1 -0
- package/src/components/slider/slider.tsx +52 -0
- package/src/components/sonner/index.ts +1 -0
- package/src/components/sonner/sonner.tsx +45 -0
- package/src/components/spinner/index.ts +1 -0
- package/src/components/spinner/spinner.tsx +15 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/switch/switch.tsx +30 -0
- package/src/components/table/index.ts +1 -0
- package/src/components/table/table.tsx +116 -0
- package/src/components/tabs/index.ts +1 -0
- package/src/components/tabs/tabs.tsx +80 -0
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/textarea.tsx +18 -0
- package/src/components/toggle/index.ts +1 -0
- package/src/components/toggle/toggle.tsx +45 -0
- package/src/components/toggle-group/index.ts +1 -0
- package/src/components/toggle-group/toggle-group.tsx +87 -0
- package/src/components/tooltip/index.ts +1 -0
- package/src/components/tooltip/tooltip.tsx +64 -0
- package/src/eslint/index.js +13 -0
- package/src/eslint/no-primitive-colors.js +158 -0
- package/src/hooks/use-mobile.ts +21 -0
- package/src/index.ts +58 -0
- package/src/lib/.gitkeep +0 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/globals.css +77 -0
- package/src/styles/nova-binding.css +290 -0
- package/src/styles/nova.css +58 -0
- package/src/styles/theme-nova.css +201 -0
- package/src/styles/typography.css +215 -0
- package/src/utils/index.ts +1 -0
- package/templates/component/component.tsx.hbs +16 -0
- package/templates/component/index.ts.hbs +1 -0
- package/templates/component/stories.tsx.hbs +13 -0
- package/tsconfig.json +18 -0
- package/tsconfig.lint.json +14 -0
- package/vite.config.ts +101 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu"
|
|
5
|
+
|
|
6
|
+
import { cn } from "../../lib/utils"
|
|
7
|
+
import { ChevronRightIcon, CheckIcon } from "lucide-react"
|
|
8
|
+
|
|
9
|
+
function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props) {
|
|
10
|
+
return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props) {
|
|
14
|
+
return (
|
|
15
|
+
<ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function ContextMenuTrigger({
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}: ContextMenuPrimitive.Trigger.Props) {
|
|
23
|
+
return (
|
|
24
|
+
<ContextMenuPrimitive.Trigger
|
|
25
|
+
data-slot="context-menu-trigger"
|
|
26
|
+
className={cn("select-none", className)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function ContextMenuContent({
|
|
33
|
+
className,
|
|
34
|
+
align = "start",
|
|
35
|
+
alignOffset = 4,
|
|
36
|
+
side = "inline-end",
|
|
37
|
+
sideOffset = 0,
|
|
38
|
+
...props
|
|
39
|
+
}: ContextMenuPrimitive.Popup.Props &
|
|
40
|
+
Pick<
|
|
41
|
+
ContextMenuPrimitive.Positioner.Props,
|
|
42
|
+
"align" | "alignOffset" | "side" | "sideOffset"
|
|
43
|
+
>) {
|
|
44
|
+
return (
|
|
45
|
+
<ContextMenuPrimitive.Portal>
|
|
46
|
+
<ContextMenuPrimitive.Positioner
|
|
47
|
+
className="isolate z-50 outline-none"
|
|
48
|
+
align={align}
|
|
49
|
+
alignOffset={alignOffset}
|
|
50
|
+
side={side}
|
|
51
|
+
sideOffset={sideOffset}
|
|
52
|
+
>
|
|
53
|
+
<ContextMenuPrimitive.Popup
|
|
54
|
+
data-slot="context-menu-content"
|
|
55
|
+
className={cn(
|
|
56
|
+
"z-50 max-h-(--available-height) min-w-48 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-2xl bg-popover p-1 text-popover-foreground shadow-2xl ring-1 ring-foreground/5 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
57
|
+
className
|
|
58
|
+
)}
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
</ContextMenuPrimitive.Positioner>
|
|
62
|
+
</ContextMenuPrimitive.Portal>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function ContextMenuGroup({ ...props }: ContextMenuPrimitive.Group.Props) {
|
|
67
|
+
return (
|
|
68
|
+
<ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function ContextMenuLabel({
|
|
73
|
+
className,
|
|
74
|
+
inset,
|
|
75
|
+
...props
|
|
76
|
+
}: ContextMenuPrimitive.GroupLabel.Props & {
|
|
77
|
+
inset?: boolean
|
|
78
|
+
}) {
|
|
79
|
+
return (
|
|
80
|
+
<ContextMenuPrimitive.GroupLabel
|
|
81
|
+
data-slot="context-menu-label"
|
|
82
|
+
data-inset={inset}
|
|
83
|
+
className={cn(
|
|
84
|
+
"px-3 py-2.5 text-xs text-muted-foreground data-inset:ps-9.5",
|
|
85
|
+
className
|
|
86
|
+
)}
|
|
87
|
+
{...props}
|
|
88
|
+
/>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function ContextMenuItem({
|
|
93
|
+
className,
|
|
94
|
+
inset,
|
|
95
|
+
variant = "default",
|
|
96
|
+
...props
|
|
97
|
+
}: ContextMenuPrimitive.Item.Props & {
|
|
98
|
+
inset?: boolean
|
|
99
|
+
variant?: "default" | "destructive"
|
|
100
|
+
}) {
|
|
101
|
+
return (
|
|
102
|
+
<ContextMenuPrimitive.Item
|
|
103
|
+
data-slot="context-menu-item"
|
|
104
|
+
data-inset={inset}
|
|
105
|
+
data-variant={variant}
|
|
106
|
+
className={cn(
|
|
107
|
+
"group/context-menu-item relative flex cursor-default items-center gap-2.5 rounded-xl px-3 py-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:ps-9.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",
|
|
108
|
+
className
|
|
109
|
+
)}
|
|
110
|
+
{...props}
|
|
111
|
+
/>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function ContextMenuSub({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props) {
|
|
116
|
+
return (
|
|
117
|
+
<ContextMenuPrimitive.SubmenuRoot data-slot="context-menu-sub" {...props} />
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function ContextMenuSubTrigger({
|
|
122
|
+
className,
|
|
123
|
+
inset,
|
|
124
|
+
children,
|
|
125
|
+
...props
|
|
126
|
+
}: ContextMenuPrimitive.SubmenuTrigger.Props & {
|
|
127
|
+
inset?: boolean
|
|
128
|
+
}) {
|
|
129
|
+
return (
|
|
130
|
+
<ContextMenuPrimitive.SubmenuTrigger
|
|
131
|
+
data-slot="context-menu-sub-trigger"
|
|
132
|
+
data-inset={inset}
|
|
133
|
+
className={cn(
|
|
134
|
+
"flex cursor-default items-center rounded-xl px-3 py-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:ps-9.5 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
135
|
+
className
|
|
136
|
+
)}
|
|
137
|
+
{...props}
|
|
138
|
+
>
|
|
139
|
+
{children}
|
|
140
|
+
<ChevronRightIcon className="ms-auto rtl:rotate-180" />
|
|
141
|
+
</ContextMenuPrimitive.SubmenuTrigger>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function ContextMenuSubContent({
|
|
146
|
+
...props
|
|
147
|
+
}: React.ComponentProps<typeof ContextMenuContent>) {
|
|
148
|
+
return (
|
|
149
|
+
<ContextMenuContent
|
|
150
|
+
data-slot="context-menu-sub-content"
|
|
151
|
+
className="shadow-lg"
|
|
152
|
+
side="inline-end"
|
|
153
|
+
{...props}
|
|
154
|
+
/>
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function ContextMenuCheckboxItem({
|
|
159
|
+
className,
|
|
160
|
+
children,
|
|
161
|
+
checked,
|
|
162
|
+
inset,
|
|
163
|
+
...props
|
|
164
|
+
}: ContextMenuPrimitive.CheckboxItem.Props & {
|
|
165
|
+
inset?: boolean
|
|
166
|
+
}) {
|
|
167
|
+
return (
|
|
168
|
+
<ContextMenuPrimitive.CheckboxItem
|
|
169
|
+
data-slot="context-menu-checkbox-item"
|
|
170
|
+
data-inset={inset}
|
|
171
|
+
className={cn(
|
|
172
|
+
"relative flex cursor-default items-center gap-2 rounded-xl py-2 ps-3 pe-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:ps-9.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
173
|
+
className
|
|
174
|
+
)}
|
|
175
|
+
checked={checked}
|
|
176
|
+
{...props}
|
|
177
|
+
>
|
|
178
|
+
<span className="pointer-events-none absolute end-2">
|
|
179
|
+
<ContextMenuPrimitive.CheckboxItemIndicator>
|
|
180
|
+
<CheckIcon />
|
|
181
|
+
</ContextMenuPrimitive.CheckboxItemIndicator>
|
|
182
|
+
</span>
|
|
183
|
+
{children}
|
|
184
|
+
</ContextMenuPrimitive.CheckboxItem>
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function ContextMenuRadioGroup({
|
|
189
|
+
...props
|
|
190
|
+
}: ContextMenuPrimitive.RadioGroup.Props) {
|
|
191
|
+
return (
|
|
192
|
+
<ContextMenuPrimitive.RadioGroup
|
|
193
|
+
data-slot="context-menu-radio-group"
|
|
194
|
+
{...props}
|
|
195
|
+
/>
|
|
196
|
+
)
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function ContextMenuRadioItem({
|
|
200
|
+
className,
|
|
201
|
+
children,
|
|
202
|
+
inset,
|
|
203
|
+
...props
|
|
204
|
+
}: ContextMenuPrimitive.RadioItem.Props & {
|
|
205
|
+
inset?: boolean
|
|
206
|
+
}) {
|
|
207
|
+
return (
|
|
208
|
+
<ContextMenuPrimitive.RadioItem
|
|
209
|
+
data-slot="context-menu-radio-item"
|
|
210
|
+
data-inset={inset}
|
|
211
|
+
className={cn(
|
|
212
|
+
"relative flex cursor-default items-center gap-2 rounded-xl py-2 ps-3 pe-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:ps-9.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
213
|
+
className
|
|
214
|
+
)}
|
|
215
|
+
{...props}
|
|
216
|
+
>
|
|
217
|
+
<span className="pointer-events-none absolute end-2">
|
|
218
|
+
<ContextMenuPrimitive.RadioItemIndicator>
|
|
219
|
+
<CheckIcon />
|
|
220
|
+
</ContextMenuPrimitive.RadioItemIndicator>
|
|
221
|
+
</span>
|
|
222
|
+
{children}
|
|
223
|
+
</ContextMenuPrimitive.RadioItem>
|
|
224
|
+
)
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function ContextMenuSeparator({
|
|
228
|
+
className,
|
|
229
|
+
...props
|
|
230
|
+
}: ContextMenuPrimitive.Separator.Props) {
|
|
231
|
+
return (
|
|
232
|
+
<ContextMenuPrimitive.Separator
|
|
233
|
+
data-slot="context-menu-separator"
|
|
234
|
+
className={cn("-mx-1 my-1 h-px bg-border/50", className)}
|
|
235
|
+
{...props}
|
|
236
|
+
/>
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function ContextMenuShortcut({
|
|
241
|
+
className,
|
|
242
|
+
...props
|
|
243
|
+
}: React.ComponentProps<"span">) {
|
|
244
|
+
return (
|
|
245
|
+
<span
|
|
246
|
+
data-slot="context-menu-shortcut"
|
|
247
|
+
className={cn(
|
|
248
|
+
"ms-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground",
|
|
249
|
+
className
|
|
250
|
+
)}
|
|
251
|
+
{...props}
|
|
252
|
+
/>
|
|
253
|
+
)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export {
|
|
257
|
+
ContextMenu,
|
|
258
|
+
ContextMenuTrigger,
|
|
259
|
+
ContextMenuContent,
|
|
260
|
+
ContextMenuItem,
|
|
261
|
+
ContextMenuCheckboxItem,
|
|
262
|
+
ContextMenuRadioItem,
|
|
263
|
+
ContextMenuLabel,
|
|
264
|
+
ContextMenuSeparator,
|
|
265
|
+
ContextMenuShortcut,
|
|
266
|
+
ContextMenuGroup,
|
|
267
|
+
ContextMenuPortal,
|
|
268
|
+
ContextMenuSub,
|
|
269
|
+
ContextMenuSubContent,
|
|
270
|
+
ContextMenuSubTrigger,
|
|
271
|
+
ContextMenuRadioGroup,
|
|
272
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./context-menu"
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog"
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../lib/utils"
|
|
5
|
+
import { Button } from "../button"
|
|
6
|
+
import { XIcon } from "lucide-react"
|
|
7
|
+
|
|
8
|
+
function Dialog({ ...props }: DialogPrimitive.Root.Props) {
|
|
9
|
+
return <DialogPrimitive.Root data-slot="dialog" {...props} />
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
|
|
13
|
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
|
|
17
|
+
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
|
|
21
|
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function DialogOverlay({
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: DialogPrimitive.Backdrop.Props) {
|
|
28
|
+
return (
|
|
29
|
+
<DialogPrimitive.Backdrop
|
|
30
|
+
data-slot="dialog-overlay"
|
|
31
|
+
className={cn(
|
|
32
|
+
"fixed inset-0 isolate z-50 bg-nova-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function DialogContent({
|
|
41
|
+
className,
|
|
42
|
+
children,
|
|
43
|
+
showCloseButton = true,
|
|
44
|
+
...props
|
|
45
|
+
}: DialogPrimitive.Popup.Props & {
|
|
46
|
+
showCloseButton?: boolean
|
|
47
|
+
}) {
|
|
48
|
+
return (
|
|
49
|
+
<DialogPortal>
|
|
50
|
+
<DialogOverlay />
|
|
51
|
+
<DialogPrimitive.Popup
|
|
52
|
+
data-slot="dialog-content"
|
|
53
|
+
className={cn(
|
|
54
|
+
"fixed start-1/2 top-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-4xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/5 duration-100 outline-none sm:max-w-md rtl:translate-x-1/2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
55
|
+
className
|
|
56
|
+
)}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
{children}
|
|
60
|
+
{showCloseButton && (
|
|
61
|
+
<DialogPrimitive.Close
|
|
62
|
+
data-slot="dialog-close"
|
|
63
|
+
render={
|
|
64
|
+
<Button
|
|
65
|
+
variant="ghost"
|
|
66
|
+
className="absolute end-4 top-4"
|
|
67
|
+
size="icon-sm"
|
|
68
|
+
/>
|
|
69
|
+
}
|
|
70
|
+
>
|
|
71
|
+
<XIcon />
|
|
72
|
+
<span className="sr-only">Close</span>
|
|
73
|
+
</DialogPrimitive.Close>
|
|
74
|
+
)}
|
|
75
|
+
</DialogPrimitive.Popup>
|
|
76
|
+
</DialogPortal>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
81
|
+
return (
|
|
82
|
+
<div
|
|
83
|
+
data-slot="dialog-header"
|
|
84
|
+
className={cn("flex flex-col gap-2", className)}
|
|
85
|
+
{...props}
|
|
86
|
+
/>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function DialogFooter({
|
|
91
|
+
className,
|
|
92
|
+
showCloseButton = false,
|
|
93
|
+
children,
|
|
94
|
+
...props
|
|
95
|
+
}: React.ComponentProps<"div"> & {
|
|
96
|
+
showCloseButton?: boolean
|
|
97
|
+
}) {
|
|
98
|
+
return (
|
|
99
|
+
<div
|
|
100
|
+
data-slot="dialog-footer"
|
|
101
|
+
className={cn(
|
|
102
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
103
|
+
className
|
|
104
|
+
)}
|
|
105
|
+
{...props}
|
|
106
|
+
>
|
|
107
|
+
{children}
|
|
108
|
+
{showCloseButton && (
|
|
109
|
+
<DialogPrimitive.Close render={<Button variant="outline" />}>
|
|
110
|
+
Close
|
|
111
|
+
</DialogPrimitive.Close>
|
|
112
|
+
)}
|
|
113
|
+
</div>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
|
|
118
|
+
return (
|
|
119
|
+
<DialogPrimitive.Title
|
|
120
|
+
data-slot="dialog-title"
|
|
121
|
+
className={cn(
|
|
122
|
+
"font-heading text-base leading-none font-medium",
|
|
123
|
+
className
|
|
124
|
+
)}
|
|
125
|
+
{...props}
|
|
126
|
+
/>
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function DialogDescription({
|
|
131
|
+
className,
|
|
132
|
+
...props
|
|
133
|
+
}: DialogPrimitive.Description.Props) {
|
|
134
|
+
return (
|
|
135
|
+
<DialogPrimitive.Description
|
|
136
|
+
data-slot="dialog-description"
|
|
137
|
+
className={cn(
|
|
138
|
+
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
139
|
+
className
|
|
140
|
+
)}
|
|
141
|
+
{...props}
|
|
142
|
+
/>
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export {
|
|
147
|
+
Dialog,
|
|
148
|
+
DialogClose,
|
|
149
|
+
DialogContent,
|
|
150
|
+
DialogDescription,
|
|
151
|
+
DialogFooter,
|
|
152
|
+
DialogHeader,
|
|
153
|
+
DialogOverlay,
|
|
154
|
+
DialogPortal,
|
|
155
|
+
DialogTitle,
|
|
156
|
+
DialogTrigger,
|
|
157
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dialog"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./direction"
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Drawer as DrawerPrimitive } from "vaul"
|
|
5
|
+
|
|
6
|
+
import { cn } from "../../lib/utils"
|
|
7
|
+
|
|
8
|
+
function Drawer({
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof DrawerPrimitive.Root>) {
|
|
11
|
+
return <DrawerPrimitive.Root data-slot="drawer" {...props} />
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function DrawerTrigger({
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
|
|
17
|
+
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function DrawerPortal({
|
|
21
|
+
...props
|
|
22
|
+
}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
|
|
23
|
+
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function DrawerClose({
|
|
27
|
+
...props
|
|
28
|
+
}: React.ComponentProps<typeof DrawerPrimitive.Close>) {
|
|
29
|
+
return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function DrawerOverlay({
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {
|
|
36
|
+
return (
|
|
37
|
+
<DrawerPrimitive.Overlay
|
|
38
|
+
data-slot="drawer-overlay"
|
|
39
|
+
className={cn(
|
|
40
|
+
"fixed inset-0 z-50 bg-nova-black/80 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
41
|
+
className
|
|
42
|
+
)}
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function DrawerContent({
|
|
49
|
+
className,
|
|
50
|
+
children,
|
|
51
|
+
...props
|
|
52
|
+
}: React.ComponentProps<typeof DrawerPrimitive.Content>) {
|
|
53
|
+
return (
|
|
54
|
+
<DrawerPortal data-slot="drawer-portal">
|
|
55
|
+
<DrawerOverlay />
|
|
56
|
+
<DrawerPrimitive.Content
|
|
57
|
+
data-slot="drawer-content"
|
|
58
|
+
className={cn(
|
|
59
|
+
"group/drawer-content fixed z-50 flex h-auto flex-col bg-transparent p-4 text-sm text-popover-foreground before:absolute before:inset-2 before:-z-10 before:rounded-4xl before:border before:border-border before:bg-popover data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:start-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:end-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
60
|
+
className
|
|
61
|
+
)}
|
|
62
|
+
{...props}
|
|
63
|
+
>
|
|
64
|
+
<div className="mx-auto mt-4 hidden h-1.5 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" />
|
|
65
|
+
{children}
|
|
66
|
+
</DrawerPrimitive.Content>
|
|
67
|
+
</DrawerPortal>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
72
|
+
return (
|
|
73
|
+
<div
|
|
74
|
+
data-slot="drawer-header"
|
|
75
|
+
className={cn(
|
|
76
|
+
"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-start",
|
|
77
|
+
className
|
|
78
|
+
)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
85
|
+
return (
|
|
86
|
+
<div
|
|
87
|
+
data-slot="drawer-footer"
|
|
88
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
89
|
+
{...props}
|
|
90
|
+
/>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function DrawerTitle({
|
|
95
|
+
className,
|
|
96
|
+
...props
|
|
97
|
+
}: React.ComponentProps<typeof DrawerPrimitive.Title>) {
|
|
98
|
+
return (
|
|
99
|
+
<DrawerPrimitive.Title
|
|
100
|
+
data-slot="drawer-title"
|
|
101
|
+
className={cn(
|
|
102
|
+
"font-heading text-base font-medium text-foreground",
|
|
103
|
+
className
|
|
104
|
+
)}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function DrawerDescription({
|
|
111
|
+
className,
|
|
112
|
+
...props
|
|
113
|
+
}: React.ComponentProps<typeof DrawerPrimitive.Description>) {
|
|
114
|
+
return (
|
|
115
|
+
<DrawerPrimitive.Description
|
|
116
|
+
data-slot="drawer-description"
|
|
117
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
118
|
+
{...props}
|
|
119
|
+
/>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export {
|
|
124
|
+
Drawer,
|
|
125
|
+
DrawerPortal,
|
|
126
|
+
DrawerOverlay,
|
|
127
|
+
DrawerTrigger,
|
|
128
|
+
DrawerClose,
|
|
129
|
+
DrawerContent,
|
|
130
|
+
DrawerHeader,
|
|
131
|
+
DrawerFooter,
|
|
132
|
+
DrawerTitle,
|
|
133
|
+
DrawerDescription,
|
|
134
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./drawer"
|