@vendure/dashboard 3.3.6-master-202507030648 → 3.3.6-master-202507030835

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.
Files changed (67) hide show
  1. package/dist/plugin/vite-plugin-vendure-dashboard.js +1 -1
  2. package/package.json +40 -27
  3. package/src/app/routes/_authenticated/_collections/collections.graphql.ts +32 -0
  4. package/src/app/routes/_authenticated/_collections/collections.tsx +153 -133
  5. package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +1 -1
  6. package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +34 -1
  7. package/src/app/routes/_authenticated/_collections/components/move-collections-dialog.tsx +430 -0
  8. package/src/app/routes/_authenticated/_collections/components/move-single-collection.tsx +33 -0
  9. package/src/app/routes/_authenticated/_customers/components/customer-address-card.tsx +8 -3
  10. package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +1 -1
  11. package/src/app/routes/_authenticated/_products/products_.$id.tsx +1 -1
  12. package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +1 -1
  13. package/src/lib/components/data-input/money-input.tsx +2 -9
  14. package/src/lib/components/data-table/data-table.tsx +1 -1
  15. package/src/lib/components/shared/form-field-wrapper.tsx +22 -13
  16. package/src/lib/components/shared/paginated-list-data-table.tsx +1 -1
  17. package/src/lib/components/ui/accordion.tsx +50 -45
  18. package/src/lib/components/ui/alert-dialog.tsx +122 -93
  19. package/src/lib/components/ui/alert.tsx +54 -48
  20. package/src/lib/components/ui/aspect-ratio.tsx +9 -0
  21. package/src/lib/components/ui/avatar.tsx +53 -0
  22. package/src/lib/components/ui/badge.tsx +37 -29
  23. package/src/lib/components/ui/breadcrumb.tsx +89 -82
  24. package/src/lib/components/ui/button.tsx +52 -51
  25. package/src/lib/components/ui/calendar.tsx +196 -435
  26. package/src/lib/components/ui/card.tsx +78 -33
  27. package/src/lib/components/ui/carousel.tsx +241 -0
  28. package/src/lib/components/ui/chart.tsx +351 -0
  29. package/src/lib/components/ui/checkbox.tsx +28 -23
  30. package/src/lib/components/ui/collapsible.tsx +0 -2
  31. package/src/lib/components/ui/command.tsx +159 -114
  32. package/src/lib/components/ui/context-menu.tsx +252 -0
  33. package/src/lib/components/ui/dialog.tsx +115 -90
  34. package/src/lib/components/ui/drawer.tsx +133 -0
  35. package/src/lib/components/ui/dropdown-menu.tsx +207 -170
  36. package/src/lib/components/ui/form.tsx +138 -114
  37. package/src/lib/components/ui/hover-card.tsx +32 -26
  38. package/src/lib/components/ui/input-otp.tsx +77 -0
  39. package/src/lib/components/ui/input.tsx +17 -15
  40. package/src/lib/components/ui/label.tsx +19 -16
  41. package/src/lib/components/ui/menubar.tsx +274 -0
  42. package/src/lib/components/ui/navigation-menu.tsx +168 -0
  43. package/src/lib/components/ui/pagination.tsx +108 -87
  44. package/src/lib/components/ui/popover.tsx +36 -28
  45. package/src/lib/components/ui/progress.tsx +29 -0
  46. package/src/lib/components/ui/radio-group.tsx +45 -0
  47. package/src/lib/components/ui/resizable.tsx +54 -0
  48. package/src/lib/components/ui/scroll-area.tsx +48 -40
  49. package/src/lib/components/ui/select.tsx +151 -129
  50. package/src/lib/components/ui/separator.tsx +22 -20
  51. package/src/lib/components/ui/sheet.tsx +110 -91
  52. package/src/lib/components/ui/sidebar.tsx +652 -622
  53. package/src/lib/components/ui/skeleton.tsx +10 -10
  54. package/src/lib/components/ui/slider.tsx +63 -0
  55. package/src/lib/components/ui/sonner.tsx +7 -11
  56. package/src/lib/components/ui/switch.tsx +27 -22
  57. package/src/lib/components/ui/table.tsx +96 -64
  58. package/src/lib/components/ui/tabs.tsx +56 -38
  59. package/src/lib/components/ui/textarea.tsx +14 -14
  60. package/src/lib/components/ui/toggle-group.tsx +73 -0
  61. package/src/lib/components/ui/toggle.tsx +45 -0
  62. package/src/lib/components/ui/tooltip.tsx +45 -37
  63. package/src/lib/framework/component-registry/component-registry.tsx +5 -3
  64. package/src/lib/framework/page/detail-page.tsx +28 -17
  65. package/src/lib/framework/page/list-page.tsx +1 -1
  66. package/src/lib/index.ts +5 -6
  67. package/vite/vite-plugin-vendure-dashboard.ts +1 -1
