@greatapps/greatauth-ui 0.2.1 → 0.3.1
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/dist/ui.d.ts +255 -104
- package/dist/ui.js +1466 -0
- package/dist/ui.js.map +1 -1
- package/package.json +6 -3
- package/src/components/ui/accordion.tsx +81 -0
- package/src/components/ui/aspect-ratio.tsx +11 -0
- package/src/components/ui/checkbox.tsx +33 -0
- package/src/components/ui/context-menu.tsx +255 -0
- package/src/components/ui/drawer.tsx +125 -0
- package/src/components/ui/hover-card.tsx +44 -0
- package/src/components/ui/input-otp.tsx +86 -0
- package/src/components/ui/menubar.tsx +269 -0
- package/src/components/ui/navigation-menu.tsx +161 -0
- package/src/components/ui/pagination.tsx +133 -0
- package/src/components/ui/popover.tsx +89 -0
- package/src/components/ui/radio-group.tsx +44 -0
- package/src/components/ui/slider.tsx +59 -0
- package/src/components/ui/sonner.tsx +49 -0
- package/src/components/ui/switch.tsx +33 -0
- package/src/components/ui/toggle-group.tsx +89 -0
- package/src/components/ui/toggle.tsx +46 -0
- package/src/ui.ts +53 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Menubar as MenubarPrimitive } from "radix-ui"
|
|
5
|
+
|
|
6
|
+
import { cn } from "../../lib/utils"
|
|
7
|
+
import { Check, ChevronRight } from "lucide-react"
|
|
8
|
+
|
|
9
|
+
function Menubar({
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Root>) {
|
|
13
|
+
return (
|
|
14
|
+
<MenubarPrimitive.Root
|
|
15
|
+
data-slot="menubar"
|
|
16
|
+
className={cn("bg-background h-9 gap-1 rounded-md border p-1 shadow-xs flex items-center", className)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function MenubarMenu({
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
|
|
25
|
+
return <MenubarPrimitive.Menu data-slot="menubar-menu" {...props} />
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function MenubarGroup({
|
|
29
|
+
...props
|
|
30
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Group>) {
|
|
31
|
+
return <MenubarPrimitive.Group data-slot="menubar-group" {...props} />
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function MenubarPortal({
|
|
35
|
+
...props
|
|
36
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
|
|
37
|
+
return <MenubarPrimitive.Portal data-slot="menubar-portal" {...props} />
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function MenubarRadioGroup({
|
|
41
|
+
...props
|
|
42
|
+
}: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
|
|
43
|
+
return (
|
|
44
|
+
<MenubarPrimitive.RadioGroup data-slot="menubar-radio-group" {...props} />
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function MenubarTrigger({
|
|
49
|
+
className,
|
|
50
|
+
...props
|
|
51
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Trigger>) {
|
|
52
|
+
return (
|
|
53
|
+
<MenubarPrimitive.Trigger
|
|
54
|
+
data-slot="menubar-trigger"
|
|
55
|
+
className={cn(
|
|
56
|
+
"hover:bg-muted aria-expanded:bg-muted rounded-sm px-2 py-1 text-sm font-medium flex items-center outline-hidden select-none",
|
|
57
|
+
className
|
|
58
|
+
)}
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function MenubarContent({
|
|
65
|
+
className,
|
|
66
|
+
align = "start",
|
|
67
|
+
alignOffset = -4,
|
|
68
|
+
sideOffset = 8,
|
|
69
|
+
...props
|
|
70
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Content>) {
|
|
71
|
+
return (
|
|
72
|
+
<MenubarPortal>
|
|
73
|
+
<MenubarPrimitive.Content
|
|
74
|
+
data-slot="menubar-content"
|
|
75
|
+
align={align}
|
|
76
|
+
alignOffset={alignOffset}
|
|
77
|
+
sideOffset={sideOffset}
|
|
78
|
+
className={cn("bg-popover text-popover-foreground data-open:animate-in data-open:fade-in-0 data-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 ring-foreground/10 min-w-36 rounded-md p-1 shadow-md ring-1 duration-100 z-50 origin-(--radix-menubar-content-transform-origin) overflow-hidden", className )}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
</MenubarPortal>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function MenubarItem({
|
|
86
|
+
className,
|
|
87
|
+
inset,
|
|
88
|
+
variant = "default",
|
|
89
|
+
...props
|
|
90
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Item> & {
|
|
91
|
+
inset?: boolean
|
|
92
|
+
variant?: "default" | "destructive"
|
|
93
|
+
}) {
|
|
94
|
+
return (
|
|
95
|
+
<MenubarPrimitive.Item
|
|
96
|
+
data-slot="menubar-item"
|
|
97
|
+
data-inset={inset}
|
|
98
|
+
data-variant={variant}
|
|
99
|
+
className={cn(
|
|
100
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive! not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm data-disabled:opacity-50 data-inset:pl-8 [&_svg:not([class*='size-'])]:size-4 group/menubar-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
101
|
+
className
|
|
102
|
+
)}
|
|
103
|
+
{...props}
|
|
104
|
+
/>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function MenubarCheckboxItem({
|
|
109
|
+
className,
|
|
110
|
+
children,
|
|
111
|
+
checked,
|
|
112
|
+
inset,
|
|
113
|
+
...props
|
|
114
|
+
}: React.ComponentProps<typeof MenubarPrimitive.CheckboxItem> & {
|
|
115
|
+
inset?: boolean
|
|
116
|
+
}) {
|
|
117
|
+
return (
|
|
118
|
+
<MenubarPrimitive.CheckboxItem
|
|
119
|
+
data-slot="menubar-checkbox-item"
|
|
120
|
+
data-inset={inset}
|
|
121
|
+
className={cn(
|
|
122
|
+
"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm data-inset:pl-8 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
123
|
+
className
|
|
124
|
+
)}
|
|
125
|
+
checked={checked}
|
|
126
|
+
{...props}
|
|
127
|
+
>
|
|
128
|
+
<span className="left-2 size-4 [&_svg:not([class*='size-'])]:size-4 pointer-events-none absolute flex items-center justify-center">
|
|
129
|
+
<MenubarPrimitive.ItemIndicator>
|
|
130
|
+
<Check />
|
|
131
|
+
</MenubarPrimitive.ItemIndicator>
|
|
132
|
+
</span>
|
|
133
|
+
{children}
|
|
134
|
+
</MenubarPrimitive.CheckboxItem>
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function MenubarRadioItem({
|
|
139
|
+
className,
|
|
140
|
+
children,
|
|
141
|
+
inset,
|
|
142
|
+
...props
|
|
143
|
+
}: React.ComponentProps<typeof MenubarPrimitive.RadioItem> & {
|
|
144
|
+
inset?: boolean
|
|
145
|
+
}) {
|
|
146
|
+
return (
|
|
147
|
+
<MenubarPrimitive.RadioItem
|
|
148
|
+
data-slot="menubar-radio-item"
|
|
149
|
+
data-inset={inset}
|
|
150
|
+
className={cn(
|
|
151
|
+
"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm data-disabled:opacity-50 data-inset:pl-8 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
152
|
+
className
|
|
153
|
+
)}
|
|
154
|
+
{...props}
|
|
155
|
+
>
|
|
156
|
+
<span className="left-2 size-4 [&_svg:not([class*='size-'])]:size-4 pointer-events-none absolute flex items-center justify-center">
|
|
157
|
+
<MenubarPrimitive.ItemIndicator>
|
|
158
|
+
<Check />
|
|
159
|
+
</MenubarPrimitive.ItemIndicator>
|
|
160
|
+
</span>
|
|
161
|
+
{children}
|
|
162
|
+
</MenubarPrimitive.RadioItem>
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function MenubarLabel({
|
|
167
|
+
className,
|
|
168
|
+
inset,
|
|
169
|
+
...props
|
|
170
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Label> & {
|
|
171
|
+
inset?: boolean
|
|
172
|
+
}) {
|
|
173
|
+
return (
|
|
174
|
+
<MenubarPrimitive.Label
|
|
175
|
+
data-slot="menubar-label"
|
|
176
|
+
data-inset={inset}
|
|
177
|
+
className={cn("px-2 py-1.5 text-sm font-medium data-inset:pl-8", className)}
|
|
178
|
+
{...props}
|
|
179
|
+
/>
|
|
180
|
+
)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function MenubarSeparator({
|
|
184
|
+
className,
|
|
185
|
+
...props
|
|
186
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Separator>) {
|
|
187
|
+
return (
|
|
188
|
+
<MenubarPrimitive.Separator
|
|
189
|
+
data-slot="menubar-separator"
|
|
190
|
+
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
|
191
|
+
{...props}
|
|
192
|
+
/>
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function MenubarShortcut({
|
|
197
|
+
className,
|
|
198
|
+
...props
|
|
199
|
+
}: React.ComponentProps<"span">) {
|
|
200
|
+
return (
|
|
201
|
+
<span
|
|
202
|
+
data-slot="menubar-shortcut"
|
|
203
|
+
className={cn("text-muted-foreground group-focus/menubar-item:text-accent-foreground text-xs tracking-widest ml-auto", className)}
|
|
204
|
+
{...props}
|
|
205
|
+
/>
|
|
206
|
+
)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function MenubarSub({
|
|
210
|
+
...props
|
|
211
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
|
|
212
|
+
return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function MenubarSubTrigger({
|
|
216
|
+
className,
|
|
217
|
+
inset,
|
|
218
|
+
children,
|
|
219
|
+
...props
|
|
220
|
+
}: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
|
|
221
|
+
inset?: boolean
|
|
222
|
+
}) {
|
|
223
|
+
return (
|
|
224
|
+
<MenubarPrimitive.SubTrigger
|
|
225
|
+
data-slot="menubar-sub-trigger"
|
|
226
|
+
data-inset={inset}
|
|
227
|
+
className={cn(
|
|
228
|
+
"focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm data-inset:pl-8 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-none select-none",
|
|
229
|
+
className
|
|
230
|
+
)}
|
|
231
|
+
{...props}
|
|
232
|
+
>
|
|
233
|
+
{children}
|
|
234
|
+
<ChevronRight className="ml-auto size-4" />
|
|
235
|
+
</MenubarPrimitive.SubTrigger>
|
|
236
|
+
)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function MenubarSubContent({
|
|
240
|
+
className,
|
|
241
|
+
...props
|
|
242
|
+
}: React.ComponentProps<typeof MenubarPrimitive.SubContent>) {
|
|
243
|
+
return (
|
|
244
|
+
<MenubarPrimitive.SubContent
|
|
245
|
+
data-slot="menubar-sub-content"
|
|
246
|
+
className={cn("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 min-w-32 rounded-md p-1 shadow-lg ring-1 duration-100 z-50 origin-(--radix-menubar-content-transform-origin) overflow-hidden", className )}
|
|
247
|
+
{...props}
|
|
248
|
+
/>
|
|
249
|
+
)
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export {
|
|
253
|
+
Menubar,
|
|
254
|
+
MenubarPortal,
|
|
255
|
+
MenubarMenu,
|
|
256
|
+
MenubarTrigger,
|
|
257
|
+
MenubarContent,
|
|
258
|
+
MenubarGroup,
|
|
259
|
+
MenubarSeparator,
|
|
260
|
+
MenubarLabel,
|
|
261
|
+
MenubarItem,
|
|
262
|
+
MenubarShortcut,
|
|
263
|
+
MenubarCheckboxItem,
|
|
264
|
+
MenubarRadioGroup,
|
|
265
|
+
MenubarRadioItem,
|
|
266
|
+
MenubarSub,
|
|
267
|
+
MenubarSubTrigger,
|
|
268
|
+
MenubarSubContent,
|
|
269
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva } from "class-variance-authority"
|
|
3
|
+
import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui"
|
|
4
|
+
|
|
5
|
+
import { cn } from "../../lib/utils"
|
|
6
|
+
import { ChevronDown } from "lucide-react"
|
|
7
|
+
|
|
8
|
+
function NavigationMenu({
|
|
9
|
+
className,
|
|
10
|
+
children,
|
|
11
|
+
viewport = true,
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
14
|
+
viewport?: boolean
|
|
15
|
+
}) {
|
|
16
|
+
return (
|
|
17
|
+
<NavigationMenuPrimitive.Root
|
|
18
|
+
data-slot="navigation-menu"
|
|
19
|
+
data-viewport={viewport}
|
|
20
|
+
className={cn(
|
|
21
|
+
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...props}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
{viewport && <NavigationMenuViewport />}
|
|
28
|
+
</NavigationMenuPrimitive.Root>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function NavigationMenuList({
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
|
|
36
|
+
return (
|
|
37
|
+
<NavigationMenuPrimitive.List
|
|
38
|
+
data-slot="navigation-menu-list"
|
|
39
|
+
className={cn(
|
|
40
|
+
"gap-0 group flex flex-1 list-none items-center justify-center",
|
|
41
|
+
className
|
|
42
|
+
)}
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function NavigationMenuItem({
|
|
49
|
+
className,
|
|
50
|
+
...props
|
|
51
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
|
|
52
|
+
return (
|
|
53
|
+
<NavigationMenuPrimitive.Item
|
|
54
|
+
data-slot="navigation-menu-item"
|
|
55
|
+
className={cn("relative", className)}
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const navigationMenuTriggerStyle = cva(
|
|
62
|
+
"bg-background hover:bg-muted focus:bg-muted data-open:hover:bg-muted data-open:focus:bg-muted data-open:bg-muted/50 focus-visible:ring-ring/50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted rounded-md px-4 py-2 text-sm font-medium transition-all focus-visible:ring-3 focus-visible:outline-1 disabled:opacity-50 group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center disabled:pointer-events-none outline-none"
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
function NavigationMenuTrigger({
|
|
66
|
+
className,
|
|
67
|
+
children,
|
|
68
|
+
...props
|
|
69
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
|
|
70
|
+
return (
|
|
71
|
+
<NavigationMenuPrimitive.Trigger
|
|
72
|
+
data-slot="navigation-menu-trigger"
|
|
73
|
+
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
|
74
|
+
{...props}
|
|
75
|
+
>
|
|
76
|
+
{children}{" "}
|
|
77
|
+
<ChevronDown className="relative top-px ml-1 size-3 transition duration-300 group-data-open/navigation-menu-trigger:rotate-180 group-data-popup-open/navigation-menu-trigger:rotate-180" aria-hidden="true" />
|
|
78
|
+
</NavigationMenuPrimitive.Trigger>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function NavigationMenuContent({
|
|
83
|
+
className,
|
|
84
|
+
...props
|
|
85
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
|
|
86
|
+
return (
|
|
87
|
+
<NavigationMenuPrimitive.Content
|
|
88
|
+
data-slot="navigation-menu-content"
|
|
89
|
+
className={cn(
|
|
90
|
+
"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 group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:ring-foreground/10 p-2 pr-2.5 ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:duration-300 top-0 left-0 w-full 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 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none md:absolute md:w-auto",
|
|
91
|
+
className
|
|
92
|
+
)}
|
|
93
|
+
{...props}
|
|
94
|
+
/>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function NavigationMenuViewport({
|
|
99
|
+
className,
|
|
100
|
+
...props
|
|
101
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
|
|
102
|
+
return (
|
|
103
|
+
<div
|
|
104
|
+
className={cn(
|
|
105
|
+
"absolute top-full left-0 isolate z-50 flex justify-center"
|
|
106
|
+
)}
|
|
107
|
+
>
|
|
108
|
+
<NavigationMenuPrimitive.Viewport
|
|
109
|
+
data-slot="navigation-menu-viewport"
|
|
110
|
+
className={cn(
|
|
111
|
+
"bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:zoom-out-95 data-open:zoom-in-90 ring-foreground/10 rounded-lg shadow ring-1 duration-100 origin-top-center relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full overflow-hidden md:w-(--radix-navigation-menu-viewport-width)",
|
|
112
|
+
className
|
|
113
|
+
)}
|
|
114
|
+
{...props}
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function NavigationMenuLink({
|
|
121
|
+
className,
|
|
122
|
+
...props
|
|
123
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
|
|
124
|
+
return (
|
|
125
|
+
<NavigationMenuPrimitive.Link
|
|
126
|
+
data-slot="navigation-menu-link"
|
|
127
|
+
className={cn("data-[active=true]:focus:bg-muted data-[active=true]:hover:bg-muted data-[active=true]:bg-muted/50 focus-visible:ring-ring/50 hover:bg-muted focus:bg-muted flex items-center gap-1.5 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-3 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4", className)}
|
|
128
|
+
{...props}
|
|
129
|
+
/>
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function NavigationMenuIndicator({
|
|
134
|
+
className,
|
|
135
|
+
...props
|
|
136
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
|
|
137
|
+
return (
|
|
138
|
+
<NavigationMenuPrimitive.Indicator
|
|
139
|
+
data-slot="navigation-menu-indicator"
|
|
140
|
+
className={cn(
|
|
141
|
+
"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",
|
|
142
|
+
className
|
|
143
|
+
)}
|
|
144
|
+
{...props}
|
|
145
|
+
>
|
|
146
|
+
<div className="bg-border rounded-tl-sm shadow-md relative top-[60%] h-2 w-2 rotate-45" />
|
|
147
|
+
</NavigationMenuPrimitive.Indicator>
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export {
|
|
152
|
+
NavigationMenu,
|
|
153
|
+
NavigationMenuList,
|
|
154
|
+
NavigationMenuItem,
|
|
155
|
+
NavigationMenuContent,
|
|
156
|
+
NavigationMenuTrigger,
|
|
157
|
+
NavigationMenuLink,
|
|
158
|
+
NavigationMenuIndicator,
|
|
159
|
+
NavigationMenuViewport,
|
|
160
|
+
navigationMenuTriggerStyle,
|
|
161
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../lib/utils"
|
|
4
|
+
import { Button } from "./button"
|
|
5
|
+
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
|
|
8
|
+
return (
|
|
9
|
+
<nav
|
|
10
|
+
role="navigation"
|
|
11
|
+
aria-label="pagination"
|
|
12
|
+
data-slot="pagination"
|
|
13
|
+
className={cn(
|
|
14
|
+
"mx-auto flex w-full justify-center",
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function PaginationContent({
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<"ul">) {
|
|
26
|
+
return (
|
|
27
|
+
<ul
|
|
28
|
+
data-slot="pagination-content"
|
|
29
|
+
className={cn("gap-1 flex items-center", className)}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function PaginationItem({ ...props }: React.ComponentProps<"li">) {
|
|
36
|
+
return <li data-slot="pagination-item" {...props} />
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
type PaginationLinkProps = {
|
|
40
|
+
isActive?: boolean
|
|
41
|
+
} & Pick<React.ComponentProps<typeof Button>, "size"> &
|
|
42
|
+
React.ComponentProps<"a">
|
|
43
|
+
|
|
44
|
+
function PaginationLink({
|
|
45
|
+
className,
|
|
46
|
+
isActive,
|
|
47
|
+
size = "icon",
|
|
48
|
+
...props
|
|
49
|
+
}: PaginationLinkProps) {
|
|
50
|
+
return (
|
|
51
|
+
<Button
|
|
52
|
+
asChild
|
|
53
|
+
variant={isActive ? "outline" : "ghost"}
|
|
54
|
+
size={size}
|
|
55
|
+
className={cn(className)}
|
|
56
|
+
>
|
|
57
|
+
<a
|
|
58
|
+
aria-current={isActive ? "page" : undefined}
|
|
59
|
+
data-slot="pagination-link"
|
|
60
|
+
data-active={isActive}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
</Button>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function PaginationPrevious({
|
|
68
|
+
className,
|
|
69
|
+
text = "Previous",
|
|
70
|
+
...props
|
|
71
|
+
}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
|
|
72
|
+
return (
|
|
73
|
+
<PaginationLink
|
|
74
|
+
aria-label="Go to previous page"
|
|
75
|
+
className={cn("pl-2!", className)}
|
|
76
|
+
{...props}
|
|
77
|
+
size="default"
|
|
78
|
+
>
|
|
79
|
+
<ChevronLeft data-icon="inline-start" />
|
|
80
|
+
<span className="hidden sm:block">
|
|
81
|
+
{text}
|
|
82
|
+
</span>
|
|
83
|
+
</PaginationLink>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function PaginationNext({
|
|
88
|
+
className,
|
|
89
|
+
text = "Next",
|
|
90
|
+
...props
|
|
91
|
+
}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
|
|
92
|
+
return (
|
|
93
|
+
<PaginationLink
|
|
94
|
+
aria-label="Go to next page"
|
|
95
|
+
className={cn("pr-2!", className)}
|
|
96
|
+
{...props}
|
|
97
|
+
size="default"
|
|
98
|
+
>
|
|
99
|
+
<span className="hidden sm:block">{text}</span>
|
|
100
|
+
<ChevronRight data-icon="inline-end" />
|
|
101
|
+
</PaginationLink>
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function PaginationEllipsis({
|
|
106
|
+
className,
|
|
107
|
+
...props
|
|
108
|
+
}: React.ComponentProps<"span">) {
|
|
109
|
+
return (
|
|
110
|
+
<span
|
|
111
|
+
aria-hidden
|
|
112
|
+
data-slot="pagination-ellipsis"
|
|
113
|
+
className={cn(
|
|
114
|
+
"size-9 [&_svg:not([class*='size-'])]:size-4 flex items-center justify-center",
|
|
115
|
+
className
|
|
116
|
+
)}
|
|
117
|
+
{...props}
|
|
118
|
+
>
|
|
119
|
+
<MoreHorizontal />
|
|
120
|
+
<span className="sr-only">More pages</span>
|
|
121
|
+
</span>
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export {
|
|
126
|
+
Pagination,
|
|
127
|
+
PaginationContent,
|
|
128
|
+
PaginationEllipsis,
|
|
129
|
+
PaginationItem,
|
|
130
|
+
PaginationLink,
|
|
131
|
+
PaginationNext,
|
|
132
|
+
PaginationPrevious,
|
|
133
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Popover as PopoverPrimitive } from "radix-ui"
|
|
5
|
+
|
|
6
|
+
import { cn } from "../../lib/utils"
|
|
7
|
+
|
|
8
|
+
function Popover({
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
11
|
+
return <PopoverPrimitive.Root data-slot="popover" {...props} />
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function PopoverTrigger({
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
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
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
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-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 flex flex-col gap-4 rounded-md p-4 text-sm shadow-md ring-1 duration-100 z-50 w-72 origin-(--radix-popover-content-transform-origin) outline-hidden",
|
|
34
|
+
className
|
|
35
|
+
)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
</PopoverPrimitive.Portal>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function PopoverAnchor({
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
45
|
+
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
49
|
+
return (
|
|
50
|
+
<div
|
|
51
|
+
data-slot="popover-header"
|
|
52
|
+
className={cn("flex flex-col gap-1 text-sm", className)}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
|
|
59
|
+
return (
|
|
60
|
+
<div
|
|
61
|
+
data-slot="popover-title"
|
|
62
|
+
className={cn("font-medium", className)}
|
|
63
|
+
{...props}
|
|
64
|
+
/>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function PopoverDescription({
|
|
69
|
+
className,
|
|
70
|
+
...props
|
|
71
|
+
}: React.ComponentProps<"p">) {
|
|
72
|
+
return (
|
|
73
|
+
<p
|
|
74
|
+
data-slot="popover-description"
|
|
75
|
+
className={cn("text-muted-foreground", className)}
|
|
76
|
+
{...props}
|
|
77
|
+
/>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export {
|
|
82
|
+
Popover,
|
|
83
|
+
PopoverAnchor,
|
|
84
|
+
PopoverContent,
|
|
85
|
+
PopoverDescription,
|
|
86
|
+
PopoverHeader,
|
|
87
|
+
PopoverTitle,
|
|
88
|
+
PopoverTrigger,
|
|
89
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { RadioGroup as RadioGroupPrimitive } from "radix-ui"
|
|
5
|
+
|
|
6
|
+
import { cn } from "../../lib/utils"
|
|
7
|
+
|
|
8
|
+
function RadioGroup({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<RadioGroupPrimitive.Root
|
|
14
|
+
data-slot="radio-group"
|
|
15
|
+
className={cn("grid gap-3 w-full", className)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function RadioGroupItem({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
|
|
25
|
+
return (
|
|
26
|
+
<RadioGroupPrimitive.Item
|
|
27
|
+
data-slot="radio-group-item"
|
|
28
|
+
className={cn(
|
|
29
|
+
"border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
30
|
+
className
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
>
|
|
34
|
+
<RadioGroupPrimitive.Indicator
|
|
35
|
+
data-slot="radio-group-indicator"
|
|
36
|
+
className="flex size-4 items-center justify-center"
|
|
37
|
+
>
|
|
38
|
+
<span className="bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full" />
|
|
39
|
+
</RadioGroupPrimitive.Indicator>
|
|
40
|
+
</RadioGroupPrimitive.Item>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { RadioGroup, RadioGroupItem }
|