@donotdev/ui 0.1.47 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,14 @@ import type { AppProvidersProps } from '@donotdev/core';
26
26
  * ```
27
27
  */
28
28
  export interface NextJsAppProvidersProps extends AppProvidersProps {
29
+ /**
30
+ * The request's `Cookie` header, passed by the app's root layout. The server render
31
+ * and the client's hydration pass read the language cookie and the auth session
32
+ * from it, so both render the visitor's language and signed-in state.
33
+ */
29
34
  serverCookies?: string;
35
+ /** The request's `Accept-Language` header, passed by the app's root layout. */
36
+ acceptLanguage?: string | null;
30
37
  }
31
38
  export declare function NextJsAppProviders(props: NextJsAppProvidersProps): import("react").JSX.Element;
32
39
  //# sourceMappingURL=NextJsAppProviders.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NextJsAppProviders.d.ts","sourceRoot":"","sources":["../../src/providers/NextJsAppProviders.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAwDxD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,+BA+DhE"}
1
+ {"version":3,"file":"NextJsAppProviders.d.ts","sourceRoot":"","sources":["../../src/providers/NextJsAppProviders.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAwDxD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;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,+BAyFhE"}
@@ -9,8 +9,9 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
9
9
  * @since 0.0.1
10
10
  * @author AMBROISE PARK Consulting
11
11
  */
12
- import { lazy, Suspense, useEffect, useState } from 'react';
13
- import { QueryProviders, AppConfigProvider } from '@donotdev/core';
12
+ import { lazy, Suspense, useEffect, useMemo, useState } from 'react';
13
+ import { ReactQueryStreamedHydration } from '@tanstack/react-query-next-experimental';
14
+ import { AppConfigProvider, AuthSessionProvider, getProvider, getRequestLanguage, hasProvider, QueryProviders, RequestLanguageProvider, } from '@donotdev/core';
14
15
  import { useConsent } from '@donotdev/core';
15
16
  import { NextJsStoresInitializer } from '../internal/initializers/NextJsStoresInitializer';
16
17
  import FaviconHead from '../internal/layout/components/FaviconHead';
@@ -48,8 +49,18 @@ function ConsentBanner() {
48
49
  }
49
50
  return (_jsx(Suspense, { fallback: null, children: _jsx(CookieConsent, {}) }));
50
51
  }
52
+ /** Auth session snapshot of the request, `null` when the auth provider cannot tell. */
53
+ function readAuthSnapshot(cookieHeader) {
54
+ if (cookieHeader === undefined || !hasProvider('auth'))
55
+ return null;
56
+ return getProvider('auth').readSessionSnapshot?.(cookieHeader) ?? null;
57
+ }
51
58
  export function NextJsAppProviders(props) {
52
- const { config = {}, layout, children, serverCookies, customStores } = props;
59
+ const { config = {}, layout, children, serverCookies, acceptLanguage, customStores, } = props;
60
+ // Same header values on the server and in the hydration pass → same language and
61
+ // signed-in state on both, so the first paint is final (no keys, no auth swap).
62
+ const requestLanguage = useMemo(() => getRequestLanguage(serverCookies, acceptLanguage), [serverCookies, acceptLanguage]);
63
+ const authSnapshot = useMemo(() => readAuthSnapshot(serverCookies), [serverCookies]);
53
64
  // SSR is the default for Next apps: render the provider tree on the server so
54
65
  // page content is present in the initial HTML (crawlable, real SSR). An app
55
66
  // opts OUT with appConfig.ssr === false, restoring the legacy client-only
@@ -63,5 +74,5 @@ export function NextJsAppProviders(props) {
63
74
  if (!ssr && !isMounted) {
64
75
  return _jsx(_Fragment, { children: children });
65
76
  }
66
- return (_jsxs(AppConfigProvider, { config: config, platform: "nextjs", children: [_jsx(SentryInitializer, {}), _jsxs(NextJsStoresInitializer, { serverCookies: serverCookies, customStores: customStores, children: [_jsx(FaviconHead, {}), _jsx(PerformanceHints, {}), _jsx(QueryProviders, { children: _jsxs(UIProviders, { children: [_jsx(DnDevLayout, { layout: layout, children: children }), _jsx(ConsentBanner, {}), _jsx(AuthReturnTo, {}), _jsx(PasswordResetCallback, {}), _jsx(Suspense, { fallback: null, children: _jsx(PWAUpdateNotification, {}) }), _jsx(Suspense, { fallback: null, children: _jsx(RedirectOverlay, {}) })] }) })] })] }));
77
+ return (_jsx(RequestLanguageProvider, { language: requestLanguage, children: _jsx(AuthSessionProvider, { snapshot: authSnapshot, children: _jsxs(AppConfigProvider, { config: config, platform: "nextjs", children: [_jsx(SentryInitializer, {}), _jsxs(NextJsStoresInitializer, { serverCookies: serverCookies, customStores: customStores, children: [_jsx(FaviconHead, {}), _jsx(PerformanceHints, {}), _jsx(QueryProviders, { children: _jsx(ReactQueryStreamedHydration, { children: _jsxs(UIProviders, { children: [_jsx(DnDevLayout, { layout: layout, children: children }), _jsx(ConsentBanner, {}), _jsx(AuthReturnTo, {}), _jsx(PasswordResetCallback, {}), _jsx(Suspense, { fallback: null, children: _jsx(PWAUpdateNotification, {}) }), _jsx(Suspense, { fallback: null, children: _jsx(RedirectOverlay, {}) })] }) }) })] })] }) }) }));
67
78
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useNavigation.d.ts","sourceRoot":"","sources":["../../src/routing/useNavigation.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAQtD;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAC;IAClB,yCAAyC;IACzC,WAAW,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,EAAE,CAgDrD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAG3E"}
1
+ {"version":3,"file":"useNavigation.d.ts","sourceRoot":"","sources":["../../src/routing/useNavigation.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAQtD;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAC;IAClB,yCAAyC;IACzC,WAAW,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,EAAE,CAkDrD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAG3E"}
@@ -8,7 +8,7 @@
8
8
  * @author AMBROISE PARK Consulting
9
9
  */
10
10
  import { useMemo } from 'react';
11
- import { useNavigationStore } from '@donotdev/core';
11
+ import { useNavigationStore, useTranslation } from '@donotdev/core';
12
12
  import { USER_ROLES } from '@donotdev/core';
13
13
  // Platform-specific hooks via conditional exports
14
14
  import { useLocation } from '@donotdev/ui/routing/hooks';
@@ -37,6 +37,7 @@ export function useNavigationItems() {
37
37
  // Get auth state - hooks must be called at top level
38
38
  const user = useAuthSafe('user');
39
39
  const authenticated = !!user;
40
+ const { t } = useTranslation();
40
41
  const role = user?.role || USER_ROLES.GUEST;
41
42
  // Use Zustand selector for proper caching - only re-runs when auth state changes
42
43
  const filteredRoutes = useNavigationStore((state) => {
@@ -63,12 +64,13 @@ export function useNavigationItems() {
63
64
  return filteredRoutes
64
65
  .map((route) => ({
65
66
  ...route,
67
+ label: routeLabel(route, t),
66
68
  isActive: isRouteActive(route.path, location.pathname),
67
69
  hasChildren: false,
68
70
  children: undefined,
69
71
  }))
70
72
  .sort((a, b) => a.label.localeCompare(b.label, undefined, { sensitivity: 'base' })); // Alphabetical sorting by label
71
- }, [filteredRoutes, location.pathname]);
73
+ }, [filteredRoutes, location.pathname, t]);
72
74
  }
73
75
  /**
74
76
  * Resolves a single navigation item from the store by path.
@@ -104,6 +106,16 @@ export function useNavigationRoute(path) {
104
106
  return useMemo(() => items.find((item) => item.path === path), [items, path]);
105
107
  }
106
108
  // ===== HELPER FUNCTIONS =====
109
+ /**
110
+ * Navigation label of a route: the page's `<namespace>:title` (the PageMeta contract,
111
+ * same key as the page `<title>`), else the label discovery derived from the file name.
112
+ */
113
+ function routeLabel(route, t) {
114
+ const namespace = route.meta?.namespace;
115
+ if (typeof namespace !== 'string' || namespace === '')
116
+ return route.label;
117
+ return t(`${namespace}:title`, { defaultValue: route.label });
118
+ }
107
119
  /**
108
120
  * Determines if a route path is currently active
109
121
  */
@@ -189,7 +189,6 @@
189
189
  --font-size-xs: 0.75rem; /* 12px - captions, shortcuts, meta */
190
190
  --font-size-sm: 0.875rem; /* 14px - small text, captions */
191
191
  --font-size-base: 1rem; /* 16px - body text, DEFAULT */
192
- --font-size-input: 16px; /* Form field text - hardcoded for iOS zoom + density-proof */
193
192
  --font-size-lg: 1.25rem; /* 20px - base × 1.25¹ - emphasized text */
194
193
  --font-size-xl: 1.563rem; /* 25px - base × 1.25² - headings */
195
194
  --font-size-2xl: 1.953rem; /* 31px - base × 1.25³ - large headings */
@@ -443,6 +442,13 @@
443
442
  ); /* 32-48px fluid, 2vw floor */
444
443
  --line-height: 1.33; /* Perfect Fourth - All text */
445
444
  }
445
+
446
+ /* Form field text: follows density, never below 16px (iOS focus zoom).
447
+ Declared on [data-density] too, so nested densities resolve their own base. */
448
+ :root,
449
+ [data-density] {
450
+ --font-size-input: max(16px, var(--font-size-base));
451
+ }
446
452
  /* 2. Theme system - color palette definitions */
447
453
  /* packages/components/src/styles/themes.css */
448
454
 
@@ -1394,6 +1400,14 @@ em {
1394
1400
  pointer-events: none;
1395
1401
  opacity: var(--opacity-muted);
1396
1402
  }
1403
+ /* Ripple clip layer (injected by JS) - contains the ripple regardless of the host's overflow */
1404
+ .dndev-interactive .dndev-ripple-clip {
1405
+ position: absolute;
1406
+ inset: 0;
1407
+ overflow: hidden;
1408
+ border-radius: inherit;
1409
+ pointer-events: none;
1410
+ }
1397
1411
  /* Ripple effect element (injected by JS) */
1398
1412
  .dndev-interactive .dndev-ripple {
1399
1413
  position: absolute;
@@ -1402,6 +1416,9 @@ em {
1402
1416
  pointer-events: none;
1403
1417
  animation: dndev-ripple var(--dur-slow) var(--ease-in-out) forwards;
1404
1418
  }
1419
+ .dndev-interactive[data-variant='ghost'],.dndev-interactive[data-variant='link'] {
1420
+ --ripple-opacity: 0;
1421
+ }
1405
1422
  .dndev-interactive[data-display='compact'] {
1406
1423
  width: var(--touch-target);
1407
1424
  height: var(--touch-target);
@@ -1546,8 +1563,12 @@ em {
1546
1563
  .dndev-interactive[data-role='menu-item']:focus-visible,.dndev-interactive[data-role='menu-item'][data-highlighted] {
1547
1564
  background: rgb(from var(--primary) r g b / 0.1);
1548
1565
  color: var(--primary);
1549
- outline: 2px solid var(--ring);
1550
- outline-offset: 0;
1566
+ outline: none;
1567
+ box-shadow: none;
1568
+ }
1569
+ /* Items fill their clipped container: scaling would expose its edges */
1570
+ .dndev-interactive[data-role='menu-item']:active:not(:disabled) {
1571
+ transform: none;
1551
1572
  }
1552
1573
  .dndev-interactive[data-role='menu-item'][data-disabled] {
1553
1574
  pointer-events: none;
@@ -1619,6 +1640,32 @@ em {
1619
1640
  text-transform: var(--text-transform-label, none);
1620
1641
  }
1621
1642
 
1643
+ /* ICON BADGE - count bubble on the icon's top-end corner (Button `badge`) */
1644
+ .dndev-interactive-icon-anchor {
1645
+ position: relative;
1646
+ display: inline-flex;
1647
+ }
1648
+
1649
+ .dndev-interactive-badge {
1650
+ position: absolute;
1651
+ inset-block-start: -0.5em;
1652
+ inset-inline-end: -0.65em;
1653
+ min-width: 1.25rem;
1654
+ height: 1.25rem;
1655
+ padding-inline: 0.3rem;
1656
+ display: inline-flex;
1657
+ align-items: center;
1658
+ justify-content: center;
1659
+ border-radius: var(--radius-full);
1660
+ background: var(--primary);
1661
+ color: var(--primary-foreground);
1662
+ font-size: var(--font-size-xs);
1663
+ font-weight: var(--font-weight-semibold);
1664
+ font-variant-numeric: tabular-nums;
1665
+ line-height: 1;
1666
+ pointer-events: none;
1667
+ }
1668
+
1622
1669
  /* Compact mode - always hide label */
1623
1670
  .dndev-interactive-label[data-display='compact'] {
1624
1671
  display: none;
@@ -3725,6 +3772,44 @@ em {
3725
3772
  object-fit: cover;
3726
3773
  }
3727
3774
 
3775
+ /* Contain: whole image visible on the muted cover background (cut-outs), inset
3776
+ proportionally so a packshot never touches the frame. */
3777
+ .dndev-card-cover[data-fit='contain'] > img:not(.dndev-card-cover-hover) {
3778
+ -o-object-fit: contain;
3779
+ object-fit: contain;
3780
+ box-sizing: border-box;
3781
+ padding: 8%;
3782
+ }
3783
+
3784
+ /* Hover view: stacked over the cover, crossfades in on hover / keyboard focus. */
3785
+ .dndev-card-cover > img.dndev-card-cover-hover {
3786
+ position: absolute;
3787
+ inset: 0;
3788
+ -o-object-fit: cover;
3789
+ object-fit: cover;
3790
+ opacity: 0;
3791
+ transition: opacity 0.4s var(--ease-in-out);
3792
+ }
3793
+
3794
+ @media (hover: hover) {
3795
+ .dndev-card:hover .dndev-card-cover-hover {
3796
+ opacity: 1;
3797
+ }
3798
+ }
3799
+
3800
+ /* Keyboard focus only: a mouse click keeps focus inside the card, which must not
3801
+ pin the hover view after the pointer leaves. */
3802
+ .dndev-card:has(:focus-visible) .dndev-card-cover-hover,
3803
+ .dndev-card:focus-visible .dndev-card-cover-hover {
3804
+ opacity: 1;
3805
+ }
3806
+
3807
+ @media (prefers-reduced-motion: reduce) {
3808
+ .dndev-card-cover > img.dndev-card-cover-hover {
3809
+ transition: none;
3810
+ }
3811
+ }
3812
+
3728
3813
  /* Consumer-supplied ReactNode: wrapper fills, inner media fills. */
3729
3814
  .dndev-card-cover-media {
3730
3815
  position: relative;
@@ -4197,6 +4282,7 @@ em {
4197
4282
  padding: var(--gap-sm) var(--gap-md);
4198
4283
  cursor: pointer;
4199
4284
  border-radius: var(--radius-interactive);
4285
+ font-weight: var(--font-weight-normal);
4200
4286
  transition: background-color var(--dur-fast) var(--ease-in-out);
4201
4287
  }
4202
4288
 
@@ -4227,7 +4313,7 @@ em {
4227
4313
  }
4228
4314
 
4229
4315
  .dndev-combobox-option-label {
4230
- font-size: var(--font-size-sm);
4316
+ font-size: var(--font-size-input);
4231
4317
  color: var(--foreground);
4232
4318
  }
4233
4319
 
@@ -5132,12 +5218,23 @@ em {
5132
5218
  margin-inline: calc(50% - 50vw);
5133
5219
  }
5134
5220
 
5135
- /* Background image with overlay for text readability */
5221
+ /* Background image with overlay for text readability.
5222
+ The photo is an <img> (discoverable by the preload scanner), laid under the scrim. */
5136
5223
  .dndev-hero-section--bg-image {
5137
5224
  position: relative;
5138
- background-size: cover;
5139
- background-position: center;
5140
- background-repeat: no-repeat;
5225
+ overflow: hidden;
5226
+ }
5227
+
5228
+ .dndev-hero-section--bg-image > .dndev-hero-section__cover {
5229
+ position: absolute;
5230
+ inset: 0;
5231
+ width: 100%;
5232
+ height: 100%;
5233
+ -o-object-fit: cover;
5234
+ object-fit: cover;
5235
+ -o-object-position: center;
5236
+ object-position: center;
5237
+ z-index: 0;
5141
5238
  }
5142
5239
 
5143
5240
  .dndev-hero-section--bg-image::before {
@@ -5149,12 +5246,22 @@ em {
5149
5246
  rgba(0, 0, 0, 0.4),
5150
5247
  rgba(0, 0, 0, 0.6)
5151
5248
  );
5152
- z-index: 0;
5249
+ z-index: 1;
5250
+ }
5251
+
5252
+ /* Soft scrim: bright photography stays bright; only the bottom band darkens
5253
+ enough for white text placed there. */
5254
+ .dndev-hero-section--bg-image[data-scrim='soft']::before {
5255
+ background: linear-gradient(
5256
+ to bottom,
5257
+ rgba(0, 0, 0, 0) 45%,
5258
+ rgba(0, 0, 0, 0.55) 100%
5259
+ );
5153
5260
  }
5154
5261
 
5155
- .dndev-hero-section--bg-image > * {
5262
+ .dndev-hero-section--bg-image > :not(.dndev-hero-section__cover) {
5156
5263
  position: relative;
5157
- z-index: 1;
5264
+ z-index: 2;
5158
5265
  }
5159
5266
 
5160
5267
  .dndev-hero-section--bg-image,
@@ -5461,6 +5568,12 @@ em {
5461
5568
  display: block;
5462
5569
  }
5463
5570
 
5571
+ .image-gallery__thumbnail-image[data-fit='contain'] {
5572
+ -o-object-fit: contain;
5573
+ object-fit: contain;
5574
+ background-color: var(--muted);
5575
+ }
5576
+
5464
5577
  /* Responsive adjustments */
5465
5578
  @media (max-width: 640px) {
5466
5579
  .image-gallery__thumbnail {
@@ -6341,7 +6454,7 @@ input[type='number'] {
6341
6454
  background-color: var(--secondary);
6342
6455
  }
6343
6456
 
6344
- .dndev-progress [data-radix-progress-indicator] {
6457
+ .dndev-progress > [data-state] {
6345
6458
  height: 100%;
6346
6459
  width: 100%;
6347
6460
  flex: 1;
@@ -6351,23 +6464,23 @@ input[type='number'] {
6351
6464
  /* Variant colors */
6352
6465
  }
6353
6466
 
6354
- [data-variant='default']:is(.dndev-progress [data-radix-progress-indicator]) {
6467
+ [data-variant='default']:is(.dndev-progress > [data-state]) {
6355
6468
  background-color: var(--primary);
6356
6469
  }
6357
6470
 
6358
- [data-variant='accent']:is(.dndev-progress [data-radix-progress-indicator]) {
6471
+ [data-variant='accent']:is(.dndev-progress > [data-state]) {
6359
6472
  background-color: var(--accent);
6360
6473
  }
6361
6474
 
6362
- [data-variant='success']:is(.dndev-progress [data-radix-progress-indicator]) {
6475
+ [data-variant='success']:is(.dndev-progress > [data-state]) {
6363
6476
  background-color: var(--success);
6364
6477
  }
6365
6478
 
6366
- [data-variant='warning']:is(.dndev-progress [data-radix-progress-indicator]) {
6479
+ [data-variant='warning']:is(.dndev-progress > [data-state]) {
6367
6480
  background-color: var(--warning);
6368
6481
  }
6369
6482
 
6370
- [data-variant='destructive']:is(.dndev-progress [data-radix-progress-indicator]) {
6483
+ [data-variant='destructive']:is(.dndev-progress > [data-state]) {
6371
6484
  background-color: var(--destructive);
6372
6485
  }
6373
6486
 
@@ -6681,39 +6794,20 @@ input[type='number'] {
6681
6794
  border-top-color: transparent;
6682
6795
  }
6683
6796
 
6684
- .dndev-select-trigger [data-radix-select-icon] {
6685
- opacity: var(--opacity-muted);
6686
- width: var(--icon-md);
6687
- height: var(--icon-md);
6688
- }
6689
-
6690
- .dndev-select-trigger [data-radix-select-value] {
6691
- font-size: var(--font-size-input);
6692
- }
6693
-
6694
6797
  .dndev-select-content {
6695
6798
  width: var(--radix-select-trigger-width);
6696
6799
  min-width: var(--radix-select-trigger-width);
6697
6800
  }
6698
6801
 
6699
- [data-radix-select-viewport] {
6700
- display: flex;
6701
- flex-direction: column;
6702
- padding: 0;
6703
- }
6704
-
6705
- .dndev-interactive[data-radix-select-item] {
6706
- width: 100%;
6707
- justify-content: flex-start;
6708
- text-align: start;
6802
+ .dndev-select-content .dndev-interactive[data-role='menu-item'] {
6803
+ font-size: var(--font-size-input);
6804
+ font-weight: var(--font-weight-normal);
6709
6805
  }
6710
6806
 
6711
- .dndev-interactive[data-radix-select-item] [data-radix-select-item-text] {
6807
+ [data-radix-select-viewport] {
6712
6808
  display: flex;
6713
6809
  flex-direction: column;
6714
- align-items: flex-start;
6715
- text-align: start;
6716
- flex: 1;
6810
+ padding: 0;
6717
6811
  }
6718
6812
 
6719
6813
  .dndev-select-item-description {
@@ -6721,20 +6815,6 @@ input[type='number'] {
6721
6815
  color: var(--muted-foreground);
6722
6816
  }
6723
6817
 
6724
- .dndev-interactive[data-radix-select-item] [data-radix-select-item-indicator] {
6725
- display: flex;
6726
- align-items: center;
6727
- justify-content: center;
6728
- color: currentColor;
6729
- }
6730
-
6731
- .dndev-interactive[data-radix-select-item]
6732
- [data-radix-select-item-indicator]
6733
- svg {
6734
- width: 1rem;
6735
- height: 1rem;
6736
- }
6737
-
6738
6818
  /* packages/components/src/atomic/ScrollArea/ScrollArea.css */
6739
6819
 
6740
6820
  .dndev-scroll-area {
@@ -7135,6 +7215,13 @@ input[type='number'] {
7135
7215
  /* Square edges for panel metaphor */
7136
7216
  }
7137
7217
 
7218
+ /* Narrow panel (carts, filters): full width on phones, a column on larger screens */
7219
+
7220
+ .dndev-sheet-content[data-size='narrow'][data-side='right'],.dndev-sheet-content[data-size='narrow'][data-side='left'] {
7221
+ width: 100%;
7222
+ max-width: 28rem;
7223
+ }
7224
+
7138
7225
  .dndev-sheet-content[data-side='right'] {
7139
7226
  /* Physical positioning: right edge */
7140
7227
  right: 0;
@@ -7874,9 +7961,9 @@ input[type='number'] {
7874
7961
  overflow: hidden;
7875
7962
  }
7876
7963
 
7877
- /* Default: show overflow when wrap is enabled (allows wrapping) */
7964
+ /* Default: show overflow when wrap is enabled (allows wrapping); interactive elements keep their own clipping */
7878
7965
 
7879
- .dndev-stack[data-direction='row'][data-wrap='wrap']:not([data-overflow]) > *,.dndev-stack[data-direction='row'][data-wrap='wrap-reverse']:not([data-overflow]) > * {
7966
+ .dndev-stack[data-direction='row'][data-wrap='wrap']:not([data-overflow]) > *:not(.dndev-interactive),.dndev-stack[data-direction='row'][data-wrap='wrap-reverse']:not([data-overflow]) > *:not(.dndev-interactive) {
7880
7967
  overflow: visible;
7881
7968
  }
7882
7969
 
@@ -8529,6 +8616,65 @@ input[type='number'] {
8529
8616
  display: none;
8530
8617
  }
8531
8618
 
8619
+ /* packages/components/src/atomic/QuantityStepper/QuantityStepper.css */
8620
+
8621
+ /* One outlined control (e-commerce standard, e.g. Shopify Dawn): borderless − / +
8622
+ buttons around a centred, tabular quantity. Same height and radius as buttons. */
8623
+ .dndev-quantity-stepper {
8624
+ display: inline-flex;
8625
+ align-items: stretch;
8626
+ min-height: var(--touch-target);
8627
+ border: var(--border-hairline) solid var(--border);
8628
+ border-radius: var(--radius-interactive);
8629
+ background: var(--interactive);
8630
+ color: var(--foreground);
8631
+ }
8632
+ .dndev-quantity-stepper[data-full-width] {
8633
+ display: flex;
8634
+ width: 100%;
8635
+ }
8636
+ .dndev-quantity-stepper[data-disabled] {
8637
+ opacity: 0.6;
8638
+ }
8639
+ .dndev-quantity-stepper > .dndev-interactive {
8640
+ flex: 0 0 auto;
8641
+ aspect-ratio: 1;
8642
+ min-height: 0;
8643
+ border: none;
8644
+ border-radius: inherit;
8645
+ background: transparent;
8646
+ }
8647
+
8648
+ .dndev-quantity-stepper-value {
8649
+ flex: 1 1 auto;
8650
+ display: flex;
8651
+ align-items: center;
8652
+ justify-content: center;
8653
+ min-width: 3ch;
8654
+ padding-inline: var(--gap-sm);
8655
+ border: none;
8656
+ background: none;
8657
+ color: inherit;
8658
+ font: inherit;
8659
+ font-weight: var(--font-weight-medium);
8660
+ font-variant-numeric: tabular-nums;
8661
+ text-align: center;
8662
+ }
8663
+
8664
+ .dndev-quantity-stepper-value:is(button) {
8665
+ cursor: pointer;
8666
+ }
8667
+
8668
+ .dndev-quantity-stepper-value:is(button):hover {
8669
+ text-decoration: underline;
8670
+ text-underline-offset: 0.2em;
8671
+ }
8672
+
8673
+ .dndev-quantity-stepper-value:is(button):focus-visible {
8674
+ outline: none;
8675
+ box-shadow: var(--shadow-focus);
8676
+ }
8677
+
8532
8678
  /* packages/components/src/atomic/Tag/Tag.css */
8533
8679
 
8534
8680
  .dndev-tag {
@@ -8715,6 +8861,9 @@ input[type='number'] {
8715
8861
 
8716
8862
  .dndev-text-base[data-level^='h'] {
8717
8863
  font-family: var(--font-headline);
8864
+ /* Display sizes need tighter leading than body copy; themes opt in with
8865
+ --line-height-heading, otherwise headings keep the text line-height. */
8866
+ line-height: var(--line-height-heading, var(--line-height));
8718
8867
 
8719
8868
  /* A single word wider than its column is the one thing text cannot solve by
8720
8869
  wrapping, and display type hits it first: uppercase, letter-spaced headings
@@ -10307,11 +10456,11 @@ input[type='number'] {
10307
10456
  /* ========== RIPPLE EFFECT ========== */
10308
10457
  @keyframes dndev-ripple {
10309
10458
  0% {
10310
- transform: translate(-50%, -50%) scale(0);
10459
+ transform: scale(0);
10311
10460
  opacity: var(--ripple-opacity);
10312
10461
  }
10313
10462
  100% {
10314
- transform: translate(-50%, -50%) scale(4);
10463
+ transform: scale(4);
10315
10464
  opacity: 0;
10316
10465
  }
10317
10466
  }
@@ -11756,6 +11905,12 @@ main[role='main'][data-routing-animation='none'] {
11756
11905
  .dndev-layout {
11757
11906
  position: relative;
11758
11907
  width: 100%;
11908
+ /* The density preset is rendered on this wrapper by the server, but <html> only
11909
+ receives it after hydration. font-size and line-height inherit as computed
11910
+ values from <body>, so re-read the density tokens here: otherwise the first
11911
+ paint uses the root defaults and text grows once <html> is updated. */
11912
+ font-size: var(--font-size-base);
11913
+ line-height: var(--line-height);
11759
11914
  height: 100vh;
11760
11915
  height: 100dvh;
11761
11916
  max-height: 100vh;
@@ -11933,7 +12088,7 @@ aside[role='navigation'].sidebar {
11933
12088
  /* Desktop presets with no sidebar: Hide sidebar element for performance/accessibility */
11934
12089
  /* Landing, Plain, Game have --sidebar-width: 0px, also need display: none */
11935
12090
  }
11936
- [data-layout='landing']:root aside.sidebar[role='navigation'],[data-layout='plain']:root aside.sidebar[role='navigation'],[data-layout='game']:root aside.sidebar[role='navigation'] {
12091
+ [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'] {
11937
12092
  display: none;
11938
12093
  }
11939
12094
  /* Moolti: Sidebar spans full height (no header/footer on desktop) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/ui",
3
- "version": "0.1.47",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "license": "MIT",
@@ -49,28 +49,29 @@
49
49
  "type-check": "bunx tsc --noEmit"
50
50
  },
51
51
  "dependencies": {
52
- "@fontsource/inter": "^5.2.8",
53
- "@fontsource/playfair-display": "^5.2.8",
54
- "@fontsource/press-start-2p": "^5.2.5",
55
- "@fontsource/roboto": "^5.2.10",
56
- "@fontsource/space-grotesk": "^5.2.10"
52
+ "@fontsource/inter": "^5.3.0",
53
+ "@fontsource/playfair-display": "^5.3.0",
54
+ "@fontsource/press-start-2p": "^5.3.0",
55
+ "@fontsource/roboto": "^5.3.0",
56
+ "@fontsource/space-grotesk": "^5.3.0",
57
+ "@tanstack/react-query-next-experimental": "5.107.1"
57
58
  },
58
59
  "peerDependencies": {
59
- "@donotdev/ai": "^0.1.44",
60
- "@donotdev/auth": "^0.1.44",
61
- "@donotdev/billing": "^0.1.44",
62
- "@donotdev/components": "^0.1.45",
63
- "@donotdev/core": "^0.1.47",
64
- "@donotdev/crud": "^0.1.45",
65
- "@donotdev/oauth": "^0.1.44",
66
- "@hookform/resolvers": "^5.2.2",
60
+ "@donotdev/ai": "^0.2.0",
61
+ "@donotdev/auth": "^0.2.1",
62
+ "@donotdev/billing": "^0.2.0",
63
+ "@donotdev/components": "^0.2.1",
64
+ "@donotdev/core": "^0.2.1",
65
+ "@donotdev/crud": "^0.2.0",
66
+ "@donotdev/oauth": "^0.2.0",
67
+ "@hookform/resolvers": "^5.9.2",
67
68
  "lucide-react": "^0.575.0",
68
- "react": "^19.2.4",
69
- "react-dom": "^19.2.4",
69
+ "react": "^19.3.1",
70
+ "react-dom": "^19.3.1",
70
71
  "react-helmet-async": "^2.0.5",
71
- "react-hook-form": "^7.71.2",
72
- "react-router-dom": "^7.13.1",
73
- "valibot": "^1.2.0"
72
+ "react-hook-form": "^7.91.0",
73
+ "react-router-dom": "^7.18.5",
74
+ "valibot": "^1.5.0"
74
75
  },
75
76
  "peerDependenciesMeta": {
76
77
  "@donotdev/ai": {
@@ -113,4 +114,4 @@
113
114
  "registry": "https://registry.npmjs.org",
114
115
  "access": "public"
115
116
  }
116
- }
117
+ }