@bytebrand/fe-ui-core-autobahn 1.0.228 → 1.0.231
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/campaign/CampaignBand.tsx +26 -26
- package/campaign/CampaignBanner.tsx +86 -0
- package/campaign/CampaignBar.tsx +37 -0
- package/campaign/CampaignHero.tsx +56 -0
- package/campaign/CampaignSwitch.tsx +43 -0
- package/campaign/campaignVars.ts +12 -12
- package/campaign/campaigns.ts +77 -74
- package/campaign/index.ts +18 -6
- package/campaign/openInApp.ts +8 -0
- package/campaign/useCountdown.ts +28 -0
- package/cards/CarCard.tsx +407 -393
- package/cards/CarCardSkeleton.tsx +103 -0
- package/cards/CarRow.tsx +46 -22
- package/cards/CarRowSkeleton.tsx +152 -0
- package/cards/cardParts.tsx +53 -18
- package/cards/dealSignals.ts +36 -36
- package/cards/index.ts +6 -0
- package/chrome/AccountMenuIcon.tsx +109 -0
- package/chrome/Footer.tsx +16 -3
- package/chrome/TopBar.tsx +139 -266
- package/compat/CookieModal/CookieModal.tsx +20 -6
- package/compat/CookieModal/Modal.tsx +6 -3
- package/compat/CookieModal/modals/ManageCookieModal/ManageCookieModal.tsx +43 -15
- package/compat/CookieModal/modals/PreviewCookieModal/PreviewCookieModal.tsx +4 -3
- package/compat/CookieModal/useModal.ts +5 -1
- package/compat/Loader/Loader.tsx +1 -7
- package/compat/MdField/MdField.tsx +28 -4
- package/compat/PriceRating/PriceRating.styl +5 -7
- package/compat/PriceRatingDetailed/PriceRatingDetailed.styl +8 -6
- package/compat/TimePicker/TimePicker.tsx +12 -2
- package/compat/legacy-theme/priceReviewColors.styl +18 -5
- package/constants/autobahn.ts +39 -0
- package/data/fieldMapping.ts +3 -3
- package/data/toAutobahnCar.ts +30 -14
- package/iconsvg/IconSVG.tsx +1 -5
- package/index.ts +19 -19
- package/locales/de/autobahn.json +925 -862
- package/locales/en/autobahn.json +925 -862
- package/package.json +2 -2
- package/theme/md3.css +16518 -11808
- package/ui/Dropdown.tsx +29 -10
- package/ui/FormCheckbox.tsx +22 -2
- package/ui/FormField.tsx +2 -1
- package/ui/Icon.tsx +6 -0
- package/ui/MfieldCheckIcon.tsx +13 -0
- package/ui/Modal.tsx +84 -6
- package/ui/Skeleton.tsx +79 -20
- package/ui/Stars.tsx +36 -18
- package/ui/StatChip.tsx +8 -3
- package/ui/index.ts +3 -0
- package/ui/ratingLink.ts +36 -0
- package/ui/scrollFieldIntoView.ts +41 -0
- package/ui/usePortalMenuPosition.ts +27 -15
- package/utils/cookieConsent.ts +84 -0
- package/utils/index.ts +10 -0
- package/vdp/FinanceCalculator.tsx +162 -34
- package/vdp/VdpModules.tsx +348 -976
- package/vdp/index.ts +6 -3
- package/vdp/types.ts +25 -15
- package/vehiclesProps/accidentDisclosure.ts +25 -0
- package/vehiclesProps/decoratedLightProps.tsx +4 -0
- package/vehiclesProps/decoratedProps.tsx +4 -0
package/vdp/index.ts
CHANGED
|
@@ -35,7 +35,6 @@ export {
|
|
|
35
35
|
Co2Label,
|
|
36
36
|
VehicleDescription,
|
|
37
37
|
TrustStrip,
|
|
38
|
-
PriceHistory,
|
|
39
38
|
ProtectionProducts,
|
|
40
39
|
VdpAnchors,
|
|
41
40
|
VdpStickyBar,
|
|
@@ -44,6 +43,9 @@ export {
|
|
|
44
43
|
HowItWorks,
|
|
45
44
|
ReviewsTeaser,
|
|
46
45
|
CustomerRatings,
|
|
46
|
+
RatingSourcesInfo,
|
|
47
|
+
ReviewSourceCaption,
|
|
48
|
+
REVIEW_LINK_REL,
|
|
47
49
|
VdpEnquiry,
|
|
48
50
|
FinanceDetailsModal,
|
|
49
51
|
} from './VdpModules';
|
|
@@ -58,7 +60,6 @@ export type {
|
|
|
58
60
|
VehicleDescriptionProps,
|
|
59
61
|
TrustStripProps,
|
|
60
62
|
TrustItem,
|
|
61
|
-
PriceHistoryProps,
|
|
62
63
|
ProtectionProductsProps,
|
|
63
64
|
ProtectionProduct,
|
|
64
65
|
VdpAnchorsProps,
|
|
@@ -70,6 +71,8 @@ export type {
|
|
|
70
71
|
HowItWorksStep,
|
|
71
72
|
ReviewsTeaserProps,
|
|
72
73
|
CustomerRatingsProps,
|
|
74
|
+
RatingSourcesInfoProps,
|
|
75
|
+
ReviewSourceCaptionProps,
|
|
73
76
|
VdpEnquiryProps,
|
|
74
77
|
FinanceDetailsModalProps,
|
|
75
78
|
} from './VdpModules';
|
|
@@ -84,9 +87,9 @@ export type {
|
|
|
84
87
|
EnergyTaxSummary,
|
|
85
88
|
Co2CostsSummary,
|
|
86
89
|
EquipmentGroups,
|
|
87
|
-
PriceHistoryPoint,
|
|
88
90
|
PriceRatingBand,
|
|
89
91
|
PriceRatingBands,
|
|
90
92
|
VdpReview,
|
|
93
|
+
RatingPortal,
|
|
91
94
|
AutobahnPhev,
|
|
92
95
|
} from './types';
|
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
|
-
//
|
|
13
|
+
// default these to placeholder numbers. The market band (marketLow / marketAvg /
|
|
14
|
+
// marketHigh) is needs-data by default.
|
|
15
15
|
|
|
16
16
|
import type { AutobahnPhev } from '../cards/types';
|
|
17
17
|
|
|
@@ -111,8 +111,8 @@ export interface Co2CostsSummary {
|
|
|
111
111
|
export interface VehicleCondition {
|
|
112
112
|
/** TÜV/HU validity, e.g. '03/2027' — or 'Neu' for a new HU. */
|
|
113
113
|
hu: string;
|
|
114
|
-
/** accident-free flag (Unfallfrei). */
|
|
115
|
-
unfallfrei: boolean;
|
|
114
|
+
/** accident-free flag (Unfallfrei); null = not specified by the source ("keine Angabe"). */
|
|
115
|
+
unfallfrei: boolean | null;
|
|
116
116
|
/** full service history (Scheckheftgepflegt). */
|
|
117
117
|
scheckheft: boolean;
|
|
118
118
|
/** warranty label, e.g. '12 Monate inkl.'. */
|
|
@@ -136,14 +136,26 @@ export interface VdpReview {
|
|
|
136
136
|
review: string;
|
|
137
137
|
/** star rating 1–5. */
|
|
138
138
|
rating: number;
|
|
139
|
+
/** portal the review was written on, e.g. "Trustpilot" (Bewertung Welt feed only). */
|
|
140
|
+
source?: string;
|
|
141
|
+
/** review date, ISO yyyy-mm-dd (Bewertung Welt feed only). */
|
|
142
|
+
date?: string;
|
|
143
|
+
/** the review on its portal (Bewertung Welt feed only; '' when unknown). */
|
|
144
|
+
url?: string;
|
|
139
145
|
}
|
|
140
146
|
|
|
141
|
-
/**
|
|
142
|
-
export interface
|
|
143
|
-
/**
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
|
|
147
|
+
/** one review portal behind the site-wide rating (Bewertung Welt `summary.portals`). */
|
|
148
|
+
export interface RatingPortal {
|
|
149
|
+
/** portal key, e.g. 'google' | 'trustpilot'. */
|
|
150
|
+
source: string;
|
|
151
|
+
/** display name, e.g. "Google". */
|
|
152
|
+
name: string;
|
|
153
|
+
/** the portal's own average (null when unknown). */
|
|
154
|
+
average: number | null;
|
|
155
|
+
/** number of reviews on the portal. */
|
|
156
|
+
total: number;
|
|
157
|
+
/** the portal's public auto.de profile — "all reviews" ('' when unknown). */
|
|
158
|
+
url?: string;
|
|
147
159
|
}
|
|
148
160
|
|
|
149
161
|
/** One [min,max] EUR band of the 5-tier Preisbewertung (mirrors legacy IRatingConfig). */
|
|
@@ -191,8 +203,8 @@ export interface VehicleDetail {
|
|
|
191
203
|
fuel: string;
|
|
192
204
|
/** gearbox label, e.g. 'Automatik' / 'Schaltgetriebe'. */
|
|
193
205
|
gear: string;
|
|
194
|
-
/** number of previous owners (rendered as 'N. Hand'). */
|
|
195
|
-
owners: number;
|
|
206
|
+
/** number of previous owners (rendered as 'N. Hand'); null = not known, the fact is not shown. */
|
|
207
|
+
owners: number | null;
|
|
196
208
|
/** number of seats. */
|
|
197
209
|
seats: number;
|
|
198
210
|
/** number of doors. */
|
|
@@ -267,8 +279,6 @@ export interface VehicleDetail {
|
|
|
267
279
|
// --- NEEDS DATA: no real source yet (NEVER fabricate) ---
|
|
268
280
|
/** original list price (for the struck-through reference + history endpoint). */
|
|
269
281
|
listPrice?: number;
|
|
270
|
-
/** price-history points (sparkline). Needs-data by default. */
|
|
271
|
-
priceHistory?: PriceHistoryPoint[];
|
|
272
282
|
/** lowest comparable market price in EUR (market band lower bound). */
|
|
273
283
|
marketLow?: number;
|
|
274
284
|
/** average comparable market price in EUR (market band reference). */
|
|
@@ -302,7 +312,7 @@ export function defaultVdpSpecs(v: VehicleDetail): VdpSpec[] {
|
|
|
302
312
|
[['cog', 'Getriebe', v.gear], true],
|
|
303
313
|
[['users', 'Sitze', `${v.seats} Sitze`], false],
|
|
304
314
|
[['door-open', 'Türen', `${v.doors} Türen`], false],
|
|
305
|
-
[['user', 'Halter', `${v.owners}. Hand`], true], // 0 Vorbesitzer is valid
|
|
315
|
+
...(v.owners == null ? [] : [[['user', 'Halter', `${v.owners}. Hand`], true] as const]), // 0 Vorbesitzer is valid
|
|
306
316
|
[['palette', 'Außenfarbe', v.color], true],
|
|
307
317
|
[['car-front', 'Karosserie', v.body], true],
|
|
308
318
|
[['droplet', 'Verbrauch komb.', v.cons], true], // Pkw-EnVKV — exempt from this rule
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// FINN handover v0.6 (Daniel, 15.10.2026): for the owners set here, accident and owner facts follow
|
|
2
|
+
// only what the source states — mainData.accidentDamaged false → accident-free, true → accident,
|
|
3
|
+
// empty → not specified; an empty owner count is not shown as "0. Hand". Every other dealer keeps
|
|
4
|
+
// the old display (accident-free unless `damaged`). The app sets the owners once at start.
|
|
5
|
+
let strictOwners: ReadonlyArray<string> = [];
|
|
6
|
+
|
|
7
|
+
export function setStrictConditionOwners(ownerIds: ReadonlyArray<string>): void {
|
|
8
|
+
strictOwners = (ownerIds || []).filter(Boolean);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function isStrictConditionOwner(car: any): boolean {
|
|
12
|
+
const ownerId = car?.metaData?.ownerId;
|
|
13
|
+
return !!ownerId && strictOwners.includes(ownerId);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type AccidentStatus = 'accidentFree' | 'accident' | 'notSpecified';
|
|
17
|
+
|
|
18
|
+
// The strict status, or undefined when the car's owner keeps the old display.
|
|
19
|
+
export function strictAccidentStatus(car: any): AccidentStatus | undefined {
|
|
20
|
+
if (!isStrictConditionOwner(car)) return undefined;
|
|
21
|
+
const value = car?.mainData?.accidentDamaged;
|
|
22
|
+
if (value === true) return 'accident';
|
|
23
|
+
if (value === false) return 'accidentFree';
|
|
24
|
+
return 'notSpecified';
|
|
25
|
+
}
|
|
@@ -6,6 +6,7 @@ import { formatTimestamp } from '../utils/DateUtils';
|
|
|
6
6
|
import { DELIVERY_PERIODS_EXTRA } from '../constants/core';
|
|
7
7
|
import moment from 'moment';
|
|
8
8
|
import { IDecoratedProp } from '../types/types';
|
|
9
|
+
import { strictAccidentStatus } from './accidentDisclosure';
|
|
9
10
|
import { gasConsumptionTemplate } from './cbdSelectors';
|
|
10
11
|
|
|
11
12
|
interface IDecoratedProps {
|
|
@@ -520,6 +521,9 @@ const getDecoratedLightProps = (
|
|
|
520
521
|
title: t('cbd:mainData_accidentDamaged'),
|
|
521
522
|
icon: 'wrench',
|
|
522
523
|
get value() {
|
|
524
|
+
const strict = strictAccidentStatus(car);
|
|
525
|
+
if (strict === 'notSpecified') return t('vehicleProps:value.na');
|
|
526
|
+
if (strict) return strict === 'accident' ? t('vehicleProps:value.damaged') : t('vehicleProps:value.accidentFree');
|
|
523
527
|
return damaged ? t('vehicleProps:value.damaged') : t('vehicleProps:value.accidentFree');
|
|
524
528
|
}
|
|
525
529
|
},
|
|
@@ -9,6 +9,7 @@ import { EMISSION_STICKERS_ICONS, WP_EMISSION_STICKERS_ICONS } from '../constant
|
|
|
9
9
|
import { DELIVERY_PERIODS_EXTRA } from '../constants';
|
|
10
10
|
import { IDecoratedProp, ICar, IFinancingUtils } from '../types/types';
|
|
11
11
|
import { getFormattedPrice } from '../utils/CommonUtils';
|
|
12
|
+
import { strictAccidentStatus } from './accidentDisclosure';
|
|
12
13
|
import { gasConsumptionTemplate } from './cbdSelectors';
|
|
13
14
|
|
|
14
15
|
const formatDeliveryPeriod = (t: (key: string, options?: object) => string, deliveryPeriod: string) => {
|
|
@@ -196,6 +197,9 @@ const getDecoratedProps = (
|
|
|
196
197
|
title: t('cbd:mainData_accidentDamaged'),
|
|
197
198
|
icon: 'wrench',
|
|
198
199
|
get value() {
|
|
200
|
+
const strict = strictAccidentStatus(car);
|
|
201
|
+
if (strict === 'notSpecified') return t('vehicleProps:value.na');
|
|
202
|
+
if (strict) return strict === 'accident' ? t('vehicleProps:value.damaged') : t('vehicleProps:value.accidentFree');
|
|
199
203
|
return damaged ? t('vehicleProps:value.damaged') : t('vehicleProps:value.accidentFree');
|
|
200
204
|
}
|
|
201
205
|
},
|