@@ -1,59 +1,64 @@
1
- import * as AccordionPrimitive from '@radix-ui/react-accordion';
2
- import { ChevronDownIcon } from 'lucide-react';
3
- import * as React from 'react';
1
+ import * as React from "react"
2
+ import * as AccordionPrimitive from "@radix-ui/react-accordion"
3
+ import { ChevronDownIcon } from "lucide-react"
4
4
 
5
- import { cn } from '@/vdb/lib/utils.js';
5
+ import { cn } from "@/vdb/lib/utils"
6
6
 
7
- function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>) {
8
- return <AccordionPrimitive.Root data-slot="accordion" {...props} />;
7
+ function Accordion({
8
+ ...props
9
+ }: React.ComponentProps<typeof AccordionPrimitive.Root>) {
10
+ return <AccordionPrimitive.Root data-slot="accordion" {...props} />
9
11
  }
10
12
 
11
- function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>) {
12
- return (
13
- <AccordionPrimitive.Item
14
- data-slot="accordion-item"
15
- className={cn('border-b last:border-b-0', className)}
16
- {...props}
17
- />
18
- );
13
+ function AccordionItem({
14
+ className,
15
+ ...props
16
+ }: React.ComponentProps<typeof AccordionPrimitive.Item>) {
17
+ return (
18
+ <AccordionPrimitive.Item
19
+ data-slot="accordion-item"
20
+ className={cn("border-b last:border-b-0", className)}
21
+ {...props}
22
+ />
23
+ )
19
24
  }
20
25
 
21
26
  function AccordionTrigger({
22
- className,
23
- children,
24
- ...props
27
+ className,
28
+ children,
29
+ ...props
25
30
  }: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
26
- return (
27
- <AccordionPrimitive.Header className="flex">
28
- <AccordionPrimitive.Trigger
29
- data-slot="accordion-trigger"
30
- className={cn(
31
- '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',
32
- className,
33
- )}
34
- {...props}
35
- >
36
- {children}
37
- <ChevronDownIcon className="text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" />
38
- </AccordionPrimitive.Trigger>
39
- </AccordionPrimitive.Header>
40
- );
31
+ return (
32
+ <AccordionPrimitive.Header className="flex">
33
+ <AccordionPrimitive.Trigger
34
+ data-slot="accordion-trigger"
35
+ className={cn(
36
+ "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",
37
+ className
38
+ )}
39
+ {...props}
40
+ >
41
+ {children}
42
+ <ChevronDownIcon className="text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" />
43
+ </AccordionPrimitive.Trigger>
44
+ </AccordionPrimitive.Header>
45
+ )
41
46
  }
42
47
 
43
48
  function AccordionContent({
44
- className,
45
- children,
46
- ...props
49
+ className,
50
+ children,
51
+ ...props
47
52
  }: React.ComponentProps<typeof AccordionPrimitive.Content>) {
48
- return (
49
- <AccordionPrimitive.Content
50
- data-slot="accordion-content"
51
- className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
52
- {...props}
53
- >
54
- <div className={cn('pt-0 pb-4', className)}>{children}</div>
55
- </AccordionPrimitive.Content>
56
- );
53
+ return (
54
+ <AccordionPrimitive.Content
55
+ data-slot="accordion-content"
56
+ className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
57
+ {...props}
58
+ >
59
+ <div className={cn("pt-0 pb-4", className)}>{children}</div>
60
+ </AccordionPrimitive.Content>
61
+ )
57
62
  }
58
63
 
59
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
64
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
@@ -1,128 +1,157 @@
1
- import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
2
- import * as React from 'react';
1
+ "use client"
3
2
 
4
- import { buttonVariants } from '@/vdb/components/ui/button.js';
5
- import { cn } from '@/vdb/lib/utils.js';
3
+ import * as React from "react"
4
+ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
6
5
 
7
- function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
8
- return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
6
+ import { cn } from "@/vdb/lib/utils"
7
+ import { buttonVariants } from "@/vdb/components/ui/button"
8
+
9
+ function AlertDialog({
10
+ ...props
11
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
12
+ return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
9
13
  }
10
14
 
11
- function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
12
- return <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />;
15
+ function AlertDialogTrigger({
16
+ ...props
17
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
18
+ return (
19
+ <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
20
+ )
13
21
  }
14
22
 
15
- function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
16
- return <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />;
23
+ function AlertDialogPortal({
24
+ ...props
25
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
26
+ return (
27
+ <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
28
+ )
17
29
  }
18
30
 
19
31
  function AlertDialogOverlay({
20
- className,
21
- ...props
32
+ className,
33
+ ...props
22
34
  }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
23
- return (
24
- <AlertDialogPrimitive.Overlay
25
- data-slot="alert-dialog-overlay"
26
- className={cn(
27
- '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',
28
- className,
29
- )}
30
- {...props}
31
- />
32
- );
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
+ )
33
45
  }
34
46
 
35
47
  function AlertDialogContent({
36
- className,
37
- ...props
48
+ className,
49
+ ...props
38
50
  }: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
39
- return (
40
- <AlertDialogPortal>
41
- <AlertDialogOverlay />
42
- <AlertDialogPrimitive.Content
43
- data-slot="alert-dialog-content"
44
- className={cn(
45
- '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',
46
- className,
47
- )}
48
- {...props}
49
- />
50
- </AlertDialogPortal>
51
- );
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
+ )
52
64
  }
53
65
 
54
- function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
55
- return (
56
- <div
57
- data-slot="alert-dialog-header"
58
- className={cn('flex flex-col gap-2 text-center sm:text-left', className)}
59
- {...props}
60
- />
61
- );
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
+ )
62
77
  }
