nextworks 0.0.1 → 0.1.0-alpha.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 (277) hide show
  1. package/README.md +209 -30
  2. package/dist/.gitkeep +0 -0
  3. package/dist/cli_manifests/auth_manifest.json +86 -0
  4. package/dist/cli_manifests/blocks_manifest.json +185 -0
  5. package/dist/cli_manifests/data_manifest.json +51 -0
  6. package/dist/cli_manifests/forms_manifest.json +61 -0
  7. package/dist/commands/admin-posts.d.ts +2 -0
  8. package/dist/commands/admin-posts.d.ts.map +1 -0
  9. package/dist/commands/admin-posts.js +15 -0
  10. package/dist/commands/admin-posts.js.map +1 -0
  11. package/dist/commands/admin-users.d.ts +2 -0
  12. package/dist/commands/admin-users.d.ts.map +1 -0
  13. package/dist/commands/admin-users.js +15 -0
  14. package/dist/commands/admin-users.js.map +1 -0
  15. package/dist/commands/auth-core.d.ts +2 -0
  16. package/dist/commands/auth-core.d.ts.map +1 -0
  17. package/dist/commands/auth-core.js +83 -0
  18. package/dist/commands/auth-core.js.map +1 -0
  19. package/dist/commands/auth-forms.d.ts +2 -0
  20. package/dist/commands/auth-forms.d.ts.map +1 -0
  21. package/dist/commands/auth-forms.js +15 -0
  22. package/dist/commands/auth-forms.js.map +1 -0
  23. package/dist/commands/blocks-options.d.ts +7 -0
  24. package/dist/commands/blocks-options.d.ts.map +1 -0
  25. package/dist/commands/blocks-options.js +19 -0
  26. package/dist/commands/blocks-options.js.map +1 -0
  27. package/dist/commands/blocks.d.ts +7 -0
  28. package/dist/commands/blocks.d.ts.map +1 -0
  29. package/dist/commands/blocks.js +140 -0
  30. package/dist/commands/blocks.js.map +1 -0
  31. package/dist/commands/data.d.ts +3 -0
  32. package/dist/commands/data.d.ts.map +1 -0
  33. package/dist/commands/data.js +88 -0
  34. package/dist/commands/data.js.map +1 -0
  35. package/dist/commands/forms.d.ts +6 -0
  36. package/dist/commands/forms.d.ts.map +1 -0
  37. package/dist/commands/forms.js +107 -0
  38. package/dist/commands/forms.js.map +1 -0
  39. package/dist/commands/remove-auth-core.d.ts +2 -0
  40. package/dist/commands/remove-auth-core.d.ts.map +1 -0
  41. package/dist/commands/remove-auth-core.js +69 -0
  42. package/dist/commands/remove-auth-core.js.map +1 -0
  43. package/dist/commands/remove-blocks.d.ts +2 -0
  44. package/dist/commands/remove-blocks.d.ts.map +1 -0
  45. package/dist/commands/remove-blocks.js +36 -0
  46. package/dist/commands/remove-blocks.js.map +1 -0
  47. package/dist/index.d.ts +3 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +109 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/kits/auth-core/README.md +82 -0
  52. package/dist/kits/auth-core/app/(protected)/dashboard/page.tsx +8 -0
  53. package/dist/kits/auth-core/app/(protected)/layout.tsx +18 -0
  54. package/dist/kits/auth-core/app/(protected)/settings/profile/page.tsx +15 -0
  55. package/dist/kits/auth-core/app/(protected)/settings/profile/profile-form.tsx +114 -0
  56. package/dist/kits/auth-core/app/api/auth/[...nextauth]/route.ts +1 -0
  57. package/dist/kits/auth-core/app/api/auth/forgot-password/route.ts +114 -0
  58. package/dist/kits/auth-core/app/api/auth/providers/route.ts +6 -0
  59. package/dist/kits/auth-core/app/api/auth/reset-password/route.ts +63 -0
  60. package/dist/kits/auth-core/app/api/auth/send-verify-email/route.ts +6 -0
  61. package/dist/kits/auth-core/app/api/signup/route.ts +41 -0
  62. package/dist/kits/auth-core/app/auth/forgot-password/page.tsx +21 -0
  63. package/dist/kits/auth-core/app/auth/login/page.tsx +5 -0
  64. package/dist/kits/auth-core/app/auth/reset-password/page.tsx +187 -0
  65. package/dist/kits/auth-core/app/auth/signup/page.tsx +5 -0
  66. package/dist/kits/auth-core/app/auth/verify-email/page.tsx +11 -0
  67. package/dist/kits/auth-core/components/admin/admin-header.tsx +57 -0
  68. package/dist/kits/auth-core/components/auth/dashboard.tsx +237 -0
  69. package/dist/kits/auth-core/components/auth/forgot-password-form.tsx +90 -0
  70. package/dist/kits/auth-core/components/auth/login-form.tsx +467 -0
  71. package/dist/kits/auth-core/components/auth/logout-button.tsx +50 -0
  72. package/dist/kits/auth-core/components/auth/minimal-logout-button.tsx +40 -0
  73. package/dist/kits/auth-core/components/auth/signup-form.tsx +468 -0
  74. package/dist/kits/auth-core/components/require-auth.tsx +59 -0
  75. package/dist/kits/auth-core/components/session-provider.tsx +11 -0
  76. package/dist/kits/auth-core/components/ui/README.txt +1 -0
  77. package/dist/kits/auth-core/components/ui/button.tsx +55 -0
  78. package/dist/kits/auth-core/components/ui/input.tsx +25 -0
  79. package/dist/kits/auth-core/components/ui/label.tsx +23 -0
  80. package/dist/kits/auth-core/lib/api/errors.ts +14 -0
  81. package/dist/kits/auth-core/lib/auth-helpers.ts +29 -0
  82. package/dist/kits/auth-core/lib/auth.ts +142 -0
  83. package/dist/kits/auth-core/lib/email/dev-transport.ts +42 -0
  84. package/dist/kits/auth-core/lib/email/index.ts +28 -0
  85. package/dist/kits/auth-core/lib/email/provider-smtp.ts +36 -0
  86. package/dist/kits/auth-core/lib/forms/map-errors.ts +11 -0
  87. package/dist/kits/auth-core/lib/hash.ts +6 -0
  88. package/dist/kits/auth-core/lib/prisma.ts +15 -0
  89. package/dist/kits/auth-core/lib/server/result.ts +45 -0
  90. package/dist/kits/auth-core/lib/utils.ts +6 -0
  91. package/dist/kits/auth-core/lib/validation/forms.ts +88 -0
  92. package/dist/kits/auth-core/package-deps.json +19 -0
  93. package/dist/kits/auth-core/prisma/auth-models.prisma +81 -0
  94. package/dist/kits/auth-core/prisma/schema.prisma +81 -0
  95. package/dist/kits/auth-core/scripts/populate-tokenhash.mjs +26 -0
  96. package/dist/kits/auth-core/scripts/promote-admin.mjs +33 -0
  97. package/dist/kits/auth-core/scripts/seed-demo.mjs +40 -0
  98. package/dist/kits/auth-core/types/next-auth.d.ts +25 -0
  99. package/dist/kits/blocks/README.md +53 -0
  100. package/dist/kits/blocks/app/globals.css +175 -0
  101. package/dist/kits/blocks/app/templates/digitalagency/PresetThemeVars.tsx +80 -0
  102. package/dist/kits/blocks/app/templates/digitalagency/README.md +36 -0
  103. package/dist/kits/blocks/app/templates/digitalagency/components/About.tsx +99 -0
  104. package/dist/kits/blocks/app/templates/digitalagency/components/CTA.tsx +74 -0
  105. package/dist/kits/blocks/app/templates/digitalagency/components/Contact.tsx +227 -0
  106. package/dist/kits/blocks/app/templates/digitalagency/components/Footer.tsx +89 -0
  107. package/dist/kits/blocks/app/templates/digitalagency/components/Hero.tsx +90 -0
  108. package/dist/kits/blocks/app/templates/digitalagency/components/Navbar.tsx +168 -0
  109. package/dist/kits/blocks/app/templates/digitalagency/components/NetworkPattern.tsx +297 -0
  110. package/dist/kits/blocks/app/templates/digitalagency/components/Portfolio.tsx +157 -0
  111. package/dist/kits/blocks/app/templates/digitalagency/components/Pricing.tsx +114 -0
  112. package/dist/kits/blocks/app/templates/digitalagency/components/Process.tsx +59 -0
  113. package/dist/kits/blocks/app/templates/digitalagency/components/Services.tsx +55 -0
  114. package/dist/kits/blocks/app/templates/digitalagency/components/Team.tsx +28 -0
  115. package/dist/kits/blocks/app/templates/digitalagency/components/Testimonials.tsx +65 -0
  116. package/dist/kits/blocks/app/templates/digitalagency/page.tsx +38 -0
  117. package/dist/kits/blocks/app/templates/gallery/PresetThemeVars.tsx +85 -0
  118. package/dist/kits/blocks/app/templates/gallery/page.tsx +303 -0
  119. package/dist/kits/blocks/app/templates/productlaunch/PresetThemeVars.tsx +74 -0
  120. package/dist/kits/blocks/app/templates/productlaunch/README.md +55 -0
  121. package/dist/kits/blocks/app/templates/productlaunch/components/About.tsx +178 -0
  122. package/dist/kits/blocks/app/templates/productlaunch/components/CTA.tsx +93 -0
  123. package/dist/kits/blocks/app/templates/productlaunch/components/Contact.tsx +231 -0
  124. package/dist/kits/blocks/app/templates/productlaunch/components/FAQ.tsx +93 -0
  125. package/dist/kits/blocks/app/templates/productlaunch/components/Features.tsx +84 -0
  126. package/dist/kits/blocks/app/templates/productlaunch/components/Footer.tsx +132 -0
  127. package/dist/kits/blocks/app/templates/productlaunch/components/Hero.tsx +89 -0
  128. package/dist/kits/blocks/app/templates/productlaunch/components/Navbar.tsx +162 -0
  129. package/dist/kits/blocks/app/templates/productlaunch/components/Pricing.tsx +106 -0
  130. package/dist/kits/blocks/app/templates/productlaunch/components/ProcessTimeline.tsx +110 -0
  131. package/dist/kits/blocks/app/templates/productlaunch/components/ServicesGrid.tsx +68 -0
  132. package/dist/kits/blocks/app/templates/productlaunch/components/Team.tsx +104 -0
  133. package/dist/kits/blocks/app/templates/productlaunch/components/Testimonials.tsx +89 -0
  134. package/dist/kits/blocks/app/templates/productlaunch/components/TrustBadges.tsx +76 -0
  135. package/dist/kits/blocks/app/templates/productlaunch/page.tsx +45 -0
  136. package/dist/kits/blocks/app/templates/saasdashboard/PresetThemeVars.tsx +80 -0
  137. package/dist/kits/blocks/app/templates/saasdashboard/README.md +38 -0
  138. package/dist/kits/blocks/app/templates/saasdashboard/components/Contact.tsx +176 -0
  139. package/dist/kits/blocks/app/templates/saasdashboard/components/Dashboard.tsx +293 -0
  140. package/dist/kits/blocks/app/templates/saasdashboard/components/FAQ.tsx +55 -0
  141. package/dist/kits/blocks/app/templates/saasdashboard/components/Features.tsx +91 -0
  142. package/dist/kits/blocks/app/templates/saasdashboard/components/Footer.tsx +77 -0
  143. package/dist/kits/blocks/app/templates/saasdashboard/components/Hero.tsx +105 -0
  144. package/dist/kits/blocks/app/templates/saasdashboard/components/Hero_mask.tsx +127 -0
  145. package/dist/kits/blocks/app/templates/saasdashboard/components/Navbar.tsx +159 -0
  146. package/dist/kits/blocks/app/templates/saasdashboard/components/Pricing.tsx +90 -0
  147. package/dist/kits/blocks/app/templates/saasdashboard/components/SmoothScroll.tsx +97 -0
  148. package/dist/kits/blocks/app/templates/saasdashboard/components/Testimonials.tsx +72 -0
  149. package/dist/kits/blocks/app/templates/saasdashboard/components/TrustBadges.tsx +53 -0
  150. package/dist/kits/blocks/app/templates/saasdashboard/page.tsx +39 -0
  151. package/dist/kits/blocks/components/app-providers.tsx +1 -0
  152. package/dist/kits/blocks/components/enhanced-theme-provider.tsx +195 -0
  153. package/dist/kits/blocks/components/sections/About.tsx +291 -0
  154. package/dist/kits/blocks/components/sections/CTA.tsx +258 -0
  155. package/dist/kits/blocks/components/sections/Contact.tsx +267 -0
  156. package/dist/kits/blocks/components/sections/FAQ.tsx +226 -0
  157. package/dist/kits/blocks/components/sections/Features.tsx +269 -0
  158. package/dist/kits/blocks/components/sections/Footer.tsx +302 -0
  159. package/dist/kits/blocks/components/sections/HeroMotion.tsx +307 -0
  160. package/dist/kits/blocks/components/sections/HeroOverlay.tsx +358 -0
  161. package/dist/kits/blocks/components/sections/HeroSplit.tsx +352 -0
  162. package/dist/kits/blocks/components/sections/Navbar.tsx +353 -0
  163. package/dist/kits/blocks/components/sections/Newsletter.tsx +156 -0
  164. package/dist/kits/blocks/components/sections/PortfolioSimple.tsx +550 -0
  165. package/dist/kits/blocks/components/sections/Pricing.tsx +264 -0
  166. package/dist/kits/blocks/components/sections/ProcessTimeline.tsx +325 -0
  167. package/dist/kits/blocks/components/sections/ServicesGrid.tsx +210 -0
  168. package/dist/kits/blocks/components/sections/Team.tsx +309 -0
  169. package/dist/kits/blocks/components/sections/Testimonials.tsx +158 -0
  170. package/dist/kits/blocks/components/sections/TrustBadges.tsx +162 -0
  171. package/dist/kits/blocks/components/theme-provider.tsx +34 -0
  172. package/dist/kits/blocks/components/ui/alert-dialog.tsx +134 -0
  173. package/dist/kits/blocks/components/ui/brand-node.tsx +121 -0
  174. package/dist/kits/blocks/components/ui/button.tsx +122 -0
  175. package/dist/kits/blocks/components/ui/button_bck.tsx +93 -0
  176. package/dist/kits/blocks/components/ui/card.tsx +95 -0
  177. package/dist/kits/blocks/components/ui/checkbox.tsx +30 -0
  178. package/dist/kits/blocks/components/ui/cta-button.tsx +125 -0
  179. package/dist/kits/blocks/components/ui/dropdown-menu.tsx +201 -0
  180. package/dist/kits/blocks/components/ui/feature-card.tsx +91 -0
  181. package/dist/kits/blocks/components/ui/input.tsx +27 -0
  182. package/dist/kits/blocks/components/ui/label.tsx +29 -0
  183. package/dist/kits/blocks/components/ui/pricing-card.tsx +120 -0
  184. package/dist/kits/blocks/components/ui/select.tsx +25 -0
  185. package/dist/kits/blocks/components/ui/skeleton.tsx +13 -0
  186. package/dist/kits/blocks/components/ui/switch.tsx +78 -0
  187. package/dist/kits/blocks/components/ui/table.tsx +98 -0
  188. package/dist/kits/blocks/components/ui/testimonial-card.tsx +108 -0
  189. package/dist/kits/blocks/components/ui/textarea.tsx +26 -0
  190. package/dist/kits/blocks/components/ui/theme-selector.tsx +247 -0
  191. package/dist/kits/blocks/components/ui/theme-toggle.tsx +74 -0
  192. package/dist/kits/blocks/components/ui/toaster.tsx +7 -0
  193. package/dist/kits/blocks/lib/themes.ts +399 -0
  194. package/dist/kits/blocks/lib/themes_old.ts +37 -0
  195. package/dist/kits/blocks/lib/utils.ts +9 -0
  196. package/dist/kits/blocks/next.config.ts +11 -0
  197. package/dist/kits/blocks/notes/THEME_GUIDE.md +29 -0
  198. package/dist/kits/blocks/notes/THEMING_CONVERSION_SUMMARY.md +14 -0
  199. package/dist/kits/blocks/package-deps.json +22 -0
  200. package/dist/kits/blocks/public/placeholders/gallery/hero-pexels-broken-9945014.avif +0 -0
  201. package/dist/kits/blocks/public/placeholders/gallery/pexels-googledeepmind-25626431.jpg +0 -0
  202. package/dist/kits/blocks/public/placeholders/gallery/pexels-googledeepmind-25626432.jpg +0 -0
  203. package/dist/kits/blocks/public/placeholders/gallery/pexels-googledeepmind-25626434.jpg +0 -0
  204. package/dist/kits/blocks/public/placeholders/gallery/pexels-googledeepmind-25626436.jpg +0 -0
  205. package/dist/kits/blocks/public/placeholders/product_launch/feature_1.png +0 -0
  206. package/dist/kits/blocks/public/placeholders/product_launch/feature_2.png +0 -0
  207. package/dist/kits/blocks/public/placeholders/product_launch/feature_3.png +0 -0
  208. package/dist/kits/blocks/public/placeholders/product_launch/feature_4.png +0 -0
  209. package/dist/kits/blocks/public/placeholders/product_launch/hero.png +0 -0
  210. package/dist/kits/blocks/public/placeholders/saas_dashboard/analytics.png +0 -0
  211. package/dist/kits/blocks/public/placeholders/saas_dashboard/chat.png +0 -0
  212. package/dist/kits/blocks/public/placeholders/saas_dashboard/projectBoard.png +0 -0
  213. package/dist/kits/data/.gitkeep +0 -0
  214. package/dist/kits/data/README.md +80 -0
  215. package/dist/kits/data/app/(protected)/admin/posts/page.tsx +5 -0
  216. package/dist/kits/data/app/(protected)/admin/users/page.tsx +5 -0
  217. package/dist/kits/data/app/api/posts/[id]/route.ts +83 -0
  218. package/dist/kits/data/app/api/posts/route.ts +138 -0
  219. package/dist/kits/data/app/api/seed-demo/route.ts +45 -0
  220. package/dist/kits/data/app/api/users/[id]/route.ts +127 -0
  221. package/dist/kits/data/app/api/users/check-email/route.ts +18 -0
  222. package/dist/kits/data/app/api/users/check-unique/route.ts +27 -0
  223. package/dist/kits/data/app/api/users/route.ts +79 -0
  224. package/dist/kits/data/app/examples/demo/README.md +4 -0
  225. package/dist/kits/data/app/examples/demo/create-post-form.tsx +106 -0
  226. package/dist/kits/data/app/examples/demo/page.tsx +118 -0
  227. package/dist/kits/data/app/examples/demo/seed-demo-button.tsx +37 -0
  228. package/dist/kits/data/components/admin/posts-manager.tsx +719 -0
  229. package/dist/kits/data/components/admin/users-manager.tsx +432 -0
  230. package/dist/kits/data/lib/prisma.ts +15 -0
  231. package/dist/kits/data/lib/server/result.ts +90 -0
  232. package/dist/kits/data/package-deps.json +11 -0
  233. package/dist/kits/data/scripts/seed-demo.mjs +41 -0
  234. package/dist/kits/forms/.gitkeep +0 -0
  235. package/dist/kits/forms/README.md +49 -0
  236. package/dist/kits/forms/app/.gitkeep +0 -0
  237. package/dist/kits/forms/app/api/wizard/route.ts +71 -0
  238. package/dist/kits/forms/app/examples/forms/basic/page.tsx +124 -0
  239. package/dist/kits/forms/app/examples/forms/server-action/form-client.tsx +28 -0
  240. package/dist/kits/forms/app/examples/forms/server-action/page.tsx +71 -0
  241. package/dist/kits/forms/app/examples/forms/wizard/page.tsx +15 -0
  242. package/dist/kits/forms/app/examples/forms/wizard/wizard-client.tsx +2 -0
  243. package/dist/kits/forms/components/.gitkeep +0 -0
  244. package/dist/kits/forms/components/examples/wizard-client.tsx +231 -0
  245. package/dist/kits/forms/components/hooks/useCheckUnique.ts +79 -0
  246. package/dist/kits/forms/components/ui/button.tsx +122 -0
  247. package/dist/kits/forms/components/ui/checkbox.tsx +30 -0
  248. package/dist/kits/forms/components/ui/form/context.ts +33 -0
  249. package/dist/kits/forms/components/ui/form/form-control.tsx +28 -0
  250. package/dist/kits/forms/components/ui/form/form-description.tsx +22 -0
  251. package/dist/kits/forms/components/ui/form/form-field.tsx +36 -0
  252. package/dist/kits/forms/components/ui/form/form-item.tsx +21 -0
  253. package/dist/kits/forms/components/ui/form/form-label.tsx +24 -0
  254. package/dist/kits/forms/components/ui/form/form-message.tsx +29 -0
  255. package/dist/kits/forms/components/ui/form/form.tsx +26 -0
  256. package/dist/kits/forms/components/ui/input.tsx +27 -0
  257. package/dist/kits/forms/components/ui/label.tsx +29 -0
  258. package/dist/kits/forms/components/ui/select.tsx +25 -0
  259. package/dist/kits/forms/components/ui/switch.tsx +78 -0
  260. package/dist/kits/forms/components/ui/textarea.tsx +26 -0
  261. package/dist/kits/forms/lib/.gitkeep +0 -0
  262. package/dist/kits/forms/lib/forms/map-errors.ts +29 -0
  263. package/dist/kits/forms/lib/prisma.ts +16 -0
  264. package/dist/kits/forms/lib/utils.ts +9 -0
  265. package/dist/kits/forms/lib/validation/forms.ts +88 -0
  266. package/dist/kits/forms/lib/validation/wizard.ts +32 -0
  267. package/dist/kits/forms/package-deps.json +17 -0
  268. package/dist/utils/file-operations.d.ts +18 -0
  269. package/dist/utils/file-operations.d.ts.map +1 -0
  270. package/dist/utils/file-operations.js +327 -0
  271. package/dist/utils/file-operations.js.map +1 -0
  272. package/dist/utils/installation-tracker.d.ts +26 -0
  273. package/dist/utils/installation-tracker.d.ts.map +1 -0
  274. package/dist/utils/installation-tracker.js +98 -0
  275. package/dist/utils/installation-tracker.js.map +1 -0
  276. package/package.json +51 -21
  277. package/index.js +0 -1
