@bytebrand/fe-ui-core-autobahn 1.0.34 → 1.0.36

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core-autobahn",
3
- "version": "1.0.34",
3
+ "version": "1.0.36",
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
@@ -1203,6 +1203,11 @@
1203
1203
  /* UVP (struck list price) — cash mode only */
1204
1204
  .md3 .fin-kauf { margin-top: 8px; font-size: 13px; color: var(--md-on-surface-variant); }
1205
1205
  .md3 .fin-kauf s { color: var(--md-error); }
1206
+ /* struck old rate / list price next to the hero figure (Figma "329 € 4̶9̶9̶ ̶€̶ / mtl.") —
1207
+ REAL isStrikeShown-gated data; used in the offer card, the Rate-anpassen sheet and the
1208
+ sticky bottom bar, all payment modes. */
1209
+ .md3 .fin-rate-old { font-size: 15px; font-weight: 700; color: var(--md-error);
1210
+ text-decoration: line-through; letter-spacing: 0; flex: none; }
1206
1211
  /* condition summary — left cell of row 2 in fin-price-grid */
1207
1212
  .md3 .fin-cond { min-width: 0; font-size: 12.5px; color: var(--md-on-surface-variant); }
1208
1213
  /* Rate-edit (Rate anpassen) sits between the rate and the CTA now */
@@ -1607,6 +1612,8 @@
1607
1612
  .md3 .fin-info { margin-top: 10px; padding-top: 10px; }
1608
1613
  /* mockup hero rate is a notch bigger on phone (inline style says 48 — hence !important) */
1609
1614
  .md3 .fin-rate-main .num { font-size: 52px !important; letter-spacing: -1.5px !important; }
1615
+ /* the struck old figure must NOT inherit the 52px hero size */
1616
+ .md3 .fin-rate-main .fin-rate-old { font-size: 15px !important; letter-spacing: 0 !important; }
1610
1617
  /* narrower rating column (figma bar is 115px) frees room for the bigger rate; let the
1611
1618
  € /mtl. suffix wrap under the number instead of pushing the grid wide on 4-digit rates */
1612
1619
  .md3 .fin-price-grid { grid-template-columns: minmax(0, 1fr) 112px; }
