@trackany-device/components 1.0.0

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 (289) hide show
  1. package/package.json +185 -0
  2. package/src/assets/logo.png +0 -0
  3. package/src/assets/map/arrows/map-arrow-blue.png +0 -0
  4. package/src/assets/map/arrows/map-arrow-green.png +0 -0
  5. package/src/assets/map/arrows/map-arrow-purple.png +0 -0
  6. package/src/assets/map/arrows/map-arrow-red.png +0 -0
  7. package/src/assets/map/flags/flag-blue.png +0 -0
  8. package/src/assets/map/flags/flag-green.png +0 -0
  9. package/src/assets/map/flags/flag-red.png +0 -0
  10. package/src/assets/map/flags/flag-yellow.png +0 -0
  11. package/src/assets/map/pins/map-pin-blue.png +0 -0
  12. package/src/assets/map/pins/map-pin-green.png +0 -0
  13. package/src/assets/map/pins/map-pin-purple.png +0 -0
  14. package/src/assets/map/pins/map-pin-red.png +0 -0
  15. package/src/components/Card.tsx +9 -0
  16. package/src/components/alert-error.tsx +24 -0
  17. package/src/components/app-content.tsx +22 -0
  18. package/src/components/app-header.tsx +153 -0
  19. package/src/components/app-logo-icon.tsx +13 -0
  20. package/src/components/app-logo.tsx +21 -0
  21. package/src/components/app-shell.tsx +19 -0
  22. package/src/components/app-sidebar-header.tsx +68 -0
  23. package/src/components/app-sidebar.tsx +106 -0
  24. package/src/components/appearance-tabs.tsx +46 -0
  25. package/src/components/breadcrumbs.tsx +50 -0
  26. package/src/components/cms/blurred-image.tsx +111 -0
  27. package/src/components/cms/section-bg.tsx +473 -0
  28. package/src/components/cms/section-button.tsx +127 -0
  29. package/src/components/cms/sections/banner-5050-section.tsx +135 -0
  30. package/src/components/cms/sections/blogs-listing-section.tsx +270 -0
  31. package/src/components/cms/sections/cards-grid-section.tsx +185 -0
  32. package/src/components/cms/sections/contact-form-section.tsx +157 -0
  33. package/src/components/cms/sections/cta-section.tsx +101 -0
  34. package/src/components/cms/sections/featured-blog-slider-section.tsx +256 -0
  35. package/src/components/cms/sections/featured-products-grid-section.tsx +173 -0
  36. package/src/components/cms/sections/featured-solutions-grid-section.tsx +183 -0
  37. package/src/components/cms/sections/hero-section.tsx +180 -0
  38. package/src/components/cms/sections/solutions-with-filter-section.tsx +234 -0
  39. package/src/components/cms/sections/text-section.tsx +77 -0
  40. package/src/components/cutout-image.tsx +228 -0
  41. package/src/components/devices/devices-mini-map.tsx +275 -0
  42. package/src/components/docs/docs-shell.tsx +280 -0
  43. package/src/components/fleet-hero-animated.tsx +383 -0
  44. package/src/components/input-error.tsx +17 -0
  45. package/src/components/keenicons/assets/duotone/Read Me.txt +7 -0
  46. package/src/components/keenicons/assets/duotone/demo-files/demo.css +160 -0
  47. package/src/components/keenicons/assets/duotone/demo-files/demo.js +32 -0
  48. package/src/components/keenicons/assets/duotone/demo.html +12424 -0
  49. package/src/components/keenicons/assets/duotone/fonts/keenicons-duotone.svg +1109 -0
  50. package/src/components/keenicons/assets/duotone/fonts/keenicons-duotone.ttf +0 -0
  51. package/src/components/keenicons/assets/duotone/fonts/keenicons-duotone.woff +0 -0
  52. package/src/components/keenicons/assets/duotone/selection.json +17313 -0
  53. package/src/components/keenicons/assets/duotone/style.css +4931 -0
  54. package/src/components/keenicons/assets/filled/Read Me.txt +7 -0
  55. package/src/components/keenicons/assets/filled/demo-files/demo.css +160 -0
  56. package/src/components/keenicons/assets/filled/demo-files/demo.js +32 -0
  57. package/src/components/keenicons/assets/filled/demo.html +12370 -0
  58. package/src/components/keenicons/assets/filled/fonts/keenicons-filled.svg +1082 -0
  59. package/src/components/keenicons/assets/filled/fonts/keenicons-filled.ttf +0 -0
  60. package/src/components/keenicons/assets/filled/fonts/keenicons-filled.woff +0 -0
  61. package/src/components/keenicons/assets/filled/selection.json +17096 -0
  62. package/src/components/keenicons/assets/filled/style.css +4769 -0
  63. package/src/components/keenicons/assets/outline/Read Me.txt +7 -0
  64. package/src/components/keenicons/assets/outline/demo-files/demo.css +160 -0
  65. package/src/components/keenicons/assets/outline/demo-files/demo.js +32 -0
  66. package/src/components/keenicons/assets/outline/demo.html +11356 -0
  67. package/src/components/keenicons/assets/outline/fonts/keenicons-outline.svg +575 -0
  68. package/src/components/keenicons/assets/outline/fonts/keenicons-outline.ttf +0 -0
  69. package/src/components/keenicons/assets/outline/fonts/keenicons-outline.woff +0 -0
  70. package/src/components/keenicons/assets/outline/selection.json +13054 -0
  71. package/src/components/keenicons/assets/outline/style.css +1721 -0
  72. package/src/components/keenicons/assets/solid/Read Me.txt +7 -0
  73. package/src/components/keenicons/assets/solid/demo-files/demo.css +160 -0
  74. package/src/components/keenicons/assets/solid/demo-files/demo.js +32 -0
  75. package/src/components/keenicons/assets/solid/demo.html +11356 -0
  76. package/src/components/keenicons/assets/solid/fonts/keenicons-solid.svg +575 -0
  77. package/src/components/keenicons/assets/solid/fonts/keenicons-solid.ttf +0 -0
  78. package/src/components/keenicons/assets/solid/fonts/keenicons-solid.woff +0 -0
  79. package/src/components/keenicons/assets/solid/selection.json +13048 -0
  80. package/src/components/keenicons/assets/solid/style.css +1721 -0
  81. package/src/components/keenicons/assets/styles.css +4 -0
  82. package/src/components/keenicons/index.ts +2 -0
  83. package/src/components/keenicons/keenicons.tsx +16 -0
  84. package/src/components/keenicons/types.ts +7 -0
  85. package/src/components/nav-footer.tsx +49 -0
  86. package/src/components/nav-main.tsx +53 -0
  87. package/src/components/nav-user.tsx +59 -0
  88. package/src/components/notification-bell.tsx +190 -0
  89. package/src/components/products/product-card.tsx +159 -0
  90. package/src/components/text-link.tsx +23 -0
  91. package/src/components/ui/accordion-menu.tsx +322 -0
  92. package/src/components/ui/accordion.tsx +133 -0
  93. package/src/components/ui/alert-dialog.tsx +82 -0
  94. package/src/components/ui/alert.tsx +63 -0
  95. package/src/components/ui/avatar-group.tsx +129 -0
  96. package/src/components/ui/avatar.tsx +67 -0
  97. package/src/components/ui/badge.tsx +230 -0
  98. package/src/components/ui/breadcrumb.tsx +88 -0
  99. package/src/components/ui/button.tsx +412 -0
  100. package/src/components/ui/calendar.tsx +56 -0
  101. package/src/components/ui/card.tsx +147 -0
  102. package/src/components/ui/chart.tsx +290 -0
  103. package/src/components/ui/checkbox.tsx +47 -0
  104. package/src/components/ui/code.tsx +45 -0
  105. package/src/components/ui/collapsible.tsx +31 -0
  106. package/src/components/ui/command-palette.tsx +189 -0
  107. package/src/components/ui/command.tsx +138 -0
  108. package/src/components/ui/cookie-banner.tsx +220 -0
  109. package/src/components/ui/copy-button.tsx +60 -0
  110. package/src/components/ui/data-grid-column-filter.tsx +124 -0
  111. package/src/components/ui/data-grid-column-header.tsx +284 -0
  112. package/src/components/ui/data-grid-column-visibility.tsx +38 -0
  113. package/src/components/ui/data-grid-pagination.tsx +206 -0
  114. package/src/components/ui/data-grid-table-dnd-rows.tsx +147 -0
  115. package/src/components/ui/data-grid-table-dnd.tsx +175 -0
  116. package/src/components/ui/data-grid-table.tsx +500 -0
  117. package/src/components/ui/data-grid.tsx +193 -0
  118. package/src/components/ui/data-list.tsx +76 -0
  119. package/src/components/ui/datefield.tsx +91 -0
  120. package/src/components/ui/dialog.tsx +139 -0
  121. package/src/components/ui/divider.tsx +41 -0
  122. package/src/components/ui/drawer.tsx +59 -0
  123. package/src/components/ui/dropdown-menu.tsx +224 -0
  124. package/src/components/ui/empty-state.tsx +54 -0
  125. package/src/components/ui/file-upload.tsx +152 -0
  126. package/src/components/ui/form.tsx +88 -0
  127. package/src/components/ui/icon.tsx +14 -0
  128. package/src/components/ui/input-otp.tsx +71 -0
  129. package/src/components/ui/input.tsx +155 -0
  130. package/src/components/ui/kbd.tsx +26 -0
  131. package/src/components/ui/label.tsx +31 -0
  132. package/src/components/ui/navigation-menu.tsx +168 -0
  133. package/src/components/ui/pagination.tsx +37 -0
  134. package/src/components/ui/placeholder-pattern.tsx +21 -0
  135. package/src/components/ui/popover.tsx +50 -0
  136. package/src/components/ui/progress.tsx +65 -0
  137. package/src/components/ui/radio-group.tsx +73 -0
  138. package/src/components/ui/resizable.tsx +39 -0
  139. package/src/components/ui/scroll-area.tsx +50 -0
  140. package/src/components/ui/select.tsx +234 -0
  141. package/src/components/ui/separator.tsx +24 -0
  142. package/src/components/ui/sheet.tsx +147 -0
  143. package/src/components/ui/sidebar.tsx +721 -0
  144. package/src/components/ui/skeleton.tsx +15 -0
  145. package/src/components/ui/slider.tsx +35 -0
  146. package/src/components/ui/sonner.tsx +28 -0
  147. package/src/components/ui/sortable.tsx +724 -0
  148. package/src/components/ui/spinner.tsx +17 -0
  149. package/src/components/ui/stat-card.tsx +82 -0
  150. package/src/components/ui/stepper.tsx +410 -0
  151. package/src/components/ui/switch.tsx +68 -0
  152. package/src/components/ui/table.tsx +42 -0
  153. package/src/components/ui/tabs.tsx +196 -0
  154. package/src/components/ui/timeline.tsx +90 -0
  155. package/src/components/ui/toggle-group.tsx +73 -0
  156. package/src/components/ui/toggle.tsx +45 -0
  157. package/src/components/ui/tooltip.tsx +55 -0
  158. package/src/components/user-info.tsx +33 -0
  159. package/src/components/user-menu-content.tsx +53 -0
  160. package/src/components/web/SiteFooter.tsx +154 -0
  161. package/src/components/web/SiteHeader.tsx +159 -0
  162. package/src/components/workflows/workflow-canvas.tsx +321 -0
  163. package/src/controls/Blockquote.tsx +25 -0
  164. package/src/controls/Button.tsx +101 -0
  165. package/src/controls/Checkbox.tsx +29 -0
  166. package/src/controls/DateField.tsx +37 -0
  167. package/src/controls/FormField.tsx +20 -0
  168. package/src/controls/Heading.tsx +28 -0
  169. package/src/controls/Input.tsx +21 -0
  170. package/src/controls/Label.tsx +18 -0
  171. package/src/controls/Paragraph.tsx +39 -0
  172. package/src/controls/PasswordInput.tsx +40 -0
  173. package/src/controls/RadioGroup.tsx +70 -0
  174. package/src/controls/Select.tsx +24 -0
  175. package/src/controls/Slider.tsx +33 -0
  176. package/src/controls/Switch.tsx +31 -0
  177. package/src/controls/Textarea.tsx +22 -0
  178. package/src/elements/ConfirmPasswordForm.tsx +43 -0
  179. package/src/elements/DeviceStatusBadge.tsx +38 -0
  180. package/src/elements/DriverCard.tsx +67 -0
  181. package/src/elements/ForgotPasswordForm.tsx +64 -0
  182. package/src/elements/IncidentCard.tsx +67 -0
  183. package/src/elements/LoginForm.tsx +100 -0
  184. package/src/elements/OtpForm.tsx +71 -0
  185. package/src/elements/RegisterForm.tsx +150 -0
  186. package/src/elements/ResetPasswordForm.tsx +72 -0
  187. package/src/elements/SmsChallengeForm.tsx +104 -0
  188. package/src/elements/VehicleCard.tsx +73 -0
  189. package/src/elements/VerifyEmailForm.tsx +39 -0
  190. package/src/hooks/use-appearance.tsx +117 -0
  191. package/src/hooks/use-applied-theme.ts +98 -0
  192. package/src/hooks/use-clipboard.ts +34 -0
  193. package/src/hooks/use-current-url.ts +83 -0
  194. package/src/hooks/use-dark-mode.ts +48 -0
  195. package/src/hooks/use-flash-toast.ts +29 -0
  196. package/src/hooks/use-initials.tsx +24 -0
  197. package/src/hooks/use-mobile-navigation.ts +12 -0
  198. package/src/hooks/use-mobile.tsx +38 -0
  199. package/src/index.ts +408 -0
  200. package/src/layouts/AppLayout.tsx +60 -0
  201. package/src/layouts/AuthLayout.tsx +32 -0
  202. package/src/layouts/SettingsLayout.tsx +21 -0
  203. package/src/layouts/app/AIChatLayout.tsx +73 -0
  204. package/src/layouts/app/AsideSidebarLayout.tsx +3 -0
  205. package/src/layouts/app/CalendarSidebarLayout.tsx +69 -0
  206. package/src/layouts/app/CommunitiesNavbarLayout.tsx +3 -0
  207. package/src/layouts/app/DualNavbarSidebarLayout.tsx +3 -0
  208. package/src/layouts/app/FocusSidebarLayout.tsx +75 -0
  209. package/src/layouts/app/MailLayout.tsx +69 -0
  210. package/src/layouts/app/MegaMenuHeaderLayout.tsx +3 -0
  211. package/src/layouts/app/MegaMenuLayout.tsx +81 -0
  212. package/src/layouts/app/MegaMenuNavbarLayout.tsx +88 -0
  213. package/src/layouts/app/MegaMenuSearchNavbarLayout.tsx +3 -0
  214. package/src/layouts/app/NavbarCollapsibleLayout.tsx +88 -0
  215. package/src/layouts/app/NavbarCollapsibleLinksLayout.tsx +3 -0
  216. package/src/layouts/app/NavbarMinimalLayout.tsx +3 -0
  217. package/src/layouts/app/NavbarMinimalSidebarLayout.tsx +3 -0
  218. package/src/layouts/app/NavbarSidebarDashboardLayout.tsx +3 -0
  219. package/src/layouts/app/NavbarSidebarLayout.tsx +92 -0
  220. package/src/layouts/app/NavbarSimpleSidebarLayout.tsx +3 -0
  221. package/src/layouts/app/NavbarTitledSidebarLayout.tsx +3 -0
  222. package/src/layouts/app/PanelSidebarLayout.tsx +3 -0
  223. package/src/layouts/app/SearchNavbarSidebarLayout.tsx +3 -0
  224. package/src/layouts/app/SidebarBreadcrumbLayout.tsx +3 -0
  225. package/src/layouts/app/SidebarCleanLayout.tsx +3 -0
  226. package/src/layouts/app/SidebarCommunitiesLayout.tsx +3 -0
  227. package/src/layouts/app/SidebarContentLayout.tsx +3 -0
  228. package/src/layouts/app/SidebarDualMenuLayout.tsx +104 -0
  229. package/src/layouts/app/SidebarFixedLayout.tsx +166 -0
  230. package/src/layouts/app/SidebarFooterNavbarLayout.tsx +3 -0
  231. package/src/layouts/app/SidebarHeaderMenuLayout.tsx +3 -0
  232. package/src/layouts/app/SidebarMegaMenuLayout.tsx +4 -0
  233. package/src/layouts/app/SidebarMinimalLayout.tsx +70 -0
  234. package/src/layouts/app/SidebarMobileSearchLayout.tsx +3 -0
  235. package/src/layouts/app/SidebarMultiPanelLayout.tsx +3 -0
  236. package/src/layouts/app/SidebarPrimarySecondaryLayout.tsx +3 -0
  237. package/src/layouts/app/SidebarSearchHeaderLayout.tsx +103 -0
  238. package/src/layouts/app/SidebarSearchToolbarLayout.tsx +3 -0
  239. package/src/layouts/app/SidebarTabsDualLayout.tsx +3 -0
  240. package/src/layouts/app/SidebarTabsLayout.tsx +98 -0
  241. package/src/layouts/app/SidebarTreeLayout.tsx +3 -0
  242. package/src/layouts/app/SplitNavbarLayout.tsx +3 -0
  243. package/src/layouts/app/SplitSidebarDashboardLayout.tsx +3 -0
  244. package/src/layouts/app/SplitSidebarLayout.tsx +99 -0
  245. package/src/layouts/app/TopNavLayout.tsx +105 -0
  246. package/src/layouts/app/TopNavLinksLayout.tsx +3 -0
  247. package/src/layouts/app/WorkspaceBreadcrumbLayout.tsx +3 -0
  248. package/src/layouts/app/WorkspaceCommunitiesLayout.tsx +3 -0
  249. package/src/layouts/app/WorkspaceNavbarLayout.tsx +3 -0
  250. package/src/layouts/app/WorkspaceSidebarLayout.tsx +98 -0
  251. package/src/layouts/app/WorkspaceSidebarTitleLayout.tsx +3 -0
  252. package/src/layouts/app/app-header-layout.tsx +45 -0
  253. package/src/layouts/app/app-sidebar-layout.tsx +56 -0
  254. package/src/layouts/app/layout-context.tsx +44 -0
  255. package/src/layouts/app/layout-types.ts +47 -0
  256. package/src/layouts/app/partials/Footer.tsx +35 -0
  257. package/src/layouts/app/partials/HeaderTopbar.tsx +96 -0
  258. package/src/layouts/app/partials/Navbar.tsx +85 -0
  259. package/src/layouts/app/partials/Toolbar.tsx +47 -0
  260. package/src/layouts/app-layout.tsx +29 -0
  261. package/src/layouts/auth/AuthBrandedLayout.tsx +58 -0
  262. package/src/layouts/auth/AuthCardLayout.tsx +31 -0
  263. package/src/layouts/auth/AuthCenteredLayout.tsx +41 -0
  264. package/src/layouts/auth/AuthClassicLayout.tsx +41 -0
  265. package/src/layouts/auth/AuthSimpleLayout.tsx +33 -0
  266. package/src/layouts/auth/AuthSplitLayout.tsx +89 -0
  267. package/src/layouts/web-app-layout.tsx +162 -0
  268. package/src/layouts/web-layout.tsx +23 -0
  269. package/src/lib/datetime.ts +188 -0
  270. package/src/lib/google-maps-loader.ts +99 -0
  271. package/src/lib/location.ts +127 -0
  272. package/src/lib/lucide-icon-map.ts +132 -0
  273. package/src/lib/map-markers.ts +124 -0
  274. package/src/lib/map-styles.ts +351 -0
  275. package/src/lib/utils.ts +11 -0
  276. package/src/platform/adapters/default.tsx +156 -0
  277. package/src/platform/adapters/inertia.tsx +88 -0
  278. package/src/platform/adapters/nextjs.ts +86 -0
  279. package/src/platform/context.tsx +106 -0
  280. package/src/platform/index.ts +27 -0
  281. package/src/platform/types.ts +105 -0
  282. package/src/styles/layouts/sidebar-fixed.css +161 -0
  283. package/src/styles/themes.css +583 -0
  284. package/src/types/assets.d.ts +5 -0
  285. package/src/types/auth.ts +25 -0
  286. package/src/types/global.d.ts +13 -0
  287. package/src/types/index.ts +9 -0
  288. package/src/types/navigation.ts +15 -0
  289. package/src/types/ui.ts +32 -0
