@donotdev/ui 0.0.12 → 0.0.14

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 (159) hide show
  1. package/dist/components/auth/AuthMenu.d.ts.map +1 -1
  2. package/dist/components/auth/AuthMenu.js +19 -20
  3. package/dist/components/common/FeatureCard.d.ts +3 -1
  4. package/dist/components/common/FeatureCard.d.ts.map +1 -1
  5. package/dist/components/common/FeatureCard.js +3 -3
  6. package/dist/components/common/ProgressBar.js +2 -2
  7. package/dist/components/common/RedirectOverlay.js +1 -1
  8. package/dist/components/common/TechBento.d.ts +14 -2
  9. package/dist/components/common/TechBento.d.ts.map +1 -1
  10. package/dist/components/common/TechBento.js +8 -9
  11. package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
  12. package/dist/components/cookie-consent/CookieConsent.js +6 -7
  13. package/dist/components/layout/GameContainer.d.ts +24 -8
  14. package/dist/components/layout/GameContainer.d.ts.map +1 -1
  15. package/dist/components/layout/GameContainer.js +21 -3
  16. package/dist/components/layout/GameFlow.d.ts.map +1 -1
  17. package/dist/components/layout/GameFlow.js +27 -11
  18. package/dist/components/layout/components/DropdownNavigation.d.ts.map +1 -1
  19. package/dist/components/layout/components/DropdownNavigation.js +3 -12
  20. package/dist/components/layout/components/FloatingLanguageSwitcher.js +1 -1
  21. package/dist/components/layout/components/Notifications.d.ts +1 -3
  22. package/dist/components/layout/components/Notifications.d.ts.map +1 -1
  23. package/dist/components/layout/components/Notifications.js +4 -2
  24. package/dist/components/layout/components/header/AppBranding.d.ts.map +1 -1
  25. package/dist/components/layout/components/header/AppBranding.js +2 -1
  26. package/dist/components/layout/components/header/AppIcon.d.ts.map +1 -1
  27. package/dist/components/layout/components/header/AppIcon.js +5 -2
  28. package/dist/components/layout/components/header/CacheSettings.d.ts.map +1 -1
  29. package/dist/components/layout/components/header/CacheSettings.js +4 -2
  30. package/dist/components/layout/components/header/HeaderNavigation.d.ts +6 -0
  31. package/dist/components/layout/components/header/HeaderNavigation.d.ts.map +1 -1
  32. package/dist/components/layout/components/header/HeaderNavigation.js +12 -2
  33. package/dist/components/license/LicenseWatermark.d.ts.map +1 -1
  34. package/dist/components/license/LicenseWatermark.js +3 -1
  35. package/dist/crud/components/CrudCardLink.d.ts +17 -0
  36. package/dist/crud/components/CrudCardLink.d.ts.map +1 -0
  37. package/dist/crud/components/CrudCardLink.js +17 -0
  38. package/dist/crud/components/EntityCardList.d.ts.map +1 -1
  39. package/dist/crud/components/EntityCardList.js +32 -81
  40. package/dist/crud/components/EntityDisplayRenderer.d.ts +1 -1
  41. package/dist/crud/components/EntityDisplayRenderer.d.ts.map +1 -1
  42. package/dist/crud/components/EntityDisplayRenderer.js +8 -4
  43. package/dist/crud/components/EntityFormRenderer.d.ts +1 -1
  44. package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
  45. package/dist/crud/components/EntityFormRenderer.js +29 -18
  46. package/dist/crud/components/EntityList.d.ts +1 -1
  47. package/dist/crud/components/EntityList.d.ts.map +1 -1
  48. package/dist/crud/components/EntityList.js +8 -10
  49. package/dist/crud/components/EntityRecommendations.d.ts +28 -0
  50. package/dist/crud/components/EntityRecommendations.d.ts.map +1 -0
  51. package/dist/crud/components/EntityRecommendations.js +31 -0
  52. package/dist/crud/components/Form.js +1 -1
  53. package/dist/crud/components/index.d.ts +2 -1
  54. package/dist/crud/components/index.d.ts.map +1 -1
  55. package/dist/crud/components/index.js +1 -0
  56. package/dist/index.js +4 -4
  57. package/dist/internal/common/RouteErrorFallback.d.ts.map +1 -1
  58. package/dist/internal/common/RouteErrorFallback.js +3 -3
  59. package/dist/internal/devtools/components/AuthDebugButton.js +1 -1
  60. package/dist/internal/devtools/components/ConfigTab.js +1 -1
  61. package/dist/internal/devtools/components/CookieTab.js +1 -1
  62. package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
  63. package/dist/internal/devtools/components/DesignTab.js +5 -4
  64. package/dist/internal/devtools/components/LayoutReset.d.ts.map +1 -1
  65. package/dist/internal/devtools/components/LayoutReset.js +2 -0
  66. package/dist/internal/devtools/components/StoresTab.d.ts.map +1 -1
  67. package/dist/internal/devtools/components/StoresTab.js +5 -2
  68. package/dist/internal/devtools/utils/envVarDiscovery.d.ts +1 -0
  69. package/dist/internal/devtools/utils/envVarDiscovery.d.ts.map +1 -1
  70. package/dist/internal/devtools/utils/envVarDiscovery.js +5 -0
  71. package/dist/internal/devtools/utils/virtualModuleInspector.d.ts.map +1 -1
  72. package/dist/internal/devtools/utils/virtualModuleInspector.js +27 -21
  73. package/dist/internal/initializers/BaseStoresInitializer.d.ts.map +1 -1
  74. package/dist/internal/initializers/BaseStoresInitializer.js +30 -6
  75. package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
  76. package/dist/internal/layout/components/AutoMetaTags.js +10 -8
  77. package/dist/internal/layout/components/FontPreloadLinks.d.ts +16 -0
  78. package/dist/internal/layout/components/FontPreloadLinks.d.ts.map +1 -0
  79. package/dist/internal/layout/components/FontPreloadLinks.js +32 -0
  80. package/dist/internal/layout/components/PerformanceHints.d.ts +7 -12
  81. package/dist/internal/layout/components/PerformanceHints.d.ts.map +1 -1
  82. package/dist/internal/layout/components/PerformanceHints.js +8 -12
  83. package/dist/internal/layout/components/footer/useLegalLinks.d.ts +6 -5
  84. package/dist/internal/layout/components/footer/useLegalLinks.d.ts.map +1 -1
  85. package/dist/internal/layout/components/footer/useLegalLinks.js +6 -2
  86. package/dist/internal/layout/zones/DnDevFooter.d.ts +6 -0
  87. package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
  88. package/dist/internal/layout/zones/DnDevFooter.js +10 -4
  89. package/dist/internal/layout/zones/DnDevHeader.d.ts +7 -0
  90. package/dist/internal/layout/zones/DnDevHeader.d.ts.map +1 -1
  91. package/dist/internal/layout/zones/DnDevHeader.js +7 -0
  92. package/dist/internal/layout/zones/DnDevMergedBar.d.ts +7 -0
  93. package/dist/internal/layout/zones/DnDevMergedBar.d.ts.map +1 -1
  94. package/dist/internal/layout/zones/DnDevMergedBar.js +10 -1
  95. package/dist/internal/layout/zones/DnDevSidebar.d.ts +4 -0
  96. package/dist/internal/layout/zones/DnDevSidebar.d.ts.map +1 -1
  97. package/dist/internal/layout/zones/DnDevSidebar.js +13 -1
  98. package/dist/next.d.ts +1 -0
  99. package/dist/next.d.ts.map +1 -1
  100. package/dist/next.js +1 -0
  101. package/dist/routing/404.js +3 -3
  102. package/dist/routing/AuthGuard.d.ts +1 -1
  103. package/dist/routing/AuthGuard.d.ts.map +1 -1
  104. package/dist/routing/AuthGuard.js +3 -1
  105. package/dist/routing/AuthGuardFallback.js +2 -2
  106. package/dist/routing/GoTo.d.ts.map +1 -1
  107. package/dist/routing/GoTo.js +3 -1
  108. package/dist/routing/GoToDialog.d.ts.map +1 -1
  109. package/dist/routing/GoToDialog.js +2 -7
  110. package/dist/routing/GoToInput.d.ts +0 -3
  111. package/dist/routing/GoToInput.d.ts.map +1 -1
  112. package/dist/routing/GoToInput.js +4 -2
  113. package/dist/routing/Link.js +1 -1
  114. package/dist/routing/NavigationItem.d.ts +29 -7
  115. package/dist/routing/NavigationItem.d.ts.map +1 -1
  116. package/dist/routing/NavigationItem.js +22 -6
  117. package/dist/routing/hooks/hooks.next.js +1 -1
  118. package/dist/routing/hooks/hooks.vite.js +1 -1
  119. package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
  120. package/dist/routing/hooks/useRedirectGuard.next.js +9 -8
  121. package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
  122. package/dist/routing/hooks/useRedirectGuard.vite.js +9 -8
  123. package/dist/routing/hooks/useSearchParams.next.d.ts +18 -1
  124. package/dist/routing/hooks/useSearchParams.next.d.ts.map +1 -1
  125. package/dist/routing/hooks/useSearchParams.next.js +16 -0
  126. package/dist/routing/hooks/useSearchParams.vite.d.ts +16 -0
  127. package/dist/routing/hooks/useSearchParams.vite.d.ts.map +1 -1
  128. package/dist/routing/hooks/useSearchParams.vite.js +17 -1
  129. package/dist/routing/index.d.ts.map +1 -1
  130. package/dist/routing/index.js +2 -0
  131. package/dist/routing/useNavigation.d.ts +30 -0
  132. package/dist/routing/useNavigation.d.ts.map +1 -1
  133. package/dist/routing/useNavigation.js +40 -3
  134. package/dist/routing/useRouteDiscovery.d.ts +2 -2
  135. package/dist/routing/useRouteDiscovery.d.ts.map +1 -1
  136. package/dist/routing/useRouteDiscovery.js +10 -4
  137. package/dist/styles/index.css +366 -120
  138. package/dist/utils/index.d.ts +1 -0
  139. package/dist/utils/index.d.ts.map +1 -1
  140. package/dist/utils/index.js +1 -0
  141. package/dist/utils/sanitizeSvg.d.ts +13 -0
  142. package/dist/utils/sanitizeSvg.d.ts.map +1 -0
  143. package/dist/utils/sanitizeSvg.js +47 -0
  144. package/dist/utils/useBillingVisibility.d.ts.map +1 -1
  145. package/dist/utils/useBillingVisibility.js +0 -7
  146. package/dist/utils/useCrudSafe.d.ts +0 -2
  147. package/dist/utils/useCrudSafe.d.ts.map +1 -1
  148. package/dist/utils/useFormStoreSafe.d.ts +3 -1
  149. package/dist/utils/useFormStoreSafe.d.ts.map +1 -1
  150. package/dist/utils/useFormStoreSafe.js +4 -5
  151. package/dist/vite-routing/AppRoutes.d.ts +19 -8
  152. package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
  153. package/dist/vite-routing/AppRoutes.js +0 -3
  154. package/package.json +15 -11
  155. package/assets/fonts/fonts.css +0 -206
  156. package/dist/dndev.css +0 -10673
  157. package/dist/routing/Navigate.d.ts +0 -10
  158. package/dist/routing/Navigate.d.ts.map +0 -1
  159. package/dist/routing/Navigate.js +0 -10
