@bytebrand/fe-ui-core-autobahn 1.0.226 → 1.0.228
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 -0
- package/campaign/campaignVars.ts +12 -0
- package/campaign/campaigns.ts +74 -0
- package/campaign/index.ts +6 -0
- package/cards/CarCard.tsx +393 -366
- package/cards/CarRow.tsx +8 -28
- package/cards/cardParts.tsx +23 -48
- package/cards/dealSignals.ts +36 -0
- package/cards/index.ts +0 -6
- package/chrome/Footer.tsx +3 -16
- package/chrome/TopBar.tsx +266 -139
- package/compat/CookieModal/CookieModal.tsx +6 -20
- package/compat/CookieModal/Modal.tsx +3 -6
- package/compat/CookieModal/modals/ManageCookieModal/ManageCookieModal.tsx +15 -43
- package/compat/CookieModal/modals/PreviewCookieModal/PreviewCookieModal.tsx +3 -4
- package/compat/CookieModal/useModal.ts +1 -5
- package/compat/Loader/Loader.tsx +7 -1
- package/compat/MdField/MdField.tsx +4 -28
- package/compat/PriceRating/PriceRating.styl +7 -5
- package/compat/PriceRatingDetailed/PriceRatingDetailed.styl +6 -8
- package/compat/TimePicker/TimePicker.tsx +2 -12
- package/compat/legacy-theme/priceReviewColors.styl +5 -18
- package/constants/app.ts +11 -1
- package/constants/autobahn.ts +0 -39
- package/constants/core.ts +12 -1
- package/data/fieldMapping.ts +3 -3
- package/data/toAutobahnCar.ts +14 -30
- package/iconsvg/IconSVG.tsx +5 -1
- package/index.ts +19 -18
- package/locales/de/autobahn.json +862 -903
- package/locales/en/autobahn.json +862 -903
- package/package.json +2 -2
- package/theme/md3.css +11808 -15866
- package/ui/Dropdown.tsx +10 -29
- package/ui/FormCheckbox.tsx +2 -22
- package/ui/FormField.tsx +1 -2
- package/ui/Icon.tsx +0 -6
- package/ui/Modal.tsx +6 -84
- package/ui/Skeleton.tsx +20 -79
- package/ui/Stars.tsx +18 -36
- package/ui/StatChip.tsx +3 -8
- package/ui/index.ts +0 -3
- package/ui/usePortalMenuPosition.ts +15 -27
- package/utils/index.ts +0 -10
- package/vdp/FinanceCalculator.tsx +34 -162
- package/vdp/VdpModules.tsx +976 -348
- package/vdp/index.ts +3 -6
- package/vdp/types.ts +15 -25
- package/vehiclesProps/decoratedLightProps.tsx +0 -4
- package/vehiclesProps/decoratedProps.tsx +0 -4
- package/cards/CarCardSkeleton.tsx +0 -103
- package/cards/CarRowSkeleton.tsx +0 -152
- package/chrome/AccountMenuIcon.tsx +0 -109
- package/ui/MfieldCheckIcon.tsx +0 -13
- package/ui/ratingLink.ts +0 -36
- package/ui/scrollFieldIntoView.ts +0 -41
- package/utils/cookieConsent.ts +0 -84
- package/vehiclesProps/accidentDisclosure.ts +0 -25
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,
|
|
@@ -43,9 +44,6 @@ export {
|
|
|
43
44
|
HowItWorks,
|
|
44
45
|
ReviewsTeaser,
|
|
45
46
|
CustomerRatings,
|
|
46
|
-
RatingSourcesInfo,
|
|
47
|
-
ReviewSourceCaption,
|
|
48
|
-
REVIEW_LINK_REL,
|
|
49
47
|
VdpEnquiry,
|
|
50
48
|
FinanceDetailsModal,
|
|
51
49
|
} from './VdpModules';
|
|
@@ -60,6 +58,7 @@ export type {
|
|
|
60
58
|
VehicleDescriptionProps,
|
|
61
59
|
TrustStripProps,
|
|
62
60
|
TrustItem,
|
|
61
|
+
PriceHistoryProps,
|
|
63
62
|
ProtectionProductsProps,
|
|
64
63
|
ProtectionProduct,
|
|
65
64
|
VdpAnchorsProps,
|
|
@@ -71,8 +70,6 @@ export type {
|
|
|
71
70
|
HowItWorksStep,
|
|
72
71
|
ReviewsTeaserProps,
|
|
73
72
|
CustomerRatingsProps,
|
|
74
|
-
RatingSourcesInfoProps,
|
|
75
|
-
ReviewSourceCaptionProps,
|
|
76
73
|
VdpEnquiryProps,
|
|
77
74
|
FinanceDetailsModalProps,
|
|
78
75
|
} from './VdpModules';
|
|
@@ -87,9 +84,9 @@ export type {
|
|
|
87
84
|
EnergyTaxSummary,
|
|
88
85
|
Co2CostsSummary,
|
|
89
86
|
EquipmentGroups,
|
|
87
|
+
PriceHistoryPoint,
|
|
90
88
|
PriceRatingBand,
|
|
91
89
|
PriceRatingBands,
|
|
92
90
|
VdpReview,
|
|
93
|
-
RatingPortal,
|
|
94
91
|
AutobahnPhev,
|
|
95
92
|
} 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
|
-
// 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
|
|
|
@@ -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). */
|
|
115
|
+
unfallfrei: boolean;
|
|
116
116
|
/** full service history (Scheckheftgepflegt). */
|
|
117
117
|
scheckheft: boolean;
|
|
118
118
|
/** warranty label, e.g. '12 Monate inkl.'. */
|
|
@@ -136,26 +136,14 @@ 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;
|
|
145
139
|
}
|
|
146
140
|
|
|
147
|
-
/**
|
|
148
|
-
export interface
|
|
149
|
-
/**
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
|
|
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;
|
|
141
|
+
/** One point on the price-history sparkline. */
|
|
142
|
+
export interface PriceHistoryPoint {
|
|
143
|
+
/** x-axis label, e.g. 'vor 6 Wo.' / 'heute'. */
|
|
144
|
+
label: string;
|
|
145
|
+
/** price in EUR at that point. */
|
|
146
|
+
price: number;
|
|
159
147
|
}
|
|
160
148
|
|
|
161
149
|
/** One [min,max] EUR band of the 5-tier Preisbewertung (mirrors legacy IRatingConfig). */
|
|
@@ -203,8 +191,8 @@ export interface VehicleDetail {
|
|
|
203
191
|
fuel: string;
|
|
204
192
|
/** gearbox label, e.g. 'Automatik' / 'Schaltgetriebe'. */
|
|
205
193
|
gear: string;
|
|
206
|
-
/** number of previous owners (rendered as 'N. Hand')
|
|
207
|
-
owners: number
|
|
194
|
+
/** number of previous owners (rendered as 'N. Hand'). */
|
|
195
|
+
owners: number;
|
|
208
196
|
/** number of seats. */
|
|
209
197
|
seats: number;
|
|
210
198
|
/** number of doors. */
|
|
@@ -279,6 +267,8 @@ export interface VehicleDetail {
|
|
|
279
267
|
// --- NEEDS DATA: no real source yet (NEVER fabricate) ---
|
|
280
268
|
/** original list price (for the struck-through reference + history endpoint). */
|
|
281
269
|
listPrice?: number;
|
|
270
|
+
/** price-history points (sparkline). Needs-data by default. */
|
|
271
|
+
priceHistory?: PriceHistoryPoint[];
|
|
282
272
|
/** lowest comparable market price in EUR (market band lower bound). */
|
|
283
273
|
marketLow?: number;
|
|
284
274
|
/** average comparable market price in EUR (market band reference). */
|
|
@@ -312,7 +302,7 @@ export function defaultVdpSpecs(v: VehicleDetail): VdpSpec[] {
|
|
|
312
302
|
[['cog', 'Getriebe', v.gear], true],
|
|
313
303
|
[['users', 'Sitze', `${v.seats} Sitze`], false],
|
|
314
304
|
[['door-open', 'Türen', `${v.doors} Türen`], false],
|
|
315
|
-
|
|
305
|
+
[['user', 'Halter', `${v.owners}. Hand`], true], // 0 Vorbesitzer is valid
|
|
316
306
|
[['palette', 'Außenfarbe', v.color], true],
|
|
317
307
|
[['car-front', 'Karosserie', v.body], true],
|
|
318
308
|
[['droplet', 'Verbrauch komb.', v.cons], true], // Pkw-EnVKV — exempt from this rule
|
|
@@ -6,7 +6,6 @@ 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';
|
|
10
9
|
import { gasConsumptionTemplate } from './cbdSelectors';
|
|
11
10
|
|
|
12
11
|
interface IDecoratedProps {
|
|
@@ -521,9 +520,6 @@ const getDecoratedLightProps = (
|
|
|
521
520
|
title: t('cbd:mainData_accidentDamaged'),
|
|
522
521
|
icon: 'wrench',
|
|
523
522
|
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');
|
|
527
523
|
return damaged ? t('vehicleProps:value.damaged') : t('vehicleProps:value.accidentFree');
|
|
528
524
|
}
|
|
529
525
|
},
|
|
@@ -9,7 +9,6 @@ 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';
|
|
13
12
|
import { gasConsumptionTemplate } from './cbdSelectors';
|
|
14
13
|
|
|
15
14
|
const formatDeliveryPeriod = (t: (key: string, options?: object) => string, deliveryPeriod: string) => {
|
|
@@ -197,9 +196,6 @@ const getDecoratedProps = (
|
|
|
197
196
|
title: t('cbd:mainData_accidentDamaged'),
|
|
198
197
|
icon: 'wrench',
|
|
199
198
|
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');
|
|
203
199
|
return damaged ? t('vehicleProps:value.damaged') : t('vehicleProps:value.accidentFree');
|
|
204
200
|
}
|
|
205
201
|
},
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// Autobahn (auto.de redesign) — CarCard loading placeholder.
|
|
2
|
-
//
|
|
3
|
-
// The shape of a CarCard while its data is on the way: the same card chrome (.mcard
|
|
4
|
-
// .cc-card — border, 18px radius, shadow) and, inside it, the card's own parts as
|
|
5
|
-
// skeleton bars on the line boxes CarCard's CSS gives them, so a grid of these is as
|
|
6
|
-
// tall as the grid of cards that replaces it and nothing below jumps:
|
|
7
|
-
// - photo: 4:3 plus the carousel's 14px (that's how tall .cc-media really renders), on
|
|
8
|
-
// the lighter --md-sc-low so the big area stays calm and the text bars read as content
|
|
9
|
-
// - title 24/27 (+6), trim 13/17 (+6), spec line 11/15 (+10)
|
|
10
|
-
// - price block on its hairline: tabs (39, +12), rate + price rating (58), terms (2 × 17)
|
|
11
|
-
// - phones (≤600, .show-mobile): the CTA row (9 + 40)
|
|
12
|
-
// - eco line (8 + 3 × 11) pinned to the bottom, like the card's
|
|
13
|
-
// Measured against real cards at 1467 / 768 / 390 px (571 / 541 / 593 tall).
|
|
14
|
-
//
|
|
15
|
-
// Decorative only (aria-hidden): the grid that shows these says what is loading.
|
|
16
|
-
// Renders correctly only inside a `<div className="md3">` subtree.
|
|
17
|
-
|
|
18
|
-
import React from 'react';
|
|
19
|
-
|
|
20
|
-
import Skeleton, { injectStyles } from '../ui/Skeleton';
|
|
21
|
-
|
|
22
|
-
export interface CarCardSkeletonProps {
|
|
23
|
-
className?: string;
|
|
24
|
-
style?: React.CSSProperties;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const CARD_SKELETON_CSS = `
|
|
28
|
-
.md3 .cc-skel { display: flex; flex-direction: column; pointer-events: none; }
|
|
29
|
-
.md3 .cc-skel .cc-skel-photo { height: 0; padding-bottom: calc(75% + 14px); border-radius: 0; --mskeleton-base: var(--md-sc-low); }
|
|
30
|
-
.md3 .cc-skel .cc-skel-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding: 0 18px 8px; margin-top: -3px; }
|
|
31
|
-
.md3 .cc-skel .cc-skel-title { width: 62%; height: 20px; margin: 4px 0 9px; border-radius: var(--md-r-xs); }
|
|
32
|
-
.md3 .cc-skel .cc-skel-trim { width: 82%; height: 11px; margin: 3px 0 9px; border-radius: var(--md-r-full); }
|
|
33
|
-
.md3 .cc-skel .cc-skel-spec { width: 92%; height: 9px; margin: 3px 0 13px; border-radius: var(--md-r-full); }
|
|
34
|
-
.md3 .cc-skel .cc-skel-price { align-self: stretch; border-top: 1px solid var(--md-outline-variant); }
|
|
35
|
-
.md3 .cc-skel .cc-skel-tabs { display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; justify-items: center; height: 39px; margin-bottom: 12px; }
|
|
36
|
-
.md3 .cc-skel .cc-skel-tabs .mskeleton { width: 56%; height: 12px; border-radius: var(--md-r-full); }
|
|
37
|
-
.md3 .cc-skel .cc-skel-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 58px; }
|
|
38
|
-
.md3 .cc-skel .cc-skel-rate { width: 46%; height: 42px; border-radius: var(--md-r-xs); }
|
|
39
|
-
.md3 .cc-skel .cc-skel-eval { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; width: 112px; flex: none; }
|
|
40
|
-
.md3 .cc-skel .cc-skel-eval .mskeleton:first-child { width: 72px; height: 12px; border-radius: var(--md-r-full); }
|
|
41
|
-
.md3 .cc-skel .cc-skel-eval .mskeleton:last-child { width: 100%; height: 7px; border-radius: var(--md-r-full); }
|
|
42
|
-
.md3 .cc-skel .cc-skel-terms,
|
|
43
|
-
.md3 .cc-skel .cc-skel-eco { display: flex; flex-direction: column; }
|
|
44
|
-
.md3 .cc-skel .cc-skel-terms .mskeleton { width: 94%; height: 9px; margin: 4px 0; border-radius: var(--md-r-full); }
|
|
45
|
-
.md3 .cc-skel .cc-skel-terms .mskeleton:last-child { width: 60%; }
|
|
46
|
-
.md3 .cc-skel .cc-skel-cta { align-self: stretch; gap: 6px; margin-top: 9px; }
|
|
47
|
-
.md3 .cc-skel .cc-skel-cta .mskeleton { flex: 1.3 1 0; height: 40px; border-radius: var(--md-r-full); }
|
|
48
|
-
.md3 .cc-skel .cc-skel-cta .mskeleton:nth-child(2) { flex: none; width: 40px; }
|
|
49
|
-
.md3 .cc-skel .cc-skel-cta .mskeleton:last-child { flex: 1 1 0; }
|
|
50
|
-
.md3 .cc-skel .cc-skel-eco { align-self: stretch; margin-top: auto; padding-top: 8px; }
|
|
51
|
-
.md3 .cc-skel .cc-skel-eco .mskeleton { height: 7px; margin: 2px 0; border-radius: var(--md-r-full); }
|
|
52
|
-
.md3 .cc-skel .cc-skel-eco .mskeleton:last-child { width: 66%; }
|
|
53
|
-
@media (max-width: 1024px) {
|
|
54
|
-
.md3 .cc-skel .cc-skel-tabs { height: 38px; }
|
|
55
|
-
}`;
|
|
56
|
-
|
|
57
|
-
const CARD_SKELETON_STYLE_ID = 'md3-card-skeleton-styles';
|
|
58
|
-
|
|
59
|
-
injectStyles(CARD_SKELETON_STYLE_ID, CARD_SKELETON_CSS);
|
|
60
|
-
|
|
61
|
-
const CarCardSkeleton: React.FunctionComponent<CarCardSkeletonProps> = ({ className, style }) => {
|
|
62
|
-
React.useEffect(() => { injectStyles(CARD_SKELETON_STYLE_ID, CARD_SKELETON_CSS); }, []);
|
|
63
|
-
return (
|
|
64
|
-
<div className={'mcard cc-card cc-skel' + (className ? ` ${className}` : '')} style={style} aria-hidden="true">
|
|
65
|
-
<Skeleton className="cc-skel-photo" />
|
|
66
|
-
<div className="cc-skel-body">
|
|
67
|
-
<Skeleton className="cc-skel-title" />
|
|
68
|
-
<Skeleton className="cc-skel-trim" />
|
|
69
|
-
<Skeleton className="cc-skel-spec" />
|
|
70
|
-
<div className="cc-skel-price">
|
|
71
|
-
<div className="cc-skel-tabs">
|
|
72
|
-
<Skeleton />
|
|
73
|
-
<Skeleton />
|
|
74
|
-
<Skeleton />
|
|
75
|
-
</div>
|
|
76
|
-
<div className="cc-skel-hero">
|
|
77
|
-
<Skeleton className="cc-skel-rate" />
|
|
78
|
-
<div className="cc-skel-eval">
|
|
79
|
-
<Skeleton />
|
|
80
|
-
<Skeleton />
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
<div className="cc-skel-terms">
|
|
84
|
-
<Skeleton />
|
|
85
|
-
<Skeleton />
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
<div className="cc-skel-cta show-mobile">
|
|
89
|
-
<Skeleton />
|
|
90
|
-
<Skeleton />
|
|
91
|
-
<Skeleton />
|
|
92
|
-
</div>
|
|
93
|
-
<div className="cc-skel-eco">
|
|
94
|
-
<Skeleton />
|
|
95
|
-
<Skeleton />
|
|
96
|
-
<Skeleton />
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export default CarCardSkeleton;
|
package/cards/CarRowSkeleton.tsx
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
// Autobahn (auto.de redesign) — CarRow (SRP list row) loading placeholder.
|
|
2
|
-
//
|
|
3
|
-
// Built on CarRow's own classes (.mcard .listcard / .listcard-info / .specstrip /
|
|
4
|
-
// .listcard-price), so the 320 | 1fr | 240 grid, the column paddings and gaps, the grey
|
|
5
|
-
// price column and the tablet re-flow (≤980: photo + info, price full width below) all
|
|
6
|
-
// come from the same CSS as the real row. Inside, the row's parts as skeleton bars on their
|
|
7
|
-
// line boxes (measured against real rows at 1467 px, 299 / 348 tall):
|
|
8
|
-
// - info: title 22 + trim 18 · spec panel (2 × 3 facts, 85) · feature chips (2 rows, 54)
|
|
9
|
-
// · eco line (3 × 14) at the bottom
|
|
10
|
-
// - price: "Finanzierung ab" + rate + terms (87) · Leasing (66, optional) · Kaufen,
|
|
11
|
-
// rating + meter, CTA (129) at the bottom
|
|
12
|
-
// `withLeasing` toggles the Leasing block, the one thing that changes a real row's height
|
|
13
|
-
// (348 with it, 299 without), so a list can mix both like real results do.
|
|
14
|
-
//
|
|
15
|
-
// Bars on the grey panels (spec strip, price column) use a darker base so they read on
|
|
16
|
-
// --md-sc-low. Decorative only (aria-hidden): the list showing these says what is loading.
|
|
17
|
-
// Renders correctly only inside a `<div className="md3">` subtree.
|
|
18
|
-
|
|
19
|
-
import React from 'react';
|
|
20
|
-
|
|
21
|
-
import Skeleton, { injectStyles } from '../ui/Skeleton';
|
|
22
|
-
|
|
23
|
-
export interface CarRowSkeletonProps {
|
|
24
|
-
/** show the Leasing block in the price column (a real row has it when the car can be leased). */
|
|
25
|
-
withLeasing?: boolean;
|
|
26
|
-
className?: string;
|
|
27
|
-
style?: React.CSSProperties;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const ROW_SKELETON_CSS = `
|
|
31
|
-
.md3 .lc-skel { pointer-events: none; background: var(--md-sc-lowest); }
|
|
32
|
-
.md3 .lc-skel .lc-skel-photo { position: absolute; inset: 0; border-radius: 0; --mskeleton-base: var(--md-sc-low); }
|
|
33
|
-
.md3 .lc-skel .specstrip .mskeleton,
|
|
34
|
-
.md3 .lc-skel .listcard-price .mskeleton { --mskeleton-base: var(--md-sc-highest); }
|
|
35
|
-
.md3 .lc-skel .lc-skel-head { display: flex; flex-direction: column; }
|
|
36
|
-
.md3 .lc-skel .lc-skel-title { width: 44%; height: 16px; margin: 3px 0; border-radius: var(--md-r-xs); }
|
|
37
|
-
.md3 .lc-skel .lc-skel-trim { width: 68%; height: 10px; margin: 4px 0; border-radius: var(--md-r-full); }
|
|
38
|
-
.md3 .lc-skel .lc-skel-fact { display: flex; align-items: center; gap: 7px; height: 15px; }
|
|
39
|
-
.md3 .lc-skel .lc-skel-fact .mskeleton:first-child { flex: none; width: 15px; height: 15px; border-radius: 50%; }
|
|
40
|
-
.md3 .lc-skel .lc-skel-fact .mskeleton:last-child { width: 62%; height: 8px; border-radius: var(--md-r-full); }
|
|
41
|
-
.md3 .lc-skel .lc-skel-fact:nth-child(3n + 2) .mskeleton:last-child { width: 48%; }
|
|
42
|
-
.md3 .lc-skel .lc-skel-chips { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
43
|
-
.md3 .lc-skel .lc-skel-chips .mskeleton { height: 24px; border-radius: 8px; }
|
|
44
|
-
.md3 .lc-skel .lc-skel-chips .mskeleton:nth-child(1) { width: 118px; }
|
|
45
|
-
.md3 .lc-skel .lc-skel-chips .mskeleton:nth-child(2) { width: 112px; }
|
|
46
|
-
.md3 .lc-skel .lc-skel-chips .mskeleton:nth-child(3) { width: 80px; }
|
|
47
|
-
.md3 .lc-skel .lc-skel-chips .mskeleton:nth-child(4) { width: 86px; }
|
|
48
|
-
.md3 .lc-skel .lc-skel-spacer { flex: 1; }
|
|
49
|
-
.md3 .lc-skel .lc-skel-eco { display: flex; flex-direction: column; }
|
|
50
|
-
.md3 .lc-skel .lc-skel-eco .mskeleton { height: 7px; margin: 4px 0 3px; border-radius: var(--md-r-full); }
|
|
51
|
-
.md3 .lc-skel .lc-skel-eco .mskeleton:last-child { width: 55%; }
|
|
52
|
-
.md3 .lc-skel .lc-skel-paths { display: flex; flex-direction: column; align-items: flex-start; }
|
|
53
|
-
.md3 .lc-skel .lc-skel-eyebrow { width: 96px; height: 9px; margin: 2px 0; border-radius: var(--md-r-full); }
|
|
54
|
-
.md3 .lc-skel .lc-skel-rate { display: flex; align-items: center; gap: 8px; height: 49px; margin-top: 4px; }
|
|
55
|
-
.md3 .lc-skel .lc-skel-rate .mskeleton:first-child { width: 120px; height: 38px; border-radius: var(--md-r-xs); }
|
|
56
|
-
.md3 .lc-skel .lc-skel-rate .mskeleton:last-child { width: 28px; height: 9px; border-radius: var(--md-r-full); }
|
|
57
|
-
.md3 .lc-skel .lc-skel-terms { width: 170px; max-width: 100%; height: 8px; margin: 11px 0 2px; border-radius: var(--md-r-full); }
|
|
58
|
-
.md3 .lc-skel .lc-skel-lease,
|
|
59
|
-
.md3 .lc-skel .lc-skel-buy { display: flex; flex-direction: column; border-top: 1px solid var(--md-outline-variant); }
|
|
60
|
-
.md3 .lc-skel .lc-skel-lease { padding-top: 14px; }
|
|
61
|
-
.md3 .lc-skel .lc-skel-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 21px; }
|
|
62
|
-
.md3 .lc-skel .lc-skel-line .mskeleton:first-child { width: 56px; height: 9px; border-radius: var(--md-r-full); }
|
|
63
|
-
.md3 .lc-skel .lc-skel-line .mskeleton:last-child { width: 72px; height: 15px; border-radius: var(--md-r-xs); }
|
|
64
|
-
.md3 .lc-skel .lc-skel-lease-terms { display: flex; flex-direction: column; margin-top: 6px; }
|
|
65
|
-
.md3 .lc-skel .lc-skel-lease-terms .mskeleton { height: 7px; margin: 2px 0 3px; border-radius: var(--md-r-full); }
|
|
66
|
-
.md3 .lc-skel .lc-skel-lease-terms .mskeleton:last-child { width: 62%; }
|
|
67
|
-
.md3 .lc-skel .lc-skel-buy { margin-top: auto; padding-top: 9px; }
|
|
68
|
-
.md3 .lc-skel .lc-skel-buy .lc-skel-line { height: 22px; }
|
|
69
|
-
.md3 .lc-skel .lc-skel-eval { display: flex; align-items: center; gap: 10px; height: 24px; margin-top: 15px; }
|
|
70
|
-
.md3 .lc-skel .lc-skel-eval .mskeleton:first-child { flex: none; width: 84px; height: 24px; border-radius: 12px; }
|
|
71
|
-
.md3 .lc-skel .lc-skel-eval .mskeleton:last-child { flex: 1; height: 8px; border-radius: var(--md-r-full); }
|
|
72
|
-
.md3 .lc-skel .lc-skel-cta { height: 40px; margin-top: 18px; border-radius: var(--md-r-full); }`;
|
|
73
|
-
|
|
74
|
-
const ROW_SKELETON_STYLE_ID = 'md3-row-skeleton-styles';
|
|
75
|
-
|
|
76
|
-
injectStyles(ROW_SKELETON_STYLE_ID, ROW_SKELETON_CSS);
|
|
77
|
-
|
|
78
|
-
const FACTS = [0, 1, 2, 3, 4, 5];
|
|
79
|
-
|
|
80
|
-
const CarRowSkeleton: React.FunctionComponent<CarRowSkeletonProps> = ({ withLeasing = true, className, style }) => {
|
|
81
|
-
React.useEffect(() => { injectStyles(ROW_SKELETON_STYLE_ID, ROW_SKELETON_CSS); }, []);
|
|
82
|
-
return (
|
|
83
|
-
<div className={'mcard listcard lc-skel' + (className ? ` ${className}` : '')} style={style} aria-hidden="true">
|
|
84
|
-
<div className="listcard-media">
|
|
85
|
-
<Skeleton className="lc-skel-photo" />
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
<div className="listcard-info">
|
|
89
|
-
<div className="lc-skel-head">
|
|
90
|
-
<Skeleton className="lc-skel-title" />
|
|
91
|
-
<Skeleton className="lc-skel-trim" />
|
|
92
|
-
</div>
|
|
93
|
-
<div className="specstrip">
|
|
94
|
-
{FACTS.map((fact) => (
|
|
95
|
-
<div key={fact} className="lc-skel-fact">
|
|
96
|
-
<Skeleton />
|
|
97
|
-
<Skeleton />
|
|
98
|
-
</div>
|
|
99
|
-
))}
|
|
100
|
-
</div>
|
|
101
|
-
<div className="lc-skel-chips">
|
|
102
|
-
<Skeleton />
|
|
103
|
-
<Skeleton />
|
|
104
|
-
<Skeleton />
|
|
105
|
-
<Skeleton />
|
|
106
|
-
</div>
|
|
107
|
-
<div className="lc-skel-spacer" />
|
|
108
|
-
<div className="lc-skel-eco">
|
|
109
|
-
<Skeleton />
|
|
110
|
-
<Skeleton />
|
|
111
|
-
<Skeleton />
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
|
|
115
|
-
<div className="listcard-price">
|
|
116
|
-
<div className="lc-skel-paths">
|
|
117
|
-
<Skeleton className="lc-skel-eyebrow" />
|
|
118
|
-
<div className="lc-skel-rate">
|
|
119
|
-
<Skeleton />
|
|
120
|
-
<Skeleton />
|
|
121
|
-
</div>
|
|
122
|
-
<Skeleton className="lc-skel-terms" />
|
|
123
|
-
</div>
|
|
124
|
-
{withLeasing && (
|
|
125
|
-
<div className="lc-skel-lease">
|
|
126
|
-
<div className="lc-skel-line">
|
|
127
|
-
<Skeleton />
|
|
128
|
-
<Skeleton />
|
|
129
|
-
</div>
|
|
130
|
-
<div className="lc-skel-lease-terms">
|
|
131
|
-
<Skeleton />
|
|
132
|
-
<Skeleton />
|
|
133
|
-
</div>
|
|
134
|
-
</div>
|
|
135
|
-
)}
|
|
136
|
-
<div className="lc-skel-buy">
|
|
137
|
-
<div className="lc-skel-line">
|
|
138
|
-
<Skeleton />
|
|
139
|
-
<Skeleton />
|
|
140
|
-
</div>
|
|
141
|
-
<div className="lc-skel-eval">
|
|
142
|
-
<Skeleton />
|
|
143
|
-
<Skeleton />
|
|
144
|
-
</div>
|
|
145
|
-
<Skeleton className="lc-skel-cta" />
|
|
146
|
-
</div>
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
);
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
export default CarRowSkeleton;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export type AccountMenuIconName =
|
|
4
|
-
| 'layout-grid' | 'car-front' | 'bookmark' | 'star' | 'scale' | 'user' | 'help-circle' | 'log-out'
|
|
5
|
-
| 'settings' | 'store';
|
|
6
|
-
type FilledIconName = 'settings' | 'store';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Row icons of the Konto menu (Figma "Konto / Kontomenü", 64243:14111): Lucide-style glyphs in a
|
|
10
|
-
* 22px frame with a 1.8px stroke, but with Figma's own geometry — e.g. its bookmark is narrower and
|
|
11
|
-
* square-cornered, unlike lucide-react 0.288's — so the paths are Figma's export, not the lib Icon.
|
|
12
|
-
* `at` moves each export to where Figma places it in the frame: the group inset minus half the stroke.
|
|
13
|
-
*/
|
|
14
|
-
const GLYPHS: Record<Exclude<AccountMenuIconName, FilledIconName>, { at: [number, number]; d: string[] }> = {
|
|
15
|
-
'layout-grid': {
|
|
16
|
-
at: [1.85, 1.85],
|
|
17
|
-
d: [
|
|
18
|
-
'M1.81667 0.9H6.4C6.90626 0.9 7.31667 1.31041 7.31667 1.81667V6.4C7.31667 6.90626 6.90626 7.31667 6.4 7.31667H1.81667C1.31041 7.31667 0.9 6.90626 0.9 6.4V1.81667C0.9 1.31041 1.31041 0.9 1.81667 0.9Z',
|
|
19
|
-
'M11.9 0.9H16.4833C16.9896 0.9 17.4 1.31041 17.4 1.81667V6.4C17.4 6.90626 16.9896 7.31667 16.4833 7.31667H11.9C11.3937 7.31667 10.9833 6.90626 10.9833 6.4V1.81667C10.9833 1.31041 11.3937 0.9 11.9 0.9Z',
|
|
20
|
-
'M1.81667 10.9833H6.4C6.90626 10.9833 7.31667 11.3937 7.31667 11.9V16.4833C7.31667 16.9896 6.90626 17.4 6.4 17.4H1.81667C1.31041 17.4 0.9 16.9896 0.9 16.4833V11.9C0.9 11.3937 1.31041 10.9833 1.81667 10.9833Z',
|
|
21
|
-
'M11.9 10.9833H16.4833C16.9896 10.9833 17.4 11.3937 17.4 11.9V16.4833C17.4 16.9896 16.9896 17.4 16.4833 17.4H11.9C11.3937 17.4 10.9833 16.9896 10.9833 16.4833V11.9C10.9833 11.3937 11.3937 10.9833 11.9 10.9833Z',
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
'car-front': {
|
|
25
|
-
at: [1.85, 3.68333],
|
|
26
|
-
d: [
|
|
27
|
-
'M2.73333 6.4L4.10833 2.275C4.20846 1.88695 4.43297 1.5424 4.74752 1.29408C5.06206 1.04575 5.44931 0.907329 5.85 0.9H12.45C12.8507 0.907329 13.2379 1.04575 13.5525 1.29408C13.867 1.5424 14.0915 1.88695 14.1917 2.275L15.5667 6.4',
|
|
28
|
-
'M2.73333 6.4H15.5667C16.5792 6.4 17.4 7.22081 17.4 8.23333V10.9833C17.4 11.9959 16.5792 12.8167 15.5667 12.8167H2.73333C1.72081 12.8167 0.9 11.9959 0.9 10.9833V8.23333C0.9 7.22081 1.72081 6.4 2.73333 6.4Z',
|
|
29
|
-
'M4.56667 12.8167V14.65M13.7333 12.8167V14.65',
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
bookmark: {
|
|
33
|
-
at: [4.6, 1.85],
|
|
34
|
-
d: ['M0.9 0.9H11.9V17.4L6.4 13.275L0.9 17.4V0.9Z'],
|
|
35
|
-
},
|
|
36
|
-
star: {
|
|
37
|
-
at: [2.03333, 1.85],
|
|
38
|
-
d: ['M8.96669 0.9L11.4417 6.03333L17.0334 6.85833L13 10.8L13.9167 16.3917L8.96669 13.7333L4.01669 16.3917L4.93336 10.8L0.900026 6.85833L6.49169 6.03333L8.96669 0.9Z'],
|
|
39
|
-
},
|
|
40
|
-
scale: {
|
|
41
|
-
at: [1.85, 1.85],
|
|
42
|
-
d: [
|
|
43
|
-
'M9.15 0.9V4.56667M9.15 4.56667V17.4M9.15 4.56667H3.65M9.15 4.56667H14.65',
|
|
44
|
-
'M3.65 4.56667L0.900003 10.9833H6.4L3.65 4.56667ZM14.65 4.56667L11.9 10.9833H17.4L14.65 4.56667Z',
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
|
-
user: {
|
|
48
|
-
at: [2.76667, 2.76667],
|
|
49
|
-
d: [
|
|
50
|
-
'M11.9 4.56667C11.9 6.59171 10.2584 8.23333 8.23333 8.23333C6.20829 8.23333 4.56667 6.59171 4.56667 4.56667C4.56667 2.54162 6.20829 0.9 8.23333 0.9C10.2584 0.9 11.9 2.54162 11.9 4.56667Z',
|
|
51
|
-
'M0.9 16.4833C0.9 12.8167 4.2 10.9833 8.23333 10.9833C12.2667 10.9833 15.5667 12.8167 15.5667 16.4833',
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
'help-circle': {
|
|
55
|
-
at: [1.85, 1.85],
|
|
56
|
-
d: [
|
|
57
|
-
'M17.4 9.15C17.4 13.7063 13.7063 17.4 9.15 17.4C4.59365 17.4 0.9 13.7063 0.9 9.15C0.9 4.59365 4.59365 0.9 9.15 0.9C13.7063 0.9 17.4 4.59365 17.4 9.15Z',
|
|
58
|
-
'M6.85833 6.85833C6.84973 6.4229 6.96538 5.99402 7.19175 5.62195C7.41811 5.24988 7.74582 4.95001 8.13647 4.75748C8.52713 4.56495 8.96456 4.48772 9.39752 4.53485C9.83049 4.58197 10.2411 4.7515 10.5811 5.02357C10.9212 5.29564 11.1767 5.65898 11.3178 6.07104C11.4588 6.4831 11.4795 6.92681 11.3774 7.3502C11.2753 7.77359 11.0547 8.15913 10.7414 8.46165C10.4281 8.76417 10.035 8.97114 9.60833 9.05833V10.25',
|
|
59
|
-
'M9.15 13.7333H9.16',
|
|
60
|
-
],
|
|
61
|
-
},
|
|
62
|
-
'log-out': {
|
|
63
|
-
at: [1.85, 1.85],
|
|
64
|
-
d: [
|
|
65
|
-
'M6.4 17.4H2.73333C2.2471 17.4 1.78079 17.2068 1.43697 16.863C1.09315 16.5192 0.9 16.0529 0.9 15.5667V2.73333C0.9 2.2471 1.09315 1.78079 1.43697 1.43697C1.78079 1.09315 2.2471 0.9 2.73333 0.9H6.4',
|
|
66
|
-
'M12.8167 4.56667L17.4 9.15L12.8167 13.7333M17.4 9.15H6.4',
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
/** Filled Material glyphs supplied for the role rows (2026-10-28): "settings" (Bildeinstellungen)
|
|
72
|
-
* and "store" (the dealer rows). Unlike the stroked Figma glyphs they are filled 24-unit glyphs;
|
|
73
|
-
* viewBox 1 1 22 22 only trims their empty margin, so they keep their own size in the 22px frame.
|
|
74
|
-
* Their masks were full 24px rects (no-ops), so dropped. */
|
|
75
|
-
const FILLED: Record<FilledIconName, string> = {
|
|
76
|
-
settings: 'M13.5 21.5H10.475C10.2583 21.5 10.0667 21.425 9.9 21.275C9.73334 21.125 9.63334 20.9333 9.6 20.7L9.3 18.45C9.03334 18.3667 8.76267 18.2417 8.488 18.075C8.21267 17.9083 7.95834 17.7333 7.725 17.55L5.65 18.45C5.43334 18.5333 5.221 18.5417 5.013 18.475C4.80434 18.4083 4.63334 18.275 4.5 18.075L3 15.45C2.88334 15.25 2.85 15.0373 2.9 14.812C2.95 14.5873 3.05834 14.4083 3.225 14.275L5.05 12.9C5.01667 12.75 4.996 12.6 4.988 12.45C4.97934 12.3 4.975 12.15 4.975 12C4.975 11.8667 4.97934 11.725 4.988 11.575C4.996 11.425 5.01667 11.2667 5.05 11.1L3.225 9.725C3.05834 9.59167 2.95 9.41267 2.9 9.188C2.85 8.96267 2.88334 8.75 3 8.55L4.5 5.95C4.61667 5.75 4.78334 5.61667 5 5.55C5.21667 5.48333 5.425 5.49167 5.625 5.575L7.725 6.45C7.95834 6.26667 8.21267 6.096 8.488 5.938C8.76267 5.77933 9.03334 5.65 9.3 5.55L9.6 3.3C9.63334 3.06667 9.73334 2.875 9.9 2.725C10.0667 2.575 10.2583 2.5 10.475 2.5H13.5C13.7333 2.5 13.9333 2.575 14.1 2.725C14.2667 2.875 14.3667 3.06667 14.4 3.3L14.7 5.55C15 5.66667 15.2707 5.79567 15.512 5.937C15.754 6.079 16 6.25 16.25 6.45L18.375 5.575C18.575 5.49167 18.7793 5.48333 18.988 5.55C19.196 5.61667 19.3667 5.75 19.5 5.95L21 8.55C21.1167 8.75 21.15 8.96267 21.1 9.188C21.05 9.41267 20.9417 9.59167 20.775 9.725L18.925 11.125C18.9583 11.2917 18.975 11.4417 18.975 11.575V12C18.975 12.1333 18.9707 12.2707 18.962 12.412C18.954 12.554 18.9333 12.7167 18.9 12.9L20.725 14.275C20.9083 14.4083 21.025 14.5873 21.075 14.812C21.125 15.0373 21.0833 15.25 20.95 15.45L19.45 18.05C19.3333 18.25 19.1667 18.3833 18.95 18.45C18.7333 18.5167 18.5167 18.5083 18.3 18.425L16.25 17.55C16 17.75 15.746 17.925 15.488 18.075C15.2293 18.225 14.9667 18.35 14.7 18.45L14.4 20.7C14.3667 20.9333 14.2667 21.125 14.1 21.275C13.9333 21.425 13.7333 21.5 13.5 21.5ZM12 15C12.8333 15 13.5417 14.7083 14.125 14.125C14.7083 13.5417 15 12.8333 15 12C15 11.1667 14.7083 10.4583 14.125 9.875C13.5417 9.29167 12.8333 9 12 9C11.1667 9 10.4583 9.29167 9.875 9.875C9.29167 10.4583 9 11.1667 9 12C9 12.8333 9.29167 13.5417 9.875 14.125C10.4583 14.7083 11.1667 15 12 15ZM12 13.5C11.5833 13.5 11.2293 13.354 10.938 13.062C10.646 12.7707 10.5 12.4167 10.5 12C10.5 11.5833 10.646 11.2293 10.938 10.938C11.2293 10.646 11.5833 10.5 12 10.5C12.4167 10.5 12.7707 10.646 13.062 10.938C13.354 11.2293 13.5 11.5833 13.5 12C13.5 12.4167 13.354 12.7707 13.062 13.062C12.7707 13.354 12.4167 13.5 12 13.5ZM11 20H12.975L13.325 17.325C13.8417 17.1917 14.3083 17 14.725 16.75C15.1417 16.5 15.55 16.1833 15.95 15.8L18.425 16.85L19.425 15.15L17.25 13.525C17.3333 13.2583 17.3877 13 17.413 12.75C17.4377 12.5 17.45 12.25 17.45 12C17.45 11.7333 17.4377 11.4793 17.413 11.238C17.3877 10.996 17.3333 10.75 17.25 10.5L19.425 8.85L18.45 7.15L15.925 8.2C15.5917 7.85 15.1917 7.53733 14.725 7.262C14.2583 6.98733 13.7917 6.79167 13.325 6.675L13 4H11.025L10.675 6.675C10.175 6.79167 9.70834 6.975 9.275 7.225C8.84167 7.475 8.425 7.79167 8.025 8.175L5.55 7.15L4.575 8.85L6.725 10.45C6.64167 10.7 6.58334 10.95 6.55 11.2C6.51667 11.45 6.5 11.7167 6.5 12C6.5 12.2667 6.51667 12.525 6.55 12.775C6.58334 13.025 6.64167 13.275 6.725 13.525L4.575 15.15L5.55 16.85L8.025 15.8C8.40834 16.1833 8.81667 16.5 9.25 16.75C9.68334 17 10.1583 17.1917 10.675 17.325L11 20Z',
|
|
77
|
-
store: 'M5 6C4.71666 6 4.479 5.90433 4.287 5.713C4.09566 5.521 4 5.28333 4 5C4 4.71667 4.09566 4.479 4.287 4.287C4.479 4.09567 4.71666 4 5 4H19C19.2833 4 19.5207 4.09567 19.712 4.287C19.904 4.479 20 4.71667 20 5C20 5.28333 19.904 5.521 19.712 5.713C19.5207 5.90433 19.2833 6 19 6H5ZM5 20C4.71666 20 4.479 19.904 4.287 19.712C4.09566 19.5207 4 19.2833 4 19V14H3.825C3.50833 14 3.25 13.879 3.05 13.637C2.85 13.3957 2.78333 13.1167 2.85 12.8L3.85 7.8C3.9 7.56667 4.01666 7.375 4.2 7.225C4.38333 7.075 4.59166 7 4.825 7H19.175C19.4083 7 19.6167 7.075 19.8 7.225C19.9833 7.375 20.1 7.56667 20.15 7.8L21.15 12.8C21.2167 13.1167 21.15 13.3957 20.95 13.637C20.75 13.879 20.4917 14 20.175 14H20V19C20 19.2833 19.904 19.5207 19.712 19.712C19.5207 19.904 19.2833 20 19 20C18.7167 20 18.4793 19.904 18.288 19.712C18.096 19.5207 18 19.2833 18 19V14H14V19C14 19.2833 13.9043 19.5207 13.713 19.712C13.521 19.904 13.2833 20 13 20H5ZM6 18H12V14H6V18ZM5.05 12H18.95L18.35 9H5.65L5.05 12Z',
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const AccountMenuIcon: React.FunctionComponent<{ name: AccountMenuIconName }> = ({ name }) => {
|
|
81
|
-
if (name === 'settings' || name === 'store') {
|
|
82
|
-
return (
|
|
83
|
-
<svg className="acct-icon" width="22" height="22" viewBox="1 1 22 22" fill="currentColor" aria-hidden="true">
|
|
84
|
-
<path d={FILLED[name]} />
|
|
85
|
-
</svg>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
const { at, d } = GLYPHS[name];
|
|
89
|
-
return (
|
|
90
|
-
<svg
|
|
91
|
-
className="acct-icon"
|
|
92
|
-
width="22"
|
|
93
|
-
height="22"
|
|
94
|
-
viewBox="0 0 22 22"
|
|
95
|
-
fill="none"
|
|
96
|
-
stroke="currentColor"
|
|
97
|
-
strokeWidth="1.8"
|
|
98
|
-
strokeLinecap="round"
|
|
99
|
-
strokeLinejoin="round"
|
|
100
|
-
aria-hidden="true"
|
|
101
|
-
>
|
|
102
|
-
<g transform={`translate(${at[0]} ${at[1]})`}>
|
|
103
|
-
{d.map((path) => <path key={path} d={path} />)}
|
|
104
|
-
</g>
|
|
105
|
-
</svg>
|
|
106
|
-
);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export default AccountMenuIcon;
|
package/ui/MfieldCheckIcon.tsx
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
// Figma-exact valid-field checkmark (.mfield-ok, FormField/MdField's showValid) — a distinct
|
|
4
|
-
// path/stroke from the generic lucide Check that Icon name="check" renders elsewhere, so it's
|
|
5
|
-
// its own tiny component rather than a REGISTRY entry in Icon.tsx (which would change every
|
|
6
|
-
// other "check" usage in the app too).
|
|
7
|
-
const MfieldCheckIcon: React.FunctionComponent = () => (
|
|
8
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9
|
-
<path d="M13.3334 4L6.00002 11.3333L2.66669 8" stroke="#168A45" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" />
|
|
10
|
-
</svg>
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
export default MfieldCheckIcon;
|
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
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// Autobahn (auto.de redesign) — shared "scroll a just-opened/just-focused field to the top of the
|
|
2
|
-
// page" behaviour, used by Dropdown.tsx and by fe-main's DualRange/RateSlider (FilterContent.tsx)
|
|
3
|
-
// text fields on /search/detailed. On mobile, opening a dropdown's menu or focusing a text field
|
|
4
|
-
// brings the on-screen keyboard up and/or needs room for a popover below the field — if the field
|
|
5
|
-
// is sitting mid-page, there may not be enough space left below it once the keyboard/menu takes
|
|
6
|
-
// its share. Scrolling the field to the very top of the page first maximizes what's available.
|
|
7
|
-
//
|
|
8
|
-
// Extracted out of Dropdown.tsx so it can be shared verbatim with fe-main's non-Dropdown form
|
|
9
|
-
// fields (DualRange/RateSlider's text inputs) — same problem, same fix, one place to keep them
|
|
10
|
-
// from drifting apart. See Dropdown.tsx's own call site for the original reasoning this was
|
|
11
|
-
// pulled from.
|
|
12
|
-
export function scrollFieldIntoView(field: HTMLElement): void {
|
|
13
|
-
if (typeof window === 'undefined') return;
|
|
14
|
-
// Mobile-only: the on-screen-keyboard/popover space problem this fixes doesn't exist on
|
|
15
|
-
// desktop, where there's no keyboard pushing the viewport around. Same breakpoint + matchMedia
|
|
16
|
-
// pattern as Modal.tsx/CardCarousel.tsx elsewhere in this lib.
|
|
17
|
-
if (window.matchMedia('(min-width: 601px)').matches) return;
|
|
18
|
-
// Anchor on whichever is higher up: the field itself, or a short field label/caption sitting
|
|
19
|
-
// directly above it (own previous sibling, or — the common "label above a row of controls"
|
|
20
|
-
// shape, e.g. "Marke & Modell" above the Make/Model row on /search/detailed — the wrapping
|
|
21
|
-
// row's previous sibling). Checked by height, not by class name, so this works for ANY
|
|
22
|
-
// caller's label without this needing to know that call site's specific markup.
|
|
23
|
-
const MAX_LABEL_HEIGHT = 30;
|
|
24
|
-
const asLabel = (el: Element | null): HTMLElement | null => {
|
|
25
|
-
if (!(el instanceof HTMLElement)) return null;
|
|
26
|
-
const h = el.getBoundingClientRect().height;
|
|
27
|
-
return h > 0 && h <= MAX_LABEL_HEIGHT ? el : null;
|
|
28
|
-
};
|
|
29
|
-
const anchor =
|
|
30
|
-
asLabel(field.previousElementSibling) ||
|
|
31
|
-
asLabel(field.parentElement && field.parentElement.previousElementSibling) ||
|
|
32
|
-
field;
|
|
33
|
-
// No sticky-header reservation here: every current caller (NewMainPage '/', FilterContent on
|
|
34
|
-
// '/search*') sits on a page where TopBar's own autoHideOnScroll is on (App.tsx: isHomePage ||
|
|
35
|
-
// isSearchPage) — the header slides itself out of the way the instant this scroll starts,
|
|
36
|
-
// independently of this call, so reserving space for it here would double-count.
|
|
37
|
-
const GAP = 8;
|
|
38
|
-
const rect = anchor.getBoundingClientRect();
|
|
39
|
-
const targetY = window.scrollY + rect.top - GAP;
|
|
40
|
-
window.scrollTo({ top: Math.max(0, targetY), behavior: 'smooth' });
|
|
41
|
-
}
|