@crmy/web 0.5.1

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 (119) hide show
  1. package/index.html +23 -0
  2. package/package.json +76 -0
  3. package/postcss.config.js +6 -0
  4. package/public/android-chrome-192x192.png +0 -0
  5. package/public/android-chrome-512x512.png +0 -0
  6. package/public/apple-touch-icon.png +0 -0
  7. package/public/favicon-16x16.png +0 -0
  8. package/public/favicon-32x32.png +0 -0
  9. package/public/favicon.ico +0 -0
  10. package/public/favicon.svg +13 -0
  11. package/public/site.webmanifest +1 -0
  12. package/src/App.tsx +158 -0
  13. package/src/api/client.ts +82 -0
  14. package/src/api/hooks.ts +689 -0
  15. package/src/assets/crmy-logo.png +0 -0
  16. package/src/components/CustomFields.tsx +240 -0
  17. package/src/components/NavLink.tsx +28 -0
  18. package/src/components/crm/AIFab.tsx +37 -0
  19. package/src/components/crm/AccountDrawer.tsx +372 -0
  20. package/src/components/crm/ActivityTimeline.tsx +115 -0
  21. package/src/components/crm/AssignmentDrawer.tsx +396 -0
  22. package/src/components/crm/BriefingPanel.tsx +217 -0
  23. package/src/components/crm/CommandPalette.tsx +254 -0
  24. package/src/components/crm/ContactAvatar.tsx +49 -0
  25. package/src/components/crm/ContactDrawer.tsx +438 -0
  26. package/src/components/crm/ContextPanel.tsx +200 -0
  27. package/src/components/crm/CrmWidgets.tsx +417 -0
  28. package/src/components/crm/DrawerShell.tsx +77 -0
  29. package/src/components/crm/ListToolbar.tsx +252 -0
  30. package/src/components/crm/OpportunityDrawer.tsx +372 -0
  31. package/src/components/crm/PaginationBar.tsx +111 -0
  32. package/src/components/crm/QuickAddDrawer.tsx +652 -0
  33. package/src/components/crm/ShortcutsOverlay.tsx +65 -0
  34. package/src/components/crm/UseCaseDrawer.tsx +454 -0
  35. package/src/components/layout/MobileNav.tsx +49 -0
  36. package/src/components/layout/Sidebar.tsx +157 -0
  37. package/src/components/layout/TopBar.tsx +54 -0
  38. package/src/components/settings/ActorsSettings.tsx +1190 -0
  39. package/src/components/ui/accordion.tsx +52 -0
  40. package/src/components/ui/alert-dialog.tsx +104 -0
  41. package/src/components/ui/alert.tsx +43 -0
  42. package/src/components/ui/aspect-ratio.tsx +5 -0
  43. package/src/components/ui/avatar.tsx +38 -0
  44. package/src/components/ui/badge.tsx +29 -0
  45. package/src/components/ui/breadcrumb.tsx +90 -0
  46. package/src/components/ui/button.tsx +47 -0
  47. package/src/components/ui/calendar.tsx +54 -0
  48. package/src/components/ui/card.tsx +43 -0
  49. package/src/components/ui/carousel.tsx +224 -0
  50. package/src/components/ui/chart.tsx +303 -0
  51. package/src/components/ui/checkbox.tsx +26 -0
  52. package/src/components/ui/collapsible.tsx +9 -0
  53. package/src/components/ui/command.tsx +132 -0
  54. package/src/components/ui/context-menu.tsx +178 -0
  55. package/src/components/ui/date-picker.tsx +313 -0
  56. package/src/components/ui/dialog.tsx +95 -0
  57. package/src/components/ui/drawer.tsx +87 -0
  58. package/src/components/ui/dropdown-menu.tsx +179 -0
  59. package/src/components/ui/form.tsx +129 -0
  60. package/src/components/ui/hover-card.tsx +27 -0
  61. package/src/components/ui/input-otp.tsx +61 -0
  62. package/src/components/ui/input.tsx +22 -0
  63. package/src/components/ui/label.tsx +17 -0
  64. package/src/components/ui/menubar.tsx +207 -0
  65. package/src/components/ui/navigation-menu.tsx +120 -0
  66. package/src/components/ui/pagination.tsx +81 -0
  67. package/src/components/ui/popover.tsx +29 -0
  68. package/src/components/ui/progress.tsx +23 -0
  69. package/src/components/ui/radio-group.tsx +36 -0
  70. package/src/components/ui/resizable.tsx +37 -0
  71. package/src/components/ui/scroll-area.tsx +38 -0
  72. package/src/components/ui/select.tsx +143 -0
  73. package/src/components/ui/separator.tsx +20 -0
  74. package/src/components/ui/sheet.tsx +107 -0
  75. package/src/components/ui/sidebar.tsx +637 -0
  76. package/src/components/ui/skeleton.tsx +7 -0
  77. package/src/components/ui/slider.tsx +23 -0
  78. package/src/components/ui/sonner.tsx +24 -0
  79. package/src/components/ui/switch.tsx +27 -0
  80. package/src/components/ui/table.tsx +72 -0
  81. package/src/components/ui/tabs.tsx +53 -0
  82. package/src/components/ui/textarea.tsx +21 -0
  83. package/src/components/ui/toast.tsx +111 -0
  84. package/src/components/ui/toaster.tsx +24 -0
  85. package/src/components/ui/toggle-group.tsx +49 -0
  86. package/src/components/ui/toggle.tsx +37 -0
  87. package/src/components/ui/tooltip.tsx +28 -0
  88. package/src/components/ui/use-toast.ts +1 -0
  89. package/src/components/ui/utils.ts +9 -0
  90. package/src/contexts/AgentSettingsContext.tsx +24 -0
  91. package/src/hooks/use-mobile.tsx +19 -0
  92. package/src/hooks/use-toast.ts +186 -0
  93. package/src/hooks/useKeyboardShortcuts.ts +95 -0
  94. package/src/hooks/useTheme.ts +24 -0
  95. package/src/index.css +245 -0
  96. package/src/lib/entityColors.ts +18 -0
  97. package/src/lib/stageConfig.ts +32 -0
  98. package/src/lib/utils.ts +6 -0
  99. package/src/main.tsx +25 -0
  100. package/src/pages/Accounts.tsx +205 -0
  101. package/src/pages/Activities.tsx +251 -0
  102. package/src/pages/Agent.tsx +237 -0
  103. package/src/pages/AgentSettings.tsx +544 -0
  104. package/src/pages/Assignments.tsx +750 -0
  105. package/src/pages/Contacts.tsx +200 -0
  106. package/src/pages/Dashboard.tsx +143 -0
  107. package/src/pages/Inbox.tsx +615 -0
  108. package/src/pages/NotFound.tsx +24 -0
  109. package/src/pages/Opportunities.tsx +386 -0
  110. package/src/pages/SearchResults.tsx +49 -0
  111. package/src/pages/Settings.tsx +1884 -0
  112. package/src/pages/UseCases.tsx +396 -0
  113. package/src/pages/auth/Login.tsx +261 -0
  114. package/src/pages/hitl/HITL.tsx +101 -0
  115. package/src/store/appStore.ts +103 -0
  116. package/src/vite-env.d.ts +14 -0
  117. package/tailwind.config.js +121 -0
  118. package/tsconfig.json +24 -0
  119. package/vite.config.ts +27 -0
