@donotdev/ui 0.3.1 → 0.3.2

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 (299) hide show
  1. package/dist/components/auth/AuthHeader.js +1 -93
  2. package/dist/components/auth/AuthMenu.d.ts.map +1 -1
  3. package/dist/components/auth/AuthMenu.js +3 -286
  4. package/dist/components/auth/index.js +1 -9
  5. package/dist/components/common/FeatureCard.d.ts.map +1 -1
  6. package/dist/components/common/FeatureCard.js +1 -86
  7. package/dist/components/common/FeatureDisabled.js +1 -67
  8. package/dist/components/common/IconPlaceholder.d.ts +24 -0
  9. package/dist/components/common/IconPlaceholder.d.ts.map +1 -0
  10. package/dist/components/common/IconPlaceholder.js +1 -0
  11. package/dist/components/common/LazyLucideIcon.d.ts +39 -0
  12. package/dist/components/common/LazyLucideIcon.d.ts.map +1 -0
  13. package/dist/components/common/LazyLucideIcon.js +1 -0
  14. package/dist/components/common/ProgressBar.js +1 -84
  15. package/dist/components/common/RedirectOverlay.js +1 -243
  16. package/dist/components/common/Skeleton.js +1 -144
  17. package/dist/components/common/TechBento.d.ts.map +1 -1
  18. package/dist/components/common/TechBento.js +1 -53
  19. package/dist/components/common/icon.d.ts +1 -1
  20. package/dist/components/common/icon.d.ts.map +1 -1
  21. package/dist/components/common/icon.js +1 -84
  22. package/dist/components/common/iconByName.d.ts +33 -0
  23. package/dist/components/common/iconByName.d.ts.map +1 -0
  24. package/dist/components/common/iconByName.js +1 -0
  25. package/dist/components/common/index.js +1 -16
  26. package/dist/components/cookie-consent/ConsentBanner.d.ts +3 -1
  27. package/dist/components/cookie-consent/ConsentBanner.d.ts.map +1 -1
  28. package/dist/components/cookie-consent/ConsentBanner.js +1 -31
  29. package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
  30. package/dist/components/cookie-consent/CookieConsent.js +1 -183
  31. package/dist/components/cookie-consent/index.js +1 -11
  32. package/dist/components/cookie-consent/useCookieNoticeRequired.d.ts +7 -0
  33. package/dist/components/cookie-consent/useCookieNoticeRequired.d.ts.map +1 -0
  34. package/dist/components/cookie-consent/useCookieNoticeRequired.js +1 -0
  35. package/dist/components/index.js +1 -13
  36. package/dist/components/layout/GameContainer.d.ts.map +1 -1
  37. package/dist/components/layout/GameContainer.js +1 -72
  38. package/dist/components/layout/GameFlow.d.ts.map +1 -1
  39. package/dist/components/layout/GameFlow.js +1 -93
  40. package/dist/components/layout/PageConfig.d.ts.map +1 -1
  41. package/dist/components/layout/PageConfig.js +1 -47
  42. package/dist/components/layout/PageContainer.d.ts.map +1 -1
  43. package/dist/components/layout/PageContainer.js +1 -38
  44. package/dist/components/layout/components/Breadcrumbs.d.ts +2 -1
  45. package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
  46. package/dist/components/layout/components/Breadcrumbs.js +1 -89
  47. package/dist/components/layout/components/DropdownNavigation.d.ts.map +1 -1
  48. package/dist/components/layout/components/DropdownNavigation.js +1 -30
  49. package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts.map +1 -1
  50. package/dist/components/layout/components/FloatingLanguageSwitcher.js +1 -26
  51. package/dist/components/layout/components/Notifications.js +1 -182
  52. package/dist/components/layout/components/header/AppBranding.d.ts.map +1 -1
  53. package/dist/components/layout/components/header/AppBranding.js +1 -54
  54. package/dist/components/layout/components/header/AppIcon.d.ts.map +1 -1
  55. package/dist/components/layout/components/header/AppIcon.js +1 -59
  56. package/dist/components/layout/components/header/AppTitle.d.ts.map +1 -1
  57. package/dist/components/layout/components/header/AppTitle.js +1 -40
  58. package/dist/components/layout/components/header/CacheSettings.js +1 -225
  59. package/dist/components/layout/components/header/GameTitle.d.ts.map +1 -1
  60. package/dist/components/layout/components/header/GameTitle.js +1 -66
  61. package/dist/components/layout/components/header/HeaderMenu.js +1 -75
  62. package/dist/components/layout/components/header/HeaderNavigation.d.ts.map +1 -1
  63. package/dist/components/layout/components/header/HeaderNavigation.js +1 -66
  64. package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
  65. package/dist/components/layout/components/header/SettingsMenu.js +1 -85
  66. package/dist/components/layout/components/header/ThemeToggle.d.ts.map +1 -1
  67. package/dist/components/layout/components/header/ThemeToggle.js +1 -93
  68. package/dist/components/layout/components/index.js +1 -25
  69. package/dist/components/layout/index.js +1 -14
  70. package/dist/crud/components/ChildRowsPicker.js +1 -68
  71. package/dist/crud/components/CrudCardLink.js +1 -14
  72. package/dist/crud/components/EntityCardList.js +1 -184
  73. package/dist/crud/components/EntityDisplayRenderer.js +1 -130
  74. package/dist/crud/components/EntityFormRenderer.js +1 -433
  75. package/dist/crud/components/EntityList.js +1 -521
  76. package/dist/crud/components/EntityRecommendations.js +1 -87
  77. package/dist/crud/components/EntityWorkflow.js +1 -55
  78. package/dist/crud/components/Form.d.ts.map +1 -1
  79. package/dist/crud/components/Form.js +1 -198
  80. package/dist/crud/components/cellEditFor.js +1 -74
  81. package/dist/crud/components/entityParent.js +1 -76
  82. package/dist/crud/components/index.js +1 -16
  83. package/dist/crud/components/useRecordBreadcrumb.d.ts.map +1 -1
  84. package/dist/crud/components/useRecordBreadcrumb.js +1 -43
  85. package/dist/crud/crudImports.js +1 -51
  86. package/dist/crud/index.js +1 -11
  87. package/dist/data/techLogos.js +1 -99
  88. package/dist/dndev-next.css +25 -4
  89. package/dist/dndev.css +25 -4
  90. package/dist/index.js +1 -5
  91. package/dist/internal/common/DnDevErrorBoundary.js +1 -55
  92. package/dist/internal/common/ErrorFallback.js +3 -214
  93. package/dist/internal/common/GlobalErrorFallback.js +1 -45
  94. package/dist/internal/common/RouteErrorFallback.js +3 -140
  95. package/dist/internal/devtools/DebugTools.js +1 -131
  96. package/dist/internal/devtools/components/AuthDebugButton.js +1 -72
  97. package/dist/internal/devtools/components/ConfigTab.js +1 -61
  98. package/dist/internal/devtools/components/CookieTab.js +1 -156
  99. package/dist/internal/devtools/components/DebugDialog.js +1 -48
  100. package/dist/internal/devtools/components/DesignTab.js +1 -469
  101. package/dist/internal/devtools/components/LayoutReset.js +1 -214
  102. package/dist/internal/devtools/components/MaskedValue.js +1 -39
  103. package/dist/internal/devtools/components/StoresTab.js +1 -90
  104. package/dist/internal/devtools/components/index.js +1 -16
  105. package/dist/internal/devtools/index.js +1 -13
  106. package/dist/internal/devtools/types.js +0 -2
  107. package/dist/internal/devtools/utils/envVarDiscovery.js +1 -106
  108. package/dist/internal/devtools/utils/index.js +1 -12
  109. package/dist/internal/devtools/utils/maskSensitive.js +1 -59
  110. package/dist/internal/devtools/utils/virtualModuleInspector.js +1 -309
  111. package/dist/internal/initializers/BaseStoresInitializer.js +1 -367
  112. package/dist/internal/initializers/NextJsStoresInitializer.js +1 -78
  113. package/dist/internal/initializers/ViteStoresInitializer.js +1 -20
  114. package/dist/internal/initializers/index.js +1 -11
  115. package/dist/internal/layout/DnDevLayout.js +1 -321
  116. package/dist/internal/layout/components/AutoMetaTags.d.ts +2 -0
  117. package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
  118. package/dist/internal/layout/components/AutoMetaTags.js +1 -338
  119. package/dist/internal/layout/components/FaviconHead.js +1 -60
  120. package/dist/internal/layout/components/FontPreloadLinks.js +1 -31
  121. package/dist/internal/layout/components/HeadTags.js +1 -20
  122. package/dist/internal/layout/components/PWAUpdateNotification.js +1 -131
  123. package/dist/internal/layout/components/footer/FooterBranding.d.ts.map +1 -1
  124. package/dist/internal/layout/components/footer/FooterBranding.js +1 -35
  125. package/dist/internal/layout/components/footer/FooterCopyright.d.ts.map +1 -1
  126. package/dist/internal/layout/components/footer/FooterCopyright.js +1 -37
  127. package/dist/internal/layout/components/footer/FooterLegalLinks.d.ts.map +1 -1
  128. package/dist/internal/layout/components/footer/FooterLegalLinks.js +1 -44
  129. package/dist/internal/layout/components/footer/useLegalLinks.d.ts +4 -2
  130. package/dist/internal/layout/components/footer/useLegalLinks.d.ts.map +1 -1
  131. package/dist/internal/layout/components/footer/useLegalLinks.js +1 -21
  132. package/dist/internal/layout/components/i18nSeoMeta.js +1 -53
  133. package/dist/internal/layout/components/index.js +1 -13
  134. package/dist/internal/layout/config/defaults.js +1 -47
  135. package/dist/internal/layout/config/index.js +1 -11
  136. package/dist/internal/layout/config/presets/admin.js +1 -35
  137. package/dist/internal/layout/config/presets/blog.js +1 -31
  138. package/dist/internal/layout/config/presets/docs.js +1 -51
  139. package/dist/internal/layout/config/presets/game.js +1 -53
  140. package/dist/internal/layout/config/presets/index.js +1 -24
  141. package/dist/internal/layout/config/presets/landing.js +1 -42
  142. package/dist/internal/layout/config/presets/moolti.js +1 -52
  143. package/dist/internal/layout/config/presets/plain.js +1 -25
  144. package/dist/internal/layout/renderers/index.js +0 -10
  145. package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
  146. package/dist/internal/layout/zones/DnDevFooter.js +1 -67
  147. package/dist/internal/layout/zones/DnDevHeader.js +1 -41
  148. package/dist/internal/layout/zones/DnDevMergedBar.d.ts.map +1 -1
  149. package/dist/internal/layout/zones/DnDevMergedBar.js +1 -52
  150. package/dist/internal/layout/zones/DnDevSidebar.d.ts.map +1 -1
  151. package/dist/internal/layout/zones/DnDevSidebar.js +1 -181
  152. package/dist/internal/layout/zones/index.js +1 -14
  153. package/dist/internal/providers/NavigationProvider.d.ts.map +1 -1
  154. package/dist/internal/providers/NavigationProvider.js +1 -71
  155. package/dist/internal/providers/SentryInitializer.d.ts.map +1 -1
  156. package/dist/internal/providers/SentryInitializer.js +1 -36
  157. package/dist/internal/providers/UIProviders.js +1 -79
  158. package/dist/internal/providers/index.js +1 -12
  159. package/dist/next.js +1 -11
  160. package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
  161. package/dist/providers/NextJsAppProviders.js +1 -107
  162. package/dist/providers/ViteAppProviders.d.ts.map +1 -1
  163. package/dist/providers/ViteAppProviders.js +1 -117
  164. package/dist/providers/index.js +1 -11
  165. package/dist/routing/404.js +1 -108
  166. package/dist/routing/AuthGuard.js +1 -178
  167. package/dist/routing/AuthGuardFallback.d.ts.map +1 -1
  168. package/dist/routing/AuthGuardFallback.js +1 -67
  169. package/dist/routing/AuthReturnTo.js +1 -68
  170. package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
  171. package/dist/routing/DnDevNavigationMenu.js +1 -138
  172. package/dist/routing/GoTo.d.ts.map +1 -1
  173. package/dist/routing/GoTo.js +1 -38
  174. package/dist/routing/GoToDialog.d.ts.map +1 -1
  175. package/dist/routing/GoToDialog.js +1 -97
  176. package/dist/routing/GoToInput.d.ts.map +1 -1
  177. package/dist/routing/GoToInput.js +1 -49
  178. package/dist/routing/GoToWrapper.d.ts.map +1 -1
  179. package/dist/routing/GoToWrapper.js +1 -59
  180. package/dist/routing/Link.d.ts +10 -2
  181. package/dist/routing/Link.d.ts.map +1 -1
  182. package/dist/routing/Link.js +1 -109
  183. package/dist/routing/NavigationItem.d.ts.map +1 -1
  184. package/dist/routing/NavigationItem.js +1 -44
  185. package/dist/routing/NotFoundDocument.d.ts +33 -0
  186. package/dist/routing/NotFoundDocument.d.ts.map +1 -0
  187. package/dist/routing/NotFoundDocument.js +1 -0
  188. package/dist/routing/SignedInRedirect.js +1 -47
  189. package/dist/routing/hooks/hooks.vite.js +1 -1
  190. package/dist/routing/hooks/index.js +1 -26
  191. package/dist/routing/hooks/types.js +0 -2
  192. package/dist/routing/hooks/useLocation.next.js +1 -35
  193. package/dist/routing/hooks/useLocation.vite.js +1 -13
  194. package/dist/routing/hooks/useMatch.next.js +1 -31
  195. package/dist/routing/hooks/useMatch.vite.js +1 -6
  196. package/dist/routing/hooks/useNavigate.next.js +1 -64
  197. package/dist/routing/hooks/useNavigate.vite.js +1 -61
  198. package/dist/routing/hooks/useParams.next.js +1 -9
  199. package/dist/routing/hooks/useParams.vite.js +1 -6
  200. package/dist/routing/hooks/useQueryParams.next.js +1 -66
  201. package/dist/routing/hooks/useQueryParams.vite.js +1 -66
  202. package/dist/routing/hooks/useRedirectGuard.next.js +1 -119
  203. package/dist/routing/hooks/useRedirectGuard.vite.js +1 -117
  204. package/dist/routing/hooks/useRouteParam.next.js +1 -38
  205. package/dist/routing/hooks/useRouteParam.vite.js +1 -38
  206. package/dist/routing/hooks/useRoutePath.next.js +1 -36
  207. package/dist/routing/hooks/useRoutePath.vite.js +1 -25
  208. package/dist/routing/hooks/useSearchParams.next.js +1 -22
  209. package/dist/routing/hooks/useSearchParams.vite.js +1 -22
  210. package/dist/routing/hooks/useUrlLanguage.next.js +1 -50
  211. package/dist/routing/hooks/useUrlLanguage.vite.js +1 -41
  212. package/dist/routing/index.d.ts +1 -0
  213. package/dist/routing/index.d.ts.map +1 -1
  214. package/dist/routing/index.js +1 -32
  215. package/dist/routing/link/InternalLink.next.d.ts +23 -0
  216. package/dist/routing/link/InternalLink.next.d.ts.map +1 -0
  217. package/dist/routing/link/InternalLink.next.js +1 -0
  218. package/dist/routing/link/InternalLink.vite.d.ts +22 -0
  219. package/dist/routing/link/InternalLink.vite.d.ts.map +1 -0
  220. package/dist/routing/link/InternalLink.vite.js +1 -0
  221. package/dist/routing/link/absolutePath.d.ts +17 -0
  222. package/dist/routing/link/absolutePath.d.ts.map +1 -0
  223. package/dist/routing/link/absolutePath.js +1 -0
  224. package/dist/routing/link/link.next.d.ts +12 -0
  225. package/dist/routing/link/link.next.d.ts.map +1 -0
  226. package/dist/routing/link/link.next.js +1 -0
  227. package/dist/routing/link/link.vite.d.ts +12 -0
  228. package/dist/routing/link/link.vite.d.ts.map +1 -0
  229. package/dist/routing/link/link.vite.js +1 -0
  230. package/dist/routing/link/types.d.ts +30 -0
  231. package/dist/routing/link/types.d.ts.map +1 -0
  232. package/dist/routing/link/types.js +0 -0
  233. package/dist/routing/parentRoute.js +1 -43
  234. package/dist/routing/useGoTo.d.ts.map +1 -1
  235. package/dist/routing/useGoTo.js +1 -59
  236. package/dist/routing/useNavigation.d.ts.map +1 -1
  237. package/dist/routing/useNavigation.js +1 -114
  238. package/dist/routing/useRouteDiscovery.d.ts +1 -0
  239. package/dist/routing/useRouteDiscovery.d.ts.map +1 -1
  240. package/dist/routing/useRouteDiscovery.js +1 -313
  241. package/dist/rsc.d.ts +28 -0
  242. package/dist/rsc.d.ts.map +1 -0
  243. package/dist/rsc.js +1 -0
  244. package/dist/styles/index.css +25 -4
  245. package/dist/styles/index.js +1 -10
  246. package/dist/styles/layoutConstants.js +1 -134
  247. package/dist/symbol-index.json +1 -1
  248. package/dist/utils/assetResolver.d.ts.map +1 -1
  249. package/dist/utils/assetResolver.js +1 -297
  250. package/dist/utils/index.js +1 -23
  251. package/dist/utils/sanitizeSvg.js +1 -51
  252. package/dist/utils/tList.js +1 -42
  253. package/dist/utils/useAISafe.d.ts.map +1 -1
  254. package/dist/utils/useAISafe.js +1 -53
  255. package/dist/utils/useAuthSafe.d.ts.map +1 -1
  256. package/dist/utils/useAuthSafe.js +1 -78
  257. package/dist/utils/useAuthVisibility.d.ts.map +1 -1
  258. package/dist/utils/useAuthVisibility.js +1 -63
  259. package/dist/utils/useBillingVisibility.d.ts.map +1 -1
  260. package/dist/utils/useBillingVisibility.js +1 -57
  261. package/dist/utils/useCrudSafe.d.ts.map +1 -1
  262. package/dist/utils/useCrudSafe.js +1 -75
  263. package/dist/utils/useDeleteAccountSafe.js +1 -52
  264. package/dist/utils/useFormStoreSafe.d.ts.map +1 -1
  265. package/dist/utils/useFormStoreSafe.js +1 -85
  266. package/dist/utils/useOAuthSafe.d.ts.map +1 -1
  267. package/dist/utils/useOAuthSafe.js +1 -38
  268. package/dist/utils/useSeo.js +1 -151
  269. package/dist/utils/useStripeBillingSafe.d.ts.map +1 -1
  270. package/dist/utils/useStripeBillingSafe.js +1 -81
  271. package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
  272. package/dist/vite-routing/AppRoutes.js +1 -235
  273. package/dist/vite-routing/RootLayout.d.ts.map +1 -1
  274. package/dist/vite-routing/RootLayout.js +1 -205
  275. package/dist/vite-routing/index.js +1 -11
  276. package/dist/vite.js +1 -10
  277. package/guidelines/COMPONENTS.md +3 -3
  278. package/guidelines/PAGES.md +3 -0
  279. package/guidelines/ROUTING.md +15 -0
  280. package/guidelines/SEO.md +4 -1
  281. package/package.json +18 -8
  282. package/dist/ChildRowsPicker-63M4EQUQ.js +0 -1
  283. package/dist/ChildRowsPicker-ISP365ON.js +0 -1
  284. package/dist/ChildRowsPicker-PQFE6NCR.js +0 -1
  285. package/dist/ChildRowsPicker-XXFFSMWY.js +0 -1
  286. package/dist/CookieConsent-QOUAY6B4.js +0 -1
  287. package/dist/GoToDialog-KSBGOIWO.js +0 -1
  288. package/dist/GoToDialog-XBK5EZF4.js +0 -1
  289. package/dist/chunk-3CIZFGST.js +0 -1
  290. package/dist/chunk-LHMKU342.js +0 -1
  291. package/dist/chunk-MS7ZIW5Z.js +0 -1
  292. package/dist/chunk-O2XFH626.js +0 -1
  293. package/dist/chunk-P2DHZWPY.js +0 -1
  294. package/dist/components/common/lucideIconByName.d.ts +0 -9
  295. package/dist/components/common/lucideIconByName.d.ts.map +0 -1
  296. package/dist/components/common/lucideIconByName.js +0 -32
  297. package/dist/internal/layout/components/PerformanceHints.d.ts +0 -71
  298. package/dist/internal/layout/components/PerformanceHints.d.ts.map +0 -1
  299. package/dist/internal/layout/components/PerformanceHints.js +0 -71
