@donotdev/ui 0.0.31 → 0.1.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.
Files changed (335) hide show
  1. package/LICENSE.md +3 -3
  2. package/dist/{GoToDialog-CR4VOVXT.js → GoToDialog-RU5RP7S2.js} +1 -1
  3. package/dist/chunk-ETE4RC7M.js +1 -0
  4. package/dist/components/auth/AuthHeader.d.ts +8 -3
  5. package/dist/components/auth/AuthHeader.d.ts.map +1 -1
  6. package/dist/components/auth/AuthHeader.js +6 -6
  7. package/dist/components/auth/AuthMenu.d.ts +2 -2
  8. package/dist/components/auth/AuthMenu.js +1 -1
  9. package/dist/components/common/FeatureCard.d.ts +2 -0
  10. package/dist/components/common/FeatureCard.d.ts.map +1 -1
  11. package/dist/components/common/FeatureCard.js +1 -1
  12. package/dist/components/common/FeatureDisabled.d.ts +2 -1
  13. package/dist/components/common/FeatureDisabled.d.ts.map +1 -1
  14. package/dist/components/common/FeatureDisabled.js +2 -2
  15. package/dist/components/common/ProgressBar.d.ts +1 -1
  16. package/dist/components/common/ProgressBar.js +2 -2
  17. package/dist/components/common/RedirectOverlay.d.ts +1 -1
  18. package/dist/components/common/RedirectOverlay.js +2 -2
  19. package/dist/components/common/Skeleton.d.ts +7 -7
  20. package/dist/components/common/Skeleton.js +8 -8
  21. package/dist/components/common/TechBento.d.ts +1 -0
  22. package/dist/components/common/TechBento.d.ts.map +1 -1
  23. package/dist/components/common/icon.d.ts +2 -1
  24. package/dist/components/common/icon.d.ts.map +1 -1
  25. package/dist/components/common/icon.js +2 -2
  26. package/dist/components/common/index.d.ts +1 -1
  27. package/dist/components/common/index.js +1 -1
  28. package/dist/components/cookie-consent/ConsentBanner.d.ts +1 -1
  29. package/dist/components/cookie-consent/ConsentBanner.js +2 -2
  30. package/dist/components/cookie-consent/CookieConsent.d.ts +1 -0
  31. package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
  32. package/dist/components/cookie-consent/index.d.ts +1 -1
  33. package/dist/components/cookie-consent/index.js +1 -1
  34. package/dist/components/index.d.ts +1 -1
  35. package/dist/components/index.js +1 -1
  36. package/dist/components/layout/GameContainer.d.ts +1 -1
  37. package/dist/components/layout/GameContainer.js +2 -2
  38. package/dist/components/layout/GameFlow.d.ts +2 -2
  39. package/dist/components/layout/GameFlow.js +2 -2
  40. package/dist/components/layout/PageConfig.d.ts +25 -0
  41. package/dist/components/layout/PageConfig.d.ts.map +1 -0
  42. package/dist/components/layout/PageConfig.js +47 -0
  43. package/dist/components/layout/PageContainer.d.ts +1 -1
  44. package/dist/components/layout/PageContainer.js +2 -2
  45. package/dist/components/layout/components/Breadcrumbs.d.ts +3 -1
  46. package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
  47. package/dist/components/layout/components/Breadcrumbs.js +2 -2
  48. package/dist/components/layout/components/DropdownNavigation.d.ts +1 -1
  49. package/dist/components/layout/components/DropdownNavigation.js +2 -2
  50. package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts +2 -1
  51. package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts.map +1 -1
  52. package/dist/components/layout/components/FloatingLanguageSwitcher.js +2 -2
  53. package/dist/components/layout/components/Notifications.d.ts +4 -4
  54. package/dist/components/layout/components/Notifications.js +3 -3
  55. package/dist/components/layout/components/header/AppBranding.d.ts +3 -2
  56. package/dist/components/layout/components/header/AppBranding.d.ts.map +1 -1
  57. package/dist/components/layout/components/header/AppBranding.js +2 -2
  58. package/dist/components/layout/components/header/AppIcon.d.ts +2 -1
  59. package/dist/components/layout/components/header/AppIcon.d.ts.map +1 -1
  60. package/dist/components/layout/components/header/AppIcon.js +2 -2
  61. package/dist/components/layout/components/header/AppTitle.d.ts +2 -1
  62. package/dist/components/layout/components/header/AppTitle.d.ts.map +1 -1
  63. package/dist/components/layout/components/header/AppTitle.js +2 -2
  64. package/dist/components/layout/components/header/CacheSettings.d.ts +1 -1
  65. package/dist/components/layout/components/header/CacheSettings.js +5 -5
  66. package/dist/components/layout/components/header/GameTitle.d.ts +2 -1
  67. package/dist/components/layout/components/header/GameTitle.d.ts.map +1 -1
  68. package/dist/components/layout/components/header/GameTitle.js +2 -2
  69. package/dist/components/layout/components/header/HeaderMenu.d.ts +2 -1
  70. package/dist/components/layout/components/header/HeaderMenu.d.ts.map +1 -1
  71. package/dist/components/layout/components/header/HeaderMenu.js +2 -2
  72. package/dist/components/layout/components/header/HeaderNavigation.d.ts +2 -1
  73. package/dist/components/layout/components/header/HeaderNavigation.d.ts.map +1 -1
  74. package/dist/components/layout/components/header/HeaderNavigation.js +2 -2
  75. package/dist/components/layout/components/header/SettingsMenu.d.ts +2 -1
  76. package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
  77. package/dist/components/layout/components/header/SettingsMenu.js +2 -2
  78. package/dist/components/layout/components/header/ThemeToggle.d.ts +1 -1
  79. package/dist/components/layout/components/header/ThemeToggle.js +2 -2
  80. package/dist/components/layout/components/index.d.ts +1 -1
  81. package/dist/components/layout/components/index.js +1 -1
  82. package/dist/components/layout/index.d.ts +2 -1
  83. package/dist/components/layout/index.d.ts.map +1 -1
  84. package/dist/components/layout/index.js +2 -1
  85. package/dist/components/license/LicenseWatermark.d.ts +1 -1
  86. package/dist/components/license/LicenseWatermark.js +2 -2
  87. package/dist/components/license/watermarkData.js +1 -1
  88. package/dist/crud/components/CrudCardLink.d.ts +1 -1
  89. package/dist/crud/components/EntityCardList.d.ts +1 -1
  90. package/dist/crud/components/EntityCardList.d.ts.map +1 -1
  91. package/dist/crud/components/EntityCardList.js +33 -22
  92. package/dist/crud/components/EntityDisplayRenderer.d.ts +1 -1
  93. package/dist/crud/components/EntityDisplayRenderer.d.ts.map +1 -1
  94. package/dist/crud/components/EntityDisplayRenderer.js +14 -13
  95. package/dist/crud/components/EntityFormRenderer.d.ts +1 -1
  96. package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
  97. package/dist/crud/components/EntityFormRenderer.js +18 -20
  98. package/dist/crud/components/EntityList.d.ts +1 -1
  99. package/dist/crud/components/EntityList.d.ts.map +1 -1
  100. package/dist/crud/components/EntityList.js +41 -25
  101. package/dist/crud/components/EntityRecommendations.d.ts +2 -2
  102. package/dist/crud/components/EntityRecommendations.d.ts.map +1 -1
  103. package/dist/crud/components/EntityRecommendations.js +6 -6
  104. package/dist/crud/components/EntityWorkflow.js +1 -1
  105. package/dist/crud/components/Form.d.ts +10 -10
  106. package/dist/crud/components/Form.js +12 -12
  107. package/dist/crud/components/index.d.ts +1 -1
  108. package/dist/crud/components/index.js +1 -1
  109. package/dist/crud/crudImports.d.ts +2 -1
  110. package/dist/crud/crudImports.d.ts.map +1 -1
  111. package/dist/crud/crudImports.js +2 -1
  112. package/dist/crud/index.d.ts +1 -1
  113. package/dist/crud/index.js +1 -1
  114. package/dist/data/techLogos.d.ts +1 -1
  115. package/dist/data/techLogos.js +1 -1
  116. package/dist/dndev-next.css +374 -81
  117. package/dist/dndev.css +455 -80
  118. package/dist/index.d.ts +1 -1
  119. package/dist/index.js +4 -4
  120. package/dist/internal/common/DnDevErrorBoundary.d.ts +2 -2
  121. package/dist/internal/common/DnDevErrorBoundary.js +2 -2
  122. package/dist/internal/common/ErrorFallback.d.ts +1 -1
  123. package/dist/internal/common/ErrorFallback.js +3 -3
  124. package/dist/internal/common/GlobalErrorFallback.d.ts +1 -1
  125. package/dist/internal/common/GlobalErrorFallback.js +2 -2
  126. package/dist/internal/common/RouteErrorFallback.d.ts +1 -1
  127. package/dist/internal/common/RouteErrorFallback.js +2 -2
  128. package/dist/internal/devtools/DebugTools.js +2 -2
  129. package/dist/internal/devtools/components/AuthDebugButton.js +1 -1
  130. package/dist/internal/devtools/components/ConfigTab.js +1 -1
  131. package/dist/internal/devtools/components/CookieTab.js +1 -1
  132. package/dist/internal/devtools/components/DebugDialog.js +1 -1
  133. package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
  134. package/dist/internal/devtools/components/DesignTab.js +7 -3
  135. package/dist/internal/devtools/components/LayoutReset.js +2 -2
  136. package/dist/internal/devtools/components/MaskedValue.js +1 -1
  137. package/dist/internal/devtools/components/StoresTab.js +1 -1
  138. package/dist/internal/devtools/components/index.d.ts +1 -1
  139. package/dist/internal/devtools/components/index.js +1 -1
  140. package/dist/internal/devtools/index.d.ts +1 -1
  141. package/dist/internal/devtools/index.js +1 -1
  142. package/dist/internal/devtools/types.d.ts +9 -9
  143. package/dist/internal/devtools/utils/envVarDiscovery.d.ts.map +1 -1
  144. package/dist/internal/devtools/utils/envVarDiscovery.js +5 -6
  145. package/dist/internal/devtools/utils/index.d.ts +1 -1
  146. package/dist/internal/devtools/utils/index.js +1 -1
  147. package/dist/internal/devtools/utils/maskSensitive.js +1 -1
  148. package/dist/internal/devtools/utils/virtualModuleInspector.d.ts.map +1 -1
  149. package/dist/internal/devtools/utils/virtualModuleInspector.js +3 -1
  150. package/dist/internal/initializers/BaseStoresInitializer.d.ts +3 -3
  151. package/dist/internal/initializers/BaseStoresInitializer.d.ts.map +1 -1
  152. package/dist/internal/initializers/BaseStoresInitializer.js +13 -4
  153. package/dist/internal/initializers/NextJsStoresInitializer.d.ts +1 -1
  154. package/dist/internal/initializers/NextJsStoresInitializer.js +2 -2
  155. package/dist/internal/initializers/ViteStoresInitializer.d.ts +1 -1
  156. package/dist/internal/initializers/ViteStoresInitializer.js +2 -2
  157. package/dist/internal/initializers/index.d.ts +1 -1
  158. package/dist/internal/initializers/index.js +1 -1
  159. package/dist/internal/layout/DnDevLayout.d.ts +2 -2
  160. package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
  161. package/dist/internal/layout/DnDevLayout.js +45 -18
  162. package/dist/internal/layout/components/AutoMetaTags.d.ts +4 -2
  163. package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
  164. package/dist/internal/layout/components/AutoMetaTags.js +193 -57
  165. package/dist/internal/layout/components/FaviconHead.d.ts +1 -1
  166. package/dist/internal/layout/components/FaviconHead.js +2 -2
  167. package/dist/internal/layout/components/FontPreloadLinks.d.ts +1 -1
  168. package/dist/internal/layout/components/FontPreloadLinks.js +1 -1
  169. package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts +3 -1
  170. package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts.map +1 -1
  171. package/dist/internal/layout/components/NextJsAutoMetaTags.js +47 -17
  172. package/dist/internal/layout/components/PWAUpdateNotification.d.ts +1 -1
  173. package/dist/internal/layout/components/PWAUpdateNotification.d.ts.map +1 -1
  174. package/dist/internal/layout/components/PWAUpdateNotification.js +17 -4
  175. package/dist/internal/layout/components/PerformanceHints.js +1 -1
  176. package/dist/internal/layout/components/footer/FooterBranding.d.ts +1 -1
  177. package/dist/internal/layout/components/footer/FooterBranding.js +2 -2
  178. package/dist/internal/layout/components/footer/FooterCopyright.d.ts +1 -1
  179. package/dist/internal/layout/components/footer/FooterCopyright.js +2 -2
  180. package/dist/internal/layout/components/footer/FooterLegalLinks.d.ts +1 -1
  181. package/dist/internal/layout/components/footer/FooterLegalLinks.js +2 -2
  182. package/dist/internal/layout/components/index.d.ts +1 -1
  183. package/dist/internal/layout/components/index.js +1 -1
  184. package/dist/internal/layout/config/defaults.js +1 -1
  185. package/dist/internal/layout/config/index.d.ts +1 -1
  186. package/dist/internal/layout/config/index.js +1 -1
  187. package/dist/internal/layout/config/presets/admin.d.ts +1 -1
  188. package/dist/internal/layout/config/presets/blog.d.ts +1 -1
  189. package/dist/internal/layout/config/presets/docs.js +1 -1
  190. package/dist/internal/layout/config/presets/game.js +1 -1
  191. package/dist/internal/layout/config/presets/index.d.ts +1 -1
  192. package/dist/internal/layout/config/presets/landing.js +1 -1
  193. package/dist/internal/layout/config/presets/moolti.js +1 -1
  194. package/dist/internal/layout/config/presets/plain.d.ts +2 -2
  195. package/dist/internal/layout/config/presets/plain.d.ts.map +1 -1
  196. package/dist/internal/layout/config/presets/plain.js +12 -1
  197. package/dist/internal/layout/renderers/index.d.ts +1 -1
  198. package/dist/internal/layout/renderers/index.js +1 -1
  199. package/dist/internal/layout/zones/DnDevFooter.d.ts +3 -1
  200. package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
  201. package/dist/internal/layout/zones/DnDevFooter.js +6 -2
  202. package/dist/internal/layout/zones/DnDevHeader.d.ts +3 -1
  203. package/dist/internal/layout/zones/DnDevHeader.d.ts.map +1 -1
  204. package/dist/internal/layout/zones/DnDevHeader.js +8 -3
  205. package/dist/internal/layout/zones/DnDevMergedBar.js +1 -1
  206. package/dist/internal/layout/zones/DnDevSidebar.d.ts +3 -1
  207. package/dist/internal/layout/zones/DnDevSidebar.d.ts.map +1 -1
  208. package/dist/internal/layout/zones/DnDevSidebar.js +10 -4
  209. package/dist/internal/layout/zones/index.d.ts +1 -1
  210. package/dist/internal/layout/zones/index.js +1 -1
  211. package/dist/internal/providers/NavigationProvider.d.ts +1 -1
  212. package/dist/internal/providers/NavigationProvider.js +2 -2
  213. package/dist/internal/providers/SentryInitializer.d.ts +1 -1
  214. package/dist/internal/providers/SentryInitializer.js +2 -2
  215. package/dist/internal/providers/UIProviders.d.ts +1 -1
  216. package/dist/internal/providers/UIProviders.js +3 -3
  217. package/dist/internal/providers/index.d.ts +1 -1
  218. package/dist/internal/providers/index.js +1 -1
  219. package/dist/next.d.ts +1 -1
  220. package/dist/next.js +1 -1
  221. package/dist/providers/NextJsAppProviders.d.ts +1 -1
  222. package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
  223. package/dist/providers/NextJsAppProviders.js +5 -3
  224. package/dist/providers/ViteAppProviders.d.ts +1 -1
  225. package/dist/providers/ViteAppProviders.js +2 -2
  226. package/dist/providers/index.d.ts +1 -1
  227. package/dist/providers/index.js +1 -1
  228. package/dist/routing/404.d.ts +2 -2
  229. package/dist/routing/404.js +3 -3
  230. package/dist/routing/AuthGuard.d.ts +14 -29
  231. package/dist/routing/AuthGuard.d.ts.map +1 -1
  232. package/dist/routing/AuthGuard.js +27 -72
  233. package/dist/routing/AuthGuardFallback.d.ts +1 -1
  234. package/dist/routing/AuthGuardFallback.js +2 -2
  235. package/dist/routing/AuthReturnTo.d.ts +13 -0
  236. package/dist/routing/AuthReturnTo.d.ts.map +1 -0
  237. package/dist/routing/AuthReturnTo.js +61 -0
  238. package/dist/routing/DnDevNavigationMenu.d.ts +2 -1
  239. package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
  240. package/dist/routing/DnDevNavigationMenu.js +2 -2
  241. package/dist/routing/GoTo.d.ts +1 -0
  242. package/dist/routing/GoTo.d.ts.map +1 -1
  243. package/dist/routing/GoTo.js +1 -1
  244. package/dist/routing/GoToDialog.js +1 -1
  245. package/dist/routing/GoToInput.js +1 -1
  246. package/dist/routing/GoToWrapper.d.ts +1 -1
  247. package/dist/routing/GoToWrapper.js +2 -2
  248. package/dist/routing/Link.d.ts +2 -2
  249. package/dist/routing/Link.js +2 -2
  250. package/dist/routing/NavigationItem.d.ts +1 -1
  251. package/dist/routing/NavigationItem.js +2 -2
  252. package/dist/routing/hooks/hooks.next.d.ts +1 -1
  253. package/dist/routing/hooks/hooks.next.js +1 -1
  254. package/dist/routing/hooks/hooks.vite.d.ts +1 -1
  255. package/dist/routing/hooks/hooks.vite.js +1 -1
  256. package/dist/routing/hooks/index.d.ts +1 -1
  257. package/dist/routing/hooks/index.js +1 -1
  258. package/dist/routing/hooks/types.d.ts +1 -1
  259. package/dist/routing/hooks/useLocation.next.js +1 -1
  260. package/dist/routing/hooks/useLocation.vite.js +1 -1
  261. package/dist/routing/hooks/useNavigate.next.d.ts +8 -0
  262. package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
  263. package/dist/routing/hooks/useNavigate.next.js +59 -9
  264. package/dist/routing/hooks/useNavigate.vite.d.ts +8 -0
  265. package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
  266. package/dist/routing/hooks/useNavigate.vite.js +65 -15
  267. package/dist/routing/hooks/useQueryParams.next.js +1 -1
  268. package/dist/routing/hooks/useQueryParams.vite.js +1 -1
  269. package/dist/routing/hooks/useRedirectGuard.next.d.ts +2 -0
  270. package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
  271. package/dist/routing/hooks/useRedirectGuard.next.js +12 -28
  272. package/dist/routing/hooks/useRedirectGuard.vite.d.ts +2 -0
  273. package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
  274. package/dist/routing/hooks/useRedirectGuard.vite.js +12 -28
  275. package/dist/routing/hooks/useRouteParam.next.js +1 -1
  276. package/dist/routing/hooks/useRouteParam.vite.js +1 -1
  277. package/dist/routing/index.d.ts +2 -1
  278. package/dist/routing/index.d.ts.map +1 -1
  279. package/dist/routing/index.js +2 -1
  280. package/dist/routing/useGoTo.js +1 -1
  281. package/dist/routing/useNavigation.d.ts +2 -2
  282. package/dist/routing/useNavigation.js +3 -3
  283. package/dist/routing/useRouteDiscovery.d.ts +7 -7
  284. package/dist/routing/useRouteDiscovery.js +6 -6
  285. package/dist/styles/index.css +455 -80
  286. package/dist/styles/index.d.ts +1 -1
  287. package/dist/styles/index.js +1 -1
  288. package/dist/styles/layoutConstants.d.ts +6 -6
  289. package/dist/styles/layoutConstants.js +5 -5
  290. package/dist/symbol-index.json +1 -0
  291. package/dist/utils/assetResolver.d.ts +5 -5
  292. package/dist/utils/assetResolver.js +4 -4
  293. package/dist/utils/index.d.ts +2 -1
  294. package/dist/utils/index.d.ts.map +1 -1
  295. package/dist/utils/index.js +2 -1
  296. package/dist/utils/sanitizeSvg.d.ts +4 -0
  297. package/dist/utils/sanitizeSvg.d.ts.map +1 -1
  298. package/dist/utils/sanitizeSvg.js +5 -1
  299. package/dist/utils/tList.js +1 -1
  300. package/dist/utils/useAISafe.d.ts +28 -0
  301. package/dist/utils/useAISafe.d.ts.map +1 -0
  302. package/dist/utils/useAISafe.js +53 -0
  303. package/dist/utils/useAuthSafe.d.ts +39 -0
  304. package/dist/utils/useAuthSafe.d.ts.map +1 -1
  305. package/dist/utils/useAuthSafe.js +6 -1
  306. package/dist/utils/useAuthVisibility.d.ts +1 -0
  307. package/dist/utils/useAuthVisibility.d.ts.map +1 -1
  308. package/dist/utils/useAuthVisibility.js +1 -1
  309. package/dist/utils/useBillingVisibility.d.ts +1 -0
  310. package/dist/utils/useBillingVisibility.d.ts.map +1 -1
  311. package/dist/utils/useBillingVisibility.js +1 -1
  312. package/dist/utils/useCrudSafe.js +1 -1
  313. package/dist/utils/useFormStoreSafe.js +1 -1
  314. package/dist/utils/useOAuthSafe.d.ts +1 -1
  315. package/dist/utils/useSeo.d.ts +121 -0
  316. package/dist/utils/useSeo.d.ts.map +1 -0
  317. package/dist/utils/useSeo.js +114 -0
  318. package/dist/utils/useStripeBillingSafe.js +1 -1
  319. package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
  320. package/dist/vite-routing/AppRoutes.js +15 -5
  321. package/dist/vite-routing/RootLayout.d.ts +1 -1
  322. package/dist/vite-routing/RootLayout.d.ts.map +1 -1
  323. package/dist/vite-routing/RootLayout.js +11 -9
  324. package/dist/vite-routing/index.d.ts +1 -1
  325. package/dist/vite-routing/index.js +1 -1
  326. package/dist/vite.d.ts +1 -1
  327. package/dist/vite.js +1 -1
  328. package/guidelines/COMPONENTS.md +136 -0
  329. package/guidelines/GOTCHAS.md +66 -0
  330. package/guidelines/LAYOUTS.md +310 -0
  331. package/guidelines/PAGES.md +205 -0
  332. package/guidelines/ROUTING.md +499 -0
  333. package/guidelines/SEO.md +275 -0
  334. package/package.json +12 -7
  335. package/dist/chunk-XHGRMKOY.js +0 -1
