@donotdev/ui 0.3.2 → 0.3.3

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 (57) hide show
  1. package/README.md +2 -3
  2. package/dist/crud/components/EntityCardList.d.ts +4 -1
  3. package/dist/crud/components/EntityCardList.d.ts.map +1 -1
  4. package/dist/crud/components/EntityCardList.js +1 -1
  5. package/dist/crud/components/useRecordBreadcrumb.d.ts +3 -1
  6. package/dist/crud/components/useRecordBreadcrumb.d.ts.map +1 -1
  7. package/dist/crud/components/useRecordBreadcrumb.js +1 -1
  8. package/dist/dndev-next.css +88 -37
  9. package/dist/dndev.css +88 -37
  10. package/dist/index.js +1 -1
  11. package/dist/internal/devtools/components/LayoutReset.js +1 -1
  12. package/dist/internal/layout/components/AutoMetaTags.d.ts +3 -0
  13. package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
  14. package/dist/internal/layout/components/AutoMetaTags.js +1 -1
  15. package/dist/internal/layout/components/FaviconHead.d.ts +18 -14
  16. package/dist/internal/layout/components/FaviconHead.d.ts.map +1 -1
  17. package/dist/internal/layout/components/FaviconHead.js +1 -1
  18. package/dist/internal/layout/components/headTagElement.d.ts +16 -0
  19. package/dist/internal/layout/components/headTagElement.d.ts.map +1 -0
  20. package/dist/internal/layout/components/headTagElement.js +1 -0
  21. package/dist/internal/layout/components/prerenderedHead.d.ts +15 -0
  22. package/dist/internal/layout/components/prerenderedHead.d.ts.map +1 -0
  23. package/dist/internal/layout/components/prerenderedHead.js +1 -0
  24. package/dist/internal/layout/components/trailingSlash.d.ts +13 -0
  25. package/dist/internal/layout/components/trailingSlash.d.ts.map +1 -0
  26. package/dist/internal/layout/components/trailingSlash.js +1 -0
  27. package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
  28. package/dist/providers/ViteAppProviders.d.ts +11 -9
  29. package/dist/providers/ViteAppProviders.d.ts.map +1 -1
  30. package/dist/providers/ViteAppProviders.js +1 -1
  31. package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
  32. package/dist/routing/DnDevNavigationMenu.js +1 -1
  33. package/dist/routing/hooks/hooks.next.js +1 -1
  34. package/dist/routing/hooks/useRoutePath.next.d.ts +5 -3
  35. package/dist/routing/hooks/useRoutePath.next.d.ts.map +1 -1
  36. package/dist/routing/hooks/useRoutePath.next.js +1 -1
  37. package/dist/routing/useRouteDiscovery.d.ts +3 -0
  38. package/dist/routing/useRouteDiscovery.d.ts.map +1 -1
  39. package/dist/styles/index.css +88 -37
  40. package/dist/symbol-index.json +1 -1
  41. package/dist/utils/assetResolver.d.ts +19 -19
  42. package/dist/utils/assetResolver.d.ts.map +1 -1
  43. package/dist/utils/assetResolver.js +1 -1
  44. package/dist/utils/index.d.ts +0 -1
  45. package/dist/utils/index.d.ts.map +1 -1
  46. package/dist/utils/index.js +1 -1
  47. package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
  48. package/dist/vite-routing/AppRoutes.js +1 -1
  49. package/guidelines/ROUTING.md +1 -0
  50. package/guidelines/SEO.md +160 -145
  51. package/package.json +8 -8
  52. package/dist/internal/layout/components/i18nSeoMeta.d.ts +0 -54
  53. package/dist/internal/layout/components/i18nSeoMeta.d.ts.map +0 -1
  54. package/dist/internal/layout/components/i18nSeoMeta.js +0 -1
  55. package/dist/utils/useSeo.d.ts +0 -129
  56. package/dist/utils/useSeo.d.ts.map +0 -1
  57. package/dist/utils/useSeo.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AutoMetaTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/AutoMetaTags.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAiO3C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,EAAE,aAyV1B,CAAC;AAEF;;;GAGG;AAEH,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"AutoMetaTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/AutoMetaTags.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAmM3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,YAAY,EAAE,aAqM1B,CAAC;AAEF;;;GAGG;AAEH,eAAe,YAAY,CAAC"}
