eai-frontend-components 2.0.4 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/ui/accordion.tsx +0 -48
- package/src/components/ui/alert-dialog.tsx +0 -138
- package/src/components/ui/alert.tsx +0 -36
- package/src/components/ui/avatar.tsx +0 -48
- package/src/components/ui/badge.tsx +0 -35
- package/src/components/ui/breadcrumb.tsx +0 -115
- package/src/components/ui/button.tsx +0 -43
- package/src/components/ui/calendar.tsx +0 -142
- package/src/components/ui/card.tsx +0 -35
- package/src/components/ui/carousel.tsx +0 -257
- package/src/components/ui/chart.tsx +0 -364
- package/src/components/ui/checkbox.tsx +0 -26
- package/src/components/ui/collapsible.tsx +0 -9
- package/src/components/ui/command.tsx +0 -145
- package/src/components/ui/context-menu.tsx +0 -198
- package/src/components/ui/custom/date-picker.tsx +0 -97
- package/src/components/ui/custom/form/checkbox.tsx +0 -53
- package/src/components/ui/custom/form/color.tsx +0 -140
- package/src/components/ui/custom/form/combobox.tsx +0 -259
- package/src/components/ui/custom/form/cpf-cnpj.tsx +0 -85
- package/src/components/ui/custom/form/currency.tsx +0 -51
- package/src/components/ui/custom/form/date-range.tsx +0 -110
- package/src/components/ui/custom/form/date.tsx +0 -109
- package/src/components/ui/custom/form/decimal.tsx +0 -50
- package/src/components/ui/custom/form/file.tsx +0 -65
- package/src/components/ui/custom/form/form-help-text.tsx +0 -20
- package/src/components/ui/custom/form/form-label.tsx +0 -24
- package/src/components/ui/custom/form/form-message.tsx +0 -10
- package/src/components/ui/custom/form/ghost.tsx +0 -28
- package/src/components/ui/custom/form/input.tsx +0 -69
- package/src/components/ui/custom/form/mask.tsx +0 -78
- package/src/components/ui/custom/form/multi-select.tsx +0 -209
- package/src/components/ui/custom/form/password.tsx +0 -70
- package/src/components/ui/custom/form/percent.tsx +0 -52
- package/src/components/ui/custom/form/phone.tsx +0 -79
- package/src/components/ui/custom/form/radio-group.tsx +0 -94
- package/src/components/ui/custom/form/select.tsx +0 -62
- package/src/components/ui/custom/form/step-new-form.tsx +0 -49
- package/src/components/ui/custom/form/switch.tsx +0 -51
- package/src/components/ui/custom/form/text.tsx +0 -71
- package/src/components/ui/custom/form/textarea.tsx +0 -71
- package/src/components/ui/custom/form/utils.ts +0 -100
- package/src/components/ui/custom/header.tsx +0 -128
- package/src/components/ui/custom/label.tsx +0 -79
- package/src/components/ui/custom/not-found.tsx +0 -30
- package/src/components/ui/custom/sidebar/module-switcher.tsx +0 -58
- package/src/components/ui/custom/sidebar/nav-footer.tsx +0 -35
- package/src/components/ui/custom/sidebar/nav-main.tsx +0 -64
- package/src/components/ui/custom/sidebar/nav-submenu-collapsible.tsx +0 -60
- package/src/components/ui/custom/sidebar/nav-submenu-dropdown.tsx +0 -56
- package/src/components/ui/custom/sidebar/nav-user.tsx +0 -77
- package/src/components/ui/custom/sidebar/sidebar-button.tsx +0 -30
- package/src/components/ui/custom/sidebar/sidebar-item-two-lines.tsx +0 -25
- package/src/components/ui/custom/sidebar/sidebar-item.tsx +0 -19
- package/src/components/ui/custom/sidebar/types/sidebar.ts +0 -31
- package/src/components/ui/custom/table/data-table-export.tsx +0 -126
- package/src/components/ui/custom/table/data-table-footer.tsx +0 -148
- package/src/components/ui/custom/table/data-table-header.tsx +0 -58
- package/src/components/ui/custom/table/data-table-rows.tsx +0 -94
- package/src/components/ui/custom/table/data-table.tsx +0 -285
- package/src/components/ui/custom/table/types/data-table.ts +0 -31
- package/src/components/ui/custom/theme-provider.tsx +0 -121
- package/src/components/ui/dateRangePicker.tsx +0 -63
- package/src/components/ui/dialog.tsx +0 -84
- package/src/components/ui/drawer.tsx +0 -116
- package/src/components/ui/dropdown-menu.tsx +0 -173
- package/src/components/ui/form.tsx +0 -114
- package/src/components/ui/hover-card.tsx +0 -27
- package/src/components/ui/input.tsx +0 -265
- package/src/components/ui/label.tsx +0 -15
- package/src/components/ui/masks.ts +0 -35
- package/src/components/ui/pagination.tsx +0 -78
- package/src/components/ui/popover.tsx +0 -32
- package/src/components/ui/progress.tsx +0 -22
- package/src/components/ui/radio-group.tsx +0 -36
- package/src/components/ui/scroll-area.tsx +0 -46
- package/src/components/ui/select.tsx +0 -130
- package/src/components/ui/separator.tsx +0 -29
- package/src/components/ui/sheet.tsx +0 -90
- package/src/components/ui/sidebar.tsx +0 -598
- package/src/components/ui/skeleton.tsx +0 -15
- package/src/components/ui/slider.tsx +0 -18
- package/src/components/ui/switch.tsx +0 -26
- package/src/components/ui/table.tsx +0 -53
- package/src/components/ui/tabs.tsx +0 -47
- package/src/components/ui/textarea.tsx +0 -27
- package/src/components/ui/toast.tsx +0 -88
- package/src/components/ui/toaster.tsx +0 -49
- package/src/components/ui/tooltip.tsx +0 -31
- package/src/components/ui/use-calendar.tsx +0 -61
- package/src/components/ui/use-toast.ts +0 -186
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/index.ts +0 -299
- package/src/lib/help/date-utils.ts +0 -41
- package/src/lib/help/format.ts +0 -171
- package/src/lib/help/theme.ts +0 -346
- package/src/lib/help/uuid.ts +0 -4
- package/src/lib/utils.ts +0 -6
- package/src/styles/globals.css +0 -59
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eai-frontend-components",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.6",
|
|
4
|
+
"description": "Biblioteca de componentes UI reutilizáveis baseada em shadcn/ui e Radix UI para projetos EAI.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"types": "dist/index.d.ts",
|
|
24
24
|
"files": [
|
|
25
25
|
"dist",
|
|
26
|
-
"
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE"
|
|
27
28
|
],
|
|
28
29
|
"scripts": {
|
|
29
30
|
"build": "rollup -c",
|
|
@@ -36,7 +37,6 @@
|
|
|
36
37
|
"test": "echo \"No tests specified\" && exit 0",
|
|
37
38
|
"ci": "npm run lint && npm run type-check && npm run build",
|
|
38
39
|
"release": "semantic-release",
|
|
39
|
-
"postinstall": "npm run build",
|
|
40
40
|
"prepublishOnly": "npm run ci"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
|
-
import { ChevronDown } from 'lucide-react';
|
|
3
|
-
import * as React from '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) => <AccordionPrimitive.Item ref={ref} className={cn('border-b', className)} {...props} />);
|
|
13
|
-
AccordionItem.displayName = 'AccordionItem';
|
|
14
|
-
|
|
15
|
-
const AccordionTrigger = React.forwardRef<
|
|
16
|
-
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
17
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
|
18
|
-
>(({ className, children, ...props }, ref) => (
|
|
19
|
-
<AccordionPrimitive.Header className='flex'>
|
|
20
|
-
<AccordionPrimitive.Trigger
|
|
21
|
-
ref={ref}
|
|
22
|
-
className={cn('flex flex-1 items-center justify-between p-4 font-medium transition-all [&[data-state=open]>svg]:rotate-180', className)}
|
|
23
|
-
{...props}
|
|
24
|
-
>
|
|
25
|
-
{children}
|
|
26
|
-
<ChevronDown className='h-4 w-4 shrink-0 transition-transform duration-200' />
|
|
27
|
-
</AccordionPrimitive.Trigger>
|
|
28
|
-
</AccordionPrimitive.Header>
|
|
29
|
-
));
|
|
30
|
-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
31
|
-
|
|
32
|
-
const AccordionContent = React.forwardRef<
|
|
33
|
-
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
34
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
|
35
|
-
>(({ className, children, ...props }, ref) => (
|
|
36
|
-
<AccordionPrimitive.Content
|
|
37
|
-
ref={ref}
|
|
38
|
-
className='overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down'
|
|
39
|
-
{...props}
|
|
40
|
-
>
|
|
41
|
-
<div className={cn('p-4 pt-0', className)}>{children}</div>
|
|
42
|
-
</AccordionPrimitive.Content>
|
|
43
|
-
));
|
|
44
|
-
|
|
45
|
-
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
46
|
-
|
|
47
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
48
|
-
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { cn } from "@/lib/utils"
|
|
2
|
-
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { buttonVariants } from "./button"
|
|
5
|
-
|
|
6
|
-
const AlertDialog = AlertDialogPrimitive.Root
|
|
7
|
-
|
|
8
|
-
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
|
9
|
-
|
|
10
|
-
const AlertDialogPortal = AlertDialogPrimitive.Portal
|
|
11
|
-
|
|
12
|
-
const AlertDialogOverlay = React.forwardRef<
|
|
13
|
-
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
14
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
15
|
-
>(({ className, ...props }, ref) => (
|
|
16
|
-
<AlertDialogPrimitive.Overlay
|
|
17
|
-
className={cn(
|
|
18
|
-
"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",
|
|
19
|
-
className
|
|
20
|
-
)}
|
|
21
|
-
{...props}
|
|
22
|
-
ref={ref}
|
|
23
|
-
/>
|
|
24
|
-
))
|
|
25
|
-
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
|
|
26
|
-
|
|
27
|
-
const AlertDialogContent = React.forwardRef<
|
|
28
|
-
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
29
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
|
|
30
|
-
>(({ className, ...props }, ref) => (
|
|
31
|
-
<AlertDialogPortal>
|
|
32
|
-
<AlertDialogOverlay />
|
|
33
|
-
<AlertDialogPrimitive.Content
|
|
34
|
-
ref={ref}
|
|
35
|
-
className={cn(
|
|
36
|
-
"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",
|
|
37
|
-
className
|
|
38
|
-
)}
|
|
39
|
-
{...props}
|
|
40
|
-
/>
|
|
41
|
-
</AlertDialogPortal>
|
|
42
|
-
))
|
|
43
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
|
|
44
|
-
|
|
45
|
-
const AlertDialogHeader = ({
|
|
46
|
-
className,
|
|
47
|
-
...props
|
|
48
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
49
|
-
<div
|
|
50
|
-
className={cn(
|
|
51
|
-
"flex flex-col space-y-2 text-center sm:text-left",
|
|
52
|
-
className
|
|
53
|
-
)}
|
|
54
|
-
{...props}
|
|
55
|
-
/>
|
|
56
|
-
)
|
|
57
|
-
AlertDialogHeader.displayName = "AlertDialogHeader"
|
|
58
|
-
|
|
59
|
-
const AlertDialogFooter = ({
|
|
60
|
-
className,
|
|
61
|
-
...props
|
|
62
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
63
|
-
<div
|
|
64
|
-
className={cn(
|
|
65
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
66
|
-
className
|
|
67
|
-
)}
|
|
68
|
-
{...props}
|
|
69
|
-
/>
|
|
70
|
-
)
|
|
71
|
-
AlertDialogFooter.displayName = "AlertDialogFooter"
|
|
72
|
-
|
|
73
|
-
const AlertDialogTitle = React.forwardRef<
|
|
74
|
-
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
75
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
76
|
-
>(({ className, ...props }, ref) => (
|
|
77
|
-
<AlertDialogPrimitive.Title
|
|
78
|
-
ref={ref}
|
|
79
|
-
className={cn("text-lg font-semibold", className)}
|
|
80
|
-
{...props}
|
|
81
|
-
/>
|
|
82
|
-
))
|
|
83
|
-
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
|
|
84
|
-
|
|
85
|
-
const AlertDialogDescription = React.forwardRef<
|
|
86
|
-
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
87
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
88
|
-
>(({ className, ...props }, ref) => (
|
|
89
|
-
<AlertDialogPrimitive.Description
|
|
90
|
-
ref={ref}
|
|
91
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
92
|
-
{...props}
|
|
93
|
-
/>
|
|
94
|
-
))
|
|
95
|
-
AlertDialogDescription.displayName =
|
|
96
|
-
AlertDialogPrimitive.Description.displayName
|
|
97
|
-
|
|
98
|
-
const AlertDialogAction = React.forwardRef<
|
|
99
|
-
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
100
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action> & {
|
|
101
|
-
variant?: "default" | "outline" | "destructive" | "secondary"; // Adapte conforme suas variantes
|
|
102
|
-
}
|
|
103
|
-
>(({ className, variant = "default", ...props }, ref) => (
|
|
104
|
-
<AlertDialogPrimitive.Action
|
|
105
|
-
ref={ref}
|
|
106
|
-
className={cn(buttonVariants({ variant }), className)}
|
|
107
|
-
{...props}
|
|
108
|
-
/>
|
|
109
|
-
));
|
|
110
|
-
|
|
111
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const AlertDialogCancel = React.forwardRef<
|
|
115
|
-
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
116
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel> & {
|
|
117
|
-
variant?: "default" | "outline" | "destructive" | "secondary"; // Adapte conforme suas variantes
|
|
118
|
-
}
|
|
119
|
-
>(({ className, variant = "outline", ...props }, ref) => (
|
|
120
|
-
<AlertDialogPrimitive.Cancel
|
|
121
|
-
ref={ref}
|
|
122
|
-
className={cn(
|
|
123
|
-
buttonVariants({ variant }), // Usa a variante passada como prop
|
|
124
|
-
"mt-2 sm:mt-0",
|
|
125
|
-
className
|
|
126
|
-
)}
|
|
127
|
-
{...props}
|
|
128
|
-
/>
|
|
129
|
-
));
|
|
130
|
-
|
|
131
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
export {
|
|
135
|
-
AlertDialog, AlertDialogAction,
|
|
136
|
-
AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger
|
|
137
|
-
}
|
|
138
|
-
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { cn } from '../../lib/utils';
|
|
4
|
-
|
|
5
|
-
const alertVariants = cva(
|
|
6
|
-
'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',
|
|
7
|
-
{
|
|
8
|
-
variants: {
|
|
9
|
-
variant: {
|
|
10
|
-
default: 'bg-background text-foreground',
|
|
11
|
-
destructive: 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
defaultVariants: {
|
|
15
|
-
variant: 'default',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const Alert = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>>(
|
|
21
|
-
({ className, variant, ...props }, ref) => <div ref={ref} role='alert' className={cn(alertVariants({ variant }), className)} {...props} />,
|
|
22
|
-
);
|
|
23
|
-
Alert.displayName = 'Alert';
|
|
24
|
-
|
|
25
|
-
const AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => (
|
|
26
|
-
<h5 ref={ref} className={cn('mb-1 font-medium leading-none tracking-tight', className)} {...props} />
|
|
27
|
-
));
|
|
28
|
-
AlertTitle.displayName = 'AlertTitle';
|
|
29
|
-
|
|
30
|
-
const AlertDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, ...props }, ref) => (
|
|
31
|
-
<div ref={ref} className={cn('text-sm [&_p]:leading-relaxed', className)} {...props} />
|
|
32
|
-
));
|
|
33
|
-
AlertDescription.displayName = 'AlertDescription';
|
|
34
|
-
|
|
35
|
-
export { Alert, AlertDescription, AlertTitle };
|
|
36
|
-
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as AvatarPrimitive from "@radix-ui/react-avatar"
|
|
3
|
-
|
|
4
|
-
import { cn } from "@/lib/utils"
|
|
5
|
-
|
|
6
|
-
const Avatar = React.forwardRef<
|
|
7
|
-
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
8
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
9
|
-
>(({ className, ...props }, ref) => (
|
|
10
|
-
<AvatarPrimitive.Root
|
|
11
|
-
ref={ref}
|
|
12
|
-
className={cn(
|
|
13
|
-
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
14
|
-
className
|
|
15
|
-
)}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
))
|
|
19
|
-
Avatar.displayName = AvatarPrimitive.Root.displayName
|
|
20
|
-
|
|
21
|
-
const AvatarImage = React.forwardRef<
|
|
22
|
-
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
23
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
24
|
-
>(({ className, ...props }, ref) => (
|
|
25
|
-
<AvatarPrimitive.Image
|
|
26
|
-
ref={ref}
|
|
27
|
-
className={cn("aspect-square h-full w-full", className)}
|
|
28
|
-
{...props}
|
|
29
|
-
/>
|
|
30
|
-
))
|
|
31
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName
|
|
32
|
-
|
|
33
|
-
const AvatarFallback = React.forwardRef<
|
|
34
|
-
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
35
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
36
|
-
>(({ className, ...props }, ref) => (
|
|
37
|
-
<AvatarPrimitive.Fallback
|
|
38
|
-
ref={ref}
|
|
39
|
-
className={cn(
|
|
40
|
-
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
41
|
-
className
|
|
42
|
-
)}
|
|
43
|
-
{...props}
|
|
44
|
-
/>
|
|
45
|
-
))
|
|
46
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
|
|
47
|
-
|
|
48
|
-
export { Avatar, AvatarImage, AvatarFallback }
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type VariantProps, cva } from 'class-variance-authority';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { cn } from '../../lib/utils';
|
|
4
|
-
|
|
5
|
-
const badgeVariants = cva(
|
|
6
|
-
'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',
|
|
7
|
-
{
|
|
8
|
-
variants: {
|
|
9
|
-
variant: {
|
|
10
|
-
default: 'border-transparent bg-background-primary text-primary-foreground',
|
|
11
|
-
secondary: 'border-transparent bg-background-secondary text-secondary-foreground',
|
|
12
|
-
surface: 'border-transparent bg-primary-100 text-primary',
|
|
13
|
-
destructive: 'border-transparent bg-destructive text-destructive-foreground',
|
|
14
|
-
outline: 'text-foreground',
|
|
15
|
-
green: 'border-transparent bg-green-50 text-emerald-700',
|
|
16
|
-
red: 'border-transparent bg-red-50 text-red-600',
|
|
17
|
-
gray: 'border-transparent bg-zinc-100 text-zinc-950',
|
|
18
|
-
blue: 'border-transparent bg-blue-50 text-blue-600',
|
|
19
|
-
orange: 'border-transparent bg-orange-50 text-orange-600',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: {
|
|
23
|
-
variant: 'default',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
|
|
29
|
-
|
|
30
|
-
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
31
|
-
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export { Badge, badgeVariants };
|
|
35
|
-
|
|
@@ -1,115 +0,0 @@
|
|
|
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<
|
|
16
|
-
HTMLOListElement,
|
|
17
|
-
React.ComponentPropsWithoutRef<"ol">
|
|
18
|
-
>(({ className, ...props }, ref) => (
|
|
19
|
-
<ol
|
|
20
|
-
ref={ref}
|
|
21
|
-
className={cn(
|
|
22
|
-
"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
|
|
23
|
-
className
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
))
|
|
28
|
-
BreadcrumbList.displayName = "BreadcrumbList"
|
|
29
|
-
|
|
30
|
-
const BreadcrumbItem = React.forwardRef<
|
|
31
|
-
HTMLLIElement,
|
|
32
|
-
React.ComponentPropsWithoutRef<"li">
|
|
33
|
-
>(({ className, ...props }, ref) => (
|
|
34
|
-
<li
|
|
35
|
-
ref={ref}
|
|
36
|
-
className={cn("inline-flex items-center gap-1.5", className)}
|
|
37
|
-
{...props}
|
|
38
|
-
/>
|
|
39
|
-
))
|
|
40
|
-
BreadcrumbItem.displayName = "BreadcrumbItem"
|
|
41
|
-
|
|
42
|
-
const BreadcrumbLink = React.forwardRef<
|
|
43
|
-
HTMLAnchorElement,
|
|
44
|
-
React.ComponentPropsWithoutRef<"a"> & {
|
|
45
|
-
asChild?: boolean
|
|
46
|
-
}
|
|
47
|
-
>(({ asChild, className, ...props }, ref) => {
|
|
48
|
-
const Comp = asChild ? Slot : "a"
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<Comp
|
|
52
|
-
ref={ref}
|
|
53
|
-
className={cn("transition-colors hover:text-foreground", className)}
|
|
54
|
-
{...props}
|
|
55
|
-
/>
|
|
56
|
-
)
|
|
57
|
-
})
|
|
58
|
-
BreadcrumbLink.displayName = "BreadcrumbLink"
|
|
59
|
-
|
|
60
|
-
const BreadcrumbPage = React.forwardRef<
|
|
61
|
-
HTMLSpanElement,
|
|
62
|
-
React.ComponentPropsWithoutRef<"span">
|
|
63
|
-
>(({ className, ...props }, ref) => (
|
|
64
|
-
<span
|
|
65
|
-
ref={ref}
|
|
66
|
-
role="link"
|
|
67
|
-
aria-disabled="true"
|
|
68
|
-
aria-current="page"
|
|
69
|
-
className={cn("font-normal text-foreground", className)}
|
|
70
|
-
{...props}
|
|
71
|
-
/>
|
|
72
|
-
))
|
|
73
|
-
BreadcrumbPage.displayName = "BreadcrumbPage"
|
|
74
|
-
|
|
75
|
-
const BreadcrumbSeparator = ({
|
|
76
|
-
children,
|
|
77
|
-
className,
|
|
78
|
-
...props
|
|
79
|
-
}: React.ComponentProps<"li">) => (
|
|
80
|
-
<li
|
|
81
|
-
role="presentation"
|
|
82
|
-
aria-hidden="true"
|
|
83
|
-
className={cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)}
|
|
84
|
-
{...props}
|
|
85
|
-
>
|
|
86
|
-
{children ?? <ChevronRight />}
|
|
87
|
-
</li>
|
|
88
|
-
)
|
|
89
|
-
BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
|
|
90
|
-
|
|
91
|
-
const BreadcrumbEllipsis = ({
|
|
92
|
-
className,
|
|
93
|
-
...props
|
|
94
|
-
}: React.ComponentProps<"span">) => (
|
|
95
|
-
<span
|
|
96
|
-
role="presentation"
|
|
97
|
-
aria-hidden="true"
|
|
98
|
-
className={cn("flex h-9 w-9 items-center justify-center", className)}
|
|
99
|
-
{...props}
|
|
100
|
-
>
|
|
101
|
-
<MoreHorizontal className="h-4 w-4" />
|
|
102
|
-
<span className="sr-only">More</span>
|
|
103
|
-
</span>
|
|
104
|
-
)
|
|
105
|
-
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
|
|
106
|
-
|
|
107
|
-
export {
|
|
108
|
-
Breadcrumb,
|
|
109
|
-
BreadcrumbList,
|
|
110
|
-
BreadcrumbItem,
|
|
111
|
-
BreadcrumbLink,
|
|
112
|
-
BreadcrumbPage,
|
|
113
|
-
BreadcrumbSeparator,
|
|
114
|
-
BreadcrumbEllipsis,
|
|
115
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
2
|
-
import { type VariantProps, cva } from 'class-variance-authority';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { cn } from '../../lib/utils';
|
|
5
|
-
|
|
6
|
-
const buttonVariants = cva(
|
|
7
|
-
'inline-flex items-center justify-center gap-2 self-start px-4 py-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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: 'bg-background-primary text-white hover:bg-background-primary-hover disabled:opacity-50',
|
|
12
|
-
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary-hover disabled:opacity-50',
|
|
13
|
-
destructive: 'bg-red-600 text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50',
|
|
14
|
-
outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground disabled:opacity-50',
|
|
15
|
-
ghost: 'hover:bg-accent hover:text-accent-foreground disabled:opacity-50',
|
|
16
|
-
link: 'text-primary underline-offset-4 hover:underline disabled:opacity-50',
|
|
17
|
-
},
|
|
18
|
-
size: {
|
|
19
|
-
default: 'h-10 px-4 py-2',
|
|
20
|
-
sm: 'h-9 rounded-md px-3',
|
|
21
|
-
lg: 'h-11 rounded-md px-8',
|
|
22
|
-
icon: 'h-10 w-10',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
defaultVariants: {
|
|
26
|
-
variant: 'default',
|
|
27
|
-
size: 'default',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
33
|
-
asChild?: boolean;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
37
|
-
const Comp = asChild ? Slot : 'button';
|
|
38
|
-
return <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />;
|
|
39
|
-
});
|
|
40
|
-
Button.displayName = 'Button';
|
|
41
|
-
|
|
42
|
-
export { Button, buttonVariants };
|
|
43
|
-
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker';
|
|
4
|
-
import { cn } from '../../lib/utils';
|
|
5
|
-
import { Button, buttonVariants } from './button';
|
|
6
|
-
|
|
7
|
-
function Calendar({
|
|
8
|
-
className,
|
|
9
|
-
classNames,
|
|
10
|
-
showOutsideDays = true,
|
|
11
|
-
captionLayout = 'label',
|
|
12
|
-
buttonVariant = 'ghost',
|
|
13
|
-
formatters,
|
|
14
|
-
components,
|
|
15
|
-
...props
|
|
16
|
-
}: React.ComponentProps<typeof DayPicker> & {
|
|
17
|
-
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
|
|
18
|
-
}) {
|
|
19
|
-
const defaultClassNames = getDefaultClassNames();
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<DayPicker
|
|
23
|
-
showOutsideDays={showOutsideDays}
|
|
24
|
-
className={cn(
|
|
25
|
-
'bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',
|
|
26
|
-
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
27
|
-
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
28
|
-
className,
|
|
29
|
-
)}
|
|
30
|
-
captionLayout={captionLayout}
|
|
31
|
-
formatters={{
|
|
32
|
-
formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),
|
|
33
|
-
...formatters,
|
|
34
|
-
}}
|
|
35
|
-
classNames={{
|
|
36
|
-
root: cn('w-fit', defaultClassNames.root),
|
|
37
|
-
months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),
|
|
38
|
-
month: cn('flex w-full flex-col gap-4', defaultClassNames.month),
|
|
39
|
-
nav: cn('absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1', defaultClassNames.nav),
|
|
40
|
-
button_previous: cn(
|
|
41
|
-
buttonVariants({ variant: buttonVariant }),
|
|
42
|
-
'h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50',
|
|
43
|
-
defaultClassNames.button_previous,
|
|
44
|
-
),
|
|
45
|
-
button_next: cn(
|
|
46
|
-
buttonVariants({ variant: buttonVariant }),
|
|
47
|
-
'h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50',
|
|
48
|
-
defaultClassNames.button_next,
|
|
49
|
-
),
|
|
50
|
-
month_caption: cn('flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]', defaultClassNames.month_caption),
|
|
51
|
-
dropdowns: cn('flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium', defaultClassNames.dropdowns),
|
|
52
|
-
dropdown_root: cn(
|
|
53
|
-
'has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border',
|
|
54
|
-
defaultClassNames.dropdown_root,
|
|
55
|
-
),
|
|
56
|
-
dropdown: cn('absolute inset-0 opacity-0', defaultClassNames.dropdown),
|
|
57
|
-
caption_label: cn(
|
|
58
|
-
'select-none font-medium',
|
|
59
|
-
captionLayout === 'label'
|
|
60
|
-
? 'text-sm'
|
|
61
|
-
: '[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5',
|
|
62
|
-
defaultClassNames.caption_label,
|
|
63
|
-
),
|
|
64
|
-
table: 'w-full border-collapse',
|
|
65
|
-
weekdays: cn('flex', defaultClassNames.weekdays),
|
|
66
|
-
weekday: cn('text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal', defaultClassNames.weekday),
|
|
67
|
-
week: cn('mt-2 flex w-full', defaultClassNames.week),
|
|
68
|
-
week_number_header: cn('w-[--cell-size] select-none', defaultClassNames.week_number_header),
|
|
69
|
-
week_number: cn('text-muted-foreground select-none text-[0.8rem]', defaultClassNames.week_number),
|
|
70
|
-
day: cn(
|
|
71
|
-
'group/day relative aspect-square h-[32px] w-[32px] select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md',
|
|
72
|
-
defaultClassNames.day,
|
|
73
|
-
),
|
|
74
|
-
range_start: cn('bg-accent rounded-l-md', defaultClassNames.range_start),
|
|
75
|
-
range_middle: cn('rounded-none', defaultClassNames.range_middle),
|
|
76
|
-
range_end: cn('bg-accent rounded-r-md', defaultClassNames.range_end),
|
|
77
|
-
today: cn('bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none', defaultClassNames.today),
|
|
78
|
-
outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),
|
|
79
|
-
disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
|
|
80
|
-
hidden: cn('invisible', defaultClassNames.hidden),
|
|
81
|
-
...classNames,
|
|
82
|
-
}}
|
|
83
|
-
components={{
|
|
84
|
-
Root: ({ className, rootRef, ...props }) => {
|
|
85
|
-
return <div data-slot='calendar' ref={rootRef} className={cn(className)} {...props} />;
|
|
86
|
-
},
|
|
87
|
-
Chevron: ({ className, orientation, ...props }) => {
|
|
88
|
-
if (orientation === 'left') {
|
|
89
|
-
return <ChevronLeftIcon className={cn('size-4', className)} {...props} />;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (orientation === 'right') {
|
|
93
|
-
return <ChevronRightIcon className={cn('size-4', className)} {...props} />;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return <ChevronDownIcon className={cn('size-4', className)} {...props} />;
|
|
97
|
-
},
|
|
98
|
-
DayButton: CalendarDayButton,
|
|
99
|
-
WeekNumber: ({ children, ...props }) => {
|
|
100
|
-
return (
|
|
101
|
-
<td {...props}>
|
|
102
|
-
<div className='flex size-[--cell-size] items-center justify-center text-center'>{children}</div>
|
|
103
|
-
</td>
|
|
104
|
-
);
|
|
105
|
-
},
|
|
106
|
-
...components,
|
|
107
|
-
}}
|
|
108
|
-
{...props}
|
|
109
|
-
/>
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>) {
|
|
114
|
-
const defaultClassNames = getDefaultClassNames();
|
|
115
|
-
|
|
116
|
-
const ref = React.useRef<HTMLButtonElement>(null);
|
|
117
|
-
React.useEffect(() => {
|
|
118
|
-
if (modifiers.focused) ref.current?.focus();
|
|
119
|
-
}, [modifiers.focused]);
|
|
120
|
-
|
|
121
|
-
return (
|
|
122
|
-
<Button
|
|
123
|
-
ref={ref}
|
|
124
|
-
variant='ghost'
|
|
125
|
-
size='icon'
|
|
126
|
-
data-day={day.date.toLocaleDateString()}
|
|
127
|
-
data-selected-single={modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle}
|
|
128
|
-
data-range-start={modifiers.range_start}
|
|
129
|
-
data-range-end={modifiers.range_end}
|
|
130
|
-
data-range-middle={modifiers.range_middle}
|
|
131
|
-
className={cn(
|
|
132
|
-
'data-[selected-single=true]:bg-background-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-background-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-background-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',
|
|
133
|
-
defaultClassNames.day,
|
|
134
|
-
className,
|
|
135
|
-
)}
|
|
136
|
-
{...props}
|
|
137
|
-
/>
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export { Calendar, CalendarDayButton };
|
|
142
|
-
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { cn } from '../../lib/utils';
|
|
3
|
-
|
|
4
|
-
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
|
|
5
|
-
<div ref={ref} className={cn('rounded-lg border bg-card text-card-foreground shadow-sm', className)} {...props} />
|
|
6
|
-
));
|
|
7
|
-
Card.displayName = 'Card';
|
|
8
|
-
|
|
9
|
-
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
|
|
10
|
-
<div ref={ref} className={cn('flex p-6', className)} {...props} />
|
|
11
|
-
));
|
|
12
|
-
CardHeader.displayName = 'CardHeader';
|
|
13
|
-
|
|
14
|
-
const CardTitle = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
|
|
15
|
-
<div ref={ref} className={cn('text-2xl font-semibold leading-none tracking-tight', className)} {...props} />
|
|
16
|
-
));
|
|
17
|
-
CardTitle.displayName = 'CardTitle';
|
|
18
|
-
|
|
19
|
-
const CardDescription = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
|
|
20
|
-
<div ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
|
|
21
|
-
));
|
|
22
|
-
CardDescription.displayName = 'CardDescription';
|
|
23
|
-
|
|
24
|
-
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
|
|
25
|
-
<div ref={ref} className={cn('py-8 px-6', className)} {...props} />
|
|
26
|
-
));
|
|
27
|
-
CardContent.displayName = 'CardContent';
|
|
28
|
-
|
|
29
|
-
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
|
|
30
|
-
<div ref={ref} className={cn('flex items-center p-6', className)} {...props} />
|
|
31
|
-
));
|
|
32
|
-
CardFooter.displayName = 'CardFooter';
|
|
33
|
-
|
|
34
|
-
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
35
|
-
|