@bytebrand/fe-ui-core-autobahn 1.0.76 → 1.0.77
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 +15 -15
- package/cards/cardParts.tsx +29 -0
- package/cards/index.ts +2 -0
- package/cards/types.ts +6 -0
- package/data/toAutobahnCar.ts +4 -0
- package/package.json +1 -1
package/cards/CarCard.tsx
CHANGED
|
@@ -22,6 +22,7 @@ import { CardCarousel, IconButton, SaveChip, Button } from '../ui';
|
|
|
22
22
|
import {
|
|
23
23
|
SpecLine,
|
|
24
24
|
EcoLine,
|
|
25
|
+
SeoLine,
|
|
25
26
|
DropChip,
|
|
26
27
|
PercentChip,
|
|
27
28
|
ZeroDownChip,
|
|
@@ -207,21 +208,6 @@ const CarCard: React.FunctionComponent<CarCardProps> = ({
|
|
|
207
208
|
t={t}
|
|
208
209
|
/>
|
|
209
210
|
</div>
|
|
210
|
-
{/* Mobile-only row (CardCtaRow itself carries the show-mobile class) — always
|
|
211
|
-
rendered, with real fallbacks the page can override once it wires its own
|
|
212
|
-
handlers (e.g. the "Rate anpassen" FinanceDetailsModal sheet). Never hidden. */}
|
|
213
|
-
<CardCtaRow
|
|
214
|
-
car={car}
|
|
215
|
-
mode={mode}
|
|
216
|
-
onRequestOffer={onRequestOffer || (() => onOpen(car))}
|
|
217
|
-
onCall={onCall || callDealerSalesPhone}
|
|
218
|
-
onOpenRateAdjust={onOpenRateAdjust || (() => onOpen(car))}
|
|
219
|
-
t={t}
|
|
220
|
-
/>
|
|
221
|
-
{/* EcoLine after the CTA row (not before): on mobile — where CardCtaRow actually
|
|
222
|
-
renders — the Figma card puts the Pkw-EnVKV legal line last, below the buttons.
|
|
223
|
-
On desktop CardCtaRow is display:none (.show-mobile), so this reorder is a no-op
|
|
224
|
-
there — EcoLine was already the last visible element on desktop either way. */}
|
|
225
211
|
<EcoLine
|
|
226
212
|
t={t}
|
|
227
213
|
car={car}
|
|
@@ -236,6 +222,20 @@ const CarCard: React.FunctionComponent<CarCardProps> = ({
|
|
|
236
222
|
color: '#0e2238',
|
|
237
223
|
}}
|
|
238
224
|
/>
|
|
225
|
+
{/* Mobile-only row (CardCtaRow itself carries the show-mobile class) — always
|
|
226
|
+
rendered, with real fallbacks the page can override once it wires its own
|
|
227
|
+
handlers (e.g. the "Rate anpassen" FinanceDetailsModal sheet). Never hidden. */}
|
|
228
|
+
<CardCtaRow
|
|
229
|
+
car={car}
|
|
230
|
+
mode={mode}
|
|
231
|
+
onRequestOffer={onRequestOffer || (() => onOpen(car))}
|
|
232
|
+
onCall={onCall || callDealerSalesPhone}
|
|
233
|
+
onOpenRateAdjust={onOpenRateAdjust || (() => onOpen(car))}
|
|
234
|
+
t={t}
|
|
235
|
+
/>
|
|
236
|
+
{/* legacy VehicleSmallCard's "SeoText" footer line (full spec + equipment list) —
|
|
237
|
+
renders nothing when the caller hasn't populated car.seoText. */}
|
|
238
|
+
<SeoLine car={car} style={{ marginTop: 6 }} />
|
|
239
239
|
{adminAction && (
|
|
240
240
|
<div style={{ marginTop: 8 }}>
|
|
241
241
|
<Button
|
package/cards/cardParts.tsx
CHANGED
|
@@ -352,6 +352,35 @@ export const EcoLine: React.FunctionComponent<EcoLineProps> = ({ car, style, t }
|
|
|
352
352
|
);
|
|
353
353
|
};
|
|
354
354
|
|
|
355
|
+
export interface SeoLineProps {
|
|
356
|
+
car: AutobahnCar;
|
|
357
|
+
style?: React.CSSProperties;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Full spec + equipment footer line (fuel, category, gearbox, colour, condition, drive
|
|
362
|
+
* type, then every equipment highlight) — the small gray text under the card's CTA row,
|
|
363
|
+
* same field/format as the legacy VehicleSmallCard's SeoText. Renders nothing without
|
|
364
|
+
* `car.seoText` (needs-data: only fe-landing currently populates it).
|
|
365
|
+
*/
|
|
366
|
+
export const SeoLine: React.FunctionComponent<SeoLineProps> = ({ car, style }) => {
|
|
367
|
+
if (!car.seoText) return null;
|
|
368
|
+
return (
|
|
369
|
+
<div
|
|
370
|
+
style={{
|
|
371
|
+
fontSize: 10,
|
|
372
|
+
lineHeight: '14px',
|
|
373
|
+
color: 'var(--md-on-surface-variant)',
|
|
374
|
+
maxHeight: 42,
|
|
375
|
+
overflow: 'hidden',
|
|
376
|
+
...style,
|
|
377
|
+
}}
|
|
378
|
+
>
|
|
379
|
+
{car.seoText}
|
|
380
|
+
</div>
|
|
381
|
+
);
|
|
382
|
+
};
|
|
383
|
+
|
|
355
384
|
export interface PricePathsProps {
|
|
356
385
|
car: AutobahnCar;
|
|
357
386
|
t: TranslationFunction;
|
package/cards/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ export {
|
|
|
18
18
|
PriceBlock,
|
|
19
19
|
DropChip,
|
|
20
20
|
EcoLine,
|
|
21
|
+
SeoLine,
|
|
21
22
|
PricePaths,
|
|
22
23
|
PriceKauf,
|
|
23
24
|
PriceMeter,
|
|
@@ -40,6 +41,7 @@ export type {
|
|
|
40
41
|
PriceBlockProps,
|
|
41
42
|
DropChipProps,
|
|
42
43
|
EcoLineProps,
|
|
44
|
+
SeoLineProps,
|
|
43
45
|
PricePathsProps,
|
|
44
46
|
PpActivityProps,
|
|
45
47
|
GalleryBadgesProps,
|
package/cards/types.ts
CHANGED
|
@@ -92,6 +92,12 @@ export interface AutobahnCar {
|
|
|
92
92
|
// --- trust / features (always real) ---
|
|
93
93
|
/** equipment highlight chips (first few are shown on the row card). */
|
|
94
94
|
features: string[];
|
|
95
|
+
/** full comma-joined spec + equipment line (fuel, category, gearbox, color, condition,
|
|
96
|
+
* drive type, then every highlight) — the small gray footer line under the card's CTA
|
|
97
|
+
* row, same field/format as the legacy VehicleSmallCard's SeoText. Optional: only
|
|
98
|
+
* callers that already build this string (fe-landing's transformSearchResultItem)
|
|
99
|
+
* populate it; others simply don't render the line. */
|
|
100
|
+
seoText?: string;
|
|
95
101
|
/** price rating tone: 'fair' → warn pill, anything else → good pill. */
|
|
96
102
|
rating: string;
|
|
97
103
|
/** price rating label shown in the pill, e.g. 'Guter Preis'. */
|
package/data/toAutobahnCar.ts
CHANGED
|
@@ -476,6 +476,10 @@ export function toAutobahnCar(storeCar: any, deps: ToAutobahnCarDeps = {}): Auto
|
|
|
476
476
|
ratingLabel,
|
|
477
477
|
|
|
478
478
|
// optional (only when real)
|
|
479
|
+
// full spec+equipment footer line — pass through as-is when the caller already built it
|
|
480
|
+
// (fe-landing's transformSearchResultItem); no fallback assembly here, since the exact
|
|
481
|
+
// seoFields/highlights order is caller-specific (see AutobahnCar.seoText's own comment).
|
|
482
|
+
...(typeof (storeCar as any).seoText === 'string' && (storeCar as any).seoText ? { seoText: (storeCar as any).seoText } : {}),
|
|
479
483
|
...(listPrice != null ? { listPrice } : {}),
|
|
480
484
|
...(savings != null ? { savings } : {}),
|
|
481
485
|
...(oldMonthly != null && oldMonthly > monthly ? { oldMonthly } : {}),
|
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.77",
|
|
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",
|