@bytebrand/fe-ui-core-autobahn 1.0.220 → 1.0.222

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.
@@ -152,7 +152,8 @@
152
152
  "and": "und",
153
153
  "allOn": "Alle Bewertungen auf {{portal}}",
154
154
  "total": "Gesamtbewertung",
155
- "weighted": "gewichteter Durchschnitt"
155
+ "weighted": "gewichteter Durchschnitt",
156
+ "info": "Wir berücksichtigen alle von {{portals}} ausge\u00adwiesenen Bewertungen seit der jeweils ersten Bewertung bis zum letzten Datenabruf. Eine eigene Prüfung, ob tat\u00adsächlich ein Kauf oder eine Nutzung erfolgt ist, findet nicht statt."
156
157
  }
157
158
  },
158
159
  "enquiry": {
@@ -152,7 +152,8 @@
152
152
  "and": "and",
153
153
  "allOn": "All reviews on {{portal}}",
154
154
  "total": "Overall rating",
155
- "weighted": "weighted average"
155
+ "weighted": "weighted average",
156
+ "info": "We take into account all reviews shown by {{portals}}, from the first review on each platform up to the latest data retrieval. We do not check ourselves whether a purchase or use actually took place."
156
157
  }
157
158
  },
158
159
  "enquiry": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core-autobahn",
3
- "version": "1.0.220",
3
+ "version": "1.0.222",
4
4
  "description": "auto.de md3 (Autobahn) design system — UI primitives, cards, chrome, VDP modules, theme CSS and locales. Ships raw TypeScript source (like fe-ui-core before it); each consumer's bundler compiles it.",
5
5
  "main": "index.ts",
6
6
  "license": "UNLICENSED",
package/theme/md3.css CHANGED
@@ -7456,6 +7456,43 @@ line-height: 31px;
7456
7456
  .md3 .vdp-stickytop--on {
7457
7457
  transform: translateY(0);
7458
7458
  }
7459
+ /* its price block (ADV-438): the rate and the purchase price share their right edge, the "ⓘ" has its
7460
+ own column after "/mtl." */
7461
+ .md3 .vdp-sticky-price {
7462
+ flex: none;
7463
+ display: grid;
7464
+ grid-template-columns: auto auto;
7465
+ column-gap: 8px;
7466
+ row-gap: 3px;
7467
+ align-items: center;
7468
+ justify-items: end;
7469
+ margin-right: 6px;
7470
+ font-size: 12px;
7471
+ font-weight: 500;
7472
+ line-height: 14px;
7473
+ color: var(--md-on-surface-variant);
7474
+ white-space: nowrap;
7475
+ }
7476
+ .md3 .vdp-sticky-rate,
7477
+ .md3 .vdp-sticky-buy {
7478
+ grid-column: 1;
7479
+ }
7480
+ .md3 .vdp-sticky-rate {
7481
+ display: flex;
7482
+ align-items: baseline;
7483
+ gap: 4px;
7484
+ }
7485
+ .md3 .vdp-sticky-rate .num {
7486
+ font-size: 20px;
7487
+ font-weight: 700;
7488
+ line-height: 23px;
7489
+ letter-spacing: -0.4px;
7490
+ color: var(--md-primary);
7491
+ }
7492
+ .md3 .vdp-sticky-price > button {
7493
+ grid-column: 2;
7494
+ grid-row: 1;
7495
+ }
7459
7496
  /* VDP: header row — title left, rating chip right */
7460
7497
  .md3 .vdp-headrow {
7461
7498
  display: flex;
@@ -10199,6 +10236,28 @@ line-height: 31px;
10199
10236
  padding: 18px 20px 22px;
10200
10237
  overflow-y: auto;
10201
10238
  }