@@ -126,6 +126,9 @@ export interface FinanceCalculatorProps {
126
126
  ratingLabel?: string;
127
127
  /** computed monthly rate in EUR for the current mode — supplied, NOT computed here. */
128
128
  monthly: number;
129
+ /** struck old monthly rate (fe-financing oldMonthlyInstallment, isStrikeShown-gated) —
130
+ * rendered as the red line-through figure next to the hero rate (fin/leasing only). */
131
+ oldMonthly?: number;
129
132
  /** effective annual rate (%) for the current mode — supplied, NOT computed here. */
130
133
  apr: number;
131
134
  /** current down payment in EUR (controlled). */
@@ -228,6 +231,7 @@ const FinanceCalculator: React.FunctionComponent<FinanceCalculatorProps> = ({
228
231
  autoDeId,
229
232
  ratingLabel,
230
233
  monthly,
234
+ oldMonthly,
231
235
  down,
232
236
  term,
233
237
  downMin,
@@ -341,6 +345,11 @@ const FinanceCalculator: React.FunctionComponent<FinanceCalculatorProps> = ({
341
345
  <span className="md-body-sm" style={{ fontWeight: 600 }}>
342
346
  {isCash ? '€' : `€ ${t('autobahn:finance.perMonth')}`}
343
347
  </span>
348
+ {/* struck old rate (REAL oldMonthlyInstallment; SRP strikes the same source) —
349
+ after the unit, else the unit wraps under the hero figure on phones */}
350
+ {!isCash && oldMonthly != null && (
351
+ <s className="num fin-rate-old">{eur(Math.round(oldMonthly))} €</s>
352
+ )}
344
353
  </div>
345
354
  {isCash && <div className="md-label-sm">{t('autobahn:finance.fixedPrice')}</div>}
346
355
  {isCash && showStrike && (
@@ -968,6 +968,8 @@ export interface VdpBottomBarProps {
968
968
  onModeChange?: (mode: FinanceMode) => void;
969
969
  /** monthly rate for the CURRENT mode (fin/leasing differ); falls back to vehicle.monthly. */
970
970
  monthly?: number;
971
+ /** struck old rate (oldMonthlyInstallment, isStrikeShown-gated) — Figma sticky footer strike. */
972
+ oldMonthly?: number;
971
973
  /** price-rating label — drives the eval pill + gradient bar (same as the offer card). */
972
974
  ratingLabel?: string;
973
975
  /** primary CTA click. */
@@ -989,6 +991,7 @@ export const VdpBottomBar: React.FunctionComponent<VdpBottomBarProps> = ({
989
991
  mode = 'fin',
990
992
  onModeChange,
991
993
  monthly,
994
+ oldMonthly,
992
995
  ratingLabel,
993
996
  onSecure,
994
997
  onCall,
@@ -1028,6 +1031,11 @@ export const VdpBottomBar: React.FunctionComponent<VdpBottomBarProps> = ({
1028
1031
  <span className="num" style={{ fontWeight: 800, fontSize: 30, color: 'var(--md-primary)', letterSpacing: '-1px' }}>
1029
1032
  {isCash ? eur(vehicle.price) : eur(Math.round(rate))} €
1030
1033
  </span>
1034
+ {/* struck old rate / list price (REAL isStrikeShown-gated figures, per Figma sticky footer) */}
1035
+ {!isCash && oldMonthly != null && <s className="num fin-rate-old">{eur(Math.round(oldMonthly))} €</s>}
1036
+ {isCash && vehicle.listPrice != null && vehicle.listPrice > vehicle.price && (
1037
+ <s className="num fin-rate-old">{eur(vehicle.listPrice)} €</s>
1038
+ )}
1031
1039
  <span className="md-label-sm" style={{ fontWeight: 600 }}>
1032
1040
  {isCash ? t('autobahn:finance.fixedPrice') : `${t('autobahn:finance.exampleLabel')} ${t('autobahn:bottom.perMonth')}`}
1033
1041
  </span>
@@ -1146,6 +1154,8 @@ export interface FinanceDetailsModalProps {
1146
1154
  vehicleName?: string;
1147
1155
  price: number;
1148
1156
  monthly: number;
1157
+ /** struck old rate (oldMonthlyInstallment, isStrikeShown-gated) — red line-through next to the rate. */
1158
+ oldMonthly?: number;
1149
1159
  apr: number;
1150
1160
  down: number;
1151
1161
  term: number;
@@ -1211,6 +1221,7 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
1211
1221
  vehicleName,
1212
1222
  price,
1213
1223
  monthly,
1224
+ oldMonthly,
1214
1225
  apr,
1215
1226
  down,
1216
1227
  term,
@@ -1338,7 +1349,7 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
1338
1349
  <div className="hide-mobile">
1339
1350
  <div style={{ display: 'flex', alignItems: 'baseline', gap: 6, marginBottom: 14 }}>
1340
1351
  <span className="num" style={{ fontSize: 34, fontWeight: 800, color: 'var(--md-primary)', letterSpacing: '-1px' }}>
1341
- {eur(monthly)} €
1352
+ {eur(monthly)} €{oldMonthly != null && <> <s className="fin-rate-old">{eur(Math.round(oldMonthly))} €</s></>}
1342
1353
  </span>
1343
1354
  <span className="md-label-sm">{t('autobahn:finance.perMonth')}</span>
1344
1355
  </div>
@@ -1428,6 +1439,9 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
1428
1439
  <span className="md-body-sm" style={{ fontWeight: 600 }}>
1429
1440
  {isCash ? '€' : `€ ${t('autobahn:finance.perMonth')}`}
1430
1441
  </span>
1442
+ {!isCash && oldMonthly != null && (
1443
+ <s className="num fin-rate-old">{eur(Math.round(oldMonthly))} €</s>
1444
+ )}
1431
1445
  </div>
1432
1446
  </div>
1433
1447
  <div>