@bytebrand/fe-ui-core-autobahn 1.0.216 → 1.0.217
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 +14 -59
- package/cards/CarRow.tsx +9 -33
- package/cards/cardParts.tsx +18 -58
- package/compat/PriceRating/PriceRating.styl +7 -5
- package/compat/PriceRatingDetailed/PriceRatingDetailed.styl +6 -8
- package/compat/legacy-theme/priceReviewColors.styl +5 -18
- package/constants/app.ts +1 -11
- package/constants/autobahn.ts +0 -39
- package/constants/core.ts +1 -12
- package/data/fieldMapping.ts +3 -3
- package/data/toAutobahnCar.ts +12 -14
- package/locales/de/autobahn.json +1 -3
- package/locales/en/autobahn.json +1 -3
- package/package.json +2 -2
- package/theme/md3.css +218 -115
- package/ui/StatChip.tsx +3 -8
- package/ui/index.ts +0 -1
- package/vdp/FinanceCalculator.tsx +27 -130
- package/vdp/VdpModules.tsx +665 -66
- package/vdp/index.ts +3 -0
- package/vdp/types.ts +12 -2
- package/ui/ratingLink.ts +0 -36
package/vdp/index.ts
CHANGED
|
@@ -35,6 +35,7 @@ export {
|
|
|
35
35
|
Co2Label,
|
|
36
36
|
VehicleDescription,
|
|
37
37
|
TrustStrip,
|
|
38
|
+
PriceHistory,
|
|
38
39
|
ProtectionProducts,
|
|
39
40
|
VdpAnchors,
|
|
40
41
|
VdpStickyBar,
|
|
@@ -60,6 +61,7 @@ export type {
|
|
|
60
61
|
VehicleDescriptionProps,
|
|
61
62
|
TrustStripProps,
|
|
62
63
|
TrustItem,
|
|
64
|
+
PriceHistoryProps,
|
|
63
65
|
ProtectionProductsProps,
|
|
64
66
|
ProtectionProduct,
|
|
65
67
|
VdpAnchorsProps,
|
|
@@ -87,6 +89,7 @@ export type {
|
|
|
87
89
|
EnergyTaxSummary,
|
|
88
90
|
Co2CostsSummary,
|
|
89
91
|
EquipmentGroups,
|
|
92
|
+
PriceHistoryPoint,
|
|
90
93
|
PriceRatingBand,
|
|
91
94
|
PriceRatingBands,
|
|
92
95
|
VdpReview,
|
package/vdp/types.ts
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// (`?`) fields are ones we have NO real source for yet; they are optional ON
|
|
11
11
|
// PURPOSE so the components can detect their absence and render the
|
|
12
12
|
// NEEDS_DATA_LABEL ('Daten folgt') marker instead of a fabricated value. Never
|
|
13
|
-
// default these to placeholder numbers.
|
|
14
|
-
// marketHigh)
|
|
13
|
+
// default these to placeholder numbers. priceHistory + the market band
|
|
14
|
+
// (marketLow / marketAvg / marketHigh) are needs-data by default.
|
|
15
15
|
|
|
16
16
|
import type { AutobahnPhev } from '../cards/types';
|
|
17
17
|
|
|
@@ -158,6 +158,14 @@ export interface RatingPortal {
|
|
|
158
158
|
url?: string;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
/** One point on the price-history sparkline. */
|
|
162
|
+
export interface PriceHistoryPoint {
|
|
163
|
+
/** x-axis label, e.g. 'vor 6 Wo.' / 'heute'. */
|
|
164
|
+
label: string;
|
|
165
|
+
/** price in EUR at that point. */
|
|
166
|
+
price: number;
|
|
167
|
+
}
|
|
168
|
+
|
|
161
169
|
/** One [min,max] EUR band of the 5-tier Preisbewertung (mirrors legacy IRatingConfig). */
|
|
162
170
|
export interface PriceRatingBand {
|
|
163
171
|
min: number;
|
|
@@ -279,6 +287,8 @@ export interface VehicleDetail {
|
|
|
279
287
|
// --- NEEDS DATA: no real source yet (NEVER fabricate) ---
|
|
280
288
|
/** original list price (for the struck-through reference + history endpoint). */
|
|
281
289
|
listPrice?: number;
|
|
290
|
+
/** price-history points (sparkline). Needs-data by default. */
|
|
291
|
+
priceHistory?: PriceHistoryPoint[];
|
|
282
292
|
/** lowest comparable market price in EUR (market band lower bound). */
|
|
283
293
|
marketLow?: number;
|
|
284
294
|
/** average comparable market price in EUR (market band reference). */
|
package/ui/ratingLink.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
/** id of the VDP's "Preis & Marktwert" section (fe-main PriceMarket), where a price-rating
|
|
4
|
-
* badge leads; `PRICE_SECTION_HASH` is the URL fragment that opens a VDP scrolled to it. */
|
|
5
|
-
export const PRICE_SECTION_ID = 'vdp-preis';
|
|
6
|
-
export const PRICE_SECTION_HASH = '#' + PRICE_SECTION_ID;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Props that make a price-rating badge (and the bar next to it) a link to the VDP's
|
|
10
|
-
* "Preis & Marktwert" section: a click, Enter or Space calls `onActivate`. The event is stopped,
|
|
11
|
-
* so the card the badge sits in does not also run its own "open the car" click. The element
|
|
12
|
-
* gets the class `rating-link` (md3.css: pointer cursor, focus ring) — spread these onto it and
|
|
13
|
-
* add that class.
|
|
14
|
-
*/
|
|
15
|
-
export function ratingLinkProps(onActivate: () => void, ariaLabel: string): {
|
|
16
|
-
role: 'link';
|
|
17
|
-
tabIndex: number;
|
|
18
|
-
'aria-label': string;
|
|
19
|
-
onClick: (e: React.MouseEvent) => void;
|
|
20
|
-
onKeyDown: (e: React.KeyboardEvent) => void;
|
|
21
|
-
} {
|
|
22
|
-
const activate = (e: React.SyntheticEvent): void => {
|
|
23
|
-
e.preventDefault();
|
|
24
|
-
e.stopPropagation();
|
|
25
|
-
onActivate();
|
|
26
|
-
};
|
|
27
|
-
return {
|
|
28
|
-
role: 'link',
|
|
29
|
-
tabIndex: 0,
|
|
30
|
-
'aria-label': ariaLabel,
|
|
31
|
-
onClick: activate,
|
|
32
|
-
onKeyDown: (e: React.KeyboardEvent) => {
|
|
33
|
-
if (e.key === 'Enter' || e.key === ' ') activate(e);
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
}
|