@devvistatech/devvista-kit 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/LICENSE +7 -0
- package/README.md +15 -0
- package/app/about/page.tsx +306 -0
- package/app/adRequest/page.tsx +550 -0
- package/app/analytics/page.tsx +347 -0
- package/app/api/about/route.ts +307 -0
- package/app/api/adRequest/route.ts +568 -0
- package/app/api/analytics/[reportType]/route.ts +338 -0
- package/app/api/bio/route.ts +314 -0
- package/app/api/blog/route.ts +307 -0
- package/app/api/chat/route.ts +15 -0
- package/app/api/contact/route.ts +410 -0
- package/app/api/contacts/route.ts +225 -0
- package/app/api/files/route.ts +430 -0
- package/app/api/gallery-data/route.ts +661 -0
- package/app/api/schedule/route.ts +456 -0
- package/app/api/sync-user/route.ts +114 -0
- package/app/api/trial-request/route.ts +298 -0
- package/app/blog/[id]/page.tsx +281 -0
- package/app/blog/page.tsx +217 -0
- package/app/constants/about.ts +49 -0
- package/app/constants/adRequest.ts +114 -0
- package/app/constants/contact.ts +41 -0
- package/app/constants/faq.ts +46 -0
- package/app/constants/gallery.ts +43 -0
- package/app/constants/page.ts +70 -0
- package/app/constants/schedule.ts +72 -0
- package/app/contact/page.tsx +285 -0
- package/app/faq/page.tsx +192 -0
- package/app/favicon.ico +0 -0
- package/app/gallery/page.tsx +320 -0
- package/app/globals.css +58 -0
- package/app/layout.tsx +62 -0
- package/app/page.tsx +339 -0
- package/app/schedule/page.tsx +661 -0
- package/bin/init.js +187 -0
- package/components/addOns/functional/BioEditor.tsx +430 -0
- package/components/addOns/functional/CalendlyWidget.tsx +101 -0
- package/components/addOns/functional/ClassList.tsx +146 -0
- package/components/addOns/functional/ClassPopup.tsx +399 -0
- package/components/addOns/functional/ContactForm.tsx +285 -0
- package/components/addOns/functional/FileUploader.tsx +293 -0
- package/components/addOns/functional/ImageDescCarousel.tsx +821 -0
- package/components/addOns/functional/NewUserAnalytics.tsx +101 -0
- package/components/addOns/functional/ScheduleCarousel.tsx +172 -0
- package/components/addOns/functional/aboutSections/AboutSection.tsx +571 -0
- package/components/addOns/functional/aboutSections/constants/aboutSection.ts +66 -0
- package/components/addOns/functional/blogSections/BlogDashboard.tsx +185 -0
- package/components/addOns/functional/blogSections/BlogFormPopUp.tsx +555 -0
- package/components/addOns/functional/blogSections/BlogList.tsx +149 -0
- package/components/addOns/functional/blogSections/BlogSidebar.tsx +59 -0
- package/components/addOns/functional/blogSections/constants/blogDashboard.ts +29 -0
- package/components/addOns/functional/blogSections/constants/blogFormPopUp.ts +98 -0
- package/components/addOns/functional/blogSections/constants/blogList.ts +23 -0
- package/components/addOns/functional/blogSections/constants/blogSidebar.ts +16 -0
- package/components/addOns/functional/contactsDashboard/ContactsDashboard.tsx +348 -0
- package/components/addOns/functional/contactsDashboard/constants/contactsDashboard.ts +71 -0
- package/components/addOns/functional/galleries/GalleryComplex.tsx +908 -0
- package/components/addOns/functional/galleries/GallerySimple.tsx +604 -0
- package/components/addOns/functional/galleries/constants/galleryComplex.ts +105 -0
- package/components/addOns/functional/galleries/constants/gallerySimple.ts +75 -0
- package/components/addOns/functional/schedules/ScheduleGridOne.tsx +263 -0
- package/components/addOns/functional/schedules/ScheduleGridTwo.tsx +295 -0
- package/components/addOns/functional/schedules/ScheduleGridTwoBasic.tsx +289 -0
- package/components/addOns/functional/schedules/SchedulerForm.tsx +429 -0
- package/components/addOns/functional/schedules/constants/ScheduleGridTwo.ts +41 -0
- package/components/addOns/functional/schedules/constants/ScheduleGridTwoBasic.ts +41 -0
- package/components/addOns/functional/schedules/constants/SchedulerForm.ts +66 -0
- package/components/addOns/functional/schedules/constants/scheduleGridOne.ts +55 -0
- package/components/addOns/non-functional/AnnouncementBanner.tsx +47 -0
- package/components/addOns/non-functional/FeaturesSection.tsx +63 -0
- package/components/addOns/non-functional/HeroSection.tsx +143 -0
- package/components/addOns/non-functional/IconBubble.tsx +50 -0
- package/components/addOns/non-functional/SampleCarousel.tsx +205 -0
- package/components/addOns/non-functional/Testimonials.tsx +336 -0
- package/components/addOns/non-functional/ThreeSetGallery.tsx +64 -0
- package/components/addOns/non-functional/aboutSections/AboutSection.tsx +63 -0
- package/components/addOns/non-functional/aboutSections/constants/aboutSection.ts +25 -0
- package/components/addOns/non-functional/imageCarousels/ProductSlider.tsx +118 -0
- package/components/addOns/non-functional/imageCarousels/ProgramCarousel.tsx +233 -0
- package/components/addOns/non-functional/imageCarousels/constants/programCarousel.ts +40 -0
- package/components/addOns/non-functional/imageCarousels/constants/programSlider.ts +37 -0
- package/components/addOns/non-functional/spinner.tsx +22 -0
- package/components/footers/footer.tsx +454 -0
- package/components/navBars/navbar.tsx +311 -0
- package/components/other/accordion.tsx +58 -0
- package/components/other/admin-menu.tsx +69 -0
- package/components/other/alert-dialog.tsx +141 -0
- package/components/other/alert.tsx +59 -0
- package/components/other/aspect-ratio.tsx +7 -0
- package/components/other/avatar.tsx +50 -0
- package/components/other/badge.tsx +36 -0
- package/components/other/breadcrumb.tsx +115 -0
- package/components/other/button.tsx +733 -0
- package/components/other/calendar.tsx +66 -0
- package/components/other/card.tsx +86 -0
- package/components/other/carousel.tsx +275 -0
- package/components/other/chart.tsx +363 -0
- package/components/other/checkbox.tsx +30 -0
- package/components/other/collapsible.tsx +11 -0
- package/components/other/command.tsx +155 -0
- package/components/other/context-menu.tsx +200 -0
- package/components/other/dialog.tsx +122 -0
- package/components/other/drawer.tsx +118 -0
- package/components/other/dropdown-menu.tsx +200 -0
- package/components/other/form.tsx +179 -0
- package/components/other/hover-card.tsx +29 -0
- package/components/other/input-otp.tsx +71 -0
- package/components/other/input.tsx +25 -0
- package/components/other/label.tsx +26 -0
- package/components/other/login-popup.tsx +0 -0
- package/components/other/menubar.tsx +236 -0
- package/components/other/mobile-icon.tsx +22 -0
- package/components/other/navigation-menu.tsx +128 -0
- package/components/other/pagination.tsx +117 -0
- package/components/other/popover.tsx +31 -0
- package/components/other/progress.tsx +28 -0
- package/components/other/radio-group.tsx +44 -0
- package/components/other/resizable.tsx +45 -0
- package/components/other/scroll-area.tsx +48 -0
- package/components/other/select.tsx +160 -0
- package/components/other/separator.tsx +31 -0
- package/components/other/sheet.tsx +140 -0
- package/components/other/signup-popup.tsx +0 -0
- package/components/other/skeleton.tsx +15 -0
- package/components/other/slider.tsx +28 -0
- package/components/other/social-icons.tsx +40 -0
- package/components/other/sonner.tsx +31 -0
- package/components/other/switch.tsx +29 -0
- package/components/other/table.tsx +117 -0
- package/components/other/tabs.tsx +55 -0
- package/components/other/textarea.tsx +24 -0
- package/components/other/toast.tsx +123 -0
- package/components/other/toaster.tsx +35 -0
- package/components/other/toggle-group.tsx +61 -0
- package/components/other/toggle.tsx +45 -0
- package/components/other/tooltip.tsx +30 -0
- package/components/theme-provider.tsx +9 -0
- package/components/types.ts +22 -0
- package/dist/.next/types/app/api/about/route.js +52 -0
- package/dist/.next/types/app/api/blog/route.js +52 -0
- package/dist/.next/types/app/api/files/route.js +52 -0
- package/dist/.next/types/app/api/schedule/route.js +52 -0
- package/dist/.next/types/app/api/sync-user/route.js +52 -0
- package/dist/.next/types/app/layout.js +22 -0
- package/dist/.next/types/app/page.js +22 -0
- package/dist/app/about/page.jsx +259 -0
- package/dist/app/adRequest/page.jsx +531 -0
- package/dist/app/analytics/page.jsx +298 -0
- package/dist/app/api/about/route.js +285 -0
- package/dist/app/api/adRequest/route.js +440 -0
- package/dist/app/api/analytics/[reportType]/route.js +346 -0
- package/dist/app/api/bio/route.js +293 -0
- package/dist/app/api/blog/route.js +366 -0
- package/dist/app/api/chat/route.js +58 -0
- package/dist/app/api/contact/route.js +163 -0
- package/dist/app/api/contacts/route.js +234 -0
- package/dist/app/api/files/route.js +444 -0
- package/dist/app/api/gallery-data/route.js +642 -0
- package/dist/app/api/schedule/route.js +461 -0
- package/dist/app/api/sync-user/route.js +174 -0
- package/dist/app/api/trial-request/route.js +165 -0
- package/dist/app/blog/[id]/page.jsx +307 -0
- package/dist/app/blog/page.jsx +210 -0
- package/dist/app/constants/about.js +32 -0
- package/dist/app/constants/adRequest.js +113 -0
- package/dist/app/constants/contact.js +40 -0
- package/dist/app/constants/faq.js +36 -0
- package/dist/app/constants/gallery.js +42 -0
- package/dist/app/constants/page.js +69 -0
- package/dist/app/constants/schedule.js +71 -0
- package/dist/app/contact/page.jsx +119 -0
- package/dist/app/faq/page.jsx +97 -0
- package/dist/app/gallery/page.jsx +280 -0
- package/dist/app/layout.jsx +45 -0
- package/dist/app/page.jsx +324 -0
- package/dist/app/schedule/page.jsx +500 -0
- package/dist/components/addOns/functional/BioEditor.jsx +175 -0
- package/dist/components/addOns/functional/CalendlyWidget.jsx +61 -0
- package/dist/components/addOns/functional/ClassList.jsx +158 -0
- package/dist/components/addOns/functional/ClassPopup.jsx +300 -0
- package/dist/components/addOns/functional/ContactForm.jsx +219 -0
- package/dist/components/addOns/functional/FileUploader.jsx +222 -0
- package/dist/components/addOns/functional/ImageDescCarousel.jsx +464 -0
- package/dist/components/addOns/functional/NewUserAnalytics.jsx +71 -0
- package/dist/components/addOns/functional/ScheduleCarousel.jsx +68 -0
- package/dist/components/addOns/functional/aboutSections/AboutSection.jsx +369 -0
- package/dist/components/addOns/functional/aboutSections/constants/aboutSection.js +65 -0
- package/dist/components/addOns/functional/blogSections/BlogDashboard.jsx +111 -0
- package/dist/components/addOns/functional/blogSections/BlogFormPopUp.jsx +465 -0
- package/dist/components/addOns/functional/blogSections/BlogList.jsx +170 -0
- package/dist/components/addOns/functional/blogSections/BlogSidebar.jsx +35 -0
- package/dist/components/addOns/functional/blogSections/constants/blogDashboard.js +28 -0
- package/dist/components/addOns/functional/blogSections/constants/blogFormPopUp.js +97 -0
- package/dist/components/addOns/functional/blogSections/constants/blogList.js +22 -0
- package/dist/components/addOns/functional/blogSections/constants/blogSidebar.js +15 -0
- package/dist/components/addOns/functional/contactsDashboard/ContactsDashboard.jsx +323 -0
- package/dist/components/addOns/functional/contactsDashboard/constants/contactsDashboard.js +70 -0
- package/dist/components/addOns/functional/galleries/GalleryComplex.jsx +586 -0
- package/dist/components/addOns/functional/galleries/GallerySimple.jsx +385 -0
- package/dist/components/addOns/functional/galleries/constants/galleryComplex.js +104 -0
- package/dist/components/addOns/functional/galleries/constants/gallerySimple.js +74 -0
- package/dist/components/addOns/functional/schedules/ScheduleGridOne.jsx +167 -0
- package/dist/components/addOns/functional/schedules/ScheduleGridTwo.jsx +100 -0
- package/dist/components/addOns/functional/schedules/ScheduleGridTwoBasic.jsx +97 -0
- package/dist/components/addOns/functional/schedules/SchedulerForm.jsx +188 -0
- package/dist/components/addOns/functional/schedules/constants/ScheduleGridTwo.js +40 -0
- package/dist/components/addOns/functional/schedules/constants/ScheduleGridTwoBasic.js +40 -0
- package/dist/components/addOns/functional/schedules/constants/SchedulerForm.js +65 -0
- package/dist/components/addOns/functional/schedules/constants/scheduleGridOne.js +54 -0
- package/dist/components/addOns/non-functional/AnnouncementBanner.jsx +24 -0
- package/dist/components/addOns/non-functional/FeaturesSection.jsx +38 -0
- package/dist/components/addOns/non-functional/HeroSection.jsx +71 -0
- package/dist/components/addOns/non-functional/IconBubble.jsx +36 -0
- package/dist/components/addOns/non-functional/SampleCarousel.jsx +114 -0
- package/dist/components/addOns/non-functional/Testimonials.jsx +177 -0
- package/dist/components/addOns/non-functional/ThreeSetGallery.jsx +40 -0
- package/dist/components/addOns/non-functional/aboutSections/AboutSection.jsx +35 -0
- package/dist/components/addOns/non-functional/aboutSections/constants/aboutSection.js +24 -0
- package/dist/components/addOns/non-functional/imageCarousels/ProductSlider.jsx +80 -0
- package/dist/components/addOns/non-functional/imageCarousels/ProgramCarousel.jsx +155 -0
- package/dist/components/addOns/non-functional/imageCarousels/constants/programCarousel.js +39 -0
- package/dist/components/addOns/non-functional/imageCarousels/constants/programSlider.js +36 -0
- package/dist/components/addOns/non-functional/spinner.jsx +13 -0
- package/dist/components/footers/footer.jsx +219 -0
- package/dist/components/navBars/navbar.jsx +158 -0
- package/dist/components/other/accordion.jsx +40 -0
- package/dist/components/other/admin-menu.jsx +34 -0
- package/dist/components/other/alert-dialog.jsx +64 -0
- package/dist/components/other/alert.jsx +41 -0
- package/dist/components/other/aspect-ratio.jsx +4 -0
- package/dist/components/other/avatar.jsx +31 -0
- package/dist/components/other/badge.jsx +32 -0
- package/dist/components/other/breadcrumb.jsx +57 -0
- package/dist/components/other/button.jsx +321 -0
- package/dist/components/other/calendar.jsx +43 -0
- package/dist/components/other/card.jsx +44 -0
- package/dist/components/other/carousel.jsx +140 -0
- package/dist/components/other/chart.jsx +182 -0
- package/dist/components/other/checkbox.jsx +26 -0
- package/dist/components/other/collapsible.jsx +6 -0
- package/dist/components/other/command.jsx +68 -0
- package/dist/components/other/context-menu.jsx +88 -0
- package/dist/components/other/dialog.jsx +60 -0
- package/dist/components/other/drawer.jsx +60 -0
- package/dist/components/other/dropdown-menu.jsx +90 -0
- package/dist/components/other/form.jsx +89 -0
- package/dist/components/other/hover-card.jsx +23 -0
- package/dist/components/other/input-otp.jsx +46 -0
- package/dist/components/other/input.jsx +19 -0
- package/dist/components/other/label.jsx +23 -0
- package/dist/components/other/login-popup.jsx +1 -0
- package/dist/components/other/menubar.jsx +96 -0
- package/dist/components/other/mobile-icon.jsx +11 -0
- package/dist/components/other/navigation-menu.jsx +62 -0
- package/dist/components/other/pagination.jsx +63 -0
- package/dist/components/other/popover.jsx +25 -0
- package/dist/components/other/progress.jsx +23 -0
- package/dist/components/other/radio-group.jsx +31 -0
- package/dist/components/other/resizable.jsx +29 -0
- package/dist/components/other/scroll-area.jsx +36 -0
- package/dist/components/other/select.jsx +83 -0
- package/dist/components/other/separator.jsx +21 -0
- package/dist/components/other/sheet.jsx +74 -0
- package/dist/components/other/signup-popup.jsx +1 -0
- package/dist/components/other/skeleton.jsx +17 -0
- package/dist/components/other/slider.jsx +26 -0
- package/dist/components/other/social-icons.jsx +15 -0
- package/dist/components/other/sonner.jsx +27 -0
- package/dist/components/other/switch.jsx +23 -0
- package/dist/components/other/table.jsx +56 -0
- package/dist/components/other/tabs.jsx +32 -0
- package/dist/components/other/textarea.jsx +19 -0
- package/dist/components/other/toast.jsx +58 -0
- package/dist/components/other/toaster.jsx +31 -0
- package/dist/components/other/toggle-group.jsx +41 -0
- package/dist/components/other/toggle.jsx +39 -0
- package/dist/components/other/tooltip.jsx +24 -0
- package/dist/components/theme-provider.jsx +18 -0
- package/dist/components/types.js +1 -0
- package/dist/hooks/use-toast.js +135 -0
- package/dist/lib/auth-context.jsx +144 -0
- package/dist/lib/google-analytics.jsx +148 -0
- package/dist/lib/utils.js +9 -0
- package/dist/lib/verify-user.js +142 -0
- package/dist/middleware.js +32 -0
- package/dist/tailwind.config.js +86 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/hooks/use-toast.ts +188 -0
- package/lib/auth-context.tsx +131 -0
- package/lib/google-analytics.tsx +98 -0
- package/lib/utils.ts +6 -0
- package/lib/verify-user.ts +118 -0
- package/middleware.ts +35 -0
- package/next.config.js +10 -0
- package/package.json +116 -0
- package/postcss.config.js +6 -0
- package/public/images/FitStop.png +0 -0
- package/public/images/classes/bodyblast.JPG +0 -0
- package/public/images/classes/cardioxtrain.JPG +0 -0
- package/public/images/classes/combo.JPG +0 -0
- package/public/images/classes/flexiblefriday.JPG +0 -0
- package/public/images/classes/freestyle.jpg +0 -0
- package/public/images/classes/noclasses.jpg +0 -0
- package/public/images/classes/seniorstretch.JPG +0 -0
- package/public/images/classes/stretch.JPG +0 -0
- package/public/images/classes/zoomba.JPG +0 -0
- package/public/images/fitstoproom1.jpg +0 -0
- package/public/images/fitstoproom2.jpg +0 -0
- package/public/images/gallery/021-1024x768.jpg +0 -0
- package/public/images/gallery/023-1024x768.jpg +0 -0
- package/public/images/gallery/027-1024x768.jpg +0 -0
- package/public/images/gallery/029-1024x768.jpg +0 -0
- package/public/images/gallery/030-1024x768.jpg +0 -0
- package/public/images/gallery/042-1024x768.jpg +0 -0
- package/public/images/gallery/049-1024x768.jpg +0 -0
- package/public/images/gallery/073-1024x768.jpg +0 -0
- package/public/images/gallery/108-300x225.jpg +0 -0
- package/public/images/gallery/109-300x225.jpg +0 -0
- package/public/images/gallery/116.jpg +0 -0
- package/public/images/gallery/123-1-1024x768.jpg +0 -0
- package/public/images/gallery/133.jpg +0 -0
- package/public/images/gallery/142-1.jpg +0 -0
- package/public/images/gallery/143.jpg +0 -0
- package/public/images/gallery/145-1-1024x768.jpg +0 -0
- package/public/images/gallery/151-1024x768.jpg +0 -0
- package/public/images/gallery/166-300x225.jpg +0 -0
- package/public/images/gallery/175.jpg +0 -0
- package/public/images/gallery/183-1024x768.jpg +0 -0
- package/public/images/gallery/311.JPG +0 -0
- package/public/images/gallery/413-1.jpg +0 -0
- package/public/images/gallery/Cathys-Fit-Stop-Holiday-Party-0003-1024x683.jpg +0 -0
- package/public/images/gallery/Cathys-Fit-Stop-Holiday-Party-0076-1024x683.jpg +0 -0
- package/public/images/gallery/Cathys-Fit-Stop-Holiday-Party-0171-1024x683.jpg +0 -0
- package/public/images/gallery/DSCN0233-1024x768.jpg +0 -0
- package/public/images/gallery/DSCN0245-1-1024x768.jpg +0 -0
- package/public/images/gallery/Fitstopgirls2.jpg +0 -0
- package/public/images/gallery/GrandOpening2009.JPG +0 -0
- package/public/images/gallery/IMG_1937.JPG +0 -0
- package/public/images/gallery/IMG_1950-20.jpg +0 -0
- package/public/images/gallery/IMG_2112.JPG +0 -0
- package/public/images/gallery/IMG_2229.JPG +0 -0
- package/public/images/gallery/IMG_2272.JPG +0 -0
- package/public/images/gallery/IMG_2336.JPG +0 -0
- package/public/images/gallery/IMG_2367.JPG +0 -0
- package/public/images/gallery/IMG_2520.jpg +0 -0
- package/public/images/gallery/IMG_2564.jpg +0 -0
- package/public/images/gallery/IMG_3678.jpg +0 -0
- package/public/images/gallery/IMG_3744.jpg +0 -0
- package/public/images/gallery/IMG_3745.jpg +0 -0
- package/public/images/gallery/IMG_6383.jpg +0 -0
- package/public/images/gallery/Jillian-8-Months-2338-1024x683.jpg +0 -0
- package/public/images/gallery/Kathys-Fit-Stop-0032-1024x675.jpg +0 -0
- package/public/images/gallery/LaurieinPlank.jpeg +0 -0
- package/public/images/gallery/May2017032.JPG +0 -0
- package/public/images/gallery/clubpic10.jpg +0 -0
- package/public/images/gallery/clubpic15.jpg +0 -0
- package/public/images/gallery/clubpic2.jpg +0 -0
- package/public/images/gallery/clubpic3.jpg +0 -0
- package/public/images/gallery/clubpic4.jpg +0 -0
- package/public/images/gallery/clubpic5.jpg +0 -0
- package/public/images/gallery/clubpic6.jpg +0 -0
- package/public/images/gallery/clubpic7.jpg +0 -0
- package/public/images/gallery/clubpic8.jpg +0 -0
- package/public/images/gallery/clubpic9.jpg +0 -0
- package/public/images/gallery/z014-1024x768.jpg +0 -0
- package/public/images/gallery/z019-1-1024x768.jpg +0 -0
- package/public/images/kathy_faq-300x132.jpg +0 -0
- package/public/images/kathyportrait.jpg +0 -0
- package/public/images/kristiportrait.jpg +0 -0
- package/public/images/maincoverbackground.JPG +0 -0
- package/public/images/videos/FitStopLoopVideo.mp4 +0 -0
- package/public/images/weights.jpg +0 -0
- package/public/pdf/FitStop-Forum-April-2025.pdf +0 -0
- package/tailwind.config.ts +89 -0
- package/tsconfig.json +24 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as RechartsPrimitive from 'recharts';
|
|
5
|
+
|
|
6
|
+
import { cn } from '@/lib/utils';
|
|
7
|
+
|
|
8
|
+
const THEMES = { light: '', dark: '.dark' } as const;
|
|
9
|
+
|
|
10
|
+
export type ChartConfig = {
|
|
11
|
+
[k in string]: {
|
|
12
|
+
label?: React.ReactNode;
|
|
13
|
+
icon?: React.ComponentType;
|
|
14
|
+
} & (
|
|
15
|
+
| { color?: string; theme?: never }
|
|
16
|
+
| { color?: never; theme: Record<keyof typeof THEMES, string> }
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type ChartContextProps = {
|
|
21
|
+
config: ChartConfig;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const ChartContext = React.createContext<ChartContextProps | null>(null);
|
|
25
|
+
|
|
26
|
+
function useChart() {
|
|
27
|
+
const context = React.useContext(ChartContext);
|
|
28
|
+
|
|
29
|
+
if (!context) {
|
|
30
|
+
throw new Error('useChart must be used within a <ChartContainer />');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return context;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const ChartContainer = React.forwardRef<
|
|
37
|
+
HTMLDivElement,
|
|
38
|
+
React.ComponentProps<'div'> & {
|
|
39
|
+
config: ChartConfig;
|
|
40
|
+
children: React.ComponentProps<
|
|
41
|
+
typeof RechartsPrimitive.ResponsiveContainer
|
|
42
|
+
>['children'];
|
|
43
|
+
}
|
|
44
|
+
>(({ id, className, children, config, ...props }, ref) => {
|
|
45
|
+
const uniqueId = React.useId();
|
|
46
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<ChartContext.Provider value={{ config }}>
|
|
50
|
+
<div
|
|
51
|
+
data-chart={chartId}
|
|
52
|
+
ref={ref}
|
|
53
|
+
className={cn(
|
|
54
|
+
"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
|
|
55
|
+
className
|
|
56
|
+
)}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
<ChartStyle id={chartId} config={config} />
|
|
60
|
+
<RechartsPrimitive.ResponsiveContainer>
|
|
61
|
+
{children}
|
|
62
|
+
</RechartsPrimitive.ResponsiveContainer>
|
|
63
|
+
</div>
|
|
64
|
+
</ChartContext.Provider>
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
ChartContainer.displayName = 'Chart';
|
|
68
|
+
|
|
69
|
+
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|
70
|
+
const colorConfig = Object.entries(config).filter(
|
|
71
|
+
([_, config]) => config.theme || config.color
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
if (!colorConfig.length) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<style
|
|
80
|
+
dangerouslySetInnerHTML={{
|
|
81
|
+
__html: Object.entries(THEMES)
|
|
82
|
+
.map(
|
|
83
|
+
([theme, prefix]) => `
|
|
84
|
+
${prefix} [data-chart=${id}] {
|
|
85
|
+
${colorConfig
|
|
86
|
+
.map(([key, itemConfig]) => {
|
|
87
|
+
const color =
|
|
88
|
+
itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||
|
|
89
|
+
itemConfig.color;
|
|
90
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
91
|
+
})
|
|
92
|
+
.join('\n')}
|
|
93
|
+
}
|
|
94
|
+
`
|
|
95
|
+
)
|
|
96
|
+
.join('\n'),
|
|
97
|
+
}}
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
103
|
+
|
|
104
|
+
const ChartTooltipContent = React.forwardRef<
|
|
105
|
+
HTMLDivElement,
|
|
106
|
+
React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
|
|
107
|
+
React.ComponentProps<'div'> & {
|
|
108
|
+
hideLabel?: boolean;
|
|
109
|
+
hideIndicator?: boolean;
|
|
110
|
+
indicator?: 'line' | 'dot' | 'dashed';
|
|
111
|
+
nameKey?: string;
|
|
112
|
+
labelKey?: string;
|
|
113
|
+
}
|
|
114
|
+
>(
|
|
115
|
+
(
|
|
116
|
+
{
|
|
117
|
+
active,
|
|
118
|
+
payload,
|
|
119
|
+
className,
|
|
120
|
+
indicator = 'dot',
|
|
121
|
+
hideLabel = false,
|
|
122
|
+
hideIndicator = false,
|
|
123
|
+
label,
|
|
124
|
+
labelFormatter,
|
|
125
|
+
labelClassName,
|
|
126
|
+
formatter,
|
|
127
|
+
color,
|
|
128
|
+
nameKey,
|
|
129
|
+
labelKey,
|
|
130
|
+
},
|
|
131
|
+
ref
|
|
132
|
+
) => {
|
|
133
|
+
const { config } = useChart();
|
|
134
|
+
|
|
135
|
+
const tooltipLabel = React.useMemo(() => {
|
|
136
|
+
if (hideLabel || !payload?.length) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const [item] = payload;
|
|
141
|
+
const key = `${labelKey || item.dataKey || item.name || 'value'}`;
|
|
142
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
143
|
+
const value =
|
|
144
|
+
!labelKey && typeof label === 'string'
|
|
145
|
+
? config[label as keyof typeof config]?.label || label
|
|
146
|
+
: itemConfig?.label;
|
|
147
|
+
|
|
148
|
+
if (labelFormatter) {
|
|
149
|
+
return (
|
|
150
|
+
<div className={cn('font-medium', labelClassName)}>
|
|
151
|
+
{labelFormatter(value, payload)}
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (!value) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return <div className={cn('font-medium', labelClassName)}>{value}</div>;
|
|
161
|
+
}, [
|
|
162
|
+
label,
|
|
163
|
+
labelFormatter,
|
|
164
|
+
payload,
|
|
165
|
+
hideLabel,
|
|
166
|
+
labelClassName,
|
|
167
|
+
config,
|
|
168
|
+
labelKey,
|
|
169
|
+
]);
|
|
170
|
+
|
|
171
|
+
if (!active || !payload?.length) {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const nestLabel = payload.length === 1 && indicator !== 'dot';
|
|
176
|
+
|
|
177
|
+
return (
|
|
178
|
+
<div
|
|
179
|
+
ref={ref}
|
|
180
|
+
className={cn(
|
|
181
|
+
'grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl',
|
|
182
|
+
className
|
|
183
|
+
)}
|
|
184
|
+
>
|
|
185
|
+
{!nestLabel ? tooltipLabel : null}
|
|
186
|
+
<div className="grid gap-1.5">
|
|
187
|
+
{payload.map((item, index) => {
|
|
188
|
+
const key = `${nameKey || item.name || item.dataKey || 'value'}`;
|
|
189
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
190
|
+
const indicatorColor = color || item.payload.fill || item.color;
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
<div
|
|
194
|
+
key={item.dataKey}
|
|
195
|
+
className={cn(
|
|
196
|
+
'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',
|
|
197
|
+
indicator === 'dot' && 'items-center'
|
|
198
|
+
)}
|
|
199
|
+
>
|
|
200
|
+
{formatter && item?.value !== undefined && item.name ? (
|
|
201
|
+
formatter(item.value, item.name, item, index, item.payload)
|
|
202
|
+
) : (
|
|
203
|
+
<>
|
|
204
|
+
{itemConfig?.icon ? (
|
|
205
|
+
<itemConfig.icon />
|
|
206
|
+
) : (
|
|
207
|
+
!hideIndicator && (
|
|
208
|
+
<div
|
|
209
|
+
className={cn(
|
|
210
|
+
'shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]',
|
|
211
|
+
{
|
|
212
|
+
'h-2.5 w-2.5': indicator === 'dot',
|
|
213
|
+
'w-1': indicator === 'line',
|
|
214
|
+
'w-0 border-[1.5px] border-dashed bg-transparent':
|
|
215
|
+
indicator === 'dashed',
|
|
216
|
+
'my-0.5': nestLabel && indicator === 'dashed',
|
|
217
|
+
}
|
|
218
|
+
)}
|
|
219
|
+
style={
|
|
220
|
+
{
|
|
221
|
+
'--color-bg': indicatorColor,
|
|
222
|
+
'--color-border': indicatorColor,
|
|
223
|
+
} as React.CSSProperties
|
|
224
|
+
}
|
|
225
|
+
/>
|
|
226
|
+
)
|
|
227
|
+
)}
|
|
228
|
+
<div
|
|
229
|
+
className={cn(
|
|
230
|
+
'flex flex-1 justify-between leading-none',
|
|
231
|
+
nestLabel ? 'items-end' : 'items-center'
|
|
232
|
+
)}
|
|
233
|
+
>
|
|
234
|
+
<div className="grid gap-1.5">
|
|
235
|
+
{nestLabel ? tooltipLabel : null}
|
|
236
|
+
<span className="text-muted-foreground">
|
|
237
|
+
{itemConfig?.label || item.name}
|
|
238
|
+
</span>
|
|
239
|
+
</div>
|
|
240
|
+
{item.value && (
|
|
241
|
+
<span className="font-mono font-medium tabular-nums text-foreground">
|
|
242
|
+
{item.value.toLocaleString()}
|
|
243
|
+
</span>
|
|
244
|
+
)}
|
|
245
|
+
</div>
|
|
246
|
+
</>
|
|
247
|
+
)}
|
|
248
|
+
</div>
|
|
249
|
+
);
|
|
250
|
+
})}
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
ChartTooltipContent.displayName = 'ChartTooltip';
|
|
257
|
+
|
|
258
|
+
const ChartLegend = RechartsPrimitive.Legend;
|
|
259
|
+
|
|
260
|
+
const ChartLegendContent = React.forwardRef<
|
|
261
|
+
HTMLDivElement,
|
|
262
|
+
React.ComponentProps<'div'> &
|
|
263
|
+
Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {
|
|
264
|
+
hideIcon?: boolean;
|
|
265
|
+
nameKey?: string;
|
|
266
|
+
}
|
|
267
|
+
>(
|
|
268
|
+
(
|
|
269
|
+
{ className, hideIcon = false, payload, verticalAlign = 'bottom', nameKey },
|
|
270
|
+
ref
|
|
271
|
+
) => {
|
|
272
|
+
const { config } = useChart();
|
|
273
|
+
|
|
274
|
+
if (!payload?.length) {
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return (
|
|
279
|
+
<div
|
|
280
|
+
ref={ref}
|
|
281
|
+
className={cn(
|
|
282
|
+
'flex items-center justify-center gap-4',
|
|
283
|
+
verticalAlign === 'top' ? 'pb-3' : 'pt-3',
|
|
284
|
+
className
|
|
285
|
+
)}
|
|
286
|
+
>
|
|
287
|
+
{payload.map((item) => {
|
|
288
|
+
const key = `${nameKey || item.dataKey || 'value'}`;
|
|
289
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
290
|
+
|
|
291
|
+
return (
|
|
292
|
+
<div
|
|
293
|
+
key={item.value}
|
|
294
|
+
className={cn(
|
|
295
|
+
'flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground'
|
|
296
|
+
)}
|
|
297
|
+
>
|
|
298
|
+
{itemConfig?.icon && !hideIcon ? (
|
|
299
|
+
<itemConfig.icon />
|
|
300
|
+
) : (
|
|
301
|
+
<div
|
|
302
|
+
className="h-2 w-2 shrink-0 rounded-[2px]"
|
|
303
|
+
style={{
|
|
304
|
+
backgroundColor: item.color,
|
|
305
|
+
}}
|
|
306
|
+
/>
|
|
307
|
+
)}
|
|
308
|
+
{itemConfig?.label}
|
|
309
|
+
</div>
|
|
310
|
+
);
|
|
311
|
+
})}
|
|
312
|
+
</div>
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
);
|
|
316
|
+
ChartLegendContent.displayName = 'ChartLegend';
|
|
317
|
+
|
|
318
|
+
function getPayloadConfigFromPayload(
|
|
319
|
+
config: ChartConfig,
|
|
320
|
+
payload: unknown,
|
|
321
|
+
key: string
|
|
322
|
+
) {
|
|
323
|
+
if (typeof payload !== 'object' || payload === null) {
|
|
324
|
+
return undefined;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const payloadPayload =
|
|
328
|
+
'payload' in payload &&
|
|
329
|
+
typeof payload.payload === 'object' &&
|
|
330
|
+
payload.payload !== null
|
|
331
|
+
? payload.payload
|
|
332
|
+
: undefined;
|
|
333
|
+
|
|
334
|
+
let configLabelKey: string = key;
|
|
335
|
+
|
|
336
|
+
if (
|
|
337
|
+
key in payload &&
|
|
338
|
+
typeof payload[key as keyof typeof payload] === 'string'
|
|
339
|
+
) {
|
|
340
|
+
configLabelKey = payload[key as keyof typeof payload] as string;
|
|
341
|
+
} else if (
|
|
342
|
+
payloadPayload &&
|
|
343
|
+
key in payloadPayload &&
|
|
344
|
+
typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'
|
|
345
|
+
) {
|
|
346
|
+
configLabelKey = payloadPayload[
|
|
347
|
+
key as keyof typeof payloadPayload
|
|
348
|
+
] as string;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
return configLabelKey in config
|
|
352
|
+
? config[configLabelKey]
|
|
353
|
+
: config[key as keyof typeof config];
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export {
|
|
357
|
+
ChartContainer,
|
|
358
|
+
ChartTooltip,
|
|
359
|
+
ChartTooltipContent,
|
|
360
|
+
ChartLegend,
|
|
361
|
+
ChartLegendContent,
|
|
362
|
+
ChartStyle,
|
|
363
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
5
|
+
import { Check } from 'lucide-react';
|
|
6
|
+
|
|
7
|
+
import { cn } from '@/lib/utils';
|
|
8
|
+
|
|
9
|
+
const Checkbox = React.forwardRef<
|
|
10
|
+
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
|
11
|
+
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
|
|
12
|
+
>(({ className, ...props }, ref) => (
|
|
13
|
+
<CheckboxPrimitive.Root
|
|
14
|
+
ref={ref}
|
|
15
|
+
className={cn(
|
|
16
|
+
'peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
>
|
|
21
|
+
<CheckboxPrimitive.Indicator
|
|
22
|
+
className={cn('flex items-center justify-center text-current')}
|
|
23
|
+
>
|
|
24
|
+
<Check className="h-4 w-4" />
|
|
25
|
+
</CheckboxPrimitive.Indicator>
|
|
26
|
+
</CheckboxPrimitive.Root>
|
|
27
|
+
));
|
|
28
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
29
|
+
|
|
30
|
+
export { Checkbox };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
4
|
+
|
|
5
|
+
const Collapsible = CollapsiblePrimitive.Root;
|
|
6
|
+
|
|
7
|
+
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
8
|
+
|
|
9
|
+
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
|
|
10
|
+
|
|
11
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { type DialogProps } from '@radix-ui/react-dialog';
|
|
5
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
6
|
+
import { Search } from 'lucide-react';
|
|
7
|
+
|
|
8
|
+
import { cn } from '@/lib/utils';
|
|
9
|
+
import { Dialog, DialogContent } from '@/components/other/dialog';
|
|
10
|
+
|
|
11
|
+
const Command = React.forwardRef<
|
|
12
|
+
React.ElementRef<typeof CommandPrimitive>,
|
|
13
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive>
|
|
14
|
+
>(({ className, ...props }, ref) => (
|
|
15
|
+
<CommandPrimitive
|
|
16
|
+
ref={ref}
|
|
17
|
+
className={cn(
|
|
18
|
+
'flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground',
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
));
|
|
24
|
+
Command.displayName = CommandPrimitive.displayName;
|
|
25
|
+
|
|
26
|
+
interface CommandDialogProps extends DialogProps {}
|
|
27
|
+
|
|
28
|
+
const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
|
|
29
|
+
return (
|
|
30
|
+
<Dialog {...props}>
|
|
31
|
+
<DialogContent className="overflow-hidden p-0 shadow-lg">
|
|
32
|
+
<Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
|
33
|
+
{children}
|
|
34
|
+
</Command>
|
|
35
|
+
</DialogContent>
|
|
36
|
+
</Dialog>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const CommandInput = React.forwardRef<
|
|
41
|
+
React.ElementRef<typeof CommandPrimitive.Input>,
|
|
42
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
|
|
43
|
+
>(({ className, ...props }, ref) => (
|
|
44
|
+
<div className="flex items-center border-b px-3" cmdk-input-wrapper="">
|
|
45
|
+
<Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
|
|
46
|
+
<CommandPrimitive.Input
|
|
47
|
+
ref={ref}
|
|
48
|
+
className={cn(
|
|
49
|
+
'flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
|
|
50
|
+
className
|
|
51
|
+
)}
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
));
|
|
56
|
+
|
|
57
|
+
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
58
|
+
|
|
59
|
+
const CommandList = React.forwardRef<
|
|
60
|
+
React.ElementRef<typeof CommandPrimitive.List>,
|
|
61
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
|
|
62
|
+
>(({ className, ...props }, ref) => (
|
|
63
|
+
<CommandPrimitive.List
|
|
64
|
+
ref={ref}
|
|
65
|
+
className={cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
));
|
|
69
|
+
|
|
70
|
+
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
71
|
+
|
|
72
|
+
const CommandEmpty = React.forwardRef<
|
|
73
|
+
React.ElementRef<typeof CommandPrimitive.Empty>,
|
|
74
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
|
|
75
|
+
>((props, ref) => (
|
|
76
|
+
<CommandPrimitive.Empty
|
|
77
|
+
ref={ref}
|
|
78
|
+
className="py-6 text-center text-sm"
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
));
|
|
82
|
+
|
|
83
|
+
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
84
|
+
|
|
85
|
+
const CommandGroup = React.forwardRef<
|
|
86
|
+
React.ElementRef<typeof CommandPrimitive.Group>,
|
|
87
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
|
|
88
|
+
>(({ className, ...props }, ref) => (
|
|
89
|
+
<CommandPrimitive.Group
|
|
90
|
+
ref={ref}
|
|
91
|
+
className={cn(
|
|
92
|
+
'overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground',
|
|
93
|
+
className
|
|
94
|
+
)}
|
|
95
|
+
{...props}
|
|
96
|
+
/>
|
|
97
|
+
));
|
|
98
|
+
|
|
99
|
+
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
100
|
+
|
|
101
|
+
const CommandSeparator = React.forwardRef<
|
|
102
|
+
React.ElementRef<typeof CommandPrimitive.Separator>,
|
|
103
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
|
|
104
|
+
>(({ className, ...props }, ref) => (
|
|
105
|
+
<CommandPrimitive.Separator
|
|
106
|
+
ref={ref}
|
|
107
|
+
className={cn('-mx-1 h-px bg-border', className)}
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
));
|
|
111
|
+
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
112
|
+
|
|
113
|
+
const CommandItem = React.forwardRef<
|
|
114
|
+
React.ElementRef<typeof CommandPrimitive.Item>,
|
|
115
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
|
|
116
|
+
>(({ className, ...props }, ref) => (
|
|
117
|
+
<CommandPrimitive.Item
|
|
118
|
+
ref={ref}
|
|
119
|
+
className={cn(
|
|
120
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",
|
|
121
|
+
className
|
|
122
|
+
)}
|
|
123
|
+
{...props}
|
|
124
|
+
/>
|
|
125
|
+
));
|
|
126
|
+
|
|
127
|
+
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
128
|
+
|
|
129
|
+
const CommandShortcut = ({
|
|
130
|
+
className,
|
|
131
|
+
...props
|
|
132
|
+
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
133
|
+
return (
|
|
134
|
+
<span
|
|
135
|
+
className={cn(
|
|
136
|
+
'ml-auto text-xs tracking-widest text-muted-foreground',
|
|
137
|
+
className
|
|
138
|
+
)}
|
|
139
|
+
{...props}
|
|
140
|
+
/>
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
CommandShortcut.displayName = 'CommandShortcut';
|
|
144
|
+
|
|
145
|
+
export {
|
|
146
|
+
Command,
|
|
147
|
+
CommandDialog,
|
|
148
|
+
CommandInput,
|
|
149
|
+
CommandList,
|
|
150
|
+
CommandEmpty,
|
|
151
|
+
CommandGroup,
|
|
152
|
+
CommandItem,
|
|
153
|
+
CommandShortcut,
|
|
154
|
+
CommandSeparator,
|
|
155
|
+
};
|