@@ -0,0 +1,129 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { AnimatePresence, motion, useMotionValue, useSpring, useTransform } from 'motion/react';
5
+ import { cn } from '../../lib/utils';
6
+
7
+ interface AvatarGroupContextValue {
8
+ tooltipClassName?: string;
9
+ animation?: 'default' | 'flip' | 'reveal';
10
+ }
11
+
12
+ const AvatarGroupContext = React.createContext<AvatarGroupContextValue | null>(null);
13
+
14
+ export function AvatarGroup({
15
+ children,
16
+ className,
17
+ tooltipClassName,
18
+ animation = 'default',
19
+ }: {
20
+ children: React.ReactNode;
21
+ className?: string;
22
+ tooltipClassName?: string;
23
+ animation?: 'default' | 'flip' | 'reveal';
24
+ }) {
25
+ return (
26
+ <AvatarGroupContext.Provider value={{ tooltipClassName, animation }}>
27
+ <div className={cn('flex -space-x-2.5', className)}>{children}</div>
28
+ </AvatarGroupContext.Provider>
29
+ );
30
+ }
31
+
32
+ export function AvatarGroupItem({
33
+ children,
34
+ className,
35
+ tooltipClassName,
36
+ animation: itemAnimation,
37
+ }: {
38
+ children: React.ReactNode;
39
+ className?: string;
40
+ tooltipClassName?: string;
41
+ animation?: 'default' | 'flip' | 'reveal';
42
+ }) {
43
+ const context = React.useContext(AvatarGroupContext);
44
+ const [hovered, setHovered] = React.useState(false);
45
+ const springConfig = { stiffness: 100, damping: 5 };
46
+ const x = useMotionValue(0);
47
+ const rotate = useSpring(useTransform(x, [-100, 100], [-45, 45]), springConfig);
48
+ const translateX = useSpring(useTransform(x, [-100, 100], [-50, 50]), springConfig);
49
+
50
+ const animation = itemAnimation ?? context?.animation ?? 'default';
51
+ const finalTooltipClassName = tooltipClassName ?? context?.tooltipClassName;
52
+
53
+ const tooltipChild = React.Children.toArray(children).find(
54
+ (child) => React.isValidElement(child) && child.type === AvatarGroupTooltip,
55
+ );
56
+ const otherChildren = React.Children.toArray(children).filter(
57
+ (child) => !(React.isValidElement(child) && child.type === AvatarGroupTooltip),
58
+ );
59
+ const tooltipContent = tooltipChild && React.isValidElement(tooltipChild)
60
+ ? (tooltipChild.props as { children: React.ReactNode }).children
61
+ : null;
62
+
63
+ const variants = {
64
+ default: {
65
+ initial: { opacity: 0, y: 20, scale: 0.6 },
66
+ animate: { opacity: 1, y: 0, scale: 1, transition: { type: 'spring' as const, stiffness: 260, damping: 10 } },
67
+ exit: { opacity: 0, y: 20, scale: 0.6, transition: { duration: 0.2, ease: 'easeInOut' as const } },
68
+ },
69
+ flip: {
70
+ initial: { opacity: 0, rotateX: -90 },
71
+ animate: { opacity: 1, rotateX: 0, transition: { type: 'spring' as const, stiffness: 180, damping: 25 } },
72
+ exit: { opacity: 0, rotateX: -90, transition: { duration: 0.3, ease: 'easeInOut' as const } },
73
+ },
74
+ reveal: {
75
+ initial: { opacity: 0, scale: 0.95 },
76
+ animate: { opacity: 1, scale: 1, transition: { duration: 0.15, ease: 'easeOut' as const } },
77
+ exit: { opacity: 0, scale: 0.95, transition: { duration: 0.1, ease: 'easeIn' as const } },
78
+ },
79
+ };
80
+ const v = variants[animation];
81
+
82
+ return (
83
+ <div
84
+ className={cn('group relative', className)}
85
+ onMouseEnter={() => setHovered(true)}
86
+ onMouseLeave={() => setHovered(false)}
87
+ >
88
+ <AnimatePresence mode="wait">
89
+ {hovered && tooltipContent && (
90
+ <motion.div
91
+ initial={v.initial}
92
+ animate={v.animate}
93
+ exit={v.exit}
94
+ style={{
95
+ translateX: animation === 'reveal' ? 0 : translateX,
96
+ rotate: animation === 'reveal' ? 0 : rotate,
97
+ whiteSpace: 'nowrap',
98
+ transformOrigin: 'center',
99
+ }}
100
+ className={cn(
101
+ 'absolute -top-16 left-1/2 z-50 flex -translate-x-1/2 flex-col items-center justify-center rounded-md bg-black px-4 py-2 text-xs font-medium text-white shadow-xl',
102
+ finalTooltipClassName,
103
+ )}
104
+ >
105
+ {tooltipContent}
106
+ </motion.div>
107
+ )}
108
+ </AnimatePresence>
109
+ <motion.div
110
+ className="relative cursor-pointer"
111
+ whileHover={{ zIndex: 30 }}
112
+ whileTap={{ scale: 0.95 }}
113
+ transition={{ duration: 0.5 }}
114
+ onMouseMove={(e) => {
115
+ const half = (e.currentTarget as HTMLElement).offsetWidth / 2;
116
+ x.set(e.nativeEvent.offsetX - half);
117
+ }}
118
+ >
119
+ {otherChildren}
120
+ </motion.div>
121
+ </div>
122
+ );
123
+ }
124
+
125
+ export function AvatarGroupTooltip({ children, className }: { children: React.ReactNode; className?: string }) {
126
+ return (
127
+ <div className={cn('hidden relative z-30', className)}>{children}</div>
128
+ );
129
+ }
@@ -0,0 +1,67 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { cn } from '../../lib/utils';
5
+ import { cva, VariantProps } from 'class-variance-authority';
6
+ import * as AvatarPrimitive from '@radix-ui/react-avatar';
7
+
8
+ const avatarStatusVariants = cva('flex items-center rounded-full size-2 border-2 border-background', {
9
+ variants: {
10
+ variant: {
11
+ online: 'bg-green-600',
12
+ offline: 'bg-zinc-600 dark:bg-zinc-300',
13
+ busy: 'bg-yellow-600',
14
+ away: 'bg-blue-600',
15
+ },
16
+ },
17
+ defaultVariants: {
18
+ variant: 'online',
19
+ },
20
+ });
21
+
22
+ function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>) {
23
+ return (
24
+ <AvatarPrimitive.Root data-slot="avatar" className={cn('relative flex shrink-0 size-10', className)} {...props} />
25
+ );
26
+ }
27
+
28
+ function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>) {
29
+ return (
30
+ <div className={cn('relative overflow-hidden rounded-full', className)}>
31
+ <AvatarPrimitive.Image data-slot="avatar-image" className={cn('aspect-square h-full w-full')} {...props} />
32
+ </div>
33
+ );
34
+ }
35
+
36
+ function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
37
+ return (
38
+ <AvatarPrimitive.Fallback
39
+ data-slot="avatar-fallback"
40
+ className={cn(
41
+ 'flex h-full w-full items-center justify-center rounded-full border border-border bg-accent text-accent-foreground text-xs',
42
+ className,
43
+ )}
44
+ {...props}
45
+ />
46
+ );
47
+ }
48
+
49
+ function AvatarIndicator({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
50
+ return (
51
+ <div
52
+ data-slot="avatar-indicator"
53
+ className={cn('absolute flex size-6 items-center justify-center', className)}
54
+ {...props}
55
+ />
56
+ );
57
+ }
58
+
59
+ function AvatarStatus({
60
+ className,
61
+ variant,
62
+ ...props
63
+ }: React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof avatarStatusVariants>) {
64
+ return <div data-slot="avatar-status" className={cn(avatarStatusVariants({ variant }), className)} {...props} />;
65
+ }
66
+
67
+ export { Avatar, AvatarFallback, AvatarImage, AvatarIndicator, AvatarStatus, avatarStatusVariants };
@@ -0,0 +1,230 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../lib/utils';
3
+ import { cva, type VariantProps } from 'class-variance-authority';
4
+ import { Slot as SlotPrimitive } from '@radix-ui/react-slot';
5
+
6
+ export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
+ asChild?: boolean;
8
+ dotClassName?: string;
9
+ disabled?: boolean;
10
+ }
11
+
12
+ export interface BadgeButtonProps
13
+ extends React.ButtonHTMLAttributes<HTMLDivElement>,
14
+ VariantProps<typeof badgeButtonVariants> {
15
+ asChild?: boolean;
16
+ }
17
+
18
+ export type BadgeDotProps = React.HTMLAttributes<HTMLSpanElement>;
19
+
20
+ const badgeVariants = cva(
21
+ 'inline-flex items-center justify-center border border-transparent font-medium focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 [&_svg]:-ms-px [&_svg]:shrink-0',
22
+ {
23
+ variants: {
24
+ variant: {
25
+ primary: 'bg-primary text-primary-foreground',
26
+ secondary: 'bg-secondary text-secondary-foreground',
27
+ success:
28
+ 'bg-[var(--color-success-accent,var(--color-green-500))] text-[var(--color-success-foreground,var(--color-white))]',
29
+ warning:
30
+ 'bg-[var(--color-warning-accent,var(--color-yellow-500))] text-[var(--color-warning-foreground,var(--color-white))]',
31
+ info: 'bg-[var(--color-info-accent,var(--color-violet-500))] text-[var(--color-info-foreground,var(--color-white))]',
32
+ outline: 'bg-transparent border border-border text-secondary-foreground',
33
+ destructive: 'bg-destructive text-destructive-foreground',
34
+ },
35
+ appearance: {
36
+ default: '',
37
+ light: '',
38
+ outline: '',
39
+ ghost: 'border-transparent bg-transparent',
40
+ },
41
+ disabled: {
42
+ true: 'opacity-50 pointer-events-none',
43
+ },
44
+ size: {
45
+ lg: 'rounded-md px-[0.5rem] h-7 min-w-7 gap-1.5 text-xs [&_svg]:size-3.5',
46
+ md: 'rounded-md px-[0.45rem] h-6 min-w-6 gap-1.5 text-xs [&_svg]:size-3.5 ',
47
+ sm: 'rounded-sm px-[0.325rem] h-5 min-w-5 gap-1 text-[0.6875rem] leading-[0.75rem] [&_svg]:size-3',
48
+ xs: 'rounded-sm px-[0.25rem] h-4 min-w-4 gap-1 text-[0.625rem] leading-[0.5rem] [&_svg]:size-3',
49
+ },
50
+ shape: {
51
+ default: '',
52
+ circle: 'rounded-full',
53
+ },
54
+ },
55
+ compoundVariants: [
56
+ /* Light */
57
+ {
58
+ variant: 'primary',
59
+ appearance: 'light',
60
+ className:
61
+ 'text-[var(--color-primary-accent,var(--color-blue-700))] bg-[var(--color-primary-soft,var(--color-blue-50))] dark:bg-[var(--color-primary-soft,var(--color-blue-950))] dark:text-[var(--color-primary-soft,var(--color-blue-600))]',
62
+ },
63
+ {
64
+ variant: 'secondary',
65
+ appearance: 'light',
66
+ className: 'bg-secondary dark:bg-secondary/50 text-secondary-foreground',
67
+ },
68
+ {
69
+ variant: 'success',
70
+ appearance: 'light',
71
+ className:
72
+ 'text-[var(--color-success-accent,var(--color-green-800))] bg-[var(--color-success-soft,var(--color-green-100))] dark:bg-[var(--color-success-soft,var(--color-green-950))] dark:text-[var(--color-success-soft,var(--color-green-600))]',
73
+ },
74
+ {
75
+ variant: 'warning',
76
+ appearance: 'light',
77
+ className:
78
+ 'text-[var(--color-warning-accent,var(--color-yellow-700))] bg-[var(--color-warning-soft,var(--color-yellow-100))] dark:bg-[var(--color-warning-soft,var(--color-yellow-950))] dark:text-[var(--color-warning-soft,var(--color-yellow-600))]',
79
+ },
80
+ {
81
+ variant: 'info',
82
+ appearance: 'light',
83
+ className:
84
+ 'text-[var(--color-info-accent,var(--color-violet-700))] bg-[var(--color-info-soft,var(--color-violet-100))] dark:bg-[var(--color-info-soft,var(--color-violet-950))] dark:text-[var(--color-info-soft,var(--color-violet-400))]',
85
+ },
86
+ {
87
+ variant: 'destructive',
88
+ appearance: 'light',
89
+ className:
90
+ 'text-[var(--color-destructive-accent,var(--color-red-700))] bg-[var(--color-destructive-soft,var(--color-red-50))] dark:bg-[var(--color-destructive-soft,var(--color-red-950))] dark:text-[var(--color-destructive-soft,var(--color-red-600))]',
91
+ },
92
+ /* Outline */
93
+ {
94
+ variant: 'primary',
95
+ appearance: 'outline',
96
+ className:
97
+ 'text-[var(--color-primary-accent,var(--color-blue-700))] border-[var(--color-primary-soft,var(--color-blue-100))] bg-[var(--color-primary-soft,var(--color-blue-50))] dark:bg-[var(--color-primary-soft,var(--color-blue-950))] dark:border-[var(--color-primary-soft,var(--color-blue-900))] dark:text-[var(--color-primary-soft,var(--color-blue-600))]',
98
+ },
99
+ {
100
+ variant: 'success',
101
+ appearance: 'outline',
102
+ className:
103
+ 'text-[var(--color-success-accent,var(--color-green-700))] border-[var(--color-success-soft,var(--color-green-200))] bg-[var(--color-success-soft,var(--color-green-50))] dark:bg-[var(--color-success-soft,var(--color-green-950))] dark:border-[var(--color-success-soft,var(--color-green-900))] dark:text-[var(--color-success-soft,var(--color-green-600))]',
104
+ },
105
+ {
106
+ variant: 'warning',
107
+ appearance: 'outline',
108
+ className:
109
+ 'text-[var(--color-warning-accent,var(--color-yellow-700))] border-[var(--color-warning-soft,var(--color-yellow-200))] bg-[var(--color-warning-soft,var(--color-yellow-50))] dark:bg-[var(--color-warning-soft,var(--color-yellow-950))] dark:border-[var(--color-warning-soft,var(--color-yellow-900))] dark:text-[var(--color-warning-soft,var(--color-yellow-600))]',
110
+ },
111
+ {
112
+ variant: 'info',
113
+ appearance: 'outline',
114
+ className:
115
+ 'text-[var(--color-info-accent,var(--color-violet-700))] border-[var(--color-info-soft,var(--color-violet-100))] bg-[var(--color-info-soft,var(--color-violet-50))] dark:bg-[var(--color-info-soft,var(--color-violet-950))] dark:border-[var(--color-info-soft,var(--color-violet-900))] dark:text-[var(--color-info-soft,var(--color-violet-400))]',
116
+ },
117
+ {
118
+ variant: 'destructive',
119
+ appearance: 'outline',
120
+ className:
121
+ 'text-[var(--color-destructive-accent,var(--color-red-700))] border-[var(--color-destructive-soft,var(--color-red-100))] bg-[var(--color-destructive-soft,var(--color-red-50))] dark:bg-[var(--color-destructive-soft,var(--color-red-950))] dark:border-[var(--color-destructive-soft,var(--color-red-900))] dark:text-[var(--color-destructive-soft,var(--color-red-600))]',
122
+ },
123
+ /* Ghost */
124
+ {
125
+ variant: 'primary',
126
+ appearance: 'ghost',
127
+ className: 'text-primary',
128
+ },
129
+ {
130
+ variant: 'secondary',
131
+ appearance: 'ghost',
132
+ className: 'text-secondary-foreground',
133
+ },
134
+ {
135
+ variant: 'success',
136
+ appearance: 'ghost',
137
+ className: 'text-[var(--color-success-accent,var(--color-green-500))]',
138
+ },
139
+ {
140
+ variant: 'warning',
141
+ appearance: 'ghost',
142
+ className: 'text-[var(--color-warning-accent,var(--color-yellow-500))]',
143
+ },
144
+ {
145
+ variant: 'info',
146
+ appearance: 'ghost',
147
+ className: 'text-[var(--color-info-accent,var(--color-violet-500))]',
148
+ },
149
+ {
150
+ variant: 'destructive',
151
+ appearance: 'ghost',
152
+ className: 'text-destructive',
153
+ },
154
+
155
+ { size: 'lg', appearance: 'ghost', className: 'px-0' },
156
+ { size: 'md', appearance: 'ghost', className: 'px-0' },
157
+ { size: 'sm', appearance: 'ghost', className: 'px-0' },
158
+ { size: 'xs', appearance: 'ghost', className: 'px-0' },
159
+ ],
160
+ defaultVariants: {
161
+ variant: 'primary',
162
+ appearance: 'default',
163
+ size: 'md',
164
+ },
165
+ },
166
+ );
167
+
168
+ const badgeButtonVariants = cva(
169
+ 'cursor-pointer transition-all inline-flex items-center justify-center leading-none size-3.5 [&>svg]:opacity-100! [&>svg]:size-3.5! p-0 rounded-md -me-0.5 opacity-60 hover:opacity-100',
170
+ {
171
+ variants: {
172
+ variant: {
173
+ default: '',
174
+ },
175
+ },
176
+ defaultVariants: {
177
+ variant: 'default',
178
+ },
179
+ },
180
+ );
181
+
182
+ function Badge({
183
+ className,
184
+ variant,
185
+ size,
186
+ appearance,
187
+ shape,
188
+ asChild = false,
189
+ disabled,
190
+ ...props
191
+ }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
192
+ const Comp = asChild ? SlotPrimitive : 'span';
193
+
194
+ return (
195
+ <Comp
196
+ data-slot="badge"
197
+ className={cn(badgeVariants({ variant, size, appearance, shape, disabled }), className)}
198
+ {...props}
199
+ />
200
+ );
201
+ }
202
+
203
+ function BadgeButton({
204
+ className,
205
+ variant,
206
+ asChild = false,
207
+ ...props
208
+ }: React.ComponentProps<'button'> & VariantProps<typeof badgeButtonVariants> & { asChild?: boolean }) {
209
+ const Comp = asChild ? SlotPrimitive : 'span';
210
+ return (
211
+ <Comp
212
+ data-slot="badge-button"
213
+ className={cn(badgeButtonVariants({ variant, className }))}
214
+ role="button"
215
+ {...props}
216
+ />
217
+ );
218
+ }
219
+
220
+ function BadgeDot({ className, ...props }: React.ComponentProps<'span'>) {
221
+ return (
222
+ <span
223
+ data-slot="badge-dot"
224
+ className={cn('size-1.5 rounded-full bg-[currentColor] opacity-75', className)}
225
+ {...props}
226
+ />
227
+ );
228
+ }
229
+
230
+ export { Badge, BadgeButton, BadgeDot, badgeVariants };
@@ -0,0 +1,88 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../lib/utils';
3
+ import { ChevronRight, MoreHorizontal } from 'lucide-react';
4
+ import { Slot as SlotPrimitive } from '@radix-ui/react-slot';
5
+
6
+ function Breadcrumb({
7
+ ...props
8
+ }: React.ComponentProps<'nav'> & {
9
+ separator?: React.ReactNode;
10
+ }) {
11
+ return <nav data-slot="breadcrumb" aria-label="breadcrumb" {...props} />;
12
+ }
13
+
14
+ function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>) {
15
+ return (
16
+ <ol
17
+ data-slot="breadcrumb-list"
18
+ className={cn('flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground', className)}
19
+ {...props}
20
+ />
21
+ );
22
+ }
23
+
24
+ function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>) {
25
+ return <li data-slot="breadcrumb-item" className={cn('inline-flex items-center gap-1.5', className)} {...props} />;
26
+ }
27
+
28
+ function BreadcrumbLink({
29
+ asChild,
30
+ className,
31
+ ...props
32
+ }: React.ComponentProps<'a'> & {
33
+ asChild?: boolean;
34
+ }) {
35
+ const Comp = asChild ? SlotPrimitive : 'a';
36
+
37
+ return (
38
+ <Comp data-slot="breadcrumb-link" className={cn('transition-colors hover:text-foreground', className)} {...props} />
39
+ );
40
+ }
41
+
42
+ function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>) {
43
+ return (
44
+ <span
45
+ data-slot="breadcrumb-page"
46
+ role="link"
47
+ aria-disabled="true"
48
+ aria-current="page"
49
+ className={cn('font-normal text-foreground', className)}
50
+ {...props}
51
+ />
52
+ );
53
+ }
54
+
55
+ const BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentProps<'li'>) => (
56
+ <li
57
+ data-slot="breadcrumb-separator"
58
+ role="presentation"
59
+ aria-hidden="true"
60
+ className={cn('[&>svg]:w-3.5 [&>svg]:h-3.5', className)}
61
+ {...props}
62
+ >
63
+ {children ?? <ChevronRight className="rtl:rotate-180" />}
64
+ </li>
65
+ );
66
+
67
+ const BreadcrumbEllipsis = ({ className, ...props }: React.ComponentProps<'span'>) => (
68
+ <span
69
+ data-slot="breadcrumb-ellipsis"
70
+ role="presentation"
71
+ aria-hidden="true"
72
+ className={cn('flex h-9 w-9 items-center justify-center', className)}
73
+ {...props}
74
+ >
75
+ <MoreHorizontal className="h-4 w-4" />
76
+ <span className="sr-only">More</span>
77
+ </span>
78
+ );
79
+
80
+ export {
81
+ Breadcrumb,
82
+ BreadcrumbEllipsis,
83
+ BreadcrumbItem,
84
+ BreadcrumbLink,
85
+ BreadcrumbList,
86
+ BreadcrumbPage,
87
+ BreadcrumbSeparator,
88
+ };