@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.
- package/package.json +185 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/map/arrows/map-arrow-blue.png +0 -0
- package/src/assets/map/arrows/map-arrow-green.png +0 -0
- package/src/assets/map/arrows/map-arrow-purple.png +0 -0
- package/src/assets/map/arrows/map-arrow-red.png +0 -0
- package/src/assets/map/flags/flag-blue.png +0 -0
- package/src/assets/map/flags/flag-green.png +0 -0
- package/src/assets/map/flags/flag-red.png +0 -0
- package/src/assets/map/flags/flag-yellow.png +0 -0
- package/src/assets/map/pins/map-pin-blue.png +0 -0
- package/src/assets/map/pins/map-pin-green.png +0 -0
- package/src/assets/map/pins/map-pin-purple.png +0 -0
- package/src/assets/map/pins/map-pin-red.png +0 -0
- package/src/components/Card.tsx +9 -0
- package/src/components/alert-error.tsx +24 -0
- package/src/components/app-content.tsx +22 -0
- package/src/components/app-header.tsx +153 -0
- package/src/components/app-logo-icon.tsx +13 -0
- package/src/components/app-logo.tsx +21 -0
- package/src/components/app-shell.tsx +19 -0
- package/src/components/app-sidebar-header.tsx +68 -0
- package/src/components/app-sidebar.tsx +106 -0
- package/src/components/appearance-tabs.tsx +46 -0
- package/src/components/breadcrumbs.tsx +50 -0
- package/src/components/cms/blurred-image.tsx +111 -0
- package/src/components/cms/section-bg.tsx +473 -0
- package/src/components/cms/section-button.tsx +127 -0
- package/src/components/cms/sections/banner-5050-section.tsx +135 -0
- package/src/components/cms/sections/blogs-listing-section.tsx +270 -0
- package/src/components/cms/sections/cards-grid-section.tsx +185 -0
- package/src/components/cms/sections/contact-form-section.tsx +157 -0
- package/src/components/cms/sections/cta-section.tsx +101 -0
- package/src/components/cms/sections/featured-blog-slider-section.tsx +256 -0
- package/src/components/cms/sections/featured-products-grid-section.tsx +173 -0
- package/src/components/cms/sections/featured-solutions-grid-section.tsx +183 -0
- package/src/components/cms/sections/hero-section.tsx +180 -0
- package/src/components/cms/sections/solutions-with-filter-section.tsx +234 -0
- package/src/components/cms/sections/text-section.tsx +77 -0
- package/src/components/cutout-image.tsx +228 -0
- package/src/components/devices/devices-mini-map.tsx +275 -0
- package/src/components/docs/docs-shell.tsx +280 -0
- package/src/components/fleet-hero-animated.tsx +383 -0
- package/src/components/input-error.tsx +17 -0
- package/src/components/keenicons/assets/duotone/Read Me.txt +7 -0
- package/src/components/keenicons/assets/duotone/demo-files/demo.css +160 -0
- package/src/components/keenicons/assets/duotone/demo-files/demo.js +32 -0
- package/src/components/keenicons/assets/duotone/demo.html +12424 -0
- package/src/components/keenicons/assets/duotone/fonts/keenicons-duotone.svg +1109 -0
- package/src/components/keenicons/assets/duotone/fonts/keenicons-duotone.ttf +0 -0
- package/src/components/keenicons/assets/duotone/fonts/keenicons-duotone.woff +0 -0
- package/src/components/keenicons/assets/duotone/selection.json +17313 -0
- package/src/components/keenicons/assets/duotone/style.css +4931 -0
- package/src/components/keenicons/assets/filled/Read Me.txt +7 -0
- package/src/components/keenicons/assets/filled/demo-files/demo.css +160 -0
- package/src/components/keenicons/assets/filled/demo-files/demo.js +32 -0
- package/src/components/keenicons/assets/filled/demo.html +12370 -0
- package/src/components/keenicons/assets/filled/fonts/keenicons-filled.svg +1082 -0
- package/src/components/keenicons/assets/filled/fonts/keenicons-filled.ttf +0 -0
- package/src/components/keenicons/assets/filled/fonts/keenicons-filled.woff +0 -0
- package/src/components/keenicons/assets/filled/selection.json +17096 -0
- package/src/components/keenicons/assets/filled/style.css +4769 -0
- package/src/components/keenicons/assets/outline/Read Me.txt +7 -0
- package/src/components/keenicons/assets/outline/demo-files/demo.css +160 -0
- package/src/components/keenicons/assets/outline/demo-files/demo.js +32 -0
- package/src/components/keenicons/assets/outline/demo.html +11356 -0
- package/src/components/keenicons/assets/outline/fonts/keenicons-outline.svg +575 -0
- package/src/components/keenicons/assets/outline/fonts/keenicons-outline.ttf +0 -0
- package/src/components/keenicons/assets/outline/fonts/keenicons-outline.woff +0 -0
- package/src/components/keenicons/assets/outline/selection.json +13054 -0
- package/src/components/keenicons/assets/outline/style.css +1721 -0
- package/src/components/keenicons/assets/solid/Read Me.txt +7 -0
- package/src/components/keenicons/assets/solid/demo-files/demo.css +160 -0
- package/src/components/keenicons/assets/solid/demo-files/demo.js +32 -0
- package/src/components/keenicons/assets/solid/demo.html +11356 -0
- package/src/components/keenicons/assets/solid/fonts/keenicons-solid.svg +575 -0
- package/src/components/keenicons/assets/solid/fonts/keenicons-solid.ttf +0 -0
- package/src/components/keenicons/assets/solid/fonts/keenicons-solid.woff +0 -0
- package/src/components/keenicons/assets/solid/selection.json +13048 -0
- package/src/components/keenicons/assets/solid/style.css +1721 -0
- package/src/components/keenicons/assets/styles.css +4 -0
- package/src/components/keenicons/index.ts +2 -0
- package/src/components/keenicons/keenicons.tsx +16 -0
- package/src/components/keenicons/types.ts +7 -0
- package/src/components/nav-footer.tsx +49 -0
- package/src/components/nav-main.tsx +53 -0
- package/src/components/nav-user.tsx +59 -0
- package/src/components/notification-bell.tsx +190 -0
- package/src/components/products/product-card.tsx +159 -0
- package/src/components/text-link.tsx +23 -0
- package/src/components/ui/accordion-menu.tsx +322 -0
- package/src/components/ui/accordion.tsx +133 -0
- package/src/components/ui/alert-dialog.tsx +82 -0
- package/src/components/ui/alert.tsx +63 -0
- package/src/components/ui/avatar-group.tsx +129 -0
- package/src/components/ui/avatar.tsx +67 -0
- package/src/components/ui/badge.tsx +230 -0
- package/src/components/ui/breadcrumb.tsx +88 -0
- package/src/components/ui/button.tsx +412 -0
- package/src/components/ui/calendar.tsx +56 -0
- package/src/components/ui/card.tsx +147 -0
- package/src/components/ui/chart.tsx +290 -0
- package/src/components/ui/checkbox.tsx +47 -0
- package/src/components/ui/code.tsx +45 -0
- package/src/components/ui/collapsible.tsx +31 -0
- package/src/components/ui/command-palette.tsx +189 -0
- package/src/components/ui/command.tsx +138 -0
- package/src/components/ui/cookie-banner.tsx +220 -0
- package/src/components/ui/copy-button.tsx +60 -0
- package/src/components/ui/data-grid-column-filter.tsx +124 -0
- package/src/components/ui/data-grid-column-header.tsx +284 -0
- package/src/components/ui/data-grid-column-visibility.tsx +38 -0
- package/src/components/ui/data-grid-pagination.tsx +206 -0
- package/src/components/ui/data-grid-table-dnd-rows.tsx +147 -0
- package/src/components/ui/data-grid-table-dnd.tsx +175 -0
- package/src/components/ui/data-grid-table.tsx +500 -0
- package/src/components/ui/data-grid.tsx +193 -0
- package/src/components/ui/data-list.tsx +76 -0
- package/src/components/ui/datefield.tsx +91 -0
- package/src/components/ui/dialog.tsx +139 -0
- package/src/components/ui/divider.tsx +41 -0
- package/src/components/ui/drawer.tsx +59 -0
- package/src/components/ui/dropdown-menu.tsx +224 -0
- package/src/components/ui/empty-state.tsx +54 -0
- package/src/components/ui/file-upload.tsx +152 -0
- package/src/components/ui/form.tsx +88 -0
- package/src/components/ui/icon.tsx +14 -0
- package/src/components/ui/input-otp.tsx +71 -0
- package/src/components/ui/input.tsx +155 -0
- package/src/components/ui/kbd.tsx +26 -0
- package/src/components/ui/label.tsx +31 -0
- package/src/components/ui/navigation-menu.tsx +168 -0
- package/src/components/ui/pagination.tsx +37 -0
- package/src/components/ui/placeholder-pattern.tsx +21 -0
- package/src/components/ui/popover.tsx +50 -0
- package/src/components/ui/progress.tsx +65 -0
- package/src/components/ui/radio-group.tsx +73 -0
- package/src/components/ui/resizable.tsx +39 -0
- package/src/components/ui/scroll-area.tsx +50 -0
- package/src/components/ui/select.tsx +234 -0
- package/src/components/ui/separator.tsx +24 -0
- package/src/components/ui/sheet.tsx +147 -0
- package/src/components/ui/sidebar.tsx +721 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/slider.tsx +35 -0
- package/src/components/ui/sonner.tsx +28 -0
- package/src/components/ui/sortable.tsx +724 -0
- package/src/components/ui/spinner.tsx +17 -0
- package/src/components/ui/stat-card.tsx +82 -0
- package/src/components/ui/stepper.tsx +410 -0
- package/src/components/ui/switch.tsx +68 -0
- package/src/components/ui/table.tsx +42 -0
- package/src/components/ui/tabs.tsx +196 -0
- package/src/components/ui/timeline.tsx +90 -0
- package/src/components/ui/toggle-group.tsx +73 -0
- package/src/components/ui/toggle.tsx +45 -0
- package/src/components/ui/tooltip.tsx +55 -0
- package/src/components/user-info.tsx +33 -0
- package/src/components/user-menu-content.tsx +53 -0
- package/src/components/web/SiteFooter.tsx +154 -0
- package/src/components/web/SiteHeader.tsx +159 -0
- package/src/components/workflows/workflow-canvas.tsx +321 -0
- package/src/controls/Blockquote.tsx +25 -0
- package/src/controls/Button.tsx +101 -0
- package/src/controls/Checkbox.tsx +29 -0
- package/src/controls/DateField.tsx +37 -0
- package/src/controls/FormField.tsx +20 -0
- package/src/controls/Heading.tsx +28 -0
- package/src/controls/Input.tsx +21 -0
- package/src/controls/Label.tsx +18 -0
- package/src/controls/Paragraph.tsx +39 -0
- package/src/controls/PasswordInput.tsx +40 -0
- package/src/controls/RadioGroup.tsx +70 -0
- package/src/controls/Select.tsx +24 -0
- package/src/controls/Slider.tsx +33 -0
- package/src/controls/Switch.tsx +31 -0
- package/src/controls/Textarea.tsx +22 -0
- package/src/elements/ConfirmPasswordForm.tsx +43 -0
- package/src/elements/DeviceStatusBadge.tsx +38 -0
- package/src/elements/DriverCard.tsx +67 -0
- package/src/elements/ForgotPasswordForm.tsx +64 -0
- package/src/elements/IncidentCard.tsx +67 -0
- package/src/elements/LoginForm.tsx +100 -0
- package/src/elements/OtpForm.tsx +71 -0
- package/src/elements/RegisterForm.tsx +150 -0
- package/src/elements/ResetPasswordForm.tsx +72 -0
- package/src/elements/SmsChallengeForm.tsx +104 -0
- package/src/elements/VehicleCard.tsx +73 -0
- package/src/elements/VerifyEmailForm.tsx +39 -0
- package/src/hooks/use-appearance.tsx +117 -0
- package/src/hooks/use-applied-theme.ts +98 -0
- package/src/hooks/use-clipboard.ts +34 -0
- package/src/hooks/use-current-url.ts +83 -0
- package/src/hooks/use-dark-mode.ts +48 -0
- package/src/hooks/use-flash-toast.ts +29 -0
- package/src/hooks/use-initials.tsx +24 -0
- package/src/hooks/use-mobile-navigation.ts +12 -0
- package/src/hooks/use-mobile.tsx +38 -0
- package/src/index.ts +408 -0
- package/src/layouts/AppLayout.tsx +60 -0
- package/src/layouts/AuthLayout.tsx +32 -0
- package/src/layouts/SettingsLayout.tsx +21 -0
- package/src/layouts/app/AIChatLayout.tsx +73 -0
- package/src/layouts/app/AsideSidebarLayout.tsx +3 -0
- package/src/layouts/app/CalendarSidebarLayout.tsx +69 -0
- package/src/layouts/app/CommunitiesNavbarLayout.tsx +3 -0
- package/src/layouts/app/DualNavbarSidebarLayout.tsx +3 -0
- package/src/layouts/app/FocusSidebarLayout.tsx +75 -0
- package/src/layouts/app/MailLayout.tsx +69 -0
- package/src/layouts/app/MegaMenuHeaderLayout.tsx +3 -0
- package/src/layouts/app/MegaMenuLayout.tsx +81 -0
- package/src/layouts/app/MegaMenuNavbarLayout.tsx +88 -0
- package/src/layouts/app/MegaMenuSearchNavbarLayout.tsx +3 -0
- package/src/layouts/app/NavbarCollapsibleLayout.tsx +88 -0
- package/src/layouts/app/NavbarCollapsibleLinksLayout.tsx +3 -0
- package/src/layouts/app/NavbarMinimalLayout.tsx +3 -0
- package/src/layouts/app/NavbarMinimalSidebarLayout.tsx +3 -0
- package/src/layouts/app/NavbarSidebarDashboardLayout.tsx +3 -0
- package/src/layouts/app/NavbarSidebarLayout.tsx +92 -0
- package/src/layouts/app/NavbarSimpleSidebarLayout.tsx +3 -0
- package/src/layouts/app/NavbarTitledSidebarLayout.tsx +3 -0
- package/src/layouts/app/PanelSidebarLayout.tsx +3 -0
- package/src/layouts/app/SearchNavbarSidebarLayout.tsx +3 -0
- package/src/layouts/app/SidebarBreadcrumbLayout.tsx +3 -0
- package/src/layouts/app/SidebarCleanLayout.tsx +3 -0
- package/src/layouts/app/SidebarCommunitiesLayout.tsx +3 -0
- package/src/layouts/app/SidebarContentLayout.tsx +3 -0
- package/src/layouts/app/SidebarDualMenuLayout.tsx +104 -0
- package/src/layouts/app/SidebarFixedLayout.tsx +166 -0
- package/src/layouts/app/SidebarFooterNavbarLayout.tsx +3 -0
- package/src/layouts/app/SidebarHeaderMenuLayout.tsx +3 -0
- package/src/layouts/app/SidebarMegaMenuLayout.tsx +4 -0
- package/src/layouts/app/SidebarMinimalLayout.tsx +70 -0
- package/src/layouts/app/SidebarMobileSearchLayout.tsx +3 -0
- package/src/layouts/app/SidebarMultiPanelLayout.tsx +3 -0
- package/src/layouts/app/SidebarPrimarySecondaryLayout.tsx +3 -0
- package/src/layouts/app/SidebarSearchHeaderLayout.tsx +103 -0
- package/src/layouts/app/SidebarSearchToolbarLayout.tsx +3 -0
- package/src/layouts/app/SidebarTabsDualLayout.tsx +3 -0
- package/src/layouts/app/SidebarTabsLayout.tsx +98 -0
- package/src/layouts/app/SidebarTreeLayout.tsx +3 -0
- package/src/layouts/app/SplitNavbarLayout.tsx +3 -0
- package/src/layouts/app/SplitSidebarDashboardLayout.tsx +3 -0
- package/src/layouts/app/SplitSidebarLayout.tsx +99 -0
- package/src/layouts/app/TopNavLayout.tsx +105 -0
- package/src/layouts/app/TopNavLinksLayout.tsx +3 -0
- package/src/layouts/app/WorkspaceBreadcrumbLayout.tsx +3 -0
- package/src/layouts/app/WorkspaceCommunitiesLayout.tsx +3 -0
- package/src/layouts/app/WorkspaceNavbarLayout.tsx +3 -0
- package/src/layouts/app/WorkspaceSidebarLayout.tsx +98 -0
- package/src/layouts/app/WorkspaceSidebarTitleLayout.tsx +3 -0
- package/src/layouts/app/app-header-layout.tsx +45 -0
- package/src/layouts/app/app-sidebar-layout.tsx +56 -0
- package/src/layouts/app/layout-context.tsx +44 -0
- package/src/layouts/app/layout-types.ts +47 -0
- package/src/layouts/app/partials/Footer.tsx +35 -0
- package/src/layouts/app/partials/HeaderTopbar.tsx +96 -0
- package/src/layouts/app/partials/Navbar.tsx +85 -0
- package/src/layouts/app/partials/Toolbar.tsx +47 -0
- package/src/layouts/app-layout.tsx +29 -0
- package/src/layouts/auth/AuthBrandedLayout.tsx +58 -0
- package/src/layouts/auth/AuthCardLayout.tsx +31 -0
- package/src/layouts/auth/AuthCenteredLayout.tsx +41 -0
- package/src/layouts/auth/AuthClassicLayout.tsx +41 -0
- package/src/layouts/auth/AuthSimpleLayout.tsx +33 -0
- package/src/layouts/auth/AuthSplitLayout.tsx +89 -0
- package/src/layouts/web-app-layout.tsx +162 -0
- package/src/layouts/web-layout.tsx +23 -0
- package/src/lib/datetime.ts +188 -0
- package/src/lib/google-maps-loader.ts +99 -0
- package/src/lib/location.ts +127 -0
- package/src/lib/lucide-icon-map.ts +132 -0
- package/src/lib/map-markers.ts +124 -0
- package/src/lib/map-styles.ts +351 -0
- package/src/lib/utils.ts +11 -0
- package/src/platform/adapters/default.tsx +156 -0
- package/src/platform/adapters/inertia.tsx +88 -0
- package/src/platform/adapters/nextjs.ts +86 -0
- package/src/platform/context.tsx +106 -0
- package/src/platform/index.ts +27 -0
- package/src/platform/types.ts +105 -0
- package/src/styles/layouts/sidebar-fixed.css +161 -0
- package/src/styles/themes.css +583 -0
- package/src/types/assets.d.ts +5 -0
- package/src/types/auth.ts +25 -0
- package/src/types/global.d.ts +13 -0
- package/src/types/index.ts +9 -0
- package/src/types/navigation.ts +15 -0
- package/src/types/ui.ts +32 -0
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { ChevronDown, LucideIcon } from 'lucide-react';
|
|
4
|
+
import { Slot as SlotPrimitive } from '@radix-ui/react-slot';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva(
|
|
8
|
+
'cursor-pointer group whitespace-nowrap focus-visible:outline-hidden inline-flex items-center justify-center has-data-[arrow=true]:justify-between whitespace-nowrap text-sm font-medium ring-offset-background transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-60 [&_svg]:shrink-0',
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
primary: 'bg-primary text-primary-foreground hover:bg-primary/90 data-[state=open]:bg-primary/90',
|
|
13
|
+
mono: 'bg-zinc-950 text-white dark:bg-zinc-300 dark:text-black hover:bg-zinc-950/90 dark:hover:bg-zinc-300/90 data-[state=open]:bg-zinc-950/90 dark:data-[state=open]:bg-zinc-300/90',
|
|
14
|
+
destructive:
|
|
15
|
+
'bg-destructive text-destructive-foreground hover:bg-destructive/90 data-[state=open]:bg-destructive/90',
|
|
16
|
+
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/90 data-[state=open]:bg-secondary/90',
|
|
17
|
+
outline: 'bg-background text-accent-foreground border border-input hover:bg-accent data-[state=open]:bg-accent',
|
|
18
|
+
dashed:
|
|
19
|
+
'text-accent-foreground border border-input border-dashed bg-background hover:bg-accent hover:text-accent-foreground data-[state=open]:text-accent-foreground',
|
|
20
|
+
ghost:
|
|
21
|
+
'text-accent-foreground hover:bg-accent hover:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
|
|
22
|
+
dim: 'text-muted-foreground hover:text-foreground data-[state=open]:text-foreground',
|
|
23
|
+
foreground: '',
|
|
24
|
+
inverse: '',
|
|
25
|
+
},
|
|
26
|
+
appearance: {
|
|
27
|
+
default: '',
|
|
28
|
+
ghost: '',
|
|
29
|
+
},
|
|
30
|
+
underline: {
|
|
31
|
+
solid: '',
|
|
32
|
+
dashed: '',
|
|
33
|
+
},
|
|
34
|
+
underlined: {
|
|
35
|
+
solid: '',
|
|
36
|
+
dashed: '',
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
lg: 'h-10 rounded-md px-4 text-sm gap-1.5 [&_svg:not([class*=size-])]:size-4',
|
|
40
|
+
md: 'h-8.5 rounded-md px-3 gap-1.5 text-[0.8125rem] leading-(--text-sm--line-height) [&_svg:not([class*=size-])]:size-4',
|
|
41
|
+
sm: 'h-7 rounded-md px-2.5 gap-1.25 text-xs [&_svg:not([class*=size-])]:size-3.5',
|
|
42
|
+
icon: 'size-8.5 rounded-md [&_svg:not([class*=size-])]:size-4 shrink-0',
|
|
43
|
+
},
|
|
44
|
+
autoHeight: {
|
|
45
|
+
true: '',
|
|
46
|
+
false: '',
|
|
47
|
+
},
|
|
48
|
+
shape: {
|
|
49
|
+
default: '',
|
|
50
|
+
circle: 'rounded-full',
|
|
51
|
+
},
|
|
52
|
+
mode: {
|
|
53
|
+
default: 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
54
|
+
icon: 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 shrink-0',
|
|
55
|
+
link: 'text-primary h-auto p-0 bg-transparent rounded-none hover:bg-transparent data-[state=open]:bg-transparent',
|
|
56
|
+
input: `
|
|
57
|
+
justify-start font-normal hover:bg-background [&_svg]:transition-colors [&_svg]:hover:text-foreground data-[state=open]:bg-background
|
|
58
|
+
focus-visible:border-ring focus-visible:outline-hidden focus-visible:ring-[3px] focus-visible:ring-ring/30
|
|
59
|
+
[[data-state=open]>&]:border-ring [[data-state=open]>&]:outline-hidden [[data-state=open]>&]:ring-[3px]
|
|
60
|
+
[[data-state=open]>&]:ring-ring/30
|
|
61
|
+
aria-invalid:border-destructive/60 aria-invalid:ring-destructive/10 dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/20
|
|
62
|
+
in-data-[invalid=true]:border-destructive/60 in-data-[invalid=true]:ring-destructive/10 dark:in-data-[invalid=true]:border-destructive dark:in-data-[invalid=true]:ring-destructive/20
|
|
63
|
+
`,
|
|
64
|
+
},
|
|
65
|
+
placeholder: {
|
|
66
|
+
true: 'text-muted-foreground',
|
|
67
|
+
false: '',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
compoundVariants: [
|
|
71
|
+
// Icons opacity for default mode
|
|
72
|
+
{
|
|
73
|
+
variant: 'ghost',
|
|
74
|
+
mode: 'default',
|
|
75
|
+
className: '[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
variant: 'outline',
|
|
79
|
+
mode: 'default',
|
|
80
|
+
className: '[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
variant: 'dashed',
|
|
84
|
+
mode: 'default',
|
|
85
|
+
className: '[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
variant: 'secondary',
|
|
89
|
+
mode: 'default',
|
|
90
|
+
className: '[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60',
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
// Icons opacity for default mode
|
|
94
|
+
{
|
|
95
|
+
variant: 'outline',
|
|
96
|
+
mode: 'input',
|
|
97
|
+
className: '[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
variant: 'outline',
|
|
101
|
+
mode: 'icon',
|
|
102
|
+
className: '[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60',
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
// Auto height
|
|
106
|
+
{
|
|
107
|
+
size: 'md',
|
|
108
|
+
autoHeight: true,
|
|
109
|
+
className: 'h-auto min-h-8.5',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
size: 'sm',
|
|
113
|
+
autoHeight: true,
|
|
114
|
+
className: 'h-auto min-h-7',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
size: 'lg',
|
|
118
|
+
autoHeight: true,
|
|
119
|
+
className: 'h-auto min-h-10',
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
// Shadow support
|
|
123
|
+
{
|
|
124
|
+
variant: 'primary',
|
|
125
|
+
mode: 'default',
|
|
126
|
+
appearance: 'default',
|
|
127
|
+
className: 'shadow-xs shadow-black/5',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
variant: 'mono',
|
|
131
|
+
mode: 'default',
|
|
132
|
+
appearance: 'default',
|
|
133
|
+
className: 'shadow-xs shadow-black/5',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
variant: 'secondary',
|
|
137
|
+
mode: 'default',
|
|
138
|
+
appearance: 'default',
|
|
139
|
+
className: 'shadow-xs shadow-black/5',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
variant: 'outline',
|
|
143
|
+
mode: 'default',
|
|
144
|
+
appearance: 'default',
|
|
145
|
+
className: 'shadow-xs shadow-black/5',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
variant: 'dashed',
|
|
149
|
+
mode: 'default',
|
|
150
|
+
appearance: 'default',
|
|
151
|
+
className: 'shadow-xs shadow-black/5',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
variant: 'destructive',
|
|
155
|
+
mode: 'default',
|
|
156
|
+
appearance: 'default',
|
|
157
|
+
className: 'shadow-xs shadow-black/5',
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
// Shadow support
|
|
161
|
+
{
|
|
162
|
+
variant: 'primary',
|
|
163
|
+
mode: 'icon',
|
|
164
|
+
appearance: 'default',
|
|
165
|
+
className: 'shadow-xs shadow-black/5',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
variant: 'mono',
|
|
169
|
+
mode: 'icon',
|
|
170
|
+
appearance: 'default',
|
|
171
|
+
className: 'shadow-xs shadow-black/5',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
variant: 'secondary',
|
|
175
|
+
mode: 'icon',
|
|
176
|
+
appearance: 'default',
|
|
177
|
+
className: 'shadow-xs shadow-black/5',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
variant: 'outline',
|
|
181
|
+
mode: 'icon',
|
|
182
|
+
appearance: 'default',
|
|
183
|
+
className: 'shadow-xs shadow-black/5',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
variant: 'dashed',
|
|
187
|
+
mode: 'icon',
|
|
188
|
+
appearance: 'default',
|
|
189
|
+
className: 'shadow-xs shadow-black/5',
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
variant: 'destructive',
|
|
193
|
+
mode: 'icon',
|
|
194
|
+
appearance: 'default',
|
|
195
|
+
className: 'shadow-xs shadow-black/5',
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
// Link
|
|
199
|
+
{
|
|
200
|
+
variant: 'primary',
|
|
201
|
+
mode: 'link',
|
|
202
|
+
underline: 'solid',
|
|
203
|
+
className:
|
|
204
|
+
'font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
variant: 'primary',
|
|
208
|
+
mode: 'link',
|
|
209
|
+
underline: 'dashed',
|
|
210
|
+
className:
|
|
211
|
+
'font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1',
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
variant: 'primary',
|
|
215
|
+
mode: 'link',
|
|
216
|
+
underlined: 'solid',
|
|
217
|
+
className:
|
|
218
|
+
'font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
variant: 'primary',
|
|
222
|
+
mode: 'link',
|
|
223
|
+
underlined: 'dashed',
|
|
224
|
+
className:
|
|
225
|
+
'font-medium text-primary hover:text-primary/90 [&_svg]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1',
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
{
|
|
229
|
+
variant: 'inverse',
|
|
230
|
+
mode: 'link',
|
|
231
|
+
underline: 'solid',
|
|
232
|
+
className:
|
|
233
|
+
'font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid',
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
variant: 'inverse',
|
|
237
|
+
mode: 'link',
|
|
238
|
+
underline: 'dashed',
|
|
239
|
+
className:
|
|
240
|
+
'font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
variant: 'inverse',
|
|
244
|
+
mode: 'link',
|
|
245
|
+
underlined: 'solid',
|
|
246
|
+
className:
|
|
247
|
+
'font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
variant: 'inverse',
|
|
251
|
+
mode: 'link',
|
|
252
|
+
underlined: 'dashed',
|
|
253
|
+
className:
|
|
254
|
+
'font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1',
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
{
|
|
258
|
+
variant: 'foreground',
|
|
259
|
+
mode: 'link',
|
|
260
|
+
underline: 'solid',
|
|
261
|
+
className:
|
|
262
|
+
'font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid',
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
variant: 'foreground',
|
|
266
|
+
mode: 'link',
|
|
267
|
+
underline: 'dashed',
|
|
268
|
+
className:
|
|
269
|
+
'font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1',
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
variant: 'foreground',
|
|
273
|
+
mode: 'link',
|
|
274
|
+
underlined: 'solid',
|
|
275
|
+
className:
|
|
276
|
+
'font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid',
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
variant: 'foreground',
|
|
280
|
+
mode: 'link',
|
|
281
|
+
underlined: 'dashed',
|
|
282
|
+
className:
|
|
283
|
+
'font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1',
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
// Ghost
|
|
287
|
+
{
|
|
288
|
+
variant: 'primary',
|
|
289
|
+
appearance: 'ghost',
|
|
290
|
+
className: 'bg-transparent text-primary/90 hover:bg-primary/5 data-[state=open]:bg-primary/5',
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
variant: 'destructive',
|
|
294
|
+
appearance: 'ghost',
|
|
295
|
+
className: 'bg-transparent text-destructive/90 hover:bg-destructive/5 data-[state=open]:bg-destructive/5',
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
variant: 'ghost',
|
|
299
|
+
mode: 'icon',
|
|
300
|
+
className: 'text-muted-foreground',
|
|
301
|
+
},
|
|
302
|
+
|
|
303
|
+
// Size
|
|
304
|
+
{
|
|
305
|
+
size: 'sm',
|
|
306
|
+
mode: 'icon',
|
|
307
|
+
className: 'w-7 h-7 p-0 [[&_svg:not([class*=size-])]:size-3.5',
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
size: 'md',
|
|
311
|
+
mode: 'icon',
|
|
312
|
+
className: 'w-8.5 h-8.5 p-0 [&_svg:not([class*=size-])]:size-4',
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
size: 'icon',
|
|
316
|
+
className: 'w-8.5 h-8.5 p-0 [&_svg:not([class*=size-])]:size-4',
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
size: 'lg',
|
|
320
|
+
mode: 'icon',
|
|
321
|
+
className: 'w-10 h-10 p-0 [&_svg:not([class*=size-])]:size-4',
|
|
322
|
+
},
|
|
323
|
+
|
|
324
|
+
// Input mode
|
|
325
|
+
{
|
|
326
|
+
mode: 'input',
|
|
327
|
+
placeholder: true,
|
|
328
|
+
variant: 'outline',
|
|
329
|
+
className: 'font-normal text-muted-foreground',
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
mode: 'input',
|
|
333
|
+
variant: 'outline',
|
|
334
|
+
size: 'sm',
|
|
335
|
+
className: 'gap-1.25',
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
mode: 'input',
|
|
339
|
+
variant: 'outline',
|
|
340
|
+
size: 'md',
|
|
341
|
+
className: 'gap-1.5',
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
mode: 'input',
|
|
345
|
+
variant: 'outline',
|
|
346
|
+
size: 'lg',
|
|
347
|
+
className: 'gap-1.5',
|
|
348
|
+
},
|
|
349
|
+
],
|
|
350
|
+
defaultVariants: {
|
|
351
|
+
variant: 'primary',
|
|
352
|
+
mode: 'default',
|
|
353
|
+
size: 'md',
|
|
354
|
+
shape: 'default',
|
|
355
|
+
appearance: 'default',
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
);
|
|
359
|
+
|
|
360
|
+
function Button({
|
|
361
|
+
className,
|
|
362
|
+
selected,
|
|
363
|
+
variant,
|
|
364
|
+
shape,
|
|
365
|
+
appearance,
|
|
366
|
+
mode,
|
|
367
|
+
size,
|
|
368
|
+
autoHeight,
|
|
369
|
+
underlined,
|
|
370
|
+
underline,
|
|
371
|
+
asChild = false,
|
|
372
|
+
placeholder = false,
|
|
373
|
+
...props
|
|
374
|
+
}: React.ComponentProps<'button'> &
|
|
375
|
+
VariantProps<typeof buttonVariants> & {
|
|
376
|
+
selected?: boolean;
|
|
377
|
+
asChild?: boolean;
|
|
378
|
+
}) {
|
|
379
|
+
const Comp = asChild ? SlotPrimitive : 'button';
|
|
380
|
+
return (
|
|
381
|
+
<Comp
|
|
382
|
+
data-slot="button"
|
|
383
|
+
className={cn(
|
|
384
|
+
buttonVariants({
|
|
385
|
+
variant,
|
|
386
|
+
size,
|
|
387
|
+
shape,
|
|
388
|
+
appearance,
|
|
389
|
+
mode,
|
|
390
|
+
autoHeight,
|
|
391
|
+
placeholder,
|
|
392
|
+
underlined,
|
|
393
|
+
underline,
|
|
394
|
+
className,
|
|
395
|
+
}),
|
|
396
|
+
asChild && props.disabled && 'pointer-events-none opacity-50',
|
|
397
|
+
)}
|
|
398
|
+
{...(selected && { 'data-state': 'open' })}
|
|
399
|
+
{...props}
|
|
400
|
+
/>
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
interface ButtonArrowProps extends React.SVGProps<SVGSVGElement> {
|
|
405
|
+
icon?: LucideIcon; // Allows passing any Lucide icon
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
function ButtonArrow({ icon: Icon = ChevronDown, className, ...props }: ButtonArrowProps) {
|
|
409
|
+
return <Icon data-slot="button-arrow" className={cn('ms-auto -me-1', className)} {...props} />;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export { Button, ButtonArrow, buttonVariants };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
import { buttonVariants } from '../../controls/Button';
|
|
6
|
+
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
|
7
|
+
import { DayPicker } from 'react-day-picker';
|
|
8
|
+
|
|
9
|
+
function Calendar({ className, classNames, showOutsideDays = true, ...props }: React.ComponentProps<typeof DayPicker>) {
|
|
10
|
+
return (
|
|
11
|
+
<DayPicker
|
|
12
|
+
showOutsideDays={showOutsideDays}
|
|
13
|
+
className={cn('p-3', className)}
|
|
14
|
+
classNames={{
|
|
15
|
+
months: 'relative flex flex-col sm:flex-row gap-4',
|
|
16
|
+
month: 'w-full',
|
|
17
|
+
month_caption: 'relative mx-10 mb-1 flex h-8 items-center justify-center z-20',
|
|
18
|
+
caption_label: 'text-sm font-medium',
|
|
19
|
+
nav: 'absolute top-0 flex w-full justify-between z-10',
|
|
20
|
+
button_previous: cn(
|
|
21
|
+
buttonVariants({ variant: 'ghost' }),
|
|
22
|
+
'size-8 text-muted-foreground/80 hover:text-foreground p-0',
|
|
23
|
+
),
|
|
24
|
+
button_next: cn(
|
|
25
|
+
buttonVariants({ variant: 'ghost' }),
|
|
26
|
+
'size-8 text-muted-foreground/80 hover:text-foreground p-0',
|
|
27
|
+
),
|
|
28
|
+
weekday: 'size-8 p-0 text-xs font-medium text-muted-foreground/80',
|
|
29
|
+
day_button:
|
|
30
|
+
'cursor-pointer relative flex size-8 items-center justify-center whitespace-nowrap rounded-md p-0 text-foreground transition-200 group-[[data-selected]:not(.range-middle)]:[transition-property:color,background-color,border-radius,box-shadow] group-[[data-selected]:not(.range-middle)]:duration-150 group-data-disabled:pointer-events-none focus-visible:z-10 hover:not-in-data-selected:bg-accent group-data-selected:bg-primary hover:not-in-data-selected:text-foreground group-data-selected:text-primary-foreground group-data-disabled:text-foreground/30 group-data-disabled:line-through group-data-outside:text-foreground/30 group-data-selected:group-data-outside:text-primary-foreground outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px] group-[.range-start:not(.range-end)]:rounded-e-none group-[.range-end:not(.range-start)]:rounded-s-none group-[.range-middle]:rounded-none group-[.range-middle]:group-data-selected:bg-accent group-[.range-middle]:group-data-selected:text-foreground',
|
|
31
|
+
day: 'group size-8 px-0 py-px text-sm',
|
|
32
|
+
range_start: 'range-start',
|
|
33
|
+
range_end: 'range-end',
|
|
34
|
+
range_middle: 'range-middle',
|
|
35
|
+
today:
|
|
36
|
+
'*:after:pointer-events-none *:after:absolute *:after:bottom-1 *:after:start-1/2 *:after:z-10 *:after:size-[3px] *:after:-translate-x-1/2 rtl:*:after:translate-x-1/2 *:after:rounded-full *:after:bg-primary [&[data-selected]:not(.range-middle)>*]:after:bg-background [&[data-disabled]>*]:after:bg-foreground/30 *:after:transition-colors',
|
|
37
|
+
outside: 'text-muted-foreground data-selected:bg-accent/50 data-selected:text-muted-foreground',
|
|
38
|
+
hidden: 'invisible',
|
|
39
|
+
week_number: 'size-8 p-0 text-xs font-medium text-muted-foreground/80',
|
|
40
|
+
...classNames,
|
|
41
|
+
}}
|
|
42
|
+
components={{
|
|
43
|
+
Chevron: (props) => {
|
|
44
|
+
if (props.orientation === 'left') {
|
|
45
|
+
return <ChevronLeft className="h-4 w-4 rtl:rotate-180" />;
|
|
46
|
+
} else {
|
|
47
|
+
return <ChevronRight className="h-4 w-4 rtl:rotate-180" />;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
}}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { Calendar };
|
|
@@ -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
|
+
|
|
7
|
+
// Define CardContext
|
|
8
|
+
type CardContextType = {
|
|
9
|
+
variant: 'default' | 'accent';
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const CardContext = React.createContext<CardContextType>({
|
|
13
|
+
variant: 'default', // Default value
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// Hook to use CardContext
|
|
17
|
+
const useCardContext = () => {
|
|
18
|
+
const context = React.useContext(CardContext);
|
|
19
|
+
if (!context) {
|
|
20
|
+
throw new Error('useCardContext must be used within a Card component');
|
|
21
|
+
}
|
|
22
|
+
return context;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// Variants
|
|
26
|
+
const cardVariants = cva('flex flex-col items-stretch text-card-foreground rounded-xl', {
|
|
27
|
+
variants: {
|
|
28
|
+
variant: {
|
|
29
|
+
default: 'bg-card border border-border shadow-xs black/5',
|
|
30
|
+
accent: 'bg-muted shadow-xs p-1',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
variant: 'default',
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const cardHeaderVariants = cva('flex items-center justify-between flex-wrap px-5 min-h-14 gap-2.5', {
|
|
39
|
+
variants: {
|
|
40
|
+
variant: {
|
|
41
|
+
default: 'border-b border-border',
|
|
42
|
+
accent: '',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
variant: 'default',
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const cardContentVariants = cva('grow p-5', {
|
|
51
|
+
variants: {
|
|
52
|
+
variant: {
|
|
53
|
+
default: '',
|
|
54
|
+
accent: 'bg-card rounded-t-xl [&:last-child]:rounded-b-xl',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
defaultVariants: {
|
|
58
|
+
variant: 'default',
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const cardTableVariants = cva('grid grow', {
|
|
63
|
+
variants: {
|
|
64
|
+
variant: {
|
|
65
|
+
default: '',
|
|
66
|
+
accent: 'bg-card rounded-xl',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
defaultVariants: {
|
|
70
|
+
variant: 'default',
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const cardFooterVariants = cva('flex items-center px-5 min-h-14', {
|
|
75
|
+
variants: {
|
|
76
|
+
variant: {
|
|
77
|
+
default: 'border-t border-border',
|
|
78
|
+
accent: 'bg-card rounded-b-xl mt-[2px]',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
defaultVariants: {
|
|
82
|
+
variant: 'default',
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// Card Component
|
|
87
|
+
function Card({
|
|
88
|
+
className,
|
|
89
|
+
variant = 'default',
|
|
90
|
+
...props
|
|
91
|
+
}: React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof cardVariants>) {
|
|
92
|
+
return (
|
|
93
|
+
<CardContext.Provider value={{ variant: variant || 'default' }}>
|
|
94
|
+
<div data-slot="card" className={cn(cardVariants({ variant }), className)} {...props} />
|
|
95
|
+
</CardContext.Provider>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// CardHeader Component
|
|
100
|
+
function CardHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
|
|
101
|
+
const { variant } = useCardContext();
|
|
102
|
+
return <div data-slot="card-header" className={cn(cardHeaderVariants({ variant }), className)} {...props} />;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// CardContent Component
|
|
106
|
+
function CardContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
|
|
107
|
+
const { variant } = useCardContext();
|
|
108
|
+
return <div data-slot="card-content" className={cn(cardContentVariants({ variant }), className)} {...props} />;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// CardTable Component
|
|
112
|
+
function CardTable({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
|
|
113
|
+
const { variant } = useCardContext();
|
|
114
|
+
return <div data-slot="card-table" className={cn(cardTableVariants({ variant }), className)} {...props} />;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// CardFooter Component
|
|
118
|
+
function CardFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
|
|
119
|
+
const { variant } = useCardContext();
|
|
120
|
+
return <div data-slot="card-footer" className={cn(cardFooterVariants({ variant }), className)} {...props} />;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Other Components
|
|
124
|
+
function CardHeading({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
|
|
125
|
+
return <div data-slot="card-heading" className={cn('space-y-1', className)} {...props} />;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function CardToolbar({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
|
|
129
|
+
return <div data-slot="card-toolbar" className={cn('flex items-center gap-2.5', className)} {...props} />;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function CardTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>) {
|
|
133
|
+
return (
|
|
134
|
+
<h3
|
|
135
|
+
data-slot="card-title"
|
|
136
|
+
className={cn('text-base font-semibold leading-none tracking-tight', className)}
|
|
137
|
+
{...props}
|
|
138
|
+
/>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function CardDescription({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
|
|
143
|
+
return <div data-slot="card-description" className={cn('text-sm text-muted-foreground', className)} {...props} />;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Exports
|
|
147
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardHeading, CardTable, CardTitle, CardToolbar };
|