@bytebrand/fe-ui-core-autobahn 1.0.147 → 1.0.148
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/cards/CarCard.tsx +32 -18
- package/package.json +1 -1
- package/theme/md3.css +15 -0
package/cards/CarCard.tsx
CHANGED
|
@@ -157,6 +157,8 @@ const CarCard: React.FunctionComponent<CarCardProps> = ({
|
|
|
157
157
|
// active that's already 3, so NEU is dropped rather than causing a 4th to overflow.
|
|
158
158
|
const activeDealChips = [showDrop || showSave, showPct, !!car.zeroDown].filter(Boolean).length;
|
|
159
159
|
const showNeu = asGoodAsNew && car.isNew && activeDealChips < 3;
|
|
160
|
+
// tabs the price block can switch to (PriceTabs shows Leasing only when the car has a lease rate)
|
|
161
|
+
const paymentModes: PaymentMode[] = car.lease != null ? ['financing', 'leasing', 'buy'] : ['financing', 'buy'];
|
|
160
162
|
return (
|
|
161
163
|
<article
|
|
162
164
|
className="mcard mcard--interactive cc-card"
|
|
@@ -277,7 +279,21 @@ const CarCard: React.FunctionComponent<CarCardProps> = ({
|
|
|
277
279
|
<div className="cc-price" style={{ marginTop: 0, borderTop: '1px solid var(--md-outline-variant)' }}>
|
|
278
280
|
<PriceTabs car={car} mode={mode} onModeChange={setMode} t={t} />
|
|
279
281
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8, marginTop: 10 }}>
|
|
280
|
-
|
|
282
|
+
{/* every tab's hero stacked in one grid cell (.cc-hero-stack), only the active one
|
|
283
|
+
visible, bottom-aligned — Kaufen's struck list price sits on its own line above
|
|
284
|
+
the price, so without this the row (and the card) grew/shrank by that line on
|
|
285
|
+
every tab switch. Same trick as .cc-terms-stack below. */}
|
|
286
|
+
<div className="cc-hero-stack">
|
|
287
|
+
{paymentModes.map((m) => (
|
|
288
|
+
<div
|
|
289
|
+
key={m}
|
|
290
|
+
className={'cc-hero-slot' + (m === mode ? '' : ' cc-hero-slot--hidden')}
|
|
291
|
+
aria-hidden={m === mode ? undefined : true}
|
|
292
|
+
>
|
|
293
|
+
<PriceHero car={car} mode={m} t={t} alwaysShowUnit />
|
|
294
|
+
</div>
|
|
295
|
+
))}
|
|
296
|
+
</div>
|
|
281
297
|
<PriceEvalCol car={car} t={t} />
|
|
282
298
|
</div>
|
|
283
299
|
{/* same fallback CardCtaRow already uses below: pages that haven't wired a real
|
|
@@ -287,23 +303,21 @@ const CarCard: React.FunctionComponent<CarCardProps> = ({
|
|
|
287
303
|
card keeps one height across Finanzierung/Leasing/Kaufen (Leasing's longer line
|
|
288
304
|
wraps to 2 lines on narrow phones). No change to the visible line itself. */}
|
|
289
305
|
<div className="cc-terms-stack">
|
|
290
|
-
{(
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
</div>
|
|
306
|
-
))}
|
|
306
|
+
{paymentModes.map((m) => (
|
|
307
|
+
<div
|
|
308
|
+
key={m}
|
|
309
|
+
className={'cc-terms-slot' + (m === mode ? '' : ' cc-terms-slot--hidden')}
|
|
310
|
+
aria-hidden={m === mode ? undefined : true}
|
|
311
|
+
>
|
|
312
|
+
<PriceTerms
|
|
313
|
+
car={car}
|
|
314
|
+
mode={m}
|
|
315
|
+
onOpenRateAdjust={onOpenRateAdjust || (() => onOpen(car))}
|
|
316
|
+
onShowDetails={onShowFinancingDetails ? () => onShowFinancingDetails(car, m) : undefined}
|
|
317
|
+
t={t}
|
|
318
|
+
/>
|
|
319
|
+
</div>
|
|
320
|
+
))}
|
|
307
321
|
</div>
|
|
308
322
|
</div>
|
|
309
323
|
{/* Mobile-only row (CardCtaRow itself carries the show-mobile class) — always
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/fe-ui-core-autobahn",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.148",
|
|
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
|
@@ -5556,6 +5556,21 @@ line-height: 31px;
|
|
|
5556
5556
|
/* financing/leasing terms line + "Finanzierungsdetails"/"Leasingdetails" link (PriceTerms in
|
|
5557
5557
|
cardParts.tsx), full-width under the price/rating row. Same quiet typography as .pp-hero-terms
|
|
5558
5558
|
(PricePaths); the link resets button chrome and reuses the primary color so it reads as tappable. */
|
|
5559
|
+
/* CarCard: all tabs' price heroes stacked in one grid cell, only the active one visible,
|
|
5560
|
+
bottom-aligned (the price figure stays put) — Kaufen's struck list price adds a line above the
|
|
5561
|
+
price, which otherwise grew/shrank the price row on every tab switch. The cell is as wide as
|
|
5562
|
+
the WIDEST hero (no min-width: 0 — same auto min-width the lone hero had), so the "Guter
|
|
5563
|
+
Preis" column next to it also keeps one position on every tab. */
|
|
5564
|
+
.md3 .cc-hero-stack {
|
|
5565
|
+
display: grid;
|
|
5566
|
+
}
|
|
5567
|
+
.md3 .cc-hero-slot {
|
|
5568
|
+
grid-area: 1 / 1;
|
|
5569
|
+
align-self: end;
|
|
5570
|
+
}
|
|
5571
|
+
.md3 .cc-hero-slot--hidden {
|
|
5572
|
+
visibility: hidden;
|
|
5573
|
+
}
|
|
5559
5574
|
/* CarCard: all tabs' terms lines stacked in one grid cell, only the active one visible — the
|
|
5560
5575
|
cell takes the tallest line's height so switching tabs never changes the card's height. */
|
|
5561
5576
|
.md3 .cc-terms-stack {
|