pxengine 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +175 -0
- package/config/tailwind-preset.js +106 -0
- package/dist/index.d.mts +1259 -0
- package/dist/index.d.ts +1259 -0
- package/dist/index.js +5175 -0
- package/dist/index.mjs +4929 -0
- package/package.json +94 -0
- package/src/atoms/AccordionAtom.tsx +44 -0
- package/src/atoms/AlertAtom.tsx +46 -0
- package/src/atoms/AlertDialogAtom.tsx +66 -0
- package/src/atoms/AspectRatioAtom.tsx +27 -0
- package/src/atoms/AvatarAtom.tsx +20 -0
- package/src/atoms/BadgeAtom.tsx +25 -0
- package/src/atoms/BreadcrumbAtom.tsx +36 -0
- package/src/atoms/ButtonAtom.tsx +63 -0
- package/src/atoms/CalendarAtom.tsx +24 -0
- package/src/atoms/CardAtom.tsx +64 -0
- package/src/atoms/CarouselAtom.tsx +40 -0
- package/src/atoms/CollapsibleAtom.tsx +44 -0
- package/src/atoms/CommandAtom.tsx +46 -0
- package/src/atoms/DialogAtom.tsx +68 -0
- package/src/atoms/InputAtom.tsx +162 -0
- package/src/atoms/LayoutAtom.tsx +43 -0
- package/src/atoms/PaginationAtom.tsx +49 -0
- package/src/atoms/PopoverAtom.tsx +40 -0
- package/src/atoms/ProgressAtom.tsx +15 -0
- package/src/atoms/ScrollAreaAtom.tsx +31 -0
- package/src/atoms/SeparatorAtom.tsx +16 -0
- package/src/atoms/SheetAtom.tsx +72 -0
- package/src/atoms/SkeletonAtom.tsx +22 -0
- package/src/atoms/SpinnerAtom.tsx +26 -0
- package/src/atoms/TableAtom.tsx +58 -0
- package/src/atoms/TabsAtom.tsx +40 -0
- package/src/atoms/TextAtom.tsx +35 -0
- package/src/atoms/TooltipAtom.tsx +39 -0
- package/src/atoms/index.ts +28 -0
- package/src/components/index.ts +178 -0
- package/src/components/ui/accordion.tsx +56 -0
- package/src/components/ui/alert-dialog.tsx +139 -0
- package/src/components/ui/alert.tsx +59 -0
- package/src/components/ui/aspect-ratio.tsx +5 -0
- package/src/components/ui/avatar.tsx +50 -0
- package/src/components/ui/badge.tsx +36 -0
- package/src/components/ui/breadcrumb.tsx +115 -0
- package/src/components/ui/button-group.tsx +83 -0
- package/src/components/ui/button.tsx +56 -0
- package/src/components/ui/calendar.tsx +213 -0
- package/src/components/ui/card.tsx +79 -0
- package/src/components/ui/carousel.tsx +260 -0
- package/src/components/ui/chart.tsx +367 -0
- package/src/components/ui/checkbox.tsx +28 -0
- package/src/components/ui/collapsible.tsx +11 -0
- package/src/components/ui/command.tsx +153 -0
- package/src/components/ui/context-menu.tsx +198 -0
- package/src/components/ui/dialog.tsx +122 -0
- package/src/components/ui/drawer.tsx +116 -0
- package/src/components/ui/dropdown-menu.tsx +200 -0
- package/src/components/ui/empty.tsx +104 -0
- package/src/components/ui/field.tsx +244 -0
- package/src/components/ui/form.tsx +176 -0
- package/src/components/ui/hover-card.tsx +27 -0
- package/src/components/ui/input-group.tsx +168 -0
- package/src/components/ui/input-otp.tsx +69 -0
- package/src/components/ui/input.tsx +22 -0
- package/src/components/ui/item.tsx +193 -0
- package/src/components/ui/kbd.tsx +28 -0
- package/src/components/ui/label.tsx +26 -0
- package/src/components/ui/menubar.tsx +254 -0
- package/src/components/ui/navigation-menu.tsx +128 -0
- package/src/components/ui/pagination.tsx +117 -0
- package/src/components/ui/popover.tsx +29 -0
- package/src/components/ui/progress.tsx +28 -0
- package/src/components/ui/radio-group.tsx +42 -0
- package/src/components/ui/resizable.tsx +45 -0
- package/src/components/ui/scroll-area.tsx +46 -0
- package/src/components/ui/select.tsx +160 -0
- package/src/components/ui/separator.tsx +29 -0
- package/src/components/ui/sheet.tsx +140 -0
- package/src/components/ui/sidebar.tsx +771 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/slider.tsx +26 -0
- package/src/components/ui/sonner.tsx +45 -0
- package/src/components/ui/spinner.tsx +16 -0
- package/src/components/ui/switch.tsx +27 -0
- package/src/components/ui/table.tsx +117 -0
- package/src/components/ui/tabs.tsx +53 -0
- package/src/components/ui/textarea.tsx +22 -0
- package/src/components/ui/toggle-group.tsx +61 -0
- package/src/components/ui/toggle.tsx +43 -0
- package/src/components/ui/tooltip.tsx +30 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/index.ts +24 -0
- package/src/lib/countries.ts +203 -0
- package/src/lib/index.ts +2 -0
- package/src/lib/utils.ts +15 -0
- package/src/lib/validators/index.ts +1 -0
- package/src/lib/validators/theme.ts +148 -0
- package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.tsx +123 -0
- package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.types.ts +13 -0
- package/src/molecules/creator-discovery/CampaignSeedCard/index.ts +2 -0
- package/src/molecules/creator-discovery/MCQCard/MCQCard.tsx +165 -0
- package/src/molecules/creator-discovery/MCQCard/MCQCard.types.ts +71 -0
- package/src/molecules/creator-discovery/MCQCard/index.ts +2 -0
- package/src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx +334 -0
- package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx +111 -0
- package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.types.ts +18 -0
- package/src/molecules/creator-discovery/SearchSpecCard/index.ts +3 -0
- package/src/molecules/creator-discovery/index.ts +3 -0
- package/src/molecules/generic/ActionButton/ActionButton.tsx +137 -0
- package/src/molecules/generic/ActionButton/ActionButton.types.ts +68 -0
- package/src/molecules/generic/ActionButton/index.ts +2 -0
- package/src/molecules/generic/EditableField/EditableField.tsx +229 -0
- package/src/molecules/generic/EditableField/EditableField.types.ts +73 -0
- package/src/molecules/generic/EditableField/index.ts +2 -0
- package/src/molecules/generic/FormCard/FormCard.tsx +136 -0
- package/src/molecules/generic/FormCard/FormCard.types.ts +93 -0
- package/src/molecules/generic/FormCard/index.ts +2 -0
- package/src/molecules/generic/index.ts +3 -0
- package/src/molecules/index.ts +2 -0
- package/src/render/PXEngineRenderer.tsx +272 -0
- package/src/render/index.ts +1 -0
- package/src/styles/globals.css +146 -0
- package/src/types/atoms.ts +294 -0
- package/src/types/common.ts +116 -0
- package/src/types/index.ts +3 -0
- package/src/types/molecules.ts +54 -0
- package/src/types/schema.ts +12 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Tooltip,
|
|
4
|
+
TooltipContent,
|
|
5
|
+
TooltipProvider,
|
|
6
|
+
TooltipTrigger,
|
|
7
|
+
} from "@/components/ui/tooltip";
|
|
8
|
+
import { TooltipAtomType, UIComponent } from "../types/schema";
|
|
9
|
+
import { cn } from "@/lib/utils";
|
|
10
|
+
|
|
11
|
+
interface Props extends TooltipAtomType {
|
|
12
|
+
renderComponent: (component: UIComponent) => React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const TooltipAtom: React.FC<Props> = ({
|
|
16
|
+
content,
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
19
|
+
renderComponent,
|
|
20
|
+
}) => {
|
|
21
|
+
return (
|
|
22
|
+
<TooltipProvider>
|
|
23
|
+
<Tooltip>
|
|
24
|
+
<TooltipTrigger asChild>
|
|
25
|
+
<div className={cn("inline-block", className)}>
|
|
26
|
+
{children.map((child) => (
|
|
27
|
+
<React.Fragment key={child.id}>
|
|
28
|
+
{renderComponent(child)}
|
|
29
|
+
</React.Fragment>
|
|
30
|
+
))}
|
|
31
|
+
</div>
|
|
32
|
+
</TooltipTrigger>
|
|
33
|
+
<TooltipContent className="bg-gray-900 text-white border-none rounded-lg shadow-xl px-3 py-1.5 text-xs">
|
|
34
|
+
{content}
|
|
35
|
+
</TooltipContent>
|
|
36
|
+
</Tooltip>
|
|
37
|
+
</TooltipProvider>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export * from "./TextAtom";
|
|
2
|
+
export * from "./ButtonAtom";
|
|
3
|
+
export * from "./LayoutAtom";
|
|
4
|
+
export * from "./CardAtom";
|
|
5
|
+
export * from "./InputAtom";
|
|
6
|
+
export * from "./BadgeAtom";
|
|
7
|
+
export * from "./AvatarAtom";
|
|
8
|
+
export * from "./TabsAtom";
|
|
9
|
+
export * from "./AccordionAtom";
|
|
10
|
+
export * from "./ProgressAtom";
|
|
11
|
+
export * from "./SkeletonAtom";
|
|
12
|
+
export * from "./AlertAtom";
|
|
13
|
+
export * from "./SeparatorAtom";
|
|
14
|
+
export * from "./TableAtom";
|
|
15
|
+
export * from "./ScrollAreaAtom";
|
|
16
|
+
export * from "./CarouselAtom";
|
|
17
|
+
export * from "./AspectRatioAtom";
|
|
18
|
+
export * from "./CollapsibleAtom";
|
|
19
|
+
export * from "./TooltipAtom";
|
|
20
|
+
export * from "./PopoverAtom";
|
|
21
|
+
export * from "./DialogAtom";
|
|
22
|
+
export * from "./SheetAtom";
|
|
23
|
+
export * from "./AlertDialogAtom";
|
|
24
|
+
export * from "./BreadcrumbAtom";
|
|
25
|
+
export * from "./SpinnerAtom";
|
|
26
|
+
export * from "./CalendarAtom";
|
|
27
|
+
export * from "./PaginationAtom";
|
|
28
|
+
export * from "./CommandAtom";
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shadcn UI Components (Atoms)
|
|
3
|
+
* Organized by category for easy importing
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// ========== FORM COMPONENTS ==========
|
|
7
|
+
export { Button } from "./ui/button";
|
|
8
|
+
export { Input } from "./ui/input";
|
|
9
|
+
export { Label } from "./ui/label";
|
|
10
|
+
export { Checkbox } from "./ui/checkbox";
|
|
11
|
+
export { RadioGroup, RadioGroupItem } from "./ui/radio-group";
|
|
12
|
+
export { Switch } from "./ui/switch";
|
|
13
|
+
export { Slider } from "./ui/slider";
|
|
14
|
+
export { Textarea } from "./ui/textarea";
|
|
15
|
+
export {
|
|
16
|
+
Select,
|
|
17
|
+
SelectGroup,
|
|
18
|
+
SelectValue,
|
|
19
|
+
SelectTrigger,
|
|
20
|
+
SelectContent,
|
|
21
|
+
SelectLabel,
|
|
22
|
+
SelectItem,
|
|
23
|
+
SelectSeparator,
|
|
24
|
+
SelectScrollUpButton,
|
|
25
|
+
SelectScrollDownButton,
|
|
26
|
+
} from "./ui/select";
|
|
27
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "./ui/input-otp";
|
|
28
|
+
export {
|
|
29
|
+
Form,
|
|
30
|
+
FormControl,
|
|
31
|
+
FormDescription,
|
|
32
|
+
FormField,
|
|
33
|
+
FormItem,
|
|
34
|
+
FormLabel,
|
|
35
|
+
FormMessage,
|
|
36
|
+
} from "./ui/form";
|
|
37
|
+
|
|
38
|
+
// ========== LAYOUT COMPONENTS ==========
|
|
39
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from "./ui/card";
|
|
40
|
+
export { Separator } from "./ui/separator";
|
|
41
|
+
export { ScrollArea, ScrollBar } from "./ui/scroll-area";
|
|
42
|
+
export { AspectRatio } from "./ui/aspect-ratio";
|
|
43
|
+
export { ResizablePanelGroup, ResizablePanel } from "./ui/resizable";
|
|
44
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./ui/tabs";
|
|
45
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "./ui/accordion";
|
|
46
|
+
export { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible";
|
|
47
|
+
|
|
48
|
+
// ========== OVERLAY COMPONENTS ==========
|
|
49
|
+
export {
|
|
50
|
+
Dialog,
|
|
51
|
+
DialogClose,
|
|
52
|
+
DialogContent,
|
|
53
|
+
DialogDescription,
|
|
54
|
+
DialogFooter,
|
|
55
|
+
DialogHeader,
|
|
56
|
+
DialogTitle,
|
|
57
|
+
DialogTrigger,
|
|
58
|
+
} from "./ui/dialog";
|
|
59
|
+
export {
|
|
60
|
+
Sheet,
|
|
61
|
+
SheetClose,
|
|
62
|
+
SheetContent,
|
|
63
|
+
SheetDescription,
|
|
64
|
+
SheetFooter,
|
|
65
|
+
SheetHeader,
|
|
66
|
+
SheetTitle,
|
|
67
|
+
SheetTrigger,
|
|
68
|
+
} from "./ui/sheet";
|
|
69
|
+
export {
|
|
70
|
+
Drawer,
|
|
71
|
+
DrawerClose,
|
|
72
|
+
DrawerContent,
|
|
73
|
+
DrawerDescription,
|
|
74
|
+
DrawerFooter,
|
|
75
|
+
DrawerHeader,
|
|
76
|
+
DrawerTitle,
|
|
77
|
+
DrawerTrigger,
|
|
78
|
+
} from "./ui/drawer";
|
|
79
|
+
export {
|
|
80
|
+
AlertDialog,
|
|
81
|
+
AlertDialogAction,
|
|
82
|
+
AlertDialogCancel,
|
|
83
|
+
AlertDialogContent,
|
|
84
|
+
AlertDialogDescription,
|
|
85
|
+
AlertDialogFooter,
|
|
86
|
+
AlertDialogHeader,
|
|
87
|
+
AlertDialogTitle,
|
|
88
|
+
AlertDialogTrigger,
|
|
89
|
+
} from "./ui/alert-dialog";
|
|
90
|
+
export { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
|
|
91
|
+
export { HoverCard, HoverCardContent, HoverCardTrigger } from "./ui/hover-card";
|
|
92
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip";
|
|
93
|
+
|
|
94
|
+
// ========== NAVIGATION COMPONENTS ==========
|
|
95
|
+
export {
|
|
96
|
+
DropdownMenu,
|
|
97
|
+
DropdownMenuCheckboxItem,
|
|
98
|
+
DropdownMenuContent,
|
|
99
|
+
DropdownMenuItem,
|
|
100
|
+
DropdownMenuLabel,
|
|
101
|
+
DropdownMenuPortal,
|
|
102
|
+
DropdownMenuRadioGroup,
|
|
103
|
+
DropdownMenuRadioItem,
|
|
104
|
+
DropdownMenuSeparator,
|
|
105
|
+
DropdownMenuShortcut,
|
|
106
|
+
DropdownMenuTrigger,
|
|
107
|
+
} from "./ui/dropdown-menu";
|
|
108
|
+
export {
|
|
109
|
+
ContextMenu,
|
|
110
|
+
ContextMenuContent,
|
|
111
|
+
ContextMenuItem,
|
|
112
|
+
ContextMenuCheckboxItem,
|
|
113
|
+
ContextMenuRadioItem,
|
|
114
|
+
ContextMenuLabel,
|
|
115
|
+
ContextMenuSeparator,
|
|
116
|
+
ContextMenuShortcut,
|
|
117
|
+
ContextMenuTrigger,
|
|
118
|
+
} from "./ui/context-menu";
|
|
119
|
+
export {
|
|
120
|
+
Menubar,
|
|
121
|
+
MenubarContent,
|
|
122
|
+
MenubarItem,
|
|
123
|
+
MenubarCheckboxItem,
|
|
124
|
+
MenubarRadioItem,
|
|
125
|
+
MenubarLabel,
|
|
126
|
+
MenubarSeparator,
|
|
127
|
+
MenubarShortcut,
|
|
128
|
+
MenubarTrigger,
|
|
129
|
+
} from "./ui/menubar";
|
|
130
|
+
export {
|
|
131
|
+
NavigationMenu,
|
|
132
|
+
NavigationMenuContent,
|
|
133
|
+
NavigationMenuItem,
|
|
134
|
+
NavigationMenuLink,
|
|
135
|
+
NavigationMenuList,
|
|
136
|
+
NavigationMenuTrigger,
|
|
137
|
+
} from "./ui/navigation-menu";
|
|
138
|
+
export {
|
|
139
|
+
Breadcrumb,
|
|
140
|
+
BreadcrumbItem,
|
|
141
|
+
BreadcrumbLink,
|
|
142
|
+
BreadcrumbList,
|
|
143
|
+
BreadcrumbPage,
|
|
144
|
+
BreadcrumbSeparator,
|
|
145
|
+
} from "./ui/breadcrumb";
|
|
146
|
+
export {
|
|
147
|
+
Pagination,
|
|
148
|
+
PaginationContent,
|
|
149
|
+
PaginationEllipsis,
|
|
150
|
+
PaginationItem,
|
|
151
|
+
PaginationLink,
|
|
152
|
+
PaginationNext,
|
|
153
|
+
PaginationPrevious,
|
|
154
|
+
} from "./ui/pagination";
|
|
155
|
+
export {
|
|
156
|
+
Command,
|
|
157
|
+
CommandDialog,
|
|
158
|
+
CommandEmpty,
|
|
159
|
+
CommandGroup,
|
|
160
|
+
CommandInput,
|
|
161
|
+
CommandItem,
|
|
162
|
+
CommandList,
|
|
163
|
+
CommandSeparator,
|
|
164
|
+
CommandShortcut,
|
|
165
|
+
} from "./ui/command";
|
|
166
|
+
|
|
167
|
+
// ========== DATA DISPLAY COMPONENTS ==========
|
|
168
|
+
export { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from "./ui/table";
|
|
169
|
+
export { Avatar, AvatarFallback, AvatarImage } from "./ui/avatar";
|
|
170
|
+
export { Badge } from "./ui/badge";
|
|
171
|
+
export { Alert, AlertDescription, AlertTitle } from "./ui/alert";
|
|
172
|
+
export { Progress } from "./ui/progress";
|
|
173
|
+
export { Skeleton } from "./ui/skeleton";
|
|
174
|
+
export { Calendar } from "./ui/calendar";
|
|
175
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "./ui/carousel";
|
|
176
|
+
|
|
177
|
+
// ========== UTILITY COMPONENTS ==========
|
|
178
|
+
export { Spinner } from "./ui/spinner";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion"
|
|
3
|
+
import { ChevronDown } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
const Accordion = AccordionPrimitive.Root
|
|
8
|
+
|
|
9
|
+
const AccordionItem = React.forwardRef<
|
|
10
|
+
React.ElementRef<typeof AccordionPrimitive.Item>,
|
|
11
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
|
|
12
|
+
>(({ className, ...props }, ref) => (
|
|
13
|
+
<AccordionPrimitive.Item
|
|
14
|
+
ref={ref}
|
|
15
|
+
className={cn("border-b", className)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
))
|
|
19
|
+
AccordionItem.displayName = "AccordionItem"
|
|
20
|
+
|
|
21
|
+
const AccordionTrigger = React.forwardRef<
|
|
22
|
+
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
23
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
|
24
|
+
>(({ className, children, ...props }, ref) => (
|
|
25
|
+
<AccordionPrimitive.Header className="flex">
|
|
26
|
+
<AccordionPrimitive.Trigger
|
|
27
|
+
ref={ref}
|
|
28
|
+
className={cn(
|
|
29
|
+
"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
|
|
30
|
+
className
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
>
|
|
34
|
+
{children}
|
|
35
|
+
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
36
|
+
</AccordionPrimitive.Trigger>
|
|
37
|
+
</AccordionPrimitive.Header>
|
|
38
|
+
))
|
|
39
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
|
|
40
|
+
|
|
41
|
+
const AccordionContent = React.forwardRef<
|
|
42
|
+
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
43
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
|
44
|
+
>(({ className, children, ...props }, ref) => (
|
|
45
|
+
<AccordionPrimitive.Content
|
|
46
|
+
ref={ref}
|
|
47
|
+
className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
48
|
+
{...props}
|
|
49
|
+
>
|
|
50
|
+
<div className={cn("pb-4 pt-0", className)}>{children}</div>
|
|
51
|
+
</AccordionPrimitive.Content>
|
|
52
|
+
))
|
|
53
|
+
|
|
54
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName
|
|
55
|
+
|
|
56
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { buttonVariants } from "@/components/ui/button"
|
|
6
|
+
|
|
7
|
+
const AlertDialog = AlertDialogPrimitive.Root
|
|
8
|
+
|
|
9
|
+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
|
10
|
+
|
|
11
|
+
const AlertDialogPortal = AlertDialogPrimitive.Portal
|
|
12
|
+
|
|
13
|
+
const AlertDialogOverlay = React.forwardRef<
|
|
14
|
+
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
15
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
16
|
+
>(({ className, ...props }, ref) => (
|
|
17
|
+
<AlertDialogPrimitive.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
|
+
))
|
|
26
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
|
|
27
|
+
|
|
28
|
+
const AlertDialogContent = React.forwardRef<
|
|
29
|
+
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
30
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
|
|
31
|
+
>(({ className, ...props }, ref) => (
|
|
32
|
+
<AlertDialogPortal>
|
|
33
|
+
<AlertDialogOverlay />
|
|
34
|
+
<AlertDialogPrimitive.Content
|
|
35
|
+
ref={ref}
|
|
36
|
+
className={cn(
|
|
37
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
38
|
+
className
|
|
39
|
+
)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
</AlertDialogPortal>
|
|
43
|
+
))
|
|
44
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
|
|
45
|
+
|
|
46
|
+
const AlertDialogHeader = ({
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
50
|
+
<div
|
|
51
|
+
className={cn(
|
|
52
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
53
|
+
className
|
|
54
|
+
)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
)
|
|
58
|
+
AlertDialogHeader.displayName = "AlertDialogHeader"
|
|
59
|
+
|
|
60
|
+
const AlertDialogFooter = ({
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
64
|
+
<div
|
|
65
|
+
className={cn(
|
|
66
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
67
|
+
className
|
|
68
|
+
)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
)
|
|
72
|
+
AlertDialogFooter.displayName = "AlertDialogFooter"
|
|
73
|
+
|
|
74
|
+
const AlertDialogTitle = React.forwardRef<
|
|
75
|
+
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
76
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
77
|
+
>(({ className, ...props }, ref) => (
|
|
78
|
+
<AlertDialogPrimitive.Title
|
|
79
|
+
ref={ref}
|
|
80
|
+
className={cn("text-lg font-semibold", className)}
|
|
81
|
+
{...props}
|
|
82
|
+
/>
|
|
83
|
+
))
|
|
84
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
|
|
85
|
+
|
|
86
|
+
const AlertDialogDescription = React.forwardRef<
|
|
87
|
+
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
88
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
89
|
+
>(({ className, ...props }, ref) => (
|
|
90
|
+
<AlertDialogPrimitive.Description
|
|
91
|
+
ref={ref}
|
|
92
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
93
|
+
{...props}
|
|
94
|
+
/>
|
|
95
|
+
))
|
|
96
|
+
AlertDialogDescription.displayName =
|
|
97
|
+
AlertDialogPrimitive.Description.displayName
|
|
98
|
+
|
|
99
|
+
const AlertDialogAction = React.forwardRef<
|
|
100
|
+
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
101
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
102
|
+
>(({ className, ...props }, ref) => (
|
|
103
|
+
<AlertDialogPrimitive.Action
|
|
104
|
+
ref={ref}
|
|
105
|
+
className={cn(buttonVariants(), className)}
|
|
106
|
+
{...props}
|
|
107
|
+
/>
|
|
108
|
+
))
|
|
109
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
|
|
110
|
+
|
|
111
|
+
const AlertDialogCancel = React.forwardRef<
|
|
112
|
+
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
113
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
114
|
+
>(({ className, ...props }, ref) => (
|
|
115
|
+
<AlertDialogPrimitive.Cancel
|
|
116
|
+
ref={ref}
|
|
117
|
+
className={cn(
|
|
118
|
+
buttonVariants({ variant: "outline" }),
|
|
119
|
+
"mt-2 sm:mt-0",
|
|
120
|
+
className
|
|
121
|
+
)}
|
|
122
|
+
{...props}
|
|
123
|
+
/>
|
|
124
|
+
))
|
|
125
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
|
|
126
|
+
|
|
127
|
+
export {
|
|
128
|
+
AlertDialog,
|
|
129
|
+
AlertDialogPortal,
|
|
130
|
+
AlertDialogOverlay,
|
|
131
|
+
AlertDialogTrigger,
|
|
132
|
+
AlertDialogContent,
|
|
133
|
+
AlertDialogHeader,
|
|
134
|
+
AlertDialogFooter,
|
|
135
|
+
AlertDialogTitle,
|
|
136
|
+
AlertDialogDescription,
|
|
137
|
+
AlertDialogAction,
|
|
138
|
+
AlertDialogCancel,
|
|
139
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
const alertVariants = cva(
|
|
7
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-background text-foreground",
|
|
12
|
+
destructive:
|
|
13
|
+
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
const Alert = React.forwardRef<
|
|
23
|
+
HTMLDivElement,
|
|
24
|
+
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
|
|
25
|
+
>(({ className, variant, ...props }, ref) => (
|
|
26
|
+
<div
|
|
27
|
+
ref={ref}
|
|
28
|
+
role="alert"
|
|
29
|
+
className={cn(alertVariants({ variant }), className)}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
))
|
|
33
|
+
Alert.displayName = "Alert"
|
|
34
|
+
|
|
35
|
+
const AlertTitle = React.forwardRef<
|
|
36
|
+
HTMLParagraphElement,
|
|
37
|
+
React.HTMLAttributes<HTMLHeadingElement>
|
|
38
|
+
>(({ className, ...props }, ref) => (
|
|
39
|
+
<h5
|
|
40
|
+
ref={ref}
|
|
41
|
+
className={cn("mb-1 font-medium leading-none tracking-tight", className)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
))
|
|
45
|
+
AlertTitle.displayName = "AlertTitle"
|
|
46
|
+
|
|
47
|
+
const AlertDescription = React.forwardRef<
|
|
48
|
+
HTMLParagraphElement,
|
|
49
|
+
React.HTMLAttributes<HTMLParagraphElement>
|
|
50
|
+
>(({ className, ...props }, ref) => (
|
|
51
|
+
<div
|
|
52
|
+
ref={ref}
|
|
53
|
+
className={cn("text-sm [&_p]:leading-relaxed", className)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
))
|
|
57
|
+
AlertDescription.displayName = "AlertDescription"
|
|
58
|
+
|
|
59
|
+
export { Alert, AlertTitle, AlertDescription }
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const Avatar = React.forwardRef<
|
|
9
|
+
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
10
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
11
|
+
>(({ className, ...props }, ref) => (
|
|
12
|
+
<AvatarPrimitive.Root
|
|
13
|
+
ref={ref}
|
|
14
|
+
className={cn(
|
|
15
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
))
|
|
21
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName
|
|
22
|
+
|
|
23
|
+
const AvatarImage = React.forwardRef<
|
|
24
|
+
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
25
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
26
|
+
>(({ className, ...props }, ref) => (
|
|
27
|
+
<AvatarPrimitive.Image
|
|
28
|
+
ref={ref}
|
|
29
|
+
className={cn("aspect-square h-full w-full", className)}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
))
|
|
33
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName
|
|
34
|
+
|
|
35
|
+
const AvatarFallback = React.forwardRef<
|
|
36
|
+
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
37
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
38
|
+
>(({ className, ...props }, ref) => (
|
|
39
|
+
<AvatarPrimitive.Fallback
|
|
40
|
+
ref={ref}
|
|
41
|
+
className={cn(
|
|
42
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
))
|
|
48
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
|
|
49
|
+
|
|
50
|
+
export { Avatar, AvatarImage, AvatarFallback }
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
const badgeVariants = cva(
|
|
7
|
+
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default:
|
|
12
|
+
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
13
|
+
secondary:
|
|
14
|
+
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
15
|
+
destructive:
|
|
16
|
+
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
17
|
+
outline: "text-foreground",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default",
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
export interface BadgeProps
|
|
27
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
28
|
+
VariantProps<typeof badgeVariants> {}
|
|
29
|
+
|
|
30
|
+
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
31
|
+
return (
|
|
32
|
+
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { Badge, badgeVariants }
|