@@ -1 +1 @@
1
- "use client";import{useMemo as G}from"react";import{getLanguageRouting as Q,isMultilingual as X,isNextJs as Y,languageUrls as Z,localizePath as T,useTranslation as ee}from"@donotdev/core";import{getDndevConfig as M}from"@donotdev/core";import{useSeoConfig as te,useAppConfig as ne,getPlatformEnvVar as ae}from"@donotdev/core";import{useRoutePath as ie,useUrlLanguage as oe}from"@donotdev/ui/routing/hooks";import{useIsNotFoundDocument as re}from"../../../routing/NotFoundDocument.js";import{AssetResolver as k}from"../../../utils/assetResolver.js";import{HeadTags as se}from"./HeadTags.js";import{readI18nSeoMeta as ce,resolveSeoField as O}from"./i18nSeoMeta.js";import{Fragment as A,jsx as t,jsxs as R}from"react/jsx-runtime";function le(r,s){let n=r.split("/").filter(Boolean),c=s.split("/").filter(Boolean);if(n.length!==c.length)return!1;for(let a=0;a<n.length;a++){let i=n[a],m=c[a];if(i===void 0||m===void 0)return!1;if(!i.startsWith(":")&&i!==m)return!1}return!0}var me={meta:{},dynamic:!1};function pe(r){let n=M()?.routes?.mapping;if(n&&Array.isArray(n)){let a=n.find(o=>o.path===r);if(a)return{meta:a.meta,dynamic:!1};let m=n.filter(o=>typeof o.path=="string"&&o.path.includes(":")).filter(o=>le(o.path,r));if(m.length>0)return a=m.reduce((o,l)=>l.path.length>o.path.length?l:o),{meta:a.meta,dynamic:!0}}let c=r.split("/").filter(Boolean);return c.length>0?{meta:{namespace:c[0]},dynamic:!1}:{meta:{},dynamic:!1}}function ue(r,s,n,c){let a=r.split("/").filter(Boolean),i=[{"@type":"ListItem",position:1,name:n,item:`${s}${c("/")}`}],m="";for(let o=0;o<a.length;o++)m+=`/${a[o]}`,i.push({"@type":"ListItem",position:o+2,name:a[o].split("-").map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join(" "),item:`${s}${c(m)}`});return{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:i}}function ge(r,s){return{"@context":"https://schema.org","@type":"WebSite",name:s,url:r||"/",potentialAction:{"@type":"SearchAction",target:{"@type":"EntryPoint",urlTemplate:`${r}/search?q={search_term_string}`},"query-input":"required name=search_term_string"}}}function de(r,s,n,c){let a=c?Object.values(c).filter(i=>!!i):[];return{"@context":"https://schema.org","@type":"Organization",name:s,url:r||"/",...n&&{description:n},...a.length>0&&{sameAs:a},logo:{"@type":"ImageObject",url:`${r}/icon-512x512.png`}}}function fe(){return{prerender:[{where:{and:[{href_matches:"/*"},{not:{href_matches:"/api/*"}},{not:{href_matches:"/admin/*"}},{not:{href_matches:"/login*"}},{not:{href_matches:"/signin*"}},{not:{href_matches:"/signup*"}},{not:{href_matches:"/logout*"}}]},eagerness:"moderate"}],prefetch:[{where:{and:[{href_matches:"/*"},{not:{href_matches:"/api/*"}}]},eagerness:"conservative"}]}}var he=()=>{let{t:r}=ee(),s=ie(),n=te(),c=ne("app"),a=n&&n.siteName||c?.name||"",i=ae("APP_URL")||"",m=M()?.routes?.manifest?.hasBlogFeed===!0,o=re(),{meta:l,dynamic:v}=o?me:pe(s),b=v&&Y(),g=Q(),w=oe(),E=p=>T(p,w,g),e=G(()=>{if(!n)return null;let{defaultNamespace:p="home",defaultImage:S="/og-image.png"}=n,C=o?null:`${i}${T(s,w,g)}`,d=o?null:l.namespace||p,u=l.seo,f=d?ce(r,d):null,h;if(f?.fullTitle)h=f.fullTitle;else if(u?.fullTitle)h=u.fullTitle;else{let $=d?O(u?.title,`${d}:title`,r):void 0;h=$?`${$} | ${a}`:a}let z=d?O(u?.description,`${d}:description`,r):void 0,F=u?.image||f?.image||S,J=u?.type||f?.type||"website",U=u?.keywords||f?.keywords,W=l.author||f?.author,y=F||void 0,H=J||"website",q=U||void 0,K=W||void 0,V=y&&!y.startsWith("http")?`${i}${y}`:y;return{title:h,description:z,image:V,url:C,type:H,noindex:u?.noindex||l.noindex||!1,keywords:q,author:K,publishDate:l.publishDate,modifiedDate:l.modifiedDate}},[o,s,w,l,a,i,n,r]);if(!n||!e)return null;let{twitterHandle:x,staticTags:N={}}=n,P=n.speculationRules===!0,j=n.hreflang!==!1,L=n.breadcrumbSchema!==!1,B=n.websiteSchema!==!1,I=n.organizationSchema!==!1,D=j&&!o&&X(g.languages),_=Z(s,i,g);return R(se,{children:[i&&e.url&&t("link",{rel:"canonical",href:e.url}),i&&e.url&&t("meta",{property:"og:url",content:e.url}),t("meta",{property:"og:site_name",content:a}),!b&&R(A,{children:[t("title",{children:e.title}),e.description&&t("meta",{name:"description",content:e.description}),e.keywords&&t("meta",{name:"keywords",content:Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords}),e.author&&t("meta",{name:"author",content:e.author}),e.noindex&&t("meta",{name:"robots",content:"noindex, nofollow"}),t("meta",{property:"og:title",content:e.title}),e.description&&t("meta",{property:"og:description",content:e.description}),t("meta",{property:"og:type",content:e.type}),e.image&&t("meta",{property:"og:image",content:e.image}),e.image&&t("meta",{property:"og:image:width",content:"1200"}),e.image&&t("meta",{property:"og:image:height",content:"630"}),e.type==="article"&&R(A,{children:[e.author&&t("meta",{property:"article:author",content:e.author}),e.publishDate&&t("meta",{property:"article:published_time",content:e.publishDate}),e.modifiedDate&&t("meta",{property:"article:modified_time",content:e.modifiedDate})]}),t("meta",{name:"twitter:card",content:"summary_large_image"}),t("meta",{name:"twitter:title",content:e.title}),e.description&&t("meta",{name:"twitter:description",content:e.description}),e.image&&t("meta",{name:"twitter:image",content:e.image}),e.author&&t("meta",{name:"twitter:creator",content:e.author})]}),x&&t("meta",{name:"twitter:site",content:`@${x}`}),t("meta",{name:"format-detection",content:"telephone=no"}),t("meta",{name:"mobile-web-app-capable",content:"yes"}),t("meta",{name:"apple-mobile-web-app-status-bar-style",content:"default"}),Object.entries(N).map(([p,S])=>t("meta",{name:p,content:S},p)),D&&g.languages.map(p=>t("link",{rel:"alternate",hrefLang:p,href:_[p]},`hreflang-${p}`)),D&&t("link",{rel:"alternate",hrefLang:"x-default",href:_[g.defaultLanguage]}),i&&m&&t("link",{rel:"alternate",type:"application/rss+xml",title:`${a} Blog`,href:`${i}/rss.xml`}),!b&&e.image&&e.image.startsWith("http")&&t("link",{rel:"dns-prefetch",href:new URL(e.image).origin}),!b&&e.url&&t("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":e.type==="article"?"Article":"WebPage",name:e.title,...e.description&&{description:e.description},url:e.url,...e.image&&{image:e.image},...e.type==="article"&&{...e.author&&{author:{"@type":"Person",name:e.author}},...e.publishDate&&{datePublished:e.publishDate},...e.modifiedDate&&{dateModified:e.modifiedDate}},publisher:{"@type":"Organization",name:a,logo:{"@type":"ImageObject",url:`${i}${k.assetExists("/icon-512x512.png")?"/icon-512x512.png":k.assetExists("/icon-192x192.png")?"/icon-192x192.png":"/logo.svg"}`}}})}),L&&!o&&s!=="/"&&t("script",{type:"application/ld+json",children:JSON.stringify(ue(s,i,a,E))}),B&&i&&t("script",{type:"application/ld+json",children:JSON.stringify(ge(i,a))}),I&&i&&s==="/"&&c?.links&&Object.values(c.links).some(Boolean)&&t("script",{type:"application/ld+json",children:JSON.stringify(de(i,a,c.description,c.links))}),P&&t("script",{type:"speculationrules",children:JSON.stringify(fe())})]})},Te=he;export{he as AutoMetaTags,Te as default};
1
+ "use client";import{useMemo as j}from"react";import{buildBreadcrumbJsonLd as k,formatTrailingSlash as x,getLanguageRouting as C,isMultilingual as U,languageUrl as O,languageUrls as F,matchRoute as I,routeHeadTags as J,routeSeo as z,siteHeadTags as q,SITE_LOGO_PATH as W,useTranslation as G}from"@donotdev/core";import{getDndevConfig as v}from"@donotdev/core";import{useSeoConfig as V,useAppConfig as K,getPlatformEnvVar as Q}from"@donotdev/core";import{useRoutePath as X,useUrlLanguage as Y}from"@donotdev/ui/routing/hooks";import{useIsNotFoundDocument as Z}from"../../../routing/NotFoundDocument.js";import{headTagElement as T}from"./headTagElement.js";import{HeadTags as ee}from"./HeadTags.js";import{prerenderedHead as te}from"./prerenderedHead.js";import{appTrailingSlash as ae}from"./trailingSlash.js";import{jsx as i,jsxs as ce}from"react/jsx-runtime";var ne={meta:{},serverMetadata:!1,authOnly:!1,recordBreadcrumb:!1};function re(s){let a=v(),e=a?.routes?.mapping,o=a?.routes?.manifest?.serverMetadataPaths??[],r=a?.routes?.manifest?.recordBreadcrumbPaths??[],t=n=>({meta:n.meta,serverMetadata:o.includes(n.path),authOnly:!!n.auth,recordBreadcrumb:r.includes(n.path)});if(e&&Array.isArray(e)){let n=I(e,s);if(n)return t(n.route)}let m=s.split("/").filter(Boolean);return m.length>0?{meta:{namespace:m[0]},serverMetadata:!1,authOnly:!1,recordBreadcrumb:!1}:{meta:{},serverMetadata:!1,authOnly:!1,recordBreadcrumb:!1}}function se(s,a,e){return{"@context":"https://schema.org","@type":"WebSite",name:a,url:s||"/",potentialAction:{"@type":"SearchAction",target:{"@type":"EntryPoint",urlTemplate:`${s}${x("/search?q={search_term_string}",e)}`},"query-input":"required name=search_term_string"}}}function oe(s,a,e,o){let r=o?Object.values(o).filter(t=>!!t):[];return{"@context":"https://schema.org","@type":"Organization",name:a,url:s||"/",...e&&{description:e},...r.length>0&&{sameAs:r},logo:{"@type":"ImageObject",url:`${s}${W}`}}}function ie(){return{prerender:[{where:{and:[{href_matches:"/*"},{not:{href_matches:"/api/*"}},{not:{href_matches:"/admin/*"}},{not:{href_matches:"/login*"}},{not:{href_matches:"/signin*"}},{not:{href_matches:"/signup*"}},{not:{href_matches:"/logout*"}}]},eagerness:"moderate"}],prefetch:[{where:{and:[{href_matches:"/*"},{not:{href_matches:"/api/*"}}]},eagerness:"conservative"}]}}var le=()=>{let{t:s}=G(),a=X(),e=V(),o=K("app"),r=e&&e.siteName||o?.name||"",t=Q("APP_URL")||"",m=v()?.routes?.manifest?.hasBlogFeed===!0,n=Z(),{meta:d,serverMetadata:b,authOnly:y,recordBreadcrumb:R}=n?ne:re(a),_=b,c=C(),p=Y(),u=ae(),S=l=>O(l,p,t,c,u),g=n||b?null:te(S(a)),f=j(()=>{if(!e)return null;let{defaultNamespace:l="home",defaultImage:h}=e;return z({meta:d,ns:n?null:d.namespace||null,defaultNs:n?null:l,t:s,siteName:r,baseUrl:t,url:n?null:O(a,p,t,c,u),defaultImage:h,authOnly:y})},[n,a,p,u,d,y,r,t,e,s]);if(!e||!f)return null;let{twitterHandle:M,staticTags:B={}}=e,w=e.speculationRules===!0,A=e.hreflang!==!1,E=e.breadcrumbSchema!==!1,N=e.websiteSchema!==!1,P=e.organizationSchema!==!1,D=A&&!n&&U(c.languages),H=g?g.tags:_?[]:J(f,{siteName:r,baseUrl:t}),L=q({url:t?f.url:null,siteName:r,alternates:D?F(a,t,c,u):null,defaultLanguage:c.defaultLanguage}),$=R||g?.breadcrumb===!0;return ce(ee,{children:[L.map(T),H.map(T),M&&i("meta",{name:"twitter:site",content:`@${M}`}),i("meta",{name:"format-detection",content:"telephone=no"}),i("meta",{name:"mobile-web-app-capable",content:"yes"}),i("meta",{name:"apple-mobile-web-app-status-bar-style",content:"default"}),Object.entries(B).map(([l,h])=>i("meta",{name:l,content:h},l)),t&&m&&i("link",{rel:"alternate",type:"application/rss+xml",title:`${r} Blog`,href:`${t}/rss.xml`}),E&&!n&&!$&&a!=="/"&&i("script",{type:"application/ld+json",children:JSON.stringify(k(a,r,S))}),N&&t&&i("script",{type:"application/ld+json",children:JSON.stringify(se(t,r,u))}),P&&t&&a==="/"&&o?.links&&Object.values(o.links).some(Boolean)&&i("script",{type:"application/ld+json",children:JSON.stringify(oe(t,r,o.description,o.links))}),w&&i("script",{type:"speculationrules",children:JSON.stringify(ie())})]})},Me=le;export{le as AutoMetaTags,Me as default};
@@ -1,22 +1,26 @@
1
- import type { ComponentType } from 'react';
2
1
  /**
3
- * Modern favicon system component
4
- *
5
- * Uses configuration from AppConfigProvider context.
6
- * No props needed - all config comes from useFaviconConfig().
2
+ * @fileoverview Favicon tags of a Next app
3
+ * @description Renders the favicon set (`resolveFaviconFiles` over the build-time asset
4
+ * manifest, `AssetResolver.resolveFaviconSet`) as the tags of `faviconHeadTags`
5
+ * (`@donotdev/core` headTags), computed during render: the server HTML holds them, and
6
+ * the browser renders the same tags (same manifest), so the page hydrates. React 19
7
+ * hoists them into `<head>` ({@link HeadTags}). Next only: on Vite the build writes the
8
+ * same tags into `index.html` and every prerendered page (`createViteFaviconPlugin`).
7
9
  *
8
- * Features:
9
- * - SVG favicon with dark mode support
10
- * - Complete size set for all devices
11
- * - PWA manifest integration
12
- * - Microsoft tile support
13
- * - Apple touch icons
14
- * - Prevents default favicon requests
10
+ * @version 0.2.0
11
+ * @since 0.0.1
12
+ * @author AMBROISE PARK Consulting
13
+ */
14
+ import type { ComponentType } from 'react';
15
+ /**
16
+ * Favicon tags (icons, apple-touch-icon, theme-color, color-scheme) from
17
+ * `useFaviconConfig()` (`appConfig.favicon`; `false` renders nothing) and the asset
18
+ * manifest. No props, no effect: the server render and the hydration pass emit the same
19
+ * tags.
15
20
  *
16
- * @version 0.1.0
21
+ * @version 0.2.0
17
22
  * @since 0.0.1
18
23
  * @author AMBROISE PARK Consulting
19
- * @note This component must be rendered inside <head> via React head management
20
24
  */