@@ -0,0 +1,247 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { Check, Palette, Wrench } from "lucide-react";
5
+ import { useTheme } from "next-themes";
6
+ import { useThemeVariant } from "@/components/enhanced-theme-provider";
7
+ import {
8
+ themes,
9
+ darkThemes,
10
+ ThemeVariant,
11
+ type ThemeConfig,
12
+ } from "@/lib/themes";
13
+
14
+ import { Button } from "@/components/ui/button";
15
+ import {
16
+ DropdownMenu,
17
+ DropdownMenuContent,
18
+ DropdownMenuItem,
19
+ DropdownMenuLabel,
20
+ DropdownMenuSeparator,
21
+ DropdownMenuTrigger,
22
+ } from "@/components/ui/dropdown-menu";
23
+
24
+ type ThemeSelectorProps = React.ComponentPropsWithoutRef<typeof Button> & {
25
+ ariaLabel?: string;
26
+ label?: string; // optional override for the visible text ("Theme")
27
+ };
28
+
29
+ export function ThemeSelector({
30
+ ariaLabel = "Demo: Color theme",
31
+ label = "Theme",
32
+ className,
33
+ ...buttonProps
34
+ }: ThemeSelectorProps) {
35
+ const { theme, setTheme } = useTheme();
36
+ const { themeVariant, setThemeVariant, setCustomBrandColors } =
37
+ useThemeVariant();
38
+
39
+ const isDark = theme === "dark";
40
+
41
+ const [showCustom, setShowCustom] = React.useState(false);
42
+ const [custom, setCustom] = React.useState<Partial<ThemeConfig["colors"]>>(
43
+ {},
44
+ );
45
+
46
+ function openCustomDialog() {
47
+ setCustom({});
48
+ setShowCustom(true);
49
+ }
50
+
51
+ function applyCustom() {
52
+ setCustomBrandColors(custom);
53
+ document.cookie = `theme-variant=custom; Path=/; Max-Age=31536000; SameSite=Lax`;
54
+ document.cookie = `theme-custom=${encodeURIComponent(JSON.stringify(custom))}; Path=/; Max-Age=31536000; SameSite=Lax`;
55
+ setShowCustom(false);
56
+ }
57
+
58
+ return (
59
+ <DropdownMenu>
60
+ <DropdownMenuTrigger asChild>
61
+ <Button
62
+ variant="outline"
63
+ size="sm"
64
+ className={`gap-2 ${className ?? ""}`}
65
+ aria-label={ariaLabel}
66
+ {...buttonProps}
67
+ >
68
+ <Palette className="h-4 w-4" />
69
+ {label}
70
+ </Button>
71
+ </DropdownMenuTrigger>
72
+ <DropdownMenuContent align="end" className="w-64">
73
+ <DropdownMenuLabel className="space-y-1">
74
+ <div className="flex items-center justify-between">
75
+ <span>Color theme variants</span>
76
+ <span
77
+ aria-hidden="true"
78
+ className="border-border bg-muted/50 text-muted-foreground rounded-md border px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase"
79
+ >
80
+ Gallery
81
+ </span>
82
+ </div>
83
+ <p className="text-muted-foreground text-xs">
84
+ Affects this preview only ( button is not part of the shared Navbar.
85
+ )
86
+ </p>
87
+ </DropdownMenuLabel>
88
+ {/* <DropdownMenuLabel>
89
+ Color theme variants — gallery only
90
+ </DropdownMenuLabel> */}
91
+ {/* <DropdownMenuLabel>Theme preview controls</DropdownMenuLabel> */}
92
+
93
+ <DropdownMenuSeparator />
94
+ {Object.entries(themes).map(([key, themeConfig]) => (
95
+ <DropdownMenuItem
96
+ key={key}
97
+ onClick={() => {
98
+ setThemeVariant(key as ThemeVariant);
99
+ document.cookie = `theme-variant=${key}; Path=/; Max-Age=31536000; SameSite=Lax`;
100
+ }}
101
+ className="flex items-center justify-between"
102
+ >
103
+ <div className="flex items-center gap-2">
104
+ <div
105
+ className="h-4 w-4 rounded-full border"
106
+ style={{
107
+ backgroundColor: isDark
108
+ ? darkThemes[key as ThemeVariant].colors.primary
109
+ : themeConfig.colors.primary,
110
+ }}
111
+ />
112
+ {themeConfig.name}
113
+ </div>
114
+ {themeVariant === key && <Check className="h-4 w-4" />}
115
+ </DropdownMenuItem>
116
+ ))}
117
+ <DropdownMenuSeparator />
118
+ <DropdownMenuLabel>Custom</DropdownMenuLabel>
119
+ <DropdownMenuItem
120
+ onClick={openCustomDialog}
121
+ className="flex items-center gap-2"
122
+ >
123
+ <Wrench className="h-4 w-4" />
124
+ Customize brand colors…
125
+ </DropdownMenuItem>
126
+
127
+ <DropdownMenuSeparator />
128
+ <DropdownMenuLabel>Appearance</DropdownMenuLabel>
129
+ <DropdownMenuItem onClick={() => setTheme("light")}>
130
+ Light
131
+ </DropdownMenuItem>
132
+ <DropdownMenuItem onClick={() => setTheme("dark")}>
133
+ Dark
134
+ </DropdownMenuItem>
135
+ <DropdownMenuItem onClick={() => setTheme("system")}>
136
+ System
137
+ </DropdownMenuItem>
138
+ </DropdownMenuContent>
139
+ {showCustom && (
140
+ <div className="fixed inset-0 z-[60] flex items-center justify-center bg-black/40 p-4">
141
+ <div
142
+ role="dialog"
143
+ aria-modal="true"
144
+ aria-labelledby="customBrandColorsTitle"
145
+ className="bg-popover text-popover-foreground w-full max-w-md rounded-md border p-4 shadow-lg"
146
+ >
147
+ <div
148
+ id="customBrandColorsTitle"
149
+ className="mb-3 text-sm font-semibold"
150
+ >
151
+ Custom brand colors
152
+ </div>
153
+ <div className="space-y-3">
154
+ <div className="flex items-center gap-3">
155
+ <label className="w-28 text-sm">primary</label>
156
+ <input
157
+ type="text"
158
+ placeholder="oklch(...) or #hex"
159
+ className="bg-background flex-1 rounded border p-2 text-sm"
160
+ value={custom.primary ?? ""}
161
+ onChange={(e) =>
162
+ setCustom((c) => ({ ...c, primary: e.target.value }))
163
+ }
164
+ />
165
+ <input
166
+ type="color"
167
+ className="h-8 w-10 cursor-pointer"
168
+ value={
169
+ typeof custom.primary === "string" &&
170
+ custom.primary.startsWith("#")
171
+ ? (custom.primary as string)
172
+ : "#000000"
173
+ }
174
+ onChange={(e) =>
175
+ setCustom((c) => ({ ...c, primary: e.target.value }))
176
+ }
177
+ />
178
+ </div>
179
+ <div className="flex items-center gap-3">
180
+ <label className="w-28 text-sm">accent</label>
181
+ <input
182
+ type="text"
183
+ placeholder="oklch(...) or #hex"
184
+ className="bg-background flex-1 rounded border p-2 text-sm"
185
+ value={custom.accent ?? ""}
186
+ onChange={(e) =>
187
+ setCustom((c) => ({ ...c, accent: e.target.value }))
188
+ }
189
+ />
190
+ <input
191
+ type="color"
192
+ className="h-8 w-10 cursor-pointer"
193
+ value={
194
+ typeof custom.accent === "string" &&
195
+ custom.accent.startsWith("#")
196
+ ? (custom.accent as string)
197
+ : "#000000"
198
+ }
199
+ onChange={(e) =>
200
+ setCustom((c) => ({ ...c, accent: e.target.value }))
201
+ }
202
+ />
203
+ </div>
204
+ <div className="flex items-center gap-3">
205
+ <label className="w-28 text-sm">ring</label>
206
+ <input
207
+ type="text"
208
+ placeholder="oklch(...) or #hex"
209
+ className="bg-background flex-1 rounded border p-2 text-sm"
210
+ value={custom.ring ?? ""}
211
+ onChange={(e) =>
212
+ setCustom((c) => ({ ...c, ring: e.target.value }))
213
+ }
214
+ />
215
+ <input
216
+ type="color"
217
+ className="h-8 w-10 cursor-pointer"
218
+ value={
219
+ typeof custom.ring === "string" &&
220
+ custom.ring.startsWith("#")
221
+ ? (custom.ring as string)
222
+ : "#000000"
223
+ }
224
+ onChange={(e) =>
225
+ setCustom((c) => ({ ...c, ring: e.target.value }))
226
+ }
227
+ />
228
+ </div>
229
+ </div>
230
+ <div className="mt-4 flex justify-end gap-2">
231
+ <Button
232
+ variant="outline"
233
+ size="sm"
234
+ onClick={() => setShowCustom(false)}
235
+ >
236
+ Cancel
237
+ </Button>
238
+ <Button size="sm" onClick={applyCustom}>
239
+ Apply
240
+ </Button>
241
+ </div>
242
+ </div>
243
+ </div>
244
+ )}
245
+ </DropdownMenu>
246
+ );
247
+ }
@@ -0,0 +1,74 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { Moon, Sun } from "lucide-react";
5
+ import { useTheme } from "next-themes";
6
+ import { cn } from "@/lib/utils";
7
+
8
+ import { Button } from "@/components/ui/button";
9
+
10
+ type ButtonProps = React.ComponentProps<typeof Button>;
11
+
12
+ export type ThemeToggleProps = {
13
+ /** Forwarded to internal Button. You can set unstyled, className, variant, size, etc. */
14
+ buttonProps?: Partial<ButtonProps>;
15
+ /** Optional aria-label override */
16
+ ariaLabel?: string;
17
+ /** Optional class overrides for icons */
18
+ moonClassName?: string;
19
+ sunClassName?: string;
20
+ };
21
+
22
+ export function ThemeToggle({
23
+ buttonProps,
24
+ ariaLabel = "Toggle theme",
25
+ moonClassName,
26
+ sunClassName,
27
+ }: ThemeToggleProps) {
28
+ const { theme, setTheme } = useTheme();
29
+
30
+ const mergedButtonProps: ButtonProps = {
31
+ variant: "outline",
32
+ size: "icon",
33
+ ...(buttonProps as ButtonProps),
34
+ className: cn(
35
+ "relative",
36
+ // Prefer preset variables if provided on Navbar
37
+ "bg-[var(--navbar-toggle-bg)] text-[var(--navbar-accent)] hover:bg-[var(--navbar-hover-bg)] focus-visible:ring-[var(--navbar-ring)]",
38
+ // Ensure border uses preset variable; provide width for unstyled cases
39
+ "border border-[var(--navbar-border)]",
40
+ buttonProps?.className,
41
+ ),
42
+ // Inline style ensures our accent wins over token classes even under dark: variants
43
+ style: {
44
+ ...(buttonProps?.style as React.CSSProperties),
45
+ color: "var(--navbar-accent)",
46
+ backgroundColor: "var(--navbar-toggle-bg)",
47
+ borderColor: "var(--navbar-border)",
48
+ // Tell Tailwind ring utilities which ring color to use
49
+ "--tw-ring-color": "var(--navbar-ring)",
50
+ },
51
+ } as ButtonProps;
52
+
53
+ return (
54
+ <Button
55
+ {...mergedButtonProps}
56
+ onClick={() => setTheme(theme === "light" ? "dark" : "light")}
57
+ aria-label={ariaLabel}
58
+ >
59
+ <Moon
60
+ className={cn(
61
+ "h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90",
62
+ moonClassName,
63
+ )}
64
+ />
65
+ <Sun
66
+ className={cn(
67
+ "absolute h-[1.2rem] w-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0",
68
+ sunClassName,
69
+ )}
70
+ />
71
+ <span className="sr-only">{ariaLabel}</span>
72
+ </Button>
73
+ );
74
+ }
@@ -0,0 +1,7 @@
1
+ "use client";
2
+
3
+ import { Toaster } from "sonner";
4
+
5
+ export default function AppToaster() {
6
+ return <Toaster position="top-center" richColors closeButton />;
7
+ }