@meghpatel-007/next-starter 0.0.0-stage → 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 (274) hide show
  1. package/LICENSE +27 -0
  2. package/README.md +131 -2
  3. package/bin/index.js +8 -0
  4. package/package.json +44 -4
  5. package/src/cli.js +242 -0
  6. package/src/git.js +25 -0
  7. package/src/install.js +55 -0
  8. package/src/scaffold.js +110 -0
  9. package/src/utils.js +70 -0
  10. package/template/AGENTS.md +9 -0
  11. package/template/LICENSE +28 -0
  12. package/template/README.md +36 -0
  13. package/template/_gitignore +41 -0
  14. package/template/components.json +25 -0
  15. package/template/eslint.config.mjs +11 -0
  16. package/template/next-env.d.ts +7 -0
  17. package/template/next.config.ts +59 -0
  18. package/template/package.json +49 -0
  19. package/template/postcss.config.mjs +6 -0
  20. package/template/public/apps.png +0 -0
  21. package/template/public/customizer.png +0 -0
  22. package/template/public/dashboard-dark.png +0 -0
  23. package/template/public/dashboard-light.png +0 -0
  24. package/template/public/dashboard.png +0 -0
  25. package/template/public/favicon-dark.png +0 -0
  26. package/template/public/favicon.png +0 -0
  27. package/template/public/feature-1-dark.png +0 -0
  28. package/template/public/feature-1-light.png +0 -0
  29. package/template/public/feature-2-dark.png +0 -0
  30. package/template/public/feature-2-light.png +0 -0
  31. package/template/public/file.svg +1 -0
  32. package/template/public/globe.svg +1 -0
  33. package/template/public/hero-images-container.png +0 -0
  34. package/template/public/next.svg +1 -0
  35. package/template/public/vercel.svg +1 -0
  36. package/template/public/window.svg +1 -0
  37. package/template/src/app/(auth)/errors/forbidden/components/forbidden-error.tsx +36 -0
  38. package/template/src/app/(auth)/errors/forbidden/page.tsx +5 -0
  39. package/template/src/app/(auth)/errors/internal-server-error/components/internal-server-error.tsx +36 -0
  40. package/template/src/app/(auth)/errors/internal-server-error/page.tsx +5 -0
  41. package/template/src/app/(auth)/errors/not-found/components/not-found-error.tsx +36 -0
  42. package/template/src/app/(auth)/errors/not-found/page.tsx +5 -0
  43. package/template/src/app/(auth)/errors/unauthorized/components/unauthorized-error.tsx +36 -0
  44. package/template/src/app/(auth)/errors/unauthorized/page.tsx +5 -0
  45. package/template/src/app/(auth)/errors/under-maintenance/components/under-maintenance-error.tsx +33 -0
  46. package/template/src/app/(auth)/errors/under-maintenance/page.tsx +5 -0
  47. package/template/src/app/(auth)/forgot-password/components/forgot-password-form-1.tsx +61 -0
  48. package/template/src/app/(auth)/forgot-password/page.tsx +22 -0
  49. package/template/src/app/(auth)/forgot-password-2/components/forgot-password-form-2.tsx +38 -0
  50. package/template/src/app/(auth)/forgot-password-2/page.tsx +25 -0
  51. package/template/src/app/(auth)/forgot-password-3/components/forgot-password-form-3.tsx +66 -0
  52. package/template/src/app/(auth)/forgot-password-3/page.tsx +9 -0
  53. package/template/src/app/(auth)/layout.tsx +14 -0
  54. package/template/src/app/(auth)/sign-in/components/login-form-1.tsx +143 -0
  55. package/template/src/app/(auth)/sign-in/page.tsx +22 -0
  56. package/template/src/app/(auth)/sign-in-2/components/login-form-2.tsx +78 -0
  57. package/template/src/app/(auth)/sign-in-2/page.tsx +25 -0
  58. package/template/src/app/(auth)/sign-in-3/components/login-form-3.tsx +130 -0
  59. package/template/src/app/(auth)/sign-in-3/page.tsx +11 -0
  60. package/template/src/app/(auth)/sign-up/components/signup-form-1.tsx +245 -0
  61. package/template/src/app/(auth)/sign-up/page.tsx +22 -0
  62. package/template/src/app/(auth)/sign-up-2/components/signup-form-2.tsx +89 -0
  63. package/template/src/app/(auth)/sign-up-2/page.tsx +25 -0
  64. package/template/src/app/(auth)/sign-up-3/components/signup-form-3.tsx +152 -0
  65. package/template/src/app/(auth)/sign-up-3/page.tsx +9 -0
  66. package/template/src/app/(dashboard)/calendar/components/calendar-main.tsx +446 -0
  67. package/template/src/app/(dashboard)/calendar/components/calendar-sidebar.tsx +78 -0
  68. package/template/src/app/(dashboard)/calendar/components/calendar-unified.tsx +431 -0
  69. package/template/src/app/(dashboard)/calendar/components/calendar.tsx +90 -0
  70. package/template/src/app/(dashboard)/calendar/components/calendars.tsx +265 -0
  71. package/template/src/app/(dashboard)/calendar/components/date-picker.tsx +56 -0
  72. package/template/src/app/(dashboard)/calendar/components/event-form.tsx +468 -0
  73. package/template/src/app/(dashboard)/calendar/components/quick-actions.tsx +159 -0
  74. package/template/src/app/(dashboard)/calendar/data/calendars.json +37 -0
  75. package/template/src/app/(dashboard)/calendar/data/event-dates.json +30 -0
  76. package/template/src/app/(dashboard)/calendar/data/events.json +62 -0
  77. package/template/src/app/(dashboard)/calendar/data.ts +55 -0
  78. package/template/src/app/(dashboard)/calendar/page.tsx +10 -0
  79. package/template/src/app/(dashboard)/calendar/types.ts +20 -0
  80. package/template/src/app/(dashboard)/calendar/use-calendar.ts +93 -0
  81. package/template/src/app/(dashboard)/chat/components/chat-header.tsx +266 -0
  82. package/template/src/app/(dashboard)/chat/components/chat.tsx +212 -0
  83. package/template/src/app/(dashboard)/chat/components/conversation-list-new.tsx +248 -0
  84. package/template/src/app/(dashboard)/chat/components/conversation-list.tsx +242 -0
  85. package/template/src/app/(dashboard)/chat/components/message-input.tsx +235 -0
  86. package/template/src/app/(dashboard)/chat/components/message-list.tsx +325 -0
  87. package/template/src/app/(dashboard)/chat/data/conversations.json +92 -0
  88. package/template/src/app/(dashboard)/chat/data/messages.json +224 -0
  89. package/template/src/app/(dashboard)/chat/data/users.json +47 -0
  90. package/template/src/app/(dashboard)/chat/page.tsx +49 -0
  91. package/template/src/app/(dashboard)/chat/use-chat.ts +149 -0
  92. package/template/src/app/(dashboard)/dashboard/components/chart-area-interactive.tsx +304 -0
  93. package/template/src/app/(dashboard)/dashboard/components/data-table.tsx +1156 -0
  94. package/template/src/app/(dashboard)/dashboard/components/section-cards.tsx +102 -0
  95. package/template/src/app/(dashboard)/dashboard/data/data.json +614 -0
  96. package/template/src/app/(dashboard)/dashboard/data/focus-documents-data.json +47 -0
  97. package/template/src/app/(dashboard)/dashboard/data/key-personnel-data.json +47 -0
  98. package/template/src/app/(dashboard)/dashboard/data/past-performance-data.json +47 -0
  99. package/template/src/app/(dashboard)/dashboard/page.tsx +37 -0
  100. package/template/src/app/(dashboard)/dashboard/schemas/task-schema.ts +13 -0
  101. package/template/src/app/(dashboard)/dashboard-2/components/customer-insights.tsx +390 -0
  102. package/template/src/app/(dashboard)/dashboard-2/components/dashboard-header.tsx +103 -0
  103. package/template/src/app/(dashboard)/dashboard-2/components/metrics-overview.tsx +95 -0
  104. package/template/src/app/(dashboard)/dashboard-2/components/quick-actions.tsx +50 -0
  105. package/template/src/app/(dashboard)/dashboard-2/components/recent-transactions.tsx +164 -0
  106. package/template/src/app/(dashboard)/dashboard-2/components/revenue-breakdown.tsx +269 -0
  107. package/template/src/app/(dashboard)/dashboard-2/components/sales-chart.tsx +170 -0
  108. package/template/src/app/(dashboard)/dashboard-2/components/top-products.tsx +140 -0
  109. package/template/src/app/(dashboard)/dashboard-2/data/dashboard-data.json +39 -0
  110. package/template/src/app/(dashboard)/dashboard-2/page.tsx +49 -0
  111. package/template/src/app/(dashboard)/faqs/components/faq-list.tsx +148 -0
  112. package/template/src/app/(dashboard)/faqs/components/features-grid.tsx +46 -0
  113. package/template/src/app/(dashboard)/faqs/data/categories.json +10 -0
  114. package/template/src/app/(dashboard)/faqs/data/faqs.json +278 -0
  115. package/template/src/app/(dashboard)/faqs/data/features.ts +37 -0
  116. package/template/src/app/(dashboard)/faqs/page.tsx +16 -0
  117. package/template/src/app/(dashboard)/layout.tsx +83 -0
  118. package/template/src/app/(dashboard)/mail/components/account-switcher.tsx +69 -0
  119. package/template/src/app/(dashboard)/mail/components/mail-display.tsx +290 -0
  120. package/template/src/app/(dashboard)/mail/components/mail-list.tsx +94 -0
  121. package/template/src/app/(dashboard)/mail/components/mail.tsx +226 -0
  122. package/template/src/app/(dashboard)/mail/components/nav.tsx +83 -0
  123. package/template/src/app/(dashboard)/mail/data.tsx +300 -0
  124. package/template/src/app/(dashboard)/mail/index.tsx +6 -0
  125. package/template/src/app/(dashboard)/mail/page.tsx +18 -0
  126. package/template/src/app/(dashboard)/mail/use-mail.ts +20 -0
  127. package/template/src/app/(dashboard)/pricing/components/faq-section.tsx +79 -0
  128. package/template/src/app/(dashboard)/pricing/components/features-grid.tsx +51 -0
  129. package/template/src/app/(dashboard)/pricing/data/faqs.json +32 -0
  130. package/template/src/app/(dashboard)/pricing/data/features.ts +61 -0
  131. package/template/src/app/(dashboard)/pricing/page.tsx +24 -0
  132. package/template/src/app/(dashboard)/settings/account/page.tsx +276 -0
  133. package/template/src/app/(dashboard)/settings/appearance/page.tsx +313 -0
  134. package/template/src/app/(dashboard)/settings/billing/components/billing-history-card.tsx +53 -0
  135. package/template/src/app/(dashboard)/settings/billing/components/current-plan-card.tsx +82 -0
  136. package/template/src/app/(dashboard)/settings/billing/data/billing-history.json +23 -0
  137. package/template/src/app/(dashboard)/settings/billing/data/current-plan.json +12 -0
  138. package/template/src/app/(dashboard)/settings/billing/page.tsx +57 -0
  139. package/template/src/app/(dashboard)/settings/connections/page.tsx +366 -0
  140. package/template/src/app/(dashboard)/settings/notifications/page.tsx +845 -0
  141. package/template/src/app/(dashboard)/settings/user/page.tsx +415 -0
  142. package/template/src/app/(dashboard)/tasks/components/add-task-modal.tsx +291 -0
  143. package/template/src/app/(dashboard)/tasks/components/columns.tsx +159 -0
  144. package/template/src/app/(dashboard)/tasks/components/data-table-column-header.tsx +46 -0
  145. package/template/src/app/(dashboard)/tasks/components/data-table-faceted-filter.tsx +164 -0
  146. package/template/src/app/(dashboard)/tasks/components/data-table-pagination.tsx +107 -0
  147. package/template/src/app/(dashboard)/tasks/components/data-table-row-actions.tsx +72 -0
  148. package/template/src/app/(dashboard)/tasks/components/data-table-toolbar.tsx +189 -0
  149. package/template/src/app/(dashboard)/tasks/components/data-table-view-options.tsx +67 -0
  150. package/template/src/app/(dashboard)/tasks/components/data-table.tsx +122 -0
  151. package/template/src/app/(dashboard)/tasks/components/user-nav.tsx +70 -0
  152. package/template/src/app/(dashboard)/tasks/data/data.tsx +66 -0
  153. package/template/src/app/(dashboard)/tasks/data/schema.ts +13 -0
  154. package/template/src/app/(dashboard)/tasks/data/tasks.json +352 -0
  155. package/template/src/app/(dashboard)/tasks/page.tsx +204 -0
  156. package/template/src/app/(dashboard)/users/components/data-table.tsx +600 -0
  157. package/template/src/app/(dashboard)/users/components/stat-cards.tsx +91 -0
  158. package/template/src/app/(dashboard)/users/components/user-form-dialog.tsx +291 -0
  159. package/template/src/app/(dashboard)/users/data.json +182 -0
  160. package/template/src/app/(dashboard)/users/page.tsx +84 -0
  161. package/template/src/app/favicon.ico +0 -0
  162. package/template/src/app/globals.css +193 -0
  163. package/template/src/app/landing/components/about-section.tsx +125 -0
  164. package/template/src/app/landing/components/blog-section.tsx +86 -0
  165. package/template/src/app/landing/components/contact-section.tsx +299 -0
  166. package/template/src/app/landing/components/cta-section.tsx +121 -0
  167. package/template/src/app/landing/components/faq-section.tsx +125 -0
  168. package/template/src/app/landing/components/features-section.tsx +221 -0
  169. package/template/src/app/landing/components/footer.tsx +273 -0
  170. package/template/src/app/landing/components/hero-section.tsx +121 -0
  171. package/template/src/app/landing/components/landing-theme-customizer.tsx +563 -0
  172. package/template/src/app/landing/components/logo-carousel.tsx +130 -0
  173. package/template/src/app/landing/components/navbar.tsx +367 -0
  174. package/template/src/app/landing/components/pricing-section.tsx +214 -0
  175. package/template/src/app/landing/components/stats-section.tsx +71 -0
  176. package/template/src/app/landing/components/team-section.tsx +224 -0
  177. package/template/src/app/landing/components/testimonials-section.tsx +148 -0
  178. package/template/src/app/landing/landing-page-content.tsx +60 -0
  179. package/template/src/app/landing/page.tsx +6 -0
  180. package/template/src/app/layout.tsx +31 -0
  181. package/template/src/app/loading.tsx +10 -0
  182. package/template/src/app/not-found.tsx +20 -0
  183. package/template/src/app/page.tsx +32 -0
  184. package/template/src/assets/react.svg +1 -0
  185. package/template/src/components/app-sidebar.tsx +241 -0
  186. package/template/src/components/color-picker.tsx +91 -0
  187. package/template/src/components/command-search.tsx +251 -0
  188. package/template/src/components/dot-pattern.tsx +131 -0
  189. package/template/src/components/dynamic-imports.ts +28 -0
  190. package/template/src/components/icons/brand-icons.tsx +114 -0
  191. package/template/src/components/image-3d.tsx +90 -0
  192. package/template/src/components/landing/mega-menu.tsx +143 -0
  193. package/template/src/components/layouts/base-layout.tsx +109 -0
  194. package/template/src/components/logo.tsx +44 -0
  195. package/template/src/components/mode-toggle.tsx +76 -0
  196. package/template/src/components/nav-main.tsx +121 -0
  197. package/template/src/components/nav-secondary.tsx +43 -0
  198. package/template/src/components/nav-user.tsx +122 -0
  199. package/template/src/components/pricing-plans.tsx +181 -0
  200. package/template/src/components/sidebar-notification.tsx +59 -0
  201. package/template/src/components/site-footer.tsx +30 -0
  202. package/template/src/components/site-header.tsx +87 -0
  203. package/template/src/components/theme-customizer/circular-transition.css +115 -0
  204. package/template/src/components/theme-customizer/import-modal.tsx +128 -0
  205. package/template/src/components/theme-customizer/index.tsx +229 -0
  206. package/template/src/components/theme-customizer/layout-tab.tsx +274 -0
  207. package/template/src/components/theme-customizer/main.tsx +7 -0
  208. package/template/src/components/theme-customizer/theme-tab.tsx +403 -0
  209. package/template/src/components/theme-customizer.tsx +6 -0
  210. package/template/src/components/theme-provider.tsx +62 -0
  211. package/template/src/components/ui/accordion.tsx +77 -0
  212. package/template/src/components/ui/alert.tsx +75 -0
  213. package/template/src/components/ui/avatar.tsx +108 -0
  214. package/template/src/components/ui/badge.tsx +51 -0
  215. package/template/src/components/ui/breadcrumb.tsx +121 -0
  216. package/template/src/components/ui/button.tsx +57 -0
  217. package/template/src/components/ui/calendar.tsx +228 -0
  218. package/template/src/components/ui/card-decorator.tsx +20 -0
  219. package/template/src/components/ui/card.tsx +102 -0
  220. package/template/src/components/ui/chart.tsx +372 -0
  221. package/template/src/components/ui/checkbox.tsx +27 -0
  222. package/template/src/components/ui/collapsible.tsx +21 -0
  223. package/template/src/components/ui/command.tsx +193 -0
  224. package/template/src/components/ui/dialog.tsx +156 -0
  225. package/template/src/components/ui/drawer.tsx +224 -0
  226. package/template/src/components/ui/dropdown-menu.tsx +271 -0
  227. package/template/src/components/ui/field.tsx +238 -0
  228. package/template/src/components/ui/hover-card.tsx +50 -0
  229. package/template/src/components/ui/input-group.tsx +158 -0
  230. package/template/src/components/ui/input.tsx +19 -0
  231. package/template/src/components/ui/kbd.tsx +26 -0
  232. package/template/src/components/ui/label.tsx +19 -0
  233. package/template/src/components/ui/loading-spinner.tsx +31 -0
  234. package/template/src/components/ui/navigation-menu.tsx +170 -0
  235. package/template/src/components/ui/popover.tsx +89 -0
  236. package/template/src/components/ui/progress.tsx +82 -0
  237. package/template/src/components/ui/radio-group.tsx +37 -0
  238. package/template/src/components/ui/resizable.tsx +49 -0
  239. package/template/src/components/ui/scroll-area.tsx +54 -0
  240. package/template/src/components/ui/select.tsx +201 -0
  241. package/template/src/components/ui/separator.tsx +24 -0
  242. package/template/src/components/ui/sheet.tsx +134 -0
  243. package/template/src/components/ui/sidebar.tsx +726 -0
  244. package/template/src/components/ui/skeleton.tsx +13 -0
  245. package/template/src/components/ui/switch.tsx +31 -0
  246. package/template/src/components/ui/table.tsx +115 -0
  247. package/template/src/components/ui/tabs.tsx +81 -0
  248. package/template/src/components/ui/textarea.tsx +17 -0
  249. package/template/src/components/ui/toast.tsx +229 -0
  250. package/template/src/components/ui/toggle-group.tsx +89 -0
  251. package/template/src/components/ui/toggle.tsx +44 -0
  252. package/template/src/components/ui/tooltip.tsx +65 -0
  253. package/template/src/components/upgrade-to-pro-button.tsx +107 -0
  254. package/template/src/config/site.ts +8 -0
  255. package/template/src/config/theme-customizer-constants.ts +56 -0
  256. package/template/src/config/theme-data.ts +29 -0
  257. package/template/src/contexts/sidebar-config.ts +16 -0
  258. package/template/src/contexts/sidebar-context.tsx +33 -0
  259. package/template/src/contexts/theme-context.ts +16 -0
  260. package/template/src/hooks/use-circular-transition.ts +83 -0
  261. package/template/src/hooks/use-fullscreen.ts +43 -0
  262. package/template/src/hooks/use-mobile.ts +18 -0
  263. package/template/src/hooks/use-sidebar-config.ts +15 -0
  264. package/template/src/hooks/use-theme-manager.ts +218 -0
  265. package/template/src/hooks/use-theme.ts +11 -0
  266. package/template/src/lib/data-table.ts +54 -0
  267. package/template/src/lib/fonts.ts +8 -0
  268. package/template/src/lib/utils.ts +7 -0
  269. package/template/src/proxy.ts +38 -0
  270. package/template/src/types/theme-customizer.ts +45 -0
  271. package/template/src/types/theme.ts +58 -0
  272. package/template/src/utils/shadcn-ui-theme-presets.ts +741 -0
  273. package/template/src/utils/tweakcn-theme-presets.ts +3425 -0
  274. package/template/tsconfig.json +41 -0
