modula-ui 1.0.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 +36 -0
- package/bin/run.js +86 -0
- package/package.json +71 -0
- package/public/avatars/avatar1.png +0 -0
- package/public/avatars/avatar2.png +0 -0
- package/public/avatars/avatar3.png +0 -0
- package/public/avatars/avatar4.png +0 -0
- package/public/avatars/sources.md +34 -0
- package/public/file.svg +1 -0
- package/public/globe.svg +1 -0
- package/public/next.svg +1 -0
- package/public/vercel.svg +1 -0
- package/public/window.svg +1 -0
- package/registry.json +12 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +126 -0
- package/src/app/layout.js +29 -0
- package/src/app/page.js +50 -0
- package/src/app/patterns/page.js +50 -0
- package/src/components/CodeCard.jsx +16 -0
- package/src/components/CopyButton.jsx +31 -0
- package/src/components/Header.jsx +24 -0
- package/src/components/Logo.jsx +64 -0
- package/src/components/MobileOverlay.jsx +10 -0
- package/src/components/PreviewCard.jsx +98 -0
- package/src/components/Sidebar.jsx +47 -0
- package/src/components/ui/avatar.jsx +47 -0
- package/src/components/ui/badge.jsx +44 -0
- package/src/components/ui/button.jsx +56 -0
- package/src/components/ui/calendar.jsx +178 -0
- package/src/components/ui/card.jsx +101 -0
- package/src/components/ui/chart.jsx +314 -0
- package/src/components/ui/checkbox.jsx +30 -0
- package/src/components/ui/dropdown-menu.jsx +223 -0
- package/src/components/ui/input.jsx +24 -0
- package/src/components/ui/navigation-menu.jsx +152 -0
- package/src/components/ui/popover.jsx +47 -0
- package/src/components/ui/progress.jsx +29 -0
- package/src/components/ui/scroll-area.jsx +51 -0
- package/src/components/ui/select.jsx +168 -0
- package/src/components/ui/separator.jsx +27 -0
- package/src/components/ui/sheet.jsx +140 -0
- package/src/components/ui/sidebar.jsx +682 -0
- package/src/components/ui/skeleton.jsx +15 -0
- package/src/components/ui/slider.jsx +56 -0
- package/src/components/ui/tooltip.jsx +55 -0
- package/src/data/componentData.js +12 -0
- package/src/hooks/use-mobile.js +19 -0
- package/src/lib/utils.js +6 -0
- package/src/library/components/Alert.jsx +27 -0
- package/src/library/components/Badge.jsx +19 -0
- package/src/library/components/Button.jsx +31 -0
- package/src/library/components/Card.jsx +25 -0
- package/src/library/components/Input.jsx +35 -0
- package/src/library/components/Modal.jsx +26 -0
- package/src/library/components/Textarea.jsx +15 -0
- package/src/library/components/Toggle.jsx +16 -0
- package/src/library/pages/FitnessPage/FitnessPage.jsx +519 -0
- package/src/library/pages/FitnessPage/index.jsx +12 -0
- package/src/library/pages/GroupChat/GroupChat.jsx +275 -0
- package/src/library/pages/GroupChat/data.js +203 -0
- package/src/library/pages/GroupChat/index.jsx +12 -0
- package/src/library/pages/ReservationsOverview/ReservationsOverviewPage.jsx +225 -0
- package/src/library/pages/ReservationsOverview/index.jsx +12 -0
- package/src/library/pages/VideoConference/VideoConferencePage.jsx +334 -0
- package/src/library/pages/VideoConference/index.jsx +12 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
|
|
3
|
+
import { cva } from "class-variance-authority"
|
|
4
|
+
import { ChevronDownIcon } from "lucide-react"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
function NavigationMenu({
|
|
9
|
+
className,
|
|
10
|
+
children,
|
|
11
|
+
viewport = true,
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
return (
|
|
15
|
+
<NavigationMenuPrimitive.Root
|
|
16
|
+
data-slot="navigation-menu"
|
|
17
|
+
data-viewport={viewport}
|
|
18
|
+
className={cn(
|
|
19
|
+
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
{...props}>
|
|
23
|
+
{children}
|
|
24
|
+
{viewport && <NavigationMenuViewport />}
|
|
25
|
+
</NavigationMenuPrimitive.Root>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function NavigationMenuList({
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}) {
|
|
33
|
+
return (
|
|
34
|
+
<NavigationMenuPrimitive.List
|
|
35
|
+
data-slot="navigation-menu-list"
|
|
36
|
+
className={cn("group flex flex-1 list-none items-center justify-center gap-1", className)}
|
|
37
|
+
{...props} />
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function NavigationMenuItem({
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}) {
|
|
45
|
+
return (
|
|
46
|
+
<NavigationMenuPrimitive.Item
|
|
47
|
+
data-slot="navigation-menu-item"
|
|
48
|
+
className={cn("relative", className)}
|
|
49
|
+
{...props} />
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const navigationMenuTriggerStyle = cva(
|
|
54
|
+
"group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1"
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
function NavigationMenuTrigger({
|
|
58
|
+
className,
|
|
59
|
+
children,
|
|
60
|
+
...props
|
|
61
|
+
}) {
|
|
62
|
+
return (
|
|
63
|
+
<NavigationMenuPrimitive.Trigger
|
|
64
|
+
data-slot="navigation-menu-trigger"
|
|
65
|
+
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
|
66
|
+
{...props}>
|
|
67
|
+
{children}{" "}
|
|
68
|
+
<ChevronDownIcon
|
|
69
|
+
className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
|
|
70
|
+
aria-hidden="true" />
|
|
71
|
+
</NavigationMenuPrimitive.Trigger>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function NavigationMenuContent({
|
|
76
|
+
className,
|
|
77
|
+
...props
|
|
78
|
+
}) {
|
|
79
|
+
return (
|
|
80
|
+
<NavigationMenuPrimitive.Content
|
|
81
|
+
data-slot="navigation-menu-content"
|
|
82
|
+
className={cn(
|
|
83
|
+
"data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto",
|
|
84
|
+
"group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",
|
|
85
|
+
className
|
|
86
|
+
)}
|
|
87
|
+
{...props} />
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function NavigationMenuViewport({
|
|
92
|
+
className,
|
|
93
|
+
...props
|
|
94
|
+
}) {
|
|
95
|
+
return (
|
|
96
|
+
<div
|
|
97
|
+
className={cn("absolute top-full left-0 isolate z-50 flex justify-center")}>
|
|
98
|
+
<NavigationMenuPrimitive.Viewport
|
|
99
|
+
data-slot="navigation-menu-viewport"
|
|
100
|
+
className={cn(
|
|
101
|
+
"origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
102
|
+
className
|
|
103
|
+
)}
|
|
104
|
+
{...props} />
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function NavigationMenuLink({
|
|
110
|
+
className,
|
|
111
|
+
...props
|
|
112
|
+
}) {
|
|
113
|
+
return (
|
|
114
|
+
<NavigationMenuPrimitive.Link
|
|
115
|
+
data-slot="navigation-menu-link"
|
|
116
|
+
className={cn(
|
|
117
|
+
"data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
|
|
118
|
+
className
|
|
119
|
+
)}
|
|
120
|
+
{...props} />
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function NavigationMenuIndicator({
|
|
125
|
+
className,
|
|
126
|
+
...props
|
|
127
|
+
}) {
|
|
128
|
+
return (
|
|
129
|
+
<NavigationMenuPrimitive.Indicator
|
|
130
|
+
data-slot="navigation-menu-indicator"
|
|
131
|
+
className={cn(
|
|
132
|
+
"data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",
|
|
133
|
+
className
|
|
134
|
+
)}
|
|
135
|
+
{...props}>
|
|
136
|
+
<div
|
|
137
|
+
className="bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" />
|
|
138
|
+
</NavigationMenuPrimitive.Indicator>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export {
|
|
143
|
+
NavigationMenu,
|
|
144
|
+
NavigationMenuList,
|
|
145
|
+
NavigationMenuItem,
|
|
146
|
+
NavigationMenuContent,
|
|
147
|
+
NavigationMenuTrigger,
|
|
148
|
+
NavigationMenuLink,
|
|
149
|
+
NavigationMenuIndicator,
|
|
150
|
+
NavigationMenuViewport,
|
|
151
|
+
navigationMenuTriggerStyle,
|
|
152
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
function Popover({
|
|
9
|
+
...props
|
|
10
|
+
}) {
|
|
11
|
+
return <PopoverPrimitive.Root data-slot="popover" {...props} />;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function PopoverTrigger({
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function PopoverContent({
|
|
21
|
+
className,
|
|
22
|
+
align = "center",
|
|
23
|
+
sideOffset = 4,
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
return (
|
|
27
|
+
<PopoverPrimitive.Portal>
|
|
28
|
+
<PopoverPrimitive.Content
|
|
29
|
+
data-slot="popover-content"
|
|
30
|
+
align={align}
|
|
31
|
+
sideOffset={sideOffset}
|
|
32
|
+
className={cn(
|
|
33
|
+
"bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
34
|
+
className
|
|
35
|
+
)}
|
|
36
|
+
{...props} />
|
|
37
|
+
</PopoverPrimitive.Portal>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function PopoverAnchor({
|
|
42
|
+
...props
|
|
43
|
+
}) {
|
|
44
|
+
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
function Progress({
|
|
9
|
+
className,
|
|
10
|
+
value,
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return (
|
|
14
|
+
<ProgressPrimitive.Root
|
|
15
|
+
data-slot="progress"
|
|
16
|
+
className={cn(
|
|
17
|
+
"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}>
|
|
21
|
+
<ProgressPrimitive.Indicator
|
|
22
|
+
data-slot="progress-indicator"
|
|
23
|
+
className="bg-primary h-full w-full flex-1 transition-all"
|
|
24
|
+
style={{ transform: `translateX(-${100 - (value || 0)}%)` }} />
|
|
25
|
+
</ProgressPrimitive.Root>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { Progress }
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
function ScrollArea({
|
|
9
|
+
className,
|
|
10
|
+
children,
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return (
|
|
14
|
+
<ScrollAreaPrimitive.Root data-slot="scroll-area" className={cn("relative", className)} {...props}>
|
|
15
|
+
<ScrollAreaPrimitive.Viewport
|
|
16
|
+
data-slot="scroll-area-viewport"
|
|
17
|
+
className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1">
|
|
18
|
+
{children}
|
|
19
|
+
</ScrollAreaPrimitive.Viewport>
|
|
20
|
+
<ScrollBar />
|
|
21
|
+
<ScrollAreaPrimitive.Corner />
|
|
22
|
+
</ScrollAreaPrimitive.Root>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function ScrollBar({
|
|
27
|
+
className,
|
|
28
|
+
orientation = "vertical",
|
|
29
|
+
...props
|
|
30
|
+
}) {
|
|
31
|
+
return (
|
|
32
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
33
|
+
data-slot="scroll-area-scrollbar"
|
|
34
|
+
orientation={orientation}
|
|
35
|
+
className={cn(
|
|
36
|
+
"flex touch-none p-px transition-colors select-none",
|
|
37
|
+
orientation === "vertical" &&
|
|
38
|
+
"h-full w-2.5 border-l border-l-transparent",
|
|
39
|
+
orientation === "horizontal" &&
|
|
40
|
+
"h-2.5 flex-col border-t border-t-transparent",
|
|
41
|
+
className
|
|
42
|
+
)}
|
|
43
|
+
{...props}>
|
|
44
|
+
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
45
|
+
data-slot="scroll-area-thumb"
|
|
46
|
+
className="bg-border relative flex-1 rounded-full" />
|
|
47
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { ScrollArea, ScrollBar }
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
5
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
|
|
9
|
+
function Select({
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function SelectGroup({
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return <SelectPrimitive.Group data-slot="select-group" {...props} />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function SelectValue({
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function SelectTrigger({
|
|
28
|
+
className,
|
|
29
|
+
size = "default",
|
|
30
|
+
children,
|
|
31
|
+
...props
|
|
32
|
+
}) {
|
|
33
|
+
return (
|
|
34
|
+
<SelectPrimitive.Trigger
|
|
35
|
+
data-slot="select-trigger"
|
|
36
|
+
data-size={size}
|
|
37
|
+
className={cn(
|
|
38
|
+
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground 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:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
39
|
+
className
|
|
40
|
+
)}
|
|
41
|
+
{...props}>
|
|
42
|
+
{children}
|
|
43
|
+
<SelectPrimitive.Icon asChild>
|
|
44
|
+
<ChevronDownIcon className="size-4 opacity-50" />
|
|
45
|
+
</SelectPrimitive.Icon>
|
|
46
|
+
</SelectPrimitive.Trigger>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function SelectContent({
|
|
51
|
+
className,
|
|
52
|
+
children,
|
|
53
|
+
position = "popper",
|
|
54
|
+
align = "center",
|
|
55
|
+
...props
|
|
56
|
+
}) {
|
|
57
|
+
return (
|
|
58
|
+
<SelectPrimitive.Portal>
|
|
59
|
+
<SelectPrimitive.Content
|
|
60
|
+
data-slot="select-content"
|
|
61
|
+
className={cn(
|
|
62
|
+
"bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
63
|
+
position === "popper" &&
|
|
64
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
65
|
+
className
|
|
66
|
+
)}
|
|
67
|
+
position={position}
|
|
68
|
+
align={align}
|
|
69
|
+
{...props}>
|
|
70
|
+
<SelectScrollUpButton />
|
|
71
|
+
<SelectPrimitive.Viewport
|
|
72
|
+
className={cn("p-1", position === "popper" &&
|
|
73
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1")}>
|
|
74
|
+
{children}
|
|
75
|
+
</SelectPrimitive.Viewport>
|
|
76
|
+
<SelectScrollDownButton />
|
|
77
|
+
</SelectPrimitive.Content>
|
|
78
|
+
</SelectPrimitive.Portal>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function SelectLabel({
|
|
83
|
+
className,
|
|
84
|
+
...props
|
|
85
|
+
}) {
|
|
86
|
+
return (
|
|
87
|
+
<SelectPrimitive.Label
|
|
88
|
+
data-slot="select-label"
|
|
89
|
+
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
|
|
90
|
+
{...props} />
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function SelectItem({
|
|
95
|
+
className,
|
|
96
|
+
children,
|
|
97
|
+
...props
|
|
98
|
+
}) {
|
|
99
|
+
return (
|
|
100
|
+
<SelectPrimitive.Item
|
|
101
|
+
data-slot="select-item"
|
|
102
|
+
className={cn(
|
|
103
|
+
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
104
|
+
className
|
|
105
|
+
)}
|
|
106
|
+
{...props}>
|
|
107
|
+
<span className="absolute right-2 flex size-3.5 items-center justify-center">
|
|
108
|
+
<SelectPrimitive.ItemIndicator>
|
|
109
|
+
<CheckIcon className="size-4" />
|
|
110
|
+
</SelectPrimitive.ItemIndicator>
|
|
111
|
+
</span>
|
|
112
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
113
|
+
</SelectPrimitive.Item>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function SelectSeparator({
|
|
118
|
+
className,
|
|
119
|
+
...props
|
|
120
|
+
}) {
|
|
121
|
+
return (
|
|
122
|
+
<SelectPrimitive.Separator
|
|
123
|
+
data-slot="select-separator"
|
|
124
|
+
className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
|
|
125
|
+
{...props} />
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function SelectScrollUpButton({
|
|
130
|
+
className,
|
|
131
|
+
...props
|
|
132
|
+
}) {
|
|
133
|
+
return (
|
|
134
|
+
<SelectPrimitive.ScrollUpButton
|
|
135
|
+
data-slot="select-scroll-up-button"
|
|
136
|
+
className={cn("flex cursor-default items-center justify-center py-1", className)}
|
|
137
|
+
{...props}>
|
|
138
|
+
<ChevronUpIcon className="size-4" />
|
|
139
|
+
</SelectPrimitive.ScrollUpButton>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function SelectScrollDownButton({
|
|
144
|
+
className,
|
|
145
|
+
...props
|
|
146
|
+
}) {
|
|
147
|
+
return (
|
|
148
|
+
<SelectPrimitive.ScrollDownButton
|
|
149
|
+
data-slot="select-scroll-down-button"
|
|
150
|
+
className={cn("flex cursor-default items-center justify-center py-1", className)}
|
|
151
|
+
{...props}>
|
|
152
|
+
<ChevronDownIcon className="size-4" />
|
|
153
|
+
</SelectPrimitive.ScrollDownButton>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export {
|
|
158
|
+
Select,
|
|
159
|
+
SelectContent,
|
|
160
|
+
SelectGroup,
|
|
161
|
+
SelectItem,
|
|
162
|
+
SelectLabel,
|
|
163
|
+
SelectScrollDownButton,
|
|
164
|
+
SelectScrollUpButton,
|
|
165
|
+
SelectSeparator,
|
|
166
|
+
SelectTrigger,
|
|
167
|
+
SelectValue,
|
|
168
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
function Separator({
|
|
9
|
+
className,
|
|
10
|
+
orientation = "horizontal",
|
|
11
|
+
decorative = true,
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
return (
|
|
15
|
+
<SeparatorPrimitive.Root
|
|
16
|
+
data-slot="separator"
|
|
17
|
+
decorative={decorative}
|
|
18
|
+
orientation={orientation}
|
|
19
|
+
className={cn(
|
|
20
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props} />
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { Separator }
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog"
|
|
5
|
+
import { XIcon } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
|
|
9
|
+
function Sheet({
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function SheetTrigger({
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function SheetClose({
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function SheetPortal({
|
|
28
|
+
...props
|
|
29
|
+
}) {
|
|
30
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function SheetOverlay({
|
|
34
|
+
className,
|
|
35
|
+
...props
|
|
36
|
+
}) {
|
|
37
|
+
return (
|
|
38
|
+
<SheetPrimitive.Overlay
|
|
39
|
+
data-slot="sheet-overlay"
|
|
40
|
+
className={cn(
|
|
41
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
42
|
+
className
|
|
43
|
+
)}
|
|
44
|
+
{...props} />
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function SheetContent({
|
|
49
|
+
className,
|
|
50
|
+
children,
|
|
51
|
+
side = "right",
|
|
52
|
+
...props
|
|
53
|
+
}) {
|
|
54
|
+
return (
|
|
55
|
+
<SheetPortal>
|
|
56
|
+
<SheetOverlay />
|
|
57
|
+
<SheetPrimitive.Content
|
|
58
|
+
data-slot="sheet-content"
|
|
59
|
+
className={cn(
|
|
60
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
61
|
+
side === "right" &&
|
|
62
|
+
"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
|
63
|
+
side === "left" &&
|
|
64
|
+
"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
65
|
+
side === "top" &&
|
|
66
|
+
"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
67
|
+
side === "bottom" &&
|
|
68
|
+
"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
69
|
+
className
|
|
70
|
+
)}
|
|
71
|
+
{...props}>
|
|
72
|
+
{children}
|
|
73
|
+
<SheetPrimitive.Close
|
|
74
|
+
className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
|
|
75
|
+
<XIcon className="size-4" />
|
|
76
|
+
<span className="sr-only">Close</span>
|
|
77
|
+
</SheetPrimitive.Close>
|
|
78
|
+
</SheetPrimitive.Content>
|
|
79
|
+
</SheetPortal>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function SheetHeader({
|
|
84
|
+
className,
|
|
85
|
+
...props
|
|
86
|
+
}) {
|
|
87
|
+
return (
|
|
88
|
+
<div
|
|
89
|
+
data-slot="sheet-header"
|
|
90
|
+
className={cn("flex flex-col gap-1.5 p-4", className)}
|
|
91
|
+
{...props} />
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function SheetFooter({
|
|
96
|
+
className,
|
|
97
|
+
...props
|
|
98
|
+
}) {
|
|
99
|
+
return (
|
|
100
|
+
<div
|
|
101
|
+
data-slot="sheet-footer"
|
|
102
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
103
|
+
{...props} />
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function SheetTitle({
|
|
108
|
+
className,
|
|
109
|
+
...props
|
|
110
|
+
}) {
|
|
111
|
+
return (
|
|
112
|
+
<SheetPrimitive.Title
|
|
113
|
+
data-slot="sheet-title"
|
|
114
|
+
className={cn("text-foreground font-semibold", className)}
|
|
115
|
+
{...props} />
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function SheetDescription({
|
|
120
|
+
className,
|
|
121
|
+
...props
|
|
122
|
+
}) {
|
|
123
|
+
return (
|
|
124
|
+
<SheetPrimitive.Description
|
|
125
|
+
data-slot="sheet-description"
|
|
126
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
127
|
+
{...props} />
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export {
|
|
132
|
+
Sheet,
|
|
133
|
+
SheetTrigger,
|
|
134
|
+
SheetClose,
|
|
135
|
+
SheetContent,
|
|
136
|
+
SheetHeader,
|
|
137
|
+
SheetFooter,
|
|
138
|
+
SheetTitle,
|
|
139
|
+
SheetDescription,
|
|
140
|
+
}
|