63
78
 
64
- function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>) {
65
- return (
66
- <div
67
- data-slot="alert-dialog-footer"
68
- className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)}
69
- {...props}
70
- />
71
- );
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
+ )
72
93
  }
73
94
 
74
- function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
75
- return (
76
- <AlertDialogPrimitive.Title
77
- data-slot="alert-dialog-title"
78
- className={cn('text-lg font-semibold', className)}
79
- {...props}
80
- />
81
- );
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
+ )
82
106
  }
83
107
 
84
108
  function AlertDialogDescription({
85
- className,
86
- ...props
109
+ className,
110
+ ...props
87
111
  }: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
88
- return (
89
- <AlertDialogPrimitive.Description
90
- data-slot="alert-dialog-description"
91
- className={cn('text-muted-foreground text-sm', className)}
92
- {...props}
93
- />
94
- );
112
+ return (
113
+ <AlertDialogPrimitive.Description
114
+ data-slot="alert-dialog-description"
115
+ className={cn("text-muted-foreground text-sm", className)}
116
+ {...props}
117
+ />
118
+ )
95
119
  }
96
120
 
97
121
  function AlertDialogAction({
98
- className,
99
- ...props
122
+ className,
123
+ ...props
100
124
  }: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
101
- return <AlertDialogPrimitive.Action className={cn(buttonVariants(), className)} {...props} />;
125
+ return (
126
+ <AlertDialogPrimitive.Action
127
+ className={cn(buttonVariants(), className)}
128
+ {...props}
129
+ />
130
+ )
102
131
  }
103
132
 
104
133
  function AlertDialogCancel({
105
- className,
106
- ...props
134
+ className,
135
+ ...props
107
136
  }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
108
- return (
109
- <AlertDialogPrimitive.Cancel
110
- className={cn(buttonVariants({ variant: 'outline' }), className)}
111
- {...props}
112
- />
113
- );
137
+ return (
138
+ <AlertDialogPrimitive.Cancel
139
+ className={cn(buttonVariants({ variant: "outline" }), className)}
140
+ {...props}
141
+ />
142
+ )
114
143
  }
115
144
 
116
145
  export {
117
- AlertDialog,
118
- AlertDialogAction,
119
- AlertDialogCancel,
120
- AlertDialogContent,
121
- AlertDialogDescription,
122
- AlertDialogFooter,
123
- AlertDialogHeader,
124
- AlertDialogOverlay,
125
- AlertDialogPortal,
126
- AlertDialogTitle,
127
- AlertDialogTrigger,
128
- };
146
+ AlertDialog,
147
+ AlertDialogPortal,
148
+ AlertDialogOverlay,
149
+ AlertDialogTrigger,
150
+ AlertDialogContent,
151
+ AlertDialogHeader,
152
+ AlertDialogFooter,
153
+ AlertDialogTitle,
154
+ AlertDialogDescription,
155
+ AlertDialogAction,
156
+ AlertDialogCancel,
157
+ }
@@ -1,60 +1,66 @@
1
- import { cva, type VariantProps } from 'class-variance-authority';
2
- import * as React from 'react';
1
+ import * as React from "react"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
3
 
