@donotdev/ui 0.0.18 → 0.0.19

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 (37) hide show
  1. package/dist/components/auth/AuthMenu.d.ts.map +1 -1
  2. package/dist/components/auth/AuthMenu.js +8 -3
  3. package/dist/crud/components/EntityDisplayRenderer.d.ts.map +1 -1
  4. package/dist/crud/components/EntityDisplayRenderer.js +4 -1
  5. package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
  6. package/dist/crud/components/EntityFormRenderer.js +2 -1
  7. package/dist/crud/components/EntityList.d.ts.map +1 -1
  8. package/dist/crud/components/EntityList.js +2 -0
  9. package/dist/crud/components/EntityWorkflow.d.ts.map +1 -1
  10. package/dist/crud/components/EntityWorkflow.js +4 -1
  11. package/dist/dndev.css +82 -38
  12. package/dist/index.js +4 -4
  13. package/dist/internal/common/RouteErrorFallback.js +1 -1
  14. package/dist/internal/devtools/DebugTools.d.ts.map +1 -1
  15. package/dist/internal/devtools/DebugTools.js +7 -2
  16. package/dist/internal/initializers/NextJsStoresInitializer.d.ts.map +1 -1
  17. package/dist/internal/initializers/NextJsStoresInitializer.js +8 -1
  18. package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
  19. package/dist/providers/NextJsAppProviders.js +14 -11
  20. package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
  21. package/dist/routing/DnDevNavigationMenu.js +3 -2
  22. package/dist/routing/GoToWrapper.d.ts.map +1 -1
  23. package/dist/routing/GoToWrapper.js +7 -0
  24. package/dist/routing/Link.d.ts.map +1 -1
  25. package/dist/routing/Link.js +2 -1
  26. package/dist/routing/hooks/hooks.next.js +1 -1
  27. package/dist/routing/hooks/useLocation.next.d.ts +1 -1
  28. package/dist/routing/hooks/useLocation.next.d.ts.map +1 -1
  29. package/dist/routing/hooks/useLocation.next.js +2 -1
  30. package/dist/routing/hooks/useParams.next.d.ts.map +1 -1
  31. package/dist/routing/hooks/useParams.next.js +4 -1
  32. package/dist/routing/hooks/useRedirectGuard.next.js +3 -3
  33. package/dist/styles/index.css +82 -38
  34. package/dist/utils/assetResolver.d.ts +6 -0
  35. package/dist/utils/assetResolver.d.ts.map +1 -1
  36. package/dist/utils/assetResolver.js +9 -3
  37. package/package.json +8 -8
