@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,50 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
5
+ import { cn } from '../../lib/utils';
6
+
7
+ function ScrollArea({
8
+ className,
9
+ viewportClassName,
10
+ children,
11
+ viewportRef,
12
+ ...props
13
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.Root> & {
14
+ viewportRef?: React.Ref<HTMLDivElement>;
15
+ viewportClassName?: string;
16
+ }) {
17
+ return (
18
+ <ScrollAreaPrimitive.Root data-slot="scroll-area" className={cn('relative overflow-hidden', className)} {...props}>
19
+ <ScrollAreaPrimitive.Viewport ref={viewportRef} className={cn('h-full w-full rounded-[inherit]', viewportClassName)}>
20
+ {children}
21
+ </ScrollAreaPrimitive.Viewport>
22
+ <ScrollBar />
23
+ <ScrollAreaPrimitive.Corner />
24
+ </ScrollAreaPrimitive.Root>
25
+ );
26
+ }
27
+
28
+ function ScrollBar({
29
+ className,
30
+ orientation = 'vertical',
31
+ ...props
32
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
33
+ return (
34
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
35
+ data-slot="scroll-area-scrollbar"
36
+ orientation={orientation}
37
+ className={cn(
38
+ 'flex touch-none select-none transition-colors',
39
+ orientation === 'vertical' && 'h-full w-2 border-l border-l-transparent p-[1px]',
40
+ orientation === 'horizontal' && 'h-2 flex-col border-t border-t-transparent p-[1px]',
41
+ className,
42
+ )}
43
+ {...props}
44
+ >
45
+ <ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
46
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
47
+ );
48
+ }
49
+
50
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,234 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { isValidElement, ReactNode } from 'react';
5
+ import { cn } from '../../lib/utils';
6
+ import { cva, VariantProps } from 'class-variance-authority';
7
+ import { Check, ChevronDown, ChevronUp } from 'lucide-react';
8
+ import * as SelectPrimitive from '@radix-ui/react-select';
9
+
10
+ // Create a Context for `indicatorPosition` and `indicator` control
11
+ const SelectContext = React.createContext<{
12
+ indicatorPosition: 'left' | 'right';
13
+ indicatorVisibility: boolean;
14
+ indicator: ReactNode;
15
+ }>({ indicatorPosition: 'left', indicator: null, indicatorVisibility: true });
16
+
17
+ // Root Component
18
+ const Select = ({
19
+ indicatorPosition = 'left',
20
+ indicatorVisibility = true,
21
+ indicator,
22
+ ...props
23
+ }: {
24
+ indicatorPosition?: 'left' | 'right';
25
+ indicatorVisibility?: boolean;
26
+ indicator?: ReactNode;
27
+ } & React.ComponentProps<typeof SelectPrimitive.Root>) => {
28
+ return (
29
+ <SelectContext.Provider value={{ indicatorPosition, indicatorVisibility, indicator }}>
30
+ <SelectPrimitive.Root {...props} />
31
+ </SelectContext.Provider>
32
+ );
33
+ };
34
+
35
+ function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {
36
+ return <SelectPrimitive.Group data-slot="select-group" {...props} />;
37
+ }
38
+
39
+ function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {
40
+ return <SelectPrimitive.Value data-slot="select-value" {...props} />;
41
+ }
42
+
43
+ // Define size variants for SelectTrigger
44
+ const selectTriggerVariants = cva(
45
+ `
46
+ flex bg-background w-full items-center justify-between outline-none border border-input shadow-xs shadow-black/5 transition-shadow
47
+ text-foreground data-placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-none focus-visible:ring-[3px]
48
+ focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1
49
+ aria-invalid:border-destructive/60 aria-invalid:ring-destructive/10 dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/20
50
+ [[data-invalid=true]_&]:border-destructive/60 [[data-invalid=true]_&]:ring-destructive/10 dark:[[data-invalid=true]_&]:border-destructive dark:[[data-invalid=true]_&]:ring-destructive/20
51
+ `,
52
+ {
53
+ variants: {
54
+ size: {
55
+ sm: 'h-7 px-2.5 text-xs gap-1 rounded-md',
56
+ md: 'h-8.5 px-3 text-[0.8125rem] leading-(--text-sm--line-height) gap-1 rounded-md',
57
+ lg: 'h-10 px-4 text-sm gap-1.5 rounded-md',
58
+ },
59
+ },
60
+ defaultVariants: {
61
+ size: 'md',
62
+ },
63
+ },
64
+ );
65
+
66
+ export interface SelectTriggerProps
67
+ extends React.ComponentProps<typeof SelectPrimitive.Trigger>,
68
+ VariantProps<typeof selectTriggerVariants> {}
69
+
70
+ function SelectTrigger({ className, children, size, ...props }: SelectTriggerProps) {
71
+ return (
72
+ <SelectPrimitive.Trigger
73
+ data-slot="select-trigger"
74
+ className={cn(selectTriggerVariants({ size }), className)}
75
+ {...props}
76
+ >
77
+ {children}
78
+ <SelectPrimitive.Icon asChild>
79
+ <ChevronDown className="h-4 w-4 opacity-60 -me-0.5" />
80
+ </SelectPrimitive.Icon>
81
+ </SelectPrimitive.Trigger>
82
+ );
83
+ }
84
+
85
+ function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
86
+ return (
87
+ <SelectPrimitive.ScrollUpButton
88
+ data-slot="select-scroll-up-button"
89
+ className={cn('flex cursor-default items-center justify-center py-1', className)}
90
+ {...props}
91
+ >
92
+ <ChevronUp className="h-4 w-4" />
93
+ </SelectPrimitive.ScrollUpButton>
94
+ );
95
+ }
96
+
97
+ function SelectScrollDownButton({
98
+ className,
99
+ ...props
100
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
101
+ return (
102
+ <SelectPrimitive.ScrollDownButton
103
+ data-slot="select-scroll-down-button"
104
+ className={cn('flex cursor-default items-center justify-center py-1', className)}
105
+ {...props}
106
+ >
107
+ <ChevronDown className="h-4 w-4" />
108
+ </SelectPrimitive.ScrollDownButton>
109
+ );
110
+ }
111
+
112
+ function SelectContent({
113
+ className,
114
+ children,
115
+ position = 'popper',
116
+ ...props
117
+ }: React.ComponentProps<typeof SelectPrimitive.Content>) {
118
+ return (
119
+ <SelectPrimitive.Portal>
120
+ <SelectPrimitive.Content
121
+ data-slot="select-content"
122
+ className={cn(
123
+ 'relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover shadow-md shadow-black/5 text-secondary-foreground 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',
124
+ position === 'popper' &&
125
+ 'data-[side=bottom]:translate-y-1.5 data-[side=left]:-translate-x-1.5 data-[side=right]:translate-x-1.5 data-[side=top]:-translate-y-1.5',
126
+ className,
127
+ )}
128
+ position={position}
129
+ {...props}
130
+ >
131
+ <SelectScrollUpButton />
132
+ <SelectPrimitive.Viewport
133
+ className={cn(
134
+ 'p-1.5',
135
+ position === 'popper' &&
136
+ 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',
137
+ )}
138
+ >
139
+ {children}
140
+ </SelectPrimitive.Viewport>
141
+ <SelectScrollDownButton />
142
+ </SelectPrimitive.Content>
143
+ </SelectPrimitive.Portal>
144
+ );
145
+ }
146
+
147
+ function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {
148
+ return (
149
+ <SelectPrimitive.Label
150
+ data-slot="select-label"
151
+ className={cn('py-1.5 ps-8 pe-2 text-xs text-muted-foreground font-medium', className)}
152
+ {...props}
153
+ />
154
+ );
155
+ }
156
+
157
+ function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) {
158
+ const { indicatorPosition, indicatorVisibility, indicator } = React.useContext(SelectContext);
159
+
160
+ return (
161
+ <SelectPrimitive.Item
162
+ data-slot="select-item"
163
+ className={cn(
164
+ 'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 text-sm outline-hidden text-foreground hover:bg-accent focus:bg-accent data-disabled:pointer-events-none data-disabled:opacity-50',
165
+ indicatorPosition === 'left' ? 'ps-8 pe-2' : 'pe-8 ps-2',
166
+ className,
167
+ )}
168
+ {...props}
169
+ >
170
+ {indicatorVisibility &&
171
+ (indicator && isValidElement(indicator) ? (
172
+ indicator
173
+ ) : (
174
+ <span
175
+ className={cn(
176
+ 'absolute flex h-3.5 w-3.5 items-center justify-center',
177
+ indicatorPosition === 'left' ? 'start-2' : 'end-2',
178
+ )}
179
+ >
180
+ <SelectPrimitive.ItemIndicator>
181
+ <Check className="h-4 w-4 text-primary" />
182
+ </SelectPrimitive.ItemIndicator>
183
+ </span>
184
+ ))}
185
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
186
+ </SelectPrimitive.Item>
187
+ );
188
+ }
189
+
190
+ function SelectIndicator({
191
+ children,
192
+ className,
193
+ ...props
194
+ }: React.ComponentProps<typeof SelectPrimitive.ItemIndicator>) {
195
+ const { indicatorPosition } = React.useContext(SelectContext);
196
+
197
+ return (
198
+ <span
199
+ data-slot="select-indicator"
200
+ className={cn(
201
+ 'absolute flex top-1/2 -translate-y-1/2 items-center justify-center',
202
+ indicatorPosition === 'left' ? 'start-2' : 'end-2',
203
+ className,
204
+ )}
205
+ {...props}
206
+ >
207
+ <SelectPrimitive.ItemIndicator>{children}</SelectPrimitive.ItemIndicator>
208
+ </span>
209
+ );
210
+ }
211
+
212
+ function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
213
+ return (
214
+ <SelectPrimitive.Separator
215
+ data-slot="select-separator"
216
+ className={cn('-mx-1.5 my-1.5 h-px bg-border', className)}
217
+ {...props}
218
+ />
219
+ );
220
+ }
221
+
222
+ export {
223
+ Select,
224
+ SelectContent,
225
+ SelectGroup,
226
+ SelectIndicator,
227
+ SelectItem,
228
+ SelectLabel,
229
+ SelectScrollDownButton,
230
+ SelectScrollUpButton,
231
+ SelectSeparator,
232
+ SelectTrigger,
233
+ SelectValue,
234
+ };
@@ -0,0 +1,24 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { cn } from '../../lib/utils';
5
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
6
+
7
+ function Separator({
8
+ className,
9
+ orientation = 'horizontal',
10
+ decorative = true,
11
+ ...props
12
+ }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
13
+ return (
14
+ <SeparatorPrimitive.Root
15
+ data-slot="separator"
16
+ decorative={decorative}
17
+ orientation={orientation}
18
+ className={cn('shrink-0 bg-border', orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px', className)}
19
+ {...props}
20
+ />
21
+ );
22
+ }
23
+
24
+ export { Separator };
@@ -0,0 +1,147 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { cn } from '../../lib/utils';
5
+ import { cva, type VariantProps } from 'class-variance-authority';
6
+ import { X } from 'lucide-react';
7
+ import * as SheetPrimitive from '@radix-ui/react-dialog';
8
+
9
+ function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
10
+ return <SheetPrimitive.Root data-slot="sheet" {...props} />;
11
+ }
12
+
13
+ function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
14
+ return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
15
+ }
16
+
17
+ function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>) {
18
+ return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
19
+ }
20
+
21
+ function SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
22
+ return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
23
+ }
24
+
25
+ function SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
26
+ return (
27
+ <SheetPrimitive.Overlay
28
+ data-slot="sheet-overlay"
29
+ className={cn(
30
+ 'fixed inset-0 z-50 bg-black/30 [backdrop-filter:blur(4px)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
31
+ className,
32
+ )}
33
+ {...props}
34
+ />
35
+ );
36
+ }
37
+
38
+ const sheetVariants = cva(
39
+ 'flex flex-col items-strech 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-400',
40
+ {
41
+ variants: {
42
+ side: {
43
+ top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
44
+ bottom:
45
+ 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
46
+ left: 'inset-y-0 start-0 h-full w-3/4 border-e data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm rtl:data-[state=closed]:slide-out-to-right rtl:data-[state=open]:slide-in-from-right',
47
+ right:
48
+ 'inset-y-0 end-0 h-full w-3/4 border-s data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm rtl:data-[state=closed]:slide-out-to-left rtl:data-[state=open]:slide-in-from-left',
49
+ },
50
+ },
51
+ defaultVariants: {
52
+ side: 'right',
53
+ },
54
+ },
55
+ );
56
+
57
+ interface SheetContentProps
58
+ extends React.ComponentProps<typeof SheetPrimitive.Content>,
59
+ VariantProps<typeof sheetVariants> {
60
+ overlay?: boolean;
61
+ close?: boolean;
62
+ }
63
+
64
+ function SheetContent({
65
+ side = 'right',
66
+ overlay = true,
67
+ close = true,
68
+ className,
69
+ children,
70
+ ...props
71
+ }: React.ComponentProps<typeof SheetPrimitive.Content> & SheetContentProps) {
72
+ return (
73
+ <SheetPortal>
74
+ {overlay && <SheetOverlay />}
75
+ <SheetPrimitive.Content className={cn(sheetVariants({ side }), className)} {...props}>
76
+ {children}
77
+ {close && (
78
+ <SheetPrimitive.Close
79
+ data-slot="sheet-close"
80
+ className="cursor-pointer absolute end-5 top-4 rounded-sm opacity-60 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"
81
+ >
82
+ <X className="h-4 w-4" />
83
+ <span className="sr-only">Close</span>
84
+ </SheetPrimitive.Close>
85
+ )}
86
+ </SheetPrimitive.Content>
87
+ </SheetPortal>
88
+ );
89
+ }
90
+
91
+ function SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {
92
+ return (
93
+ <div
94
+ data-slot="sheet-header"
95
+ className={cn('flex flex-col space-y-1 text-center sm:text-start', className)}
96
+ {...props}
97
+ />
98
+ );
99
+ }
100
+
101
+ function SheetBody({ className, ...props }: React.ComponentProps<'div'>) {
102
+ return <div data-slot="sheet-body" className={cn('py-2.5', className)} {...props} />;
103
+ }
104
+
105
+ function SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {
106
+ return (
107
+ <div
108
+ data-slot="sheet-footer"
109
+ className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}
110
+ {...props}
111
+ />
112
+ );
113
+ }
114
+
115
+ function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {
116
+ return (
117
+ <SheetPrimitive.Title
118
+ data-slot="sheet-title"
119
+ className={cn('text-base font-semibold text-foreground', className)}
120
+ {...props}
121
+ />
122
+ );
123
+ }
124
+
125
+ function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>) {
126
+ return (
127
+ <SheetPrimitive.Description
128
+ data-slot="sheet-description"
129
+ className={cn('text-sm text-muted-foreground', className)}
130
+ {...props}
131
+ />
132
+ );
133
+ }
134
+
135
+ export {
136
+ Sheet,
137
+ SheetBody,
138
+ SheetClose,
139
+ SheetContent,
140
+ SheetDescription,
141
+ SheetFooter,
142
+ SheetHeader,
143
+ SheetOverlay,
144
+ SheetPortal,
145
+ SheetTitle,
146
+ SheetTrigger,
147
+ };