@evolution-soft/ui 1.0.0 → 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/cli/index.js +386 -0
- package/components/button-icon-lottie/index.tsx +46 -0
- package/components/fullscreen-mode/index.tsx +82 -0
- package/components/header/components/buttons.tsx +102 -0
- package/components/header/index.tsx +146 -0
- package/components/loading-default/index.tsx +90 -0
- package/components/lottie-icon/index.tsx +78 -0
- package/components/not-found-default/index.tsx +68 -0
- package/components/settings-modal/index.tsx +225 -0
- package/components/sidebar/index.tsx +645 -0
- package/components/subtitle/index.tsx +60 -0
- package/components/theme-transition/index.tsx +142 -0
- package/components/title/index.tsx +66 -0
- package/components/tooltip-indicator/index.tsx +30 -0
- package/components/ui/accordion.tsx +66 -0
- package/components/ui/alert-dialog.tsx +157 -0
- package/components/ui/alert.tsx +66 -0
- package/components/ui/aspect-ratio.tsx +11 -0
- package/components/ui/avatar.tsx +53 -0
- package/components/ui/badge.tsx +46 -0
- package/components/ui/breadcrumb.tsx +109 -0
- package/components/ui/button.tsx +58 -0
- package/components/ui/calendar.tsx +78 -0
- package/components/ui/card.tsx +92 -0
- package/components/ui/carousel.tsx +241 -0
- package/components/ui/chart.tsx +360 -0
- package/components/ui/checkbox.tsx +32 -0
- package/components/ui/collapsible.tsx +33 -0
- package/components/ui/command.tsx +177 -0
- package/components/ui/context-menu.tsx +252 -0
- package/components/ui/dialog.tsx +135 -0
- package/components/ui/divisor.tsx +9 -0
- package/components/ui/drawer.tsx +132 -0
- package/components/ui/dropdown-menu.tsx +257 -0
- package/components/ui/emoji-picker.tsx +76 -0
- package/components/ui/form.tsx +168 -0
- package/components/ui/hover-card.tsx +44 -0
- package/components/ui/input-mask.tsx +46 -0
- package/components/ui/input-otp.tsx +77 -0
- package/components/ui/input.tsx +61 -0
- package/components/ui/label.tsx +24 -0
- package/components/ui/menubar.tsx +276 -0
- package/components/ui/multiselect.tsx +105 -0
- package/components/ui/navigation-menu.tsx +168 -0
- package/components/ui/pagination.tsx +127 -0
- package/components/ui/popover.tsx +48 -0
- package/components/ui/progress.tsx +31 -0
- package/components/ui/radio-group.tsx +45 -0
- package/components/ui/resizable.tsx +65 -0
- package/components/ui/scroll-area.tsx +58 -0
- package/components/ui/searchable-select.tsx +211 -0
- package/components/ui/select.tsx +189 -0
- package/components/ui/separator.tsx +28 -0
- package/components/ui/sheet.tsx +139 -0
- package/components/ui/sidebar.tsx +727 -0
- package/components/ui/skeleton.tsx +144 -0
- package/components/ui/slider.tsx +63 -0
- package/components/ui/sonner.tsx +26 -0
- package/components/ui/switch.tsx +31 -0
- package/components/ui/table.tsx +116 -0
- package/components/ui/tabs.tsx +76 -0
- package/components/ui/textarea.tsx +18 -0
- package/components/ui/theme-toggle.tsx +89 -0
- package/components/ui/toggle-group.tsx +73 -0
- package/components/ui/toggle.tsx +47 -0
- package/components/ui/tooltip.tsx +61 -0
- package/components/ui/use-mobile.ts +21 -0
- package/components/ui/utils.ts +6 -0
- package/contexts/AnimationSettingsContext.tsx +85 -0
- package/contexts/AuthContext.tsx +80 -0
- package/contexts/ThemeContext.tsx +70 -0
- package/hooks/useAnimationSettings.ts +2 -0
- package/hooks/usePermissions.ts +4 -0
- package/lib/persistentFilters.ts +120 -0
- package/lib/utils.ts +2 -0
- package/package.json +11 -2
- package/stores/theme.ts +30 -0
- package/stores/useThemeStore.ts +32 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { cn } from '@/components/ui/utils';
|
|
3
|
+
|
|
4
|
+
const subtitleVariants = cva(
|
|
5
|
+
"text-gray-400 transition-colors",
|
|
6
|
+
{
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
xs: "text-xs",
|
|
10
|
+
sm: "text-sm",
|
|
11
|
+
md: "text-base",
|
|
12
|
+
lg: "text-lg",
|
|
13
|
+
},
|
|
14
|
+
weight: {
|
|
15
|
+
light: "font-light",
|
|
16
|
+
normal: "font-normal",
|
|
17
|
+
medium: "font-medium",
|
|
18
|
+
semibold: "font-semibold",
|
|
19
|
+
bold: "font-bold",
|
|
20
|
+
extrabold: "font-extrabold",
|
|
21
|
+
black: "font-black",
|
|
22
|
+
},
|
|
23
|
+
variant: {
|
|
24
|
+
default: "text-gray-400",
|
|
25
|
+
muted: "text-muted-foreground",
|
|
26
|
+
secondary: "text-secondary-foreground",
|
|
27
|
+
accent: "text-accent-foreground",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
size: "sm",
|
|
32
|
+
weight: "semibold",
|
|
33
|
+
variant: "default",
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export interface SubtitleProps extends VariantProps<typeof subtitleVariants> {
|
|
39
|
+
children: React.ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
as?: 'p' | 'span' | 'div';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function Subtitle({
|
|
45
|
+
size,
|
|
46
|
+
weight,
|
|
47
|
+
variant,
|
|
48
|
+
className,
|
|
49
|
+
as = 'p',
|
|
50
|
+
...props
|
|
51
|
+
}: SubtitleProps) {
|
|
52
|
+
const Comp = as;
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Comp
|
|
56
|
+
className={cn(subtitleVariants({ size, weight, variant }), className)}
|
|
57
|
+
{...props}
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { motion, AnimatePresence } from 'framer-motion';
|
|
4
|
+
import { Moon, Sun } from 'lucide-react';
|
|
5
|
+
|
|
6
|
+
interface ThemeTransitionProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function ThemeTransition({ children }: ThemeTransitionProps) {
|
|
11
|
+
const [isTransitioning, setIsTransitioning] = useState(false);
|
|
12
|
+
const [themeKey, setThemeKey] = useState(0);
|
|
13
|
+
const [currentTheme, setCurrentTheme] = useState<'light' | 'dark'>('light');
|
|
14
|
+
const [isInitialized, setIsInitialized] = useState(false);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const checkThemeChange = () => {
|
|
18
|
+
const isDark = document.documentElement.classList.contains('dark');
|
|
19
|
+
const newTheme = isDark ? 'dark' : 'light';
|
|
20
|
+
|
|
21
|
+
if (!isInitialized) {
|
|
22
|
+
setCurrentTheme(newTheme);
|
|
23
|
+
setIsInitialized(true);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (currentTheme !== newTheme) {
|
|
28
|
+
setCurrentTheme(newTheme);
|
|
29
|
+
setIsTransitioning(true);
|
|
30
|
+
|
|
31
|
+
setThemeKey(prev => prev + 1);
|
|
32
|
+
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
setIsTransitioning(false);
|
|
35
|
+
}, 800);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const observer = new MutationObserver(checkThemeChange);
|
|
40
|
+
observer.observe(document.documentElement, {
|
|
41
|
+
attributes: true,
|
|
42
|
+
attributeFilter: ['class']
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
checkThemeChange();
|
|
46
|
+
|
|
47
|
+
return () => {
|
|
48
|
+
observer.disconnect();
|
|
49
|
+
};
|
|
50
|
+
}, [currentTheme, isInitialized]);
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
<div key={themeKey}>
|
|
55
|
+
{children}
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<AnimatePresence>
|
|
59
|
+
{isTransitioning && (
|
|
60
|
+
<motion.div
|
|
61
|
+
className="fixed inset-0 z-9999 flex items-center justify-center pointer-events-none"
|
|
62
|
+
initial={{ opacity: 0 }}
|
|
63
|
+
animate={{ opacity: 1 }}
|
|
64
|
+
exit={{ opacity: 0 }}
|
|
65
|
+
transition={{ duration: 0.2 }}
|
|
66
|
+
>
|
|
67
|
+
{/* Background overlay */}
|
|
68
|
+
<motion.div
|
|
69
|
+
className={`absolute inset-0 ${currentTheme === 'dark'
|
|
70
|
+
? 'bg-linear-to-br from-gray-900 via-gray-800 to-black'
|
|
71
|
+
: 'bg-linear-to-br from-white via-gray-50 to-gray-100'
|
|
72
|
+
}`}
|
|
73
|
+
initial={{ opacity: 0 }}
|
|
74
|
+
animate={{ opacity: 0.95 }}
|
|
75
|
+
exit={{ opacity: 0 }}
|
|
76
|
+
transition={{ duration: 0.3 }}
|
|
77
|
+
/>
|
|
78
|
+
|
|
79
|
+
{/* Animated icon */}
|
|
80
|
+
<motion.div
|
|
81
|
+
className="relative z-10 flex items-center justify-center"
|
|
82
|
+
initial={{ scale: 0.8, opacity: 0 }}
|
|
83
|
+
animate={{ scale: 1, opacity: 1 }}
|
|
84
|
+
exit={{ scale: 0.8, opacity: 0 }}
|
|
85
|
+
transition={{
|
|
86
|
+
duration: 0.3,
|
|
87
|
+
ease: "easeOut"
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
<div className={`p-6 rounded-full backdrop-blur-sm ${currentTheme === 'dark'
|
|
91
|
+
? 'bg-gray-800/90 border border-gray-600/50 shadow-2xl shadow-blue-500/20'
|
|
92
|
+
: 'bg-white/90 border border-gray-300/50 shadow-2xl shadow-yellow-500/20'
|
|
93
|
+
}`}>
|
|
94
|
+
<motion.div
|
|
95
|
+
initial={{ rotate: 0 }}
|
|
96
|
+
animate={{ rotate: 180 }}
|
|
97
|
+
transition={{
|
|
98
|
+
duration: 0.6,
|
|
99
|
+
ease: "easeInOut"
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
{currentTheme === 'dark' ? (
|
|
103
|
+
<Moon className="w-8 h-8 text-blue-400" />
|
|
104
|
+
) : (
|
|
105
|
+
<Sun className="w-8 h-8 text-yellow-500" />
|
|
106
|
+
)}
|
|
107
|
+
</motion.div>
|
|
108
|
+
</div>
|
|
109
|
+
</motion.div>
|
|
110
|
+
|
|
111
|
+
<motion.div
|
|
112
|
+
className="absolute bottom-1/3 left-1/2 transform -translate-x-1/2"
|
|
113
|
+
initial={{ opacity: 0, y: 20 }}
|
|
114
|
+
animate={{ opacity: 1, y: 0 }}
|
|
115
|
+
exit={{ opacity: 0, y: -20 }}
|
|
116
|
+
transition={{ duration: 0.4, delay: 0.2 }}
|
|
117
|
+
>
|
|
118
|
+
<p className={`text-base font-medium ${currentTheme === 'dark' ? 'text-gray-300' : 'text-gray-600'
|
|
119
|
+
}`}>
|
|
120
|
+
Alternando para modo {currentTheme === 'dark' ? 'escuro' : 'claro'}...
|
|
121
|
+
</p>
|
|
122
|
+
</motion.div>
|
|
123
|
+
|
|
124
|
+
<motion.div
|
|
125
|
+
className={`absolute inset-0 rounded-full ${currentTheme === 'dark' ? 'bg-blue-500/10' : 'bg-yellow-500/10'
|
|
126
|
+
}`}
|
|
127
|
+
initial={{ scale: 0.5, opacity: 0 }}
|
|
128
|
+
animate={{ scale: 2.5, opacity: [0, 0.6, 0] }}
|
|
129
|
+
transition={{
|
|
130
|
+
duration: 0.8,
|
|
131
|
+
ease: "easeOut"
|
|
132
|
+
}}
|
|
133
|
+
style={{
|
|
134
|
+
filter: 'blur(40px)',
|
|
135
|
+
}}
|
|
136
|
+
/>
|
|
137
|
+
</motion.div>
|
|
138
|
+
)}
|
|
139
|
+
</AnimatePresence>
|
|
140
|
+
</>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { cn } from '@/components/ui/utils';
|
|
4
|
+
|
|
5
|
+
const titleVariants = cva(
|
|
6
|
+
"text-gray-700 dark:text-gray-300 transition-colors",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
xs: "text-sm md:text-base",
|
|
11
|
+
sm: "text-base md:text-lg",
|
|
12
|
+
md: "text-lg md:text-xl",
|
|
13
|
+
lg: "text-xl md:text-2xl",
|
|
14
|
+
xl: "text-2xl md:text-3xl",
|
|
15
|
+
"2xl": "text-3xl md:text-4xl",
|
|
16
|
+
},
|
|
17
|
+
weight: {
|
|
18
|
+
light: "font-light",
|
|
19
|
+
normal: "font-normal",
|
|
20
|
+
medium: "font-medium",
|
|
21
|
+
semibold: "font-semibold",
|
|
22
|
+
bold: "font-bold",
|
|
23
|
+
extrabold: "font-extrabold",
|
|
24
|
+
black: "font-black",
|
|
25
|
+
},
|
|
26
|
+
variant: {
|
|
27
|
+
default: "text-gray-700 dark:text-gray-300",
|
|
28
|
+
muted: "text-muted-foreground",
|
|
29
|
+
accent: "text-accent-foreground",
|
|
30
|
+
destructive: "text-destructive",
|
|
31
|
+
primary: "text-primary",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
size: "md",
|
|
36
|
+
weight: "bold",
|
|
37
|
+
variant: "default",
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
export interface TitleProps extends VariantProps<typeof titleVariants> {
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
className?: string;
|
|
46
|
+
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function Title({
|
|
50
|
+
asChild = false,
|
|
51
|
+
size,
|
|
52
|
+
weight,
|
|
53
|
+
variant,
|
|
54
|
+
className,
|
|
55
|
+
as = 'h3',
|
|
56
|
+
...props
|
|
57
|
+
}: TitleProps) {
|
|
58
|
+
const Comp = asChild ? Slot : as;
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Comp
|
|
62
|
+
className={cn(titleVariants({ size, weight, variant }), className)}
|
|
63
|
+
{...props}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AlertCircle, Settings } from 'lucide-react';
|
|
2
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
|
3
|
+
|
|
4
|
+
interface TooltipIndicatorProps {
|
|
5
|
+
type: 'development' | 'analysis';
|
|
6
|
+
message?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function TooltipIndicator({ type, message }: TooltipIndicatorProps) {
|
|
10
|
+
const defaultMessages = {
|
|
11
|
+
development: 'Módulo em Desenvolvimento!',
|
|
12
|
+
analysis: 'Módulo em andamento/revisão, algumas funcionalidades podem estar travadas!'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const Icon = type === 'development' ? AlertCircle : Settings;
|
|
16
|
+
const color = type === 'development' ? 'text-orange-500' : 'text-blue-500';
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<TooltipProvider>
|
|
20
|
+
<Tooltip>
|
|
21
|
+
<TooltipTrigger asChild>
|
|
22
|
+
<Icon className={`h-3 w-3 ${color} shrink-0`} />
|
|
23
|
+
</TooltipTrigger>
|
|
24
|
+
<TooltipContent className='max-w-2xs'>
|
|
25
|
+
<p className="text-xs">{message || defaultMessages[type]}</p>
|
|
26
|
+
</TooltipContent>
|
|
27
|
+
</Tooltip>
|
|
28
|
+
</TooltipProvider>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
5
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
6
|
+
|
|
7
|
+
import { cn } from "./utils";
|
|
8
|
+
|
|
9
|
+
function Accordion({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Root>) {
|
|
12
|
+
return <AccordionPrimitive.Root data-slot="accordion" {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function AccordionItem({
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Item>) {
|
|
19
|
+
return (
|
|
20
|
+
<AccordionPrimitive.Item
|
|
21
|
+
data-slot="accordion-item"
|
|
22
|
+
className={cn("border-b last:border-b-0", className)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function AccordionTrigger({
|
|
29
|
+
className,
|
|
30
|
+
children,
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
|
|
33
|
+
return (
|
|
34
|
+
<AccordionPrimitive.Header className="flex">
|
|
35
|
+
<AccordionPrimitive.Trigger
|
|
36
|
+
data-slot="accordion-trigger"
|
|
37
|
+
className={cn(
|
|
38
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
39
|
+
className,
|
|
40
|
+
)}
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
<ChevronDownIcon className="text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" />
|
|
45
|
+
</AccordionPrimitive.Trigger>
|
|
46
|
+
</AccordionPrimitive.Header>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function AccordionContent({
|
|
51
|
+
className,
|
|
52
|
+
children,
|
|
53
|
+
...props
|
|
54
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Content>) {
|
|
55
|
+
return (
|
|
56
|
+
<AccordionPrimitive.Content
|
|
57
|
+
data-slot="accordion-content"
|
|
58
|
+
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
|
|
59
|
+
{...props}
|
|
60
|
+
>
|
|
61
|
+
<div className={cn("pt-0 pb-4", className)}>{children}</div>
|
|
62
|
+
</AccordionPrimitive.Content>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
5
|
+
|
|
6
|
+
import { cn } from "./utils";
|
|
7
|
+
import { buttonVariants } from "./button";
|
|
8
|
+
|
|
9
|
+
function AlertDialog({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
12
|
+
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function AlertDialogTrigger({
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
18
|
+
return (
|
|
19
|
+
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function AlertDialogPortal({
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
26
|
+
return (
|
|
27
|
+
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function AlertDialogOverlay({
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
|
|
35
|
+
return (
|
|
36
|
+
<AlertDialogPrimitive.Overlay
|
|
37
|
+
data-slot="alert-dialog-overlay"
|
|
38
|
+
className={cn(
|
|
39
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
40
|
+
className,
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function AlertDialogContent({
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
|
|
51
|
+
return (
|
|
52
|
+
<AlertDialogPortal>
|
|
53
|
+
<AlertDialogOverlay />
|
|
54
|
+
<AlertDialogPrimitive.Content
|
|
55
|
+
data-slot="alert-dialog-content"
|
|
56
|
+
className={cn(
|
|
57
|
+
"bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
58
|
+
className,
|
|
59
|
+
)}
|
|
60
|
+
{...props}
|
|
61
|
+
/>
|
|
62
|
+
</AlertDialogPortal>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function AlertDialogHeader({
|
|
67
|
+
className,
|
|
68
|
+
...props
|
|
69
|
+
}: React.ComponentProps<"div">) {
|
|
70
|
+
return (
|
|
71
|
+
<div
|
|
72
|
+
data-slot="alert-dialog-header"
|
|
73
|
+
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
74
|
+
{...props}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function AlertDialogFooter({
|
|
80
|
+
className,
|
|
81
|
+
...props
|
|
82
|
+
}: React.ComponentProps<"div">) {
|
|
83
|
+
return (
|
|
84
|
+
<div
|
|
85
|
+
data-slot="alert-dialog-footer"
|
|
86
|
+
className={cn(
|
|
87
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
88
|
+
className,
|
|
89
|
+
)}
|
|
90
|
+
{...props}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function AlertDialogTitle({
|
|
96
|
+
className,
|
|
97
|
+
...props
|
|
98
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
99
|
+
return (
|
|
100
|
+
<AlertDialogPrimitive.Title
|
|
101
|
+
data-slot="alert-dialog-title"
|
|
102
|
+
className={cn("text-lg font-semibold", className)}
|
|
103
|
+
{...props}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function AlertDialogDescription({
|
|
109
|
+
className,
|
|
110
|
+
...props
|
|
111
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
112
|
+
return (
|
|
113
|
+
<AlertDialogPrimitive.Description
|
|
114
|
+
data-slot="alert-dialog-description"
|
|
115
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
116
|
+
{...props}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function AlertDialogAction({
|
|
122
|
+
className,
|
|
123
|
+
...props
|
|
124
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
|
|
125
|
+
return (
|
|
126
|
+
<AlertDialogPrimitive.Action
|
|
127
|
+
className={cn(buttonVariants(), className)}
|
|
128
|
+
{...props}
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function AlertDialogCancel({
|
|
134
|
+
className,
|
|
135
|
+
...props
|
|
136
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
|
|
137
|
+
return (
|
|
138
|
+
<AlertDialogPrimitive.Cancel
|
|
139
|
+
className={cn(buttonVariants({ variant: "outline" }), className)}
|
|
140
|
+
{...props}
|
|
141
|
+
/>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export {
|
|
146
|
+
AlertDialog,
|
|
147
|
+
AlertDialogPortal,
|
|
148
|
+
AlertDialogOverlay,
|
|
149
|
+
AlertDialogTrigger,
|
|
150
|
+
AlertDialogContent,
|
|
151
|
+
AlertDialogHeader,
|
|
152
|
+
AlertDialogFooter,
|
|
153
|
+
AlertDialogTitle,
|
|
154
|
+
AlertDialogDescription,
|
|
155
|
+
AlertDialogAction,
|
|
156
|
+
AlertDialogCancel,
|
|
157
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
import { cn } from "./utils";
|
|
5
|
+
|
|
6
|
+
const alertVariants = cva(
|
|
7
|
+
"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-card text-card-foreground",
|
|
12
|
+
destructive:
|
|
13
|
+
"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
function Alert({
|
|
23
|
+
className,
|
|
24
|
+
variant,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
data-slot="alert"
|
|
30
|
+
role="alert"
|
|
31
|
+
className={cn(alertVariants({ variant }), className)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
data-slot="alert-title"
|
|
41
|
+
className={cn(
|
|
42
|
+
"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
|
|
43
|
+
className,
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function AlertDescription({
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}: React.ComponentProps<"div">) {
|
|
54
|
+
return (
|
|
55
|
+
<div
|
|
56
|
+
data-slot="alert-description"
|
|
57
|
+
className={cn(
|
|
58
|
+
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
59
|
+
className,
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
4
|
+
|
|
5
|
+
function AspectRatio({
|
|
6
|
+
...props
|
|
7
|
+
}: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
|
|
8
|
+
return <AspectRatioPrimitive.Root data-slot="aspect-ratio" {...props} />;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { AspectRatio };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
5
|
+
|
|
6
|
+
import { cn } from "./utils";
|
|
7
|
+
|
|
8
|
+
function Avatar({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<AvatarPrimitive.Root
|
|
14
|
+
data-slot="avatar"
|
|
15
|
+
className={cn(
|
|
16
|
+
"relative flex size-10 shrink-0 overflow-hidden rounded-full",
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function AvatarImage({
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
|
28
|
+
return (
|
|
29
|
+
<AvatarPrimitive.Image
|
|
30
|
+
data-slot="avatar-image"
|
|
31
|
+
className={cn("aspect-square size-full", className)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function AvatarFallback({
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
|
|
41
|
+
return (
|
|
42
|
+
<AvatarPrimitive.Fallback
|
|
43
|
+
data-slot="avatar-fallback"
|
|
44
|
+
className={cn(
|
|
45
|
+
"bg-muted flex size-full items-center justify-center rounded-full",
|
|
46
|
+
className,
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { Avatar, AvatarImage, AvatarFallback };
|