@bytebrand/fe-ui-core-autobahn 1.0.166 → 1.0.168
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 +8 -1
- package/cards/CarRow.tsx +5 -1
- package/cards/cardParts.tsx +5 -0
- package/chrome/AccountMenuIcon.tsx +91 -0
- package/chrome/TopBar.tsx +104 -266
- package/locales/de/autobahn.json +10 -1
- package/locales/en/autobahn.json +10 -1
- package/package.json +30 -30
- package/theme/md3.css +121 -21
- package/vehiclesProps/accidentDisclosure.ts +25 -25
package/cards/CarCard.tsx
CHANGED
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
GalleryActivityPill,
|
|
39
39
|
cardSpec,
|
|
40
40
|
PaymentMode,
|
|
41
|
+
startPaymentMode,
|
|
41
42
|
callDealerSalesPhone,
|
|
42
43
|
DEALER_SALES_PHONE,
|
|
43
44
|
} from './cardParts';
|
|
@@ -98,6 +99,11 @@ export interface CarCardProps {
|
|
|
98
99
|
* (still onOpenRateAdjust).
|
|
99
100
|
*/
|
|
100
101
|
onShowFinancingDetails?: (car: AutobahnCar, mode: PaymentMode) => void;
|
|
102
|
+
/**
|
|
103
|
+
* Tab the price block opens on (default Finanzierung) — e.g. the SRP's leasing-only results
|
|
104
|
+
* open every card on Leasing. Ignored for a car without a lease rate (it has no Leasing tab).
|
|
105
|
+
*/
|
|
106
|
+
initialMode?: PaymentMode;
|
|
101
107
|
}
|
|
102
108
|
|
|
103
109
|
const CarCard: React.FunctionComponent<CarCardProps> = ({
|
|
@@ -113,8 +119,9 @@ const CarCard: React.FunctionComponent<CarCardProps> = ({
|
|
|
113
119
|
onCall,
|
|
114
120
|
onOpenRateAdjust,
|
|
115
121
|
onShowFinancingDetails,
|
|
122
|
+
initialMode,
|
|
116
123
|
}) => {
|
|
117
|
-
const [mode, setMode] = useState<PaymentMode>(
|
|
124
|
+
const [mode, setMode] = useState<PaymentMode>(() => startPaymentMode(car, initialMode));
|
|
118
125
|
const [photoIndex, setPhotoIndex] = useState(0);
|
|
119
126
|
const [viewerOpen, setViewerOpen] = useState(false);
|
|
120
127
|
const mediaRef = useRef<HTMLDivElement | null>(null);
|
package/cards/CarRow.tsx
CHANGED
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
ZeroDownChip,
|
|
42
42
|
fmtKm,
|
|
43
43
|
PaymentMode,
|
|
44
|
+
startPaymentMode,
|
|
44
45
|
ratingTone,
|
|
45
46
|
} from './cardParts';
|
|
46
47
|
import { AutobahnCar } from './types';
|
|
@@ -80,6 +81,8 @@ export interface CarRowProps {
|
|
|
80
81
|
* links render as plain text (see PricePaths' own fallback).
|
|
81
82
|
*/
|
|
82
83
|
onShowFinancingDetails?: (car: AutobahnCar, mode: PaymentMode) => void;
|
|
84
|
+
/** Tab the mobile price tabs open on — see CarCard's identically-named prop. */
|
|
85
|
+
initialMode?: PaymentMode;
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
const CarRow: React.FunctionComponent<CarRowProps> = ({
|
|
@@ -92,8 +95,9 @@ const CarRow: React.FunctionComponent<CarRowProps> = ({
|
|
|
92
95
|
t,
|
|
93
96
|
adminAction,
|
|
94
97
|
onShowFinancingDetails,
|
|
98
|
+
initialMode,
|
|
95
99
|
}) => {
|
|
96
|
-
const [mode, setMode] = useState<PaymentMode>(
|
|
100
|
+
const [mode, setMode] = useState<PaymentMode>(() => startPaymentMode(car, initialMode));
|
|
97
101
|
const [photoIndex, setPhotoIndex] = useState(0);
|
|
98
102
|
const mediaRef = useRef<HTMLDivElement | null>(null);
|
|
99
103
|
// always call the LATEST onMediaEnter without re-arming the observer on every render (the
|
package/cards/cardParts.tsx
CHANGED
|
@@ -489,6 +489,11 @@ export const PriceEvalCol: React.FunctionComponent<{ car: AutobahnCar; t: Transl
|
|
|
489
489
|
|
|
490
490
|
export type PaymentMode = 'financing' | 'leasing' | 'buy';
|
|
491
491
|
|
|
492
|
+
/** The tab a card opens on: the requested one (default Finanzierung), but never Leasing for a car
|
|
493
|
+
* without a lease rate — PriceTabs has no Leasing tab for it. */
|
|
494
|
+
export const startPaymentMode = (car: AutobahnCar, requested?: PaymentMode): PaymentMode =>
|
|
495
|
+
requested === 'leasing' && car.lease == null ? 'financing' : requested || 'financing';
|
|
496
|
+
|
|
492
497
|
export interface PriceTabsProps {
|
|
493
498
|
car: AutobahnCar;
|
|
494
499
|
mode: PaymentMode;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export type AccountMenuIconName =
|
|
4
|
+
| 'layout-grid' | 'car-front' | 'bookmark' | 'star' | 'scale' | 'user' | 'help-circle' | 'log-out';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Row icons of the Konto menu (Figma "Konto / Kontomenü", 64243:14111): Lucide-style glyphs in a
|
|
8
|
+
* 22px frame with a 1.8px stroke, but with Figma's own geometry — e.g. its bookmark is narrower and
|
|
9
|
+
* square-cornered, unlike lucide-react 0.288's — so the paths are Figma's export, not the lib Icon.
|
|
10
|
+
* `at` moves each export to where Figma places it in the frame: the group inset minus half the stroke.
|
|
11
|
+
*/
|
|
12
|
+
const GLYPHS: Record<AccountMenuIconName, { at: [number, number]; d: string[] }> = {
|
|
13
|
+
'layout-grid': {
|
|
14
|
+
at: [1.85, 1.85],
|
|
15
|
+
d: [
|
|
16
|
+
'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',
|
|
17
|
+
'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',
|
|
18
|
+
'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',
|
|
19
|
+
'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',
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
'car-front': {
|
|
23
|
+
at: [1.85, 3.68333],
|
|
24
|
+
d: [
|
|
25
|
+
'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',
|
|
26
|
+
'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',
|
|
27
|
+
'M4.56667 12.8167V14.65M13.7333 12.8167V14.65',
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
bookmark: {
|
|
31
|
+
at: [4.6, 1.85],
|
|
32
|
+
d: ['M0.9 0.9H11.9V17.4L6.4 13.275L0.9 17.4V0.9Z'],
|
|
33
|
+
},
|
|
34
|
+
star: {
|
|
35
|
+
at: [2.03333, 1.85],
|
|
36
|
+
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'],
|
|
37
|
+
},
|
|
38
|
+
scale: {
|
|
39
|
+
at: [1.85, 1.85],
|
|
40
|
+
d: [
|
|
41
|
+
'M9.15 0.9V4.56667M9.15 4.56667V17.4M9.15 4.56667H3.65M9.15 4.56667H14.65',
|
|
42
|
+
'M3.65 4.56667L0.900003 10.9833H6.4L3.65 4.56667ZM14.65 4.56667L11.9 10.9833H17.4L14.65 4.56667Z',
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
user: {
|
|
46
|
+
at: [2.76667, 2.76667],
|
|
47
|
+
d: [
|
|
48
|
+
'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',
|
|
49
|
+
'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',
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
'help-circle': {
|
|
53
|
+
at: [1.85, 1.85],
|
|
54
|
+
d: [
|
|
55
|
+
'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',
|
|
56
|
+
'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',
|
|
57
|
+
'M9.15 13.7333H9.16',
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
'log-out': {
|
|
61
|
+
at: [1.85, 1.85],
|
|
62
|
+
d: [
|
|
63
|
+
'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',
|
|
64
|
+
'M12.8167 4.56667L17.4 9.15L12.8167 13.7333M17.4 9.15H6.4',
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const AccountMenuIcon: React.FunctionComponent<{ name: AccountMenuIconName }> = ({ name }) => {
|
|
70
|
+
const { at, d } = GLYPHS[name];
|
|
71
|
+
return (
|
|
72
|
+
<svg
|
|
73
|
+
className="acct-icon"
|
|
74
|
+
width="22"
|
|
75
|
+
height="22"
|
|
76
|
+
viewBox="0 0 22 22"
|
|
77
|
+
fill="none"
|
|
78
|
+
stroke="currentColor"
|
|
79
|
+
strokeWidth="1.8"
|
|
80
|
+
strokeLinecap="round"
|
|
81
|
+
strokeLinejoin="round"
|
|
82
|
+
aria-hidden="true"
|
|
83
|
+
>
|
|
84
|
+
<g transform={`translate(${at[0]} ${at[1]})`}>
|
|
85
|
+
{d.map((path) => <path key={path} d={path} />)}
|
|
86
|
+
</g>
|
|
87
|
+
</svg>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default AccountMenuIcon;
|
package/chrome/TopBar.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { TranslationFunction } from '../types';
|
|
|
3
3
|
|
|
4
4
|
import { Button, Icon, IconButton } from '../ui';
|
|
5
5
|
import logoUrl from '../assets/autode-logo.svg';
|
|
6
|
+
import AccountMenuIcon, { AccountMenuIconName } from './AccountMenuIcon';
|
|
6
7
|
|
|
7
8
|
/** Where the logo navigates on click. '/' is NOT an SPA route — traefik serves the WordPress
|
|
8
9
|
* homepage there (generate-routes.py: wp-home at higher priority) — so the logo must be a FULL
|
|
@@ -39,6 +40,10 @@ const R_MY_ORDERS = '/account/my-orders';
|
|
|
39
40
|
const R_DASHBOARD = '/account/dashboard';
|
|
40
41
|
const R_IMAGE_SETTINGS = '/account/image-settings';
|
|
41
42
|
const R_KONTAKT = '/account/kontakt';
|
|
43
|
+
const R_COMPARE = '/compare';
|
|
44
|
+
|
|
45
|
+
/** lib Icon strokes are in lucide's 24-unit viewBox: drawn at 22px this is the Konto menu's 1.8px. */
|
|
46
|
+
const ACCT_ICON_STROKE = (1.8 * 24) / 22;
|
|
42
47
|
|
|
43
48
|
/** Languages offered in the account menu (legacy supports de/en/ru). Labels are proper nouns
|
|
44
49
|
* (endonyms) and stay untranslated. */
|
|
@@ -83,14 +88,18 @@ export interface TopBarProps {
|
|
|
83
88
|
variant?: TopBarVariant;
|
|
84
89
|
/** real auth state (authStore.isAuthorized) — guest vs profile menu. */
|
|
85
90
|
isAuthorized?: boolean;
|
|
86
|
-
/**
|
|
91
|
+
/** name in the authed menu's head (the profile's first + last name, else authStore.userEmail). */
|
|
87
92
|
userLabel?: string;
|
|
88
93
|
/** Merkliste count (favoriteStore.favoritesIDs.length) — badge on the heart + menu row. */
|
|
89
94
|
favoritesCount?: number;
|
|
90
95
|
/** unread Suchaufträge count — badge on the bell. Defaults to 0 (no badge). */
|
|
91
96
|
notificationCount?: number;
|
|
92
|
-
/** placed-orders count (profileStore.totalOrdered) —
|
|
97
|
+
/** placed-orders count (profileStore.totalOrdered) — the "Meine Bestellung" row shows only above 0. */
|
|
93
98
|
ordersCount?: number;
|
|
99
|
+
/** saved searches (filterStore.savedSearchStrings.length) — badge on the "Gespeicherte Suchen" row. */
|
|
100
|
+
savedSearchesCount?: number;
|
|
101
|
+
/** cars picked for comparison (compareStore.vehiclesIDsToCompare.length) — badge on "Fahrzeuge vergleichen". */
|
|
102
|
+
compareCount?: number;
|
|
94
103
|
/** active language tag (appStore.language) — ticks the current language row. */
|
|
95
104
|
language?: string;
|
|
96
105
|
/** dealer-main account (authStore.isDealerMain) — shows the dealer menu section. */
|
|
@@ -138,6 +147,8 @@ const TopBar: React.FunctionComponent<TopBarProps> = ({
|
|
|
138
147
|
favoritesCount = 0,
|
|
139
148
|
notificationCount = 0,
|
|
140
149
|
ordersCount = 0,
|
|
150
|
+
savedSearchesCount = 0,
|
|
151
|
+
compareCount = 0,
|
|
141
152
|
language = 'de',
|
|
142
153
|
isDealerMain = false,
|
|
143
154
|
dealers = [],
|
|
@@ -206,280 +217,109 @@ const TopBar: React.FunctionComponent<TopBarProps> = ({
|
|
|
206
217
|
</nav>
|
|
207
218
|
);
|
|
208
219
|
|
|
209
|
-
/** one
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
border: 0,
|
|
223
|
-
background: opts && opts.primary ? 'var(--md-primary)' : 'transparent',
|
|
224
|
-
color: opts && opts.primary ? '#fff' : 'var(--md-on-surface)',
|
|
225
|
-
borderRadius: opts && opts.primary ? 'var(--md-r-full)' : 0,
|
|
226
|
-
margin: opts && opts.primary ? '0 0 6px' : 0,
|
|
227
|
-
cursor: 'pointer',
|
|
228
|
-
font: 'inherit',
|
|
229
|
-
fontWeight: opts && opts.primary ? 700 : 500,
|
|
230
|
-
justifyContent: opts && opts.primary ? 'center' : 'flex-start',
|
|
231
|
-
textAlign: 'left',
|
|
232
|
-
}}
|
|
233
|
-
>
|
|
234
|
-
{opts && opts.icon && <Icon name={opts.icon} size={17} style={{ flex: 'none' }} />}
|
|
235
|
-
<span style={{ flex: 1 }}>{label}</span>
|
|
236
|
-
{opts && typeof opts.badge === 'number' && (
|
|
237
|
-
<span className="md-label-sm" style={{ fontWeight: 700 }}>{opts.badge}</span>
|
|
238
|
-
)}
|
|
220
|
+
/** one Konto-menu row (Figma "acct-row"): 22px icon, label, count badge when above 0. `icon` is a
|
|
221
|
+
* Figma glyph; `lucide` is a lib Icon for the rows Figma doesn't draw (guest, dealer). */
|
|
222
|
+
const acctRow = (
|
|
223
|
+
key: string,
|
|
224
|
+
label: string,
|
|
225
|
+
onClick: () => void,
|
|
226
|
+
opts: { icon?: AccountMenuIconName; lucide?: string; badge?: number } = {},
|
|
227
|
+
): JSX.Element => (
|
|
228
|
+
<button key={key} type="button" className="acct-row" onClick={onClick}>
|
|
229
|
+
{opts.icon && <AccountMenuIcon name={opts.icon} />}
|
|
230
|
+
{opts.lucide && <Icon name={opts.lucide} size={22} stroke={ACCT_ICON_STROKE} cls="acct-icon" />}
|
|
231
|
+
<span className="acct-label">{label}</span>
|
|
232
|
+
{!!opts.badge && opts.badge > 0 && <span className="acct-badge">{opts.badge}</span>}
|
|
239
233
|
</button>
|
|
240
234
|
);
|
|
241
235
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
)
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
gap: 12,
|
|
263
|
-
width: '100%',
|
|
264
|
-
padding: '13px 4px',
|
|
265
|
-
border: 0,
|
|
266
|
-
background: 'transparent',
|
|
267
|
-
color: 'var(--md-on-surface)',
|
|
268
|
-
cursor: 'pointer',
|
|
269
|
-
font: 'inherit',
|
|
270
|
-
fontWeight: 500,
|
|
271
|
-
textAlign: 'left',
|
|
272
|
-
}}
|
|
273
|
-
>
|
|
274
|
-
{opts && opts.icon && <Icon name={opts.icon} size={19} style={{ flex: 'none', color: 'var(--md-on-surface-variant)' }} />}
|
|
275
|
-
<span style={{ flex: 1, fontSize: 15 }}>{label}</span>
|
|
276
|
-
{opts && typeof opts.badge === 'number' && opts.badge > 0 && (
|
|
277
|
-
<span className="md-label-sm" style={{ fontWeight: 700 }}>{opts.badge}</span>
|
|
278
|
-
)}
|
|
279
|
-
<Icon name="chevron-right" size={18} style={{ flex: 'none', color: 'var(--md-on-surface-variant)' }} />
|
|
280
|
-
</button>
|
|
236
|
+
/** language rows — not in the Figma menu, kept for phones: the header's DE/EN switch is hidden
|
|
237
|
+
* ≤600px, so this group (show-mobile) is the only language switch there. */
|
|
238
|
+
const renderLanguageRows = (): JSX.Element => (
|
|
239
|
+
<div className="acct-list show-mobile">
|
|
240
|
+
{LANGS.map(([code, label]) => (
|
|
241
|
+
<button
|
|
242
|
+
key={`lang-${code}`}
|
|
243
|
+
type="button"
|
|
244
|
+
className="acct-row"
|
|
245
|
+
aria-pressed={language === code}
|
|
246
|
+
onClick={() => { setAccount(false); if (onLangSelect) onLangSelect(code); }}
|
|
247
|
+
>
|
|
248
|
+
<span className="acct-flag"><Flag code={code} /></span>
|
|
249
|
+
<span className="acct-label">{label}</span>
|
|
250
|
+
{language === code && (
|
|
251
|
+
<span className="acct-check"><Icon name="check" size={13} color="#fff" stroke={3} /></span>
|
|
252
|
+
)}
|
|
253
|
+
</button>
|
|
254
|
+
))}
|
|
255
|
+
</div>
|
|
281
256
|
);
|
|
282
257
|
|
|
283
|
-
/**
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
<button
|
|
290
|
-
key={`mlang-${code}`}
|
|
291
|
-
type="button"
|
|
292
|
-
onClick={() => { setAccount(false); if (onLangSelect) onLangSelect(code); }}
|
|
293
|
-
style={{
|
|
294
|
-
display: 'flex',
|
|
295
|
-
alignItems: 'center',
|
|
296
|
-
gap: 12,
|
|
297
|
-
width: '100%',
|
|
298
|
-
padding: '10px 4px',
|
|
299
|
-
border: 0,
|
|
300
|
-
background: 'transparent',
|
|
301
|
-
cursor: 'pointer',
|
|
302
|
-
font: 'inherit',
|
|
303
|
-
textAlign: 'left',
|
|
304
|
-
}}
|
|
305
|
-
>
|
|
306
|
-
<Flag code={code} />
|
|
307
|
-
<span style={{ flex: 1, fontSize: 15, color: 'var(--md-on-surface)' }}>{label}</span>
|
|
308
|
-
{active && (
|
|
309
|
-
<span
|
|
310
|
-
style={{
|
|
311
|
-
width: 20, height: 20, borderRadius: '50%', background: 'var(--md-primary)',
|
|
312
|
-
display: 'flex', alignItems: 'center', justifyContent: 'center', flex: 'none',
|
|
313
|
-
}}
|
|
314
|
-
>
|
|
315
|
-
<Icon name="check" size={13} color="#fff" stroke={3} />
|
|
316
|
-
</span>
|
|
317
|
-
)}
|
|
318
|
-
</button>
|
|
319
|
-
);
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
/** Mobile-only "Account Layer" — a full-width sheet under the header (Figma: "03 | Account
|
|
323
|
-
* Layer"), replacing the desktop popover's small 264px card on mobile widths. Shown/hidden
|
|
324
|
-
* purely via the `show-mobile`/`hide-mobile` CSS classes (this project's existing convention —
|
|
325
|
-
* see the hamburger button/topbar-menu above), not JS width checks. */
|
|
326
|
-
const renderMobileAccountLayer = (): JSX.Element => (
|
|
327
|
-
<div className="amenu-mobile show-mobile mcard" style={{ flexDirection: 'column' }}>
|
|
328
|
-
<div style={{ padding: '20px 20px 8px', textAlign: isAuthorized ? 'left' : 'center' }}>
|
|
258
|
+
/** Konto menu (Figma "Kontomenü (geöffnet)", 64243:14205 desktop / 64243:14299 mobile — the same
|
|
259
|
+
* 312px dropdown at every width): the name, then groups split by lines. Dealer and guest rows,
|
|
260
|
+
* which Figma doesn't draw, use the same row style. */
|
|
261
|
+
const renderAccountMenu = (): JSX.Element => (
|
|
262
|
+
<div className="acct-menu">
|
|
263
|
+
<div className="acct-scroll">
|
|
329
264
|
{isAuthorized ? (
|
|
330
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
|
331
|
-
<span
|
|
332
|
-
style={{
|
|
333
|
-
width: 44, height: 44, borderRadius: '50%', flex: 'none',
|
|
334
|
-
background: 'color-mix(in srgb, var(--md-primary) 15%, transparent)',
|
|
335
|
-
color: 'var(--md-primary)', display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
336
|
-
fontWeight: 700, fontSize: 16,
|
|
337
|
-
}}
|
|
338
|
-
>
|
|
339
|
-
{avatarInitial}
|
|
340
|
-
</span>
|
|
341
|
-
<div style={{ flex: 1, minWidth: 0 }}>
|
|
342
|
-
<div className="md-title-sm" style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
|
343
|
-
{userLabel}
|
|
344
|
-
</div>
|
|
345
|
-
<a
|
|
346
|
-
onClick={() => goRoute(R_SETTINGS)}
|
|
347
|
-
className="md-label"
|
|
348
|
-
style={{ color: 'var(--md-primary)', cursor: 'pointer', fontWeight: 600 }}
|
|
349
|
-
>
|
|
350
|
-
{t('autobahn:chrome.myProfile')} ›
|
|
351
|
-
</a>
|
|
352
|
-
</div>
|
|
353
|
-
</div>
|
|
354
|
-
) : (
|
|
355
265
|
<>
|
|
356
|
-
<
|
|
357
|
-
|
|
358
|
-
width: 44, height: 44, borderRadius: '50%', margin: '0 auto 14px',
|
|
359
|
-
background: 'var(--md-outline-variant)', color: 'var(--md-on-surface-variant)',
|
|
360
|
-
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
361
|
-
}}
|
|
362
|
-
>
|
|
363
|
-
<Icon name="user" size={22} />
|
|
364
|
-
</span>
|
|
365
|
-
<div className="md-headline-sm" style={{ fontWeight: 700, marginBottom: 6 }}>
|
|
366
|
-
{t('autobahn:chrome.welcome')}
|
|
266
|
+
<div className="acct-head">
|
|
267
|
+
<span className="acct-name">{userLabel || t('autobahn:chrome.myAccount')}</span>
|
|
367
268
|
</div>
|
|
368
|
-
<div className="
|
|
369
|
-
{
|
|
269
|
+
<div className="acct-list">
|
|
270
|
+
{/* dealer-main users get the same route via the "Händler-Dashboard" row below */}
|
|
271
|
+
{!isDealerMain &&
|
|
272
|
+
acctRow('overview', t('autobahn:chrome.acct.overview'), () => goRoute(R_DASHBOARD), { icon: 'layout-grid' })}
|
|
273
|
+
{ordersCount > 0 &&
|
|
274
|
+
acctRow('myOrder', t('autobahn:chrome.acct.myOrder'), () => goRoute(R_MY_ORDERS), { icon: 'car-front' })}
|
|
275
|
+
{acctRow('savedSearches', t('autobahn:chrome.acct.savedSearches'), () => goRoute(R_SAVED_SEARCHES), { icon: 'bookmark', badge: savedSearchesCount })}
|
|
276
|
+
{acctRow('favorites', t('autobahn:chrome.acct.favorites'), () => goRoute(R_FAVOURITES), { icon: 'star', badge: favoritesCount })}
|
|
277
|
+
{acctRow('compare', t('autobahn:chrome.acct.compare'), () => goRoute(R_COMPARE), { icon: 'scale', badge: compareCount })}
|
|
278
|
+
</div>
|
|
279
|
+
<div className="acct-list">
|
|
280
|
+
{acctRow('profile', t('autobahn:chrome.acct.profile'), () => goRoute(R_SETTINGS), { icon: 'user' })}
|
|
281
|
+
</div>
|
|
282
|
+
<div className="acct-list">
|
|
283
|
+
{acctRow('support', t('autobahn:chrome.acct.support'), () => goRoute(R_KONTAKT), { icon: 'help-circle' })}
|
|
284
|
+
</div>
|
|
285
|
+
{isDealerMain && (
|
|
286
|
+
<div className="acct-list">
|
|
287
|
+
{acctRow('dealerDashboard', t('autobahn:chrome.dealerDashboard'), () => goRoute(R_DASHBOARD), { lucide: 'store' })}
|
|
288
|
+
{acctRow('imageSettings', t('autobahn:chrome.imageSettings'), () => goRoute(R_IMAGE_SETTINGS), { lucide: 'image' })}
|
|
289
|
+
{dealers.length > 1 && (
|
|
290
|
+
<>
|
|
291
|
+
<div className="acct-sub">{t('autobahn:chrome.myDealers')} ({dealers.length})</div>
|
|
292
|
+
{dealers.map((d) =>
|
|
293
|
+
acctRow(`dealer-${d.dealer.id}`, d.dealer.email, () => {
|
|
294
|
+
setAccount(false);
|
|
295
|
+
if (!d.isActive && onDealerSelect) onDealerSelect(d.dealer.id);
|
|
296
|
+
}, { lucide: d.isActive ? 'check' : 'store' }),
|
|
297
|
+
)}
|
|
298
|
+
</>
|
|
299
|
+
)}
|
|
300
|
+
</div>
|
|
301
|
+
)}
|
|
302
|
+
{renderLanguageRows()}
|
|
303
|
+
<div className="acct-list">
|
|
304
|
+
{acctRow('signOut', t('autobahn:chrome.signOut'), () => { setAccount(false); if (onSignOut) onSignOut(); }, { icon: 'log-out' })}
|
|
370
305
|
</div>
|
|
371
|
-
</>
|
|
372
|
-
)}
|
|
373
|
-
</div>
|
|
374
|
-
|
|
375
|
-
<div style={{ padding: '4px 20px 8px' }}>
|
|
376
|
-
{isAuthorized ? (
|
|
377
|
-
<>
|
|
378
|
-
{!isDealerMain &&
|
|
379
|
-
mrow('m-dashboard', t('autobahn:chrome.dashboard'), () => goRoute(R_DASHBOARD), { icon: 'layout-grid' })}
|
|
380
|
-
{mrow('m-vehicles', t('autobahn:chrome.myVehicles'), () => goRoute(R_MY_VEHICLES), { icon: 'car' })}
|
|
381
|
-
{mrow('m-searches', t('autobahn:chrome.savedSearches'), () => goRoute(R_SAVED_SEARCHES), { icon: 'bell' })}
|
|
382
|
-
{mrow('m-favorites', t('autobahn:chrome.favorites'), () => goRoute(R_FAVOURITES), { icon: 'heart', badge: favoritesCount })}
|
|
383
|
-
{mrow('m-settings', t('autobahn:chrome.settings'), () => goRoute(R_SETTINGS), { icon: 'settings' })}
|
|
384
|
-
{mrow('m-help', t('autobahn:chrome.helpContact'), () => goRoute(R_KONTAKT), { icon: 'help-circle' })}
|
|
385
|
-
{isDealerMain && mrow('m-dealer', t('autobahn:chrome.dealerDashboard'), () => goRoute(R_DASHBOARD), { icon: 'store' })}
|
|
386
|
-
{mrow('m-signout', t('autobahn:chrome.signOut'), () => { setAccount(false); if (onSignOut) onSignOut(); }, { icon: 'log-out' })}
|
|
387
306
|
</>
|
|
388
307
|
) : (
|
|
389
308
|
<>
|
|
390
|
-
<
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
{
|
|
309
|
+
<div className="acct-list">
|
|
310
|
+
<div className="acct-cta">
|
|
311
|
+
<Button variant="filled" block onClick={() => goRoute(R_SIGN_IN)}>{t('autobahn:chrome.signIn')}</Button>
|
|
312
|
+
</div>
|
|
313
|
+
{acctRow('register', t('autobahn:chrome.register'), () => goRoute(R_SIGN_UP), { lucide: 'user-plus' })}
|
|
314
|
+
{acctRow('dealerSignUp', t('autobahn:chrome.dealerSignUp'), () => goRoute(R_DEALER), { lucide: 'store' })}
|
|
315
|
+
</div>
|
|
316
|
+
<div className="acct-list">
|
|
317
|
+
{acctRow('favorites', t('autobahn:chrome.acct.favorites'), () => goRoute(R_FAVOURITES), { icon: 'star', badge: favoritesCount })}
|
|
318
|
+
</div>
|
|
319
|
+
{renderLanguageRows()}
|
|
401
320
|
</>
|
|
402
321
|
)}
|
|
403
322
|
</div>
|
|
404
|
-
|
|
405
|
-
{divider('m-d1')}
|
|
406
|
-
|
|
407
|
-
<div style={{ padding: '8px 20px 20px' }}>
|
|
408
|
-
<div className="md-label-sm" style={{ color: 'var(--md-on-surface-variant)', padding: '4px 4px 6px' }}>
|
|
409
|
-
{t('autobahn:chrome.language')}
|
|
410
|
-
</div>
|
|
411
|
-
{LANGS.map(([code, label]) => mLangRow(code, label))}
|
|
412
|
-
</div>
|
|
413
|
-
</div>
|
|
414
|
-
);
|
|
415
|
-
|
|
416
|
-
const renderAccountMenu = (): JSX.Element => (
|
|
417
|
-
<div
|
|
418
|
-
className="amenu mcard hide-mobile"
|
|
419
|
-
style={{
|
|
420
|
-
position: 'absolute',
|
|
421
|
-
top: 'calc(100% + 8px)',
|
|
422
|
-
right: 0,
|
|
423
|
-
width: 264,
|
|
424
|
-
padding: 8,
|
|
425
|
-
zIndex: 60,
|
|
426
|
-
boxShadow: 'var(--md-elev-2)',
|
|
427
|
-
}}
|
|
428
|
-
>
|
|
429
|
-
{isAuthorized ? (
|
|
430
|
-
<>
|
|
431
|
-
<div className="md-label-sm" style={{ padding: '6px 14px 8px', color: 'var(--md-on-surface-variant)' }}>
|
|
432
|
-
{userLabel || t('autobahn:chrome.myAccount')}
|
|
433
|
-
</div>
|
|
434
|
-
{/* dealer-main users get the same route via the dedicated "Händler-Dashboard" row below */}
|
|
435
|
-
{!isDealerMain &&
|
|
436
|
-
row('autobahn:chrome.dashboard', t('autobahn:chrome.dashboard'), () => goRoute(R_DASHBOARD), { icon: 'layout-grid' })}
|
|
437
|
-
{row('autobahn:chrome.myVehicles', t('autobahn:chrome.myVehicles'), () => goRoute(R_MY_VEHICLES), { icon: 'car' })}
|
|
438
|
-
{ordersCount > 0 &&
|
|
439
|
-
row('autobahn:chrome.myOrders', t('autobahn:chrome.myOrders'), () => goRoute(R_MY_ORDERS), { icon: 'package', badge: ordersCount })}
|
|
440
|
-
{row('autobahn:chrome.savedSearches', t('autobahn:chrome.savedSearches'), () => goRoute(R_SAVED_SEARCHES), { icon: 'bell' })}
|
|
441
|
-
{row('autobahn:chrome.favorites', t('autobahn:chrome.favorites'), () => goRoute(R_FAVOURITES), { icon: 'heart', badge: favoritesCount })}
|
|
442
|
-
{row('autobahn:chrome.settings', t('autobahn:chrome.settings'), () => goRoute(R_SETTINGS), { icon: 'settings' })}
|
|
443
|
-
{row('autobahn:chrome.helpContact', t('autobahn:chrome.helpContact'), () => goRoute(R_KONTAKT), { icon: 'help-circle' })}
|
|
444
|
-
{isDealerMain && (
|
|
445
|
-
<>
|
|
446
|
-
{divider('d-dealer')}
|
|
447
|
-
{row('autobahn:chrome.dealerDashboard', t('autobahn:chrome.dealerDashboard'), () => goRoute(R_DASHBOARD), { icon: 'store' })}
|
|
448
|
-
{row('autobahn:chrome.imageSettings', t('autobahn:chrome.imageSettings'), () => goRoute(R_IMAGE_SETTINGS), { icon: 'image' })}
|
|
449
|
-
</>
|
|
450
|
-
)}
|
|
451
|
-
{dealers.length > 1 && (
|
|
452
|
-
<>
|
|
453
|
-
<div className="md-label-sm" style={{ padding: '8px 14px 4px', color: 'var(--md-on-surface-variant)' }}>
|
|
454
|
-
{t('autobahn:chrome.myDealers')} ({dealers.length})
|
|
455
|
-
</div>
|
|
456
|
-
{dealers.map((d) =>
|
|
457
|
-
row(`dealer-${d.dealer.id}`, d.dealer.email, () => {
|
|
458
|
-
setAccount(false);
|
|
459
|
-
if (!d.isActive && onDealerSelect) onDealerSelect(d.dealer.id);
|
|
460
|
-
}, { icon: d.isActive ? 'check' : 'store' }),
|
|
461
|
-
)}
|
|
462
|
-
</>
|
|
463
|
-
)}
|
|
464
|
-
{divider('d1')}
|
|
465
|
-
{row('autobahn:chrome.signOut', t('autobahn:chrome.signOut'), () => { setAccount(false); if (onSignOut) onSignOut(); }, { icon: 'log-out' })}
|
|
466
|
-
</>
|
|
467
|
-
) : (
|
|
468
|
-
<>
|
|
469
|
-
{row('autobahn:chrome.signIn', t('autobahn:chrome.signIn'), () => goRoute(R_SIGN_IN), { primary: true })}
|
|
470
|
-
{row('autobahn:chrome.register', t('autobahn:chrome.register'), () => goRoute(R_SIGN_UP), { icon: 'user-plus' })}
|
|
471
|
-
{row('autobahn:chrome.dealerSignUp', t('autobahn:chrome.dealerSignUp'), () => goRoute(R_DEALER), { icon: 'store' })}
|
|
472
|
-
{divider('d1')}
|
|
473
|
-
{row('autobahn:chrome.favorites', t('autobahn:chrome.favorites'), () => goRoute(R_FAVOURITES), { icon: 'heart', badge: favoritesCount })}
|
|
474
|
-
</>
|
|
475
|
-
)}
|
|
476
|
-
{divider('d2')}
|
|
477
|
-
<div className="md-label-sm" style={{ padding: '4px 14px', color: 'var(--md-on-surface-variant)' }}>{t('autobahn:chrome.language')}</div>
|
|
478
|
-
{LANGS.map(([code, label]) =>
|
|
479
|
-
row(`lang-${code}`, label, () => { setAccount(false); if (onLangSelect) onLangSelect(code); }, {
|
|
480
|
-
icon: language === code ? 'check' : 'globe',
|
|
481
|
-
}),
|
|
482
|
-
)}
|
|
483
323
|
</div>
|
|
484
324
|
);
|
|
485
325
|
|
|
@@ -569,11 +409,11 @@ const TopBar: React.FunctionComponent<TopBarProps> = ({
|
|
|
569
409
|
</div>
|
|
570
410
|
)}
|
|
571
411
|
|
|
572
|
-
{/* Konto trigger +
|
|
573
|
-
|
|
412
|
+
{/* Konto trigger + menu — visible at EVERY width: this menu is the only place sign-out /
|
|
413
|
+
settings / dealer switching exist, so it must never be display:none'd (the
|
|
574
414
|
pre-cutover hide-tablet left 601–980px with no logout at all). Desktop keeps the
|
|
575
415
|
tonal "Konto" pill; ≤600px it collapses to a plain icon (topbar-account-btn CSS) and
|
|
576
|
-
opens the
|
|
416
|
+
opens the same 312px menu (Figma draws the phone one the same). */}
|
|
577
417
|
<span style={{ position: 'relative', display: 'inline-flex' }}>
|
|
578
418
|
<button
|
|
579
419
|
className="mbtn mbtn--tonal mbtn--sm topbar-account-btn"
|
|
@@ -589,8 +429,6 @@ const TopBar: React.FunctionComponent<TopBarProps> = ({
|
|
|
589
429
|
</div>
|
|
590
430
|
</div>
|
|
591
431
|
|
|
592
|
-
{account && renderMobileAccountLayer()}
|
|
593
|
-
|
|
594
432
|
{/* click-away backdrop for the account popover */}
|
|
595
433
|
{account && (
|
|
596
434
|
<div
|
package/locales/de/autobahn.json
CHANGED
|
@@ -277,7 +277,16 @@
|
|
|
277
277
|
"myDealers": "Meine Händler",
|
|
278
278
|
"dashboard": "Dashboard",
|
|
279
279
|
"dealerDashboard": "Händler-Dashboard",
|
|
280
|
-
"imageSettings": "Bildeinstellungen"
|
|
280
|
+
"imageSettings": "Bildeinstellungen",
|
|
281
|
+
"acct": {
|
|
282
|
+
"overview": "Übersicht",
|
|
283
|
+
"myOrder": "Meine Bestellung",
|
|
284
|
+
"savedSearches": "Gespeicherte Suchen",
|
|
285
|
+
"favorites": "Favoriten",
|
|
286
|
+
"compare": "Fahrzeuge vergleichen",
|
|
287
|
+
"profile": "Profil",
|
|
288
|
+
"support": "Support & Rückruf"
|
|
289
|
+
}
|
|
281
290
|
},
|
|
282
291
|
"srp": {
|
|
283
292
|
"trust": {
|
package/locales/en/autobahn.json
CHANGED
|
@@ -277,7 +277,16 @@
|
|
|
277
277
|
"myDealers": "My dealers",
|
|
278
278
|
"dashboard": "Dashboard",
|
|
279
279
|
"dealerDashboard": "Dealer dashboard",
|
|
280
|
-
"imageSettings": "Image settings"
|
|
280
|
+
"imageSettings": "Image settings",
|
|
281
|
+
"acct": {
|
|
282
|
+
"overview": "Overview",
|
|
283
|
+
"myOrder": "My order",
|
|
284
|
+
"savedSearches": "Saved searches",
|
|
285
|
+
"favorites": "Favorites",
|
|
286
|
+
"compare": "Compare vehicles",
|
|
287
|
+
"profile": "Profile",
|
|
288
|
+
"support": "Support & callback"
|
|
289
|
+
}
|
|
281
290
|
},
|
|
282
291
|
"srp": {
|
|
283
292
|
"trust": {
|
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bytebrand/fe-ui-core-autobahn",
|
|
3
|
-
"version": "1.0.
|
|
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
|
-
"main": "index.ts",
|
|
6
|
-
"license": "UNLICENSED",
|
|
7
|
-
"peerDependencies": {
|
|
8
|
-
"react": "^18.0.0",
|
|
9
|
-
"react-dom": "^18.0.0"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@bytebrand/car-schema-selectors": "^2.0.7",
|
|
13
|
-
"@bytebrand/fe-financing": "^5.14.20",
|
|
14
|
-
"classnames": "2.2.6",
|
|
15
|
-
"clsx": "^2.1.1",
|
|
16
|
-
"d3-format": "1.4.5",
|
|
17
|
-
"js-cookie": "^2.2.0",
|
|
18
|
-
"lodash": "^4.17.21",
|
|
19
|
-
"lucide-react": "^0.288.0",
|
|
20
|
-
"mobx-react": "^7.6.0",
|
|
21
|
-
"moment": "^2.29.1",
|
|
22
|
-
"qs": "^6.6.0",
|
|
23
|
-
"react-device-detect": "^2.1.2",
|
|
24
|
-
"react-grid-system": "^5.0.2",
|
|
25
|
-
"react-lazyload": "^3.2.0",
|
|
26
|
-
"react-scroll": "^1.9.3",
|
|
27
|
-
"react-slick": "^0.29.0",
|
|
28
|
-
"slick-carousel": "1.8.1"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@bytebrand/fe-ui-core-autobahn",
|
|
3
|
+
"version": "1.0.168",
|
|
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
|
+
"main": "index.ts",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"react": "^18.0.0",
|
|
9
|
+
"react-dom": "^18.0.0"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@bytebrand/car-schema-selectors": "^2.0.7",
|
|
13
|
+
"@bytebrand/fe-financing": "^5.14.20",
|
|
14
|
+
"classnames": "2.2.6",
|
|
15
|
+
"clsx": "^2.1.1",
|
|
16
|
+
"d3-format": "1.4.5",
|
|
17
|
+
"js-cookie": "^2.2.0",
|
|
18
|
+
"lodash": "^4.17.21",
|
|
19
|
+
"lucide-react": "^0.288.0",
|
|
20
|
+
"mobx-react": "^7.6.0",
|
|
21
|
+
"moment": "^2.29.1",
|
|
22
|
+
"qs": "^6.6.0",
|
|
23
|
+
"react-device-detect": "^2.1.2",
|
|
24
|
+
"react-grid-system": "^5.0.2",
|
|
25
|
+
"react-lazyload": "^3.2.0",
|
|
26
|
+
"react-scroll": "^1.9.3",
|
|
27
|
+
"react-slick": "^0.29.0",
|
|
28
|
+
"slick-carousel": "1.8.1"
|
|
29
|
+
}
|
|
30
|
+
}
|
package/theme/md3.css
CHANGED
|
@@ -10355,33 +10355,133 @@ line-height: 31px;
|
|
|
10355
10355
|
}
|
|
10356
10356
|
}
|
|
10357
10357
|
|
|
10358
|
-
/*
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
.md3 .
|
|
10362
|
-
/* NOT full-width — measured against the real Figma export: the panel is anchored to the
|
|
10363
|
-
RIGHT edge, leaving ~22% of the viewport showing the dimmed page on the left (both the
|
|
10364
|
-
logged-out and logged-in mockups measured close to this, not identical px-for-px, so this
|
|
10365
|
-
is the representative middle value rather than either exact reading). */
|
|
10358
|
+
/* Konto menu (TopBar) — Figma "Konto / Kontomenü" (64243:14111): the same 312px dropdown at every
|
|
10359
|
+
width. Figma's strokes are inside and take no layout room (473px tall), so the outer line is an
|
|
10360
|
+
overlay and the head/group lines are inset shadows — a border would add a px per line. */
|
|
10361
|
+
.md3 .acct-menu {
|
|
10366
10362
|
position: absolute;
|
|
10367
|
-
top: 100
|
|
10368
|
-
left: 22%;
|
|
10363
|
+
top: calc(100% + 8px);
|
|
10369
10364
|
right: 0;
|
|
10370
|
-
background: var(--md-surface);
|
|
10371
|
-
box-shadow: var(--md-elev-2);
|
|
10372
10365
|
z-index: 60;
|
|
10373
|
-
|
|
10366
|
+
width: 312px;
|
|
10367
|
+
max-width: calc(100vw - 24px);
|
|
10368
|
+
background: #fff;
|
|
10369
|
+
border-radius: 16px;
|
|
10370
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
|
|
10371
|
+
overflow: hidden;
|
|
10372
|
+
font-family: 'Arimo';
|
|
10373
|
+
color: #0e2238;
|
|
10374
|
+
text-align: left;
|
|
10375
|
+
}
|
|
10376
|
+
.md3 .acct-menu::after {
|
|
10377
|
+
content: '';
|
|
10378
|
+
position: absolute;
|
|
10379
|
+
inset: 0;
|
|
10380
|
+
border: 1px solid #c5c6d2;
|
|
10381
|
+
border-radius: inherit;
|
|
10382
|
+
pointer-events: none;
|
|
10383
|
+
}
|
|
10384
|
+
/* short phones: the menu sits in the sticky header, so scroll inside it instead of past the screen
|
|
10385
|
+
(it starts ~64px down; dvh = the space left by the browser bars) */
|
|
10386
|
+
.md3 .acct-scroll {
|
|
10387
|
+
max-height: calc(100vh - 72px);
|
|
10388
|
+
max-height: calc(100dvh - 72px);
|
|
10374
10389
|
overflow-y: auto;
|
|
10375
|
-
/* only the LEFT corners are visually rounded (top-left, bottom-left) — the right edge sits
|
|
10376
|
-
flush against the viewport's own right edge, so rounding there would be invisible anyway.
|
|
10377
|
-
(This element is already show-mobile-gated, so no extra media query needed here.) */
|
|
10378
|
-
border-radius: 20px 0 0 20px;
|
|
10379
10390
|
}
|
|
10380
|
-
.md3 .
|
|
10381
|
-
|
|
10391
|
+
.md3 .acct-head {
|
|
10392
|
+
display: flex;
|
|
10393
|
+
justify-content: center;
|
|
10394
|
+
padding: 18px 16px;
|
|
10395
|
+
box-shadow: inset 0 -1px 0 #c5c6d2;
|
|
10396
|
+
}
|
|
10397
|
+
.md3 .acct-name {
|
|
10398
|
+
font-size: 16px;
|
|
10399
|
+
font-weight: 700;
|
|
10400
|
+
line-height: 21px;
|
|
10401
|
+
white-space: nowrap;
|
|
10402
|
+
overflow: hidden;
|
|
10403
|
+
text-overflow: ellipsis;
|
|
10404
|
+
}
|
|
10405
|
+
.md3 .acct-list {
|
|
10406
|
+
display: flex;
|
|
10407
|
+
flex-direction: column;
|
|
10408
|
+
padding: 6px 0;
|
|
10409
|
+
}
|
|
10410
|
+
.md3 .acct-list + .acct-list {
|
|
10411
|
+
box-shadow: inset 0 1px 0 #c5c6d2;
|
|
10412
|
+
}
|
|
10413
|
+
.md3 .acct-row {
|
|
10414
|
+
display: flex;
|
|
10415
|
+
align-items: center;
|
|
10416
|
+
gap: 14px;
|
|
10417
|
+
width: 100%;
|
|
10418
|
+
height: 46px;
|
|
10419
|
+
padding: 13px 18px;
|
|
10420
|
+
border: 0;
|
|
10421
|
+
background: transparent;
|
|
10422
|
+
color: inherit;
|
|
10423
|
+
font: inherit;
|
|
10424
|
+
text-align: left;
|
|
10425
|
+
cursor: pointer;
|
|
10426
|
+
}
|
|
10427
|
+
.md3 .acct-row:hover {
|
|
10428
|
+
background: color-mix(in srgb, #0e2238 5%, transparent);
|
|
10429
|
+
}
|
|
10430
|
+
.md3 .acct-icon {
|
|
10431
|
+
flex: none;
|
|
10432
|
+
width: 22px;
|
|
10433
|
+
height: 22px;
|
|
10434
|
+
color: #5b6b7f;
|
|
10435
|
+
}
|
|
10436
|
+
.md3 .acct-label {
|
|
10437
|
+
flex: 1 0 0;
|
|
10438
|
+
min-width: 1px;
|
|
10439
|
+
font-size: 15px;
|
|
10440
|
+
font-weight: 400;
|
|
10441
|
+
line-height: 20px;
|
|
10442
|
+
}
|
|
10443
|
+
.md3 .acct-badge {
|
|
10444
|
+
flex: none;
|
|
10445
|
+
display: flex;
|
|
10446
|
+
align-items: center;
|
|
10447
|
+
justify-content: center;
|
|
10448
|
+
height: 22px;
|
|
10449
|
+
padding: 0 8px;
|
|
10450
|
+
border-radius: 999px;
|
|
10451
|
+
background: #005cff;
|
|
10452
|
+
color: #fff;
|
|
10453
|
+
font-size: 12.5px;
|
|
10454
|
+
font-weight: 700;
|
|
10455
|
+
line-height: 16px;
|
|
10456
|
+
}
|
|
10457
|
+
/* rows Figma doesn't draw: language (phones), dealer list, guest sign-in */
|
|
10458
|
+
.md3 .acct-flag {
|
|
10459
|
+
flex: none;
|
|
10460
|
+
display: flex;
|
|
10461
|
+
align-items: center;
|
|
10462
|
+
justify-content: center;
|
|
10463
|
+
width: 22px;
|
|
10464
|
+
}
|
|
10465
|
+
.md3 .acct-check {
|
|
10466
|
+
flex: none;
|
|
10467
|
+
display: flex;
|
|
10468
|
+
align-items: center;
|
|
10469
|
+
justify-content: center;
|
|
10470
|
+
width: 20px;
|
|
10471
|
+
height: 20px;
|
|
10472
|
+
border-radius: 50%;
|
|
10473
|
+
background: #005cff;
|
|
10474
|
+
}
|
|
10475
|
+
.md3 .acct-sub {
|
|
10476
|
+
padding: 8px 18px 4px;
|
|
10477
|
+
font-size: 12.5px;
|
|
10478
|
+
line-height: 16px;
|
|
10479
|
+
color: #5b6b7f;
|
|
10480
|
+
}
|
|
10481
|
+
.md3 .acct-cta {
|
|
10482
|
+
padding: 6px 18px 4px;
|
|
10382
10483
|
}
|
|
10383
|
-
/* desktop "Konto" pill collapses to a plain icon-only button on mobile
|
|
10384
|
-
replaces the small popover the pill normally opens on wider screens. */
|
|
10484
|
+
/* desktop "Konto" pill collapses to a plain icon-only button on mobile; it opens the same menu. */
|
|
10385
10485
|
@media (max-width: 600px) {
|
|
10386
10486
|
/* "Header-System" spec dimensions (390px reference) — all scoped to the TopBar's own <header>
|
|
10387
10487
|
(or a dedicated class) so none of this touches .icon-btn/.mbtn/.container usage elsewhere in
|
|
@@ -1,25 +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
|
-
}
|
|
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
|
+
}
|