@hexclave/ui 1.0.2 → 1.0.5
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/components/copy-button.d.ts +1 -1
- package/dist/components/simple-tooltip.js +2 -2
- package/dist/components/simple-tooltip.js.map +1 -1
- package/dist/components/ui/badge.d.ts +2 -2
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/form.d.ts +1 -1
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/resizable.d.ts +1 -1
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/typography.d.ts +1 -1
- package/dist/esm/components/copy-button.d.ts +1 -1
- package/dist/esm/components/simple-tooltip.js +3 -3
- package/dist/esm/components/simple-tooltip.js.map +1 -1
- package/dist/esm/components/ui/badge.d.ts +2 -2
- package/dist/esm/components/ui/button.d.ts +2 -2
- package/dist/esm/components/ui/form.d.ts +1 -1
- package/dist/esm/components/ui/form.d.ts.map +1 -1
- package/dist/esm/components/ui/resizable.d.ts +1 -1
- package/dist/esm/components/ui/resizable.d.ts.map +1 -1
- package/dist/esm/components/ui/typography.d.ts +1 -1
- package/package.json +3 -2
- package/src/components/action-dialog.tsx +135 -0
- package/src/components/brand-icons.tsx +276 -0
- package/src/components/browser-frame/LICENSE +3 -0
- package/src/components/browser-frame/index.tsx +51 -0
- package/src/components/copy-button.tsx +36 -0
- package/src/components/copy-field.tsx +52 -0
- package/src/components/data-table/cells.tsx +133 -0
- package/src/components/data-table/column-header.tsx +52 -0
- package/src/components/data-table/data-table.tsx +318 -0
- package/src/components/data-table/faceted-filter.tsx +138 -0
- package/src/components/data-table/index.tsx +9 -0
- package/src/components/data-table/pagination.tsx +76 -0
- package/src/components/data-table/toolbar-items.tsx +13 -0
- package/src/components/data-table/toolbar.tsx +100 -0
- package/src/components/data-table/utils.tsx +7 -0
- package/src/components/data-table/view-options.tsx +64 -0
- package/src/components/simple-tooltip.tsx +48 -0
- package/src/components/ui/accordion.tsx +58 -0
- package/src/components/ui/alert.tsx +60 -0
- package/src/components/ui/aspect-ratio.tsx +7 -0
- package/src/components/ui/avatar.tsx +51 -0
- package/src/components/ui/badge.tsx +36 -0
- package/src/components/ui/breadcrumb.tsx +116 -0
- package/src/components/ui/button.tsx +95 -0
- package/src/components/ui/calendar.tsx +77 -0
- package/src/components/ui/card.tsx +88 -0
- package/src/components/ui/checkbox.tsx +31 -0
- package/src/components/ui/collapsible.tsx +11 -0
- package/src/components/ui/command.tsx +159 -0
- package/src/components/ui/context-menu.tsx +205 -0
- package/src/components/ui/dialog.tsx +135 -0
- package/src/components/ui/dropdown-menu.tsx +245 -0
- package/src/components/ui/form.tsx +173 -0
- package/src/components/ui/hover-card.tsx +30 -0
- package/src/components/ui/inline-code.tsx +40 -0
- package/src/components/ui/input-otp.tsx +73 -0
- package/src/components/ui/input.tsx +68 -0
- package/src/components/ui/label.tsx +40 -0
- package/src/components/ui/menubar.tsx +241 -0
- package/src/components/ui/navigation-menu.tsx +131 -0
- package/src/components/ui/password-input.tsx +50 -0
- package/src/components/ui/popover.tsx +34 -0
- package/src/components/ui/progress.tsx +29 -0
- package/src/components/ui/radio-group.tsx +45 -0
- package/src/components/ui/resizable.tsx +45 -0
- package/src/components/ui/scroll-area.tsx +49 -0
- package/src/components/ui/select.tsx +162 -0
- package/src/components/ui/separator.tsx +32 -0
- package/src/components/ui/sheet.tsx +139 -0
- package/src/components/ui/skeleton.tsx +23 -0
- package/src/components/ui/slider.tsx +29 -0
- package/src/components/ui/spinner.tsx +18 -0
- package/src/components/ui/switch.tsx +75 -0
- package/src/components/ui/table.tsx +117 -0
- package/src/components/ui/tabs.tsx +56 -0
- package/src/components/ui/textarea.tsx +24 -0
- package/src/components/ui/toast.tsx +135 -0
- package/src/components/ui/toaster.tsx +35 -0
- package/src/components/ui/toggle-group.tsx +62 -0
- package/src/components/ui/toggle.tsx +46 -0
- package/src/components/ui/tooltip.tsx +40 -0
- package/src/components/ui/typography.tsx +47 -0
- package/src/components/ui/use-toast.tsx +195 -0
- package/src/index.ts +54 -0
- package/src/lib/utils.tsx +6 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { forwardRefIfNeeded } from "@hexclave/shared/dist/utils/react";
|
|
5
|
+
import {
|
|
6
|
+
CheckIcon,
|
|
7
|
+
ChevronRightIcon,
|
|
8
|
+
DotFilledIcon,
|
|
9
|
+
} from "@radix-ui/react-icons";
|
|
10
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
11
|
+
|
|
12
|
+
import { cn } from "../../lib/utils";
|
|
13
|
+
|
|
14
|
+
const MenubarMenu = MenubarPrimitive.Menu as any;
|
|
15
|
+
|
|
16
|
+
const MenubarGroup = MenubarPrimitive.Group;
|
|
17
|
+
|
|
18
|
+
const MenubarPortal = MenubarPrimitive.Portal;
|
|
19
|
+
|
|
20
|
+
const MenubarSub = MenubarPrimitive.Sub;
|
|
21
|
+
|
|
22
|
+
const MenubarRadioGroup = MenubarPrimitive.RadioGroup;
|
|
23
|
+
|
|
24
|
+
const Menubar = React.forwardRef<
|
|
25
|
+
React.ElementRef<typeof MenubarPrimitive.Root>,
|
|
26
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
|
|
27
|
+
>(({ className, ...props }, ref) => (
|
|
28
|
+
<MenubarPrimitive.Root
|
|
29
|
+
ref={ref}
|
|
30
|
+
className={cn(
|
|
31
|
+
"stack-scope flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",
|
|
32
|
+
className
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
));
|
|
37
|
+
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
38
|
+
|
|
39
|
+
const MenubarTrigger = React.forwardRef<
|
|
40
|
+
React.ElementRef<typeof MenubarPrimitive.Trigger>,
|
|
41
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
|
|
42
|
+
>(({ className, ...props }, ref) => (
|
|
43
|
+
<MenubarPrimitive.Trigger
|
|
44
|
+
ref={ref}
|
|
45
|
+
className={cn(
|
|
46
|
+
"flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
47
|
+
className
|
|
48
|
+
)}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
));
|
|
52
|
+
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
|
|
53
|
+
|
|
54
|
+
const MenubarSubTrigger = React.forwardRef<
|
|
55
|
+
React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
|
|
56
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
|
|
57
|
+
inset?: boolean,
|
|
58
|
+
}
|
|
59
|
+
>(({ className, inset, children, ...props }, ref) => (
|
|
60
|
+
<MenubarPrimitive.SubTrigger
|
|
61
|
+
ref={ref}
|
|
62
|
+
className={cn(
|
|
63
|
+
"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",
|
|
64
|
+
inset && "pl-8",
|
|
65
|
+
className
|
|
66
|
+
)}
|
|
67
|
+
{...props}
|
|
68
|
+
>
|
|
69
|
+
{children}
|
|
70
|
+
<ChevronRightIcon className="ml-auto h-4 w-4" />
|
|
71
|
+
</MenubarPrimitive.SubTrigger>
|
|
72
|
+
));
|
|
73
|
+
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
74
|
+
|
|
75
|
+
const MenubarSubContent = React.forwardRef<
|
|
76
|
+
React.ElementRef<typeof MenubarPrimitive.SubContent>,
|
|
77
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
|
|
78
|
+
>(({ className, ...props }, ref) => (
|
|
79
|
+
<MenubarPrimitive.SubContent
|
|
80
|
+
ref={ref}
|
|
81
|
+
className={cn(
|
|
82
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
|
|
83
|
+
className
|
|
84
|
+
)}
|
|
85
|
+
{...props}
|
|
86
|
+
/>
|
|
87
|
+
));
|
|
88
|
+
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
89
|
+
|
|
90
|
+
const MenubarContent = React.forwardRef<
|
|
91
|
+
React.ElementRef<typeof MenubarPrimitive.Content>,
|
|
92
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
|
|
93
|
+
>(
|
|
94
|
+
(
|
|
95
|
+
{ className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
|
|
96
|
+
ref
|
|
97
|
+
) => (
|
|
98
|
+
<MenubarPrimitive.Portal>
|
|
99
|
+
<MenubarPrimitive.Content
|
|
100
|
+
ref={ref}
|
|
101
|
+
align={align}
|
|
102
|
+
alignOffset={alignOffset}
|
|
103
|
+
sideOffset={sideOffset}
|
|
104
|
+
className={cn(
|
|
105
|
+
"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",
|
|
106
|
+
className
|
|
107
|
+
)}
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
</MenubarPrimitive.Portal>
|
|
111
|
+
)
|
|
112
|
+
);
|
|
113
|
+
MenubarContent.displayName = MenubarPrimitive.Content.displayName;
|
|
114
|
+
|
|
115
|
+
const MenubarItem = React.forwardRef<
|
|
116
|
+
React.ElementRef<typeof MenubarPrimitive.Item>,
|
|
117
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
|
|
118
|
+
inset?: boolean,
|
|
119
|
+
}
|
|
120
|
+
>(({ className, inset, ...props }, ref) => (
|
|
121
|
+
<MenubarPrimitive.Item
|
|
122
|
+
ref={ref}
|
|
123
|
+
className={cn(
|
|
124
|
+
"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",
|
|
125
|
+
inset && "pl-8",
|
|
126
|
+
className
|
|
127
|
+
)}
|
|
128
|
+
{...props}
|
|
129
|
+
/>
|
|
130
|
+
));
|
|
131
|
+
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
132
|
+
|
|
133
|
+
const MenubarCheckboxItem = React.forwardRef<
|
|
134
|
+
React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
|
|
135
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
|
|
136
|
+
>(({ className, children, checked, ...props }, ref) => (
|
|
137
|
+
<MenubarPrimitive.CheckboxItem
|
|
138
|
+
ref={ref}
|
|
139
|
+
className={cn(
|
|
140
|
+
"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",
|
|
141
|
+
className
|
|
142
|
+
)}
|
|
143
|
+
checked={checked}
|
|
144
|
+
{...props}
|
|
145
|
+
>
|
|
146
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
147
|
+
<MenubarPrimitive.ItemIndicator>
|
|
148
|
+
<CheckIcon className="h-4 w-4" />
|
|
149
|
+
</MenubarPrimitive.ItemIndicator>
|
|
150
|
+
</span>
|
|
151
|
+
{children}
|
|
152
|
+
</MenubarPrimitive.CheckboxItem>
|
|
153
|
+
));
|
|
154
|
+
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
|
|
155
|
+
|
|
156
|
+
const MenubarRadioItem = React.forwardRef<
|
|
157
|
+
React.ElementRef<typeof MenubarPrimitive.RadioItem>,
|
|
158
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
|
|
159
|
+
>(({ className, children, ...props }, ref) => (
|
|
160
|
+
<MenubarPrimitive.RadioItem
|
|
161
|
+
ref={ref}
|
|
162
|
+
className={cn(
|
|
163
|
+
"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",
|
|
164
|
+
className
|
|
165
|
+
)}
|
|
166
|
+
{...props}
|
|
167
|
+
>
|
|
168
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
169
|
+
<MenubarPrimitive.ItemIndicator>
|
|
170
|
+
<DotFilledIcon className="h-4 w-4 fill-current" />
|
|
171
|
+
</MenubarPrimitive.ItemIndicator>
|
|
172
|
+
</span>
|
|
173
|
+
{children}
|
|
174
|
+
</MenubarPrimitive.RadioItem>
|
|
175
|
+
));
|
|
176
|
+
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
|
|
177
|
+
|
|
178
|
+
const MenubarLabel = React.forwardRef<
|
|
179
|
+
React.ElementRef<typeof MenubarPrimitive.Label>,
|
|
180
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
|
|
181
|
+
inset?: boolean,
|
|
182
|
+
}
|
|
183
|
+
>(({ className, inset, ...props }, ref) => (
|
|
184
|
+
<MenubarPrimitive.Label
|
|
185
|
+
ref={ref}
|
|
186
|
+
className={cn(
|
|
187
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
188
|
+
inset && "pl-8",
|
|
189
|
+
className
|
|
190
|
+
)}
|
|
191
|
+
{...props}
|
|
192
|
+
/>
|
|
193
|
+
));
|
|
194
|
+
MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
|
|
195
|
+
|
|
196
|
+
const MenubarSeparator = forwardRefIfNeeded<
|
|
197
|
+
React.ElementRef<typeof MenubarPrimitive.Separator>,
|
|
198
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
|
|
199
|
+
>(({ className, ...props }, ref) => (
|
|
200
|
+
<MenubarPrimitive.Separator
|
|
201
|
+
ref={ref}
|
|
202
|
+
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
203
|
+
{...props}
|
|
204
|
+
/>
|
|
205
|
+
));
|
|
206
|
+
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
207
|
+
|
|
208
|
+
const MenubarShortcut = ({
|
|
209
|
+
className,
|
|
210
|
+
...props
|
|
211
|
+
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
212
|
+
return (
|
|
213
|
+
<span
|
|
214
|
+
className={cn(
|
|
215
|
+
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
216
|
+
className
|
|
217
|
+
)}
|
|
218
|
+
{...props}
|
|
219
|
+
/>
|
|
220
|
+
);
|
|
221
|
+
};
|
|
222
|
+
MenubarShortcut.displayname = "MenubarShortcut";
|
|
223
|
+
|
|
224
|
+
export {
|
|
225
|
+
Menubar,
|
|
226
|
+
MenubarMenu,
|
|
227
|
+
MenubarTrigger,
|
|
228
|
+
MenubarContent,
|
|
229
|
+
MenubarItem,
|
|
230
|
+
MenubarSeparator,
|
|
231
|
+
MenubarLabel,
|
|
232
|
+
MenubarCheckboxItem,
|
|
233
|
+
MenubarRadioGroup,
|
|
234
|
+
MenubarRadioItem,
|
|
235
|
+
MenubarPortal,
|
|
236
|
+
MenubarSubContent,
|
|
237
|
+
MenubarSubTrigger,
|
|
238
|
+
MenubarGroup,
|
|
239
|
+
MenubarSub,
|
|
240
|
+
MenubarShortcut,
|
|
241
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { forwardRefIfNeeded } from "@hexclave/shared/dist/utils/react";
|
|
5
|
+
import { ChevronDownIcon } from "@radix-ui/react-icons";
|
|
6
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
7
|
+
import { cva } from "class-variance-authority";
|
|
8
|
+
|
|
9
|
+
import { cn } from "../../lib/utils";
|
|
10
|
+
|
|
11
|
+
const NavigationMenu = forwardRefIfNeeded<
|
|
12
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
|
|
13
|
+
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
|
|
14
|
+
>(({ className, children, ...props }, ref) => (
|
|
15
|
+
<NavigationMenuPrimitive.Root
|
|
16
|
+
ref={ref}
|
|
17
|
+
className={cn(
|
|
18
|
+
"stack-scope relative z-10 flex max-w-max flex-1 items-center justify-center",
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
<NavigationMenuViewport />
|
|
25
|
+
</NavigationMenuPrimitive.Root>
|
|
26
|
+
));
|
|
27
|
+
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
|
|
28
|
+
|
|
29
|
+
const NavigationMenuList = forwardRefIfNeeded<
|
|
30
|
+
React.ElementRef<typeof NavigationMenuPrimitive.List>,
|
|
31
|
+
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
|
|
32
|
+
>(({ className, ...props }, ref) => (
|
|
33
|
+
<NavigationMenuPrimitive.List
|
|
34
|
+
ref={ref}
|
|
35
|
+
className={cn(
|
|
36
|
+
"stack-scope group flex flex-1 list-none items-center justify-center space-x-1",
|
|
37
|
+
className
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
));
|
|
42
|
+
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
|
|
43
|
+
|
|
44
|
+
const NavigationMenuItem = NavigationMenuPrimitive.Item;
|
|
45
|
+
|
|
46
|
+
const navigationMenuTriggerStyle = cva(
|
|
47
|
+
"stack-scope group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const NavigationMenuTrigger = forwardRefIfNeeded<
|
|
51
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
|
|
52
|
+
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
|
|
53
|
+
>(({ className, children, ...props }, ref) => (
|
|
54
|
+
<NavigationMenuPrimitive.Trigger
|
|
55
|
+
ref={ref}
|
|
56
|
+
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
{children}{" "}
|
|
60
|
+
<ChevronDownIcon
|
|
61
|
+
className="relative top-[1px] ml-1 h-3 w-3 duration-300 group-data-[state=open]:rotate-180"
|
|
62
|
+
aria-hidden="true"
|
|
63
|
+
/>
|
|
64
|
+
</NavigationMenuPrimitive.Trigger>
|
|
65
|
+
));
|
|
66
|
+
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
67
|
+
|
|
68
|
+
const NavigationMenuContent = forwardRefIfNeeded<
|
|
69
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Content>,
|
|
70
|
+
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
|
|
71
|
+
>(({ className, ...props }, ref) => (
|
|
72
|
+
<NavigationMenuPrimitive.Content
|
|
73
|
+
ref={ref}
|
|
74
|
+
className={cn(
|
|
75
|
+
"stack-scope 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 ",
|
|
76
|
+
className
|
|
77
|
+
)}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
));
|
|
81
|
+
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
82
|
+
|
|
83
|
+
const NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
84
|
+
|
|
85
|
+
const NavigationMenuViewport = forwardRefIfNeeded<
|
|
86
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
|
|
87
|
+
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
|
|
88
|
+
>(({ className, ...props }, ref) => (
|
|
89
|
+
<div className={cn("absolute left-0 top-full flex justify-center")}>
|
|
90
|
+
<NavigationMenuPrimitive.Viewport
|
|
91
|
+
className={cn(
|
|
92
|
+
"stack-scope 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 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)]",
|
|
93
|
+
className
|
|
94
|
+
)}
|
|
95
|
+
ref={ref}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
99
|
+
));
|
|
100
|
+
NavigationMenuViewport.displayName =
|
|
101
|
+
NavigationMenuPrimitive.Viewport.displayName;
|
|
102
|
+
|
|
103
|
+
const NavigationMenuIndicator = forwardRefIfNeeded<
|
|
104
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
|
|
105
|
+
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
|
|
106
|
+
>(({ className, ...props }, ref) => (
|
|
107
|
+
<NavigationMenuPrimitive.Indicator
|
|
108
|
+
ref={ref}
|
|
109
|
+
className={cn(
|
|
110
|
+
"stack-scope 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",
|
|
111
|
+
className
|
|
112
|
+
)}
|
|
113
|
+
{...props}
|
|
114
|
+
>
|
|
115
|
+
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
|
|
116
|
+
</NavigationMenuPrimitive.Indicator>
|
|
117
|
+
));
|
|
118
|
+
NavigationMenuIndicator.displayName =
|
|
119
|
+
NavigationMenuPrimitive.Indicator.displayName;
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
navigationMenuTriggerStyle,
|
|
123
|
+
NavigationMenu,
|
|
124
|
+
NavigationMenuList,
|
|
125
|
+
NavigationMenuItem,
|
|
126
|
+
NavigationMenuContent,
|
|
127
|
+
NavigationMenuTrigger,
|
|
128
|
+
NavigationMenuLink,
|
|
129
|
+
NavigationMenuIndicator,
|
|
130
|
+
NavigationMenuViewport,
|
|
131
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
|
5
|
+
import { Button } from "./button";
|
|
6
|
+
import { Input, InputProps } from "./input";
|
|
7
|
+
import { cn } from "../../lib/utils";
|
|
8
|
+
import { forwardRefIfNeeded } from "@hexclave/shared/dist/utils/react";
|
|
9
|
+
|
|
10
|
+
const PasswordInput = forwardRefIfNeeded<HTMLInputElement, InputProps>(
|
|
11
|
+
({ className, ...props }, ref) => {
|
|
12
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className="relative">
|
|
16
|
+
<Input
|
|
17
|
+
type={showPassword ? "text" : "password"}
|
|
18
|
+
className={cn("stack-scope hide-password-toggle pr-10", className)}
|
|
19
|
+
ref={ref}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
<Button
|
|
23
|
+
type="button"
|
|
24
|
+
variant="ghost"
|
|
25
|
+
size="sm"
|
|
26
|
+
className="absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent"
|
|
27
|
+
onClick={() => setShowPassword((prev) => !prev)}
|
|
28
|
+
disabled={props.disabled}
|
|
29
|
+
aria-label={showPassword ? "Hide password" : "Show password"}
|
|
30
|
+
tabIndex={-1}
|
|
31
|
+
>
|
|
32
|
+
{showPassword ? (
|
|
33
|
+
<EyeIcon
|
|
34
|
+
className="h-4 w-4"
|
|
35
|
+
aria-hidden="true"
|
|
36
|
+
/>
|
|
37
|
+
) : (
|
|
38
|
+
<EyeOffIcon
|
|
39
|
+
className="h-4 w-4"
|
|
40
|
+
aria-hidden="true"
|
|
41
|
+
/>
|
|
42
|
+
)}
|
|
43
|
+
</Button>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
PasswordInput.displayName = "PasswordInput";
|
|
49
|
+
|
|
50
|
+
export { PasswordInput };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { forwardRefIfNeeded } from "@hexclave/shared/dist/utils/react";
|
|
5
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
6
|
+
|
|
7
|
+
import { cn } from "../../lib/utils";
|
|
8
|
+
|
|
9
|
+
const Popover = PopoverPrimitive.Root;
|
|
10
|
+
|
|
11
|
+
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
12
|
+
|
|
13
|
+
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
14
|
+
|
|
15
|
+
const PopoverContent = forwardRefIfNeeded<
|
|
16
|
+
React.ElementRef<typeof PopoverPrimitive.Content>,
|
|
17
|
+
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
|
|
18
|
+
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
|
|
19
|
+
<PopoverPrimitive.Portal>
|
|
20
|
+
<PopoverPrimitive.Content
|
|
21
|
+
ref={ref}
|
|
22
|
+
align={align}
|
|
23
|
+
sideOffset={sideOffset}
|
|
24
|
+
className={cn(
|
|
25
|
+
"stack-scope z-50 pointer-events-auto 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",
|
|
26
|
+
className
|
|
27
|
+
)}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
</PopoverPrimitive.Portal>
|
|
31
|
+
));
|
|
32
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
33
|
+
|
|
34
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { forwardRefIfNeeded } from "@hexclave/shared/dist/utils/react";
|
|
5
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
6
|
+
|
|
7
|
+
import { cn } from "../../lib/utils";
|
|
8
|
+
|
|
9
|
+
const Progress = forwardRefIfNeeded<
|
|
10
|
+
React.ElementRef<typeof ProgressPrimitive.Root>,
|
|
11
|
+
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
|
|
12
|
+
>(({ className, value, ...props }, ref) => (
|
|
13
|
+
<ProgressPrimitive.Root
|
|
14
|
+
ref={ref}
|
|
15
|
+
className={cn(
|
|
16
|
+
"stack-scope relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
>
|
|
21
|
+
<ProgressPrimitive.Indicator
|
|
22
|
+
className="h-full w-full flex-1 bg-primary transition-all"
|
|
23
|
+
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
24
|
+
/>
|
|
25
|
+
</ProgressPrimitive.Root>
|
|
26
|
+
));
|
|
27
|
+
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
28
|
+
|
|
29
|
+
export { Progress };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { CheckIcon } from "@radix-ui/react-icons";
|
|
4
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
5
|
+
import { forwardRefIfNeeded } from "@hexclave/shared/dist/utils/react";
|
|
6
|
+
import React from "react";
|
|
7
|
+
|
|
8
|
+
import { cn } from "../../lib/utils";
|
|
9
|
+
|
|
10
|
+
const RadioGroup = forwardRefIfNeeded<
|
|
11
|
+
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
|
12
|
+
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
|
|
13
|
+
>(({ className, ...props }, ref) => {
|
|
14
|
+
return (
|
|
15
|
+
<RadioGroupPrimitive.Root
|
|
16
|
+
className={cn("stack-scope grid gap-2", className)}
|
|
17
|
+
{...props}
|
|
18
|
+
ref={ref}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
23
|
+
|
|
24
|
+
const RadioGroupItem = forwardRefIfNeeded<
|
|
25
|
+
React.ElementRef<typeof RadioGroupPrimitive.Item>,
|
|
26
|
+
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
|
|
27
|
+
>(({ className, ...props }, ref) => {
|
|
28
|
+
return (
|
|
29
|
+
<RadioGroupPrimitive.Item
|
|
30
|
+
ref={ref}
|
|
31
|
+
className={cn(
|
|
32
|
+
"aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
35
|
+
{...props}
|
|
36
|
+
>
|
|
37
|
+
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
|
|
38
|
+
<CheckIcon className="h-3.5 w-3.5 fill-primary" />
|
|
39
|
+
</RadioGroupPrimitive.Indicator>
|
|
40
|
+
</RadioGroupPrimitive.Item>
|
|
41
|
+
);
|
|
42
|
+
});
|
|
43
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
44
|
+
|
|
45
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as ResizablePrimitive from "react-resizable-panels";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
import { DragHandleDots2Icon } from "@radix-ui/react-icons";
|
|
7
|
+
|
|
8
|
+
const ResizablePanelGroup = ({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
|
|
12
|
+
<ResizablePrimitive.PanelGroup
|
|
13
|
+
className={cn(
|
|
14
|
+
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const ResizablePanel = ResizablePrimitive.Panel;
|
|
22
|
+
|
|
23
|
+
const ResizableHandle = ({
|
|
24
|
+
withHandle,
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
|
28
|
+
withHandle?: boolean,
|
|
29
|
+
}) => (
|
|
30
|
+
<ResizablePrimitive.PanelResizeHandle
|
|
31
|
+
className={cn(
|
|
32
|
+
"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
35
|
+
{...props}
|
|
36
|
+
>
|
|
37
|
+
{withHandle && (
|
|
38
|
+
<div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">
|
|
39
|
+
<DragHandleDots2Icon className="h-2.5 w-2.5" />
|
|
40
|
+
</div>
|
|
41
|
+
)}
|
|
42
|
+
</ResizablePrimitive.PanelResizeHandle>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { forwardRefIfNeeded } from "@hexclave/shared/dist/utils/react";
|
|
5
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
6
|
+
|
|
7
|
+
import { cn } from "../../lib/utils";
|
|
8
|
+
|
|
9
|
+
const ScrollArea = forwardRefIfNeeded<
|
|
10
|
+
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
|
11
|
+
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
|
12
|
+
>(({ className, children, ...props }, ref) => (
|
|
13
|
+
<ScrollAreaPrimitive.Root
|
|
14
|
+
ref={ref}
|
|
15
|
+
className={cn("stack-scope relative overflow-hidden", className)}
|
|
16
|
+
{...props}
|
|
17
|
+
>
|
|
18
|
+
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
|
|
19
|
+
{children}
|
|
20
|
+
</ScrollAreaPrimitive.Viewport>
|
|
21
|
+
<ScrollBar />
|
|
22
|
+
<ScrollAreaPrimitive.Corner />
|
|
23
|
+
</ScrollAreaPrimitive.Root>
|
|
24
|
+
));
|
|
25
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
26
|
+
|
|
27
|
+
const ScrollBar = forwardRefIfNeeded<
|
|
28
|
+
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
|
29
|
+
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
30
|
+
>(({ className, orientation = "vertical", ...props }, ref) => (
|
|
31
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
32
|
+
ref={ref}
|
|
33
|
+
orientation={orientation}
|
|
34
|
+
className={cn(
|
|
35
|
+
"flex touch-none select-none",
|
|
36
|
+
orientation === "vertical" &&
|
|
37
|
+
"h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
38
|
+
orientation === "horizontal" &&
|
|
39
|
+
"h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
>
|
|
44
|
+
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
|
|
45
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
46
|
+
));
|
|
47
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
48
|
+
|
|
49
|
+
export { ScrollArea, ScrollBar };
|