@@ -0,0 +1,499 @@
1
+ # Routing
2
+
3
+ **Use framework routing components/hooks. NEVER import from `react-router-dom` directly.** Framework handles SPA navigation, Outlet, and overlay closing automatically.
4
+
5
+ ---
6
+
7
+ ## Critical Rule: Never Use react-router-dom Directly
8
+
9
+ **WRONG:**
10
+ ```tsx
11
+ import { Link, useNavigate, useParams } from 'react-router-dom'; // BREAKS FRAMEWORK
12
+ ```
13
+
14
+ **CORRECT:**
15
+ ```tsx
16
+ import { Link, useNavigate, useParams } from '@donotdev/ui'; // Framework routing
17
+ ```
18
+
19
+ **Why?** The framework's routing components:
20
+ - Automatically close overlays on navigation
21
+ - Handle SPA navigation correctly with Outlet
22
+ - Work with both Vite and Next.js
23
+ - Integrate with auth and route discovery
24
+ - Provide proper TypeScript types
25
+
26
+ ---
27
+
28
+ ## Framework Routing API
29
+
30
+ ### Components
31
+
32
+ ```tsx
33
+ import { Link, DnDevNavigationMenu } from '@donotdev/ui';
34
+ ```
35
+
36
+ **Link Component:**
37
+ ```tsx
38
+ <Link path="/products" label="Products" icon="Package" />
39
+ <Link path="/users/:id" replace prefetch={false}>User Details</Link>
40
+ ```
41
+
42
+ **DnDevNavigationMenu (Sidebar/Header):**
43
+ ```tsx
44
+ // Auto-fetches routes, handles auth filtering
45
+ <DnDevNavigationMenu vertical display={DISPLAY.AUTO} />
46
+ ```
47
+
48
+ ### Hooks
49
+
50
+ ```tsx
51
+ import {
52
+ useNavigate,
53
+ useLocation,
54
+ useParams,
55
+ useRouteParam,
56
+ useSearchParams,
57
+ useNavigationItems,
58
+ } from '@donotdev/ui';
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Navigation Patterns
64
+
65
+ ### 1. Basic Navigation
66
+
67
+ **Use framework Link:**
68
+ ```tsx
69
+ import { Link } from '@donotdev/ui';
70
+
71
+ function ProductCard({ product }) {
72
+ return (
73
+ <Link path={`/products/${product.id}`} label={product.name} />
74
+ );
75
+ }
76
+ ```
77
+
78
+ **Use framework useNavigate:**
79
+ ```tsx
80
+ import { useNavigate } from '@donotdev/ui';
81
+
82
+ function ProductForm() {
83
+ const navigate = useNavigate();
84
+
85
+ const handleSubmit = async () => {
86
+ await saveProduct();
87
+ navigate('/products'); // Closes overlays automatically
88
+ };
89
+
90
+ return <form onSubmit={handleSubmit}>...</form>;
91
+ }
92
+ ```
93
+
94
+ **DON'T use react-router-dom:**
95
+ ```tsx
96
+ import { useNavigate } from 'react-router-dom'; // BREAKS FRAMEWORK
97
+
98
+ function ProductForm() {
99
+ const navigate = useNavigate(); // Doesn't close overlays, breaks SPA
100
+ // ...
101
+ }
102
+ ```
103
+
104
+ ---
105
+
106
+ ### 2. Route Parameters
107
+
108
+ **Use framework useRouteParam:**
109
+ ```tsx
110
+ import { useRouteParam } from '@donotdev/ui';
111
+
112
+ function ProductPage() {
113
+ const id = useRouteParam('id'); // Returns string | undefined
114
+ // Safe: handles string | string[] | undefined automatically
115
+ }
116
+ ```
117
+
118
+ **Or use framework useParams:**
119
+ ```tsx
120
+ import { useParams } from '@donotdev/ui';
121
+
122
+ function ProductPage() {
123
+ const params = useParams();
124
+ const id = typeof params.id === 'string' ? params.id : undefined;
125
+ }
126
+ ```
127
+
128
+ **DON'T use react-router-dom:**
129
+ ```tsx
130
+ import { useParams } from 'react-router-dom'; // Type issues, breaks framework
131
+ ```
132
+
133
+ ---
134
+
135
+ ### 3. Sidebar Navigation
136
+
137
+ **Use DnDevNavigationMenu (auto-fetches routes):**
138
+ ```tsx
139
+ import { DnDevNavigationMenu, DISPLAY } from '@donotdev/ui';
140
+
141
+ function Sidebar() {
142
+ return (
143
+ <DnDevNavigationMenu
144
+ vertical
145
+ display={DISPLAY.AUTO} // CSS-driven collapse
146
+ showIcons={true}
147
+ />
148
+ );
149
+ }
150
+ ```
151
+
152
+ **Or use useNavigationItems for custom sidebar:**
153
+ ```tsx
154
+ import { Link, useNavigationItems } from '@donotdev/ui';
155
+
156
+ function CustomSidebar() {
157
+ const menuItems = useNavigationItems(); // Auth-filtered routes
158
+
159
+ return (
160
+ <nav>
161
+ {menuItems.map((item) => (
162
+ <Link
163
+ key={item.path}
164
+ path={item.path}
165
+ label={item.label}
166
+ icon={item.icon}
167
+ className={item.isActive ? 'active' : ''}
168
+ />
169
+ ))}
170
+ </nav>
171
+ );
172
+ }
173
+ ```
174
+
175
+ **DON'T manually build navigation:**
176
+ ```tsx
177
+ import { Link } from 'react-router-dom'; // BREAKS FRAMEWORK
178
+
179
+ function Sidebar() {
180
+ // Doesn't integrate with route discovery
181
+ // Doesn't handle auth filtering
182
+ // Doesn't work with Outlet
183
+ return (
184
+ <nav>
185
+ <Link to="/products">Products</Link>
186
+ </nav>
187
+ );
188
+ }
189
+ ```
190
+
191
+ ---
192
+
193
+ ### 4. Programmatic Navigation
194
+
195
+ **Use framework useNavigate:**
196
+ ```tsx
197
+ import { useNavigate } from '@donotdev/ui';
198
+
199
+ function LoginForm() {
200
+ const navigate = useNavigate();
201
+
202
+ const handleLogin = async () => {
203
+ await signIn();
204
+ navigate('/dashboard', { replace: true }); // Closes overlays
205
+ };
206
+
207
+ return <form onSubmit={handleLogin}>...</form>;
208
+ }
209
+ ```
210
+
211
+ **Navigate back:**
212
+ ```tsx
213
+ const navigate = useNavigate();
214
+ navigate('back'); // Framework handles browser history
215
+ ```
216
+
217
+ **With options:**
218
+ ```tsx
219
+ navigate('/products', {
220
+ replace: true, // Replace history entry
221
+ preserveScroll: true, // Preserve scroll position
222
+ });
223
+ ```
224
+
225
+ ---
226
+
227
+ ### 5. Query Parameters
228
+
229
+ **Use framework useSearchParams (read-only, returns URLSearchParams directly):**
230
+ ```tsx
231
+ import { useSearchParams } from '@donotdev/ui';
232
+
233
+ function ProductList() {
234
+ const searchParams = useSearchParams();
235
+ const page = searchParams.get('page') || '1';
236
+
237
+ return <div>Page: {page}</div>;
238
+ }
239
+ ```
240
+
241
+ **Or use useQueryParams helper:**
242
+ ```tsx
243
+ import { useQueryParams } from '@donotdev/ui';
244
+
245
+ function ProductList() {
246
+ const { page, sort } = useQueryParams({ page: '1', sort: 'name' });
247
+ // Returns { page: string, sort: string } with defaults
248
+ }
249
+ ```
250
+
251
+ ---
252
+
253
+ ### 6. Route Matching
254
+
255
+ **Use framework useMatch:**
256
+ ```tsx
257
+ import { useMatch } from '@donotdev/ui';
258
+
259
+ function NavigationItem({ path }) {
260
+ const isActive = useMatch(path);
261
+ return <Link path={path} className={isActive ? 'active' : ''} />;
262
+ }
263
+ ```
264
+
265
+ ---
266
+
267
+ ## Outlet and Nested Routes
268
+
269
+ **Framework handles Outlet automatically.** You don't need to manually use `<Outlet />` in most cases.
270
+
271
+ ### How It Works
272
+
273
+ 1. **RootLayout** wraps all routes and includes `<Outlet />`
274
+ 2. **DnDevLayout** receives `<Outlet />` and renders it in the main content area
275
+ 3. **Routes are discovered** from `src/pages/*Page.tsx` files automatically
276
+
277
+ **Your pages just render content:**
278
+ ```tsx
279
+ // src/pages/ProductsPage.tsx
280
+ export function ProductsPage() {
281
+ return <div>Products List</div>; // Rendered via Outlet automatically
282
+ }
283
+ ```
284
+
285
+ **DON'T manually use Outlet:**
286
+ ```tsx
287
+ import { Outlet } from 'react-router-dom'; // BREAKS FRAMEWORK
288
+
289
+ export function ProductsPage() {
290
+ return (
291
+ <div>
292
+ <h1>Products</h1>
293
+ <Outlet /> {/* Framework already handles this */}
294
+ </div>
295
+ );
296
+ }
297
+ ```
298
+
299
+ ### Nested Routes (Advanced)
300
+
301
+ If you need nested routes, use the framework's route discovery:
302
+
303
+ ```tsx
304
+ // src/pages/products/ProductsPage.tsx
305
+ export const pageMeta = {
306
+ route: '/products',
307
+ // ...
308
+ };
309
+
310
+ // src/pages/products/ProductDetailPage.tsx
311
+ export const pageMeta = {
312
+ route: '/products/:id',
313
+ // ...
314
+ };
315
+ ```
316
+
317
+ Framework automatically creates nested route structure.
318
+
319
+ ---
320
+
321
+ ## Route Discovery
322
+
323
+ **Routes are auto-discovered from `src/pages/*Page.tsx` files.**
324
+
325
+ **Define routes with PageMeta:**
326
+ ```tsx
327
+ // src/pages/ProductsPage.tsx
328
+ import type { PageMeta } from '@donotdev/core';
329
+
330
+ export const pageMeta: PageMeta = {
331
+ title: 'Products',
332
+ route: '/products',
333
+ icon: 'Package',
334
+ auth: { required: true, roles: ['user', 'admin'] },
335
+ };
336
+
337
+ export function ProductsPage() {
338
+ return <div>Products</div>;
339
+ }
340
+ ```
341
+
342
+ **Framework automatically:**
343
+ - Discovers routes from filesystem
344
+ - Generates navigation menus
345
+ - Filters by auth permissions
346
+ - Handles lazy loading
347
+ - Creates route structure
348
+
349
+ ---
350
+
351
+ ## Common Mistakes
352
+
353
+ ### Mistake 1: Importing from react-router-dom
354
+
355
+ ```tsx
356
+ // WRONG
357
+ import { Link, useNavigate } from 'react-router-dom';
358
+ ```
359
+
360
+ **Fix:**
361
+ ```tsx
362
+ // CORRECT
363
+ import { Link, useNavigate } from '@donotdev/ui';
364
+ ```
365
+
366
+ ---
367
+
368
+ ### Mistake 2: Manual Outlet Usage
369
+
370
+ ```tsx
371
+ // WRONG
372
+ import { Outlet } from 'react-router-dom';
373
+
374
+ export function Layout() {
375
+ return <Outlet />; // Framework already handles this
376
+ }
377
+ ```
378
+
379
+ **Fix:** Don't use Outlet manually. Framework handles it.
380
+
381
+ ---
382
+
383
+ ### Mistake 3: Manual Route Configuration
384
+
385
+ ```tsx
386
+ // WRONG
387
+ import { Routes, Route } from 'react-router-dom';
388
+
389
+ function App() {
390
+ return (
391
+ <Routes>
392
+ <Route path="/products" element={<ProductsPage />} />
393
+ </Routes>
394
+ );
395
+ }
396
+ ```
397
+
398
+ **Fix:** Use route discovery. Create `src/pages/ProductsPage.tsx` with `pageMeta`.
399
+
400
+ ---
401
+
402
+ ### Mistake 4: Manual Navigation Menu
403
+
404
+ ```tsx
405
+ // WRONG
406
+ function Sidebar() {
407
+ return (
408
+ <nav>
409
+ <Link to="/products">Products</Link>
410
+ <Link to="/users">Users</Link>
411
+ </nav>
412
+ );
413
+ }
414
+ ```
415
+
416
+ **Fix:**
417
+ ```tsx
418
+ // CORRECT
419
+ import { DnDevNavigationMenu } from '@donotdev/ui';
420
+
421
+ function Sidebar() {
422
+ return <DnDevNavigationMenu vertical />; // Auto-fetches routes
423
+ }
424
+ ```
425
+
426
+ ---
427
+
428
+ ### Mistake 5: Not Using Framework Link
429
+
430
+ ```tsx
431
+ // WRONG
432
+ import { Link } from 'react-router-dom';
433
+
434
+ <Link to="/products">Products</Link>
435
+ ```
436
+
437
+ **Fix:**
438
+ ```tsx
439
+ // CORRECT
440
+ import { Link } from '@donotdev/ui';
441
+
442
+ <Link path="/products" label="Products" />
443
+ ```
444
+
445
+ ---
446
+
447
+ ## Quick Reference
448
+
449
+ ### Import Paths
450
+
451
+ ```tsx
452
+ // Framework routing (platform-agnostic)
453
+ import {
454
+ Link,
455
+ useNavigate,
456
+ useLocation,
457
+ useParams,
458
+ useRouteParam,
459
+ useSearchParams,
460
+ useNavigationItems,
461
+ DnDevNavigationMenu,
462
+ } from '@donotdev/ui';
463
+ ```
464
+
465
+ ### Common Patterns
466
+
467
+ ```tsx
468
+ // Navigation
469
+ const navigate = useNavigate();
470
+ navigate('/products');
471
+ navigate('back');
472
+ navigate('/products', { replace: true });
473
+
474
+ // Route params
475
+ const id = useRouteParam('id');
476
+
477
+ // Query params (read-only, returns URLSearchParams directly)
478
+ const searchParams = useSearchParams();
479
+ const page = searchParams.get('page');
480
+
481
+ // Navigation menu
482
+ const menuItems = useNavigationItems(); // Auth-filtered routes
483
+
484
+ // Link component
485
+ <Link path="/products" label="Products" icon="Package" />
486
+ ```
487
+
488
+ ---
489
+
490
+ ## Summary
491
+
492
+ 1. **Always import from `@donotdev/ui`** - never `react-router-dom`
493
+ 2. **Use `DnDevNavigationMenu`** for sidebars/headers
494
+ 3. **Use `useNavigationItems()`** for custom navigation
495
+ 4. **Don't use `<Outlet />` manually** - framework handles it
496
+ 5. **Routes are auto-discovered** from `src/pages/*Page.tsx`
497
+ 6. **Framework closes overlays** on navigation automatically
498
+
499
+ **Framework handles SPA navigation, Outlet, and route discovery. Use framework components/hooks only.**