@@ -0,0 +1,265 @@
1
+ "use client"
2
+
3
+ import { useState } from "react"
4
+ import {
5
+ Check,
6
+ ChevronRight,
7
+ Plus,
8
+ Eye,
9
+ EyeOff,
10
+ MoreHorizontal,
11
+ } from "lucide-react"
12
+
13
+ import {
14
+ Collapsible,
15
+ CollapsibleContent,
16
+ CollapsibleTrigger,
17
+ } from "@/components/ui/collapsible"
18
+ import {
19
+ DropdownMenu,
20
+ DropdownMenuContent,
21
+ DropdownMenuGroup,
22
+ DropdownMenuItem,
23
+ DropdownMenuSeparator,
24
+ DropdownMenuTrigger,
25
+ } from "@/components/ui/dropdown-menu"
26
+ import { cn } from "@/lib/utils"
27
+
28
+ interface CalendarItem {
29
+ id: string
30
+ name: string
31
+ color: string
32
+ visible: boolean
33
+ type: "personal" | "work" | "shared"
34
+ }
35
+
36
+ interface CalendarGroup {
37
+ name: string
38
+ items: CalendarItem[]
39
+ }
40
+
41
+ interface CalendarsProps {
42
+ calendars?: {
43
+ name: string
44
+ items: string[]
45
+ }[]
46
+ onCalendarToggle?: (calendarId: string, visible: boolean) => void
47
+ onCalendarEdit?: (calendarId: string) => void
48
+ onCalendarDelete?: (calendarId: string) => void
49
+ onNewCalendar?: () => void
50
+ }
51
+
52
+ // Enhanced calendar data with colors and visibility
53
+ const enhancedCalendars: CalendarGroup[] = [
54
+ {
55
+ name: "My Calendars",
56
+ items: [
57
+ {
58
+ id: "personal",
59
+ name: "Personal",
60
+ color: "bg-blue-500",
61
+ visible: true,
62
+ type: "personal",
63
+ },
64
+ {
65
+ id: "work",
66
+ name: "Work",
67
+ color: "bg-green-500",
68
+ visible: true,
69
+ type: "work",
70
+ },
71
+ {
72
+ id: "family",
73
+ name: "Family",
74
+ color: "bg-pink-500",
75
+ visible: true,
76
+ type: "personal",
77
+ },
78
+ ],
79
+ },
80
+ {
81
+ name: "Favorites",
82
+ items: [
83
+ {
84
+ id: "holidays",
85
+ name: "Holidays",
86
+ color: "bg-red-500",
87
+ visible: true,
88
+ type: "shared",
89
+ },
90
+ {
91
+ id: "birthdays",
92
+ name: "Birthdays",
93
+ color: "bg-purple-500",
94
+ visible: true,
95
+ type: "personal",
96
+ },
97
+ ],
98
+ },
99
+ {
100
+ name: "Other",
101
+ items: [
102
+ {
103
+ id: "travel",
104
+ name: "Travel",
105
+ color: "bg-orange-500",
106
+ visible: false,
107
+ type: "personal",
108
+ },
109
+ {
110
+ id: "reminders",
111
+ name: "Reminders",
112
+ color: "bg-yellow-500",
113
+ visible: true,
114
+ type: "personal",
115
+ },
116
+ {
117
+ id: "deadlines",
118
+ name: "Deadlines",
119
+ color: "bg-red-600",
120
+ visible: true,
121
+ type: "work",
122
+ },
123
+ ],
124
+ },
125
+ ]
126
+
127
+ export function Calendars({
128
+ onCalendarToggle,
129
+ onCalendarEdit,
130
+ onCalendarDelete,
131
+ onNewCalendar,
132
+ }: CalendarsProps) {
133
+ const [calendarData, setCalendarData] = useState(enhancedCalendars)
134
+
135
+ const handleToggleVisibility = (calendarId: string) => {
136
+ setCalendarData((prev) =>
137
+ prev.map((group) => ({
138
+ ...group,
139
+ items: group.items.map((item) =>
140
+ item.id === calendarId ? { ...item, visible: !item.visible } : item
141
+ ),
142
+ }))
143
+ )
144
+
145
+ const calendar = calendarData
146
+ .flatMap((g) => g.items)
147
+ .find((c) => c.id === calendarId)
148
+ if (calendar) {
149
+ onCalendarToggle?.(calendarId, !calendar.visible)
150
+ }
151
+ }
152
+
153
+ return (
154
+ <div className="flex flex-col gap-4">
155
+ {calendarData.map((calendar, index) => (
156
+ <div key={calendar.name}>
157
+ <Collapsible defaultOpen={index === 0} className="group/collapsible">
158
+ <CollapsibleTrigger className="flex items-center justify-between w-full p-2 hover:bg-accent hover:text-accent-foreground rounded-md cursor-pointer">
159
+ <span className="text-sm font-medium">{calendar.name}</span>
160
+ <div className="flex items-center gap-1">
161
+ {index === 0 && (
162
+ <div
163
+ className="size-5 flex items-center justify-center opacity-0 group-hover/collapsible:opacity-100 cursor-pointer hover:bg-accent rounded-sm"
164
+ onClick={(e) => {
165
+ e.stopPropagation()
166
+ onNewCalendar?.()
167
+ }}
168
+ >
169
+ <Plus className="size-3" />
170
+ </div>
171
+ )}
172
+ <ChevronRight className="size-4 transition-transform group-data-open/collapsible:rotate-90" />
173
+ </div>
174
+ </CollapsibleTrigger>
175
+
176
+ <CollapsibleContent>
177
+ <div className="flex flex-col mt-2 gap-1">
178
+ {calendar.items.map((item) => (
179
+ <div key={item.id} className="group/calendar-item">
180
+ <div className="flex items-center justify-between p-2 hover:bg-accent/50 rounded-md">
181
+ <div className="flex items-center gap-3 flex-1">
182
+ {/* Calendar Color & Visibility Toggle */}
183
+ <button
184
+ onClick={() => handleToggleVisibility(item.id)}
185
+ className={cn(
186
+ "flex aspect-square size-4 shrink-0 items-center justify-center rounded-sm border transition-all cursor-pointer",
187
+ item.visible
188
+ ? cn("border-transparent text-white", item.color)
189
+ : "border-border bg-transparent"
190
+ )}
191
+ >
192
+ {item.visible && <Check className="size-3" />}
193
+ </button>
194
+
195
+ {/* Calendar Name */}
196
+ <span
197
+ className={cn(
198
+ "flex-1 truncate text-sm cursor-pointer",
199
+ !item.visible && "text-muted-foreground"
200
+ )}
201
+ onClick={() => handleToggleVisibility(item.id)}
202
+ >
203
+ {item.name}
204
+ </span>
205
+
206
+ {/* Visibility Icon */}
207
+ <div className="opacity-0 group-hover/calendar-item:opacity-100">
208
+ {item.visible ? (
209
+ <Eye className="size-3 text-muted-foreground" />
210
+ ) : (
211
+ <EyeOff className="size-3 text-muted-foreground" />
212
+ )}
213
+ </div>
214
+
215
+ {/* More Options */}
216
+ <DropdownMenu>
217
+ <DropdownMenuTrigger
218
+ nativeButton={false}
219
+ render={
220
+ <div
221
+ className="size-5 flex items-center justify-center p-0 opacity-0 group-hover/calendar-item:opacity-100 cursor-pointer hover:bg-accent rounded-sm"
222
+ onClick={(e) => e.stopPropagation()}
223
+ />
224
+ }
225
+ >
226
+ <MoreHorizontal />
227
+ </DropdownMenuTrigger>
228
+ <DropdownMenuContent align="end" side="right">
229
+ <DropdownMenuGroup>
230
+ <DropdownMenuItem
231
+ onClick={() => onCalendarEdit?.(item.id)}
232
+ className="cursor-pointer"
233
+ >
234
+ Edit calendar
235
+ </DropdownMenuItem>
236
+ <DropdownMenuItem
237
+ onClick={() => handleToggleVisibility(item.id)}
238
+ className="cursor-pointer"
239
+ >
240
+ {item.visible ? "Hide" : "Show"} calendar
241
+ </DropdownMenuItem>
242
+ </DropdownMenuGroup>
243
+ <DropdownMenuSeparator />
244
+ <DropdownMenuGroup>
245
+ <DropdownMenuItem
246
+ onClick={() => onCalendarDelete?.(item.id)}
247
+ className="cursor-pointer text-destructive"
248
+ >
249
+ Delete calendar
250
+ </DropdownMenuItem>
251
+ </DropdownMenuGroup>
252
+ </DropdownMenuContent>
253
+ </DropdownMenu>
254
+ </div>
255
+ </div>
256
+ </div>
257
+ ))}
258
+ </div>
259
+ </CollapsibleContent>
260
+ </Collapsible>
261
+ </div>
262
+ ))}
263
+ </div>
264
+ )
265
+ }
@@ -0,0 +1,56 @@
1
+ "use client"
2
+
3
+ import { useState } from "react"
4
+ import { Calendar } from "@/components/ui/calendar"
5
+
6
+ interface DatePickerProps {
7
+ selectedDate?: Date
8
+ onDateSelect?: (date: Date) => void
9
+ events?: Array<{ date: Date; count: number }>
10
+ }
11
+
12
+ export function DatePicker({
13
+ selectedDate,
14
+ onDateSelect,
15
+ events = [],
16
+ }: DatePickerProps) {
17
+ const [date, setDate] = useState<Date | undefined>(selectedDate || new Date())
18
+
19
+ const handleDateSelect = (selectedDate: Date | undefined) => {
20
+ if (selectedDate) {
21
+ setDate(selectedDate)
22
+ onDateSelect?.(selectedDate)
23
+ }
24
+ }
25
+
26
+ // Create a map of dates with events for styling
27
+ const eventDates = events.reduce(
28
+ (acc, event) => {
29
+ const dateKey = event.date.toDateString()
30
+ acc[dateKey] = event.count
31
+ return acc
32
+ },
33
+ {} as Record<string, number>
34
+ )
35
+
36
+ return (
37
+ <div className="flex justify-center">
38
+ <Calendar
39
+ mode="single"
40
+ selected={date}
41
+ onSelect={handleDateSelect}
42
+ className="w-full [&_[role=gridcell]_button]:cursor-pointer [&_button]:cursor-pointer"
43
+ modifiers={{
44
+ hasEvents: (date) => {
45
+ const eventCount = eventDates[date.toDateString()]
46
+ return Boolean(eventCount && eventCount > 0)
47
+ },
48
+ }}
49
+ modifiersClassNames={{
50
+ hasEvents:
51
+ "relative after:absolute after:bottom-1 after:right-1 after:w-1.5 after:h-1.5 after:bg-primary after:rounded-full",
52
+ }}
53
+ />
54
+ </div>
55
+ )
56
+ }