@donotdev/ui 0.1.46 → 0.2.0

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.
@@ -0,0 +1 @@
1
+ import"./chunk-O2XFH626.js";import{Cookie as w,Settings as W,Shield as G,BarChart3 as K,Target as V}from"lucide-react";import{useState as v,useEffect as y,useRef as q}from"react";import{Accordion as X,Button as m,BUTTON_VARIANT as f,Card as $,Switch as J,Text as u,cn as Q,Stack as s}from"@donotdev/components";import{handleError as Z,useConsent as d,getCookieExamples as S,hasOptionalCookies as ee}from"@donotdev/core";import{CONSENT_CATEGORY as r}from"@donotdev/core";import{useTranslation as te}from"@donotdev/core";import{isClient as ne}from"@donotdev/core";import{Fragment as se,jsx as n,jsxs as a}from"react/jsx-runtime";var oe=480;function ie({position:N="bottom",className:O=""}){let p=d("hasConsented"),g=d("categories"),D=d("acceptAll"),B=d("declineAll"),I=d("updateCategory"),k=d("showBanner"),{t:e}=te("cookies"),[C,E]=v(!1),[h,l]=v(!p||k),[A,b]=v(g),T=q(null),[L,P]=v(!1);y(()=>P(!0),[]),y(()=>{k&&l(!0)},[k]);let R=Object.keys(g),U=[{id:r.NECESSARY,icon:G,title:e("essentialCookies"),description:e("essentialDescription"),examples:S("necessary")||e("essentialExamples"),locked:!0},{id:r.FUNCTIONAL,icon:w,title:e("functionalCookies"),description:e("functionalDescription"),examples:S("functional")||e("functionalExamples"),legalNotice:e("functionalLegalNotice"),locked:!1},{id:r.ANALYTICS,icon:K,title:e("analyticsCookies"),description:e("analyticsDescription"),examples:S("analytics")||e("analyticsExamples"),locked:!1},{id:r.MARKETING,icon:V,title:e("marketingCookies"),description:e("marketingDescription"),examples:S("marketing")||e("marketingExamples"),locked:!1}].filter(t=>R.includes(t.id)),x=ee(),c=!x;if(y(()=>{let t={...g};if(C){let o=t;Object.keys(o).forEach(i=>{i!==r.NECESSARY&&o[i]===!1&&(o[i]=!0)})}b(t)},[g,C]),y(()=>{if(!ne()||p||!h||c)return;let t=i=>{T.current&&!T.current.contains(i.target)&&l(!1)},o=setTimeout(()=>{document.addEventListener("mousedown",t)},100);return()=>{clearTimeout(o),document.removeEventListener("mousedown",t)}},[p,h,c]),!L||p&&!k)return null;let M=()=>{try{Object.entries(A).forEach(([t,o])=>{if(t!==r.NECESSARY&&o!==void 0){let i=t;Object.values(r).includes(i)&&I(i,!!o)}}),E(!1),l(!1)}catch(t){Z(t,{userMessage:"Error saving preferences",context:{operation:"save_preferences"},severity:"warning",log:!0,reportToSentry:!1,showNotification:!1})}},z=()=>{D(),l(!1)},H=()=>{B(),l(!1)},Y=a(s,{gap:"medium",children:[n(u,{as:"p",variant:"muted",level:"small",style:{lineHeight:1.55},children:e(c?"necessaryOnlyDescription":"cookieBannerDescription")}),x&&n(X,{type:"single",collapsible:!0,value:C?"preferences":"",onValueChange:t=>E(t==="preferences"),items:[{value:"preferences",trigger:a(s,{direction:"row",align:"center",gap:"tight",children:[n(W,{className:"dndev-size-sm"}),n(u,{as:"span",level:"small",weight:"medium",children:e("customize")})]}),content:n(s,{gap:"tight",children:U.map(t=>{let o=t.icon,i=A[t.id]??!1;return a(s,{direction:"row",align:"start",justify:"between",gap:"medium",style:{padding:"0.75rem",borderRadius:"var(--radius-surface, 0.5rem)",background:"var(--muted)"},children:[a(s,{direction:"row",align:"start",gap:"tight",style:{flex:1,minWidth:0},children:[n(o,{className:"dndev-size-sm",style:{color:"var(--primary)",marginTop:"0.15rem",flexShrink:0}}),a(s,{gap:"none",style:{minWidth:0},children:[n(u,{as:"span",level:"small",weight:"semibold",children:t.title}),n(u,{as:"span",variant:"muted",level:"caption",style:{lineHeight:1.45},children:t.description})]})]}),t.locked?n(u,{as:"span",variant:"muted",level:"caption",weight:"medium",style:{flexShrink:0},children:e("alwaysOn")}):n(J,{checked:i,onCheckedChange:F=>b(_=>({..._,[t.id]:F}))})]},t.id)})})}]})]}),j=C?a(s,{direction:"row",gap:"tight",style:{width:"100%"},children:[n(m,{onClick:()=>E(!1),variant:f.OUTLINE,style:{flex:1},children:e("form.cancel","Cancel")}),n(m,{onClick:M,variant:f.DEFAULT,style:{flex:1},children:e("savePreferences","Save Preferences")})]}):a(s,{direction:"row",gap:"tight",style:{width:"100%"},children:[x&&n(m,{onClick:H,variant:f.OUTLINE,style:{flex:1},children:e("declineOptional")}),n(m,{onClick:z,variant:f.DEFAULT,style:{flex:1},children:e(c?"acknowledge":"acceptAll")})]});return a(se,{children:[h&&n($,{ref:T,elevated:!0,icon:w,title:e(c?"necessaryOnlyTitle":"cookiePreferences"),content:Y,footer:j,className:Q("dndev-fixed dndev-z-modal",O),style:{[N==="top"?"top":"bottom"]:"var(--gap-md)",insetInlineStart:"var(--gap-md)",width:`min(${oe}px, calc(100vw - var(--gap-md) * 2))`,height:"auto"}}),!h&&!p&&!c&&n(m,{onClick:()=>l(!0),variant:f.OUTLINE,floating:!0,icon:w,display:"compact",tooltip:e("cookiePreferences"),"aria-label":e("cookiePreferences"),className:"dndev-fixed dndev-z-toast",style:{[N==="top"?"top":"bottom"]:"var(--gap-md)",insetInlineStart:"var(--gap-md)"}})]})}var fe=ie;export{fe as default};
@@ -0,0 +1 @@
1
+ import{a as u,h as T}from"./chunk-DRFM6WXH.js";import"./chunk-O2XFH626.js";import{Link as G,Star as I}from"lucide-react";import{useCallback as k,useEffect as D,useRef as O}from"react";import{Badge as S,Command as R,CommandDialog as F}from"@donotdev/components";import{useOverlayStore as v,useTranslation as A}from"@donotdev/core";import{jsx as o,jsxs as t}from"react/jsx-runtime";var E=()=>{let{t:e}=A("dndev"),d=O(null),m=v(a=>a.isCommandDialogOpen),r=v(a=>a.closeCommandDialog),{navigationItems:f,favoriteItems:s,recentItems:i,toggleFavorite:b,isFavorite:c,navigateToItem:h}=T();D(()=>{m&&requestAnimationFrame(()=>{d.current?.focus()})},[m]);let C=k(a=>{h(a),r()},[h,r]),p=k((a,g=!0)=>a.map(n=>({label:n.label,value:n.path,description:n.path!==n.label?n.path:void 0,icon:o(u,{icon:n.icon,fallback:G}),badge:n.badge?o(S,{children:n.badge}):void 0,onSelect:()=>C(n.path),rightSlot:g?o("button",{type:"button",onClick:N=>{N.stopPropagation(),b(n.path)},className:"dndev-command-favorite-button","data-favorited":c(n.path),"aria-label":c(n.path)?e("globalGoTo.unfavorite","Remove from favorites"):e("globalGoTo.favorite","Add to favorites"),children:o(u,{icon:I,className:"dndev-size-sm"})}):void 0})),[C,b,c,e]),l=[];if(s.length>0&&l.push({heading:e("globalGoTo.favorites","Favorites"),items:p(s,!1)}),i.length>0){let a=i.flatMap(g=>p([g],!0));a.length>0&&l.push({heading:e("globalGoTo.recent","Recent"),separator:s.length>0,items:a})}l.push({heading:e("globalGoTo.allPages","All Pages"),separator:s.length>0||i.length>0,items:p(f)});let y=f.length>0;return t(F,{open:m,onOpenChange:a=>a?null:r(),children:[o(R,{placeholder:e("globalGoTo.placeholder","Search pages..."),emptyMessage:y?e("globalGoTo.noResults","No results found."):e("globalGoTo.empty","No pages available."),groups:l}),o("div",{className:"dndev-command-footer",children:t("div",{className:"dndev-command-footer-shortcuts",children:[t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"\u2318K"}),o("span",{children:e("globalGoTo.shortcutOpen","Open")})]}),t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"\u2191"}),o("kbd",{className:"dndev-command-footer-key",children:"\u2193"}),o("span",{children:e("globalGoTo.shortcutNavigate","Navigate")})]}),t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"\u21B5"}),o("span",{children:e("globalGoTo.shortcutSelect","Select")})]}),t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"Esc"}),o("span",{children:e("globalGoTo.shortcutClose","Close")})]})]})})]})},L=()=>v(d=>d.isCommandDialogOpen)?o(E,{}):null,K=L;export{K as default};
@@ -0,0 +1 @@
1
+ import*as f from"lucide-react";import{isValidElement as b}from"react";import{cn as d}from"@donotdev/components";import{jsx as c}from"react/jsx-runtime";function x(e){if(!e)return f.Palette;let n=e.replace(/['"]/g,"");return f[n]||f.Palette}var C=({icon:e,fallback:n,className:i,ariaHidden:s=!1})=>{let o=e||n;if(!o)return null;let a="dndev-size-md";if(typeof o=="function"||typeof o=="object"&&o!==null&&"render"in o)return c(o,{className:d(a,i),style:{flexShrink:0},"aria-hidden":s});if(typeof o=="string"){if(!/^[a-zA-Z0-9_-]+$/.test(o))return c("span",{className:d(a,i),style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o});let p=x(o);return c(p,{className:d(a,i),style:{flexShrink:0},"aria-hidden":s})}return b(o)?c("span",{className:i,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o}):c("span",{className:i,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o})},D=C;import*as y from"@donotdev/auth";import{DEGRADED_AUTH_API as P}from"@donotdev/core";var m=y?.useAuth;function L(e){return P[e]}function I(e){return m?m(e):L(e)}var O=typeof m=="function",M=y?.PasswordResetCallback??(()=>null);import{useMemo as h}from"react";import{useNavigationStore as S,useTranslation as E}from"@donotdev/core";import{USER_ROLES as T}from"@donotdev/core";import{useLocation as k}from"@donotdev/ui/routing/hooks";function g(){let e=k(),n=I("user"),i=!!n,{t:s}=E(),o=n?.role||T.GUEST,a=S(r=>!r||typeof r.getFilteredRoutes!="function"?[]:r.getFilteredRoutes({authenticated:i,role:o}));return h(()=>Array.isArray(a)?a.map(r=>({...r,label:K(r,s),isActive:F(r.path,e.pathname),hasChildren:!1,children:void 0})).sort((r,l)=>r.label.localeCompare(l.label,void 0,{sensitivity:"base"})):[],[a,e.pathname,s])}function Q(e){let n=g();return h(()=>n.find(i=>i.path===e),[n,e])}function K(e,n){let i=e.meta?.namespace;return typeof i!="string"||i===""?e.label:n(`${i}:title`,{defaultValue:e.label})}function F(e,n){return e==="/"?n==="/":n===e?!0:n.startsWith(e+"/")}import{useCallback as V}from"react";import{useNavigationStore as u}from"@donotdev/core";import{useNavigate as _}from"@donotdev/ui/routing/hooks";var ne=()=>{let e=_(),n=g()??[],i=u(t=>t.favorites),s=u(t=>t.recent),o=u(t=>t.toggleFavorite),a=u(t=>t.isFavorite),r=u(t=>t.addRecent),l=n.length?n.filter(t=>i.includes(t.path)):[],p=n.length?n.filter(t=>s.includes(t.path)).slice(0,5):[],A=t=>{o(t)},N=t=>a(t),v=t=>{r(t)},R=V(t=>{v(t),e(t)},[e,v]);return{navigationItems:n,favoriteItems:l,recentItems:p,toggleFavorite:A,isFavorite:N,navigateToItem:R}};export{C as a,D as b,I as c,O as d,M as e,g as f,Q as g,ne as h};
@@ -1 +1 @@
1
- {"version":3,"file":"CookieConsent.d.ts","sourceRoot":"","sources":["../../../src/components/cookie-consent/CookieConsent.tsx"],"names":[],"mappings":"AA6BA,6CAA6C;AAC7C,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,iBAAS,aAAa,CAAC,EACrB,QAAmB,EACnB,SAAc,GACf,EAAE,kBAAkB,sCA8UpB;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"CookieConsent.d.ts","sourceRoot":"","sources":["../../../src/components/cookie-consent/CookieConsent.tsx"],"names":[],"mappings":"AA6BA,6CAA6C;AAC7C,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,iBAAS,aAAa,CAAC,EACrB,QAAmB,EACnB,SAAc,GACf,EAAE,kBAAkB,sCAgVpB;AAED,eAAe,aAAa,CAAC"}
@@ -74,12 +74,9 @@ function CookieConsent({ position = 'bottom', className = '', }) {
74
74
  },
75
75
  ].filter((cat) => requiredCategories.includes(cat.id));
76
76
  const hasOptionalCategories = checkHasOptionalCookies();
77
- // Auto-accept if only necessary cookies (GDPR/CCPA — necessary don't need consent)
78
- useEffect(() => {
79
- if (!hasConsented && !hasOptionalCategories) {
80
- acceptAll();
81
- }
82
- }, [hasConsented, hasOptionalCategories, acceptAll]);
77
+ // Functional cookies only (sign-in, language, consent): nothing to consent to, but the
78
+ // visitor is told once — an information bar with a single OK that records it.
79
+ const informationOnly = !hasOptionalCategories;
83
80
  // Sync local draft state when accordion opens — default optional ON for easier UX
84
81
  useEffect(() => {
85
82
  const defaulted = { ...categories };
@@ -95,7 +92,8 @@ function CookieConsent({ position = 'bottom', className = '', }) {
95
92
  }, [categories, showPreferences]);
96
93
  // Dismiss on outside click when banner is showing pre-consent
97
94
  useEffect(() => {
98
- if (!isClient() || hasConsented || !showBanner)
95
+ // The information bar stays until acknowledged (OK), no dismiss by outside click.
96
+ if (!isClient() || hasConsented || !showBanner || informationOnly)
99
97
  return;
100
98
  const handleClickOutside = (event) => {
101
99
  if (bannerRef.current &&
@@ -110,7 +108,7 @@ function CookieConsent({ position = 'bottom', className = '', }) {
110
108
  clearTimeout(timeoutId);
111
109
  document.removeEventListener('mousedown', handleClickOutside);
112
110
  };
113
- }, [hasConsented, showBanner]);
111
+ }, [hasConsented, showBanner, informationOnly]);
114
112
  if (!mounted)
115
113
  return null;
116
114
  if (hasConsented && !storeShowBanner)
@@ -147,7 +145,9 @@ function CookieConsent({ position = 'bottom', className = '', }) {
147
145
  declineAll();
148
146
  setShowBanner(false);
149
147
  };
150
- const bannerContent = (_jsxs(Stack, { gap: "medium", children: [_jsx(Text, { as: "p", variant: "muted", level: "small", style: { lineHeight: 1.55 }, children: t('cookieBannerDescription') }), hasOptionalCategories && (_jsx(Accordion, { type: "single", collapsible: true, value: showPreferences ? 'preferences' : '', onValueChange: (value) => setShowPreferences(value === 'preferences'), items: [
148
+ const bannerContent = (_jsxs(Stack, { gap: "medium", children: [_jsx(Text, { as: "p", variant: "muted", level: "small", style: { lineHeight: 1.55 }, children: informationOnly
149
+ ? t('necessaryOnlyDescription')
150
+ : t('cookieBannerDescription') }), hasOptionalCategories && (_jsx(Accordion, { type: "single", collapsible: true, value: showPreferences ? 'preferences' : '', onValueChange: (value) => setShowPreferences(value === 'preferences'), items: [
151
151
  {
152
152
  value: 'preferences',
153
153
  trigger: (_jsxs(Stack, { direction: "row", align: "center", gap: "tight", children: [_jsx(Settings, { className: "dndev-size-sm" }), _jsx(Text, { as: "span", level: "small", weight: "medium", children: t('customize') })] })),
@@ -169,13 +169,13 @@ function CookieConsent({ position = 'bottom', className = '', }) {
169
169
  }) })),
170
170
  },
171
171
  ] }))] }));
172
- const bannerFooter = showPreferences ? (_jsxs(Stack, { direction: "row", gap: "tight", style: { width: '100%' }, children: [_jsx(Button, { onClick: () => setShowPreferences(false), variant: BUTTON_VARIANT.OUTLINE, style: { flex: 1 }, children: t('form.cancel', 'Cancel') }), _jsx(Button, { onClick: handleSave, variant: BUTTON_VARIANT.DEFAULT, style: { flex: 1 }, children: t('savePreferences', 'Save Preferences') })] })) : (_jsxs(Stack, { direction: "row", gap: "tight", style: { width: '100%' }, children: [hasOptionalCategories && (_jsx(Button, { onClick: handleDeclineAll, variant: BUTTON_VARIANT.OUTLINE, style: { flex: 1 }, children: t('declineOptional') })), _jsx(Button, { onClick: handleAcceptAll, variant: BUTTON_VARIANT.DEFAULT, style: { flex: 1 }, children: t('acceptAll') })] }));
173
- return (_jsxs(_Fragment, { children: [showBanner && (_jsx(Card, { ref: bannerRef, elevated: true, icon: Cookie, title: t('cookiePreferences'), content: bannerContent, footer: bannerFooter, className: cn('dndev-fixed dndev-z-modal', className), style: {
172
+ const bannerFooter = showPreferences ? (_jsxs(Stack, { direction: "row", gap: "tight", style: { width: '100%' }, children: [_jsx(Button, { onClick: () => setShowPreferences(false), variant: BUTTON_VARIANT.OUTLINE, style: { flex: 1 }, children: t('form.cancel', 'Cancel') }), _jsx(Button, { onClick: handleSave, variant: BUTTON_VARIANT.DEFAULT, style: { flex: 1 }, children: t('savePreferences', 'Save Preferences') })] })) : (_jsxs(Stack, { direction: "row", gap: "tight", style: { width: '100%' }, children: [hasOptionalCategories && (_jsx(Button, { onClick: handleDeclineAll, variant: BUTTON_VARIANT.OUTLINE, style: { flex: 1 }, children: t('declineOptional') })), _jsx(Button, { onClick: handleAcceptAll, variant: BUTTON_VARIANT.DEFAULT, style: { flex: 1 }, children: informationOnly ? t('acknowledge') : t('acceptAll') })] }));
173
+ return (_jsxs(_Fragment, { children: [showBanner && (_jsx(Card, { ref: bannerRef, elevated: true, icon: Cookie, title: informationOnly ? t('necessaryOnlyTitle') : t('cookiePreferences'), content: bannerContent, footer: bannerFooter, className: cn('dndev-fixed dndev-z-modal', className), style: {
174
174
  [position === 'top' ? 'top' : 'bottom']: 'var(--gap-md)',
175
175
  insetInlineStart: 'var(--gap-md)',
176
176
  width: `min(${MAX_WIDTH}px, calc(100vw - var(--gap-md) * 2))`,
177
177
  height: 'auto',
178
- } })), !showBanner && !hasConsented && (_jsx(Button, { onClick: () => setShowBanner(true), variant: BUTTON_VARIANT.OUTLINE, floating: true, icon: Cookie, display: "compact", tooltip: t('cookiePreferences'), "aria-label": t('cookiePreferences'), className: "dndev-fixed dndev-z-toast", style: {
178
+ } })), !showBanner && !hasConsented && !informationOnly && (_jsx(Button, { onClick: () => setShowBanner(true), variant: BUTTON_VARIANT.OUTLINE, floating: true, icon: Cookie, display: "compact", tooltip: t('cookiePreferences'), "aria-label": t('cookiePreferences'), className: "dndev-fixed dndev-z-toast", style: {
179
179
  [position === 'top' ? 'top' : 'bottom']: 'var(--gap-md)',
180
180
  insetInlineStart: 'var(--gap-md)',
181
181
  } }))] }));
@@ -1624,6 +1624,32 @@ em {
1624
1624
  text-transform: var(--text-transform-label, none);
1625
1625
  }
1626
1626
 
1627
+ /* ICON BADGE - count bubble on the icon's top-end corner (Button `badge`) */
1628
+ .dndev-interactive-icon-anchor {
1629
+ position: relative;
1630
+ display: inline-flex;
1631
+ }
1632
+
1633
+ .dndev-interactive-badge {
1634
+ position: absolute;
1635
+ inset-block-start: -0.5em;
1636
+ inset-inline-end: -0.65em;
1637
+ min-width: 1.25rem;
1638
+ height: 1.25rem;
1639
+ padding-inline: 0.3rem;
1640
+ display: inline-flex;
1641
+ align-items: center;
1642
+ justify-content: center;
1643
+ border-radius: var(--radius-full);
1644
+ background: var(--primary);
1645
+ color: var(--primary-foreground);
1646
+ font-size: var(--font-size-xs);
1647
+ font-weight: var(--font-weight-semibold);
1648
+ font-variant-numeric: tabular-nums;
1649
+ line-height: 1;
1650
+ pointer-events: none;
1651
+ }
1652
+
1627
1653
  /* Compact mode - always hide label */
1628
1654
  .dndev-interactive-label[data-display='compact'] {
1629
1655
  display: none;
@@ -3730,6 +3756,44 @@ em {
3730
3756
  object-fit: cover;
3731
3757
  }
3732
3758
 
3759
+ /* Contain: whole image visible on the muted cover background (cut-outs), inset
3760
+ proportionally so a packshot never touches the frame. */
3761
+ .dndev-card-cover[data-fit='contain'] > img:not(.dndev-card-cover-hover) {
3762
+ -o-object-fit: contain;
3763
+ object-fit: contain;
3764
+ box-sizing: border-box;
3765
+ padding: 8%;
3766
+ }
3767
+
3768
+ /* Hover view: stacked over the cover, crossfades in on hover / keyboard focus. */
3769
+ .dndev-card-cover > img.dndev-card-cover-hover {
3770
+ position: absolute;
3771
+ inset: 0;
3772
+ -o-object-fit: cover;
3773
+ object-fit: cover;
3774
+ opacity: 0;
3775
+ transition: opacity 0.4s var(--ease-in-out);
3776
+ }
3777
+
3778
+ @media (hover: hover) {
3779
+ .dndev-card:hover .dndev-card-cover-hover {
3780
+ opacity: 1;
3781
+ }
3782
+ }
3783
+
3784
+ /* Keyboard focus only: a mouse click keeps focus inside the card, which must not
3785
+ pin the hover view after the pointer leaves. */
3786
+ .dndev-card:has(:focus-visible) .dndev-card-cover-hover,
3787
+ .dndev-card:focus-visible .dndev-card-cover-hover {
3788
+ opacity: 1;
3789
+ }
3790
+
3791
+ @media (prefers-reduced-motion: reduce) {
3792
+ .dndev-card-cover > img.dndev-card-cover-hover {
3793
+ transition: none;
3794
+ }
3795
+ }
3796
+
3733
3797
  /* Consumer-supplied ReactNode: wrapper fills, inner media fills. */
3734
3798
  .dndev-card-cover-media {
3735
3799
  position: relative;
@@ -5137,12 +5201,23 @@ em {
5137
5201
  margin-inline: calc(50% - 50vw);
5138
5202
  }
5139
5203
 
5140
- /* Background image with overlay for text readability */
5204
+ /* Background image with overlay for text readability.
5205
+ The photo is an <img> (discoverable by the preload scanner), laid under the scrim. */
5141
5206
  .dndev-hero-section--bg-image {
5142
5207
  position: relative;
5143
- background-size: cover;
5144
- background-position: center;
5145
- background-repeat: no-repeat;
5208
+ overflow: hidden;
5209
+ }
5210
+
5211
+ .dndev-hero-section--bg-image > .dndev-hero-section__cover {
5212
+ position: absolute;
5213
+ inset: 0;
5214
+ width: 100%;
5215
+ height: 100%;
5216
+ -o-object-fit: cover;
5217
+ object-fit: cover;
5218
+ -o-object-position: center;
5219
+ object-position: center;
5220
+ z-index: 0;
5146
5221
  }
5147
5222
 
5148
5223
  .dndev-hero-section--bg-image::before {
@@ -5154,12 +5229,22 @@ em {
5154
5229
  rgba(0, 0, 0, 0.4),
5155
5230
  rgba(0, 0, 0, 0.6)
5156
5231
  );
5157
- z-index: 0;
5232
+ z-index: 1;
5233
+ }
5234
+
5235
+ /* Soft scrim: bright photography stays bright; only the bottom band darkens
5236
+ enough for white text placed there. */
5237
+ .dndev-hero-section--bg-image[data-scrim='soft']::before {
5238
+ background: linear-gradient(
5239
+ to bottom,
5240
+ rgba(0, 0, 0, 0) 45%,
5241
+ rgba(0, 0, 0, 0.55) 100%
5242
+ );
5158
5243
  }
5159
5244
 
5160
- .dndev-hero-section--bg-image > * {
5245
+ .dndev-hero-section--bg-image > :not(.dndev-hero-section__cover) {
5161
5246
  position: relative;
5162
- z-index: 1;
5247
+ z-index: 2;
5163
5248
  }
5164
5249
 
5165
5250
  .dndev-hero-section--bg-image,
@@ -5466,6 +5551,12 @@ em {
5466
5551
  display: block;
5467
5552
  }
5468
5553
 
5554
+ .image-gallery__thumbnail-image[data-fit='contain'] {
5555
+ -o-object-fit: contain;
5556
+ object-fit: contain;
5557
+ background-color: var(--muted);
5558
+ }
5559
+
5469
5560
  /* Responsive adjustments */
5470
5561
  @media (max-width: 640px) {
5471
5562
  .image-gallery__thumbnail {
@@ -6346,7 +6437,7 @@ input[type='number'] {
6346
6437
  background-color: var(--secondary);
6347
6438
  }
6348
6439
 
6349
- .dndev-progress [data-radix-progress-indicator] {
6440
+ .dndev-progress > [data-state] {
6350
6441
  height: 100%;
6351
6442
  width: 100%;
6352
6443
  flex: 1;
@@ -6356,23 +6447,23 @@ input[type='number'] {
6356
6447
  /* Variant colors */
6357
6448
  }
6358
6449
 
6359
- [data-variant='default']:is(.dndev-progress [data-radix-progress-indicator]) {
6450
+ [data-variant='default']:is(.dndev-progress > [data-state]) {
6360
6451
  background-color: var(--primary);
6361
6452
  }
6362
6453
 
6363
- [data-variant='accent']:is(.dndev-progress [data-radix-progress-indicator]) {
6454
+ [data-variant='accent']:is(.dndev-progress > [data-state]) {
6364
6455
  background-color: var(--accent);
6365
6456
  }
6366
6457
 
6367
- [data-variant='success']:is(.dndev-progress [data-radix-progress-indicator]) {
6458
+ [data-variant='success']:is(.dndev-progress > [data-state]) {
6368
6459
  background-color: var(--success);
6369
6460
  }
6370
6461
 
6371
- [data-variant='warning']:is(.dndev-progress [data-radix-progress-indicator]) {
6462
+ [data-variant='warning']:is(.dndev-progress > [data-state]) {
6372
6463
  background-color: var(--warning);
6373
6464
  }
6374
6465
 
6375
- [data-variant='destructive']:is(.dndev-progress [data-radix-progress-indicator]) {
6466
+ [data-variant='destructive']:is(.dndev-progress > [data-state]) {
6376
6467
  background-color: var(--destructive);
6377
6468
  }
6378
6469
 
@@ -7140,6 +7231,13 @@ input[type='number'] {
7140
7231
  /* Square edges for panel metaphor */
7141
7232
  }
7142
7233
 
7234
+ /* Narrow panel (carts, filters): full width on phones, a column on larger screens */
7235
+
7236
+ .dndev-sheet-content[data-size='narrow'][data-side='right'],.dndev-sheet-content[data-size='narrow'][data-side='left'] {
7237
+ width: 100%;
7238
+ max-width: 28rem;
7239
+ }
7240
+
7143
7241
  .dndev-sheet-content[data-side='right'] {
7144
7242
  /* Physical positioning: right edge */
7145
7243
  right: 0;
@@ -8534,6 +8632,65 @@ input[type='number'] {
8534
8632
  display: none;
8535
8633
  }
8536
8634
 
8635
+ /* packages/components/src/atomic/QuantityStepper/QuantityStepper.css */
8636
+
8637
+ /* One outlined control (e-commerce standard, e.g. Shopify Dawn): borderless − / +
8638
+ buttons around a centred, tabular quantity. Same height and radius as buttons. */
8639
+ .dndev-quantity-stepper {
8640
+ display: inline-flex;
8641
+ align-items: stretch;
8642
+ min-height: var(--touch-target);
8643
+ border: var(--border-hairline) solid var(--border);
8644
+ border-radius: var(--radius-interactive);
8645
+ background: var(--interactive);
8646
+ color: var(--foreground);
8647
+ }
8648
+ .dndev-quantity-stepper[data-full-width] {
8649
+ display: flex;
8650
+ width: 100%;
8651
+ }
8652
+ .dndev-quantity-stepper[data-disabled] {
8653
+ opacity: 0.6;
8654
+ }
8655
+ .dndev-quantity-stepper > .dndev-interactive {
8656
+ flex: 0 0 auto;
8657
+ aspect-ratio: 1;
8658
+ min-height: 0;
8659
+ border: none;
8660
+ border-radius: inherit;
8661
+ background: transparent;
8662
+ }
8663
+
8664
+ .dndev-quantity-stepper-value {
8665
+ flex: 1 1 auto;
8666
+ display: flex;
8667
+ align-items: center;
8668
+ justify-content: center;
8669
+ min-width: 3ch;
8670
+ padding-inline: var(--gap-sm);
8671
+ border: none;
8672
+ background: none;
8673
+ color: inherit;
8674
+ font: inherit;
8675
+ font-weight: var(--font-weight-medium);
8676
+ font-variant-numeric: tabular-nums;
8677
+ text-align: center;
8678
+ }
8679
+
8680
+ .dndev-quantity-stepper-value:is(button) {
8681
+ cursor: pointer;
8682
+ }
8683
+
8684
+ .dndev-quantity-stepper-value:is(button):hover {
8685
+ text-decoration: underline;
8686
+ text-underline-offset: 0.2em;
8687
+ }
8688
+
8689
+ .dndev-quantity-stepper-value:is(button):focus-visible {
8690
+ outline: none;
8691
+ box-shadow: var(--shadow-focus);
8692
+ }
8693
+
8537
8694
  /* packages/components/src/atomic/Tag/Tag.css */
8538
8695
 
8539
8696
  .dndev-tag {
@@ -8720,6 +8877,9 @@ input[type='number'] {
8720
8877
 
8721
8878
  .dndev-text-base[data-level^='h'] {
8722
8879
  font-family: var(--font-headline);
8880
+ /* Display sizes need tighter leading than body copy; themes opt in with
8881
+ --line-height-heading, otherwise headings keep the text line-height. */
8882
+ line-height: var(--line-height-heading, var(--line-height));
8723
8883
 
8724
8884
  /* A single word wider than its column is the one thing text cannot solve by
8725
8885
  wrapping, and display type hits it first: uppercase, letter-spaced headings
@@ -11761,6 +11921,12 @@ main[role='main'][data-routing-animation='none'] {
11761
11921
  .dndev-layout {
11762
11922
  position: relative;
11763
11923
  width: 100%;
11924
+ /* The density preset is rendered on this wrapper by the server, but <html> only
11925
+ receives it after hydration. font-size and line-height inherit as computed
11926
+ values from <body>, so re-read the density tokens here: otherwise the first
11927
+ paint uses the root defaults and text grows once <html> is updated. */
11928
+ font-size: var(--font-size-base);
11929
+ line-height: var(--line-height);
11764
11930
  height: 100vh;
11765
11931
  height: 100dvh;
11766
11932
  max-height: 100vh;
@@ -11938,7 +12104,7 @@ aside[role='navigation'].sidebar {
11938
12104
  /* Desktop presets with no sidebar: Hide sidebar element for performance/accessibility */
11939
12105
  /* Landing, Plain, Game have --sidebar-width: 0px, also need display: none */
11940
12106
  }
11941
- [data-layout='landing']:root aside.sidebar[role='navigation'],[data-layout='plain']:root aside.sidebar[role='navigation'],[data-layout='game']:root aside.sidebar[role='navigation'] {
12107
+ [data-layout='landing']:root aside.sidebar[role='navigation'],[data-layout='plain']:root aside.sidebar[role='navigation'],[data-layout='game']:root aside.sidebar[role='navigation'],.dndev-layout[data-layout='landing'] aside.sidebar[role='navigation'],.dndev-layout[data-layout='plain'] aside.sidebar[role='navigation'],.dndev-layout[data-layout='game'] aside.sidebar[role='navigation'] {
11942
12108
  display: none;
11943
12109
  }
11944
12110
  /* Moolti: Sidebar spans full height (no header/footer on desktop) */