@@ -112,7 +112,7 @@ export const RouteErrorFallback = ({ error, resetError, componentStack, eventId,
112
112
  fontSize: 'var(--font-size-lg)',
113
113
  color: 'var(--muted-foreground)',
114
114
  margin: 0,
115
- }, children: t('routeError.description', 'We encountered an error while loading this page.') }), _jsx(Alert, { variant: ALERT_VARIANT.SUCCESS, hideIcon: true, children: _jsx("div", { style: { fontSize: 'var(--font-size-sm)', textAlign: 'center' }, children: t('routeError.dataSafe', "Don't worry, your data is safe.") }) })] }), eventId && (_jsxs("code", { style: {
115
+ }, children: t('routeError.description', 'We encountered an error while loading this page.') }), _jsx(Alert, { variant: ALERT_VARIANT.INFO, hideIcon: true, children: _jsx("div", { style: { fontSize: 'var(--font-size-sm)', textAlign: 'center' }, children: t('routeError.dataSafe', "Don't worry, your data is safe.") }) })] }), eventId && (_jsxs("code", { style: {
116
116
  padding: 'var(--gap-sm) var(--gap-md)',
117
117
  background: 'var(--muted)',
118
118
  borderRadius: 'var(--radius-full)',
@@ -1 +1 @@
1
- {"version":3,"file":"DebugTools.d.ts","sourceRoot":"","sources":["../../../src/internal/devtools/DebugTools.tsx"],"names":[],"mappings":"AAgCA,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,GAAI,eAAe,eAAe,4CA8NjD,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"DebugTools.d.ts","sourceRoot":"","sources":["../../../src/internal/devtools/DebugTools.tsx"],"names":[],"mappings":"AAgCA,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,GAAI,eAAe,eAAe,4CAmOjD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -97,8 +97,13 @@ const DebugTools = ({ className }) => {
97
97
  await Promise.all(keys.map((key) => caches.delete(key)));
98
98
  }
99
99
  if ('indexedDB' in window && 'databases' in indexedDB) {
100
- const databases = await indexedDB.databases();
101
- await Promise.all(databases.map((db) => db.name && indexedDB.deleteDatabase(db.name)));
100
+ try {
101
+ const databases = await indexedDB.databases();
102
+ await Promise.all(databases.map((db) => db.name && indexedDB.deleteDatabase(db.name)));
103
+ }
104
+ catch (dbError) {
105
+ console.error('Failed to clear IndexedDB:', dbError);
106
+ }
102
107
  }
103
108
  // Clear store registry (DEV mode: HMR preserves globalThis, prevents re-init)
104
109
  if (typeof globalThis !== 'undefined' &&
@@ -1 +1 @@
1
- {"version":3,"file":"NextJsStoresInitializer.d.ts","sourceRoot":"","sources":["../../../src/internal/initializers/NextJsStoresInitializer.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAOxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,4BAA4B;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,aAAa,GACd,EAAE,4BAA4B,kDA2D9B"}
1
+ {"version":3,"file":"NextJsStoresInitializer.d.ts","sourceRoot":"","sources":["../../../src/internal/initializers/NextJsStoresInitializer.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAOxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,4BAA4B;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,aAAa,GACd,EAAE,4BAA4B,kDAiE9B"}
@@ -54,7 +54,14 @@ export function NextJsStoresInitializer({ children, serverCookies, customStores,
54
54
  try {
55
55
  const cookieValue = themeCookie.split('=')[1]?.trim();
56
56
  if (cookieValue) {
57
- const theme = decodeURIComponent(cookieValue);
57
+ let theme;
58
+ try {
59
+ theme = decodeURIComponent(cookieValue);
60
+ }
61
+ catch {
62
+ // Malformed URI encoding in cookie value — skip hydration
63
+ return;
64
+ }
58
65
  // Validate theme exists in available themes (build-time config is available synchronously)
59
66
  if (themeData.some((t) => t.name === theme)) {
60
67
  useThemeStore.setState({ currentTheme: theme });
@@ -1 +1 @@
1
- {"version":3,"file":"NextJsAppProviders.d.ts","sourceRoot":"","sources":["../../src/providers/NextJsAppProviders.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAuDxD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAiDhE"}
1
+ {"version":3,"file":"NextJsAppProviders.d.ts","sourceRoot":"","sources":["../../src/providers/NextJsAppProviders.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AA6DxD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAiDhE"}
@@ -20,17 +20,20 @@ import PerformanceHints from '../internal/layout/components/PerformanceHints';
20
20
  import { DnDevLayout } from '../internal/layout/DnDevLayout';
21
21
  import { SentryInitializer } from '../internal/providers/SentryInitializer';
22
22
  import { UIProviders } from '../internal/providers/UIProviders';
23
- // Lazy load client-only components
24
- const CookieConsent = lazy(() => import('../components/cookie-consent/CookieConsent'));
25
- const PWAUpdateNotification = lazy(() => import('../internal/layout/components/PWAUpdateNotification').then((m) => ({
26
- default: m.default,
27
- })));
28
- const LicenseWatermark = lazy(() => import('../components/license/LicenseWatermark').then((m) => ({
29
- default: m.LicenseWatermark,
30
- })));
31
- const RedirectOverlay = lazy(() => import('../components/common/RedirectOverlay').then((m) => ({
32
- default: m.RedirectOverlay,
33
- })));
23
+ // Null fallback for lazy components that fail to load (e.g., optional auth dependency absent)
24
+ const NullFallback = () => null;
25
+ // Lazy load client-only components — each wrapped with catch to prevent hanging
26
+ // if an optional dependency (e.g., @donotdev/auth) is not installed.
27
+ const CookieConsent = lazy(() => import('../components/cookie-consent/CookieConsent').catch(() => ({ default: NullFallback })));
28
+ const PWAUpdateNotification = lazy(() => import('../internal/layout/components/PWAUpdateNotification')
29
+ .then((m) => ({ default: m.default }))
30
+ .catch(() => ({ default: NullFallback })));
31
+ const LicenseWatermark = lazy(() => import('../components/license/LicenseWatermark')
32
+ .then((m) => ({ default: m.LicenseWatermark }))
33
+ .catch(() => ({ default: NullFallback })));
34
+ const RedirectOverlay = lazy(() => import('../components/common/RedirectOverlay')
35
+ .then((m) => ({ default: m.RedirectOverlay }))
36
+ .catch(() => ({ default: NullFallback })));
34
37
  /**
35
38
  * ConsentBanner - Lazy loaded consent component
36
39
  * Only shows if user hasn't consented yet
@@ -1 +1 @@
1
- {"version":3,"file":"DnDevNavigationMenu.d.ts","sourceRoot":"","sources":["../../src/routing/DnDevNavigationMenu.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AAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,wBAAwB,CA8KvE,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -114,8 +114,9 @@ export const DnDevNavigationMenu = ({ routes, vertical = false, display = DISPLA
114
114
  return null;
115
115
  }
116
116
  if (overflowDetection && !vertical) {
117
- const visibleItems = items.slice(0, visibleCount);
118
- const overflowItems = items.slice(visibleCount);
117
+ const boundedVisibleCount = Math.min(visibleCount, items.length);
118
+ const visibleItems = items.slice(0, boundedVisibleCount);
119
+ const overflowItems = items.slice(boundedVisibleCount);
119
120
  return (_jsx(NavigationMenu, { className: cn(className), style: style || { flex: 1 }, children: _jsxs(NavigationMenuListPrimitive, { ref: containerRef, "data-vertical": "false", style: {
120
121
  display: 'flex',
121
122
  alignItems: 'center',
@@ -1 +1 @@
1
- {"version":3,"file":"GoToWrapper.d.ts","sourceRoot":"","sources":["../../src/routing/GoToWrapper.tsx"],"names":[],"mappings":"AAuBA;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,WAAW,+CA0BhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"GoToWrapper.d.ts","sourceRoot":"","sources":["../../src/routing/GoToWrapper.tsx"],"names":[],"mappings":"AAuBA;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,WAAW,+CAmChB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -34,6 +34,13 @@ const GoToWrapper = () => {
34
34
  // Cmd+K keyboard shortcut
35
35
  useEventListener('keydown', (event) => {
36
36
  if ((event.metaKey || event.ctrlKey) && event.key === 'k') {
37
+ // Don't intercept Cmd+K in form fields where it may have native meaning
38
+ const target = event.target;
39
+ if (target.tagName === 'INPUT' ||
40
+ target.tagName === 'TEXTAREA' ||
41
+ target.isContentEditable) {
42
+ return;
43
+ }
37
44
  event.preventDefault();
38
45
  openCommandDialog();
39
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/routing/Link.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAC1B,MAAM,OAAO,CAAC;AASf;;;;;;GAMG;AACH,MAAM,WAAW,SAAU,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,EAAE,aAAa,CAAC,SAAS,CAuIzC,CAAC"}
1
+ {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/routing/Link.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAC1B,MAAM,OAAO,CAAC;AASf;;;;;;GAMG;AACH,MAAM,WAAW,SAAU,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,EAAE,aAAa,CAAC,SAAS,CAyIzC,CAAC"}
@@ -67,7 +67,8 @@ export const Link = ({ path, replace, prefetch = true, children, icon, label, on
67
67
  onClick(e);
68
68
  }
69
69
  // Ensure path is absolute (starts with /) to prevent relative navigation issues
70
- const absolutePath = path.startsWith('/') ? path : `/${path}`;
70
+ // but preserve intentional relative paths (starting with '.' or '..')
71
+ const absolutePath = path.startsWith('/') || path.startsWith('.') ? path : `/${path}`;
71
72
  navigate(absolutePath, { replace });
72
73
  };
73
74
  const accessibilityProps = {
@@ -1 +1 @@
1
- "use client";import{useRouter as f}from"next/navigation";import{useCallback as h}from"react";import{isClient as S,useOverlayStore as y}from"@donotdev/core";function d(){let e=f(),t=y(r=>r.closeAll);return h((r,i)=>{if(r==="back")return t(),e.back();if(t(),i?.preserveScroll&&S()){let s=window.scrollY;i?.replace?e.replace(r):e.push(r),requestAnimationFrame(()=>{window.scrollTo({top:s,behavior:"auto"})});return}return i?.replace?e.replace(r):e.push(r)},[e,t])}function k(){let e=f();return h(()=>e.back(),[e])}function T(){let e=f();return h(()=>e.refresh(),[e])}function v(){let e=f();return h(t=>e.prefetch(t),[e])}import{usePathname as b,useSearchParams as N}from"next/navigation";function l(){let e=b(),t=N(),r=t.toString()?`?${t.toString()}`:"";return{pathname:e||"/",search:r,hash:"",state:null}}import{useParams as w}from"next/navigation";function g(){return w()}function C(e){let r=g()[e];if(typeof r=="string")return r;if(Array.isArray(r)&&r.length>0)return r[0]}import{useSearchParams as I}from"next/navigation";function R(){return I()}import{usePathname as G}from"next/navigation";function $(e){let t=G(),r=e.replace(/:[^/]+/g,"([^/]+)").replace(/\*/g,".*"),i=new RegExp(`^${r}$`),s=t.match(i);if(!s)return null;let o=e.match(/:[^/]+/g)?.map(a=>a.slice(1))||[],n={};return o.forEach((a,c)=>{n[a]=s[c+1]||""}),{params:n,pathname:t,pattern:e}}import{useCallback as P}from"react";function K(){let e=R(),t=d(),r=l(),i=P((n,a)=>{let c=new URLSearchParams(e.toString());c.set(n,a);let m=c.toString(),x=`${r.pathname||"/"}${m?`?${m}`:""}`;t(x)},[e,t,r.pathname]),s=P(n=>{let a=new URLSearchParams(e.toString());a.delete(n);let c=a.toString(),u=`${r.pathname||"/"}${c?`?${c}`:""}`;t(u)},[e,t,r.pathname]),o=P(()=>{let n=r.pathname||"/";t(n)},[t,r.pathname]);return{query:e,setQuery:i,removeQuery:s,clearQueries:o}}import{useMemo as E}from"react";import{isClient as Q,FEATURE_STATUS as F}from"@donotdev/core";import{useAuthConfig as M}from"@donotdev/core";import*as O from"@donotdev/auth";import{DEGRADED_AUTH_API as U}from"@donotdev/core";var A=O?.useAuth;function L(e){return U[e]}function p(e){return A?A(e):L(e)}function j(e={}){let{auth:t,redirectTo:r,condition:i}=e,s=l(),o=M(),n=p("user"),a=p("can"),c=p("status");return E(()=>{if(!Q())return{shouldRedirect:!1,redirectTo:null,isChecking:!1};if(c===F.INITIALIZING)return{shouldRedirect:!1,redirectTo:null,isChecking:!0};if(i){let u=i(n,c);return{shouldRedirect:u,redirectTo:u&&r||null,isChecking:!1}}if(t!==!1&&t!==void 0){if(!a)return{shouldRedirect:!1,redirectTo:null,isChecking:!1};if(!a.navigate(t)){let u=null;return typeof t=="object"&&t.required&&!n?s.search.includes("code=")||s.search.includes("state=")||s.search.includes("error=")?u=`${o.authRoute}${s.search}`:u=o.authRoute:typeof t=="object"&&t.role?u=o.roleRoute:typeof t=="object"&&t.tier?u=o.tierRoute:u=o.roleRoute,{shouldRedirect:!0,redirectTo:r||u,isChecking:!1}}}return{shouldRedirect:!1,redirectTo:null,isChecking:!1}},[t,c,n,a,i,r,s.search,o.authRoute,o.roleRoute,o.tierRoute])}export{k as useBack,l as useLocation,$ as useMatch,d as useNavigate,g as useParams,v as usePrefetch,K as useQueryParams,j as useRedirectGuard,T as useRefresh,C as useRouteParam,R as useSearchParams};
1
+ "use client";import{useRouter as f}from"next/navigation";import{useCallback as h}from"react";import{isClient as S,useOverlayStore as y}from"@donotdev/core";function d(){let e=f(),r=y(t=>t.closeAll);return h((t,s)=>{if(t==="back")return r(),e.back();if(r(),s?.preserveScroll&&S()){let o=window.scrollY;s?.replace?e.replace(t):e.push(t),requestAnimationFrame(()=>{window.scrollTo({top:o,behavior:"auto"})});return}return s?.replace?e.replace(t):e.push(t)},[e,r])}function k(){let e=f();return h(()=>e.back(),[e])}function T(){let e=f();return h(()=>e.refresh(),[e])}function v(){let e=f();return h(r=>e.prefetch(r),[e])}import{usePathname as b,useSearchParams as N}from"next/navigation";function m(){let e=b(),t=N().toString(),s=t?`?${t}`:void 0;return{pathname:e||"/",search:s,hash:"",state:null}}import{useParams as w}from"next/navigation";function g(){let e=w();return e||{}}function C(e){let t=g()[e];if(typeof t=="string")return t;if(Array.isArray(t)&&t.length>0)return t[0]}import{useSearchParams as I}from"next/navigation";function R(){return I()}import{usePathname as G}from"next/navigation";function $(e){let r=G(),t=e.replace(/:[^/]+/g,"([^/]+)").replace(/\*/g,".*"),s=new RegExp(`^${t}$`),o=r.match(s);if(!o)return null;let n=e.match(/:[^/]+/g)?.map(u=>u.slice(1))||[],a={};return n.forEach((u,c)=>{a[u]=o[c+1]||""}),{params:a,pathname:r,pattern:e}}import{useCallback as P}from"react";function K(){let e=R(),r=d(),t=m(),s=P((a,u)=>{let c=new URLSearchParams(e.toString());c.set(a,u);let l=c.toString(),x=`${t.pathname||"/"}${l?`?${l}`:""}`;r(x)},[e,r,t.pathname]),o=P(a=>{let u=new URLSearchParams(e.toString());u.delete(a);let c=u.toString(),i=`${t.pathname||"/"}${c?`?${c}`:""}`;r(i)},[e,r,t.pathname]),n=P(()=>{let a=t.pathname||"/";r(a)},[r,t.pathname]);return{query:e,setQuery:s,removeQuery:o,clearQueries:n}}import{useMemo as E}from"react";import{isClient as Q,FEATURE_STATUS as F}from"@donotdev/core";import{useAuthConfig as M}from"@donotdev/core";import*as O from"@donotdev/auth";import{DEGRADED_AUTH_API as U}from"@donotdev/core";var A=O?.useAuth;function L(e){return U[e]}function p(e){return A?A(e):L(e)}function j(e={}){let{auth:r,redirectTo:t,condition:s}=e,o=m(),n=M(),a=p("user"),u=p("can"),c=p("status");return E(()=>{if(!Q())return{shouldRedirect:!1,redirectTo:null,isChecking:!1};if(c===F.INITIALIZING)return{shouldRedirect:!1,redirectTo:null,isChecking:!0};if(s){let i=s(a,c);return{shouldRedirect:i,redirectTo:i&&t||null,isChecking:!1}}if(r!==!1&&r!==void 0){if(!u)return{shouldRedirect:!1,redirectTo:null,isChecking:!1};if(!u.navigate(r)){let i=null;return typeof r=="object"&&r.required&&!a?o.search?.includes("code=")||o.search?.includes("state=")||o.search?.includes("error=")?i=`${n.authRoute}${o.search}`:i=n.authRoute:typeof r=="object"&&r.role?i=n.roleRoute:typeof r=="object"&&r.tier?i=n.tierRoute:i=n.roleRoute,{shouldRedirect:!0,redirectTo:t||i,isChecking:!1}}}return{shouldRedirect:!1,redirectTo:null,isChecking:!1}},[r,c,a,u,s,t,o.search,n.authRoute,n.roleRoute,n.tierRoute])}export{k as useBack,m as useLocation,$ as useMatch,d as useNavigate,g as useParams,v as usePrefetch,K as useQueryParams,j as useRedirectGuard,T as useRefresh,C as useRouteParam,R as useSearchParams};
@@ -1,6 +1,6 @@
1
1
  export declare function useLocation(): {
2
2
  pathname: string;
3
- search: string;
3
+ search: string | undefined;
4
4
  hash: string;
5
5
  state: null;
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useLocation.next.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useLocation.next.ts"],"names":[],"mappings":"AAgBA,wBAAgB,WAAW;;;;;EAW1B"}
1
+ {"version":3,"file":"useLocation.next.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useLocation.next.ts"],"names":[],"mappings":"AAgBA,wBAAgB,WAAW;;;;;EAY1B"}
@@ -11,7 +11,8 @@ import { usePathname, useSearchParams as useNextSearchParams, } from 'next/navig
11
11
  export function useLocation() {
12
12
  const pathname = usePathname();
13
13
  const searchParams = useNextSearchParams();
14
- const search = searchParams.toString() ? `?${searchParams.toString()}` : '';
14
+ const searchString = searchParams.toString();
15
+ const search = searchString ? `?${searchString}` : undefined;
15
16
  return {
16
17
  pathname: pathname || '/',
17
18
  search,
@@ -1 +1 @@
1
- {"version":3,"file":"useParams.next.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useParams.next.ts"],"names":[],"mappings":"AAKA,wBAAgB,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAEzE"}
1
+ {"version":3,"file":"useParams.next.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useParams.next.ts"],"names":[],"mappings":"AAKA,wBAAgB,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAIzE"}
@@ -2,5 +2,8 @@
2
2
  // packages/ui/src/routing/hooks/useParams.next.ts
3
3
  import { useParams as useNextParams } from 'next/navigation';
4
4
  export function useParams() {
5
- return useNextParams();
5
+ const params = useNextParams();
6
+ if (!params)
7
+ return {};
8
+ return params;
6
9
  }
@@ -72,9 +72,9 @@ export function useRedirectGuard(options = {}) {
72
72
  // Authentication failure (not logged in)
73
73
  if (typeof auth === 'object' && auth.required && !user) {
74
74
  // Check if we have OAuth parameters that need to be preserved
75
- const hasOAuthParams = location.search.includes('code=') ||
76
- location.search.includes('state=') ||
77
- location.search.includes('error=');
75
+ const hasOAuthParams = location.search?.includes('code=') ||
76
+ location.search?.includes('state=') ||
77
+ location.search?.includes('error=');
78
78
  if (hasOAuthParams) {
79
79
  targetRoute = `${authConfig.authRoute}${location.search}`;
80
80
  }
@@ -45,11 +45,22 @@
45
45
  These are STANDARD density defaults - density system overrides below
46
46
  =========================== */
47
47
 
48
- /* Gap system - 4 tiers only (STANDARD density defaults) */
48
+ /**
49
+ * Gap system — 4 tiers, viewport-safe.
50
+ *
51
+ * Each gap uses min(rem, 2vw) so that on extreme narrow viewports
52
+ * (<400px) all gaps converge to 2% of viewport width instead of
53
+ * holding fixed rem values that eat into content. On normal+
54
+ * screens the rem value wins and the 2vw floor is irrelevant.
55
+ *
56
+ * Density overrides below follow the same pattern — their clamp()
57
+ * values are wrapped in min(..., 2vw) so the viewport floor
58
+ * applies regardless of density tier.
59
+ */
49
60
  --gap-none: 0;
50
- --gap-sm: 0.5rem; /* 8px - tight */
51
- --gap-md: 1rem; /* 16px - medium */
52
- --gap-lg: 2rem; /* 32px - large */
61
+ --gap-sm: min(0.5rem, 2vw); /* 8px or 2vw, whichever is smaller */
62
+ --gap-md: min(1rem, 2vw); /* 16px or 2vw */
63
+ --gap-lg: min(2rem, 2vw); /* 32px or 2vw */
53
64
 
54
65
  /* ===========================
55
66
  DIALOG SIZE VARIANTS
@@ -328,17 +339,18 @@
328
339
  1.625rem
329
340
  ); /* 24-26px fluid */
330
341
  --font-size-3xl: clamp(1.814rem, 1.625rem + 1vw, 2rem); /* 29-32px fluid */
331
- --gap-sm: clamp(0.375rem, 0.3125rem + 0.25vw, 0.5rem); /* 6-8px fluid */
332
- --gap-md: clamp(
333
- 0.75rem,
334
- 0.625rem + 0.5vw,
335
- 0.875rem
336
- ); /* 12-14px fluid, zoom-safe */
337
- --gap-lg: clamp(
338
- 1.5rem,
339
- 1.25rem + 1vw,
340
- 1.75rem
341
- ); /* 24-28px fluid, zoom-safe */
342
+ --gap-sm: min(
343
+ clamp(0.375rem, 0.3125rem + 0.25vw, 0.5rem),
344
+ 2vw
345
+ ); /* 6-8px fluid, 2vw floor */
346
+ --gap-md: min(
347
+ clamp(0.75rem, 0.625rem + 0.5vw, 0.875rem),
348
+ 2vw
349
+ ); /* 12-14px fluid, 2vw floor */
350
+ --gap-lg: min(
351
+ clamp(1.5rem, 1.25rem + 1vw, 1.75rem),
352
+ 2vw
353
+ ); /* 24-28px fluid, 2vw floor */
342
354
  --line-height: 1.2; /* Minor Third - All text */
343
355
  }
344
356
 
@@ -368,13 +380,18 @@
368
380
  2rem + 1.5vw,
369
381
  3rem
370
382
  ); /* 39-48px fluid - hero text */
371
- --gap-sm: clamp(0.5rem, 0.4375rem + 0.25vw, 0.625rem); /* 8-10px fluid */
372
- --gap-md: clamp(
373
- 1rem,
374
- 0.875rem + 0.5vw,
375
- 1.25rem
376
- ); /* 16-20px fluid, zoom-safe */
377
- --gap-lg: clamp(2rem, 1.75rem + 1vw, 2.5rem); /* 32-40px fluid, zoom-safe */
383
+ --gap-sm: min(
384
+ clamp(0.5rem, 0.4375rem + 0.25vw, 0.625rem),
385
+ 2vw
386
+ ); /* 8-10px fluid, 2vw floor */
387
+ --gap-md: min(
388
+ clamp(1rem, 0.875rem + 0.5vw, 1.25rem),
389
+ 2vw
390
+ ); /* 16-20px fluid, 2vw floor */
391
+ --gap-lg: min(
392
+ clamp(2rem, 1.75rem + 1vw, 2.5rem),
393
+ 2vw
394
+ ); /* 32-40px fluid, 2vw floor */
378
395
  --line-height: 1.25; /* Major Third - All text */
379
396
  }
380
397
 
@@ -396,9 +413,18 @@
396
413
  2.5rem + 2.5vw,
397
414
  5rem
398
415
  ); /* base × 1.333⁴ fluid */
399
- --gap-sm: clamp(0.5rem, 0.375rem + 0.25vw, 0.75rem); /* 8-12px fluid */
400
- --gap-md: clamp(1rem, 0.75rem + 0.5vw, 1.5rem); /* 16-24px fluid, zoom-safe */
401
- --gap-lg: clamp(2rem, 1.5rem + 1vw, 3rem); /* 32-48px fluid, zoom-safe */
416
+ --gap-sm: min(
417
+ clamp(0.5rem, 0.375rem + 0.25vw, 0.75rem),
418
+ 2vw
419
+ ); /* 8-12px fluid, 2vw floor */
420
+ --gap-md: min(
421
+ clamp(1rem, 0.75rem + 0.5vw, 1.5rem),
422
+ 2vw
423
+ ); /* 16-24px fluid, 2vw floor */
424
+ --gap-lg: min(
425
+ clamp(2rem, 1.5rem + 1vw, 3rem),
426
+ 2vw
427
+ ); /* 32-48px fluid, 2vw floor */
402
428
  --line-height: 1.33; /* Perfect Fourth - All text */
403
429
  }
404
430
 
@@ -2113,8 +2139,8 @@ em {
2113
2139
  display: grid;
2114
2140
  grid-template-rows: auto 1fr auto;
2115
2141
  width: 100%;
2116
- gap: var(--gap-md);
2117
- padding: var(--gap-lg);
2142
+ gap: var(--gap-sm);
2143
+ padding-block: var(--gap-md);
2118
2144
  overflow: hidden;
2119
2145
  box-shadow: var(--shadow-xl);
2120
2146
  animation: dialog-in var(--dur-normal) var(--ease-in-out);
@@ -2168,6 +2194,7 @@ em {
2168
2194
  gap: var(--gap-md);
2169
2195
  flex-shrink: 0;
2170
2196
  min-height: var(--touch-target);
2197
+ padding-inline: var(--gap-md);
2171
2198
  }
2172
2199
 
2173
2200
  .dndev-modal-footer {
@@ -2175,6 +2202,7 @@ em {
2175
2202
  flex-direction: column-reverse;
2176
2203
  gap: var(--gap-sm);
2177
2204
  flex-shrink: 0;
2205
+ padding-inline: var(--gap-md);
2178
2206
  }
2179
2207
 
2180
2208
  @media (width >= 640px) {
@@ -2192,7 +2220,7 @@ em {
2192
2220
  overflow-y: auto;
2193
2221
  overflow-x: visible;
2194
2222
  min-height: 0;
2195
- padding-block-start: var(--gap-sm);
2223
+ padding-inline: var(--gap-md);
2196
2224
  }
2197
2225
 
2198
2226
  .dndev-modal-title {
@@ -2209,8 +2237,8 @@ em {
2209
2237
 
2210
2238
  .dndev-modal-close {
2211
2239
  position: absolute;
2212
- inset-inline-end: var(--gap-md);
2213
- top: var(--gap-md);
2240
+ inset-inline-end: var(--gap-sm);
2241
+ top: var(--gap-sm);
2214
2242
  opacity: var(--opacity-muted);
2215
2243
  }
2216
2244
 
@@ -6991,6 +7019,12 @@ input[type='number'] {
6991
7019
  gap: var(--gap-sm);
6992
7020
  }
6993
7021
 
7022
+ .dndev-interactive[data-role='stepper-button'],
7023
+ .dndev-interactive[data-role='stepper-button']:focus,
7024
+ .dndev-interactive[data-role='stepper-button']:focus-visible {
7025
+ outline: none;
7026
+ }
7027
+
6994
7028
  .dndev-interactive[data-role='stepper-button'] {
6995
7029
  width: var(--touch-target);
6996
7030
  height: var(--touch-target);
@@ -8678,6 +8712,14 @@ input[type='number'] {
8678
8712
 
8679
8713
  /* packages/components/src/advanced/Reveal/Reveal.css */
8680
8714
 
8715
+ /* Cleanup keyframe — removes will-change after animation completes for GPU memory */
8716
+
8717
+ @keyframes dndev-reveal-cleanup {
8718
+ to {
8719
+ will-change: auto;
8720
+ }
8721
+ }
8722
+
8681
8723
  .dndev-reveal-container {
8682
8724
  /* Performance */
8683
8725
  contain: layout style;
@@ -8689,8 +8731,8 @@ input[type='number'] {
8689
8731
  transform: translate3d(0, 0, 0);
8690
8732
 
8691
8733
  /* Performance cleanup */
8692
- animation: dndev-reveal-cleanup var(--reveal-duration) var(--reveal-easing)
8693
- forwards;
8734
+ animation: dndev-reveal-cleanup var(--reveal-duration, 0.6s)
8735
+ var(--reveal-easing, cubic-bezier(0.22, 1, 0.36, 1)) forwards;
8694
8736
  }
8695
8737
 
8696
8738
  @media (prefers-reduced-motion: reduce) {
@@ -8714,8 +8756,10 @@ input[type='number'] {
8714
8756
 
8715
8757
  /* Transitions */
8716
8758
  transition:
8717
- opacity var(--reveal-duration) var(--reveal-easing),
8718
- transform var(--reveal-duration) var(--reveal-easing);
8759
+ opacity var(--reveal-duration, 0.6s)
8760
+ var(--reveal-easing, cubic-bezier(0.22, 1, 0.36, 1)),
8761
+ transform var(--reveal-duration, 0.6s)
8762
+ var(--reveal-easing, cubic-bezier(0.22, 1, 0.36, 1));
8719
8763
 
8720
8764
  /* Stagger timing */
8721
8765
  transition-delay: var(--reveal-delay, 0ms);
@@ -8724,19 +8768,19 @@ input[type='number'] {
8724
8768
  }
8725
8769
 
8726
8770
  .dndev-reveal-item[data-direction='left'] {
8727
- transform: translate3d(calc(-1 * var(--reveal-distance)), 0, 0);
8771
+ transform: translate3d(calc(-1 * var(--reveal-distance, 5vw)), 0, 0);
8728
8772
  }
8729
8773
 
8730
8774
  .dndev-reveal-item[data-direction='right'] {
8731
- transform: translate3d(var(--reveal-distance), 0, 0);
8775
+ transform: translate3d(var(--reveal-distance, 5vw), 0, 0);
8732
8776
  }
8733
8777
 
8734
8778
  .dndev-reveal-item[data-direction='top'] {
8735
- transform: translate3d(0, calc(-1 * var(--reveal-distance)), 0);
8779
+ transform: translate3d(0, calc(-1 * var(--reveal-distance, 5vw)), 0);
8736
8780
  }
8737
8781
 
8738
8782
  .dndev-reveal-item[data-direction='bottom'] {
8739
- transform: translate3d(0, var(--reveal-distance), 0);
8783
+ transform: translate3d(0, var(--reveal-distance, 5vw), 0);
8740
8784
  }
8741
8785
 
8742
8786
  .dndev-reveal-item[data-direction='fade-in'] {
@@ -95,6 +95,12 @@ export declare class AssetResolver {
95
95
  /**
96
96
  * Direct asset existence check for development
97
97
  * More reliable than the build-time detection
98
+ *
99
+ * **Limitation:** This is a synchronous heuristic that always returns true
100
+ * when `new Image()` doesn't throw. It does NOT wait for the image to load,
101
+ * so it cannot detect 404s. A proper async check would require returning a
102
+ * Promise<boolean> via Image.onload/onerror, but that would change the
103
+ * synchronous contract used by resolveLogo/resolveFaviconSet.
98
104
  */
99
105
  private static directAssetCheck;
100
106
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"assetResolver.d.ts","sourceRoot":"","sources":["../../src/utils/assetResolver.ts"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd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B;IAmBlC;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAYzC;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,aAAa,GAAG,IAAI;IAM/C;;;;OAIG;IACH,MAAM,CAAC,iBAAiB,IAAI,MAAM,GAAG,IAAI;IAKzC;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM;IAe/C;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAgB/B;;;OAGG;IACH,MAAM,CAAC,iBAAiB,IAAI,UAAU;IA6DtC;;OAEG;IACH,MAAM,CAAC,cAAc,IAAI,MAAM;IAuB/B;;;OAGG;IACH,MAAM,CAAC,UAAU,IAAI,IAAI;IASzB;;OAEG;IACH,MAAM,CAAC,YAAY;;;;;;;;CAQpB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAE9C"}
@@ -135,6 +135,12 @@ export class AssetResolver {
135
135
  /**
136
136
  * Direct asset existence check for development
137
137
  * More reliable than the build-time detection
138
+ *
139
+ * **Limitation:** This is a synchronous heuristic that always returns true
140
+ * when `new Image()` doesn't throw. It does NOT wait for the image to load,
141
+ * so it cannot detect 404s. A proper async check would require returning a
142
+ * Promise<boolean> via Image.onload/onerror, but that would change the
143
+ * synchronous contract used by resolveLogo/resolveFaviconSet.
138
144
  */
139
145
  static directAssetCheck(path) {
140
146
  if (!isClient())
@@ -143,9 +149,9 @@ export class AssetResolver {
143
149
  // Create a temporary image element to test if the resource exists
144
150
  const testImg = new Image();
145
151
  testImg.src = path;
146
- // For SVG, we can also check if it's accessible synchronously
147
- // This is a heuristic - in most dev servers, static assets are immediately available
148
- return true; // Assume SVG exists in development, as it's the preferred format
152
+ // Synchronous heuristic: assumes asset exists if Image() doesn't throw.
153
+ // Cannot validate actual load — see JSDoc limitation above.
154
+ return true;
149
155
  }
150
156
  catch {
151
157
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/ui",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -57,13 +57,13 @@
57
57
  "react-hook-form": "^7.71.2"
58
58
  },
59
59
  "peerDependencies": {
60
- "@donotdev/auth": "^0.0.11",
61
- "@donotdev/billing": "^0.0.10",
62
- "@donotdev/components": "^0.0.21",
63
- "@donotdev/core": "^0.0.27",
64
- "@donotdev/crud": "^0.0.18",
65
- "@donotdev/firebase": "^0.0.14",
66
- "@donotdev/oauth": "^0.0.10",
60
+ "@donotdev/auth": "^0.0.13",
61
+ "@donotdev/billing": "^0.0.12",
62
+ "@donotdev/components": "^0.0.23",
63
+ "@donotdev/core": "^0.0.29",
64
+ "@donotdev/crud": "^0.0.20",
65
+ "@donotdev/firebase": "^0.0.15",
66
+ "@donotdev/oauth": "^0.0.12",
67
67
  "firebase": "^12.9.0",
68
68
  "lucide-react": "^0.574.0",
69
69
  "react": "^19.2.4",