create-bdpamke-react-scaffold 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/LICENSE +21 -0
- package/README.md +62 -0
- package/bin/create-bdpamke-react-scaffold.js +101 -0
- package/package.json +39 -0
- package/template/.env.example +6 -0
- package/template/FUNCTIONS_EXAMPLES.md +480 -0
- package/template/HOWTOadd a page.md +166 -0
- package/template/REACT_PROPS_USEEFFECT.md +210 -0
- package/template/REGISTRATION_FLOW.md +268 -0
- package/template/USESTATE_EXAMPLES.md +451 -0
- package/template/components.json +20 -0
- package/template/index.html +13 -0
- package/template/jsconfig.json +19 -0
- package/template/package-lock.json +5988 -0
- package/template/package.json +73 -0
- package/template/postcss.config.cjs +6 -0
- package/template/public/images/BDPA_edited.png +0 -0
- package/template/server/server.js +86 -0
- package/template/server/utils/apiClient.js +59 -0
- package/template/server/utils/password.js +60 -0
- package/template/src/App.jsx +10 -0
- package/template/src/components/layout/Container.jsx +7 -0
- package/template/src/components/layout/Section.jsx +7 -0
- package/template/src/components/ui/accordion.jsx +41 -0
- package/template/src/components/ui/alert-dialog.jsx +99 -0
- package/template/src/components/ui/alert.jsx +47 -0
- package/template/src/components/ui/aspect-ratio.jsx +5 -0
- package/template/src/components/ui/avatar.jsx +35 -0
- package/template/src/components/ui/badge.jsx +34 -0
- package/template/src/components/ui/button.jsx +47 -0
- package/template/src/components/ui/calendar.jsx +173 -0
- package/template/src/components/ui/card.jsx +50 -0
- package/template/src/components/ui/carousel.jsx +194 -0
- package/template/src/components/ui/checkbox.jsx +22 -0
- package/template/src/components/ui/collapsible.jsx +11 -0
- package/template/src/components/ui/command.jsx +116 -0
- package/template/src/components/ui/dialog.jsx +94 -0
- package/template/src/components/ui/drawer.jsx +92 -0
- package/template/src/components/ui/dropdown-menu.jsx +155 -0
- package/template/src/components/ui/form.jsx +138 -0
- package/template/src/components/ui/hover-card.jsx +25 -0
- package/template/src/components/ui/icons.jsx +81 -0
- package/template/src/components/ui/input.jsx +19 -0
- package/template/src/components/ui/label.jsx +16 -0
- package/template/src/components/ui/menubar.jsx +200 -0
- package/template/src/components/ui/navigation-menu.jsx +104 -0
- package/template/src/components/ui/popover.jsx +25 -0
- package/template/src/components/ui/progress.jsx +20 -0
- package/template/src/components/ui/radio-group.jsx +29 -0
- package/template/src/components/ui/scroll-area.jsx +40 -0
- package/template/src/components/ui/select.jsx +120 -0
- package/template/src/components/ui/separator.jsx +25 -0
- package/template/src/components/ui/sheet.jsx +108 -0
- package/template/src/components/ui/skeleton.jsx +10 -0
- package/template/src/components/ui/slider.jsx +23 -0
- package/template/src/components/ui/sonner.jsx +42 -0
- package/template/src/components/ui/switch.jsx +24 -0
- package/template/src/components/ui/table.jsx +83 -0
- package/template/src/components/ui/tabs.jsx +41 -0
- package/template/src/components/ui/textarea.jsx +18 -0
- package/template/src/components/ui/toast.jsx +82 -0
- package/template/src/components/ui/toaster.jsx +33 -0
- package/template/src/components/ui/toggle.jsx +40 -0
- package/template/src/components/ui/tooltip.jsx +24 -0
- package/template/src/hooks/use-toast.js +155 -0
- package/template/src/index.css +61 -0
- package/template/src/index.js +6 -0
- package/template/src/lib/utils.js +11 -0
- package/template/src/main.jsx +15 -0
- package/template/src/pages/Home.jsx +26 -0
- package/template/tailwind.config.cjs +76 -0
- package/template/vite.config.mts +22 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar"
|
|
5
|
+
import { Check, ChevronRight, Circle } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
|
|
9
|
+
function MenubarMenu({
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return <MenubarPrimitive.Menu {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function MenubarGroup({
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return <MenubarPrimitive.Group {...props} />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function MenubarPortal({
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return <MenubarPrimitive.Portal {...props} />;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function MenubarRadioGroup({
|
|
28
|
+
...props
|
|
29
|
+
}) {
|
|
30
|
+
return <MenubarPrimitive.RadioGroup {...props} />;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function MenubarSub({
|
|
34
|
+
...props
|
|
35
|
+
}) {
|
|
36
|
+
return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const Menubar = React.forwardRef(({ className, ...props }, ref) => (
|
|
40
|
+
<MenubarPrimitive.Root
|
|
41
|
+
ref={ref}
|
|
42
|
+
className={cn(
|
|
43
|
+
"flex h-10 items-center space-x-1 rounded-md border bg-background p-1",
|
|
44
|
+
className
|
|
45
|
+
)}
|
|
46
|
+
{...props} />
|
|
47
|
+
))
|
|
48
|
+
Menubar.displayName = MenubarPrimitive.Root.displayName
|
|
49
|
+
|
|
50
|
+
const MenubarTrigger = React.forwardRef(({ className, ...props }, ref) => (
|
|
51
|
+
<MenubarPrimitive.Trigger
|
|
52
|
+
ref={ref}
|
|
53
|
+
className={cn(
|
|
54
|
+
"flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
55
|
+
className
|
|
56
|
+
)}
|
|
57
|
+
{...props} />
|
|
58
|
+
))
|
|
59
|
+
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
|
|
60
|
+
|
|
61
|
+
const MenubarSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (
|
|
62
|
+
<MenubarPrimitive.SubTrigger
|
|
63
|
+
ref={ref}
|
|
64
|
+
className={cn(
|
|
65
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
66
|
+
inset && "pl-8",
|
|
67
|
+
className
|
|
68
|
+
)}
|
|
69
|
+
{...props}>
|
|
70
|
+
{children}
|
|
71
|
+
<ChevronRight className="ml-auto h-4 w-4" />
|
|
72
|
+
</MenubarPrimitive.SubTrigger>
|
|
73
|
+
))
|
|
74
|
+
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
|
|
75
|
+
|
|
76
|
+
const MenubarSubContent = React.forwardRef(({ className, ...props }, ref) => (
|
|
77
|
+
<MenubarPrimitive.SubContent
|
|
78
|
+
ref={ref}
|
|
79
|
+
className={cn(
|
|
80
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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 origin-[--radix-menubar-content-transform-origin]",
|
|
81
|
+
className
|
|
82
|
+
)}
|
|
83
|
+
{...props} />
|
|
84
|
+
))
|
|
85
|
+
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
|
|
86
|
+
|
|
87
|
+
const MenubarContent = React.forwardRef((
|
|
88
|
+
{ className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
|
|
89
|
+
ref
|
|
90
|
+
) => (
|
|
91
|
+
<MenubarPrimitive.Portal>
|
|
92
|
+
<MenubarPrimitive.Content
|
|
93
|
+
ref={ref}
|
|
94
|
+
align={align}
|
|
95
|
+
alignOffset={alignOffset}
|
|
96
|
+
sideOffset={sideOffset}
|
|
97
|
+
className={cn(
|
|
98
|
+
"z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]",
|
|
99
|
+
className
|
|
100
|
+
)}
|
|
101
|
+
{...props} />
|
|
102
|
+
</MenubarPrimitive.Portal>
|
|
103
|
+
))
|
|
104
|
+
MenubarContent.displayName = MenubarPrimitive.Content.displayName
|
|
105
|
+
|
|
106
|
+
const MenubarItem = React.forwardRef(({ className, inset, ...props }, ref) => (
|
|
107
|
+
<MenubarPrimitive.Item
|
|
108
|
+
ref={ref}
|
|
109
|
+
className={cn(
|
|
110
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
111
|
+
inset && "pl-8",
|
|
112
|
+
className
|
|
113
|
+
)}
|
|
114
|
+
{...props} />
|
|
115
|
+
))
|
|
116
|
+
MenubarItem.displayName = MenubarPrimitive.Item.displayName
|
|
117
|
+
|
|
118
|
+
const MenubarCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (
|
|
119
|
+
<MenubarPrimitive.CheckboxItem
|
|
120
|
+
ref={ref}
|
|
121
|
+
className={cn(
|
|
122
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
123
|
+
className
|
|
124
|
+
)}
|
|
125
|
+
checked={checked}
|
|
126
|
+
{...props}>
|
|
127
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
128
|
+
<MenubarPrimitive.ItemIndicator>
|
|
129
|
+
<Check className="h-4 w-4" />
|
|
130
|
+
</MenubarPrimitive.ItemIndicator>
|
|
131
|
+
</span>
|
|
132
|
+
{children}
|
|
133
|
+
</MenubarPrimitive.CheckboxItem>
|
|
134
|
+
))
|
|
135
|
+
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
|
|
136
|
+
|
|
137
|
+
const MenubarRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (
|
|
138
|
+
<MenubarPrimitive.RadioItem
|
|
139
|
+
ref={ref}
|
|
140
|
+
className={cn(
|
|
141
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
142
|
+
className
|
|
143
|
+
)}
|
|
144
|
+
{...props}>
|
|
145
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
146
|
+
<MenubarPrimitive.ItemIndicator>
|
|
147
|
+
<Circle className="h-2 w-2 fill-current" />
|
|
148
|
+
</MenubarPrimitive.ItemIndicator>
|
|
149
|
+
</span>
|
|
150
|
+
{children}
|
|
151
|
+
</MenubarPrimitive.RadioItem>
|
|
152
|
+
))
|
|
153
|
+
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
|
|
154
|
+
|
|
155
|
+
const MenubarLabel = React.forwardRef(({ className, inset, ...props }, ref) => (
|
|
156
|
+
<MenubarPrimitive.Label
|
|
157
|
+
ref={ref}
|
|
158
|
+
className={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)}
|
|
159
|
+
{...props} />
|
|
160
|
+
))
|
|
161
|
+
MenubarLabel.displayName = MenubarPrimitive.Label.displayName
|
|
162
|
+
|
|
163
|
+
const MenubarSeparator = React.forwardRef(({ className, ...props }, ref) => (
|
|
164
|
+
<MenubarPrimitive.Separator
|
|
165
|
+
ref={ref}
|
|
166
|
+
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
167
|
+
{...props} />
|
|
168
|
+
))
|
|
169
|
+
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
|
|
170
|
+
|
|
171
|
+
const MenubarShortcut = ({
|
|
172
|
+
className,
|
|
173
|
+
...props
|
|
174
|
+
}) => {
|
|
175
|
+
return (
|
|
176
|
+
<span
|
|
177
|
+
className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)}
|
|
178
|
+
{...props} />
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
MenubarShortcut.displayname = "MenubarShortcut"
|
|
182
|
+
|
|
183
|
+
export {
|
|
184
|
+
Menubar,
|
|
185
|
+
MenubarMenu,
|
|
186
|
+
MenubarTrigger,
|
|
187
|
+
MenubarContent,
|
|
188
|
+
MenubarItem,
|
|
189
|
+
MenubarSeparator,
|
|
190
|
+
MenubarLabel,
|
|
191
|
+
MenubarCheckboxItem,
|
|
192
|
+
MenubarRadioGroup,
|
|
193
|
+
MenubarRadioItem,
|
|
194
|
+
MenubarPortal,
|
|
195
|
+
MenubarSubContent,
|
|
196
|
+
MenubarSubTrigger,
|
|
197
|
+
MenubarGroup,
|
|
198
|
+
MenubarSub,
|
|
199
|
+
MenubarShortcut,
|
|
200
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
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 { ChevronDown } from "lucide-react"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const NavigationMenu = React.forwardRef(({ className, children, ...props }, ref) => (
|
|
9
|
+
<NavigationMenuPrimitive.Root
|
|
10
|
+
ref={ref}
|
|
11
|
+
className={cn(
|
|
12
|
+
"relative z-10 flex max-w-max flex-1 items-center justify-center",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
{...props}>
|
|
16
|
+
{children}
|
|
17
|
+
<NavigationMenuViewport />
|
|
18
|
+
</NavigationMenuPrimitive.Root>
|
|
19
|
+
))
|
|
20
|
+
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
|
|
21
|
+
|
|
22
|
+
const NavigationMenuList = React.forwardRef(({ className, ...props }, ref) => (
|
|
23
|
+
<NavigationMenuPrimitive.List
|
|
24
|
+
ref={ref}
|
|
25
|
+
className={cn(
|
|
26
|
+
"group flex flex-1 list-none items-center justify-center space-x-1",
|
|
27
|
+
className
|
|
28
|
+
)}
|
|
29
|
+
{...props} />
|
|
30
|
+
))
|
|
31
|
+
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
|
|
32
|
+
|
|
33
|
+
const NavigationMenuItem = NavigationMenuPrimitive.Item
|
|
34
|
+
|
|
35
|
+
const navigationMenuTriggerStyle = cva(
|
|
36
|
+
"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 hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
const NavigationMenuTrigger = React.forwardRef(({ className, children, ...props }, ref) => (
|
|
40
|
+
<NavigationMenuPrimitive.Trigger
|
|
41
|
+
ref={ref}
|
|
42
|
+
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
|
43
|
+
{...props}>
|
|
44
|
+
{children}{" "}
|
|
45
|
+
<ChevronDown
|
|
46
|
+
className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
|
|
47
|
+
aria-hidden="true" />
|
|
48
|
+
</NavigationMenuPrimitive.Trigger>
|
|
49
|
+
))
|
|
50
|
+
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
|
|
51
|
+
|
|
52
|
+
const NavigationMenuContent = React.forwardRef(({ className, ...props }, ref) => (
|
|
53
|
+
<NavigationMenuPrimitive.Content
|
|
54
|
+
ref={ref}
|
|
55
|
+
className={cn(
|
|
56
|
+
"left-0 top-0 w-full 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 md:absolute md:w-auto ",
|
|
57
|
+
className
|
|
58
|
+
)}
|
|
59
|
+
{...props} />
|
|
60
|
+
))
|
|
61
|
+
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
|
|
62
|
+
|
|
63
|
+
const NavigationMenuLink = NavigationMenuPrimitive.Link
|
|
64
|
+
|
|
65
|
+
const NavigationMenuViewport = React.forwardRef(({ className, ...props }, ref) => (
|
|
66
|
+
<div className={cn("absolute left-0 top-full flex justify-center")}>
|
|
67
|
+
<NavigationMenuPrimitive.Viewport
|
|
68
|
+
className={cn(
|
|
69
|
+
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
70
|
+
className
|
|
71
|
+
)}
|
|
72
|
+
ref={ref}
|
|
73
|
+
{...props} />
|
|
74
|
+
</div>
|
|
75
|
+
))
|
|
76
|
+
NavigationMenuViewport.displayName =
|
|
77
|
+
NavigationMenuPrimitive.Viewport.displayName
|
|
78
|
+
|
|
79
|
+
const NavigationMenuIndicator = React.forwardRef(({ className, ...props }, ref) => (
|
|
80
|
+
<NavigationMenuPrimitive.Indicator
|
|
81
|
+
ref={ref}
|
|
82
|
+
className={cn(
|
|
83
|
+
"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
|
|
84
|
+
className
|
|
85
|
+
)}
|
|
86
|
+
{...props}>
|
|
87
|
+
<div
|
|
88
|
+
className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
|
|
89
|
+
</NavigationMenuPrimitive.Indicator>
|
|
90
|
+
))
|
|
91
|
+
NavigationMenuIndicator.displayName =
|
|
92
|
+
NavigationMenuPrimitive.Indicator.displayName
|
|
93
|
+
|
|
94
|
+
export {
|
|
95
|
+
navigationMenuTriggerStyle,
|
|
96
|
+
NavigationMenu,
|
|
97
|
+
NavigationMenuList,
|
|
98
|
+
NavigationMenuItem,
|
|
99
|
+
NavigationMenuContent,
|
|
100
|
+
NavigationMenuTrigger,
|
|
101
|
+
NavigationMenuLink,
|
|
102
|
+
NavigationMenuIndicator,
|
|
103
|
+
NavigationMenuViewport,
|
|
104
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
const Popover = PopoverPrimitive.Root
|
|
7
|
+
|
|
8
|
+
const PopoverTrigger = PopoverPrimitive.Trigger
|
|
9
|
+
|
|
10
|
+
const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
|
|
11
|
+
<PopoverPrimitive.Portal>
|
|
12
|
+
<PopoverPrimitive.Content
|
|
13
|
+
ref={ref}
|
|
14
|
+
align={align}
|
|
15
|
+
sideOffset={sideOffset}
|
|
16
|
+
className={cn(
|
|
17
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props} />
|
|
21
|
+
</PopoverPrimitive.Portal>
|
|
22
|
+
))
|
|
23
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName
|
|
24
|
+
|
|
25
|
+
export { Popover, PopoverTrigger, PopoverContent }
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
const Progress = React.forwardRef(({ className, value, ...props }, ref) => (
|
|
9
|
+
<ProgressPrimitive.Root
|
|
10
|
+
ref={ref}
|
|
11
|
+
className={cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className)}
|
|
12
|
+
{...props}>
|
|
13
|
+
<ProgressPrimitive.Indicator
|
|
14
|
+
className="h-full w-full flex-1 bg-primary transition-all"
|
|
15
|
+
style={{ transform: `translateX(-${100 - (value || 0)}%)` }} />
|
|
16
|
+
</ProgressPrimitive.Root>
|
|
17
|
+
))
|
|
18
|
+
Progress.displayName = ProgressPrimitive.Root.displayName
|
|
19
|
+
|
|
20
|
+
export { Progress }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
|
3
|
+
import { Circle } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
const RadioGroup = React.forwardRef(({ className, ...props }, ref) => {
|
|
8
|
+
return (<RadioGroupPrimitive.Root className={cn("grid gap-2", className)} {...props} ref={ref} />);
|
|
9
|
+
})
|
|
10
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
|
|
11
|
+
|
|
12
|
+
const RadioGroupItem = React.forwardRef(({ className, ...props }, ref) => {
|
|
13
|
+
return (
|
|
14
|
+
<RadioGroupPrimitive.Item
|
|
15
|
+
ref={ref}
|
|
16
|
+
className={cn(
|
|
17
|
+
"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}>
|
|
21
|
+
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
|
|
22
|
+
<Circle className="h-2.5 w-2.5 fill-current text-current" />
|
|
23
|
+
</RadioGroupPrimitive.Indicator>
|
|
24
|
+
</RadioGroupPrimitive.Item>
|
|
25
|
+
);
|
|
26
|
+
})
|
|
27
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
|
|
28
|
+
|
|
29
|
+
export { RadioGroup, RadioGroupItem }
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => (
|
|
9
|
+
<ScrollAreaPrimitive.Root
|
|
10
|
+
ref={ref}
|
|
11
|
+
className={cn("relative overflow-hidden", className)}
|
|
12
|
+
{...props}>
|
|
13
|
+
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
|
|
14
|
+
{children}
|
|
15
|
+
</ScrollAreaPrimitive.Viewport>
|
|
16
|
+
<ScrollBar />
|
|
17
|
+
<ScrollAreaPrimitive.Corner />
|
|
18
|
+
</ScrollAreaPrimitive.Root>
|
|
19
|
+
))
|
|
20
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
|
|
21
|
+
|
|
22
|
+
const ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => (
|
|
23
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
24
|
+
ref={ref}
|
|
25
|
+
orientation={orientation}
|
|
26
|
+
className={cn(
|
|
27
|
+
"flex touch-none select-none transition-colors",
|
|
28
|
+
orientation === "vertical" &&
|
|
29
|
+
"h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
30
|
+
orientation === "horizontal" &&
|
|
31
|
+
"h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
32
|
+
className
|
|
33
|
+
)}
|
|
34
|
+
{...props}>
|
|
35
|
+
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
|
|
36
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
37
|
+
))
|
|
38
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
|
39
|
+
|
|
40
|
+
export { ScrollArea, ScrollBar }
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
3
|
+
import { Check, ChevronDown, ChevronUp } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
const Select = SelectPrimitive.Root
|
|
8
|
+
|
|
9
|
+
const SelectGroup = SelectPrimitive.Group
|
|
10
|
+
|
|
11
|
+
const SelectValue = SelectPrimitive.Value
|
|
12
|
+
|
|
13
|
+
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (
|
|
14
|
+
<SelectPrimitive.Trigger
|
|
15
|
+
ref={ref}
|
|
16
|
+
className={cn(
|
|
17
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}>
|
|
21
|
+
{children}
|
|
22
|
+
<SelectPrimitive.Icon asChild>
|
|
23
|
+
<ChevronDown className="h-4 w-4 opacity-50" />
|
|
24
|
+
</SelectPrimitive.Icon>
|
|
25
|
+
</SelectPrimitive.Trigger>
|
|
26
|
+
))
|
|
27
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
|
|
28
|
+
|
|
29
|
+
const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (
|
|
30
|
+
<SelectPrimitive.ScrollUpButton
|
|
31
|
+
ref={ref}
|
|
32
|
+
className={cn("flex cursor-default items-center justify-center py-1", className)}
|
|
33
|
+
{...props}>
|
|
34
|
+
<ChevronUp className="h-4 w-4" />
|
|
35
|
+
</SelectPrimitive.ScrollUpButton>
|
|
36
|
+
))
|
|
37
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
|
|
38
|
+
|
|
39
|
+
const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (
|
|
40
|
+
<SelectPrimitive.ScrollDownButton
|
|
41
|
+
ref={ref}
|
|
42
|
+
className={cn("flex cursor-default items-center justify-center py-1", className)}
|
|
43
|
+
{...props}>
|
|
44
|
+
<ChevronDown className="h-4 w-4" />
|
|
45
|
+
</SelectPrimitive.ScrollDownButton>
|
|
46
|
+
))
|
|
47
|
+
SelectScrollDownButton.displayName =
|
|
48
|
+
SelectPrimitive.ScrollDownButton.displayName
|
|
49
|
+
|
|
50
|
+
const SelectContent = React.forwardRef(({ className, children, position = "popper", ...props }, ref) => (
|
|
51
|
+
<SelectPrimitive.Portal>
|
|
52
|
+
<SelectPrimitive.Content
|
|
53
|
+
ref={ref}
|
|
54
|
+
className={cn(
|
|
55
|
+
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
|
|
56
|
+
position === "popper" &&
|
|
57
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
58
|
+
className
|
|
59
|
+
)}
|
|
60
|
+
position={position}
|
|
61
|
+
{...props}>
|
|
62
|
+
<SelectScrollUpButton />
|
|
63
|
+
<SelectPrimitive.Viewport
|
|
64
|
+
className={cn("p-1", position === "popper" &&
|
|
65
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")}>
|
|
66
|
+
{children}
|
|
67
|
+
</SelectPrimitive.Viewport>
|
|
68
|
+
<SelectScrollDownButton />
|
|
69
|
+
</SelectPrimitive.Content>
|
|
70
|
+
</SelectPrimitive.Portal>
|
|
71
|
+
))
|
|
72
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName
|
|
73
|
+
|
|
74
|
+
const SelectLabel = React.forwardRef(({ className, ...props }, ref) => (
|
|
75
|
+
<SelectPrimitive.Label
|
|
76
|
+
ref={ref}
|
|
77
|
+
className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
|
|
78
|
+
{...props} />
|
|
79
|
+
))
|
|
80
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName
|
|
81
|
+
|
|
82
|
+
const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (
|
|
83
|
+
<SelectPrimitive.Item
|
|
84
|
+
ref={ref}
|
|
85
|
+
className={cn(
|
|
86
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
87
|
+
className
|
|
88
|
+
)}
|
|
89
|
+
{...props}>
|
|
90
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
91
|
+
<SelectPrimitive.ItemIndicator>
|
|
92
|
+
<Check className="h-4 w-4" />
|
|
93
|
+
</SelectPrimitive.ItemIndicator>
|
|
94
|
+
</span>
|
|
95
|
+
|
|
96
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
97
|
+
</SelectPrimitive.Item>
|
|
98
|
+
))
|
|
99
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName
|
|
100
|
+
|
|
101
|
+
const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (
|
|
102
|
+
<SelectPrimitive.Separator
|
|
103
|
+
ref={ref}
|
|
104
|
+
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
105
|
+
{...props} />
|
|
106
|
+
))
|
|
107
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName
|
|
108
|
+
|
|
109
|
+
export {
|
|
110
|
+
Select,
|
|
111
|
+
SelectGroup,
|
|
112
|
+
SelectValue,
|
|
113
|
+
SelectTrigger,
|
|
114
|
+
SelectContent,
|
|
115
|
+
SelectLabel,
|
|
116
|
+
SelectItem,
|
|
117
|
+
SelectSeparator,
|
|
118
|
+
SelectScrollUpButton,
|
|
119
|
+
SelectScrollDownButton,
|
|
120
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
const Separator = React.forwardRef((
|
|
9
|
+
{ className, orientation = "horizontal", decorative = true, ...props },
|
|
10
|
+
ref
|
|
11
|
+
) => (
|
|
12
|
+
<SeparatorPrimitive.Root
|
|
13
|
+
ref={ref}
|
|
14
|
+
decorative={decorative}
|
|
15
|
+
orientation={orientation}
|
|
16
|
+
className={cn(
|
|
17
|
+
"shrink-0 bg-border",
|
|
18
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
{...props} />
|
|
22
|
+
))
|
|
23
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName
|
|
24
|
+
|
|
25
|
+
export { Separator }
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog"
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { X } from "lucide-react"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const Sheet = SheetPrimitive.Root
|
|
9
|
+
|
|
10
|
+
const SheetTrigger = SheetPrimitive.Trigger
|
|
11
|
+
|
|
12
|
+
const SheetClose = SheetPrimitive.Close
|
|
13
|
+
|
|
14
|
+
const SheetPortal = SheetPrimitive.Portal
|
|
15
|
+
|
|
16
|
+
const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => (
|
|
17
|
+
<SheetPrimitive.Overlay
|
|
18
|
+
className={cn(
|
|
19
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
{...props}
|
|
23
|
+
ref={ref} />
|
|
24
|
+
))
|
|
25
|
+
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName
|
|
26
|
+
|
|
27
|
+
const sheetVariants = cva(
|
|
28
|
+
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
29
|
+
{
|
|
30
|
+
variants: {
|
|
31
|
+
side: {
|
|
32
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
33
|
+
bottom:
|
|
34
|
+
"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
35
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
36
|
+
right:
|
|
37
|
+
"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
side: "right",
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
const SheetContent = React.forwardRef(({ side = "right", className, children, ...props }, ref) => (
|
|
47
|
+
<SheetPortal>
|
|
48
|
+
<SheetOverlay />
|
|
49
|
+
<SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>
|
|
50
|
+
{children}
|
|
51
|
+
<SheetPrimitive.Close
|
|
52
|
+
className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
|
|
53
|
+
<X className="h-4 w-4" />
|
|
54
|
+
<span className="sr-only">Close</span>
|
|
55
|
+
</SheetPrimitive.Close>
|
|
56
|
+
</SheetPrimitive.Content>
|
|
57
|
+
</SheetPortal>
|
|
58
|
+
))
|
|
59
|
+
SheetContent.displayName = SheetPrimitive.Content.displayName
|
|
60
|
+
|
|
61
|
+
const SheetHeader = ({
|
|
62
|
+
className,
|
|
63
|
+
...props
|
|
64
|
+
}) => (
|
|
65
|
+
<div
|
|
66
|
+
className={cn("flex flex-col space-y-2 text-center sm:text-left", className)}
|
|
67
|
+
{...props} />
|
|
68
|
+
)
|
|
69
|
+
SheetHeader.displayName = "SheetHeader"
|
|
70
|
+
|
|
71
|
+
const SheetFooter = ({
|
|
72
|
+
className,
|
|
73
|
+
...props
|
|
74
|
+
}) => (
|
|
75
|
+
<div
|
|
76
|
+
className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)}
|
|
77
|
+
{...props} />
|
|
78
|
+
)
|
|
79
|
+
SheetFooter.displayName = "SheetFooter"
|
|
80
|
+
|
|
81
|
+
const SheetTitle = React.forwardRef(({ className, ...props }, ref) => (
|
|
82
|
+
<SheetPrimitive.Title
|
|
83
|
+
ref={ref}
|
|
84
|
+
className={cn("text-lg font-semibold text-foreground", className)}
|
|
85
|
+
{...props} />
|
|
86
|
+
))
|
|
87
|
+
SheetTitle.displayName = SheetPrimitive.Title.displayName
|
|
88
|
+
|
|
89
|
+
const SheetDescription = React.forwardRef(({ className, ...props }, ref) => (
|
|
90
|
+
<SheetPrimitive.Description
|
|
91
|
+
ref={ref}
|
|
92
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
93
|
+
{...props} />
|
|
94
|
+
))
|
|
95
|
+
SheetDescription.displayName = SheetPrimitive.Description.displayName
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
Sheet,
|
|
99
|
+
SheetPortal,
|
|
100
|
+
SheetOverlay,
|
|
101
|
+
SheetTrigger,
|
|
102
|
+
SheetClose,
|
|
103
|
+
SheetContent,
|
|
104
|
+
SheetHeader,
|
|
105
|
+
SheetFooter,
|
|
106
|
+
SheetTitle,
|
|
107
|
+
SheetDescription,
|
|
108
|
+
}
|