10239
+ /* the page behind the open popup is locked, without its scrollbar (set by FinanceDetailsModal, desktop) */
10240
+ html.fin-modal-open {
10241
+ overflow: hidden;
10242
+ padding-right: var(--fin-modal-scrollbar, 0px);
10243
+ }
10244
+ html.fin-modal-open .fin-modal-scrim {
10245
+ /* where the scrollbar was: the page tint under the dimming, so no strip shows at the edge */
10246
+ background:
10247
+ linear-gradient(rgba(8, 12, 24, 0.5), rgba(8, 12, 24, 0.5)),
10248
+ linear-gradient(to left, var(--md-sc-low) var(--fin-modal-scrollbar, 0px), transparent 0);
10249
+ }
10250
+ /* takes the focus on open so the keyboard scrolls it (FinanceDetailsModal); not a control */
10251
+ .md3 .fin-modal-body:focus {
10252
+ outline: none;
10253
+ box-shadow: none !important; /* the .md3 :focus-visible ring */
10254
+ }
10255
+ @media (min-width: 601px) {
10256
+ /* at its ends it does not scroll the page behind */
10257
+ .md3 .fin-modal-body {
10258
+ overscroll-behavior: contain;
10259
+ }
10260
+ }
10202
10261
  /* Checkout's Finanzierungsdetails/Leasingdetails modal (CheckoutFinancePanelNext's cf-details
10203
10262
  button) reuses this SAME FinanceDetailsModal as the VDP page, but the rate hero + price-rating
10204
10263
  pill/bar (.fin-price-grid) would just repeat the SAME figures the cf-panel already shows above
@@ -11958,19 +12017,6 @@ color: #005CFF;
11958
12017
  background: #d4dde7;
11959
12018
  border-radius: 1px;
11960
12019
  }
11961
- /* Pricing Card / Tabs / Base Line — .cc-price only, fixed 326px inset 18px from the left
11962
- rather than the shared rule's fluid left:0/right:0 span. Scoped instead of edited in
11963
- place: .vdp-bottom-bar's own left:10px/right:10px override below (higher specificity, so
11964
- it already wins over the shared rule's left/right) doesn't set `width` — a fixed width in
11965
- the shared rule would still leak through there, and into .fin-modal-body's tabs which
11966
- have no override at all. `right: auto` makes the drop explicit rather than relying on
11967
- the left+right+width overconstraint rule (right is silently ignored once both left and
11968
- width are set) to do the right thing unremarked. */
11969
- .md3 .cc-price .fin-tabs::after {
11970
- left: 18px;
11971
- right: auto;
11972
- width: 326px;
11973
- }
11974
12020
  .md3 .fin-tab {
11975
12021
  position: relative;
11976
12022
  padding: 0;
@@ -11994,11 +12040,13 @@ color: #005CFF;
11994
12040
  }
11995
12041
  /* Pricing Card / Tabs / active-tab underline — .cc-price only. The shared rule above (also
11996
12042
  used by .vdp-bottom-bar's / .fin-modal-body's own tab bars) keeps its 115×4; only the
11997
- card's own underline (326px-wide divider below) gets the slightly slimmer 110×3. content/
12043
+ card's own underline gets the slightly slimmer 110×3. content/
11998
12044
  position/left/bottom/transform/background/border-radius/z-index still come from the base
11999
- rule above — both match the same ::after, so only width/height need repeating here. */
12045
+ rule above — both match the same ::after, so only width/height need repeating here.
12046
+ Never wider than its tab: with three tabs on a phone a tab is narrower than 110px, and the
12047
+ underline stuck out past the divider. */
12000
12048
  .md3 .cc-price .fin-tab.on::after {
12001
- width: 110px;
12049
+ width: min(110px, 100%);
12002
12050
  height: 3px;
12003
12051
  }
12004
12052
  /* no divider above the Persönliche-Beratung row on phone (Figma: the only divider in this
@@ -15334,9 +15382,11 @@ color: #005CFF;
15334
15382
  /* ==========================================================================================
15335
15383
  ADV-405 Kreditkosten-Hinweis „Achtung! Kreditaufnahme kostet Geld.“ (ui/CreditCostNotice.tsx)
15336
15384
  Verbraucherkreditreform 2026. Figma master „auto.de / Kreditkosten-Hinweis“ (Ton=Hell /
15337
- Ton=Dunkel). Panel #EEF4FF + 1px #CCDEFF, radius 12px, Lucide info 16px #005CFF before the
15338
- text. Font size/colour follow the host block's conditions line (set per host below via
15339
- --ccn-fs / --ccn-color); min. 10px. Never clipped (no nowrap/ellipsis) — legal text.
15385
+ Ton=Dunkel). ADV-439: white panel with the grey border of the CDP sections (.mcard) everywhere,
15386
+ instead of the master's #EEF4FF + #CCDEFF. Radius 12px, Lucide info 16px before the text, grey
15387
+ (auto.de 2026-11-24; the master's is #005CFF). Font size/colour follow the host block's
15388
+ conditions line (set per host below via --ccn-fs / --ccn-color); min. 10px. Never clipped (no
15389
+ nowrap/ellipsis) — legal text.
15340
15390
  ========================================================================================== */
