@donotdev/ui 0.1.0 → 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.
- package/dist/{GoToDialog-CR4VOVXT.js → GoToDialog-RU5RP7S2.js} +1 -1
- package/dist/chunk-ETE4RC7M.js +1 -0
- package/dist/components/auth/AuthHeader.d.ts +6 -1
- package/dist/components/auth/AuthHeader.d.ts.map +1 -1
- package/dist/components/auth/AuthHeader.js +4 -4
- package/dist/components/common/FeatureCard.d.ts +2 -0
- package/dist/components/common/FeatureCard.d.ts.map +1 -1
- package/dist/components/common/FeatureDisabled.d.ts +1 -0
- package/dist/components/common/FeatureDisabled.d.ts.map +1 -1
- package/dist/components/common/TechBento.d.ts +1 -0
- package/dist/components/common/TechBento.d.ts.map +1 -1
- package/dist/components/common/icon.d.ts +1 -0
- package/dist/components/common/icon.d.ts.map +1 -1
- package/dist/components/cookie-consent/CookieConsent.d.ts +1 -0
- package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
- package/dist/components/layout/PageConfig.d.ts +25 -0
- package/dist/components/layout/PageConfig.d.ts.map +1 -0
- package/dist/components/layout/PageConfig.js +47 -0
- package/dist/components/layout/components/Breadcrumbs.d.ts +2 -0
- package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts +1 -0
- package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppBranding.d.ts +1 -0
- package/dist/components/layout/components/header/AppBranding.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppIcon.d.ts +1 -0
- package/dist/components/layout/components/header/AppIcon.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppTitle.d.ts +1 -0
- package/dist/components/layout/components/header/AppTitle.d.ts.map +1 -1
- package/dist/components/layout/components/header/CacheSettings.js +2 -2
- package/dist/components/layout/components/header/GameTitle.d.ts +1 -0
- package/dist/components/layout/components/header/GameTitle.d.ts.map +1 -1
- package/dist/components/layout/components/header/HeaderMenu.d.ts +1 -0
- package/dist/components/layout/components/header/HeaderMenu.d.ts.map +1 -1
- package/dist/components/layout/components/header/HeaderNavigation.d.ts +1 -0
- package/dist/components/layout/components/header/HeaderNavigation.d.ts.map +1 -1
- package/dist/components/layout/components/header/SettingsMenu.d.ts +1 -0
- package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +1 -0
- package/dist/crud/components/EntityCardList.d.ts +1 -1
- package/dist/crud/components/EntityCardList.d.ts.map +1 -1
- package/dist/crud/components/EntityCardList.js +32 -21
- package/dist/crud/components/EntityDisplayRenderer.d.ts +1 -1
- package/dist/crud/components/EntityDisplayRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityDisplayRenderer.js +13 -12
- package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityFormRenderer.js +16 -18
- package/dist/crud/components/EntityList.d.ts +1 -1
- package/dist/crud/components/EntityList.d.ts.map +1 -1
- package/dist/crud/components/EntityList.js +40 -24
- package/dist/crud/components/EntityRecommendations.d.ts +1 -1
- package/dist/crud/components/EntityRecommendations.d.ts.map +1 -1
- package/dist/crud/components/EntityRecommendations.js +4 -4
- package/dist/crud/crudImports.d.ts +1 -0
- package/dist/crud/crudImports.d.ts.map +1 -1
- package/dist/crud/crudImports.js +1 -0
- package/dist/dndev-next.css +198 -75
- package/dist/dndev.css +228 -74
- package/dist/index.js +4 -4
- package/dist/internal/common/ErrorFallback.js +1 -1
- package/dist/internal/devtools/DebugTools.js +1 -1
- package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/DesignTab.js +6 -2
- package/dist/internal/devtools/utils/envVarDiscovery.d.ts.map +1 -1
- package/dist/internal/devtools/utils/envVarDiscovery.js +4 -5
- package/dist/internal/devtools/utils/virtualModuleInspector.d.ts.map +1 -1
- package/dist/internal/devtools/utils/virtualModuleInspector.js +2 -0
- package/dist/internal/initializers/BaseStoresInitializer.d.ts.map +1 -1
- package/dist/internal/initializers/BaseStoresInitializer.js +11 -2
- package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
- package/dist/internal/layout/DnDevLayout.js +39 -16
- package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.js +55 -23
- package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts +2 -0
- package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/NextJsAutoMetaTags.js +45 -15
- package/dist/internal/layout/components/PWAUpdateNotification.d.ts.map +1 -1
- package/dist/internal/layout/components/PWAUpdateNotification.js +15 -2
- package/dist/internal/layout/zones/DnDevFooter.d.ts +3 -1
- package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevFooter.js +5 -1
- package/dist/internal/layout/zones/DnDevHeader.d.ts +3 -1
- package/dist/internal/layout/zones/DnDevHeader.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevHeader.js +7 -2
- package/dist/internal/layout/zones/DnDevSidebar.d.ts +3 -1
- package/dist/internal/layout/zones/DnDevSidebar.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevSidebar.js +9 -3
- package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
- package/dist/providers/NextJsAppProviders.js +3 -1
- package/dist/routing/AuthGuard.d.ts +7 -22
- package/dist/routing/AuthGuard.d.ts.map +1 -1
- package/dist/routing/AuthGuard.js +19 -64
- package/dist/routing/AuthReturnTo.d.ts +13 -0
- package/dist/routing/AuthReturnTo.d.ts.map +1 -0
- package/dist/routing/AuthReturnTo.js +61 -0
- package/dist/routing/DnDevNavigationMenu.d.ts +1 -0
- package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
- package/dist/routing/GoTo.d.ts +1 -0
- package/dist/routing/GoTo.d.ts.map +1 -1
- package/dist/routing/hooks/hooks.next.js +1 -1
- package/dist/routing/hooks/hooks.vite.js +1 -1
- package/dist/routing/hooks/useNavigate.next.d.ts +8 -0
- package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.next.js +58 -8
- package/dist/routing/hooks/useNavigate.vite.d.ts +8 -0
- package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.vite.js +64 -14
- package/dist/routing/hooks/useRedirectGuard.next.d.ts +2 -0
- package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
- package/dist/routing/hooks/useRedirectGuard.next.js +11 -27
- package/dist/routing/hooks/useRedirectGuard.vite.d.ts +2 -0
- package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
- package/dist/routing/hooks/useRedirectGuard.vite.js +11 -27
- package/dist/routing/index.d.ts +1 -0
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +1 -0
- package/dist/styles/index.css +228 -74
- package/dist/symbol-index.json +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/sanitizeSvg.d.ts +4 -0
- package/dist/utils/sanitizeSvg.d.ts.map +1 -1
- package/dist/utils/sanitizeSvg.js +4 -0
- package/dist/utils/useAISafe.d.ts +28 -0
- package/dist/utils/useAISafe.d.ts.map +1 -0
- package/dist/utils/useAISafe.js +53 -0
- package/dist/utils/useAuthSafe.d.ts +39 -0
- package/dist/utils/useAuthSafe.d.ts.map +1 -1
- package/dist/utils/useAuthSafe.js +5 -0
- package/dist/utils/useAuthVisibility.d.ts +1 -0
- package/dist/utils/useAuthVisibility.d.ts.map +1 -1
- package/dist/utils/useBillingVisibility.d.ts +1 -0
- package/dist/utils/useBillingVisibility.d.ts.map +1 -1
- package/dist/utils/useSeo.d.ts +121 -0
- package/dist/utils/useSeo.d.ts.map +1 -0
- package/dist/utils/useSeo.js +114 -0
- package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
- package/dist/vite-routing/AppRoutes.js +14 -4
- package/dist/vite-routing/RootLayout.d.ts.map +1 -1
- package/dist/vite-routing/RootLayout.js +6 -4
- package/guidelines/COMPONENTS.md +136 -0
- package/guidelines/GOTCHAS.md +66 -0
- package/guidelines/LAYOUTS.md +310 -0
- package/guidelines/PAGES.md +205 -0
- package/guidelines/ROUTING.md +499 -0
- package/guidelines/SEO.md +275 -0
- package/package.json +12 -7
- package/dist/chunk-XHGRMKOY.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppRoutes.d.ts","sourceRoot":"","sources":["../../src/vite-routing/AppRoutes.tsx"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAQ3E,OAAO,KAAK,EAAE,aAAa,EAAkC,MAAM,OAAO,CAAC;AAG3E,yEAAyE;AACzE,KAAK,oBAAoB,GACrB,CAAC,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC,GAC3C,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"AppRoutes.d.ts","sourceRoot":"","sources":["../../src/vite-routing/AppRoutes.tsx"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAQ3E,OAAO,KAAK,EAAE,aAAa,EAAkC,MAAM,OAAO,CAAC;AAG3E,yEAAyE;AACzE,KAAK,oBAAoB,GACrB,CAAC,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC,GAC3C,MAAM,CAAC;AA8IX;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;CAChC;AAED,4DAA4D;AAC5D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,oBAAoB,CAAC;IAChC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,yCAiF9D"}
|
|
@@ -97,6 +97,14 @@ function getRoutePreset(meta) {
|
|
|
97
97
|
}
|
|
98
98
|
return undefined;
|
|
99
99
|
}
|
|
100
|
+
/** Extract hideBreadcrumbs from route meta */
|
|
101
|
+
function getRouteHideBreadcrumbs(meta) {
|
|
102
|
+
if (meta && typeof meta === 'object' && 'hideBreadcrumbs' in meta) {
|
|
103
|
+
const hide = meta.hideBreadcrumbs;
|
|
104
|
+
return typeof hide === 'boolean' ? hide : undefined;
|
|
105
|
+
}
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
100
108
|
/**
|
|
101
109
|
* LayoutRoute - Per-route preset switcher
|
|
102
110
|
*
|
|
@@ -107,12 +115,14 @@ function getRoutePreset(meta) {
|
|
|
107
115
|
*
|
|
108
116
|
* Uses useLayoutEffect to apply before paint, avoiding visual flash.
|
|
109
117
|
*/
|
|
110
|
-
const LayoutRoute = ({ preset, children, }) => {
|
|
118
|
+
const LayoutRoute = ({ preset, hideBreadcrumbs, children, }) => {
|
|
111
119
|
const setRoutePresetOverride = useLayout('setRoutePresetOverride');
|
|
120
|
+
const setRouteHideBreadcrumbs = useLayout('setRouteHideBreadcrumbs');
|
|
112
121
|
useLayoutEffect(() => {
|
|
113
122
|
// Set route override (or null to clear and use app default)
|
|
114
123
|
setRoutePresetOverride(preset ?? null);
|
|
115
|
-
|
|
124
|
+
setRouteHideBreadcrumbs(hideBreadcrumbs ?? false);
|
|
125
|
+
}, [preset, hideBreadcrumbs, setRoutePresetOverride, setRouteHideBreadcrumbs]);
|
|
116
126
|
return _jsx(_Fragment, { children: children });
|
|
117
127
|
};
|
|
118
128
|
/**
|
|
@@ -210,7 +220,7 @@ export function createAppRouter(options) {
|
|
|
210
220
|
console.warn('[DoNotDev] HomePage has auth config but the index route is always public. ' +
|
|
211
221
|
'Auth config on HomePage is ignored. Use a different page as your protected entry point.');
|
|
212
222
|
}
|
|
213
|
-
return (_jsx(LayoutRoute, { preset: getRoutePreset(homePageRoute.meta), children: _jsx(LazyRoute, { component: homePageRoute.component, path: homePageRoute.path }) }));
|
|
223
|
+
return (_jsx(LayoutRoute, { preset: getRoutePreset(homePageRoute.meta), hideBreadcrumbs: getRouteHideBreadcrumbs(homePageRoute.meta), children: _jsx(LazyRoute, { component: homePageRoute.component, path: homePageRoute.path }) }));
|
|
214
224
|
})(),
|
|
215
225
|
},
|
|
216
226
|
/** All other routes are discovered and rendered here */
|
|
@@ -218,7 +228,7 @@ export function createAppRouter(options) {
|
|
|
218
228
|
.filter((route) => route.path !== '/')
|
|
219
229
|
.map((route) => ({
|
|
220
230
|
path: route.path.startsWith('/') ? route.path.slice(1) : route.path,
|
|
221
|
-
element: route.parsedAuth === false ? (_jsx(LayoutRoute, { preset: getRoutePreset(route.meta), children: _jsx(LazyRoute, { component: route.component, path: route.path }) })) : (_jsx(LayoutRoute, { preset: getRoutePreset(route.meta), children: _jsx(AuthGuard, { auth: route.parsedAuth, children: _jsx(LazyRoute, { component: route.component, path: route.path }) }) })),
|
|
231
|
+
element: route.parsedAuth === false ? (_jsx(LayoutRoute, { preset: getRoutePreset(route.meta), hideBreadcrumbs: getRouteHideBreadcrumbs(route.meta), children: _jsx(LazyRoute, { component: route.component, path: route.path }) })) : (_jsx(LayoutRoute, { preset: getRoutePreset(route.meta), hideBreadcrumbs: getRouteHideBreadcrumbs(route.meta), children: _jsx(AuthGuard, { auth: route.parsedAuth, children: _jsx(LazyRoute, { component: route.component, path: route.path }) }) })),
|
|
222
232
|
})),
|
|
223
233
|
// 404 catch-all route (must be last)
|
|
224
234
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RootLayout.d.ts","sourceRoot":"","sources":["../../src/vite-routing/RootLayout.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"RootLayout.d.ts","sourceRoot":"","sources":["../../src/vite-routing/RootLayout.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA4LnD;;GAEG;AACH,UAAU,oBAAoB;IAC5B,2BAA2B;IAC3B,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,oBAAoB,2CAkC1D"}
|
|
@@ -17,6 +17,8 @@ import { Outlet, useLocation } from 'react-router-dom';
|
|
|
17
17
|
import { globalEmitter, isClient, QueryProviders } from '@donotdev/core';
|
|
18
18
|
import { DnDevLayout } from '../internal/layout/DnDevLayout';
|
|
19
19
|
import { UIProviders } from '../internal/providers/UIProviders';
|
|
20
|
+
import { PasswordResetCallback } from '../utils/useAuthSafe';
|
|
21
|
+
import { AuthReturnTo } from '../routing/AuthReturnTo';
|
|
20
22
|
// Only lazy load non-critical components (not in render path)
|
|
21
23
|
const AutoMetaTags = lazy(() => import('../internal/layout/components/AutoMetaTags').then((m) => ({
|
|
22
24
|
default: m.default,
|
|
@@ -76,9 +78,9 @@ function CustomScrollRestoration() {
|
|
|
76
78
|
prevLocationKey.current = location.key;
|
|
77
79
|
// Cleanup: Keep only last 20 positions to prevent memory leaks
|
|
78
80
|
if (scrollPositions.current.size > 20) {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
for (const key of scrollPositions.current.keys()) {
|
|
82
|
+
scrollPositions.current.delete(key);
|
|
83
|
+
break;
|
|
82
84
|
}
|
|
83
85
|
}
|
|
84
86
|
}, [location.pathname, location.key]);
|
|
@@ -202,5 +204,5 @@ function RouteReadySignal({ children }) {
|
|
|
202
204
|
* @author AMBROISE PARK Consulting
|
|
203
205
|
*/
|
|
204
206
|
export function RootLayout({ layout }) {
|
|
205
|
-
return (_jsx(QueryProviders, { children: _jsxs(UIProviders, { children: [_jsx(Suspense, { fallback: null, children: _jsx(AutoMetaTags, {}) }), _jsxs(FrameworkReadySignal, { children: [_jsx(DnDevLayout, { layout: layout, children: _jsx(RouteReadySignal, { children: _jsx(Outlet, {}) }) }), _jsx(CustomScrollRestoration, {}), _jsxs(Suspense, { fallback: null, children: [_jsx(ConsentBanner, {}), _jsx(PWAUpdateNotification, {}), _jsx(LicenseWatermark, {}), _jsx(RedirectOverlay, {})] })] })] }) }));
|
|
207
|
+
return (_jsx(QueryProviders, { children: _jsxs(UIProviders, { children: [_jsx(Suspense, { fallback: null, children: _jsx(AutoMetaTags, {}) }), _jsxs(FrameworkReadySignal, { children: [_jsx(DnDevLayout, { layout: layout, children: _jsx(RouteReadySignal, { children: _jsx(Outlet, {}) }) }), _jsx(CustomScrollRestoration, {}), _jsx(AuthReturnTo, {}), _jsxs(Suspense, { fallback: null, children: [_jsx(ConsentBanner, {}), _jsx(PasswordResetCallback, {}), _jsx(PWAUpdateNotification, {}), _jsx(LicenseWatermark, {}), _jsx(RedirectOverlay, {})] })] })] }) }));
|
|
206
208
|
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# UI Components Reference
|
|
2
|
+
|
|
3
|
+
**Check JSDoc in your IDE** - Hover over any component import to see props, types, and examples.
|
|
4
|
+
|
|
5
|
+
**Import from:** `@donotdev/ui` (layout/composition components)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Layout Components
|
|
10
|
+
|
|
11
|
+
- **PageContainer** - Page wrapper with width constraints, spacing, and density system.
|
|
12
|
+
- **GameContainer** - Game preset container with fixed header/footer layout.
|
|
13
|
+
- **GameFlow** - Game flow component for step-by-step game interfaces.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Layout Sub-Components
|
|
18
|
+
|
|
19
|
+
- **AppBranding** - App branding display with logo and name.
|
|
20
|
+
- **AppIcon** - App icon component.
|
|
21
|
+
- **AppTitle** - App title display component.
|
|
22
|
+
- **GameTitle** - Game title component for game preset.
|
|
23
|
+
- **Breadcrumbs** - Breadcrumb navigation component.
|
|
24
|
+
- **HeaderNavigation** - Header navigation menu component.
|
|
25
|
+
- **DropdownNavigation** - Dropdown navigation menu.
|
|
26
|
+
- **HeaderMenu** - Header menu component.
|
|
27
|
+
- **SettingsMenu** - Settings menu component.
|
|
28
|
+
- **ThemeToggle** - Theme toggle button component.
|
|
29
|
+
- **CacheSettings** - Cache settings component.
|
|
30
|
+
- **Notifications** - Notifications component.
|
|
31
|
+
- **FloatingLanguageSwitcher** - Floating language selector component.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Auth Components
|
|
36
|
+
|
|
37
|
+
- **AuthHeader** - Header component with authentication UI (sign in/out, user menu).
|
|
38
|
+
- **AuthMenu** - Authentication menu component.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Helpers
|
|
43
|
+
|
|
44
|
+
- **tList(t, key, count, icon?, size?)** - Translated array as List. Default: CheckCircle icon. Pass `null` for no icon (use with emoji labels).
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Common Components
|
|
49
|
+
|
|
50
|
+
- **FeatureDisabled** - Component shown when features are disabled.
|
|
51
|
+
- **Icon** - Icon component wrapper.
|
|
52
|
+
- **ProgressBar** - Progress bar component.
|
|
53
|
+
- **Skeleton** - Skeleton loading component (consumer use, not used internally).
|
|
54
|
+
- **FeatureCard** - Feature showcase card component.
|
|
55
|
+
- **TechBento** - Tech stack showcase component.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Routing Components
|
|
60
|
+
|
|
61
|
+
- **Link** - Platform-agnostic link component (works in Vite + Next.js).
|
|
62
|
+
- **AuthGuard** - Route guard component for protected routes.
|
|
63
|
+
- **AuthGuardFallback** - Fallback component for auth-guarded routes.
|
|
64
|
+
- **GoTo** - Programmatic navigation component.
|
|
65
|
+
- **GoToWrapper** - Wrapper for GoTo navigation.
|
|
66
|
+
- **GoToInput** - Input component for GoTo navigation.
|
|
67
|
+
- **GoToDialog** - Dialog for GoTo navigation.
|
|
68
|
+
- **DnDevNavigationMenu** - Framework navigation menu component.
|
|
69
|
+
- **NotFoundPage** - 404 page component.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Routing Hooks
|
|
74
|
+
|
|
75
|
+
- **useNavigate** - Navigate to routes programmatically.
|
|
76
|
+
- **useBack** - Navigate back in history.
|
|
77
|
+
- **useRefresh** - Refresh current route.
|
|
78
|
+
- **usePrefetch** - Prefetch route data.
|
|
79
|
+
- **useLocation** - Get current location.
|
|
80
|
+
- **useParams** - Get route parameters.
|
|
81
|
+
- **useSearchParams** - Get URL search parameters. Returns `URLSearchParams` directly (NOT a tuple). Use `.get('key')` to read values.
|
|
82
|
+
- **useMatch** - Match current route pattern.
|
|
83
|
+
- **useQueryParams** - Get and set query parameters.
|
|
84
|
+
- **useRedirectGuard** - Guard against redirects.
|
|
85
|
+
- **useNavigation** - Navigation state and methods.
|
|
86
|
+
- **useGoTo** - GoTo navigation hook.
|
|
87
|
+
- **useRouteDiscovery** - Route discovery hook.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Cookie Consent
|
|
92
|
+
|
|
93
|
+
- **CookieConsent** - Cookie consent management component.
|
|
94
|
+
- **ConsentBanner** - Cookie consent banner component.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Platform-Specific Providers
|
|
99
|
+
|
|
100
|
+
- **ViteAppProviders** - App providers for Vite (import from `@donotdev/ui/vite`).
|
|
101
|
+
- **NextJsAppProviders** - App providers for Next.js (import from `@donotdev/ui/next`).
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## CRUD Display Components (from @donotdev/ui)
|
|
106
|
+
|
|
107
|
+
- **DisplayFieldRenderer** - Renders read-only field displays.
|
|
108
|
+
- **EntityDisplayRenderer** - Renders complete entity displays.
|
|
109
|
+
- **TextFieldDisplay** - Text field display component.
|
|
110
|
+
- **BadgeFieldDisplay** - Badge field display component.
|
|
111
|
+
- **AvatarFieldDisplay** - Avatar field display component.
|
|
112
|
+
- **LinkFieldDisplay** - Link field display component.
|
|
113
|
+
- **DateFieldDisplay** - Date field display component.
|
|
114
|
+
- **NumberFieldDisplay** - Number field display component.
|
|
115
|
+
- **PhoneNumberDisplay** - Phone number display component.
|
|
116
|
+
- **TextAreaDisplay** - Textarea display component.
|
|
117
|
+
- **CheckboxFieldDisplay** - Checkbox display component.
|
|
118
|
+
- **DropdownDisplay** - Dropdown display component.
|
|
119
|
+
- **MultiDropdownDisplay** - Multi-select dropdown display component.
|
|
120
|
+
- **MultiInputTextFieldDisplay** - Multi-input text field display component.
|
|
121
|
+
- **RadioFieldDisplay** - Radio field display component.
|
|
122
|
+
- **RangeFieldDisplay** - Range field display component.
|
|
123
|
+
- **FileFieldDisplay** - File field display component.
|
|
124
|
+
- **ImageFieldDisplay** - Image field display component.
|
|
125
|
+
- **GeoPointFieldDisplay** - GeoPoint field display component.
|
|
126
|
+
- **MapFieldDisplay** - Map field display component.
|
|
127
|
+
- **ReferenceFieldDisplay** - Reference field display component.
|
|
128
|
+
- **TimestampFieldDisplay** - Timestamp field display component.
|
|
129
|
+
- **HiddenFieldDisplay** - Hidden field display component.
|
|
130
|
+
- **ButtonFieldDisplay** - Button field display component.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
**For MVP:** Only `PageContainer` is needed. All other components are optional.
|
|
135
|
+
|
|
136
|
+
**All props documented in JSDoc** - Hover in IDE for complete reference.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Gotchas: @donotdev/ui
|
|
2
|
+
|
|
3
|
+
Common mistakes related to routing, styling, layouts, and UI components.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Routing [Phase 1, 3]
|
|
8
|
+
|
|
9
|
+
**Never import from `react-router-dom` - use framework routing.**
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
// WRONG - breaks framework features
|
|
13
|
+
import { Link, useNavigate, useParams } from 'react-router-dom';
|
|
14
|
+
|
|
15
|
+
// CORRECT
|
|
16
|
+
import { Link, useNavigate, useParams } from '@donotdev/ui';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Routes are auto-discovered** from `src/pages/*Page.tsx` with `pageMeta`. Don't use `<Routes>`, `<Route>`, or manual `<Outlet />`.
|
|
20
|
+
|
|
21
|
+
**Use `useRouteParam('id')` for typed route params** - not `useParams()` from react-router-dom.
|
|
22
|
+
|
|
23
|
+
**Navigation is auto-built.** Use `<DnDevNavigationMenu>` or `useNavigationItems()`. Don't build nav manually - you lose auth filtering and route discovery.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Styling [Phase 3, 4]
|
|
28
|
+
|
|
29
|
+
**No inline `fontSize` or `font-size` - use `Text` level prop.**
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
// WRONG
|
|
33
|
+
<Text style={{ fontSize: '18px' }}>Title</Text>
|
|
34
|
+
|
|
35
|
+
// CORRECT
|
|
36
|
+
<Text level="h2">Title</Text>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Levels: `h1`, `h2`, `h3`, `h4`, `body`, `small`, `caption`. Limit to 2-3 levels per page.
|
|
40
|
+
|
|
41
|
+
**RTL: Always use `start`/`end` - never `left`/`right`.**
|
|
42
|
+
|
|
43
|
+
```css
|
|
44
|
+
/* WRONG - breaks RTL */
|
|
45
|
+
text-align: left;
|
|
46
|
+
|
|
47
|
+
/* CORRECT - works in both LTR and RTL */
|
|
48
|
+
text-align: start;
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Same for inline styles: `textAlign: 'start'` not `textAlign: 'left'`. Same for data attributes: `data-text-align="start|center|end"`.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Components [Phase 3]
|
|
56
|
+
|
|
57
|
+
**Always `lookup_symbol` before using any `@donotdev` component.** Never guess props.
|
|
58
|
+
|
|
59
|
+
Common wrong props:
|
|
60
|
+
- `Button`: no `size`, `tone`, `gap` - use `variant`, `display`
|
|
61
|
+
- `Text`: no `size`, `tone`, `color` - use `level`, `variant`
|
|
62
|
+
- `Stack`: no `spacing`, `size` - use `gap`
|
|
63
|
+
- `Card`: no `padding`, `margin`, `size` - use `title`, `subtitle`, `content`, `footer`
|
|
64
|
+
- `Grid`: no `columns` - use `cols`
|
|
65
|
+
|
|
66
|
+
**If you can't do it with framework components:** Stop. Tell the user what's missing. Don't invent custom workarounds.
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
# Layouts
|
|
2
|
+
|
|
3
|
+
**Choose preset in `config/app.ts`. Framework handles header, sidebar, footer, auth, themes, languages.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Standard Use
|
|
8
|
+
|
|
9
|
+
**Choose preset:**
|
|
10
|
+
```typescript
|
|
11
|
+
// config/app.ts
|
|
12
|
+
export const appConfig: AppConfig = {
|
|
13
|
+
preset: 'landing', // landing | admin | moolti | docs | blog | game | plain
|
|
14
|
+
};
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**7 presets:** `landing` (marketing), `admin` (dashboards), `moolti` (SaaS), `docs` (documentation), `blog` (content), `game` (mobile), `plain` (minimal).
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Preset Capabilities
|
|
22
|
+
|
|
23
|
+
**The `docs` preset AUTOMATICALLY generates sidebar navigation from your `src/pages` files. You do not need to configure a sidebar manually.**
|
|
24
|
+
|
|
25
|
+
All presets automatically include these components when applicable:
|
|
26
|
+
|
|
27
|
+
* **LanguageSelector** - Automatically shown if more than 1 language is configured
|
|
28
|
+
* **ThemeToggle** - Automatically shown if more than 1 theme is available
|
|
29
|
+
* **AuthMenu** - Automatically shown if auth is configured in `.env` (Firebase keys present)
|
|
30
|
+
* **Navigation Menu** - Automatically generated from `src/pages/*Page.tsx` files for sidebars
|
|
31
|
+
* **GoTo Component** - Command palette (Cmd+K) for quick navigation - always available
|
|
32
|
+
* **Footer** - Automatic footer with copyright and legal links
|
|
33
|
+
* **LegalLinks + Copyright** - Automatically included in footer from `config/legal.ts`
|
|
34
|
+
|
|
35
|
+
**You don't need to add these manually - the framework handles them based on your configuration.**
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Per-Route Layout Switching
|
|
40
|
+
|
|
41
|
+
**Override the app preset on a per-page basis via `PageMeta.preset`:**
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
// src/pages/DashboardPage.tsx
|
|
45
|
+
import type { PageMeta } from '@donotdev/core';
|
|
46
|
+
|
|
47
|
+
export const meta: PageMeta = {
|
|
48
|
+
preset: 'admin', // This route uses admin layout (sidebar, compact density)
|
|
49
|
+
auth: true,
|
|
50
|
+
};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- If `preset` is set - that route uses the specified layout
|
|
54
|
+
- If `preset` is absent - the app's `appConfig.preset` is used
|
|
55
|
+
- The override is **transient** - navigating away restores the next route's preset or the app default
|
|
56
|
+
- No localStorage pollution - route presets are not persisted
|
|
57
|
+
|
|
58
|
+
**Common pattern (SaaS app):**
|
|
59
|
+
| Route | Preset | Purpose |
|
|
60
|
+
|-------|--------|---------|
|
|
61
|
+
| `/` | (app default: `landing`) | Marketing landing page |
|
|
62
|
+
| `/pricing` | (app default: `landing`) | Pricing page |
|
|
63
|
+
| `/dashboard` | `admin` | Dashboard with sidebar |
|
|
64
|
+
| `/products` | `admin` | CRUD with sidebar |
|
|
65
|
+
| `/changelog` | `docs` | Documentation layout |
|
|
66
|
+
|
|
67
|
+
**Reference implementation:** See `packages/cli/templates/app-demo/` for a working example of per-route switching.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Custom Presets
|
|
72
|
+
|
|
73
|
+
**Define your own presets with the same `PresetConfig` shape as built-ins.**
|
|
74
|
+
|
|
75
|
+
`config/app.ts` is strings-only (no React, no JSX). Custom presets with components go in `App.tsx`.
|
|
76
|
+
|
|
77
|
+
### Zone ownership: slots vs functions
|
|
78
|
+
|
|
79
|
+
Each zone (header, sidebar, footer) supports two config modes:
|
|
80
|
+
|
|
81
|
+
| Config shape | What it means | Framework provides |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| **Object** (slots) | "I want your layout, my content" | Structure + behavior + visual polish |
|
|
84
|
+
| **Function** | "I own this zone" | Structure + behavior only, no visual polish |
|
|
85
|
+
| **`null`** | "Hide it" | Nothing |
|
|
86
|
+
|
|
87
|
+
**Slots mode** (object) - fill framework slots, get framework styling (background, border, padding):
|
|
88
|
+
```tsx
|
|
89
|
+
sidebar: {
|
|
90
|
+
top: () => <MyBranding />,
|
|
91
|
+
content: () => <MyNav />,
|
|
92
|
+
bottom: () => <MyProfile />,
|
|
93
|
+
defaultWidth: 280,
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Custom mode** (function) - own the zone visuals, framework provides structural behavior (resize, sticky, grid placement):
|
|
98
|
+
```tsx
|
|
99
|
+
sidebar: () => <MyFullSidebar />,
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
In custom mode:
|
|
103
|
+
- **Sidebar** gets resize handle, keyboard nav, collapse for free. No framework background/border.
|
|
104
|
+
- **Header** gets grid-area, height, sticky, z-index. No framework background/border/padding.
|
|
105
|
+
- **Footer** gets grid-area, z-index, grid-column span. No framework background/border/min-height/padding.
|
|
106
|
+
|
|
107
|
+
**Your component must NOT render the semantic wrapper** (`<aside>`, `<header>`, `<footer>`) - the framework handles that. Render a `<div>` or fragment as your root.
|
|
108
|
+
|
|
109
|
+
### Example: custom preset with full zone ownership
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
// App.tsx
|
|
113
|
+
import type { LayoutPreset, PresetConfig } from '@donotdev/core';
|
|
114
|
+
import { ViteAppProviders } from '@donotdev/ui/vite';
|
|
115
|
+
|
|
116
|
+
import { MyGameHud } from './components/MyGameHud';
|
|
117
|
+
import { MyToolPanel } from './components/MyToolPanel';
|
|
118
|
+
import { appConfig } from './config/app';
|
|
119
|
+
|
|
120
|
+
const customPresets: Record<string, PresetConfig> = {
|
|
121
|
+
'my-editor': {
|
|
122
|
+
name: 'my-editor' as LayoutPreset,
|
|
123
|
+
sidebar: () => <MyToolPanel />, // Custom visuals, resize for free
|
|
124
|
+
footer: () => <MyGameHud />, // Custom visuals, fixed at bottom
|
|
125
|
+
footerMode: 'fixed', // Stays pinned on mobile too
|
|
126
|
+
mobile: {
|
|
127
|
+
mergedBar: {
|
|
128
|
+
position: 'top',
|
|
129
|
+
height: '62px',
|
|
130
|
+
content: () => <MyToolPanel />,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export function App() {
|
|
137
|
+
return (
|
|
138
|
+
<ViteAppProviders
|
|
139
|
+
config={{ ...appConfig, customPresets }}
|
|
140
|
+
/>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Example: custom preset with slot overrides (framework polish)
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
const customPresets: Record<string, PresetConfig> = {
|
|
149
|
+
'my-docs': {
|
|
150
|
+
name: 'my-docs' as LayoutPreset,
|
|
151
|
+
sidebar: {
|
|
152
|
+
content: () => <MyDocNav />, // Custom content, framework styling
|
|
153
|
+
defaultWidth: 300,
|
|
154
|
+
minWidth: 200,
|
|
155
|
+
maxWidth: 400,
|
|
156
|
+
},
|
|
157
|
+
footer: null, // No footer
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### CSS variables for custom presets
|
|
163
|
+
|
|
164
|
+
**Add CSS variables in `src/themes.css`:**
|
|
165
|
+
```css
|
|
166
|
+
[data-layout='my-editor'] {
|
|
167
|
+
--header-height: 0px;
|
|
168
|
+
--sidebar-width: 280px;
|
|
169
|
+
--custom-sidebar-width: 286px; /* content + 6px resize handle */
|
|
170
|
+
|
|
171
|
+
header[role='banner'] { display: none; }
|
|
172
|
+
|
|
173
|
+
@media (width <= 1023px) {
|
|
174
|
+
--sidebar-width: 0px;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Use on a page:**
|
|
180
|
+
```tsx
|
|
181
|
+
export const meta: PageMeta = {
|
|
182
|
+
preset: 'my-editor',
|
|
183
|
+
};
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**How it works:**
|
|
187
|
+
1. `customPresets` merged into config in `App.tsx` - flows through `AppConfigProvider`
|
|
188
|
+
2. Page sets `preset: 'my-editor'` - store accepts any string
|
|
189
|
+
3. `DnDevLayout` looks up `'my-editor'` in merged registry (custom overrides built-in)
|
|
190
|
+
4. Zones render from your `PresetConfig` - function zones get `data-custom` attribute, slots don't
|
|
191
|
+
5. `data-layout="my-editor"` on `<html>` - your CSS variables activate
|
|
192
|
+
6. Mobile: mergedBar shows automatically, header hidden via `data-has-mergedbar`
|
|
193
|
+
|
|
194
|
+
**Unknown presets without a custom config fall back to `landing`.**
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Advanced: Slot Overrides
|
|
199
|
+
|
|
200
|
+
**Customize zones (framework polish applies):**
|
|
201
|
+
```tsx
|
|
202
|
+
<ViteAppProviders
|
|
203
|
+
config={appConfig}
|
|
204
|
+
layout={{
|
|
205
|
+
header: {
|
|
206
|
+
start: () => <CustomLogo />, // Override start zone
|
|
207
|
+
center: () => <SearchBar />, // Override center zone
|
|
208
|
+
end: () => <UserMenu />, // Override end zone
|
|
209
|
+
},
|
|
210
|
+
sidebar: {
|
|
211
|
+
top: () => <Branding />, // Override top zone
|
|
212
|
+
content: () => <CustomNav />, // Override content zone
|
|
213
|
+
bottom: () => <UserProfile />, // Override bottom zone
|
|
214
|
+
},
|
|
215
|
+
footer: () => <CustomFooter />, // Replace entire footer (custom mode, no framework polish)
|
|
216
|
+
}}
|
|
217
|
+
/>
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**Hide zones:**
|
|
221
|
+
```tsx
|
|
222
|
+
layout={{
|
|
223
|
+
header: {
|
|
224
|
+
center: () => null, // Hide center zone
|
|
225
|
+
},
|
|
226
|
+
footer: () => null, // Hide footer
|
|
227
|
+
}}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Available slots:** `header.start/center/end`, `sidebar.top/content/bottom`, `footer`, `mergedbar` (mobile nav).
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Advanced: Footer Mode
|
|
235
|
+
|
|
236
|
+
**Control footer scroll behavior:**
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
// Default: footer scrolls with content on mobile, fixed on desktop
|
|
240
|
+
// No footerMode needed - this is the default for all built-in presets
|
|
241
|
+
|
|
242
|
+
// Fixed on all breakpoints (footer stays pinned at bottom, even on mobile):
|
|
243
|
+
footerMode: 'fixed',
|
|
244
|
+
|
|
245
|
+
// Scroll on all breakpoints (footer scrolls with content):
|
|
246
|
+
footerMode: 'scroll',
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Set `footerMode` in your preset config or in the `layout` prop:
|
|
250
|
+
```tsx
|
|
251
|
+
<ViteAppProviders
|
|
252
|
+
config={appConfig}
|
|
253
|
+
layout={{ footerMode: 'fixed' }}
|
|
254
|
+
/>
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Advanced: CSS Variable Overrides
|
|
260
|
+
|
|
261
|
+
**Override dimensions in `src/themes.css`:**
|
|
262
|
+
```css
|
|
263
|
+
:root {
|
|
264
|
+
--header-height: 96px;
|
|
265
|
+
--sidebar-width: 320px;
|
|
266
|
+
--main-max-width: 1480px;
|
|
267
|
+
--footer-height: 64px;
|
|
268
|
+
--section-gap: 2rem;
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Framework auto-computes:** Spacing, typography, responsive breakpoints.
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Advanced: Density System
|
|
277
|
+
|
|
278
|
+
**Global density:**
|
|
279
|
+
```tsx
|
|
280
|
+
layout={{
|
|
281
|
+
density: 'compact', // compact | standard | expressive
|
|
282
|
+
}}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**Per-page density:**
|
|
286
|
+
```tsx
|
|
287
|
+
<PageContainer density="expressive">
|
|
288
|
+
<HeroSection title="Hero" />
|
|
289
|
+
</PageContainer>
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
**Three densities:** `compact` (1.2x), `standard` (1.25x), `expressive` (1.333x).
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Advanced: Runtime Preset Changes
|
|
297
|
+
|
|
298
|
+
**Change preset programmatically:**
|
|
299
|
+
```tsx
|
|
300
|
+
import { useLayout } from '@donotdev/core';
|
|
301
|
+
|
|
302
|
+
const setLayoutPreset = useLayout('setLayoutPreset');
|
|
303
|
+
setLayoutPreset('plain'); // Switch to plain layout
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
**Pre-configured:** All presets handle auth, themes, languages automatically.
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
**Choose preset, get layout. Framework handles the rest.**
|