@@ -0,0 +1,120 @@
1
+ import * as React from "react";
2
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
3
+ import { cva } from "class-variance-authority";
4
+ import { ChevronDown } from "lucide-react";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ const NavigationMenu = React.forwardRef<
9
+ React.ElementRef<typeof NavigationMenuPrimitive.Root>,
10
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
11
+ >(({ className, children, ...props }, ref) => (
12
+ <NavigationMenuPrimitive.Root
13
+ ref={ref}
14
+ className={cn("relative z-10 flex max-w-max flex-1 items-center justify-center", className)}
15
+ {...props}
16
+ >
17
+ {children}
18
+ <NavigationMenuViewport />
19
+ </NavigationMenuPrimitive.Root>
20
+ ));
21
+ NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
22
+
23
+ const NavigationMenuList = React.forwardRef<
24
+ React.ElementRef<typeof NavigationMenuPrimitive.List>,
25
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
26
+ >(({ className, ...props }, ref) => (
27
+ <NavigationMenuPrimitive.List
28
+ ref={ref}
29
+ className={cn("group flex flex-1 list-none items-center justify-center space-x-1", className)}
30
+ {...props}
31
+ />
32
+ ));
33
+ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
34
+
35
+ const NavigationMenuItem = NavigationMenuPrimitive.Item;
36
+
37
+ const navigationMenuTriggerStyle = cva(
38
+ "group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50",
39
+ );
40
+
41
+ const NavigationMenuTrigger = React.forwardRef<
42
+ React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
43
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
44
+ >(({ className, children, ...props }, ref) => (
45
+ <NavigationMenuPrimitive.Trigger
46
+ ref={ref}
47
+ className={cn(navigationMenuTriggerStyle(), "group", className)}
48
+ {...props}
49
+ >
50
+ {children}{" "}
51
+ <ChevronDown
52
+ className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
53
+ aria-hidden="true"
54
+ />
55
+ </NavigationMenuPrimitive.Trigger>
56
+ ));
57
+ NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
58
+
59
+ const NavigationMenuContent = React.forwardRef<
60
+ React.ElementRef<typeof NavigationMenuPrimitive.Content>,
61
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
62
+ >(({ className, ...props }, ref) => (
63
+ <NavigationMenuPrimitive.Content
64
+ ref={ref}
65
+ className={cn(
66
+ "left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",
67
+ className,
68
+ )}
69
+ {...props}
70
+ />
71
+ ));
72
+ NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
73
+
74
+ const NavigationMenuLink = NavigationMenuPrimitive.Link;
75
+
76
+ const NavigationMenuViewport = React.forwardRef<
77
+ React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
78
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
79
+ >(({ className, ...props }, ref) => (
80
+ <div className={cn("absolute left-0 top-full flex justify-center")}>
81
+ <NavigationMenuPrimitive.Viewport
82
+ className={cn(
83
+ "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
84
+ className,
85
+ )}
86
+ ref={ref}
87
+ {...props}
88
+ />
89
+ </div>
90
+ ));
91
+ NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
92
+
93
+ const NavigationMenuIndicator = React.forwardRef<
94
+ React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
95
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
96
+ >(({ className, ...props }, ref) => (
97
+ <NavigationMenuPrimitive.Indicator
98
+ ref={ref}
99
+ className={cn(
100
+ "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
101
+ className,
102
+ )}
103
+ {...props}
104
+ >
105
+ <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
106
+ </NavigationMenuPrimitive.Indicator>
107
+ ));
108
+ NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
109
+
110
+ export {
111
+ navigationMenuTriggerStyle,
112
+ NavigationMenu,
113
+ NavigationMenuList,
114
+ NavigationMenuItem,
115
+ NavigationMenuContent,
116
+ NavigationMenuTrigger,
117
+ NavigationMenuLink,
118
+ NavigationMenuIndicator,
119
+ NavigationMenuViewport,
120
+ };
@@ -0,0 +1,81 @@
1
+ import * as React from "react";
2
+ import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
3
+
4
+ import { cn } from "@/lib/utils";
5
+ import { ButtonProps, buttonVariants } from "@/components/ui/button";
6
+
7
+ const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
8
+ <nav
9
+ role="navigation"
10
+ aria-label="pagination"
11
+ className={cn("mx-auto flex w-full justify-center", className)}
12
+ {...props}
13
+ />
14
+ );
15
+ Pagination.displayName = "Pagination";
16
+
17
+ const PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentProps<"ul">>(
18
+ ({ className, ...props }, ref) => (
19
+ <ul ref={ref} className={cn("flex flex-row items-center gap-1", className)} {...props} />
20
+ ),
21
+ );
22
+ PaginationContent.displayName = "PaginationContent";
23
+
24
+ const PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentProps<"li">>(({ className, ...props }, ref) => (
25
+ <li ref={ref} className={cn("", className)} {...props} />
26
+ ));
27
+ PaginationItem.displayName = "PaginationItem";
28
+
29
+ type PaginationLinkProps = {
30
+ isActive?: boolean;
31
+ } & Pick<ButtonProps, "size"> &
32
+ React.ComponentProps<"a">;
33
+
34
+ const PaginationLink = ({ className, isActive, size = "icon", ...props }: PaginationLinkProps) => (
35
+ <a
36
+ aria-current={isActive ? "page" : undefined}
37
+ className={cn(
38
+ buttonVariants({
39
+ variant: isActive ? "outline" : "ghost",
40
+ size,
41
+ }),
42
+ className,
43
+ )}
44
+ {...props}
45
+ />
46
+ );
47
+ PaginationLink.displayName = "PaginationLink";
48
+
49
+ const PaginationPrevious = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (
50
+ <PaginationLink aria-label="Go to previous page" size="default" className={cn("gap-1 pl-2.5", className)} {...props}>
51
+ <ChevronLeft className="h-4 w-4" />
52
+ <span>Previous</span>
53
+ </PaginationLink>
54
+ );
55
+ PaginationPrevious.displayName = "PaginationPrevious";
56
+
57
+ const PaginationNext = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (
58
+ <PaginationLink aria-label="Go to next page" size="default" className={cn("gap-1 pr-2.5", className)} {...props}>
59
+ <span>Next</span>
60
+ <ChevronRight className="h-4 w-4" />
61
+ </PaginationLink>
62
+ );
63
+ PaginationNext.displayName = "PaginationNext";
64
+
65
+ const PaginationEllipsis = ({ className, ...props }: React.ComponentProps<"span">) => (
66
+ <span aria-hidden className={cn("flex h-9 w-9 items-center justify-center", className)} {...props}>
67
+ <MoreHorizontal className="h-4 w-4" />
68
+ <span className="sr-only">More pages</span>
69
+ </span>
70
+ );
71
+ PaginationEllipsis.displayName = "PaginationEllipsis";
72
+
73
+ export {
74
+ Pagination,
75
+ PaginationContent,
76
+ PaginationEllipsis,
77
+ PaginationItem,
78
+ PaginationLink,
79
+ PaginationNext,
80
+ PaginationPrevious,
81
+ };
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const Popover = PopoverPrimitive.Root;
7
+
8
+ const PopoverTrigger = PopoverPrimitive.Trigger;
9
+
10
+ const PopoverContent = React.forwardRef<
11
+ React.ElementRef<typeof PopoverPrimitive.Content>,
12
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
13
+ >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
14
+ <PopoverPrimitive.Portal>
15
+ <PopoverPrimitive.Content
16
+ ref={ref}
17
+ align={align}
18
+ sideOffset={sideOffset}
19
+ className={cn(
20
+ "z-[200] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
21
+ className,
22
+ )}
23
+ {...props}
24
+ />
25
+ </PopoverPrimitive.Portal>
26
+ ));
27
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
28
+
29
+ export { Popover, PopoverTrigger, PopoverContent };
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ import * as ProgressPrimitive from "@radix-ui/react-progress";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const Progress = React.forwardRef<
7
+ React.ElementRef<typeof ProgressPrimitive.Root>,
8
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
9
+ >(({ className, value, ...props }, ref) => (
10
+ <ProgressPrimitive.Root
11
+ ref={ref}
12
+ className={cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className)}
13
+ {...props}
14
+ >
15
+ <ProgressPrimitive.Indicator
16
+ className="h-full w-full flex-1 bg-primary transition-all"
17
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
18
+ />
19
+ </ProgressPrimitive.Root>
20
+ ));
21
+ Progress.displayName = ProgressPrimitive.Root.displayName;
22
+
23
+ export { Progress };
@@ -0,0 +1,36 @@
1
+ import * as React from "react";
2
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
3
+ import { Circle } from "lucide-react";
4
+
5
+ import { cn } from "@/lib/utils";
6
+
7
+ const RadioGroup = React.forwardRef<
8
+ React.ElementRef<typeof RadioGroupPrimitive.Root>,
9
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
10
+ >(({ className, ...props }, ref) => {
11
+ return <RadioGroupPrimitive.Root className={cn("grid gap-2", className)} {...props} ref={ref} />;
12
+ });
13
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
14
+
15
+ const RadioGroupItem = React.forwardRef<
16
+ React.ElementRef<typeof RadioGroupPrimitive.Item>,
17
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
18
+ >(({ className, ...props }, ref) => {
19
+ return (
20
+ <RadioGroupPrimitive.Item
21
+ ref={ref}
22
+ className={cn(
23
+ "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
24
+ className,
25
+ )}
26
+ {...props}
27
+ >
28
+ <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
29
+ <Circle className="h-2.5 w-2.5 fill-current text-current" />
30
+ </RadioGroupPrimitive.Indicator>
31
+ </RadioGroupPrimitive.Item>
32
+ );
33
+ });
34
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
35
+
36
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,37 @@
1
+ import { GripVertical } from "lucide-react";
2
+ import * as ResizablePrimitive from "react-resizable-panels";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const ResizablePanelGroup = ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
7
+ <ResizablePrimitive.PanelGroup
8
+ className={cn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", className)}
9
+ {...props}
10
+ />
11
+ );
12
+
13
+ const ResizablePanel = ResizablePrimitive.Panel;
14
+
15
+ const ResizableHandle = ({
16
+ withHandle,
17
+ className,
18
+ ...props
19
+ }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
20
+ withHandle?: boolean;
21
+ }) => (
22
+ <ResizablePrimitive.PanelResizeHandle
23
+ className={cn(
24
+ "relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 [&[data-panel-group-direction=vertical]>div]:rotate-90",
25
+ className,
26
+ )}
27
+ {...props}
28
+ >
29
+ {withHandle && (
30
+ <div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">
31
+ <GripVertical className="h-2.5 w-2.5" />
32
+ </div>
33
+ )}
34
+ </ResizablePrimitive.PanelResizeHandle>
35
+ );
36
+
37
+ export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const ScrollArea = React.forwardRef<
7
+ React.ElementRef<typeof ScrollAreaPrimitive.Root>,
8
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
9
+ >(({ className, children, ...props }, ref) => (
10
+ <ScrollAreaPrimitive.Root ref={ref} className={cn("relative overflow-hidden", className)} {...props}>
11
+ <ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">{children}</ScrollAreaPrimitive.Viewport>
12
+ <ScrollBar />
13
+ <ScrollAreaPrimitive.Corner />
14
+ </ScrollAreaPrimitive.Root>
15
+ ));
16
+ ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
17
+
18
+ const ScrollBar = React.forwardRef<
19
+ React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
20
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
21
+ >(({ className, orientation = "vertical", ...props }, ref) => (
22
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
23
+ ref={ref}
24
+ orientation={orientation}
25
+ className={cn(
26
+ "flex touch-none select-none transition-colors",
27
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
28
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
29
+ className,
30
+ )}
31
+ {...props}
32
+ >
33
+ <ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
34
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
35
+ ));
36
+ ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
37
+
38
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,143 @@
1
+ import * as React from "react";
2
+ import * as SelectPrimitive from "@radix-ui/react-select";
3
+ import { Check, ChevronDown, ChevronUp } from "lucide-react";
4
+
5
+ import { cn } from "@/lib/utils";
6
+
7
+ const Select = SelectPrimitive.Root;
8
+
9
+ const SelectGroup = SelectPrimitive.Group;
10
+
11
+ const SelectValue = SelectPrimitive.Value;
12
+
13
+ const SelectTrigger = React.forwardRef<
14
+ React.ElementRef<typeof SelectPrimitive.Trigger>,
15
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
16
+ >(({ className, children, ...props }, ref) => (
17
+ <SelectPrimitive.Trigger
18
+ ref={ref}
19
+ className={cn(
20
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
21
+ className,
22
+ )}
23
+ {...props}
24
+ >
25
+ {children}
26
+ <SelectPrimitive.Icon asChild>
27
+ <ChevronDown className="h-4 w-4 opacity-50" />
28
+ </SelectPrimitive.Icon>
29
+ </SelectPrimitive.Trigger>
30
+ ));
31
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
32
+
33
+ const SelectScrollUpButton = React.forwardRef<
34
+ React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
35
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
36
+ >(({ className, ...props }, ref) => (
37
+ <SelectPrimitive.ScrollUpButton
38
+ ref={ref}
39
+ className={cn("flex cursor-default items-center justify-center py-1", className)}
40
+ {...props}
41
+ >
42
+ <ChevronUp className="h-4 w-4" />
43
+ </SelectPrimitive.ScrollUpButton>
44
+ ));
45
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
46
+
47
+ const SelectScrollDownButton = React.forwardRef<
48
+ React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
49
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
50
+ >(({ className, ...props }, ref) => (
51
+ <SelectPrimitive.ScrollDownButton
52
+ ref={ref}
53
+ className={cn("flex cursor-default items-center justify-center py-1", className)}
54
+ {...props}
55
+ >
56
+ <ChevronDown className="h-4 w-4" />
57
+ </SelectPrimitive.ScrollDownButton>
58
+ ));
59
+ SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
60
+
61
+ const SelectContent = React.forwardRef<
62
+ React.ElementRef<typeof SelectPrimitive.Content>,
63
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
64
+ >(({ className, children, position = "popper", ...props }, ref) => (
65
+ <SelectPrimitive.Portal>
66
+ <SelectPrimitive.Content
67
+ ref={ref}
68
+ className={cn(
69
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover 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",
70
+ position === "popper" &&
71
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
72
+ className,
73
+ )}
74
+ position={position}
75
+ {...props}
76
+ >
77
+ <SelectScrollUpButton />
78
+ <SelectPrimitive.Viewport
79
+ className={cn(
80
+ "p-1",
81
+ position === "popper" &&
82
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
83
+ )}
84
+ >
85
+ {children}
86
+ </SelectPrimitive.Viewport>
87
+ <SelectScrollDownButton />
88
+ </SelectPrimitive.Content>
89
+ </SelectPrimitive.Portal>
90
+ ));
91
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
92
+
93
+ const SelectLabel = React.forwardRef<
94
+ React.ElementRef<typeof SelectPrimitive.Label>,
95
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
96
+ >(({ className, ...props }, ref) => (
97
+ <SelectPrimitive.Label ref={ref} className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)} {...props} />
98
+ ));
99
+ SelectLabel.displayName = SelectPrimitive.Label.displayName;
100
+
101
+ const SelectItem = React.forwardRef<
102
+ React.ElementRef<typeof SelectPrimitive.Item>,
103
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
104
+ >(({ className, children, ...props }, ref) => (
105
+ <SelectPrimitive.Item
106
+ ref={ref}
107
+ className={cn(
108
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",
109
+ className,
110
+ )}
111
+ {...props}
112
+ >
113
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
114
+ <SelectPrimitive.ItemIndicator>
115
+ <Check className="h-4 w-4" />
116
+ </SelectPrimitive.ItemIndicator>
117
+ </span>
118
+
119
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
120
+ </SelectPrimitive.Item>
121
+ ));
122
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
123
+
124
+ const SelectSeparator = React.forwardRef<
125
+ React.ElementRef<typeof SelectPrimitive.Separator>,
126
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
127
+ >(({ className, ...props }, ref) => (
128
+ <SelectPrimitive.Separator ref={ref} className={cn("-mx-1 my-1 h-px bg-muted", className)} {...props} />
129
+ ));
130
+ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
131
+
132
+ export {
133
+ Select,
134
+ SelectGroup,
135
+ SelectValue,
136
+ SelectTrigger,
137
+ SelectContent,
138
+ SelectLabel,
139
+ SelectItem,
140
+ SelectSeparator,
141
+ SelectScrollUpButton,
142
+ SelectScrollDownButton,
143
+ };
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const Separator = React.forwardRef<
7
+ React.ElementRef<typeof SeparatorPrimitive.Root>,
8
+ React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
9
+ >(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => (
10
+ <SeparatorPrimitive.Root
11
+ ref={ref}
12
+ decorative={decorative}
13
+ orientation={orientation}
14
+ className={cn("shrink-0 bg-border", orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", className)}
15
+ {...props}
16
+ />
17
+ ));
18
+ Separator.displayName = SeparatorPrimitive.Root.displayName;
19
+
20
+ export { Separator };
@@ -0,0 +1,107 @@
1
+ import * as SheetPrimitive from "@radix-ui/react-dialog";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+ import { X } from "lucide-react";
4
+ import * as React from "react";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ const Sheet = SheetPrimitive.Root;
9
+
10
+ const SheetTrigger = SheetPrimitive.Trigger;
11
+
12
+ const SheetClose = SheetPrimitive.Close;
13
+
14
+ const SheetPortal = SheetPrimitive.Portal;
15
+
16
+ const SheetOverlay = React.forwardRef<
17
+ React.ElementRef<typeof SheetPrimitive.Overlay>,
18
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
19
+ >(({ className, ...props }, ref) => (
20
+ <SheetPrimitive.Overlay
21
+ className={cn(
22
+ "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",
23
+ className,
24
+ )}
25
+ {...props}
26
+ ref={ref}
27
+ />
28
+ ));
29
+ SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
30
+
31
+ const sheetVariants = cva(
32
+ "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
33
+ {
34
+ variants: {
35
+ side: {
36
+ top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
37
+ bottom:
38
+ "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
39
+ left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
40
+ right:
41
+ "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
42
+ },
43
+ },
44
+ defaultVariants: {
45
+ side: "right",
46
+ },
47
+ },
48
+ );
49
+
50
+ interface SheetContentProps
51
+ extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
52
+ VariantProps<typeof sheetVariants> {}
53
+
54
+ const SheetContent = React.forwardRef<React.ElementRef<typeof SheetPrimitive.Content>, SheetContentProps>(
55
+ ({ side = "right", className, children, ...props }, ref) => (
56
+ <SheetPortal>
57
+ <SheetOverlay />
58
+ <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>
59
+ {children}
60
+ <SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none">
61
+ <X className="h-4 w-4" />
62
+ <span className="sr-only">Close</span>
63
+ </SheetPrimitive.Close>
64
+ </SheetPrimitive.Content>
65
+ </SheetPortal>
66
+ ),
67
+ );
68
+ SheetContent.displayName = SheetPrimitive.Content.displayName;
69
+
70
+ const SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
71
+ <div className={cn("flex flex-col space-y-2 text-center sm:text-left", className)} {...props} />
72
+ );
73
+ SheetHeader.displayName = "SheetHeader";
74
+
75
+ const SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
76
+ <div className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)} {...props} />
77
+ );
78
+ SheetFooter.displayName = "SheetFooter";
79
+
80
+ const SheetTitle = React.forwardRef<
81
+ React.ElementRef<typeof SheetPrimitive.Title>,
82
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
83
+ >(({ className, ...props }, ref) => (
84
+ <SheetPrimitive.Title ref={ref} className={cn("text-lg font-semibold text-foreground", className)} {...props} />
85
+ ));
86
+ SheetTitle.displayName = SheetPrimitive.Title.displayName;
87
+
88
+ const SheetDescription = React.forwardRef<
89
+ React.ElementRef<typeof SheetPrimitive.Description>,
90
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
91
+ >(({ className, ...props }, ref) => (
92
+ <SheetPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />
93
+ ));
94
+ SheetDescription.displayName = SheetPrimitive.Description.displayName;
95
+
96
+ export {
97
+ Sheet,
98
+ SheetClose,
99
+ SheetContent,
100
+ SheetDescription,
101
+ SheetFooter,
102
+ SheetHeader,
103
+ SheetOverlay,
104
+ SheetPortal,
105
+ SheetTitle,
106
+ SheetTrigger,
107
+ };