@@ -14,4 +14,5 @@ export * from './useStripeBillingSafe';
14
14
  export * from './useBillingVisibility';
15
15
  export * from './useOAuthSafe';
16
16
  export * from './tList';
17
+ export * from './sanitizeSvg';
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC"}
@@ -15,3 +15,4 @@ export * from './useStripeBillingSafe';
15
15
  export * from './useBillingVisibility';
16
16
  export * from './useOAuthSafe';
17
17
  export * from './tList';
18
+ export * from './sanitizeSvg';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Strips known XSS vectors from an SVG string.
3
+ *
4
+ * @param svg - Raw SVG string (build-time or static source)
5
+ * @returns Sanitized SVG string safe for dangerouslySetInnerHTML
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * <div dangerouslySetInnerHTML={{ __html: sanitizeSvg(svgContent) }} />
10
+ * ```
11
+ */
12
+ export declare function sanitizeSvg(svg: string): string;
13
+ //# sourceMappingURL=sanitizeSvg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitizeSvg.d.ts","sourceRoot":"","sources":["../../src/utils/sanitizeSvg.ts"],"names":[],"mappings":"AA+BA;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO/C"}
@@ -0,0 +1,47 @@
1
+ // packages/ui/src/utils/sanitizeSvg.ts
2
+ /**
3
+ * @fileoverview Minimal SVG sanitizer
4
+ * @description Strips dangerous elements and attributes from SVG strings
5
+ * without requiring a third-party DOMPurify dependency.
6
+ *
7
+ * Removes:
8
+ * - `<script>` elements and their content
9
+ * - `<foreignObject>` elements (arbitrary HTML injection vector)
10
+ * - Event handler attributes (on*)
11
+ * - `href` / `xlink:href` values starting with `javascript:`
12
+ * - `data:` URIs in href attributes (except safe image types)
13
+ *
14
+ * @remarks
15
+ * This is intentionally a lightweight allowlist approach for SVG strings
16
+ * that originate from build-time assets (logo.svg) or internal static data
17
+ * (techLogos). For user-provided SVG content, use DOMPurify instead.
18
+ *
19
+ * @version 0.0.1
20
+ * @since 0.0.1
21
+ * @author AMBROISE PARK Consulting
22
+ */
23
+ /** Regex patterns for known XSS vectors in SVG */
24
+ const SCRIPT_TAG_RE = /<script[\s\S]*?<\/script>/gi;
25
+ const FOREIGN_OBJECT_RE = /<foreignObject[\s\S]*?<\/foreignObject>/gi;
26
+ const EVENT_HANDLER_RE = /\s+on\w+\s*=\s*["'][^"']*["']/gi;
27
+ const JAVASCRIPT_HREF_RE = /\s+(?:xlink:)?href\s*=\s*["']\s*javascript:[^"']*["']/gi;
28
+ const DATA_URI_HREF_RE = /\s+(?:xlink:)?href\s*=\s*["']\s*data:(?!image\/(?:png|jpe?g|gif|webp|svg\+xml))[^"']*["']/gi;
29
+ /**
30
+ * Strips known XSS vectors from an SVG string.
31
+ *
32
+ * @param svg - Raw SVG string (build-time or static source)
33
+ * @returns Sanitized SVG string safe for dangerouslySetInnerHTML
34
+ *
35
+ * @example
36
+ * ```tsx
37
+ * <div dangerouslySetInnerHTML={{ __html: sanitizeSvg(svgContent) }} />
38
+ * ```
39
+ */
40
+ export function sanitizeSvg(svg) {
41
+ return svg
42
+ .replace(SCRIPT_TAG_RE, '')
43
+ .replace(FOREIGN_OBJECT_RE, '')
44
+ .replace(EVENT_HANDLER_RE, '')
45
+ .replace(JAVASCRIPT_HREF_RE, '')
46
+ .replace(DATA_URI_HREF_RE, '');
47
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"useBillingVisibility.d.ts","sourceRoot":"","sources":["../../src/utils/useBillingVisibility.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,oBAAoB,IAAI,sBAAsB,CA0B7D"}
1
+ {"version":3,"file":"useBillingVisibility.d.ts","sourceRoot":"","sources":["../../src/utils/useBillingVisibility.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,oBAAoB,IAAI,sBAAsB,CAkB7D"}
@@ -49,13 +49,6 @@ export function useBillingVisibility() {
49
49
  const shouldHide = !isAvailable;
50
50
  const isLoading = billingStatus === 'initializing';
51
51
  const isReady = isAvailable && billingStatus === 'ready';
52
- console.log('[useBillingVisibility]', {
53
- billingStatus,
54
- isAvailable,
55
- shouldHide,
56
- isLoading,
57
- isReady,
58
- });
59
52
  return {
60
53
  shouldHide,
61
54
  isLoading,
@@ -1,7 +1,5 @@
1
1
  import type { CrudAPI, dndevSchema, Entity } from '@donotdev/core';
2
- type BackendType = 'firestore' | 'functions';
3
2
  interface UseCrudSafeOptions<T> {
4
- backend?: BackendType;
5
3
  schema?: dndevSchema<T>;
6
4
  entity?: Entity;
7
5
  staleTime?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"useCrudSafe.d.ts","sourceRoot":"","sources":["../../src/utils/useCrudSafe.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,eAAe,SAAoC,CAAC"}
@@ -21,6 +21,8 @@ declare const DEGRADED_FORM_STORE_STATE: {
21
21
  readonly getError: () => null;
22
22
  readonly getIsDirty: () => boolean;
23
23
  };
24
+ /** Minimal shape shared between the real FormStore state and the degraded fallback */
25
+ type FormStoreLike = typeof DEGRADED_FORM_STORE_STATE;
24
26
  /**
25
27
  * Check if FormStore is available
26
28
  */
@@ -38,7 +40,7 @@ export declare const isFormStoreAvailable: boolean;
38
40
  * // Always safe to call - returns false when degraded
39
41
  * ```
