@auto-engineer/frontend-generator-react-graphql 0.11.3 → 0.11.4
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 +10 -0
- package/dist/mui-starter/auto-configure.ts +114 -0
- package/dist/mui-starter/codegen.ts +16 -0
- package/dist/mui-starter/design-system-principles.md +32 -0
- package/dist/mui-starter/eslint.config.ts +57 -0
- package/dist/mui-starter/index.html +26 -0
- package/dist/mui-starter/package.json +70 -0
- package/dist/mui-starter/postcss.config.ts +5 -0
- package/dist/mui-starter/public/favicon.ico +0 -0
- package/dist/mui-starter/src/App.css +42 -0
- package/dist/mui-starter/src/App.tsx +21 -0
- package/dist/mui-starter/src/apolloClient.ts +8 -0
- package/dist/mui-starter/src/hooks/use-mobile.tsx +19 -0
- package/dist/mui-starter/src/hooks/use-toast.ts +186 -0
- package/dist/mui-starter/src/index.css +0 -0
- package/dist/mui-starter/src/main.tsx +5 -0
- package/dist/mui-starter/src/pages/Index.tsx +10 -0
- package/dist/mui-starter/src/pages/NotFound.tsx +20 -0
- package/dist/mui-starter/src/theme.ts +86 -0
- package/dist/mui-starter/src/theme.ts.ejs +3 -0
- package/dist/mui-starter/tsconfig.json +40 -0
- package/dist/mui-starter/vite.config.ts +21 -0
- package/dist/shadcn-starter/auto-configure.ts +107 -0
- package/dist/shadcn-starter/codegen.ts +16 -0
- package/dist/shadcn-starter/components.json +20 -0
- package/dist/shadcn-starter/design-system-principles.md +23 -0
- package/dist/shadcn-starter/eslint.config.ts +57 -0
- package/dist/shadcn-starter/index.html +26 -0
- package/dist/shadcn-starter/package.json +101 -0
- package/dist/shadcn-starter/pnpm-lock.yaml +8234 -0
- package/dist/shadcn-starter/postcss.config.ts +6 -0
- package/dist/shadcn-starter/public/favicon.ico +0 -0
- package/dist/shadcn-starter/src/App.css +6 -0
- package/dist/shadcn-starter/src/App.tsx +28 -0
- package/dist/shadcn-starter/src/apolloClient.ts +8 -0
- package/dist/shadcn-starter/src/components/atoms/accordion.tsx +52 -0
- package/dist/shadcn-starter/src/components/atoms/alert-dialog.tsx +104 -0
- package/dist/shadcn-starter/src/components/atoms/alert.tsx +43 -0
- package/dist/shadcn-starter/src/components/atoms/aspect-ratio.tsx +5 -0
- package/dist/shadcn-starter/src/components/atoms/avatar.tsx +40 -0
- package/dist/shadcn-starter/src/components/atoms/badge.tsx +29 -0
- package/dist/shadcn-starter/src/components/atoms/breadcrumb.tsx +90 -0
- package/dist/shadcn-starter/src/components/atoms/button.tsx +47 -0
- package/dist/shadcn-starter/src/components/atoms/calendar.tsx +158 -0
- package/dist/shadcn-starter/src/components/atoms/card.tsx +43 -0
- package/dist/shadcn-starter/src/components/atoms/carousel.tsx +224 -0
- package/dist/shadcn-starter/src/components/atoms/chart.tsx +307 -0
- package/dist/shadcn-starter/src/components/atoms/checkbox.tsx +26 -0
- package/dist/shadcn-starter/src/components/atoms/collapsible.tsx +11 -0
- package/dist/shadcn-starter/src/components/atoms/command.tsx +132 -0
- package/dist/shadcn-starter/src/components/atoms/context-menu.tsx +178 -0
- package/dist/shadcn-starter/src/components/atoms/dialog.tsx +97 -0
- package/dist/shadcn-starter/src/components/atoms/drawer.tsx +87 -0
- package/dist/shadcn-starter/src/components/atoms/dropdown-menu.tsx +181 -0
- package/dist/shadcn-starter/src/components/atoms/form.tsx +136 -0
- package/dist/shadcn-starter/src/components/atoms/hover-card.tsx +27 -0
- package/dist/shadcn-starter/src/components/atoms/input-otp.tsx +61 -0
- package/dist/shadcn-starter/src/components/atoms/input.tsx +22 -0
- package/dist/shadcn-starter/src/components/atoms/label.tsx +19 -0
- package/dist/shadcn-starter/src/components/atoms/menubar.tsx +217 -0
- package/dist/shadcn-starter/src/components/atoms/navigation-menu.tsx +120 -0
- package/dist/shadcn-starter/src/components/atoms/pagination.tsx +81 -0
- package/dist/shadcn-starter/src/components/atoms/popover.tsx +29 -0
- package/dist/shadcn-starter/src/components/atoms/progress.tsx +25 -0
- package/dist/shadcn-starter/src/components/atoms/radio-group.tsx +36 -0
- package/dist/shadcn-starter/src/components/atoms/resizable.tsx +39 -0
- package/dist/shadcn-starter/src/components/atoms/scroll-area.tsx +38 -0
- package/dist/shadcn-starter/src/components/atoms/select.tsx +145 -0
- package/dist/shadcn-starter/src/components/atoms/separator.tsx +20 -0
- package/dist/shadcn-starter/src/components/atoms/sheet.tsx +109 -0
- package/dist/shadcn-starter/src/components/atoms/sidebar.tsx +641 -0
- package/dist/shadcn-starter/src/components/atoms/skeleton.tsx +7 -0
- package/dist/shadcn-starter/src/components/atoms/slider.tsx +23 -0
- package/dist/shadcn-starter/src/components/atoms/sonner.tsx +29 -0
- package/dist/shadcn-starter/src/components/atoms/switch.tsx +27 -0
- package/dist/shadcn-starter/src/components/atoms/table.tsx +72 -0
- package/dist/shadcn-starter/src/components/atoms/tabs.tsx +53 -0
- package/dist/shadcn-starter/src/components/atoms/textarea.tsx +21 -0
- package/dist/shadcn-starter/src/components/atoms/toggle-group.tsx +51 -0
- package/dist/shadcn-starter/src/components/atoms/toggle.tsx +37 -0
- package/dist/shadcn-starter/src/components/atoms/tooltip.tsx +30 -0
- package/dist/shadcn-starter/src/hooks/use-mobile.tsx +19 -0
- package/dist/shadcn-starter/src/hooks/use-toast.ts +186 -0
- package/dist/shadcn-starter/src/index.css +103 -0
- package/dist/shadcn-starter/src/index.css.ejs +27 -0
- package/dist/shadcn-starter/src/lib/utils.ts +6 -0
- package/dist/shadcn-starter/src/main.tsx +5 -0
- package/dist/shadcn-starter/src/mockApolloClient.ts +93 -0
- package/dist/shadcn-starter/src/pages/NotFound.tsx +22 -0
- package/dist/shadcn-starter/tailwind.config.ts +92 -0
- package/dist/shadcn-starter/tsconfig.json +48 -0
- package/dist/shadcn-starter/vite.config.ts +21 -0
- package/dist/src/commands/generate-client.d.ts +2 -1
- package/dist/src/commands/generate-client.d.ts.map +1 -1
- package/dist/src/commands/generate-client.js +14 -4
- package/dist/src/commands/generate-client.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ApolloProvider } from '@apollo/client';
|
|
2
|
+
// import { Toaster } from '@/components/atoms/toaster';
|
|
3
|
+
// import { Toaster as Sonner } from '@/components/atoms/sonner';
|
|
4
|
+
// import { TooltipProvider } from '@/components/atoms/tooltip';
|
|
5
|
+
import { BrowserRouter, Route, Routes } from 'react-router-dom';
|
|
6
|
+
import { NotFound } from '@/pages/NotFound';
|
|
7
|
+
import { apolloClient } from '@/apolloClient';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
|
|
10
|
+
// Type assertion workaround for React component type issues
|
|
11
|
+
const ApolloProviderTyped = ApolloProvider as any;
|
|
12
|
+
const RoutesTyped = Routes as any;
|
|
13
|
+
const RouteTyped = Route as any;
|
|
14
|
+
|
|
15
|
+
export const App: React.FC = () => (
|
|
16
|
+
<ApolloProviderTyped client={apolloClient}>
|
|
17
|
+
{/* <TooltipProvider> */}
|
|
18
|
+
{/* <Toaster /> */}
|
|
19
|
+
{/* <Sonner /> */}
|
|
20
|
+
<BrowserRouter>
|
|
21
|
+
<RoutesTyped>
|
|
22
|
+
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
|
|
23
|
+
<RouteTyped path="*" element={<NotFound />} />
|
|
24
|
+
</RoutesTyped>
|
|
25
|
+
</BrowserRouter>
|
|
26
|
+
{/* </TooltipProvider> */}
|
|
27
|
+
</ApolloProviderTyped>
|
|
28
|
+
);
|
|
@@ -0,0 +1,52 @@
|
|
|
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 ref={ref} className={cn('border-b', className)} {...props} />
|
|
14
|
+
));
|
|
15
|
+
AccordionItem.displayName = 'AccordionItem';
|
|
16
|
+
|
|
17
|
+
const AccordionTrigger = React.forwardRef<
|
|
18
|
+
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
19
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
|
20
|
+
>(({ className, children, ...props }, ref) => (
|
|
21
|
+
<AccordionPrimitive.Header className="flex">
|
|
22
|
+
<AccordionPrimitive.Trigger
|
|
23
|
+
ref={ref}
|
|
24
|
+
className={cn(
|
|
25
|
+
'flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180',
|
|
26
|
+
className,
|
|
27
|
+
)}
|
|
28
|
+
{...props}
|
|
29
|
+
>
|
|
30
|
+
{children}
|
|
31
|
+
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
32
|
+
</AccordionPrimitive.Trigger>
|
|
33
|
+
</AccordionPrimitive.Header>
|
|
34
|
+
));
|
|
35
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
36
|
+
|
|
37
|
+
const AccordionContent = React.forwardRef<
|
|
38
|
+
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
39
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
|
40
|
+
>(({ className, children, ...props }, ref) => (
|
|
41
|
+
<AccordionPrimitive.Content
|
|
42
|
+
ref={ref}
|
|
43
|
+
className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
44
|
+
{...props}
|
|
45
|
+
>
|
|
46
|
+
<div className={cn('pb-4 pt-0', className)}>{children}</div>
|
|
47
|
+
</AccordionPrimitive.Content>
|
|
48
|
+
));
|
|
49
|
+
|
|
50
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
51
|
+
|
|
52
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,104 @@
|
|
|
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/atoms/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 = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
47
|
+
<div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />
|
|
48
|
+
);
|
|
49
|
+
AlertDialogHeader.displayName = 'AlertDialogHeader';
|
|
50
|
+
|
|
51
|
+
const AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
52
|
+
<div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />
|
|
53
|
+
);
|
|
54
|
+
AlertDialogFooter.displayName = 'AlertDialogFooter';
|
|
55
|
+
|
|
56
|
+
const AlertDialogTitle = React.forwardRef<
|
|
57
|
+
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
58
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
59
|
+
>(({ className, ...props }, ref) => (
|
|
60
|
+
<AlertDialogPrimitive.Title ref={ref} className={cn('text-lg font-semibold', className)} {...props} />
|
|
61
|
+
));
|
|
62
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
63
|
+
|
|
64
|
+
const AlertDialogDescription = React.forwardRef<
|
|
65
|
+
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
66
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
67
|
+
>(({ className, ...props }, ref) => (
|
|
68
|
+
<AlertDialogPrimitive.Description ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
|
|
69
|
+
));
|
|
70
|
+
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
71
|
+
|
|
72
|
+
const AlertDialogAction = React.forwardRef<
|
|
73
|
+
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
74
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
75
|
+
>(({ className, ...props }, ref) => (
|
|
76
|
+
<AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} />
|
|
77
|
+
));
|
|
78
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
79
|
+
|
|
80
|
+
const AlertDialogCancel = React.forwardRef<
|
|
81
|
+
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
82
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
83
|
+
>(({ className, ...props }, ref) => (
|
|
84
|
+
<AlertDialogPrimitive.Cancel
|
|
85
|
+
ref={ref}
|
|
86
|
+
className={cn(buttonVariants({ variant: 'outline' }), 'mt-2 sm:mt-0', className)}
|
|
87
|
+
{...props}
|
|
88
|
+
/>
|
|
89
|
+
));
|
|
90
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
91
|
+
|
|
92
|
+
export {
|
|
93
|
+
AlertDialog,
|
|
94
|
+
AlertDialogPortal,
|
|
95
|
+
AlertDialogOverlay,
|
|
96
|
+
AlertDialogTrigger,
|
|
97
|
+
AlertDialogContent,
|
|
98
|
+
AlertDialogHeader,
|
|
99
|
+
AlertDialogFooter,
|
|
100
|
+
AlertDialogTitle,
|
|
101
|
+
AlertDialogDescription,
|
|
102
|
+
AlertDialogAction,
|
|
103
|
+
AlertDialogCancel,
|
|
104
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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: 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
variant: 'default',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const Alert = React.forwardRef<
|
|
22
|
+
HTMLDivElement,
|
|
23
|
+
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
|
|
24
|
+
>(({ className, variant, ...props }, ref) => (
|
|
25
|
+
<div ref={ref} role="alert" className={cn(alertVariants({ variant }), className)} {...props} />
|
|
26
|
+
));
|
|
27
|
+
Alert.displayName = 'Alert';
|
|
28
|
+
|
|
29
|
+
const AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
|
|
30
|
+
({ className, ...props }, ref) => (
|
|
31
|
+
<h5 ref={ref} className={cn('mb-1 font-medium leading-none tracking-tight', className)} {...props} />
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
AlertTitle.displayName = 'AlertTitle';
|
|
35
|
+
|
|
36
|
+
const AlertDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
|
|
37
|
+
({ className, ...props }, ref) => (
|
|
38
|
+
<div ref={ref} className={cn('text-sm [&_p]:leading-relaxed', className)} {...props} />
|
|
39
|
+
),
|
|
40
|
+
);
|
|
41
|
+
AlertDescription.displayName = 'AlertDescription';
|
|
42
|
+
|
|
43
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,40 @@
|
|
|
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('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
));
|
|
18
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
19
|
+
|
|
20
|
+
const AvatarImage = React.forwardRef<
|
|
21
|
+
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
22
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
23
|
+
>(({ className, ...props }, ref) => (
|
|
24
|
+
<AvatarPrimitive.Image ref={ref} className={cn('aspect-square h-full w-full', className)} {...props} />
|
|
25
|
+
));
|
|
26
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
27
|
+
|
|
28
|
+
const AvatarFallback = React.forwardRef<
|
|
29
|
+
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
30
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
31
|
+
>(({ className, ...props }, ref) => (
|
|
32
|
+
<AvatarPrimitive.Fallback
|
|
33
|
+
ref={ref}
|
|
34
|
+
className={cn('flex h-full w-full items-center justify-center rounded-full bg-muted', className)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
));
|
|
38
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
39
|
+
|
|
40
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,29 @@
|
|
|
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: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
|
|
12
|
+
secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
13
|
+
destructive: 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
|
|
14
|
+
outline: 'text-foreground',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
variant: 'default',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
|
|
24
|
+
|
|
25
|
+
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
26
|
+
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
+
import { ChevronRight, MoreHorizontal } from 'lucide-react';
|
|
4
|
+
|
|
5
|
+
import { cn } from '@/lib/utils';
|
|
6
|
+
|
|
7
|
+
const Breadcrumb = React.forwardRef<
|
|
8
|
+
HTMLElement,
|
|
9
|
+
React.ComponentPropsWithoutRef<'nav'> & {
|
|
10
|
+
separator?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />);
|
|
13
|
+
Breadcrumb.displayName = 'Breadcrumb';
|
|
14
|
+
|
|
15
|
+
const BreadcrumbList = React.forwardRef<HTMLOListElement, React.ComponentPropsWithoutRef<'ol'>>(
|
|
16
|
+
({ className, ...props }, ref) => (
|
|
17
|
+
<ol
|
|
18
|
+
ref={ref}
|
|
19
|
+
className={cn(
|
|
20
|
+
'flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5',
|
|
21
|
+
className,
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
),
|
|
26
|
+
);
|
|
27
|
+
BreadcrumbList.displayName = 'BreadcrumbList';
|
|
28
|
+
|
|
29
|
+
const BreadcrumbItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<'li'>>(
|
|
30
|
+
({ className, ...props }, ref) => (
|
|
31
|
+
<li ref={ref} className={cn('inline-flex items-center gap-1.5', className)} {...props} />
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
35
|
+
|
|
36
|
+
const BreadcrumbLink = React.forwardRef<
|
|
37
|
+
HTMLAnchorElement,
|
|
38
|
+
React.ComponentPropsWithoutRef<'a'> & {
|
|
39
|
+
asChild?: boolean;
|
|
40
|
+
}
|
|
41
|
+
>(({ asChild, className, ...props }, ref) => {
|
|
42
|
+
const Comp = asChild ? Slot : 'a';
|
|
43
|
+
|
|
44
|
+
return <Comp ref={ref} className={cn('transition-colors hover:text-foreground', className)} {...props} />;
|
|
45
|
+
});
|
|
46
|
+
BreadcrumbLink.displayName = 'BreadcrumbLink';
|
|
47
|
+
|
|
48
|
+
const BreadcrumbPage = React.forwardRef<HTMLSpanElement, React.ComponentPropsWithoutRef<'span'>>(
|
|
49
|
+
({ className, ...props }, ref) => (
|
|
50
|
+
<span
|
|
51
|
+
ref={ref}
|
|
52
|
+
role="link"
|
|
53
|
+
aria-disabled="true"
|
|
54
|
+
aria-current="page"
|
|
55
|
+
className={cn('font-normal text-foreground', className)}
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
),
|
|
59
|
+
);
|
|
60
|
+
BreadcrumbPage.displayName = 'BreadcrumbPage';
|
|
61
|
+
|
|
62
|
+
const BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentProps<'li'>) => (
|
|
63
|
+
<li role="presentation" aria-hidden="true" className={cn('[&>svg]:w-3.5 [&>svg]:h-3.5', className)} {...props}>
|
|
64
|
+
{children ?? <ChevronRight />}
|
|
65
|
+
</li>
|
|
66
|
+
);
|
|
67
|
+
BreadcrumbSeparator.displayName = 'BreadcrumbSeparator';
|
|
68
|
+
|
|
69
|
+
const BreadcrumbEllipsis = ({ className, ...props }: React.ComponentProps<'span'>) => (
|
|
70
|
+
<span
|
|
71
|
+
role="presentation"
|
|
72
|
+
aria-hidden="true"
|
|
73
|
+
className={cn('flex h-9 w-9 items-center justify-center', className)}
|
|
74
|
+
{...props}
|
|
75
|
+
>
|
|
76
|
+
<MoreHorizontal className="h-4 w-4" />
|
|
77
|
+
<span className="sr-only">More</span>
|
|
78
|
+
</span>
|
|
79
|
+
);
|
|
80
|
+
BreadcrumbEllipsis.displayName = 'BreadcrumbElipssis';
|
|
81
|
+
|
|
82
|
+
export {
|
|
83
|
+
Breadcrumb,
|
|
84
|
+
BreadcrumbList,
|
|
85
|
+
BreadcrumbItem,
|
|
86
|
+
BreadcrumbLink,
|
|
87
|
+
BreadcrumbPage,
|
|
88
|
+
BreadcrumbSeparator,
|
|
89
|
+
BreadcrumbEllipsis,
|
|
90
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
import { cn } from '@/lib/utils';
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva(
|
|
8
|
+
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
13
|
+
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
|
|
14
|
+
outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
|
|
15
|
+
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
16
|
+
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
17
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
default: 'h-10 px-4 py-2',
|
|
21
|
+
sm: 'h-9 rounded-md px-3',
|
|
22
|
+
lg: 'h-11 rounded-md px-8',
|
|
23
|
+
icon: 'h-10 w-10',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: 'default',
|
|
28
|
+
size: 'default',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
export interface ButtonProps
|
|
34
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
35
|
+
VariantProps<typeof buttonVariants> {
|
|
36
|
+
asChild?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
40
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
41
|
+
const Comp = asChild ? Slot : 'button';
|
|
42
|
+
return <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />;
|
|
43
|
+
},
|
|
44
|
+
);
|
|
45
|
+
Button.displayName = 'Button';
|
|
46
|
+
|
|
47
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
|
|
5
|
+
import { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker';
|
|
6
|
+
|
|
7
|
+
import { cn } from '@/lib/utils';
|
|
8
|
+
import { Button, buttonVariants } from '@/components/atoms/button';
|
|
9
|
+
|
|
10
|
+
function Calendar({
|
|
11
|
+
className,
|
|
12
|
+
classNames,
|
|
13
|
+
showOutsideDays = true,
|
|
14
|
+
captionLayout = 'label',
|
|
15
|
+
buttonVariant = 'ghost',
|
|
16
|
+
formatters,
|
|
17
|
+
components,
|
|
18
|
+
...props
|
|
19
|
+
}: React.ComponentProps<typeof DayPicker> & {
|
|
20
|
+
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
|
|
21
|
+
}) {
|
|
22
|
+
const defaultClassNames = getDefaultClassNames();
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<DayPicker
|
|
26
|
+
showOutsideDays={showOutsideDays}
|
|
27
|
+
className={cn(
|
|
28
|
+
'bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',
|
|
29
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
30
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
captionLayout={captionLayout}
|
|
34
|
+
formatters={{
|
|
35
|
+
formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),
|
|
36
|
+
...formatters,
|
|
37
|
+
}}
|
|
38
|
+
classNames={{
|
|
39
|
+
root: cn('w-fit', defaultClassNames.root),
|
|
40
|
+
months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),
|
|
41
|
+
month: cn('flex w-full flex-col gap-4', defaultClassNames.month),
|
|
42
|
+
nav: cn('absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1', defaultClassNames.nav),
|
|
43
|
+
button_previous: cn(
|
|
44
|
+
buttonVariants({ variant: buttonVariant }),
|
|
45
|
+
'h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50',
|
|
46
|
+
defaultClassNames.button_previous,
|
|
47
|
+
),
|
|
48
|
+
button_next: cn(
|
|
49
|
+
buttonVariants({ variant: buttonVariant }),
|
|
50
|
+
'h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50',
|
|
51
|
+
defaultClassNames.button_next,
|
|
52
|
+
),
|
|
53
|
+
month_caption: cn(
|
|
54
|
+
'flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]',
|
|
55
|
+
defaultClassNames.month_caption,
|
|
56
|
+
),
|
|
57
|
+
dropdowns: cn(
|
|
58
|
+
'flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium',
|
|
59
|
+
defaultClassNames.dropdowns,
|
|
60
|
+
),
|
|
61
|
+
dropdown_root: cn(
|
|
62
|
+
'has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border',
|
|
63
|
+
defaultClassNames.dropdown_root,
|
|
64
|
+
),
|
|
65
|
+
dropdown: cn('bg-popover absolute inset-0 opacity-0', defaultClassNames.dropdown),
|
|
66
|
+
caption_label: cn(
|
|
67
|
+
'select-none font-medium',
|
|
68
|
+
captionLayout === 'label'
|
|
69
|
+
? 'text-sm'
|
|
70
|
+
: '[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5',
|
|
71
|
+
defaultClassNames.caption_label,
|
|
72
|
+
),
|
|
73
|
+
table: 'w-full border-collapse',
|
|
74
|
+
weekdays: cn('flex', defaultClassNames.weekdays),
|
|
75
|
+
weekday: cn(
|
|
76
|
+
'text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal',
|
|
77
|
+
defaultClassNames.weekday,
|
|
78
|
+
),
|
|
79
|
+
week: cn('mt-2 flex w-full', defaultClassNames.week),
|
|
80
|
+
week_number_header: cn('w-[--cell-size] select-none', defaultClassNames.week_number_header),
|
|
81
|
+
week_number: cn('text-muted-foreground select-none text-[0.8rem]', defaultClassNames.week_number),
|
|
82
|
+
day: cn(
|
|
83
|
+
'group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md',
|
|
84
|
+
defaultClassNames.day,
|
|
85
|
+
),
|
|
86
|
+
range_start: cn('bg-accent rounded-l-md', defaultClassNames.range_start),
|
|
87
|
+
range_middle: cn('rounded-none', defaultClassNames.range_middle),
|
|
88
|
+
range_end: cn('bg-accent rounded-r-md', defaultClassNames.range_end),
|
|
89
|
+
today: cn(
|
|
90
|
+
'bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none',
|
|
91
|
+
defaultClassNames.today,
|
|
92
|
+
),
|
|
93
|
+
outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),
|
|
94
|
+
disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
|
|
95
|
+
hidden: cn('invisible', defaultClassNames.hidden),
|
|
96
|
+
...classNames,
|
|
97
|
+
}}
|
|
98
|
+
components={{
|
|
99
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
100
|
+
return <div data-slot="calendar" ref={rootRef} className={cn(className)} {...props} />;
|
|
101
|
+
},
|
|
102
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
103
|
+
if (orientation === 'left') {
|
|
104
|
+
return <ChevronLeftIcon className={cn('size-4', className)} {...props} />;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (orientation === 'right') {
|
|
108
|
+
return <ChevronRightIcon className={cn('size-4', className)} {...props} />;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return <ChevronDownIcon className={cn('size-4', className)} {...props} />;
|
|
112
|
+
},
|
|
113
|
+
DayButton: CalendarDayButton,
|
|
114
|
+
WeekNumber: ({ children, ...props }) => {
|
|
115
|
+
return (
|
|
116
|
+
<td {...props}>
|
|
117
|
+
<div className="flex size-[--cell-size] items-center justify-center text-center">{children}</div>
|
|
118
|
+
</td>
|
|
119
|
+
);
|
|
120
|
+
},
|
|
121
|
+
...components,
|
|
122
|
+
}}
|
|
123
|
+
{...props}
|
|
124
|
+
/>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>) {
|
|
129
|
+
const defaultClassNames = getDefaultClassNames();
|
|
130
|
+
|
|
131
|
+
const ref = React.useRef<HTMLButtonElement>(null);
|
|
132
|
+
React.useEffect(() => {
|
|
133
|
+
if (modifiers.focused) ref.current?.focus();
|
|
134
|
+
}, [modifiers.focused]);
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<Button
|
|
138
|
+
ref={ref}
|
|
139
|
+
variant="ghost"
|
|
140
|
+
size="icon"
|
|
141
|
+
data-day={day.date.toLocaleDateString()}
|
|
142
|
+
data-selected-single={
|
|
143
|
+
modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle
|
|
144
|
+
}
|
|
145
|
+
data-range-start={modifiers.range_start}
|
|
146
|
+
data-range-end={modifiers.range_end}
|
|
147
|
+
data-range-middle={modifiers.range_middle}
|
|
148
|
+
className={cn(
|
|
149
|
+
'data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70',
|
|
150
|
+
defaultClassNames.day,
|
|
151
|
+
className,
|
|
152
|
+
)}
|
|
153
|
+
{...props}
|
|
154
|
+
/>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { cn } from '@/lib/utils';
|
|
4
|
+
|
|
5
|
+
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
|
|
6
|
+
<div ref={ref} className={cn('rounded-lg border bg-card text-card-foreground shadow-sm', className)} {...props} />
|
|
7
|
+
));
|
|
8
|
+
Card.displayName = 'Card';
|
|
9
|
+
|
|
10
|
+
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
11
|
+
({ className, ...props }, ref) => (
|
|
12
|
+
<div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />
|
|
13
|
+
),
|
|
14
|
+
);
|
|
15
|
+
CardHeader.displayName = 'CardHeader';
|
|
16
|
+
|
|
17
|
+
const CardTitle = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
18
|
+
({ className, ...props }, ref) => (
|
|
19
|
+
<div ref={ref} className={cn('text-2xl font-semibold leading-none tracking-tight', className)} {...props} />
|
|
20
|
+
),
|
|
21
|
+
);
|
|
22
|
+
CardTitle.displayName = 'CardTitle';
|
|
23
|
+
|
|
24
|
+
const CardDescription = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
25
|
+
({ className, ...props }, ref) => (
|
|
26
|
+
<div ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
CardDescription.displayName = 'CardDescription';
|
|
30
|
+
|
|
31
|
+
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
32
|
+
({ className, ...props }, ref) => <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />,
|
|
33
|
+
);
|
|
34
|
+
CardContent.displayName = 'CardContent';
|
|
35
|
+
|
|
36
|
+
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
37
|
+
({ className, ...props }, ref) => (
|
|
38
|
+
<div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props} />
|
|
39
|
+
),
|
|
40
|
+
);
|
|
41
|
+
CardFooter.displayName = 'CardFooter';
|
|
42
|
+
|
|
43
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|