luxlabs 1.0.1 → 1.0.3
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/package.json +1 -1
- package/templates/interface-boilerplate/app/api/auth/[...all]/route.ts +52 -0
- package/templates/interface-boilerplate/app/auth/callback/page.tsx +22 -31
- package/templates/interface-boilerplate/app/dashboard/page.tsx +41 -214
- package/templates/interface-boilerplate/app/favicon.ico +0 -0
- package/templates/interface-boilerplate/app/globals.css +18 -113
- package/templates/interface-boilerplate/app/layout.tsx +21 -33
- package/templates/interface-boilerplate/app/page.tsx +37 -116
- package/templates/interface-boilerplate/app/settings/page.tsx +71 -0
- package/templates/interface-boilerplate/app/sign-in/page.tsx +19 -0
- package/templates/interface-boilerplate/app/sign-up/page.tsx +19 -0
- package/templates/interface-boilerplate/components/auth/sign-in-form.tsx +144 -0
- package/templates/interface-boilerplate/components/auth/sign-up-form.tsx +236 -0
- package/templates/interface-boilerplate/components/ui/badge.tsx +18 -14
- package/templates/interface-boilerplate/components/ui/button.tsx +29 -24
- package/templates/interface-boilerplate/components/ui/card.tsx +76 -57
- package/templates/interface-boilerplate/components/ui/input.tsx +8 -9
- package/templates/interface-boilerplate/eslint.config.mjs +18 -0
- package/templates/interface-boilerplate/lib/auth-client.ts +18 -0
- package/templates/interface-boilerplate/lib/auth.config.ts +111 -0
- package/templates/interface-boilerplate/lib/lux.ts +8 -0
- package/templates/interface-boilerplate/lib/utils.ts +3 -3
- package/templates/interface-boilerplate/middleware.ts +60 -0
- package/templates/interface-boilerplate/next.config.ts +7 -0
- package/templates/interface-boilerplate/package-lock.json +6855 -0
- package/templates/interface-boilerplate/package.json +18 -37
- package/templates/interface-boilerplate/postcss.config.mjs +7 -0
- package/templates/interface-boilerplate/tsconfig.json +18 -4
- package/templates/interface-boilerplate/.env.example +0 -2
- package/templates/interface-boilerplate/.eslintrc.json +0 -4
- package/templates/interface-boilerplate/app/login/page.tsx +0 -178
- package/templates/interface-boilerplate/app/signup/page.tsx +0 -199
- package/templates/interface-boilerplate/components/AnalyticsProvider.tsx +0 -142
- package/templates/interface-boilerplate/components/AuthGuard.tsx +0 -76
- package/templates/interface-boilerplate/components/ErrorBoundary.tsx +0 -106
- package/templates/interface-boilerplate/components/theme-provider.tsx +0 -9
- package/templates/interface-boilerplate/components/theme-toggle.tsx +0 -39
- package/templates/interface-boilerplate/components/ui/avatar.tsx +0 -46
- package/templates/interface-boilerplate/components/ui/checkbox.tsx +0 -27
- package/templates/interface-boilerplate/components/ui/dialog.tsx +0 -100
- package/templates/interface-boilerplate/components/ui/dropdown-menu.tsx +0 -173
- package/templates/interface-boilerplate/components/ui/index.ts +0 -53
- package/templates/interface-boilerplate/components/ui/label.tsx +0 -20
- package/templates/interface-boilerplate/components/ui/progress.tsx +0 -24
- package/templates/interface-boilerplate/components/ui/select.tsx +0 -149
- package/templates/interface-boilerplate/components/ui/separator.tsx +0 -25
- package/templates/interface-boilerplate/components/ui/skeleton.tsx +0 -12
- package/templates/interface-boilerplate/components/ui/switch.tsx +0 -28
- package/templates/interface-boilerplate/components/ui/tabs.tsx +0 -54
- package/templates/interface-boilerplate/components/ui/textarea.tsx +0 -22
- package/templates/interface-boilerplate/components/ui/tooltip.tsx +0 -29
- package/templates/interface-boilerplate/lib/analytics.ts +0 -182
- package/templates/interface-boilerplate/lib/auth-context.tsx +0 -83
- package/templates/interface-boilerplate/lib/auth.ts +0 -199
- package/templates/interface-boilerplate/lib/callFlow.ts +0 -234
- package/templates/interface-boilerplate/lib/flowTracer.ts +0 -195
- package/templates/interface-boilerplate/lib/hooks/.gitkeep +0 -0
- package/templates/interface-boilerplate/lib/stores/.gitkeep +0 -0
- package/templates/interface-boilerplate/next.config.js +0 -6
- package/templates/interface-boilerplate/postcss.config.js +0 -6
- package/templates/interface-boilerplate/tailwind.config.js +0 -103
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
import { useRouter } from 'next/navigation';
|
|
5
|
-
import { useAuth } from '@/lib/auth-context';
|
|
6
|
-
import { Skeleton } from '@/components/ui/skeleton';
|
|
7
|
-
|
|
8
|
-
interface AuthGuardProps {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
requiredPermission?: string;
|
|
11
|
-
requiredRole?: string;
|
|
12
|
-
fallback?: React.ReactNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Wrap protected pages with this component to require authentication.
|
|
17
|
-
* Optionally require specific permissions or roles.
|
|
18
|
-
*/
|
|
19
|
-
export function AuthGuard({ children, requiredPermission, requiredRole, fallback }: AuthGuardProps) {
|
|
20
|
-
const { user, isLoading, isAuthenticated } = useAuth();
|
|
21
|
-
const router = useRouter();
|
|
22
|
-
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
if (!isLoading && !isAuthenticated) {
|
|
25
|
-
router.push('/login');
|
|
26
|
-
}
|
|
27
|
-
}, [isLoading, isAuthenticated, router]);
|
|
28
|
-
|
|
29
|
-
if (isLoading) {
|
|
30
|
-
return fallback || (
|
|
31
|
-
<div className="flex min-h-screen items-center justify-center">
|
|
32
|
-
<div className="space-y-4 w-full max-w-md px-4">
|
|
33
|
-
<Skeleton className="h-12 w-3/4" />
|
|
34
|
-
<Skeleton className="h-4 w-full" />
|
|
35
|
-
<Skeleton className="h-4 w-2/3" />
|
|
36
|
-
<Skeleton className="h-32 w-full" />
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (!isAuthenticated) {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Check permission if required
|
|
47
|
-
if (requiredPermission && user) {
|
|
48
|
-
const hasPermission = user.permissions.includes(requiredPermission) || user.permissions.includes('admin');
|
|
49
|
-
if (!hasPermission) {
|
|
50
|
-
return (
|
|
51
|
-
<div className="flex min-h-screen items-center justify-center">
|
|
52
|
-
<div className="text-center">
|
|
53
|
-
<h1 className="text-2xl font-bold text-destructive">Access Denied</h1>
|
|
54
|
-
<p className="text-muted-foreground mt-2">You don't have permission to view this page.</p>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Check role if required
|
|
62
|
-
if (requiredRole && user) {
|
|
63
|
-
if (!user.roles.includes(requiredRole)) {
|
|
64
|
-
return (
|
|
65
|
-
<div className="flex min-h-screen items-center justify-center">
|
|
66
|
-
<div className="text-center">
|
|
67
|
-
<h1 className="text-2xl font-bold text-destructive">Access Denied</h1>
|
|
68
|
-
<p className="text-muted-foreground mt-2">This page requires the {requiredRole} role.</p>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return <>{children}</>;
|
|
76
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import React, { Component, ErrorInfo, ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
fallback?: ReactNode;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
interface State {
|
|
11
|
-
hasError: boolean;
|
|
12
|
-
error: Error | null;
|
|
13
|
-
errorInfo: ErrorInfo | null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Error Boundary component that catches React errors and reports them
|
|
18
|
-
* to the Lux Studio runtime error capture system for auto-fixing.
|
|
19
|
-
*/
|
|
20
|
-
export class ErrorBoundary extends Component<Props, State> {
|
|
21
|
-
constructor(props: Props) {
|
|
22
|
-
super(props);
|
|
23
|
-
this.state = { hasError: false, error: null, errorInfo: null };
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static getDerivedStateFromError(error: Error): Partial<State> {
|
|
27
|
-
return { hasError: true, error };
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
|
31
|
-
this.setState({ errorInfo });
|
|
32
|
-
|
|
33
|
-
// Report error to Lux Studio's runtime error capture
|
|
34
|
-
// The __luxReportError function is injected by the Lux preview bridge
|
|
35
|
-
if (typeof window !== 'undefined' && (window as any).__luxReportError) {
|
|
36
|
-
(window as any).__luxReportError(error, errorInfo.componentStack);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Also log to console for debugging
|
|
40
|
-
console.error('[ErrorBoundary] React error caught:', error);
|
|
41
|
-
console.error('[ErrorBoundary] Component stack:', errorInfo.componentStack);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
render() {
|
|
45
|
-
if (this.state.hasError) {
|
|
46
|
-
// Custom fallback UI
|
|
47
|
-
if (this.props.fallback) {
|
|
48
|
-
return this.props.fallback;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Default error UI
|
|
52
|
-
return (
|
|
53
|
-
<div className="min-h-[200px] flex items-center justify-center p-6">
|
|
54
|
-
<div className="max-w-md w-full bg-destructive/10 border border-destructive/30 rounded-lg p-6">
|
|
55
|
-
<div className="flex items-center gap-3 mb-4">
|
|
56
|
-
<svg
|
|
57
|
-
className="w-6 h-6 text-destructive"
|
|
58
|
-
fill="none"
|
|
59
|
-
viewBox="0 0 24 24"
|
|
60
|
-
stroke="currentColor"
|
|
61
|
-
>
|
|
62
|
-
<path
|
|
63
|
-
strokeLinecap="round"
|
|
64
|
-
strokeLinejoin="round"
|
|
65
|
-
strokeWidth={2}
|
|
66
|
-
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
67
|
-
/>
|
|
68
|
-
</svg>
|
|
69
|
-
<h2 className="text-lg font-semibold text-destructive">
|
|
70
|
-
Something went wrong
|
|
71
|
-
</h2>
|
|
72
|
-
</div>
|
|
73
|
-
<p className="text-sm text-muted-foreground mb-4">
|
|
74
|
-
{this.state.error?.message || 'An unexpected error occurred'}
|
|
75
|
-
</p>
|
|
76
|
-
<button
|
|
77
|
-
onClick={() => {
|
|
78
|
-
this.setState({ hasError: false, error: null, errorInfo: null });
|
|
79
|
-
window.location.reload();
|
|
80
|
-
}}
|
|
81
|
-
className="px-4 py-2 bg-primary text-primary-foreground rounded-md text-sm font-medium hover:bg-primary/90 transition-colors"
|
|
82
|
-
>
|
|
83
|
-
Reload Page
|
|
84
|
-
</button>
|
|
85
|
-
{process.env.NODE_ENV === 'development' && this.state.errorInfo && (
|
|
86
|
-
<details className="mt-4">
|
|
87
|
-
<summary className="text-xs text-muted-foreground cursor-pointer hover:text-foreground">
|
|
88
|
-
Show error details
|
|
89
|
-
</summary>
|
|
90
|
-
<pre className="mt-2 p-3 bg-muted rounded text-xs overflow-auto max-h-40">
|
|
91
|
-
{this.state.error?.stack}
|
|
92
|
-
{'\n\nComponent Stack:'}
|
|
93
|
-
{this.state.errorInfo.componentStack}
|
|
94
|
-
</pre>
|
|
95
|
-
</details>
|
|
96
|
-
)}
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return this.props.children;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export default ErrorBoundary;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { ThemeProvider as NextThemesProvider } from 'next-themes';
|
|
5
|
-
import { type ThemeProviderProps } from 'next-themes/dist/types';
|
|
6
|
-
|
|
7
|
-
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
|
|
8
|
-
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
|
|
9
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Moon, Sun } from 'lucide-react';
|
|
5
|
-
import { useTheme } from 'next-themes';
|
|
6
|
-
import { Button } from '@/components/ui/button';
|
|
7
|
-
|
|
8
|
-
export function ThemeToggle() {
|
|
9
|
-
const { theme, setTheme } = useTheme();
|
|
10
|
-
const [mounted, setMounted] = React.useState(false);
|
|
11
|
-
|
|
12
|
-
React.useEffect(() => {
|
|
13
|
-
setMounted(true);
|
|
14
|
-
}, []);
|
|
15
|
-
|
|
16
|
-
if (!mounted) {
|
|
17
|
-
return (
|
|
18
|
-
<Button variant="ghost" size="icon" className="h-9 w-9">
|
|
19
|
-
<Sun className="h-4 w-4" />
|
|
20
|
-
</Button>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<Button
|
|
26
|
-
variant="ghost"
|
|
27
|
-
size="icon"
|
|
28
|
-
className="h-9 w-9"
|
|
29
|
-
onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
|
|
30
|
-
>
|
|
31
|
-
{theme === 'dark' ? (
|
|
32
|
-
<Sun className="h-4 w-4" />
|
|
33
|
-
) : (
|
|
34
|
-
<Moon className="h-4 w-4" />
|
|
35
|
-
)}
|
|
36
|
-
<span className="sr-only">Toggle theme</span>
|
|
37
|
-
</Button>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
5
|
-
import { cn } from '@/lib/utils';
|
|
6
|
-
|
|
7
|
-
const Avatar = React.forwardRef<
|
|
8
|
-
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
9
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
10
|
-
>(({ className, ...props }, ref) => (
|
|
11
|
-
<AvatarPrimitive.Root
|
|
12
|
-
ref={ref}
|
|
13
|
-
className={cn('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className)}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
));
|
|
17
|
-
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
18
|
-
|
|
19
|
-
const AvatarImage = React.forwardRef<
|
|
20
|
-
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
21
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
22
|
-
>(({ className, ...props }, ref) => (
|
|
23
|
-
<AvatarPrimitive.Image
|
|
24
|
-
ref={ref}
|
|
25
|
-
className={cn('aspect-square h-full w-full', className)}
|
|
26
|
-
{...props}
|
|
27
|
-
/>
|
|
28
|
-
));
|
|
29
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
30
|
-
|
|
31
|
-
const AvatarFallback = React.forwardRef<
|
|
32
|
-
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
33
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
34
|
-
>(({ className, ...props }, ref) => (
|
|
35
|
-
<AvatarPrimitive.Fallback
|
|
36
|
-
ref={ref}
|
|
37
|
-
className={cn(
|
|
38
|
-
'flex h-full w-full items-center justify-center rounded-full bg-muted',
|
|
39
|
-
className
|
|
40
|
-
)}
|
|
41
|
-
{...props}
|
|
42
|
-
/>
|
|
43
|
-
));
|
|
44
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
45
|
-
|
|
46
|
-
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
5
|
-
import { Check } from 'lucide-react';
|
|
6
|
-
import { cn } from '@/lib/utils';
|
|
7
|
-
|
|
8
|
-
const Checkbox = React.forwardRef<
|
|
9
|
-
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
|
10
|
-
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
|
|
11
|
-
>(({ className, ...props }, ref) => (
|
|
12
|
-
<CheckboxPrimitive.Root
|
|
13
|
-
ref={ref}
|
|
14
|
-
className={cn(
|
|
15
|
-
'peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
|
|
16
|
-
className
|
|
17
|
-
)}
|
|
18
|
-
{...props}
|
|
19
|
-
>
|
|
20
|
-
<CheckboxPrimitive.Indicator className={cn('flex items-center justify-center text-current')}>
|
|
21
|
-
<Check className="h-4 w-4" />
|
|
22
|
-
</CheckboxPrimitive.Indicator>
|
|
23
|
-
</CheckboxPrimitive.Root>
|
|
24
|
-
));
|
|
25
|
-
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
26
|
-
|
|
27
|
-
export { Checkbox };
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
5
|
-
import { X } from 'lucide-react';
|
|
6
|
-
import { cn } from '@/lib/utils';
|
|
7
|
-
|
|
8
|
-
const Dialog = DialogPrimitive.Root;
|
|
9
|
-
const DialogTrigger = DialogPrimitive.Trigger;
|
|
10
|
-
const DialogPortal = DialogPrimitive.Portal;
|
|
11
|
-
const DialogClose = DialogPrimitive.Close;
|
|
12
|
-
|
|
13
|
-
const DialogOverlay = React.forwardRef<
|
|
14
|
-
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
15
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
16
|
-
>(({ className, ...props }, ref) => (
|
|
17
|
-
<DialogPrimitive.Overlay
|
|
18
|
-
ref={ref}
|
|
19
|
-
className={cn(
|
|
20
|
-
'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',
|
|
21
|
-
className
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
));
|
|
26
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
27
|
-
|
|
28
|
-
const DialogContent = React.forwardRef<
|
|
29
|
-
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
30
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
|
|
31
|
-
>(({ className, children, ...props }, ref) => (
|
|
32
|
-
<DialogPortal>
|
|
33
|
-
<DialogOverlay />
|
|
34
|
-
<DialogPrimitive.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
|
-
{children}
|
|
43
|
-
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
|
|
44
|
-
<X className="h-4 w-4" />
|
|
45
|
-
<span className="sr-only">Close</span>
|
|
46
|
-
</DialogPrimitive.Close>
|
|
47
|
-
</DialogPrimitive.Content>
|
|
48
|
-
</DialogPortal>
|
|
49
|
-
));
|
|
50
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
51
|
-
|
|
52
|
-
const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
53
|
-
<div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />
|
|
54
|
-
);
|
|
55
|
-
DialogHeader.displayName = 'DialogHeader';
|
|
56
|
-
|
|
57
|
-
const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
58
|
-
<div
|
|
59
|
-
className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}
|
|
60
|
-
{...props}
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
63
|
-
DialogFooter.displayName = 'DialogFooter';
|
|
64
|
-
|
|
65
|
-
const DialogTitle = React.forwardRef<
|
|
66
|
-
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
67
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
68
|
-
>(({ className, ...props }, ref) => (
|
|
69
|
-
<DialogPrimitive.Title
|
|
70
|
-
ref={ref}
|
|
71
|
-
className={cn('text-lg font-semibold leading-none tracking-tight', className)}
|
|
72
|
-
{...props}
|
|
73
|
-
/>
|
|
74
|
-
));
|
|
75
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
76
|
-
|
|
77
|
-
const DialogDescription = React.forwardRef<
|
|
78
|
-
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
79
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
80
|
-
>(({ className, ...props }, ref) => (
|
|
81
|
-
<DialogPrimitive.Description
|
|
82
|
-
ref={ref}
|
|
83
|
-
className={cn('text-sm text-muted-foreground', className)}
|
|
84
|
-
{...props}
|
|
85
|
-
/>
|
|
86
|
-
));
|
|
87
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
88
|
-
|
|
89
|
-
export {
|
|
90
|
-
Dialog,
|
|
91
|
-
DialogPortal,
|
|
92
|
-
DialogOverlay,
|
|
93
|
-
DialogClose,
|
|
94
|
-
DialogTrigger,
|
|
95
|
-
DialogContent,
|
|
96
|
-
DialogHeader,
|
|
97
|
-
DialogFooter,
|
|
98
|
-
DialogTitle,
|
|
99
|
-
DialogDescription,
|
|
100
|
-
};
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
5
|
-
import { Check, ChevronRight, Circle } from 'lucide-react';
|
|
6
|
-
import { cn } from '@/lib/utils';
|
|
7
|
-
|
|
8
|
-
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
9
|
-
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
10
|
-
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
11
|
-
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
12
|
-
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
13
|
-
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
14
|
-
|
|
15
|
-
const DropdownMenuSubTrigger = React.forwardRef<
|
|
16
|
-
React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
|
|
17
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & { inset?: boolean }
|
|
18
|
-
>(({ className, inset, children, ...props }, ref) => (
|
|
19
|
-
<DropdownMenuPrimitive.SubTrigger
|
|
20
|
-
ref={ref}
|
|
21
|
-
className={cn(
|
|
22
|
-
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent',
|
|
23
|
-
inset && 'pl-8',
|
|
24
|
-
className
|
|
25
|
-
)}
|
|
26
|
-
{...props}
|
|
27
|
-
>
|
|
28
|
-
{children}
|
|
29
|
-
<ChevronRight className="ml-auto h-4 w-4" />
|
|
30
|
-
</DropdownMenuPrimitive.SubTrigger>
|
|
31
|
-
));
|
|
32
|
-
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
33
|
-
|
|
34
|
-
const DropdownMenuSubContent = React.forwardRef<
|
|
35
|
-
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
|
|
36
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
|
|
37
|
-
>(({ className, ...props }, ref) => (
|
|
38
|
-
<DropdownMenuPrimitive.SubContent
|
|
39
|
-
ref={ref}
|
|
40
|
-
className={cn(
|
|
41
|
-
'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',
|
|
42
|
-
className
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
/>
|
|
46
|
-
));
|
|
47
|
-
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
48
|
-
|
|
49
|
-
const DropdownMenuContent = React.forwardRef<
|
|
50
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
|
51
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
|
|
52
|
-
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
53
|
-
<DropdownMenuPrimitive.Portal>
|
|
54
|
-
<DropdownMenuPrimitive.Content
|
|
55
|
-
ref={ref}
|
|
56
|
-
sideOffset={sideOffset}
|
|
57
|
-
className={cn(
|
|
58
|
-
'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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',
|
|
59
|
-
className
|
|
60
|
-
)}
|
|
61
|
-
{...props}
|
|
62
|
-
/>
|
|
63
|
-
</DropdownMenuPrimitive.Portal>
|
|
64
|
-
));
|
|
65
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
66
|
-
|
|
67
|
-
const DropdownMenuItem = React.forwardRef<
|
|
68
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
|
|
69
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & { inset?: boolean }
|
|
70
|
-
>(({ className, inset, ...props }, ref) => (
|
|
71
|
-
<DropdownMenuPrimitive.Item
|
|
72
|
-
ref={ref}
|
|
73
|
-
className={cn(
|
|
74
|
-
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
75
|
-
inset && 'pl-8',
|
|
76
|
-
className
|
|
77
|
-
)}
|
|
78
|
-
{...props}
|
|
79
|
-
/>
|
|
80
|
-
));
|
|
81
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
82
|
-
|
|
83
|
-
const DropdownMenuCheckboxItem = React.forwardRef<
|
|
84
|
-
React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
|
|
85
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
|
|
86
|
-
>(({ className, children, checked, ...props }, ref) => (
|
|
87
|
-
<DropdownMenuPrimitive.CheckboxItem
|
|
88
|
-
ref={ref}
|
|
89
|
-
className={cn(
|
|
90
|
-
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
91
|
-
className
|
|
92
|
-
)}
|
|
93
|
-
checked={checked}
|
|
94
|
-
{...props}
|
|
95
|
-
>
|
|
96
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
97
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
98
|
-
<Check className="h-4 w-4" />
|
|
99
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
100
|
-
</span>
|
|
101
|
-
{children}
|
|
102
|
-
</DropdownMenuPrimitive.CheckboxItem>
|
|
103
|
-
));
|
|
104
|
-
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
105
|
-
|
|
106
|
-
const DropdownMenuRadioItem = React.forwardRef<
|
|
107
|
-
React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
|
|
108
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
|
|
109
|
-
>(({ className, children, ...props }, ref) => (
|
|
110
|
-
<DropdownMenuPrimitive.RadioItem
|
|
111
|
-
ref={ref}
|
|
112
|
-
className={cn(
|
|
113
|
-
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
114
|
-
className
|
|
115
|
-
)}
|
|
116
|
-
{...props}
|
|
117
|
-
>
|
|
118
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
119
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
120
|
-
<Circle className="h-2 w-2 fill-current" />
|
|
121
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
122
|
-
</span>
|
|
123
|
-
{children}
|
|
124
|
-
</DropdownMenuPrimitive.RadioItem>
|
|
125
|
-
));
|
|
126
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
127
|
-
|
|
128
|
-
const DropdownMenuLabel = React.forwardRef<
|
|
129
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Label>,
|
|
130
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & { inset?: boolean }
|
|
131
|
-
>(({ className, inset, ...props }, ref) => (
|
|
132
|
-
<DropdownMenuPrimitive.Label
|
|
133
|
-
ref={ref}
|
|
134
|
-
className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}
|
|
135
|
-
{...props}
|
|
136
|
-
/>
|
|
137
|
-
));
|
|
138
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
139
|
-
|
|
140
|
-
const DropdownMenuSeparator = React.forwardRef<
|
|
141
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
|
|
142
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
|
|
143
|
-
>(({ className, ...props }, ref) => (
|
|
144
|
-
<DropdownMenuPrimitive.Separator
|
|
145
|
-
ref={ref}
|
|
146
|
-
className={cn('-mx-1 my-1 h-px bg-muted', className)}
|
|
147
|
-
{...props}
|
|
148
|
-
/>
|
|
149
|
-
));
|
|
150
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
151
|
-
|
|
152
|
-
const DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
153
|
-
return <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />;
|
|
154
|
-
};
|
|
155
|
-
DropdownMenuShortcut.displayName = 'DropdownMenuShortcut';
|
|
156
|
-
|
|
157
|
-
export {
|
|
158
|
-
DropdownMenu,
|
|
159
|
-
DropdownMenuTrigger,
|
|
160
|
-
DropdownMenuContent,
|
|
161
|
-
DropdownMenuItem,
|
|
162
|
-
DropdownMenuCheckboxItem,
|
|
163
|
-
DropdownMenuRadioItem,
|
|
164
|
-
DropdownMenuLabel,
|
|
165
|
-
DropdownMenuSeparator,
|
|
166
|
-
DropdownMenuShortcut,
|
|
167
|
-
DropdownMenuGroup,
|
|
168
|
-
DropdownMenuPortal,
|
|
169
|
-
DropdownMenuSub,
|
|
170
|
-
DropdownMenuSubContent,
|
|
171
|
-
DropdownMenuSubTrigger,
|
|
172
|
-
DropdownMenuRadioGroup,
|
|
173
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export { Button, buttonVariants } from './button';
|
|
2
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from './card';
|
|
3
|
-
export { Input } from './input';
|
|
4
|
-
export { Label } from './label';
|
|
5
|
-
export { Badge, badgeVariants } from './badge';
|
|
6
|
-
export { Skeleton } from './skeleton';
|
|
7
|
-
export { Avatar, AvatarImage, AvatarFallback } from './avatar';
|
|
8
|
-
export { Separator } from './separator';
|
|
9
|
-
export { Progress } from './progress';
|
|
10
|
-
export { Switch } from './switch';
|
|
11
|
-
export { Checkbox } from './checkbox';
|
|
12
|
-
export { Textarea } from './textarea';
|
|
13
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent } from './tabs';
|
|
14
|
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './tooltip';
|
|
15
|
-
export {
|
|
16
|
-
Select,
|
|
17
|
-
SelectGroup,
|
|
18
|
-
SelectValue,
|
|
19
|
-
SelectTrigger,
|
|
20
|
-
SelectContent,
|
|
21
|
-
SelectLabel,
|
|
22
|
-
SelectItem,
|
|
23
|
-
SelectSeparator,
|
|
24
|
-
} from './select';
|
|
25
|
-
export {
|
|
26
|
-
Dialog,
|
|
27
|
-
DialogPortal,
|
|
28
|
-
DialogOverlay,
|
|
29
|
-
DialogClose,
|
|
30
|
-
DialogTrigger,
|
|
31
|
-
DialogContent,
|
|
32
|
-
DialogHeader,
|
|
33
|
-
DialogFooter,
|
|
34
|
-
DialogTitle,
|
|
35
|
-
DialogDescription,
|
|
36
|
-
} from './dialog';
|
|
37
|
-
export {
|
|
38
|
-
DropdownMenu,
|
|
39
|
-
DropdownMenuTrigger,
|
|
40
|
-
DropdownMenuContent,
|
|
41
|
-
DropdownMenuItem,
|
|
42
|
-
DropdownMenuCheckboxItem,
|
|
43
|
-
DropdownMenuRadioItem,
|
|
44
|
-
DropdownMenuLabel,
|
|
45
|
-
DropdownMenuSeparator,
|
|
46
|
-
DropdownMenuShortcut,
|
|
47
|
-
DropdownMenuGroup,
|
|
48
|
-
DropdownMenuPortal,
|
|
49
|
-
DropdownMenuSub,
|
|
50
|
-
DropdownMenuSubContent,
|
|
51
|
-
DropdownMenuSubTrigger,
|
|
52
|
-
DropdownMenuRadioGroup,
|
|
53
|
-
} from './dropdown-menu';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
5
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
6
|
-
import { cn } from '@/lib/utils';
|
|
7
|
-
|
|
8
|
-
const labelVariants = cva(
|
|
9
|
-
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
const Label = React.forwardRef<
|
|
13
|
-
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
14
|
-
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>
|
|
15
|
-
>(({ className, ...props }, ref) => (
|
|
16
|
-
<LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />
|
|
17
|
-
));
|
|
18
|
-
Label.displayName = LabelPrimitive.Root.displayName;
|
|
19
|
-
|
|
20
|
-
export { Label };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
5
|
-
import { cn } from '@/lib/utils';
|
|
6
|
-
|
|
7
|
-
const Progress = React.forwardRef<
|
|
8
|
-
React.ElementRef<typeof ProgressPrimitive.Root>,
|
|
9
|
-
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
|
|
10
|
-
>(({ className, value, ...props }, ref) => (
|
|
11
|
-
<ProgressPrimitive.Root
|
|
12
|
-
ref={ref}
|
|
13
|
-
className={cn('relative h-4 w-full overflow-hidden rounded-full bg-secondary', className)}
|
|
14
|
-
{...props}
|
|
15
|
-
>
|
|
16
|
-
<ProgressPrimitive.Indicator
|
|
17
|
-
className="h-full w-full flex-1 bg-primary transition-all"
|
|
18
|
-
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
19
|
-
/>
|
|
20
|
-
</ProgressPrimitive.Root>
|
|
21
|
-
));
|
|
22
|
-
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
23
|
-
|
|
24
|
-
export { Progress };
|