40
42
  */
41
- export declare function useFormStoreSafe<T>(selector: (state: any) => T): T;
43
+ export declare function useFormStoreSafe<T>(selector: (state: FormStoreLike) => T): T;
42
44
  export declare namespace useFormStoreSafe {
43
45
  var getState: () => typeof DEGRADED_FORM_STORE_STATE;
44
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useFormStoreSafe.d.ts","sourceRoot":"","sources":["../../src/utils/useFormStoreSafe.ts"],"names":[],"mappings":"AA8BA;;;GAGG;AACH,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;CAqBrB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,oBAAoB,SAAyC,CAAC;AAE3E;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAKlE;yBALe,gBAAgB;wBAmBA,OAAO,yBAAyB;;AAOhE;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAG9C;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,SAA4C,GAClD,OAAO,CAAC,OAAO,CAAC,CAUlB"}
1
+ {"version":3,"file":"useFormStoreSafe.d.ts","sourceRoot":"","sources":["../../src/utils/useFormStoreSafe.ts"],"names":[],"mappings":"AAwBA;;;GAGG;AACH,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;CAqBrB,CAAC;AAEX,sFAAsF;AACtF,KAAK,aAAa,GAAG,OAAO,yBAAyB,CAAC;AAQtD;;GAEG;AACH,eAAO,MAAM,oBAAoB,SAAyC,CAAC;AAE3E;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,CAAC,GAAG,CAAC,CAK5E;yBALe,gBAAgB;wBAmBA,OAAO,yBAAyB;;AAOhE;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,SAA4C,GAClD,OAAO,CAAC,OAAO,CAAC,CAUlB"}
@@ -18,9 +18,6 @@
18
18
  import * as crudModule from '@donotdev/crud';
19
19
  // Sync import - bundler aliases to empty module if not installed
20
20
  // Decision made ONCE at module load time, never changes
21
- // Extract useFormStore if available (undefined if package not installed/aliased)
22
- // Zustand stores have both the hook and getState method
23
- const realUseFormStore = crudModule?.useFormStore;
24
21
  /**
25
22
  * Degraded FormStore state - returned when CRUD package not installed
26
23
  * Matches FormStoreState & FormStoreActions interface
@@ -47,6 +44,9 @@ const DEGRADED_FORM_STORE_STATE = {
47
44
  getError: () => null,
48
45
  getIsDirty: () => false,
49
46
  };
47
+ // Extract useFormStore if available (undefined if package not installed/aliased)
48
+ // Zustand stores have both the hook and getState method
49
+ const realUseFormStore = crudModule?.useFormStore;
50
50
  /**
51
51
  * Check if FormStore is available
52
52
  */
@@ -93,8 +93,7 @@ useFormStoreSafe.getState = () => {
93
93
  * Returns false if CRUD package not available.
94
94
  */
95
95
  export function useHasDirtyFormsSafe() {
96
- const hasDirtyForms = useFormStoreSafe((state) => state.hasDirtyForms());
97
- return hasDirtyForms();
96
+ return useFormStoreSafe((state) => state.hasDirtyForms());
98
97
  }
99
98
  /**
100
99
  * Check if navigation should be blocked (safe version).
@@ -1,16 +1,27 @@
1
- import type { LayoutConfig } from '@donotdev/core';
1
+ import type { PageAuth, LayoutConfig } from '@donotdev/core';
2
+ import type { ComponentType } from 'react';
3
+ /** Lazy-loadable page component factory or Vite glob string reference */
4
+ type PageComponentFactory = (() => Promise<{
5
+ default: ComponentType;
6
+ }>) | string;
2
7
  /**
3
8
  * Route group from useRouteDiscovery
4
9
  */
5
10
  export interface RouteGroup {
6
11
  label: string;
7
- icon?: any;
8
- routes: Array<{
9
- path: string;
10
- component: any;
11
- auth?: any;
12
- [key: string]: any;
13
- }>;
12
+ icon?: unknown;
13
+ routes: Array<RouteGroupEntry>;
14
+ }
15
+ /** Minimal route entry shape accepted by createAppRouter */
16
+ export interface RouteGroupEntry {
17
+ path: string;
18
+ component: PageComponentFactory;
19
+ auth?: boolean | PageAuth;
20
+ label?: string;
21
+ importPath?: string;
22
+ exportName?: string;
23
+ meta?: unknown;
24
+ icon?: unknown;
14
25
  }
15
26
  /**
16
27
  * Options for createAppRouter
@@ -1 +1 @@
1
- {"version":3,"file":"AppRoutes.d.ts","sourceRoot":"","sources":["../../src/vite-routing/AppRoutes.tsx"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAY,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAyF7D;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,GAAG,CAAC;QACf,IAAI,CAAC,EAAE,GAAG,CAAC;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,UAAU,sBAAsB;IAC9B,4CAA4C;IAC5C,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;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A8D9D"}
@@ -108,9 +108,6 @@ function parseAuthConfig(auth) {
108
108
  if (typeof auth === 'object' && auth !== null) {
109
109
  return auth; // Return PageAuth object as-is
110
110
  }
111
- if (typeof auth === 'function') {
112
- return false; // Functions are not valid auth configs
113
- }
114
111
  return false; // Default to public
115
112
  }
116
113
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/ui",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -47,21 +47,25 @@
47
47
  "type-check": "tsc --noEmit"
48
48
  },
49
49
  "dependencies": {
50
+ "@fontsource/inter": "^5.2.8",
51
+ "@fontsource/playfair-display": "^5.2.8",
52
+ "@fontsource/roboto": "^5.2.9",
53
+ "@fontsource/space-grotesk": "^5.2.10",
50
54
  "@hookform/resolvers": "^5.2.2",
51
55
  "react-helmet-async": "^2.0.5",
52
56
  "react-hook-form": "^7.71.1"
53
57
  },
54
58
  "peerDependencies": {
55
- "@donotdev/adv-comps": "^0.0.9",
56
- "@donotdev/auth": "^0.0.6",
57
- "@donotdev/billing": "^0.0.5",
58
- "@donotdev/components": "^0.0.15",
59
- "@donotdev/core": "^0.0.20",
60
- "@donotdev/crud": "^0.0.11",
61
- "@donotdev/firebase": "^0.0.9",
62
- "@donotdev/oauth": "^0.0.5",
63
- "firebase": "^12.8.0",
64
- "lucide-react": "^0.563.0",
59
+ "@donotdev/adv-comps": "^0.0.11",
60
+ "@donotdev/auth": "^0.0.7",
61
+ "@donotdev/billing": "^0.0.6",
62
+ "@donotdev/components": "^0.0.17",
63
+ "@donotdev/core": "^0.0.24",
64
+ "@donotdev/crud": "^0.0.15",
65
+ "@donotdev/firebase": "^0.0.10",
66
+ "@donotdev/oauth": "^0.0.6",
67
+ "firebase": "^12.9.0",
68
+ "lucide-react": "^0.574.0",
65
69
  "react": "^19.2.4",
66
70
  "react-dom": "^19.2.4",
67
71
  "react-router-dom": "^7.13.0",
@@ -1,206 +0,0 @@
1
- /* packages/ui/assets/fonts/fonts.css */
2
-
3
- @font-face {
4
- font-family: Roboto;
5
- font-style: normal;
6
- font-weight: 400;
7
- font-display: swap;
8
- src: url('/fonts/Roboto-400-latin.woff2') format('woff2');
9
- unicode-range: U+0000-00FF; /* Basic Latin - loads first for performance */
10
- }
11
-
12
- @font-face {
13
- font-family: Roboto;
14
- font-style: normal;
15
- font-weight: 700;
16
- font-display: swap;
17
- src: url('/fonts/Roboto-700-latin.woff2') format('woff2');
18
- unicode-range: U+0000-00FF; /* Basic Latin - loads first for performance */
19
- }
20
-
21
- /* ✅ CRITICAL: Extended character sets load on-demand when needed */
22
- /* These load automatically when browser encounters characters in these ranges */
23
- @font-face {
24
- font-family: Roboto;
25
- font-style: normal;
26
- font-weight: 400;
27
- font-display: swap;
28
- src: url('/fonts/Roboto-400-latin-ext.woff2') format('woff2');
29
- unicode-range:
30
- U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113,
31
- U+2C60-2C7F, U+A720-A7FF;
32
- }
33
-
34
- @font-face {
35
- font-family: Roboto;
36
- font-style: normal;
37
- font-weight: 700;
38
- font-display: swap;
39
- src: url('/fonts/Roboto-700-latin-ext.woff2') format('woff2');
40
- unicode-range:
41
- U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113,
42
- U+2C60-2C7F, U+A720-A7FF;
43
- }
44
-
45
- /* Cyrillic */
46
- @font-face {
47
- font-family: Roboto;
48
- font-style: normal;
49
- font-weight: 400;
50
- font-display: swap;
51
- src: url('/fonts/Roboto-400-cyrillic.woff2') format('woff2');
52
- unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
53
- }
54
-
55
- @font-face {
56
- font-family: Roboto;
57
- font-style: normal;
58
- font-weight: 700;
59
- font-display: swap;
60
- src: url('/fonts/Roboto-700-cyrillic.woff2') format('woff2');
61
- unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
62
- }
63
-
64
- /* Cyrillic Extended */
65
- @font-face {
66
- font-family: Roboto;
67
- font-style: normal;
68
- font-weight: 400;
69
- font-display: swap;
70
- src: url('/fonts/Roboto-400-cyrillic-ext.woff2') format('woff2');
71
- unicode-range:
72
- U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
73
- }
74
-
75
- @font-face {
76
- font-family: Roboto;
77
- font-style: normal;
78
- font-weight: 700;
79
- font-display: swap;
80
- src: url('/fonts/Roboto-700-cyrillic-ext.woff2') format('woff2');
81
- unicode-range:
82
- U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
83
- }
84
-
85
- /* Greek */
86
- @font-face {
87
- font-family: Roboto;
88
- font-style: normal;
89
- font-weight: 400;
90
- font-display: swap;
91
- src: url('/fonts/Roboto-400-greek.woff2') format('woff2');
92
- unicode-range: U+0370-03FF;
93
- }
94
-
95
- @font-face {
96
- font-family: Roboto;
97
- font-style: normal;
98
- font-weight: 700;
99
- font-display: swap;
100
- src: url('/fonts/Roboto-700-greek.woff2') format('woff2');
101
- unicode-range: U+0370-03FF;
102
- }
103
-
104
- /* Greek Extended */
105
- @font-face {
106
- font-family: Roboto;
107
- font-style: normal;
108
- font-weight: 400;
109
- font-display: swap;
110
- src: url('/fonts/Roboto-400-greek-ext.woff2') format('woff2');
111
- unicode-range: U+1F00-1FFF;
112
- }
113
-
114
- @font-face {
115
- font-family: Roboto;
116
- font-style: normal;
117
- font-weight: 700;
118
- font-display: swap;
119
- src: url('/fonts/Roboto-700-greek-ext.woff2') format('woff2');
120
- unicode-range: U+1F00-1FFF;
121
- }
122
-
123
- /* Vietnamese */
124
- @font-face {
125
- font-family: Roboto;
126
- font-style: normal;
127
- font-weight: 400;
128
- font-display: swap;
129
- src: url('/fonts/Roboto-400-vietnamese.woff2') format('woff2');
130
- unicode-range:
131
- U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
132
- U+01AF-01B0, U+1EA0-1EF9, U+20AB;
133
- }
134
-
135
- @font-face {
136
- font-family: Roboto;
137
- font-style: normal;
138
- font-weight: 700;
139
- font-display: swap;
140
- src: url('/fonts/Roboto-700-vietnamese.woff2') format('woff2');
141
- unicode-range:
142
- U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
143
- U+01AF-01B0, U+1EA0-1EF9, U+20AB;
144
- }
145
-
146
- /* ===========================
147
- Inter - Modern Sans-Serif (Variable Font)
148
- Weights: 400-700
149
- =========================== */
150
-
151
- /* Latin - loads first */
152
- @font-face {
153
- font-family: Inter;
154
- font-style: normal;
155
- font-weight: 400 700;
156
- font-display: swap; /* Changed from optional to swap - we preload this font */
157
- src: url('/fonts/Inter-latin.woff2') format('woff2');
158
- unicode-range:
159
- U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
160
- U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
161
- U+2215, U+FEFF, U+FFFD;
162
- }
163
-
164
- /* Latin Extended - on-demand */
165
- @font-face {
166
- font-family: Inter;
167
- font-style: normal;
168
- font-weight: 400 700;
169
- font-display: swap;
170
- src: url('/fonts/Inter-latin-ext.woff2') format('woff2');
171
- unicode-range:
172
- U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
173
- U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
174
- U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
175
- }
176
-
177
- /* ===========================
178
- Playfair Display - Serif (Variable Font)
179
- Weights: 400-700
180
- =========================== */
181
-
182
- /* Latin - loads first */
183
- @font-face {
184
- font-family: 'Playfair Display';
185
- font-style: normal;
186
- font-weight: 400 700;
187
- font-display: swap;
188
- src: url('/fonts/PlayfairDisplay-latin.woff2') format('woff2');
189
- unicode-range:
190
- U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
191
- U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
192
- U+2215, U+FEFF, U+FFFD;
193
- }
194
-
195
- /* Latin Extended - on-demand */
196
- @font-face {
197
- font-family: 'Playfair Display';
198
- font-style: normal;
199
- font-weight: 400 700;
200
- font-display: swap;
201
- src: url('/fonts/PlayfairDisplay-latin-ext.woff2') format('woff2');
202
- unicode-range:
203
- U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
204
- U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
205
- U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
206
- }