@@ -1,313 +1 @@
1
- // packages/ui/src/routing/useRouteDiscovery.ts
2
- /**
3
- * @fileoverview Route Discovery Hooks - Store-Integrated Navigation Data Access
4
- * @description Enhanced route discovery with navigation store integration
5
- *
6
- * Provides route discovery functionality with seamless integration to the navigation
7
- * store for optimal performance and data consistency. These hooks serve as the bridge
8
- * between the virtual route module system and the store-based navigation architecture.
9
- *
10
- * Key features:
11
- * - Integration with navigation store for caching
12
- * - Auth-filtered route access via store
13
- * - Route grouping and organization
14
- * - Performance optimization through store-level caching
15
- *
16
- * @version 0.1.0
17
- * @since 0.0.1
18
- * @author AMBROISE PARK Consulting
19
- *
20
- * @example
21
- * ```tsx
22
- * const routes = useAccessibleNavigationRoutes();
23
- * ```
24
- */
25
- import { useMemo } from 'react';
26
- import { useNavigationStore, filterNavigationRoutes, getRoutes, getRouteManifest, } from '@donotdev/core';
27
- import { useAuthSafe } from '../utils/useAuthSafe';
28
- /**
29
- * Hook that provides auto-discovered routes from virtual module system
30
- *
31
- * This hook provides raw route discovery data from the virtual module system
32
- * without authentication filtering. It serves as the foundation for other
33
- * route-related hooks.
34
- *
35
- * Performance:
36
- * - Results are memoized to prevent unnecessary re-computation
37
- * - No authentication dependencies to avoid re-renders
38
- * - Integrates with navigation store for enhanced caching
39
- *
40
- * @returns Array of route groups organized by entity/domain
41
- *
42
- * @example
43
- * ```tsx
44
- * function RouteDebugger() {
45
- * const allRoutes = useRouteDiscovery();
46
- * return <div>Total routes: {allRoutes.flatMap(g => g.routes).length}</div>;
47
- * }
48
- * ```
49
- *
50
- * @version 0.1.0
51
- * @since 0.0.1
52
- * @author AMBROISE PARK Consulting
53
- */
54
- export function useRouteDiscovery() {
55
- return useMemo(() => {
56
- try {
57
- const routeData = getRoutes();
58
- if (!routeData || routeData.length === 0) {
59
- if (process.env.NODE_ENV === 'development') {
60
- console.warn('[useRouteDiscovery] No routes found - ensure you have *Page.tsx files in src/');
61
- }
62
- return [];
63
- }
64
- const groupedRoutes = groupRoutes(routeData);
65
- return groupedRoutes;
66
- }
67
- catch (error) {
68
- if (process.env.NODE_ENV === 'development') {
69
- console.error('[useRouteDiscovery] Error discovering routes:', error);
70
- console.warn('[useRouteDiscovery] No routes found - ensure you have *Page.tsx files in src/');
71
- }
72
- return [];
73
- }
74
- }, []);
75
- }
76
- /**
77
- * Hook that provides routes filtered by user access permissions
78
- *
79
- * Enhanced version that integrates with navigation store for optimal performance
80
- * and caching. Uses store-level filtering with auth state caching to minimize
81
- * re-computation across multiple component uses.
82
- *
83
- * @returns Array of route groups filtered by user permissions
84
- *
85
- * @example
86
- * ```tsx
87
- * function AdminRoutesList() {
88
- * const accessibleGroups = useAccessibleRoutes();
89
- * return (
90
- * <div>
91
- * {accessibleGroups.map(group => (
92
- * <RouteGroup key={group.label} group={group} />
93
- * ))}
94
- * </div>
95
- * );
96
- * }
97
- * ```
98
- *
99
- * @version 0.1.0
100
- * @since 0.0.1
101
- * @author AMBROISE PARK Consulting
102
- */
103
- export function useAccessibleRoutes() {
104
- const allGroups = useRouteDiscovery();
105
- const user = useAuthSafe('user');
106
- return useMemo(() => {
107
- return allGroups
108
- .map((group) => ({
109
- ...group,
110
- routes: group.routes.filter((route) => {
111
- // Use same filtering logic as AuthGuard for consistency (Item 88)
112
- if (route.auth === false)
113
- return true;
114
- if (route.auth === true)
115
- return !!user;
116
- if (typeof route.auth === 'object' && route.auth.required) {
117
- return !!user;
118
- }
119
- return true;
120
- }),
121
- }))
122
- .filter((group) => group.routes.length > 0);
123
- }, [allGroups, user]);
124
- }
125
- /**
126
- * Hook for components that need auth-filtered navigation routes (Store-Enhanced)
127
- *
128
- * Provides auth-filtered navigation routes with store integration for optimal
129
- * performance. This is the recommended hook for UI components that need
130
- * navigation data with authentication filtering.
131
- *
132
- * Features:
133
- * - Memoized filtering of snapshot-owned routes
134
- * - Automatic updates when routes or auth change
135
- * - Consistent filtering logic with AuthGuard
136
- * - Optimized for multiple component usage
137
- *
138
- * @returns Array of navigation routes filtered by user permissions
139
- *
140
- * @example
141
- * ```tsx
142
- * function Sidebar() {
143
- * const routes = useAccessibleNavigationRoutes();
144
- * return <SidebarMenu routes={routes} />;
145
- * }
146
- * ```
147
- *
148
- * @version 0.1.0
149
- * @since 0.0.1
150
- * @author AMBROISE PARK Consulting
151
- */
152
- export function useAccessibleNavigationRoutes() {
153
- const user = useAuthSafe('user');
154
- const allRoutes = useNavigationStore((state) => state.cache.allRoutes);
155
- return useMemo(() => {
156
- const filteredRoutes = filterNavigationRoutes(allRoutes, {
157
- authenticated: !!user,
158
- role: user?.role || 'user',
159
- });
160
- return filteredRoutes.map((route) => ({
161
- path: route.path,
162
- label: route.label,
163
- icon: route.icon,
164
- meta: route.meta,
165
- }));
166
- }, [allRoutes, user]);
167
- }
168
- /**
169
- * Hook that returns all discovered routes as a flat list
170
- *
171
- * Provides all route information without grouping or filtering.
172
- * Useful for route analytics, debugging, or admin interfaces.
173
- *
174
- * @returns Flat array of all route information
175
- *
176
- * @example
177
- * ```tsx
178
- * function RouteAnalytics() {
179
- * const allRoutes = useAllRoutes();
180
- * return <div>Total discovered routes: {allRoutes.length}</div>;
181
- * }
182
- * ```
183
- *
184
- * @version 0.1.0
185
- * @since 0.0.1
186
- * @author AMBROISE PARK Consulting
187
- */
188
- export function useAllRoutes() {
189
- const groups = useRouteDiscovery();
190
- return useMemo(() => {
191
- return groups.flatMap((group) => group.routes);
192
- }, [groups]);
193
- }
194
- /**
195
- * Hook that returns route manifest information from virtual module
196
- *
197
- * Provides metadata about the route discovery process including statistics
198
- * and build-time information. Useful for debugging and development tools.
199
- *
200
- * @returns Route manifest with statistics and metadata, or null if unavailable
201
- *
202
- * @example
203
- * ```tsx
204
- * function RouteManifestDisplay() {
205
- * const manifest = useRouteManifest();
206
- * if (!manifest) return <div>No manifest available</div>;
207
- *
208
- * return (
209
- * <div>
210
- * <p>Total routes: {manifest.totalRoutes}</p>
211
- * <p>Auth required: {manifest.authRequired}</p>
212
- * <p>Generated: {manifest.generatedAt}</p>
213
- * </div>
214
- * );
215
- * }
216
- * ```
217
- *
218
- * @version 0.1.0
219
- * @since 0.0.1
220
- * @author AMBROISE PARK Consulting
221
- */
222
- export function useRouteManifest() {
223
- return useMemo(() => {
224
- try {
225
- return getRouteManifest();
226
- }
227
- catch {
228
- return null;
229
- }
230
- }, []);
231
- }
232
- // ===== HELPER FUNCTIONS =====
233
- /**
234
- * Groups discovered routes by entity/domain for organized navigation
235
- *
236
- * Takes raw route data from the virtual module system and organizes it into
237
- * logical groups based on entity names extracted from route paths or metadata.
238
- *
239
- * Features:
240
- * - Automatic entity extraction from route paths
241
- * - Smart defaults for missing metadata
242
- * - Comprehensive route inclusion regardless of configuration completeness
243
- * - Organized navigation structure for UI components
244
- *
245
- * @param routes - Raw route data from virtual module
246
- * @returns Organized route groups with labels and route collections
247
- */
248
- function groupRoutes(routes) {
249
- const groups = new Map();
250
- routes.forEach((route) => {
251
- // Ensure path is a string - handle cases where it might be an object
252
- const pathString = typeof route.path === 'string' ? route.path : String(route.path);
253
- // Skip invalid routes
254
- if (!pathString || pathString === 'undefined' || pathString === 'null') {
255
- if (process.env.NODE_ENV === 'development') {
256
- console.warn('[groupRoutes] Skipping invalid route:', route);
257
- }
258
- return;
259
- }
260
- // Extract entity with fallback to path-based detection
261
- const entity = route.meta?.entity || extractEntityFromPath(pathString) || 'other';
262
- const routeInfo = {
263
- path: pathString, // Ensure path is always a string
264
- label: route.meta?.title || generateLabel(pathString),
265
- icon: route.meta?.icon, // Read icon from PageMeta
266
- component: route.component,
267
- importPath: route.importPath,
268
- exportName: route.exportName, // Pass through export name for named exports
269
- auth: route.auth,
270
- meta: route.meta,
271
- };
272
- if (!groups.has(entity)) {
273
- groups.set(entity, {
274
- label: entity.charAt(0).toUpperCase() + entity.slice(1),
275
- routes: [],
276
- });
277
- }
278
- groups.get(entity)?.routes.push(routeInfo);
279
- });
280
- return Array.from(groups.values());
281
- }
282
- /**
283
- * Extracts entity name from route path for grouping purposes
284
- *
285
- * Analyzes route path structure to determine the entity or domain that the
286
- * route belongs to, used for organizing routes into logical navigation groups.
287
- *
288
- * @param path - Route path (e.g., '/products/list')
289
- * @returns Entity name (e.g., 'products') or null if no entity found
290
- */
291
- function extractEntityFromPath(path) {
292
- const segments = path.split('/').filter(Boolean);
293
- return segments[0] || null;
294
- }
295
- /**
296
- * Generates human-readable label from route path
297
- *
298
- * Creates display-friendly labels from route paths by transforming path
299
- * segments into properly capitalized words suitable for navigation menus.
300
- *
301
- * @param path - Route path to generate label from
302
- * @returns Formatted label for display in navigation
303
- */
304
- function generateLabel(path) {
305
- const segments = path.split('/').filter(Boolean);
306
- const lastSegment = segments[segments.length - 1];
307
- if (!lastSegment)
308
- return 'Home';
309
- return lastSegment
310
- .split('-')
311
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
312
- .join(' ');
313
- }
1
+ "use client";import{useMemo as s}from"react";import{useNavigationStore as c,filterNavigationRoutes as p,getRoutes as l,getRouteManifest as f}from"@donotdev/core";import{useAuthSafe as u}from"../utils/useAuthSafe.js";function i(){return s(()=>{try{let t=l();return!t||t.length===0?[]:g(t)}catch{return[]}},[])}function d(){let t=i(),r=u("user");return s(()=>t.map(e=>({...e,routes:e.routes.filter(o=>o.auth===!1?!0:o.auth===!0||typeof o.auth=="object"&&o.auth.required?!!r:!0)})).filter(e=>e.routes.length>0),[t,r])}function y(){let t=u("user"),r=c(e=>e.cache.allRoutes);return s(()=>p(r,{authenticated:!!t,role:t?.role||"user"}).map(o=>({path:o.path,label:o.label,icon:o.icon,meta:o.meta})),[r,t])}function x(){let t=i();return s(()=>t.flatMap(r=>r.routes),[t])}function b(){return s(()=>{try{return f()}catch{return null}},[])}function g(t){let r=new Map;return t.forEach(e=>{let o=typeof e.path=="string"?e.path:String(e.path);if(!o||o==="undefined"||o==="null")return;let n=e.meta?.entity||m(o)||"other",a={path:o,label:e.meta?.title||R(o),icon:e.meta?.icon,component:e.component,importPath:e.importPath,exportName:e.exportName,auth:e.auth,meta:e.meta};r.has(n)||r.set(n,{label:n.charAt(0).toUpperCase()+n.slice(1),routes:[]}),r.get(n)?.routes.push(a)}),Array.from(r.values())}function m(t){return t.split("/").filter(Boolean)[0]||null}function R(t){let r=t.split("/").filter(Boolean),e=r[r.length-1];return e?e.split("-").map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" "):"Home"}export{y as useAccessibleNavigationRoutes,d as useAccessibleRoutes,x as useAllRoutes,i as useRouteDiscovery,b as useRouteManifest};
package/dist/rsc.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @fileoverview UI package, React Server Components entry
3
+ * @description `@donotdev/ui/rsc`: resolves only under the `react-server` export
4
+ * condition (Next's RSC graph); anywhere else the import fails to resolve. Nothing
5
+ * imports it yet: `@donotdev/ui` itself stays `index.ts` everywhere. Its modules
6
+ * import `@donotdev/components` (the client barrel), so components they render are
7
+ * client references.
8
+ *
9
+ * Same exports as `index.ts`, without its `'use client'`: presentational modules
10
+ * (PageContainer…) load as server components, and every interactive module keeps its
11
+ * own per-file `'use client'`, so a server component that renders it gets a client
12
+ * reference (an island). Values exported by a `'use client'` module (hooks, providers,
13
+ * helpers) are client references here: calling them on the server throws, which is
14
+ * the intended fail-loud.
15
+ *
16
+ * Keep in sync with `index.ts` (the entries test compares both export lists).
17
+ *
18
+ * @version 0.1.0
19
+ * @since 0.3.2
20
+ * @author AMBROISE PARK Consulting
21
+ */
22
+ export * from './components';
23
+ export * from './crud';
24
+ export * from './data/techLogos';
25
+ export * from './routing';
26
+ export * from './styles';
27
+ export * from './utils';
28
+ //# sourceMappingURL=rsc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rsc.d.ts","sourceRoot":"","sources":["../src/rsc.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
package/dist/rsc.js ADDED
@@ -0,0 +1 @@
1
+ export*from"./components/index.js";export*from"./crud/index.js";export*from"./data/techLogos.js";export*from"./routing/index.js";export*from"./styles/index.js";export*from"./utils/index.js";
@@ -168,13 +168,17 @@
168
168
  /* DRY: Default font for everything */
169
169
  --font-family: var(--font-sans);
170
170
 
171
- /* Sans-serif: Inter (2026 standard) */
171
+ /* Sans-serif: Inter (2026 standard). '<Family> Fallback': size-matched local face
172
+ shown until the web font loads, so the swap shifts no layout (Next: defined in
173
+ public/dndev-fonts.css, see @donotdev/core config/fonts/fontFallback.js) */
172
174
  --font-sans:
173
- Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue',
174
- Arial, sans-serif;
175
+ Inter, 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI',
176
+ 'Helvetica Neue', Arial, sans-serif;
175
177
 
176
178
  /* Serif: Playfair Display (headlines) */
177
- --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
179
+ --font-serif:
180
+ 'Playfair Display', 'Playfair Display Fallback', Georgia, 'Times New Roman',
181
+ serif;
178
182
 
179
183
  /* Headlines use sans by default (serif available for opt-in) */
180
184
  --font-headline: var(--font-sans);
@@ -3243,6 +3247,23 @@ em {
3243
3247
  .dndev-calendar-day-hidden {
3244
3248
  visibility: hidden;
3245
3249
  }
3250
+
3251
+ /* LazyCalendar placeholder while the calendar chunk loads: the rendered calendar's
3252
+ size (caption + weekday row + 6 weeks of day cells, 7 columns), borders outside as
3253
+ on .dndev-calendar, so the popover neither resizes nor flips when it arrives */
3254
+ .dndev-calendar-fallback {
3255
+ box-sizing: content-box;
3256
+ width: calc(var(--touch-target) * 7);
3257
+ height: calc(var(--touch-target) * 8);
3258
+ }
3259
+
3260
+ /* LazyCalendar error (calendar chunk failed to load), in the popover */
3261
+ .dndev-calendar-error {
3262
+ box-sizing: content-box;
3263
+ width: calc(var(--touch-target) * 7);
3264
+ padding: calc(var(--touch-target) / 4);
3265
+ color: var(--destructive-foreground);
3266
+ }
3246
3267
  /* packages/components/src/atomic/DatePicker/DatePicker.css */
3247
3268
 
3248
3269
  /**
@@ -1,10 +1 @@
1
- // packages/ui/src/styles/index.ts
2
- /**
3
- * @fileoverview UI Styles Barrel Exports
4
- * @description Barrel exports for UI style constants. Provides centralized access to layout constants and style-related utilities.
5
- *
6
- * @version 0.1.0
7
- * @since 0.0.1
8
- * @author AMBROISE PARK Consulting
9
- */
10
- export * from './layoutConstants';
1
+ export*from"./layoutConstants.js";
@@ -1,134 +1 @@
1
- // packages/ui/src/styles/layoutConstants.ts
2
- /**
3
- * @fileoverview Layout constants
4
- * @description Layout component class names and CSS selectors
5
- * Used for IDE autocomplete and type safety
6
- *
7
- * Note: CSS uses semantic HTML selectors with role attributes for scoping:
8
- * - `header[role='banner']` - not `.header` or `.dndev-header`
9
- * - `main[role='main']` - not `.main` or `.dndev-main`
10
- * - `footer[role='contentinfo']` - not `.footer` or `.dndev-footer`
11
- * - `aside[role='navigation'].sidebar` - uses `.sidebar` class but scoped by role
12
- *
13
- * Class names are organizational only. CSS targets by element+role for semantic scoping.
14
- *
15
- * @version 0.1.0
16
- * @since 0.0.1
17
- * @author AMBROISE PARK Consulting
18
- */
19
- export const layoutClasses = {
20
- // Layout container
21
- layoutContainer: 'dndev-layout',
22
- // Sidebar classes (CSS targets aside[role='navigation'].sidebar)
23
- sidebar: 'sidebar',
24
- sidebarTop: 'sidebar-top',
25
- sidebarContent: 'sidebar-content',
26
- sidebarBottom: 'sidebar-bottom',
27
- sidebarResizeHandle: 'dndev-sidebar-resize-handle',
28
- // Layout zone classes (organizational - CSS targets by element+role)
29
- // CSS: header[role='banner'], main[role='main'], footer[role='contentinfo']
30
- header: 'header',
31
- main: 'main',
32
- footer: 'footer',
33
- // Page container (namespaced - this one IS a CSS class)
34
- container: 'dndev-container',
35
- pageContainer: 'dndev-container',
36
- breadcrumbsContainer: 'breadcrumbs-container',
37
- };
38
- /**
39
- * Layout utility class names.
40
- * These are direct CSS class names that map to CSS variables (e.g., h-header → var(--header-height)).
41
- *
42
- * Framework components use these CSS classes directly.
43
- * These are exported for:
44
- * - Direct use in consumer apps
45
- * - IDE autocomplete
46
- *
47
- * @version 0.1.0
48
- * @since 0.0.1
49
- * @author AMBROISE PARK Consulting
50
- */
51
- export const layoutUtilities = {
52
- // Z-index utilities (from components package)
53
- zHeader: 'dndev-z-header',
54
- zSidebar: 'dndev-z-sidebar',
55
- zOverlay: 'dndev-z-overlay',
56
- zModal: 'dndev-z-modal',
57
- zTooltip: 'dndev-z-tooltip',
58
- zToast: 'dndev-z-toast',
59
- };
60
- /**
61
- * Combined export of all layout classes and utilities
62
- * For consumer apps
63
- *
64
- * @version 0.1.0
65
- * @since 0.0.1
66
- * @author AMBROISE PARK Consulting
67
- */
68
- export const allLayoutClasses = {
69
- ...layoutClasses,
70
- ...layoutUtilities,
71
- };
72
- /**
73
- * Layout CSS custom property names for programmatic access
74
- *
75
- * @version 0.1.0
76
- * @since 0.0.1
77
- * @author AMBROISE PARK Consulting
78
- */
79
- export const layoutVariables = {
80
- // Header dimensions
81
- headerHeight: '--header-height',
82
- headerPadding: '--header-padding',
83
- headerIconSize: '--header-icon-size',
84
- headerLogoMaxHeight: '--header-logo-max-height',
85
- // Sidebar dimensions
86
- sidebarWidth: '--sidebar-width',
87
- sidebarPadding: '--sidebar-padding',
88
- // Main content dimensions
89
- mainPadding: '--main-padding',
90
- mainMaxWidth: '--main-max-width',
91
- contentWidth: '--content-width',
92
- contentPadding: '--content-padding',
93
- // Footer dimensions
94
- footerHeight: '--footer-height',
95
- footerPadding: '--footer-padding',
96
- // Z-index layers (from components package)
97
- zHeader: '--z-header',
98
- zSidebar: '--z-sidebar',
99
- zFooter: '--z-footer',
100
- zOverlay: '--z-overlay',
101
- zModal: '--z-modal',
102
- zTooltip: '--z-tooltip',
103
- zToast: '--z-toast',
104
- };
105
- /**
106
- * CSS variable exports
107
- * Exports CSS variable names for use in TypeScript
108
- *
109
- * @version 0.1.0
110
- * @since 0.0.1
111
- * @author AMBROISE PARK Consulting
112
- */
113
- export const cssVariables = {
114
- /* Header */
115
- headerHeight: '--header-height',
116
- headerPadding: '--header-padding',
117
- logoSize: '--logo-size',
118
- /* Sidebar */
119
- sidebarWidth: '--sidebar-width',
120
- sidebarPadding: '--sidebar-padding',
121
- /* Footer */
122
- footerHeight: '--footer-height',
123
- footerPadding: '--footer-padding',
124
- /* Layout spacing */
125
- layoutGap: '--layout-gap',
126
- sectionGap: '--gap-lg',
127
- contentGap: '--content-gap',
128
- /* Z-index */
129
- zHeader: '--z-header',
130
- zSidebar: '--z-sidebar',
131
- zFooter: '--z-footer',
132
- zModal: '--z-modal',
133
- zTooltip: '--z-tooltip',
134
- };
1
+ var e={layoutContainer:"dndev-layout",sidebar:"sidebar",sidebarTop:"sidebar-top",sidebarContent:"sidebar-content",sidebarBottom:"sidebar-bottom",sidebarResizeHandle:"dndev-sidebar-resize-handle",header:"header",main:"main",footer:"footer",container:"dndev-container",pageContainer:"dndev-container",breadcrumbsContainer:"breadcrumbs-container"},a={zHeader:"dndev-z-header",zSidebar:"dndev-z-sidebar",zOverlay:"dndev-z-overlay",zModal:"dndev-z-modal",zTooltip:"dndev-z-tooltip",zToast:"dndev-z-toast"},d={...e,...a},o={headerHeight:"--header-height",headerPadding:"--header-padding",headerIconSize:"--header-icon-size",headerLogoMaxHeight:"--header-logo-max-height",sidebarWidth:"--sidebar-width",sidebarPadding:"--sidebar-padding",mainPadding:"--main-padding",mainMaxWidth:"--main-max-width",contentWidth:"--content-width",contentPadding:"--content-padding",footerHeight:"--footer-height",footerPadding:"--footer-padding",zHeader:"--z-header",zSidebar:"--z-sidebar",zFooter:"--z-footer",zOverlay:"--z-overlay",zModal:"--z-modal",zTooltip:"--z-tooltip",zToast:"--z-toast"},t={headerHeight:"--header-height",headerPadding:"--header-padding",logoSize:"--logo-size",sidebarWidth:"--sidebar-width",sidebarPadding:"--sidebar-padding",footerHeight:"--footer-height",footerPadding:"--footer-padding",layoutGap:"--layout-gap",sectionGap:"--gap-lg",contentGap:"--content-gap",zHeader:"--z-header",zSidebar:"--z-sidebar",zFooter:"--z-footer",zModal:"--z-modal",zTooltip:"--z-tooltip"};export{d as allLayoutClasses,t as cssVariables,e as layoutClasses,a as layoutUtilities,o as layoutVariables};