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