4
- import { cn } from '@/vdb/lib/utils.js';
4
+ import { cn } from "@/vdb/lib/utils"
5
5
 
6
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-background text-foreground',
12
- destructive:
13
- 'border-destructive/50 text-destructive dark:text-destructive-foreground/80 dark:border-destructive [&>svg]:text-current dark:bg-destructive/50',
14
- },
15
- },
16
- defaultVariants: {
17
- variant: 'default',
18
- },
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
+ },
19
15
  },
20
- );
16
+ defaultVariants: {
17
+ variant: "default",
18
+ },
19
+ }
20
+ )
21
21
 
22
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
- );
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
35
  }
36
36
 
37
- function AlertTitle({ className, ...props }: React.ComponentProps<'div'>) {
38
- return (
39
- <div
40
- data-slot="alert-title"
41
- className={cn('col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight', className)}
42
- {...props}
43
- />
44
- );
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
+ )
45
48
  }
46
49
 
47
- function AlertDescription({ className, ...props }: React.ComponentProps<'div'>) {
48
- return (
49
- <div
50
- data-slot="alert-description"
51
- className={cn(
52
- 'col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed',
53
- className,
54
- )}
55
- {...props}
56
- />
57
- );
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
+ )
58
64
  }
59
65
 
60
- export { Alert, AlertDescription, AlertTitle };
66
+ export { Alert, AlertTitle, AlertDescription }
@@ -0,0 +1,9 @@
1
+ import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
2
+
3
+ function AspectRatio({
4
+ ...props
5
+ }: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
6
+ return <AspectRatioPrimitive.Root data-slot="aspect-ratio" {...props} />
7
+ }
8
+
9
+ export { AspectRatio }
@@ -0,0 +1,53 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as AvatarPrimitive from "@radix-ui/react-avatar"
5
+
6
+ import { cn } from "@/vdb/lib/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-8 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 }
@@ -1,38 +1,46 @@
1
- import { Slot } from '@radix-ui/react-slot';
2
- import { cva, type VariantProps } from 'class-variance-authority';
3
- import * as React from 'react';
1
+ import * as React from "react"
2
+ import { Slot } from "@radix-ui/react-slot"
3
+ import { cva, type VariantProps } from "class-variance-authority"
4
4
 
5
- import { cn } from '@/vdb/lib/utils.js';
5
+ import { cn } from "@/vdb/lib/utils"
6
6
 
7
7
  const badgeVariants = cva(
8
- 'inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-auto',
9
- {
10
- variants: {
11
- variant: {
12
- default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
13
- secondary:
14
- 'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
15
- destructive:
16
- 'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40',
17
- outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
18
- success: 'border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90',
19
- },
20
- },
21
- defaultVariants: {
22
- variant: 'default',
23
- },
8
+ "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default:
13
+ "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
14
+ secondary:
15
+ "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
16
+ destructive:
17
+ "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
18
+ outline:
19
+ "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
20
+ },
24
21
  },
25
- );
22
+ defaultVariants: {
23
+ variant: "default",
24
+ },
25
+ }
26
+ )
26
27
 
27
28
  function Badge({
28
- className,
29
- variant,
30
- asChild = false,
31
- ...props
32
- }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
33
- const Comp = asChild ? Slot : 'span';
29
+ className,
30
+ variant,
31
+ asChild = false,
32
+ ...props
33
+ }: React.ComponentProps<"span"> &
34
+ VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
35
+ const Comp = asChild ? Slot : "span"
34
36
 
35
- return <Comp data-slot="badge" className={cn(badgeVariants({ variant }), className)} {...props} />;
37
+ return (
38
+ <Comp
39
+ data-slot="badge"
40
+ className={cn(badgeVariants({ variant }), className)}
41
+ {...props}
42
+ />
43
+ )
36
44
  }
37
45
 
38
- export { Badge, badgeVariants };
46
+ export { Badge, badgeVariants }