21
25
  declare const FaviconHead: ComponentType;
22
26
  export default FaviconHead;
@@ -1 +1 @@
1
- {"version":3,"file":"FaviconHead.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/FaviconHead.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAO3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,WAAW,EAAE,aA+GlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"FaviconHead.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/FaviconHead.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQ3C;;;;;;;;;GASG;AACH,QAAA,MAAM,WAAW,EAAE,aAMlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1 +1 @@
1
- "use client";import{useEffect as m,useState as f}from"react";import{useFaviconConfig as g}from"@donotdev/core";import{AssetResolver as u}from"../../../utils/assetResolver.js";import{Fragment as o,jsx as n,jsxs as t}from"react/jsx-runtime";var d=()=>{let i=g();if(!i)return null;let{appName:l="DoNotDev App",themeColor:a="#2563eb",backgroundColor:v="#ffffff",includeManifestIcons:p=!0,includeMSIcons:r=!1}=i,[e,c]=f(null);return m(()=>{let s=u.resolveFaviconSet();c(s)},[]),e?t(o,{children:[e.svg&&n("link",{rel:"icon",type:"image/svg+xml",href:e.svg}),e.ico&&n("link",{rel:"icon",type:"image/x-icon",href:e.ico}),e.png16&&n("link",{rel:"icon",type:"image/png",sizes:"16x16",href:e.png16}),e.png32&&n("link",{rel:"icon",type:"image/png",sizes:"32x32",href:e.png32}),e.apple180&&t(o,{children:[n("link",{rel:"apple-touch-icon",sizes:"180x180",href:e.apple180}),n("meta",{name:"apple-mobile-web-app-status-bar-style",content:"default"}),n("meta",{name:"apple-mobile-web-app-title",content:l})]}),p&&t(o,{children:[e.android192&&n("link",{rel:"icon",type:"image/png",sizes:"192x192",href:e.android192}),e.android512&&n("link",{rel:"icon",type:"image/png",sizes:"512x512",href:e.android512})]}),r&&e.png32&&t(o,{children:[n("meta",{name:"msapplication-TileImage",content:e.png32}),n("meta",{name:"msapplication-TileColor",content:a}),n("meta",{name:"msapplication-config",content:"/browserconfig.xml"})]}),n("meta",{name:"theme-color",content:a}),n("meta",{name:"color-scheme",content:"light dark"}),n("link",{rel:"shortcut icon",href:"data:,"})]}):null},b=d;export{b as default};
1
+ "use client";import{faviconHeadTags as t,useFaviconConfig as n}from"@donotdev/core";import{AssetResolver as a}from"../../../utils/assetResolver.js";import{headTagElement as r}from"./headTagElement.js";import{HeadTags as i}from"./HeadTags.js";import{jsx as p}from"react/jsx-runtime";var m=()=>{let o=n();if(!o)return null;let e=t(a.resolveFaviconSet(),o);return p(i,{children:e.map(r)})},l=m;export{l as default};
@@ -0,0 +1,16 @@
1
+ import type { HeadTag } from '@donotdev/core';
2
+ /**
3
+ * A head tag of the shared builders (`@donotdev/core` headTags) as the element
4
+ * `HeadTags` hoists (React 19 on Next, react-helmet-async on Vite). Usable as an
5
+ * `Array.map` callback: the index keys the element.
6
+ *
7
+ * @param headTag - Tag name, HTML attributes, text content
8
+ * @param index - Position in its list (React key)
9
+ * @returns The element
10
+ *
11
+ * @version 0.1.0
12
+ * @since 0.3.2
13
+ * @author AMBROISE PARK Consulting
14
+ */
15
+ export declare function headTagElement({ tag, attributes, text }: HeadTag, index: number): import("react").DetailedReactHTMLElement<Record<string, string>, HTMLElement>;
16
+ //# sourceMappingURL=headTagElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headTagElement.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/headTagElement.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAK9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,iFAM/E"}
@@ -0,0 +1 @@
1
+ import{createElement as s}from"react";var d={hreflang:"hrefLang"};function i({tag:e,attributes:o,text:t},a){let r={key:`${e}-${a}`};for(let[n,c]of Object.entries(o))r[d[n]??n]=c;return s(e,r,t)}export{i as headTagElement};
@@ -0,0 +1,15 @@
1
+ import type { PrerenderedHead } from '@donotdev/core';
2
+ /**
3
+ * The prerendered head of the page at `url`, when the loaded document is that page's
4
+ * static HTML.
5
+ *
6
+ * @param url - Canonical URL of the current page (`languageUrl`)
7
+ * @returns The head the build embedded, or null (another URL, no prerendered page,
8
+ * server render)
9
+ *
10
+ * @version 0.2.0
11
+ * @since 0.3.2
12
+ * @author AMBROISE PARK Consulting
13
+ */
14
+ export declare function prerenderedHead(url: string): PrerenderedHead | null;
15
+ //# sourceMappingURL=prerenderedHead.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prerenderedHead.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/prerenderedHead.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKtD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CASnE"}
@@ -0,0 +1 @@
1
+ import{PRERENDERED_HEAD_ELEMENT_ID as r}from"@donotdev/core";var e;function o(n){if(typeof document>"u")return null;if(e===void 0){let d=document.getElementById(r)?.textContent;e=d?JSON.parse(d):null}return e?.url===n?e:null}export{o as prerenderedHead};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Whether the app's page URLs end with `/`: the Next `trailingSlash` setting, written by
3
+ * the build into the route manifest (`routes.manifest.trailingSlash`, set on the server
4
+ * and in the browser alike). Never on Vite (no such setting).
5
+ *
6
+ * @returns true when the app sets Next `trailingSlash: true`
7
+ *
8
+ * @version 0.1.0
9
+ * @since 0.3.2
10
+ * @author AMBROISE PARK Consulting
11
+ */
12
+ export declare function appTrailingSlash(): boolean;
13
+ //# sourceMappingURL=trailingSlash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trailingSlash.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/trailingSlash.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C"}
@@ -0,0 +1 @@
1
+ import{getDndevConfig as n}from"@donotdev/core";function t(){return n()?.routes?.manifest?.trailingSlash===!0}export{t as appTrailingSlash};
@@ -1 +1 @@
1
- {"version":3,"file":"NextJsAppProviders.d.ts","sourceRoot":"","sources":["../../src/providers/NextJsAppProviders.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,iBAAiB,EAAoB,MAAM,gBAAgB,CAAC;AA2F1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAQD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,+BA0FhE"}
1
+ {"version":3,"file":"NextJsAppProviders.d.ts","sourceRoot":"","sources":["../../src/providers/NextJsAppProviders.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,iBAAiB,EAAoB,MAAM,gBAAgB,CAAC;AA2F1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAQD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,+BA4FhE"}
@@ -15,17 +15,19 @@ import type { AppProvidersProps } from '@donotdev/core';
15
15
  * 2. SentryInitializer (error monitoring)
16
16
  * 3. ViteStoresInitializer (store setup)
17
17
  * 4. HelmetProvider (head management)
18
- * 5. FaviconHead (favicon configuration)
19
- * 6. NavigationProvider (RouterProvider with auto-abort)
18
+ * 5. NavigationProvider (RouterProvider with auto-abort)
20
19
  *
21
20
  * Provider hierarchy (inside router via RootLayout):
22
- * 7. QueryProviders (React Query)
23
- * 8. UIProviders (design system)
24
- * 9. AutoMetaTags (SEO)
25
- * 10. FrameworkReadySignal (framework initialization)
26
- * 11. Layout (application layout)
27
- * 12. ConsentBanner (cookie consent)
28
- * 13. PWAUpdateNotification (PWA updates)
21
+ * 6. QueryProviders (React Query)
22
+ * 7. UIProviders (design system)
23
+ * 8. AutoMetaTags (SEO)
24
+ * 9. FrameworkReadySignal (framework initialization)
25
+ * 10. Layout (application layout)
26
+ * 11. ConsentBanner (cookie consent)
27
+ * 12. PWAUpdateNotification (PWA updates)
28
+ *
29
+ * No favicon component: the build writes the favicon tags into index.html and every
30
+ * prerendered page (`createViteFaviconPlugin`, `faviconHeadTags` of `@donotdev/core`).
29
31
  *
30
32
  * @version 0.1.0
31
33
  * @since 0.0.1
@@ -1 +1 @@
1
- {"version":3,"file":"ViteAppProviders.d.ts","sourceRoot":"","sources":["../../src/providers/ViteAppProviders.tsx"],"names":[],"mappings":"AAeA,OAAO,aAAa,CAAC;AACrB,OAAO,gBAAgB,CAAC;AACxB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AACxB,OAAO,gBAAgB,CAAC;AAUxB,OAAO,KAAK,EAAE,iBAAiB,EAAoB,MAAM,gBAAgB,CAAC;AAoC1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,+BA4DxD"}
1
+ {"version":3,"file":"ViteAppProviders.d.ts","sourceRoot":"","sources":["../../src/providers/ViteAppProviders.tsx"],"names":[],"mappings":"AAeA,OAAO,aAAa,CAAC;AACrB,OAAO,gBAAgB,CAAC;AACxB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AACxB,OAAO,gBAAgB,CAAC;AAUxB,OAAO,KAAK,EAAE,iBAAiB,EAAoB,MAAM,gBAAgB,CAAC;AA+B1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,+BAyDxD"}
@@ -1 +1 @@
1
- "use client";import{lazy as d,Suspense as L,useEffect as l,useMemo as P,useRef as S,useState as y}from"react";import"virtual:env";import"virtual:themes";import"virtual:i18n-mapping";import"virtual:routes";import"virtual:assets";import{AppConfigProvider as h,applyFirstVisitLanguage as w,getI18nInstance as s,getLanguageRouting as R,getUrlLanguage as A,LanguageNavigationProvider as I}from"@donotdev/core";import{ViteStoresInitializer as N}from"../internal/initializers/ViteStoresInitializer.js";import{NavigationProvider as z}from"../internal/providers/NavigationProvider.js";import{SentryInitializer as H}from"../internal/providers/SentryInitializer.js";import{useRouteDiscovery as V}from"../routing/useRouteDiscovery.js";import{createAppRouter as E}from"../vite-routing/AppRoutes.js";import{jsx as t,jsxs as m}from"react/jsx-runtime";var T=d(()=>import("react-helmet-async").then(e=>({default:e.HelmetProvider}))),U=d(()=>import("../internal/layout/components/FaviconHead.js").then(e=>({default:e.default})));function c(){return A(window.location.pathname)}function C(e){let o=S(e);l(()=>{o.current!==e&&o.current.dispose(),o.current=e},[e])}function X(e){let{config:o={},layout:i,children:D,customStores:v}=e,a=V(),[f,u]=y(c),g=P(()=>E({routeGroups:a,layout:i}),[a,i,f]);return C(g),l(()=>{let n=()=>{let r=R();w(r.languages,r.defaultLanguage);let p=c();s().changeLanguage(p),u(p)};return window.addEventListener("popstate",n),()=>window.removeEventListener("popstate",n)},[]),m(h,{config:o,platform:"vite",children:[t(H,{}),t(N,{customStores:v,children:t(L,{fallback:null,children:m(T,{children:[t(U,{}),t(I,{navigate:(n,r)=>{window.history.pushState(null,"",n),s().changeLanguage(r),u(r)},children:t(z,{router:g})})]})})})]})}export{X as ViteAppProviders};
1
+ "use client";import{lazy as d,Suspense as f,useEffect as m,useMemo as L,useRef as P,useState as S}from"react";import"virtual:env";import"virtual:themes";import"virtual:i18n-mapping";import"virtual:routes";import"virtual:assets";import{AppConfigProvider as y,applyFirstVisitLanguage as w,getI18nInstance as s,getLanguageRouting as R,getUrlLanguage as h,LanguageNavigationProvider as A}from"@donotdev/core";import{ViteStoresInitializer as I}from"../internal/initializers/ViteStoresInitializer.js";import{NavigationProvider as N}from"../internal/providers/NavigationProvider.js";import{SentryInitializer as z}from"../internal/providers/SentryInitializer.js";import{useRouteDiscovery as V}from"../routing/useRouteDiscovery.js";import{createAppRouter as E}from"../vite-routing/AppRoutes.js";import{jsx as t,jsxs as U}from"react/jsx-runtime";var H=d(()=>import("react-helmet-async").then(e=>({default:e.HelmetProvider})));function c(){return h(window.location.pathname)}function T(e){let o=P(e);m(()=>{o.current!==e&&o.current.dispose(),o.current=e},[e])}function W(e){let{config:o={},layout:i,children:C,customStores:v}=e,a=V(),[l,g]=S(c),u=L(()=>E({routeGroups:a,layout:i}),[a,i,l]);return T(u),m(()=>{let n=()=>{let r=R();w(r.languages,r.defaultLanguage);let p=c();s().changeLanguage(p),g(p)};return window.addEventListener("popstate",n),()=>window.removeEventListener("popstate",n)},[]),U(y,{config:o,platform:"vite",children:[t(z,{}),t(I,{customStores:v,children:t(f,{fallback:null,children:t(H,{children:t(A,{navigate:(n,r)=>{window.history.pushState(null,"",n),s().changeLanguage(r),g(r)},children:t(N,{router:u})})})})})]})}export{W as ViteAppProviders};
@@ -1 +1 @@
1
- {"version":3,"file":"DnDevNavigationMenu.d.ts","sourceRoot":"","sources":["../../src/routing/DnDevNavigationMenu.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAEf,OAAO,EAOL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAS9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD,mDAAmD;AACnD,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,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"}
1
+ {"version":3,"file":"DnDevNavigationMenu.d.ts","sourceRoot":"","sources":["../../src/routing/DnDevNavigationMenu.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAEf,OAAO,EAOL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAW9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAatD,mDAAmD;AACnD,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,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,CA0LvE,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- "use client";import{MoreHorizontal as A,Link as y}from"lucide-react";import{useState as B,useEffect as I,useRef as W,useMemo as z}from"react";import{NavigationMenu as L,NavigationMenuListPrimitive as E,NavigationMenuItemPrimitive as k,Button as H,DropdownMenu as O,cn as u,DISPLAY as Y}from"@donotdev/components";import{useTranslation as q}from"@donotdev/core";import{Link as d}from"./Link.js";import{useNavigationItems as U}from"./useNavigation.js";import{Icon as R}from"../components/common/icon.js";import{jsx as n,jsxs as v}from"react/jsx-runtime";var V=({routes:D,vertical:o=!1,display:P=Y.AUTO,overflowDetection:l=!1,showIcons:f=!0,className:g,style:C})=>{let{t:S}=q("dndev"),T=U(),i=D??T,c=W(null),[x,h]=B(i.length),p=z(()=>i.map(t=>({label:t.label,path:t.path,icon:n(R,{icon:t.icon,fallback:y}),children:t.children?t.children.map(a=>({label:a.label,path:a.path,icon:n(R,{icon:a.icon,fallback:y})})):void 0})),[i]);if(I(()=>{if(!l||i.length===0||o)return;let t=()=>{let s=c.current;if(!s)return;let e=s.getBoundingClientRect(),r=s.querySelectorAll("[data-nav-item]"),b=s.querySelector("[data-more-button]"),N=0,w=b?.offsetWidth||0;for(let m=0;m<r.length;m++){let M=r[m];if(!M)break;if(M.getBoundingClientRect().right-e.left+(m===r.length-1&&b?w:0)<=e.width)N=m+1;else break}h(Math.max(0,N))},a=new ResizeObserver(t);return c.current&&a.observe(c.current),setTimeout(t,0),()=>a.disconnect()},[l,i.length,o]),I(()=>{l&&!o&&h(i.length)},[i.length,l,o]),i.length===0)return null;if(l&&!o){let t=Math.min(x,p.length),a=p.slice(0,t),s=p.slice(t);return n(L,{className:u(g),style:C||{flex:1},children:v(E,{ref:c,"data-vertical":"false",style:{display:"flex",alignItems:"center",gap:"var(--gap-sm)",flexWrap:"nowrap",overflow:"hidden"},children:[a.filter(e=>e.path).map((e,r)=>n(k,{"data-nav-item":!0,children:v(d,{path:e.path,className:u("dndev-interactive"),"data-role":"nav-trigger",children:[f&&e.icon,n("span",{className:"dndev-interactive-label",children:e.label})]})},e.path||r)),s.length>0&&n(k,{"data-more-button":!0,children:n(O,{trigger:n(H,{className:"dndev-size-touch",style:{flexShrink:0},"aria-label":S("navigation.more","More"),children:n(A,{className:"dndev-size-md"})}),items:s.filter(e=>e.path).map(e=>({label:e.label,children:v(d,{path:e.path,className:u("dndev-interactive"),"data-role":"menu-item",children:[f&&e.icon,n("span",{className:"dndev-interactive-label",children:e.label})]}),asChild:!0})),contentWidth:"14rem",contentAlign:"end"})})]})})}return n(L,{items:p,vertical:o,display:P,className:u(g,o&&"dndev-sidebar-nav-menu"),LinkComponent:d})},ee=V;export{V as DnDevNavigationMenu,ee as default};
1
+ "use client";import{MoreHorizontal as B,Link as k}from"lucide-react";import{useState as z,useEffect as R,useRef as E,useMemo as H}from"react";import{NavigationMenu as P,NavigationMenuListPrimitive as O,NavigationMenuItemPrimitive as D,Button as Y,DropdownMenu as q,cn as f,DISPLAY as U}from"@donotdev/components";import{useTranslation as V}from"@donotdev/core";import{useRoutePath as $}from"@donotdev/ui/routing/hooks";import{Link as v}from"./Link.js";import{useNavigationItems as F}from"./useNavigation.js";import{Icon as C}from"../components/common/icon.js";import{jsx as a,jsxs as h}from"react/jsx-runtime";function g(s,n){return s?s==="/"?n==="/":n===s||n.startsWith(`${s}/`):!1}var G=({routes:s,vertical:n=!1,display:S=U.AUTO,overflowDetection:l=!1,showIcons:b=!0,className:N,style:T})=>{let{t:x}=V("dndev"),u=$(),A=F(),o=s??A,d=E(null),[W,M]=z(o.length),p=H(()=>o.map(t=>({label:t.label,path:t.path,icon:a(C,{icon:t.icon,fallback:k}),active:g(t.path,u)||(t.children?.some(i=>g(i.path,u))??!1),children:t.children?t.children.map(i=>({label:i.label,path:i.path,icon:a(C,{icon:i.icon,fallback:k}),active:g(i.path,u)})):void 0})),[o,u]);if(R(()=>{if(!l||o.length===0||n)return;let t=()=>{let r=d.current;if(!r)return;let e=r.getBoundingClientRect(),c=r.querySelectorAll("[data-nav-item]"),y=r.querySelector("[data-more-button]"),I=0,w=y?.offsetWidth||0;for(let m=0;m<c.length;m++){let L=c[m];if(!L)break;if(L.getBoundingClientRect().right-e.left+(m===c.length-1&&y?w:0)<=e.width)I=m+1;else break}M(Math.max(0,I))},i=new ResizeObserver(t);return d.current&&i.observe(d.current),setTimeout(t,0),()=>i.disconnect()},[l,o.length,n]),R(()=>{l&&!n&&M(o.length)},[o.length,l,n]),o.length===0)return null;if(l&&!n){let t=Math.min(W,p.length),i=p.slice(0,t),r=p.slice(t);return a(P,{className:f(N),style:T||{flex:1},children:h(O,{ref:d,"data-vertical":"false",style:{display:"flex",alignItems:"center",gap:"var(--gap-sm)",flexWrap:"nowrap",overflow:"hidden"},children:[i.filter(e=>e.path).map((e,c)=>a(D,{"data-nav-item":!0,children:h(v,{path:e.path,className:f("dndev-interactive"),"data-role":"nav-trigger","aria-current":e.active?"page":void 0,"data-active":e.active?"true":void 0,children:[b&&e.icon,a("span",{className:"dndev-interactive-label",children:e.label})]})},e.path||c)),r.length>0&&a(D,{"data-more-button":!0,children:a(q,{trigger:a(Y,{className:"dndev-size-touch",style:{flexShrink:0},"aria-label":x("navigation.more","More"),children:a(B,{className:"dndev-size-md"})}),items:r.filter(e=>e.path).map(e=>({label:e.label,children:h(v,{path:e.path,className:f("dndev-interactive"),"data-role":"menu-item","aria-current":e.active?"page":void 0,"data-active":e.active?"true":void 0,children:[b&&e.icon,a("span",{className:"dndev-interactive-label",children:e.label})]}),asChild:!0})),contentWidth:"14rem",contentAlign:"end"})})]})})}return a(P,{items:p,vertical:n,display:S,className:f(N,n&&"dndev-sidebar-nav-menu"),LinkComponent:v})},ae=G;export{G as DnDevNavigationMenu,ae as default};
@@ -1 +1 @@
1
- "use client";import{useRouter as d}from"next/navigation";import{isClient as G,useOverlayStore as $}from"@donotdev/core";import{usePathname as L}from"next/navigation";import{getLanguageRouting as b,localizePath as T,publicPathname as N,splitLanguagePath as I}from"@donotdev/core";function w(){return I(N(L()??"/"),b()).language}function h(){let e=w(),t=b();return r=>T(r,e,t)}function P(){let e=d(),t=$(n=>n.closeAll),r=h();return(n,o)=>{if(n==="back")return t(),e.back();t();let u=r(n);if(o?.preserveScroll&&G()){let s=window.scrollY;o?.replace?e.replace(u):e.push(u),requestAnimationFrame(()=>{window.scrollTo({top:s,behavior:"auto"})});return}return o?.replace?e.replace(u):e.push(u)}}function U(){let e=d();return()=>e.back()}function K(){let e=d();return()=>e.refresh()}function E(){let e=d(),t=h();return r=>e.prefetch(t(r))}import{useSearchParams as D}from"next/navigation";import{usePathname as O}from"next/navigation";import{getLanguageRouting as z,publicPathname as q,splitLanguagePath as Q}from"@donotdev/core";function m(){return Q(q(O()??"/"),z()).path}function R(){let e=m(),r=D().toString(),n=r?`?${r}`:void 0;return{pathname:e,search:n,hash:"",state:null}}import{useParams as F}from"next/navigation";function x(){let e=F();return e||{}}function M(e){let r=x()[e];if(typeof r=="string")return r;if(Array.isArray(r)&&r.length>0)return r[0]}import{useSearchParams as j}from"next/navigation";function A(){return j()}function _(e){let t=m(),r=e.replace(/:[^/]+/g,"([^/]+)").replace(/\*/g,".*"),n=new RegExp(`^${r}$`),o=t.match(n);if(!o)return null;let u=e.match(/:[^/]+/g)?.map(a=>a.slice(1))||[],s={};return u.forEach((a,i)=>{s[a]=o[i+1]||""}),{params:s,pathname:t,pattern:e}}import{useCallback as S}from"react";function B(){let e=A(),t=P(),r=R(),n=S((s,a)=>{let i=new URLSearchParams(e.toString());i.set(s,a);let p=i.toString(),c=`${r.pathname||"/"}${p?`?${p}`:""}`;t(c)},[e,t,r.pathname]),o=S(s=>{let a=new URLSearchParams(e.toString());a.delete(s);let i=a.toString(),l=`${r.pathname||"/"}${i?`?${i}`:""}`;t(l)},[e,t,r.pathname]),u=S(()=>{let s=r.pathname||"/";t(s)},[t,r.pathname]);return{query:e,setQuery:n,removeQuery:o,clearQueries:u}}import{useMemo as Z}from"react";import{isClient as J,FEATURE_STATUS as V}from"@donotdev/core";import{useAppConfig as W,useAuthConfig as X}from"@donotdev/core";import*as k from"@donotdev/auth";import{DEGRADED_AUTH_API as Y}from"@donotdev/core";var v=k?.useAuth;function H(e){return Y[e]}function g(e){return v?v(e):H(e)}var Le=k?.PasswordResetCallback??(()=>null);function ee(e={}){let{auth:t,redirectTo:r,condition:n}=e,o=X(),u=W().auth===!1,s=g("user"),a=g("can"),i=g("status");return Z(()=>{let l={shouldRedirect:!1,redirectTo:null,isChecking:!1};if(!J())return l;if(i===V.INITIALIZING)return{...l,isChecking:!0};if(n){let c=n(s,i);return{shouldRedirect:c,redirectTo:c&&r||null,isChecking:!1}}if(t!==!1&&t!==void 0){if(!a)return l;if(!a.navigate(t)){if(u&&!r)throw new Error("[dndev] This route declares auth requirements but AppConfig.auth is false, so there is no auth route to redirect to. Enable auth in AppConfig or remove the route's auth requirement.");let c=null;if(typeof t=="object"&&t.required&&!s){let f=window.location.search,C=f.includes("code=")||f.includes("state=")||f.includes("error="),y=o.authRoute;C?c=`${y}${f}`:c=y}else typeof t=="object"&&t.role?c=o.roleRoute:typeof t=="object"&&t.tier?c=o.tierRoute:c=o.roleRoute;return{shouldRedirect:!0,redirectTo:r||c,isChecking:!1}}}return l},[t,i,s,a,n,r,u,o.authRoute,o.roleRoute,o.tierRoute])}export{U as useBack,h as useLocalizedPath,R as useLocation,_ as useMatch,P as useNavigate,x as useParams,E as usePrefetch,B as useQueryParams,ee as useRedirectGuard,K as useRefresh,M as useRouteParam,m as useRoutePath,A as useSearchParams,w as useUrlLanguage};
1
+ "use client";import{useRouter as d}from"next/navigation";import{isClient as G,useOverlayStore as $}from"@donotdev/core";import{usePathname as C}from"next/navigation";import{getLanguageRouting as b,localizePath as L,publicPathname as N,splitLanguagePath as I}from"@donotdev/core";function w(){return I(N(C()??"/"),b()).language}function h(){let e=w(),t=b();return r=>L(r,e,t)}function P(){let e=d(),t=$(n=>n.closeAll),r=h();return(n,o)=>{if(n==="back")return t(),e.back();t();let u=r(n);if(o?.preserveScroll&&G()){let s=window.scrollY;o?.replace?e.replace(u):e.push(u),requestAnimationFrame(()=>{window.scrollTo({top:s,behavior:"auto"})});return}return o?.replace?e.replace(u):e.push(u)}}function U(){let e=d();return()=>e.back()}function K(){let e=d();return()=>e.refresh()}function E(){let e=d(),t=h();return r=>e.prefetch(t(r))}import{useSearchParams as F}from"next/navigation";import{usePathname as O}from"next/navigation";import{getLanguageRouting as z,publicPathname as q,splitLanguagePath as Q,stripTrailingSlash as D}from"@donotdev/core";function m(){return Q(q(D(O()??"/")),z()).path}function R(){let e=m(),r=F().toString(),n=r?`?${r}`:void 0;return{pathname:e,search:n,hash:"",state:null}}import{useParams as M}from"next/navigation";function x(){let e=M();return e||{}}function j(e){let r=x()[e];if(typeof r=="string")return r;if(Array.isArray(r)&&r.length>0)return r[0]}import{useSearchParams as _}from"next/navigation";function A(){return _()}function B(e){let t=m(),r=e.replace(/:[^/]+/g,"([^/]+)").replace(/\*/g,".*"),n=new RegExp(`^${r}$`),o=t.match(n);if(!o)return null;let u=e.match(/:[^/]+/g)?.map(a=>a.slice(1))||[],s={};return u.forEach((a,i)=>{s[a]=o[i+1]||""}),{params:s,pathname:t,pattern:e}}import{useCallback as S}from"react";function Y(){let e=A(),t=P(),r=R(),n=S((s,a)=>{let i=new URLSearchParams(e.toString());i.set(s,a);let p=i.toString(),c=`${r.pathname||"/"}${p?`?${p}`:""}`;t(c)},[e,t,r.pathname]),o=S(s=>{let a=new URLSearchParams(e.toString());a.delete(s);let i=a.toString(),l=`${r.pathname||"/"}${i?`?${i}`:""}`;t(l)},[e,t,r.pathname]),u=S(()=>{let s=r.pathname||"/";t(s)},[t,r.pathname]);return{query:e,setQuery:n,removeQuery:o,clearQueries:u}}import{useMemo as J}from"react";import{isClient as V,FEATURE_STATUS as W}from"@donotdev/core";import{useAppConfig as X,useAuthConfig as ee}from"@donotdev/core";import*as k from"@donotdev/auth";import{DEGRADED_AUTH_API as H}from"@donotdev/core";var v=k?.useAuth;function Z(e){return H[e]}function g(e){return v?v(e):Z(e)}var Le=k?.PasswordResetCallback??(()=>null);function te(e={}){let{auth:t,redirectTo:r,condition:n}=e,o=ee(),u=X().auth===!1,s=g("user"),a=g("can"),i=g("status");return J(()=>{let l={shouldRedirect:!1,redirectTo:null,isChecking:!1};if(!V())return l;if(i===W.INITIALIZING)return{...l,isChecking:!0};if(n){let c=n(s,i);return{shouldRedirect:c,redirectTo:c&&r||null,isChecking:!1}}if(t!==!1&&t!==void 0){if(!a)return l;if(!a.navigate(t)){if(u&&!r)throw new Error("[dndev] This route declares auth requirements but AppConfig.auth is false, so there is no auth route to redirect to. Enable auth in AppConfig or remove the route's auth requirement.");let c=null;if(typeof t=="object"&&t.required&&!s){let f=window.location.search,T=f.includes("code=")||f.includes("state=")||f.includes("error="),y=o.authRoute;T?c=`${y}${f}`:c=y}else typeof t=="object"&&t.role?c=o.roleRoute:typeof t=="object"&&t.tier?c=o.tierRoute:c=o.roleRoute;return{shouldRedirect:!0,redirectTo:r||c,isChecking:!1}}}return l},[t,i,s,a,n,r,u,o.authRoute,o.roleRoute,o.tierRoute])}export{U as useBack,h as useLocalizedPath,R as useLocation,B as useMatch,P as useNavigate,x as useParams,E as usePrefetch,Y as useQueryParams,te as useRedirectGuard,K as useRefresh,j as useRouteParam,m as useRoutePath,A as useSearchParams,w as useUrlLanguage};
@@ -5,9 +5,11 @@
5
5
  * `useSearchParams`) moves the render to the browser up to the nearest Suspense
6
6
  * boundary. Use it whenever the query string is not needed. The server render of a
7
7
  * per-request page reads its internal pathname (`/<lang>/dndev-session/…`): dropped here, so
8
- * the server and the browser see the same path.
8
+ * the server and the browser see the same path. Under Next `trailingSlash: true` the URL
9
+ * ends with `/` (`/en/produits/`): the route path does not (`/produits`), the form of the
10
+ * route mapping.
9
11
  *
10
- * @returns Route path, always starting with `/`
12
+ * @returns Route path, always starting with `/`, never ending with `/` (except the root)
11
13
  *
12
14
  * @example
13
15
  * ```tsx
@@ -15,7 +17,7 @@
15
17
  * const active = path === '/produits';
16
18
  * ```
17
19
  *
18
- * @version 0.1.0
20
+ * @version 0.1.1
19
21
  * @since 0.2.3
20
22
  * @author AMBROISE PARK Consulting
21
23
  */
@@ -1 +1 @@
1
- {"version":3,"file":"useRoutePath.next.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useRoutePath.next.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAKrC"}
1
+ {"version":3,"file":"useRoutePath.next.d.ts","sourceRoot":"","sources":["../../../src/routing/hooks/useRoutePath.next.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAKrC"}
@@ -1 +1 @@
1
- "use client";import{usePathname as t}from"next/navigation";import{getLanguageRouting as e,publicPathname as a,splitLanguagePath as n}from"@donotdev/core";function o(){return n(a(t()??"/"),e()).path}export{o as useRoutePath};
1
+ "use client";import{usePathname as t}from"next/navigation";import{getLanguageRouting as a,publicPathname as e,splitLanguagePath as i,stripTrailingSlash as n}from"@donotdev/core";function g(){return i(e(n(t()??"/")),a()).path}export{g as useRoutePath};
@@ -184,6 +184,9 @@ export declare function useRouteManifest(): {
184
184
  publicRoutes: number;
185
185
  source: import("@donotdev/types").RouteSource;
186
186
  hasBlogFeed?: boolean;
187
+ trailingSlash?: boolean;
188
+ serverMetadataPaths?: string[];
189
+ recordBreadcrumbPaths?: string[];
187
190
  generatedAt: string;
188
191
  } | null;
189
192
  //# sourceMappingURL=useRouteDiscovery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRouteDiscovery.d.ts","sourceRoot":"","sources":["../../src/routing/useRouteDiscovery.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,OAAO,KAAK,EAEV,eAAe,IAAI,mBAAmB,EACvC,MAAM,gBAAgB,CAAC;AAOxB;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACnB,qCAAqC;IACrC,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,EAAE,CA2BhD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,mBAAmB,IAAI,UAAU,EAAE,CAoBlD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,6BAA6B,IAAI,eAAe,EAAE,CAejE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,gBAK3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,gBAAgB;;;;;;;SAQ/B"}
1
+ {"version":3,"file":"useRouteDiscovery.d.ts","sourceRoot":"","sources":["../../src/routing/useRouteDiscovery.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,OAAO,KAAK,EAEV,eAAe,IAAI,mBAAmB,EACvC,MAAM,gBAAgB,CAAC;AAOxB;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACnB,qCAAqC;IACrC,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,EAAE,CA2BhD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,mBAAmB,IAAI,UAAU,EAAE,CAoBlD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,6BAA6B,IAAI,eAAe,EAAE,CAejE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,gBAK3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,gBAAgB;;;;;;;;;;SAQ/B"}
@@ -1231,7 +1231,9 @@ em {
1231
1231
  var(--floating-glow-start) 100%
1232
1232
  );
1233
1233
 
1234
- background: var(--floating-glow-gradient);
1234
+ /* --floating-background: optional theme token, set on :root / theme class
1235
+ (e.g. var(--popover)) to flatten every floating surface. Unset = glow gradient. */
1236
+ background: var(--floating-background, var(--floating-glow-gradient));
1235
1237
  color: var(--popover-foreground);
1236
1238
  border: var(--border-hairline) solid var(--line-2);
1237
1239
  border-radius: var(--radius-floating);
@@ -1263,11 +1265,14 @@ em {
1263
1265
  background: var(--popover);
1264
1266
  }
1265
1267
  .dndev-floating:dir(rtl) {
1266
- background: linear-gradient(
1267
- 135deg,
1268
- var(--floating-glow-start) 0%,
1269
- var(--floating-glow-mid) 50%,
1270
- var(--floating-glow-end) 100%
1268
+ background: var(
1269
+ --floating-background,
1270
+ linear-gradient(
1271
+ 135deg,
1272
+ var(--floating-glow-start) 0%,
1273
+ var(--floating-glow-mid) 50%,
1274
+ var(--floating-glow-end) 100%
1275
+ )
1271
1276
  );
1272
1277
  }
1273
1278
  /* Size variants - ONLY 3 sizes */
@@ -1757,7 +1762,7 @@ em {
1757
1762
  font-size: var(--font-size-input);
1758
1763
  color: var(--foreground);
1759
1764
  cursor: pointer;
1760
- transition: color var(--transition-fast);
1765
+ transition: color var(--dur-fast) var(--ease-in-out);
1761
1766
 
1762
1767
  /* Subtle hover on label text */
1763
1768
  }
@@ -5656,8 +5661,8 @@ em {
5656
5661
  display: flex;
5657
5662
  align-items: center;
5658
5663
  justify-content: center;
5659
- width: 44px;
5660
- height: 44px;
5664
+ width: var(--touch-target);
5665
+ height: var(--touch-target);
5661
5666
  border: none;
5662
5667
  border-radius: var(--radius-full);
5663
5668
  /* --card not --background: surface must be opaque */
@@ -6460,6 +6465,11 @@ input[type='number'] {
6460
6465
  gap: var(--gap-none);
6461
6466
  }
6462
6467
 
6468
+ /* Sub-menu lists: base.css gives every ul list-style disc */
6469
+ .dndev-nav-menu-grid-container {
6470
+ list-style: none;
6471
+ }
6472
+
6463
6473
  /* Navigation trigger - NavigationMenu-specific styles only */
6464
6474
  .dndev-interactive[data-role='nav-trigger'] {
6465
6475
  height: var(--touch-target);
@@ -6471,6 +6481,12 @@ input[type='number'] {
6471
6481
  background-color: rgb(from var(--accent) r g b / 0.5);
6472
6482
  }
6473
6483
 
6484
+ /* Active page: top-level links, overflow dropdown links, sub-menu links */
6485
+ .dndev-interactive[data-role='menu-item'][data-active='true'],
6486
+ .dndev-nav-menu-item-container[data-active='true'] {
6487
+ background-color: rgb(from var(--accent) r g b / 0.5);
6488
+ }
6489
+
6474
6490
  .dndev-nav-menu-trigger-icon {
6475
6491
  position: relative;
6476
6492
  top: 1px;
@@ -8536,7 +8552,7 @@ input[type='number'] {
8536
8552
  .dndev-swipe-action-content {
8537
8553
  flex: 0 0 100%;
8538
8554
  min-inline-size: 0;
8539
- min-block-size: 44px;
8555
+ min-block-size: var(--touch-target);
8540
8556
  scroll-snap-align: start;
8541
8557
  background: var(--background);
8542
8558
  }
@@ -8559,8 +8575,8 @@ input[type='number'] {
8559
8575
  display: flex;
8560
8576
  align-items: center;
8561
8577
  justify-content: center;
8562
- min-inline-size: 44px;
8563
- min-block-size: 44px;
8578
+ min-inline-size: var(--touch-target);
8579
+ min-block-size: var(--touch-target);
8564
8580
  border: 0;
8565
8581
  font: inherit;
8566
8582
  cursor: pointer;
@@ -9145,34 +9161,52 @@ input[type='number'] {
9145
9161
  display: none;
9146
9162
  }
9147
9163
 
9148
- /* Reserve the complete footprint, even when zero is presented as one large +. */
9164
+ /* Collapsed: one square + at the inline end. Expanded: [ − qty + ].
9165
+ Rows are fixed in both states (no vertical shift); only the inline size animates,
9166
+ growing from the inline end toward the inline start. */
9149
9167
  .dndev-quantity-stepper {
9150
- --quantity-target: max(var(--touch-target), 44px);
9151
- /* Include both icon states, padding and inherited text BEFORE placing items.
9152
- Auto rows otherwise grow for the larger collapsed icon, then shrink on expand. */
9153
- --quantity-cell: max(
9154
- var(--quantity-target),
9155
- calc(max(var(--icon-md), var(--quantity-target) * 0.6, 1lh) + 2 * var(--gap-sm))
9156
- );
9168
+ --quantity-target: var(--touch-target);
9169
+ /* The cell IS the touch target: padding and icons fit inside it. State-independent,
9170
+ so the larger collapsed icon never changes the row; only enlarged text grows it. */
9171
+ --quantity-cell: max(var(--quantity-target), calc(1lh + 2 * var(--gap-sm)));
9172
+ /* Quantity field: three tabular digits plus breathing room. */
9173
+ --quantity-field: calc(3ch + var(--gap-sm));
9174
+ --quantity-square: calc(var(--quantity-cell) + 2 * var(--border-hairline));
9175
+ --quantity-expanded: calc(2 * var(--quantity-cell) + var(--quantity-field) + 2 * var(--border-hairline));
9157
9176
  display: inline-grid;
9158
- grid-template-columns: var(--quantity-cell) minmax(var(--quantity-cell), 1fr) var(--quantity-cell);
9177
+ /* − and the quantity shrink to nothing while collapsed or mid-transition; + is always one cell. */
9178
+ grid-template-columns: minmax(0, var(--quantity-cell)) minmax(0, var(--quantity-field)) var(--quantity-cell);
9159
9179
  grid-template-rows: var(--quantity-cell);
9160
- inline-size: calc(3 * var(--quantity-cell));
9161
- min-inline-size: calc(3 * var(--quantity-cell));
9180
+ inline-size: var(--quantity-expanded);
9181
+ min-inline-size: var(--quantity-expanded);
9162
9182
  border: var(--border-hairline) solid var(--border);
9163
9183
  border-radius: var(--radius-interactive);
9164
9184
  background: var(--interactive);
9165
9185
  color: var(--foreground);
9186
+ transition:
9187
+ inline-size var(--dur-normal) var(--ease-in-out),
9188
+ min-inline-size var(--dur-normal) var(--ease-in-out);
9189
+
9190
+ /* A clickable quantity is a target of its own: keep it at the touch target. */
9166
9191
  }
9192
+ .dndev-quantity-stepper:has( > button.dndev-quantity-stepper-value) {
9193
+ --quantity-field: max(var(--quantity-target), calc(3ch + var(--gap-sm)));
9194
+ }
9167
9195
  .dndev-quantity-stepper[data-full-width] {
9168
9196
  display: grid;
9197
+ grid-template-columns: minmax(0, var(--quantity-cell)) minmax(0, 1fr) var(--quantity-cell);
9169
9198
  inline-size: 100%;
9199
+ /* The collapsed + sits at the inline end; resolves to zero once expanded. */
9200
+ margin-inline-start: auto;
9201
+ }
9202
+ .dndev-quantity-stepper[data-collapsed]:not([data-vertical]) {
9203
+ inline-size: var(--quantity-square);
9204
+ min-inline-size: var(--quantity-square);
9170
9205
  }
9171
9206
  .dndev-quantity-stepper[data-disabled] {
9172
9207
  opacity: 0.6;
9173
9208
  }
9174
9209
  .dndev-quantity-stepper > button,.dndev-quantity-stepper > input {
9175
- min-inline-size: var(--quantity-target);
9176
9210
  min-block-size: var(--quantity-target);
9177
9211
  border: none;
9178
9212
  border-radius: inherit;
@@ -9194,9 +9228,10 @@ input[type='number'] {
9194
9228
  display: flex;
9195
9229
  align-items: center;
9196
9230
  justify-content: center;
9197
- padding: var(--gap-sm);
9231
+ /* The cell is the target: the icon centres inside it. */
9232
+ padding: 0;
9198
9233
  cursor: pointer;
9199
- transition: background-color var(--transition-fast);
9234
+ transition: background-color var(--dur-fast) var(--ease-in-out);
9200
9235
  /* Press-and-hold repeats: no text selection or touch callout on long press. */
9201
9236
  -moz-user-select: none;
9202
9237
  user-select: none;
@@ -9207,9 +9242,20 @@ input[type='number'] {
9207
9242
  background: var(--muted);
9208
9243
  }
9209
9244
  :is(.dndev-quantity-stepper > button) > svg {
9245
+ flex-shrink: 0;
9210
9246
  inline-size: var(--icon-md);
9211
9247
  block-size: var(--icon-md);
9212
9248
  }
9249
+ .dndev-quantity-stepper > .dndev-quantity-stepper-decrement,.dndev-quantity-stepper > .dndev-quantity-stepper-value {
9250
+ min-inline-size: 0;
9251
+ /* Clips the icon/digits while the track is narrower than them. The focus ring is
9252
+ the element's own box-shadow, outside its box, so it is never clipped. */
9253
+ overflow: hidden;
9254
+ transition:
9255
+ opacity var(--dur-normal) var(--ease-in-out),
9256
+ visibility var(--dur-normal) var(--ease-in-out),
9257
+ background-color var(--dur-fast) var(--ease-in-out);
9258
+ }
9213
9259
  .dndev-quantity-stepper > .dndev-quantity-stepper-decrement {
9214
9260
  grid-area: 1 / 1;
9215
9261
  }
@@ -9218,12 +9264,13 @@ input[type='number'] {
9218
9264
  }
9219
9265
  .dndev-quantity-stepper > .dndev-quantity-stepper-increment {
9220
9266
  grid-area: 1 / 3;
9267
+ min-inline-size: var(--quantity-target);
9221
9268
  }
9222
9269
  .dndev-quantity-stepper[data-vertical] {
9223
9270
  grid-template-columns: minmax(var(--quantity-cell), 1fr);
9224
9271
  grid-template-rows: repeat(3, var(--quantity-cell));
9225
- inline-size: var(--quantity-cell);
9226
- min-inline-size: var(--quantity-cell);
9272
+ inline-size: var(--quantity-square);
9273
+ min-inline-size: var(--quantity-square);
9227
9274
  }
9228
9275
  .dndev-quantity-stepper[data-vertical][data-full-width] {
9229
9276
  inline-size: 100%;
@@ -9239,15 +9286,17 @@ input[type='number'] {
9239
9286
  }
9240
9287
  .dndev-quantity-stepper[data-collapsed] > .dndev-quantity-stepper-decrement,.dndev-quantity-stepper[data-collapsed] > .dndev-quantity-stepper-value {
9241
9288
  visibility: hidden;
9289
+ opacity: 0;
9242
9290
  pointer-events: none;
9243
9291
  }
9244
- .dndev-quantity-stepper[data-collapsed] > .dndev-quantity-stepper-increment {
9245
- grid-area: 1 / 1 / -1 / -1;
9292
+ .dndev-quantity-stepper[data-collapsed] > .dndev-quantity-stepper-increment > svg {
9293
+ inline-size: calc(var(--quantity-target) * 0.6);
9294
+ block-size: calc(var(--quantity-target) * 0.6);
9246
9295
  }
9247
- :is(.dndev-quantity-stepper[data-collapsed] > .dndev-quantity-stepper-increment) > svg {
9248
- inline-size: calc(var(--quantity-target) * 0.6);
9249
- block-size: calc(var(--quantity-target) * 0.6);
9250
- }
9296
+ /* Vertical keeps its stacked footprint: the collapsed + spans all three cells. */
9297
+ .dndev-quantity-stepper[data-vertical][data-collapsed] > .dndev-quantity-stepper-increment {
9298
+ grid-area: 1 / 1 / -1 / -1;
9299
+ }
9251
9300
 
9252
9301
  .dndev-quantity-stepper-value {
9253
9302
  box-sizing: border-box;
@@ -9256,7 +9305,7 @@ input[type='number'] {
9256
9305
  justify-content: center;
9257
9306
  inline-size: 100%;
9258
9307
  min-inline-size: 0;
9259
- padding-inline: var(--gap-sm);
9308
+ padding-inline: 0;
9260
9309
  border: none;
9261
9310
  background: none;
9262
9311
  color: inherit;
@@ -9264,11 +9313,13 @@ input[type='number'] {
9264
9313
  font-weight: var(--font-weight-medium);
9265
9314
  font-variant-numeric: tabular-nums;
9266
9315
  text-align: center;
9267
-
9268
9316
  }
9269
9317
 
9270
9318
  @media (prefers-reduced-motion: reduce) {
9271
- .dndev-quantity-stepper > button {
9319
+ .dndev-quantity-stepper,
9320
+ .dndev-quantity-stepper > button,
9321
+ .dndev-quantity-stepper > .dndev-quantity-stepper-decrement,
9322
+ .dndev-quantity-stepper > .dndev-quantity-stepper-value {
9272
9323
  transition: none;
9273
9324
  }
9274
9325
  }