15341
15391
  .md3 .ccn {
15342
15392
  display: flex;
@@ -15345,8 +15395,8 @@ color: #005CFF;
15345
15395
  box-sizing: border-box;
15346
15396
  margin: 0;
15347
15397
  padding: 8px 10px;
15348
- background: #EEF4FF;
15349
- border: 1px solid #CCDEFF;
15398
+ background: var(--md-sc-lowest);
15399
+ border: 1px solid var(--md-outline-variant);
15350
15400
  border-radius: 12px;
15351
15401
  font-family: Arial, Helvetica, Arimo, sans-serif;
15352
15402
  font-style: normal;
@@ -15365,7 +15415,7 @@ color: #005CFF;
15365
15415
  .md3 .ccn-icon {
15366
15416
  display: inline-flex;
15367
15417
  flex: none;
15368
- color: #005CFF;
15418
+ color: var(--md-outline);
15369
15419
  }
15370
15420
  .md3 .ccn-icon svg {
15371
15421
  display: block;
@@ -15751,13 +15801,29 @@ color: #005CFF;
15751
15801
  gap: 8px;
15752
15802
  font-size: 16px;
15753
15803
  }
15754
- .md3 .rating-sources-count {
15755
- grid-area: count;
15756
- white-space: nowrap;
15804
+ .md3 .rating-sources-count,
15805
+ .md3 .rating-sources-info > p {
15757
15806
  font-size: 13px;
15758
15807
  line-height: 18px;
15759
15808
  opacity: 0.85;
15760
15809
  }
15810
+ .md3 .rating-sources-count {
15811
+ grid-area: count;
15812
+ white-space: nowrap;
15813
+ }
15814
+ /* which reviews count and that auto.de does not verify them (ADV-440): a white box with a thin blue
15815
+ border under the total; the border takes 1px of the rows' padding, so the text lines up with them */
15816
+ .md3 .rating-sources-info {
15817
+ margin-top: 10px;
15818
+ padding: 13px 15px;
15819
+ border: 1px solid #4084d8;
15820
+ border-radius: var(--md-r-md);
15821
+ background: var(--md-sc-lowest);
15822
+ color: var(--md-on-surface);
15823
+ }
15824
+ .md3 .rating-sources-info > p {
15825
+ margin: 0;
15826
+ }
15761
15827
  .md3 .rating-sources-link,
15762
15828
  .md3 .rating-sources-note {
15763
15829
  grid-area: link;
@@ -557,18 +557,29 @@ const range = (min: number, max: number, step: number): number[] => {
557
557
  return out.length ? out : [min];
558
558
  };
559
559
 
560
+ export interface DetailsLinkProps {
561
+ label: string;
562
+ onClick: () => void;
563
+ /** only the "ⓘ": the label becomes its name and tooltip (VdpStickyBar, ADV-438). */
564
+ iconOnly?: boolean;
565
+ tabIndex?: number;
566
+ }
567
+
560
568
  /** quiet primary-colored text link (Finanzierungsdetails / Details anzeigen). */
561
- const DetailsLink: React.FunctionComponent<{ label: string; onClick: () => void }> = ({ label, onClick }) => (
569
+ export const DetailsLink: React.FunctionComponent<DetailsLinkProps> = ({ label, onClick, iconOnly, tabIndex }) => (
562
570
  <button
563
571
  type="button"
564
572
  onClick={onClick}
573
+ tabIndex={tabIndex}
574
+ {...(iconOnly ? { 'aria-label': label, title: label } : {})}
565
575
  style={{
566
576
  display: 'inline-flex',
567
577
  alignItems: 'center',
568
578
  gap: 5,
569
579
  background: 'none',
570
580
  border: 0,
571
- padding: 0,
581
+ // icon only: a 25px click area around the 15px icon that takes no space of its own
582
+ ...(iconOnly ? { padding: 5, margin: -5 } : { padding: 0 }),
572
583
  cursor: 'pointer',
573
584
  color: 'var(--md-primary)',
574
585
  font: 'inherit',
@@ -577,7 +588,7 @@ const DetailsLink: React.FunctionComponent<{ label: string; onClick: () => void
577
588
  }}
578
589
  >
579
590
  <Icon name="info" size={15} color="var(--md-primary)" />
580
- {label}
591
+ {!iconOnly && label}
581
592
  </button>
582
593
  );
583
594
 
@@ -30,7 +30,7 @@ import { CO2_CLASSES, CO2_COLORS } from '../constants';
30
30
  import { ratingTone } from '../data/toAutobahnCar';
31
31
  import { ratingLinkProps } from '../ui/ratingLink';
32
32
  import { defaultVdpSpecs, EquipmentGroups, VehicleDetail, VdpSpec, VdpReview, RatingPortal, RunningCostRow, EnergyTaxSummary } from './types';
33
- import { AddServicesTooltipBody, CalcRow, DocCheckIcon, EvalBar, EvalPill, evalPillOf, expanderBtnStyle, FinanceMode, Slider, TermChips, ToggleRow } from './FinanceCalculator';
33
+ import { AddServicesTooltipBody, CalcRow, DetailsLink, DocCheckIcon, EvalBar, EvalPill, evalPillOf, expanderBtnStyle, FinanceMode, Slider, TermChips, ToggleRow } from './FinanceCalculator';
34
34
  import { formatEur as eur, formatEurCents as eurCents, formatPct as pct } from '../utils/financeFormat';
35
35
 
36
36
  /** mileage → 'X.XXX km' (de-DE grouping). */
@@ -1010,12 +1010,19 @@ export interface VdpStickyBarProps {
1010
1010
  show: boolean;
1011
1011
  /** primary CTA click. */
1012
1012
  onSecure?: () => void;
1013
+ /** active tab of the calculator: Leasing shows the leasing rate, every other tab the financing rate. */
1014
+ mode?: FinanceMode;
1015
+ /**
1016
+ * Opens the details of the rate shown here (ADV-438): the "ⓘ" after "/mtl.", the same one as in
1017
+ * front of "Finanzierungs-Details" next to the auto.de-ID. No handler → no "ⓘ".
1018
+ */
1019
+ onShowDetails?: () => void;
1013
1020
  /** i18n function (drilled from the page). */
1014
1021
  t: TranslationFunction;
1015
1022
  }
1016
1023
 
1017
1024
  /** Desktop sticky summary bar (AS24 pattern) — docks to top, driven by `show`. */
1018
- export const VdpStickyBar: React.FunctionComponent<VdpStickyBarProps> = ({ vehicle, image, show, onSecure, t }) => (
1025
+ export const VdpStickyBar: React.FunctionComponent<VdpStickyBarProps> = ({ vehicle, image, show, onSecure, mode, onShowDetails, t }) => (
1019
1026
  <div className={'vdp-stickytop hide-mobile' + (show ? ' vdp-stickytop--on' : '')}>
1020
1027
  <div className="container" style={{ display: 'flex', alignItems: 'center', gap: 18, padding: '10px 24px' }}>
1021
1028
  <img
@@ -1039,15 +1046,21 @@ export const VdpStickyBar: React.FunctionComponent<VdpStickyBarProps> = ({ vehic
1039
1046
  {fmtKm(vehicle.km)} · {vehicle.reg} · {vehicle.gear}
1040
1047
  </div>
1041
1048
  </div>
1042
- <div style={{ textAlign: 'right', flex: 'none' }}>
1043
- <div style={{ display: 'flex', alignItems: 'baseline', gap: 4, justifyContent: 'flex-end' }}>
1044
- <span className="md-label-sm">{t('autobahn:sticky.from')}</span>
1045
- <span className="num" style={{ fontWeight: 700, fontSize: 20, color: 'var(--md-primary)', letterSpacing: '-.4px' }}>
1046
- {vehicle.monthly} €
1047
- </span>
1048
- <span className="md-label-sm">{t('autobahn:sticky.perMonth')}</span>
1049
+ <div className="vdp-sticky-price">
1050
+ <div className="vdp-sticky-rate">
1051
+ <span>{t('autobahn:sticky.from')}</span>
1052
+ <span className="num">{eur(Math.round(vehicle.monthly))} €</span>
1053
+ <span>{t('autobahn:sticky.perMonth')}</span>
1049
1054
  </div>
1050
- <div className="md-label-sm">{t('autobahn:sticky.purchasePrice', { price: eur(vehicle.price) })}</div>
1055
+ {onShowDetails && (
1056
+ <DetailsLink
1057
+ iconOnly
1058
+ label={mode === 'leasing' ? t('autobahn:finance.leasingDetails') : t('autobahn:finance.financingDetails')}
1059
+ onClick={onShowDetails}
1060
+ tabIndex={show ? undefined : -1}
1061
+ />
1062
+ )}
1063
+ <div className="vdp-sticky-buy">{t('autobahn:sticky.purchasePrice', { price: eur(vehicle.price) })}</div>
1051
1064
  </div>
1052
1065
  <Button variant="filled" icon="shield-check" style={{ flex: 'none' }} onClick={onSecure}>
1053
1066
  {t('autobahn:sticky.secureOffer')}
@@ -1536,6 +1549,36 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
1536
1549
  else animateSheetScroll(() => 0);
1537
1550
  }, [showBreakdown, scrollSheetToBreakdown, animateSheetScroll]);
1538
1551
 
1552
+ // desktop: the popup scrolls wherever the pointer is (it opens under the click, e.g. from the VDP's
1553
+ // sticky header), and by keyboard, so it takes the focus. The page behind is locked: a class on <html>
1554
+ // (md3.css), because other dialogs opened above this one set and clear the inline overflow.
1555
+ const bodyRef = React.useRef<HTMLDivElement | null>(null);
1556
+ React.useLayoutEffect(() => {
1557
+ const body = bodyRef.current;
1558
+ const scrim = sheetRef.current?.parentElement;
1559
+ if (!open || !body || !scrim || !window.matchMedia('(min-width: 601px)').matches) return;
1560
+ const html = document.documentElement;
1561
+ // the scrollbar's width stays reserved, so the page behind does not move
1562
+ html.style.setProperty('--fin-modal-scrollbar', `${window.innerWidth - html.clientWidth}px`);
1563
+ html.classList.add('fin-modal-open');
1564
+ const prevFocus = document.activeElement as HTMLElement | null;
1565
+ body.tabIndex = -1;
1566
+ body.focus({ preventScroll: true });
1567
+ const onWheel = (e: WheelEvent): void => {
1568
+ if (e.ctrlKey) return; // zoom
1569
+ if (body.contains(e.target as Node) && body.scrollHeight > body.clientHeight) return; // scrolls natively
1570
+ e.preventDefault();
1571
+ body.scrollTop += e.deltaMode === 1 ? e.deltaY * 16 : e.deltaY;
1572
+ };
1573
+ scrim.addEventListener('wheel', onWheel, { passive: false });
1574
+ return () => {
1575
+ scrim.removeEventListener('wheel', onWheel);
1576
+ html.classList.remove('fin-modal-open');
1577
+ html.style.removeProperty('--fin-modal-scrollbar');
1578
+ if (prevFocus && document.contains(prevFocus)) prevFocus.focus({ preventScroll: true });
1579
+ };
1580
+ }, [open]);
1581
+
1539
1582
  // iOS Safari (26+, "Allow Website Tinting") paints its bottom toolbar area with the page's
1540
1583
  // <meta name="theme-color"> (site-wide blue #005CCB) — under the open white sheet that showed
1541
1584
  // as a solid blue band right below the CTA. While the sheet is open, theme-color is white;
@@ -1776,7 +1819,8 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
1776
1819
  ));
1777
1820
 
1778
1821
  return (
1779
- <div className="fin-modal-scrim" onClick={onClose}>
1822
+ // the second click of a double click on what opened it must not close it again
1823
+ <div className="fin-modal-scrim" onClick={(e) => e.detail < 2 && onClose()}>
1780
1824
  <div
1781
1825
  className={
1782
1826
  'fin-modal' +
@@ -1811,7 +1855,7 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
1811
1855
  <Icon name="x" size={20} />
1812
1856
  </button>
1813
1857
  </div>
1814
- <div className="fin-modal-body">
1858
+ <div className="fin-modal-body" ref={bodyRef}>
1815
1859
  {/* ============================== DESKTOP (≥601px) — always-expanded breakdown, no tabs
1816
1860
  (the desktop .fin-calc-card owns its own tabs outside this modal) ============================== */}
1817
1861
  <div className="hide-mobile">
@@ -3194,7 +3238,8 @@ export interface RatingSourcesInfoProps {
3194
3238
  /**
3195
3239
  * "ⓘ" next to the site rating → a popup that explains it: the rating of each portal (Google,
3196
3240
  * Trustpilot) with its review count and a nofollow link to all auto.de reviews there, then the
3197
- * combined, count-weighted average that the page shows. With `children`, the rating next to the
3241
+ * combined, count-weighted average that the page shows, and a note on which reviews count and that
3242
+ * auto.de does not verify them (ADV-440). With `children`, the rating next to the
3198
3243
  * "ⓘ" opens it too (PM 2026-11-24: "link the entire area, not just the circle").
3199
3244
  */
3200
3245
  export const RatingSourcesInfo: React.FunctionComponent<RatingSourcesInfoProps> = ({ average, total, portals, size = 18, color, children, style, t }) => {
@@ -3265,6 +3310,9 @@ export const RatingSourcesInfo: React.FunctionComponent<RatingSourcesInfoProps>
3265
3310
  <span className="rating-sources-note">{t('autobahn:reviews.sources.weighted')}</span>
3266
3311
  </li>
3267
3312
  </ul>
3313
+ <div className="rating-sources-info">
3314
+ <p>{t('autobahn:reviews.sources.info', { portals: names })}</p>
3315
+ </div>
3268
3316
  </Modal>
3269
3317
  </>
3270
3318
  );