@bytebrand/fe-ui-core-autobahn 1.0.210 → 1.0.211

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.
Files changed (43) hide show
  1. package/cards/CarCard.tsx +12 -43
  2. package/cards/CarCardSkeleton.tsx +103 -0
  3. package/cards/CarRowSkeleton.tsx +152 -0
  4. package/cards/cardParts.tsx +1 -6
  5. package/cards/index.ts +6 -0
  6. package/chrome/AccountMenuIcon.tsx +109 -0
  7. package/chrome/Footer.tsx +16 -3
  8. package/chrome/TopBar.tsx +139 -266
  9. package/compat/CookieModal/CookieModal.tsx +20 -6
  10. package/compat/CookieModal/Modal.tsx +6 -3
  11. package/compat/CookieModal/modals/ManageCookieModal/ManageCookieModal.tsx +43 -15
  12. package/compat/CookieModal/modals/PreviewCookieModal/PreviewCookieModal.tsx +4 -3
  13. package/compat/CookieModal/useModal.ts +5 -1
  14. package/compat/Loader/Loader.tsx +1 -7
  15. package/compat/MdField/MdField.tsx +28 -4
  16. package/compat/TimePicker/TimePicker.tsx +12 -2
  17. package/constants/app.ts +1 -11
  18. package/constants/core.ts +1 -12
  19. package/data/toAutobahnCar.ts +16 -2
  20. package/iconsvg/IconSVG.tsx +1 -5
  21. package/locales/de/autobahn.json +46 -12
  22. package/locales/en/autobahn.json +45 -11
  23. package/package.json +2 -2
  24. package/theme/md3.css +5321 -1207
  25. package/ui/CreditCostNotice.tsx +44 -44
  26. package/ui/Dropdown.tsx +29 -10
  27. package/ui/FormCheckbox.tsx +22 -2
  28. package/ui/FormField.tsx +2 -1
  29. package/ui/Icon.tsx +6 -0
  30. package/ui/MfieldCheckIcon.tsx +13 -0
  31. package/ui/Modal.tsx +84 -6
  32. package/ui/Skeleton.tsx +79 -20
  33. package/ui/index.ts +2 -0
  34. package/ui/scrollFieldIntoView.ts +41 -0
  35. package/ui/usePortalMenuPosition.ts +27 -15
  36. package/utils/cookieConsent.ts +84 -0
  37. package/utils/index.ts +10 -0
  38. package/vdp/FinanceCalculator.tsx +19 -5
  39. package/vdp/VdpModules.tsx +56 -13
  40. package/vdp/types.ts +5 -5
  41. package/vehiclesProps/accidentDisclosure.ts +25 -0
  42. package/vehiclesProps/decoratedLightProps.tsx +4 -0
  43. package/vehiclesProps/decoratedProps.tsx +4 -0
@@ -8,19 +8,43 @@ import MaterialAccordionGroup from '../../../MdAccordionGroup/MdAccordionGroup';
8
8
  import MaterialSwitch from '../../../MdSwitch/MdSwitch';
9
9
  import { COOKIE_SCHEMA, COOKIE_SCHEMA_LINKS } from '../../../../constants/common';
10
10
  import { updateCookieList } from '../../../../utils/CommonUtils';
11
+ import { saveCookieConfig } from '../../../../utils/cookieConsent';
12
+ import { TranslationFunction } from '../../../../types';
11
13
 
12
14
  import styles from './ManageCookieModal.styl';
13
15
 
14
16
  interface IManageCookieModal {
15
17
  toggleModal: () => void;
16
18
  handleSentryInit?: () => void;
19
+ /** the host's `t` with the `autobahn` namespace loaded; without it the dialog stays German (fe-landing) */
20
+ t?: TranslationFunction;
17
21
  }
18
22
 
19
23
  interface IMarketingSwitches {
20
24
  [key: string]: any;
21
25
  }
22
26
 
23
- const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModal) => {
27
+ // the German copy (locales/de/autobahn.json `cookieModal`), used as is when the host passes no `t`
28
+ const DE: Record<string, string> = {
29
+ title: 'Nach den Cookies geht die Fahrt weiter.',
30
+ manageText: 'Für ein bestmögliches Nutzererlebnis setzen wir Cookies und andere Technologien ein. Diese können Sie hier verwalten.',
31
+ 'necessary.title': 'Notwendig',
32
+ 'necessary.text': 'Wir verwenden Browser-Cookies, die notwendig sind, damit die Website wie vorgesehen funktioniert. Beispiel: Wir speichern Ihre Präferenzen bei der Datenerfassung auf der Website, damit wir sie berücksichtigen können, wenn Sie auf unsere Website zurückkehren. Sie können diese Cookies in den Einstellungen Ihres Browsers deaktivieren, aber wenn Sie dies tun, funktioniert die Website möglicherweise nicht wie vorgesehen.',
33
+ 'analytics.title': 'Analytisch',
34
+ 'analytics.text': 'Um das Nutzerverhalten zu verstehen und Ihnen ein relevanteres Surferlebnis zu bieten oder den Inhalt unserer Website zu personalisieren. Beispiel: Wir sammeln Informationen darüber, welche Seiten Sie besuchen, damit wir Ihnen relevantere Informationen präsentieren können.',
35
+ 'marketing.title': 'Marketing',
36
+ 'marketing.text': 'Zur Personalisierung und Messung der Effektivität von Werbung auf unserer Website und anderen Websites. Beispiel: Wir können Ihnen eine personalisierte Werbung auf der Grundlage der von Ihnen besuchten Seiten auf unserer Website anzeigen.',
37
+ privacyPolicy: 'Datenschutzbestimmungen',
38
+ saveSelection: 'Auswahl speichern',
39
+ acceptAll: 'Alles akzeptieren'
40
+ };
41
+
42
+ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieModal) => {
43
+ // a key the host can't resolve (namespace not loaded) comes back as the key itself
44
+ const tr = (key: string) => {
45
+ const text = t ? t(`autobahn:cookieModal.${key}`) : '';
46
+ return text && !text.endsWith(`cookieModal.${key}`) ? text : DE[key];
47
+ };
24
48
  const [analytcisMasterSwitch, setAnalyticsMasterSwitch] = useState(false);
25
49
  const [marketingMasterSwitch, setMarketingMasterSwitch] = useState(false);
26
50
  const [analyticsSwitches, setAnalyticsSwitches] = useState<IMarketingSwitches>({});
@@ -44,6 +68,10 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
44
68
  .reduce((acc, item) => ({ ...acc, [item]: !!savedConfig && !savedDisabledMarketing.includes(item) }), {});
45
69
  setAnalyticsSwitches(newAnalyticsSwitches);
46
70
  setMarketingSwitches(newMarketingSwitches);
71
+ // ADV-268: reopened from the account page, a category whose cookies are all allowed shows
72
+ // its master switch on (it always started off)
73
+ setAnalyticsMasterSwitch(Object.values(newAnalyticsSwitches).every(Boolean));
74
+ setMarketingMasterSwitch(Object.values(newMarketingSwitches).every(Boolean));
47
75
  },
48
76
  []
49
77
  );
@@ -86,7 +114,7 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
86
114
  marketing: Object.keys(marketingSwitches).filter(i => !marketingSwitches[i]) || [],
87
115
  analytics: Object.keys(analyticsSwitches).filter(i => !analyticsSwitches[i]) || []
88
116
  };
89
- localStorage.setItem('cookieConfig', JSON.stringify(cookieConfig));
117
+ saveCookieConfig(cookieConfig);
90
118
  updateCookieList(handleSentryInit);
91
119
  toggleModal();
92
120
  };
@@ -110,34 +138,34 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
110
138
  return (
111
139
  <div className={styles.modalWrapper}>
112
140
  <IconSVG name='autodeLogo' customDimensions />
113
- <div className={styles.modalTitle}>Nach den Cookies geht die Fahrt weiter.</div>
114
- <div className={styles.modalContent}>Für ein bestmögliches Nutzererlebnis setzen wir Cookies und andere Technologien ein. Diese können Sie hier verwalten.</div>
141
+ <div className={styles.modalTitle}>{tr('title')}</div>
142
+ <div className={styles.modalContent}>{tr('manageText')}</div>
115
143
  <div className={styles.accordions}>
116
144
  <MaterialAccordionGroup
117
- title='Notwendig'
145
+ title={tr('necessary.title')}
118
146
  // tooltipText='Notwendig'
119
147
  withSwitch
120
148
  switchProps={necessarySwitchProps}
121
149
  >
122
- <span className={styles.accordionDescription}>Wir verwenden Browser-Cookies, die notwendig sind, damit die Website wie vorgesehen funktioniert. Beispiel: Wir speichern Ihre Präferenzen bei der Datenerfassung auf der Website, damit wir sie berücksichtigen können, wenn Sie auf unsere Website zurückkehren. Sie können diese Cookies in den Einstellungen Ihres Browsers deaktivieren, aber wenn Sie dies tun, funktioniert die Website möglicherweise nicht wie vorgesehen.</span>
150
+ <span className={styles.accordionDescription}>{tr('necessary.text')}</span>
123
151
  {Object.keys(COOKIE_SCHEMA.necessary).map(cookie => {
124
152
  const getLinkFromCategory = _get(COOKIE_SCHEMA_LINKS, [cookie], '');
125
153
  return (
126
154
  <div className={styles.switchBlock} key={cookie} >
127
155
  <span className={styles.switchBlockTitle}>{cookie}</span>
128
- <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>Datenschutzbestimmungen</a>
156
+ <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>{tr('privacyPolicy')}</a>
129
157
  <MaterialSwitch sx={{ marginLeft: 'auto' }} disabled={true} value={true} onChange={() => {}} />
130
158
  </div>
131
159
  );
132
160
  })}
133
161
  </MaterialAccordionGroup>
134
162
  <MaterialAccordionGroup
135
- title='Analytisch'
163
+ title={tr('analytics.title')}
136
164
  withSwitch
137
165
  // tooltipText='Analytisch'
138
166
  switchProps={analyticsSwitchProps}
139
167
  >
140
- <span className={styles.accordionDescription}>Um das Nutzerverhalten zu verstehen und Ihnen ein relevanteres Surferlebnis zu bieten oder den Inhalt unserer Website zu personalisieren. Beispiel: Wir sammeln Informationen darüber, welche Seiten Sie besuchen, damit wir Ihnen relevantere Informationen präsentieren können.</span>
168
+ <span className={styles.accordionDescription}>{tr('analytics.text')}</span>
141
169
  {Object.keys(COOKIE_SCHEMA.analytics).map(cookie => {
142
170
  const getItemsFromCategory = _get(COOKIE_SCHEMA, `analytics['${cookie}']`, null);
143
171
  const getLinkFromCategory = _get(COOKIE_SCHEMA_LINKS, [cookie], '');
@@ -145,7 +173,7 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
145
173
  return (
146
174
  <div className={styles.switchBlock} key={cookie} >
147
175
  <span className={styles.switchBlockTitle}>{cookie}</span>
148
- <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>Datenschutzbestimmungen</a>
176
+ <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>{tr('privacyPolicy')}</a>
149
177
  <MaterialSwitch
150
178
  sx={{ marginLeft: 'auto' }}
151
179
  value={isChecked}
@@ -156,12 +184,12 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
156
184
  })}
157
185
  </MaterialAccordionGroup>
158
186
  <MaterialAccordionGroup
159
- title='Marketing'
187
+ title={tr('marketing.title')}
160
188
  withSwitch
161
189
  // tooltipText='Marketing'
162
190
  switchProps={marketingSwitchProps}
163
191
  >
164
- <span className={styles.accordionDescription}>Zur Personalisierung und Messung der Effektivität von Werbung auf unserer Website und anderen Websites. Beispiel: Wir können Ihnen eine personalisierte Werbung auf der Grundlage der von Ihnen besuchten Seiten auf unserer Website anzeigen.</span>
192
+ <span className={styles.accordionDescription}>{tr('marketing.text')}</span>
165
193
  {Object.keys(COOKIE_SCHEMA.marketing).map(cookie => {
166
194
  const getItemsFromCategory = _get(COOKIE_SCHEMA, `marketing['${cookie}']`, null);
167
195
  const getLinkFromCategory = _get(COOKIE_SCHEMA_LINKS, [cookie], '');
@@ -169,7 +197,7 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
169
197
  return (
170
198
  <div className={styles.switchBlock} key={cookie} >
171
199
  <span className={styles.switchBlockTitle}>{cookie}</span>
172
- <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>Datenschutzbestimmungen</a>
200
+ <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>{tr('privacyPolicy')}</a>
173
201
  <MaterialSwitch
174
202
  sx={{ marginLeft: 'auto' }}
175
203
  value={isChecked}
@@ -181,8 +209,8 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
181
209
  </MaterialAccordionGroup>
182
210
  </div>
183
211
  <div className={styles.buttonsContainer}>
184
- <Button onClick={() => onAccept()} className={classNames(styles.modalBtn, styles.outlinedBtn, styles.zustimmenBtn)} >Auswahl speichern</Button>
185
- <Button onClick={() => onAccept({ marketing: [], analytics: [] })} className={classNames(styles.modalBtn, styles.zustimmenBtn)}>Alles akzeptieren</Button>
212
+ <Button onClick={() => onAccept()} className={classNames(styles.modalBtn, styles.outlinedBtn, styles.zustimmenBtn)} >{tr('saveSelection')}</Button>
213
+ <Button onClick={() => onAccept({ marketing: [], analytics: [] })} className={classNames(styles.modalBtn, styles.zustimmenBtn)}>{tr('acceptAll')}</Button>
186
214
  </div>
187
215
  </div>
188
216
  );
@@ -3,6 +3,7 @@ import IconSVG from '../../../../iconsvg/IconSVG';
3
3
  import Button from '../../../Button/Button';
4
4
  import styles from './PreviewCookieModal.styl';
5
5
  import { updateCookieList } from '../../../../utils/CommonUtils';
6
+ import { saveCookieConfig } from '../../../../utils/cookieConsent';
6
7
  import { COOKIE_SCHEMA } from '../../../../constants/common';
7
8
 
8
9
  interface IPreviewCookieModal {
@@ -14,16 +15,16 @@ interface IPreviewCookieModal {
14
15
  const PreviewCookieModal = ({ toggleModal, setModal, handleSentryInit } : IPreviewCookieModal) => {
15
16
  const environment = window.location.origin;
16
17
  const onAcceptAll = () => {
17
- localStorage.setItem('cookieConfig', JSON.stringify({ marketing: [], analytics: [] }));
18
+ saveCookieConfig({ marketing: [], analytics: [] });
18
19
  updateCookieList(handleSentryInit);
19
20
  toggleModal();
20
21
  };
21
22
 
22
23
  const onDisableAll = () => {
23
- localStorage.setItem('cookieConfig', JSON.stringify({
24
+ saveCookieConfig({
24
25
  marketing: Object.values(COOKIE_SCHEMA.marketing).reduce((acc: string[], val: string[]) => acc.concat(val), []),
25
26
  analytics: Object.values(COOKIE_SCHEMA.analytics).reduce((acc: string[], val: string[]) => acc.concat(val), [])
26
- }));
27
+ });
27
28
  updateCookieList(handleSentryInit);
28
29
  toggleModal();
29
30
  };
@@ -7,7 +7,11 @@ const useModal = () => {
7
7
  setIsVisible(!isVisible);
8
8
  };
9
9
 
10
- return { isVisible, toggleModal };
10
+ const openModal = () => {
11
+ setIsVisible(true);
12
+ };
13
+
14
+ return { isVisible, toggleModal, openModal };
11
15
  };
12
16
 
13
17
  export default useModal;
@@ -10,7 +10,7 @@ export interface ILoaderProps {
10
10
  fluid?: boolean;
11
11
  }
12
12
 
13
- const Loader: React.FC<ILoaderProps> = ({ className, size, fluid }) => {
13
+ const Loader: React.FC<ILoaderProps> = ({ className = '', size = 'medium', fluid = false }) => {
14
14
  const classNames = classnames(
15
15
  styles.loader,
16
16
  { [styles[size]]: !fluid },
@@ -23,10 +23,4 @@ const Loader: React.FC<ILoaderProps> = ({ className, size, fluid }) => {
23
23
  );
24
24
  };
25
25
 
26
- Loader.defaultProps = {
27
- className: '',
28
- size: 'medium',
29
- fluid: false
30
- };
31
-
32
26
  export default Loader;
@@ -8,6 +8,7 @@ import * as React from 'react';
8
8
  import classnames from 'classnames';
9
9
 
10
10
  import Icon from '../../ui/Icon';
11
+ import MfieldCheckIcon from '../../ui/MfieldCheckIcon';
11
12
 
12
13
  export interface MdFieldProps {
13
14
  className?: string;
@@ -32,12 +33,21 @@ export interface MdFieldProps {
32
33
  * when empty and unfocused, then floats up to the normal small-label spot on focus
33
34
  * or once a value is typed. Defaults to false — the static above-field label. */
34
35
  floatingLabel?: boolean;
36
+ /** opt-in: show a green check + green border when the field is filled and valid (checkout).
37
+ * Same contract/markup as FormField's own showValid (.mfield--valid/.mfield-ok, md3.css). */
38
+ showValid?: boolean;
35
39
  onChange: (value: string, name?: string, event?: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
40
+ /** fires after the field's own internal blur handling (floating-label state). Callers use
41
+ * this to trigger `field.validate()` (mobx-react-form) on blur — this component only owns
42
+ * the `error` prop's display, not when validation actually runs, so without a caller wiring
43
+ * this in, `field.error` never populates from blur and a required-but-empty field never
44
+ * shows its error text/red border until some other validate() call happens to run. */
45
+ onBlur?: () => void;
36
46
  }
37
47
 
38
48
  const MdField: React.FunctionComponent<MdFieldProps> = ({
39
49
  className, error, sx, required, disabled, multiline, autoComplete,
40
- value, type, name, rows, label, placeholder, floatingLabel, maxLength, onChange
50
+ value, type, name, rows, label, placeholder, floatingLabel, maxLength, showValid, onChange, onBlur
41
51
  }) => {
42
52
  const [reveal, setReveal] = React.useState(false);
43
53
  const [focused, setFocused] = React.useState(false);
@@ -54,6 +64,7 @@ const MdField: React.FunctionComponent<MdFieldProps> = ({
54
64
  // a value is typed, the real <label> appears in its normal static spot above the
55
65
  // field and the native placeholder goes quiet — the two never show at the same time.
56
66
  const hasValue = value != null && value !== '';
67
+ const isValid = !!showValid && !disabled && !isPassword && !hasError && hasValue;
57
68
  const resting = !!floatingLabel && !focused && !hasValue;
58
69
  const effectivePlaceholder = floatingLabel ? (resting ? (label || placeholder || '') : '') : (placeholder || '');
59
70
  // The real <label> is skipped entirely while resting (see above), leaving the input with
@@ -71,7 +82,9 @@ const MdField: React.FunctionComponent<MdFieldProps> = ({
71
82
 
72
83
  return (
73
84
  <div className={classnames('mfield-group', className)} style={sx as React.CSSProperties}>
74
- {label && !resting ? (
85
+ {/* Non-floating fields (FormField's own call sites don't set floatingLabel) keep the
86
+ plain label-above-the-box row — unchanged, still a .mfield-group flex child. */}
87
+ {label && !resting && !floatingLabel ? (
75
88
  <label className='md-label-sm mfield-label' htmlFor={generatedId}>
76
89
  {label}{required ? ' *' : ''}
77
90
  </label>
@@ -87,8 +100,18 @@ const MdField: React.FunctionComponent<MdFieldProps> = ({
87
100
  + (hasError ? ' mfield--error' : '')
88
101
  + (disabled ? ' mfield--disabled' : '')
89
102
  + (floatingLabel ? ' mfield--floating' : '')
103
+ + (isValid ? ' mfield--valid' : '')
90
104
  }
91
105
  >
106
+ {/* floatingLabel + floated (focused or has a value): the Material "notched outline"
107
+ treatment — label sits ON the border line, not stacked above it in its own row.
108
+ Lives INSIDE .mfield (not .mfield-group) so it can position against .mfield's own
109
+ edge (.mfield is position:relative already, md3.css) via .mfield-label--notch. */}
110
+ {label && !resting && floatingLabel ? (
111
+ <label className='md-label-sm mfield-label mfield-label--notch' htmlFor={generatedId}>
112
+ {label}{required ? ' *' : ''}
113
+ </label>
114
+ ) : null}
92
115
  {multiline ? (
93
116
  <textarea
94
117
  id={generatedId}
@@ -96,7 +119,7 @@ const MdField: React.FunctionComponent<MdFieldProps> = ({
96
119
  value={value == null ? '' : value}
97
120
  onChange={handleChange}
98
121
  onFocus={() => setFocused(true)}
99
- onBlur={() => setFocused(false)}
122
+ onBlur={() => { setFocused(false); onBlur?.(); }}
100
123
  disabled={disabled}
101
124
  rows={rows || 3}
102
125
  maxLength={maxLength}
@@ -115,7 +138,7 @@ const MdField: React.FunctionComponent<MdFieldProps> = ({
115
138
  value={value == null ? '' : value}
116
139
  onChange={handleChange}
117
140
  onFocus={() => setFocused(true)}
118
- onBlur={() => setFocused(false)}
141
+ onBlur={() => { setFocused(false); onBlur?.(); }}
119
142
  disabled={disabled}
120
143
  maxLength={maxLength}
121
144
  placeholder={effectivePlaceholder}
@@ -137,6 +160,7 @@ const MdField: React.FunctionComponent<MdFieldProps> = ({
137
160
  <Icon name={reveal ? 'eye-off' : 'eye'} size={18} />
138
161
  </button>
139
162
  ) : null}
163
+ {isValid ? <span className="mfield-ok"><MfieldCheckIcon /></span> : null}
140
164
  </div>
141
165
  {hasError ? (
142
166
  // role="alert" announces this to screen readers the moment it enters the DOM (e.g.
@@ -41,9 +41,17 @@ const TimePicker = ({
41
41
 
42
42
  const endOfTheDayTime = currentDay > 5 || currentDay < 1 ? '17:30:00' : '19:30:00';
43
43
  const startOfTheDayTime = currentDay > 5 || currentDay < 1 ? '09:00:00' : '08:30:00';
44
- const setNewDay = new Date(`${date.toDateString()} ${endOfTheDayTime}`) > date ? 0 : 86400000;
45
44
  const interval = 30 * 60 * 1000;
46
45
  const roundedTime = new Date(Math.ceil(date / interval) * interval);
46
+ // Today is open while a slot is left: the next half hour must not be past the last one (16:30 on
47
+ // weekends, 19:30 on weekdays). Weekends 16:31–17:29 were still before closing but had no slot
48
+ // left, which crashed the picker on an empty list. A closed today is left out of the dates, as
49
+ // after hours. Today's own weekday decides, not the selected day's.
50
+ const isTodayWeekend = date.getDay() > 5 || date.getDay() < 1;
51
+ const todayEnd = new Date(`${date.toDateString()} ${isTodayWeekend ? '17:30:00' : '19:30:00'}`);
52
+ const todayLastSlot = new Date(`${date.toDateString()} ${isTodayWeekend ? '16:30:00' : '19:30:00'}`);
53
+ const isTodayOpen = todayEnd > date && roundedTime <= todayLastSlot;
54
+ const setNewDay = isTodayOpen ? 0 : 86400000;
47
55
  const nextWeekDays = [...Array(7).keys()].map((days, index) => (
48
56
  {
49
57
  value: index,
@@ -87,7 +95,9 @@ const TimePicker = ({
87
95
  dayRanges.push({ time, value: dayRanges.length, label: `${time} - ${rangeTime}` });
88
96
  } // time ranges for full day
89
97
 
90
- return currentDay === new Date().getDay() && isWorkingHours() ? currentDayRanges : dayRanges;
98
+ // today's remaining slots only for today's date: the same weekday a week later gets the full day
99
+ const isTodaySelected = new Date(nextWeekDaysFull[day]).toDateString() === new Date().toDateString();
100
+ return isTodaySelected && isWorkingHours() ? currentDayRanges : dayRanges;
91
101
  };
92
102
 
93
103
  useEffect(
package/constants/app.ts CHANGED
@@ -40,17 +40,7 @@ export const LOCAL_STORAGE_KEY = {
40
40
  i18n_KEY: 'i18nLanguage'
41
41
  };
42
42
 
43
- // ADV-284: evaluated at import time — with site storage blocked, reading localStorage throws a
44
- // SecurityError that took down the whole bundle. Blocked storage behaves like "nothing saved".
45
- const readStoredLang = (): string | null => {
46
- try {
47
- return localStorage.getItem(LOCAL_STORAGE_KEY.i18n_KEY);
48
- } catch (e) {
49
- return null;
50
- }
51
- };
52
-
53
- export const DEFAULT_LANG: string = typeof window !== 'undefined' ? readStoredLang() : 'de';
43
+ export const DEFAULT_LANG: string = typeof window !== 'undefined' ? localStorage.getItem(LOCAL_STORAGE_KEY.i18n_KEY) : 'de';
54
44
 
55
45
  // Default support contact phone
56
46
  export const CONTACT_PHONE: string = '+498004030182';
package/constants/core.ts CHANGED
@@ -35,18 +35,7 @@ export const LOCAL_STORAGE_KEY = {
35
35
  i18n_KEY: 'i18nLanguage'
36
36
  };
37
37
 
38
- // ADV-284: evaluated at import time — with site storage blocked, merely reading
39
- // window.localStorage throws a SecurityError, which took down the whole bundle (landing
40
- // page never rendered). Treat blocked storage like "no language saved".
41
- const readStoredLang = (): string | null => {
42
- try {
43
- return typeof window !== 'undefined' ? window.localStorage.getItem(LOCAL_STORAGE_KEY.i18n_KEY) : null;
44
- } catch (e) {
45
- return null;
46
- }
47
- };
48
-
49
- export const DEFAULT_LANG: string = readStoredLang() ?? 'de';
38
+ export const DEFAULT_LANG: string = (typeof window !== 'undefined' ? window.localStorage.getItem(LOCAL_STORAGE_KEY.i18n_KEY) : null) ?? 'de';
50
39
 
51
40
  export const ROW_STYLES = {
52
41
  marginBottom: 10
@@ -43,6 +43,20 @@ import { TIER_LABELS, RatingTier, CO2_CLASSES, Co2Class } from '../constants/aut
43
43
  export const PLACEHOLDER_IMAGE =
44
44
  'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
45
45
 
46
+ /**
47
+ * The app-wide no-image asset, set ONCE at app start (fe-main's index.tsx passes its
48
+ * PLACEHOLDER_IMAGE_LARGE_URL, built from config.imagesAPI.imgUrlBase) — so every card that
49
+ * maps a car without a photo shows the "noimage" picture, not the transparent data URI above,
50
+ * without each page having to remember `deps.placeholder` (most didn't: the home page, /search,
51
+ * favourites and the dashboard all rendered an empty white photo). `deps.placeholder` still
52
+ * wins per call; the data URI stays the last resort (tests, an app that never sets this).
53
+ */
54
+ let defaultPlaceholder: string = PLACEHOLDER_IMAGE;
55
+
56
+ export function setPlaceholderImage(url: string): void {
57
+ defaultPlaceholder = url || PLACEHOLDER_IMAGE;
58
+ }
59
+
46
60
  /**
47
61
  * Dependencies the SRP container injects. Everything here is what the mapper
48
62
  * needs from the outside world — keeping the function itself pure.
@@ -68,7 +82,7 @@ export interface ToAutobahnCarDeps {
68
82
  t?: (key: string, options?: object) => string;
69
83
  /** active UI language ('de' | 'en' …). Drives de-DE vs en-IN number grouping for the EnVKV line. */
70
84
  language?: string;
71
- /** placeholder image URL override (defaults to PLACEHOLDER_IMAGE). */
85
+ /** placeholder image URL override (defaults to the one set with setPlaceholderImage). */
72
86
  placeholder?: string;
73
87
  /**
74
88
  * Buyer-activity stats for this car — UserActionsAPI 'stats/viewers' response, loaded async and
@@ -273,7 +287,7 @@ function isPluginHybrid(fuel: any): boolean {
273
287
  * `sizeOverride` lets a caller ask for a different size than `deps.imageSize` (e.g. a full-res
274
288
  * set for a lightbox, while the card thumbnail itself stays on the smaller default). */
275
289
  function buildGallery(storeCar: any, deps: ToAutobahnCarDeps, sizeOverride?: 'small' | 'medium' | 'large'): string[] {
276
- const placeholder = deps.placeholder || PLACEHOLDER_IMAGE;
290
+ const placeholder = deps.placeholder || defaultPlaceholder;
277
291
  // Only 'small' and 'large' variants are pre-generated by image-generator; 'medium' has no cached file.
278
292
  const size = sizeOverride || deps.imageSize || 'small';
279
293
 
@@ -7,7 +7,7 @@ type TIconSVG = {
7
7
  customDimensions?: boolean;
8
8
  };
9
9
 
10
- const IconSVG: React.FC<TIconSVG> = ({ name, isWarrantyActive, customDimensions, ...props }: TIconSVG) => {
10
+ const IconSVG: React.FC<TIconSVG> = ({ name, isWarrantyActive, customDimensions = false, ...props }: TIconSVG) => {
11
11
  if (!name) return null;
12
12
 
13
13
  const Component: any = components[name.toString()];
@@ -23,8 +23,4 @@ const IconSVG: React.FC<TIconSVG> = ({ name, isWarrantyActive, customDimensions,
23
23
  );
24
24
  };
25
25
 
26
- IconSVG.defaultProps = {
27
- customDimensions: false
28
- };
29
-
30
26
  export default IconSVG;
@@ -77,6 +77,7 @@
77
77
  "kfPurchaseObligation": "Kaufpflicht",
78
78
  "termSelection": "Laufzeit",
79
79
  "termSelectionMonths": "Laufzeit (Monate)",
80
+ "change": "Ändern",
80
81
  "headerTitle": "Dein Angebot",
81
82
  "adjustRate": "Rate anpassen",
82
83
  "secureOffer": "Angebot anfragen",
@@ -97,7 +98,7 @@
97
98
  "detailsShow": "Details anzeigen",
98
99
  "paymentLabel": "Zahlung",
99
100
  "paymentValue": "Überweisung",
100
- "warrantyLabel": "Garantie",
101
+ "warrantyLabel": "Zusatzgarantie (Multipart)",
101
102
  "warrantyValue": "1 Jahr inklusive",
102
103
  "deliveryLabel": "Lieferung",
103
104
  "deliveryValue": "ca. 7–14 Tage · oder Abholung",
@@ -286,7 +287,16 @@
286
287
  "myDealers": "Meine Händler",
287
288
  "dashboard": "Dashboard",
288
289
  "dealerDashboard": "Händler-Dashboard",
289
- "imageSettings": "Bildeinstellungen"
290
+ "imageSettings": "Bildeinstellungen",
291
+ "acct": {
292
+ "overview": "Übersicht",
293
+ "myOrder": "Meine Bestellung",
294
+ "savedSearches": "Gespeicherte Suchen",
295
+ "favorites": "Favoriten",
296
+ "compare": "Fahrzeuge vergleichen",
297
+ "profile": "Profil",
298
+ "support": "Support & Rückruf"
299
+ }
290
300
  },
291
301
  "srp": {
292
302
  "trust": {
@@ -494,11 +504,12 @@
494
504
  "ratings": "Bewertungen"
495
505
  },
496
506
  "section": {
497
- "similar": "Ähnliche Fahrzeuge"
507
+ "similar": "Ähnliche Fahrzeuge",
508
+ "unavailableSimilar": "Ähnliche / vergleichbare Fahrzeuge"
498
509
  },
499
510
  "breadcrumb": {
500
511
  "home": "Start",
501
- "used-cars": "Gebrauchtwagen"
512
+ "used-cars": "Fahrzeuge"
502
513
  },
503
514
  "state": {
504
515
  "loading": "Fahrzeug wird geladen…",
@@ -710,7 +721,7 @@
710
721
  },
711
722
  "modal": {
712
723
  "leasingDetails": "Leasingdetails",
713
- "financingDetails": "Finanzierungs-Details",
724
+ "financingDetails": "Finanzierungsdetails",
714
725
  "close": "Schließen",
715
726
  "vehiclePrice": "Fahrzeugpreis ggf. inkl. MwSt.",
716
727
  "leasingAmount": "Leasingbetrag",
@@ -749,13 +760,13 @@
749
760
  "representativeExample": "Repräsentatives Beispiel",
750
761
  "vatDisclaimer": "(alle Preisangaben ggf. inkl. der jeweils gesetzlich gültigen MwSt., derzeit 19%)",
751
762
  "lenderLabel": "Darlehensgeber:",
752
- "lenderName": "Open Bank AG, Santander-Platz 1, 41061 Mönchengladbach",
763
+ "lenderName": "Openbank Deutschland AG, Santander-Platz 1, 41061 Mönchengladbach",
753
764
  "leaseLenderLabel": "Leasinggeber:",
754
- "leaseLenderName": "Santander Consumer Leasing GmbH, Santander-Platz 1, 41061 Mönchengladbach",
765
+ "leaseLenderName": "Openbank Deutschland AG, Santander-Platz 1, 41061 Mönchengladbach",
755
766
  "contractTypeLabel": "Vertragsart:",
756
767
  "contractTypeValue": "Restwertleasing",
757
768
  "packageMandatoryNotice": "Das Rundum-Sorglos-Paket ist verpflichtend. In der dargestellten Konfiguration ist es als Einmalzahlung von {{amount}} € zu leisten und nicht in der Monatsrate enthalten. Bei Rateneinrechnung werden Monatsrate und Gesamtbeträge entsprechend angepasst.",
758
- "legalFootnoteAcquisitionPrice": "¹ Der Anschaffungspreis bezeichnet den Preis, den die Santander Consumer Leasing GmbH für das Fahrzeug zu bezahlen hat.",
769
+ "legalFootnoteAcquisitionPrice": "¹ Der Anschaffungspreis bezeichnet den Preis, den die Openbank Deutschland AG für das Fahrzeug zu bezahlen hat.",
759
770
  "legalFootnoteListPriceLease": "² Listenpreis (UVP) = unverbindliche Preisempfehlung des Herstellers.",
760
771
  "closingDisclaimerLine1": "Änderungen und Irrtümer vorbehalten. Farbe und Ausstattung können vom Angebot abweichen.",
761
772
  "closingDisclaimerLine2": "Kostenpflichtige Sonderausstattung möglich.",
@@ -766,8 +777,8 @@
766
777
  "legalNoticeVat": "Alle Preisangaben inkl. der jeweils gesetzlich gültigen MwSt., derzeit 19 %.",
767
778
  "legalNoticeAddServices": "Das Rundum-Sorglos-Paket ist eine einmalige Zahlung.",
768
779
  "listPriceFootnote": "³ Listenpreis (UVP) = unverbindliche Preisempfehlung des Herstellers.",
769
- "legalLeasing": "Für Ihre Finanzierungswünsche stellen wir eine Bonitätsanfrage. Bonität vorausgesetzt, ist dies ein repräsentatives Berechnungsbeispiel gem. der Angaben, welches 2/3 aller Kunden, im Sinne des § 17a Abs. 4 PangV, erhalten. Dieses freibleibende Angebot der Santander Consumer Leasing GmbH, Santander-Platz 1, 41061 Mönchengladbach wird vermittelt durch die auto.de GmbH, Max-Planck-Str. 19, 06796 Sandersdorf-Brehna, die als ungebundener Vermittler nicht beratend tätig ist. Irrtümer vorbehalten. Preise ggf. inkl. MwSt.",
770
- "legalFinancing": "Für Ihre Finanzierungswünsche stellen wir eine Bonitätsanfrage. Bonität vorausgesetzt, ist dies ein repräsentatives Berechnungsbeispiel gem. der Angaben, welches 2/3 aller Kunden, im Sinne des § 17a Abs. 4 PangV, erhalten. Dieses freibleibende Angebot der Open Bank AG, Santander-Platz 1, 41061 Mönchengladbach wird vermittelt durch die auto.de GmbH, Max-Planck-Str. 19, 06796 Sandersdorf-Brehna, die als ungebundener Vermittler nicht beratend tätig ist. Irrtümer vorbehalten. Preise ggf. inkl. MwSt.",
780
+ "legalLeasing": "Für Ihre Finanzierungswünsche stellen wir eine Bonitätsanfrage. Bonität vorausgesetzt, ist dies ein repräsentatives Berechnungsbeispiel gem. der Angaben, welches 2/3 aller Kunden, im Sinne des § 17a Abs. 4 PangV, erhalten. Dieses freibleibende Angebot der Openbank Deutschland AG, Santander-Platz 1, 41061 Mönchengladbach wird vermittelt durch die auto.de GmbH, Max-Planck-Str. 19, 06796 Sandersdorf-Brehna, die als ungebundener Vermittler nicht beratend tätig ist. Irrtümer vorbehalten. Preise ggf. inkl. MwSt.",
781
+ "legalFinancing": "Für Ihre Finanzierungswünsche stellen wir eine Bonitätsanfrage. Bonität vorausgesetzt, ist dies ein repräsentatives Berechnungsbeispiel gem. der Angaben, welches 2/3 aller Kunden, im Sinne des § 17a Abs. 4 PangV, erhalten. Dieses freibleibende Angebot der Openbank Deutschland AG, Santander-Platz 1, 41061 Mönchengladbach wird vermittelt durch die auto.de GmbH, Max-Planck-Str. 19, 06796 Sandersdorf-Brehna, die als ungebundener Vermittler nicht beratend tätig ist. Irrtümer vorbehalten. Preise ggf. inkl. MwSt.",
771
782
  "sheetTitleFinancing": "Kredit-Rate anpassen",
772
783
  "sheetTitleLeasing": "Leasing-Rate anpassen",
773
784
  "sheetTitleCash": "Kaufen - Details"
@@ -775,7 +786,9 @@
775
786
  "ratings": {
776
787
  "showLess": "Weniger anzeigen",
777
788
  "showMore": "Alle {{count}} Bewertung anzeigen",
778
- "showMore_plural": "Alle {{count}} Bewertungen anzeigen"
789
+ "showMore_plural": "Alle {{count}} Bewertungen anzeigen",
790
+ "showMoreLoaded": "Weitere {{count}} Bewertung anzeigen",
791
+ "showMoreLoaded_plural": "Weitere {{count}} Bewertungen anzeigen"
779
792
  },
780
793
  "steps": {
781
794
  "step1": {
@@ -805,7 +818,8 @@
805
818
  "serviceHistory": "Scheckheft",
806
819
  "warranty": "Garantie",
807
820
  "yes": "Ja",
808
- "no": "Nein"
821
+ "no": "Nein",
822
+ "notSpecified": "keine Angabe"
809
823
  },
810
824
  "common": {
811
825
  "needsData": "Daten folgt"
@@ -853,5 +867,25 @@
853
867
  "captionSlices": "Scheiben",
854
868
  "captionSteeringWheel": "Lenkrad",
855
869
  "captionWheelsLandingGear": "Räder | Fahrwerk"
870
+ },
871
+ "cookieModal": {
872
+ "dialogLabel": "Cookie-Einstellungen",
873
+ "title": "Nach den Cookies geht die Fahrt weiter.",
874
+ "manageText": "Für ein bestmögliches Nutzererlebnis setzen wir Cookies und andere Technologien ein. Diese können Sie hier verwalten.",
875
+ "necessary": {
876
+ "title": "Notwendig",
877
+ "text": "Wir verwenden Browser-Cookies, die notwendig sind, damit die Website wie vorgesehen funktioniert. Beispiel: Wir speichern Ihre Präferenzen bei der Datenerfassung auf der Website, damit wir sie berücksichtigen können, wenn Sie auf unsere Website zurückkehren. Sie können diese Cookies in den Einstellungen Ihres Browsers deaktivieren, aber wenn Sie dies tun, funktioniert die Website möglicherweise nicht wie vorgesehen."
878
+ },
879
+ "analytics": {
880
+ "title": "Analytisch",
881
+ "text": "Um das Nutzerverhalten zu verstehen und Ihnen ein relevanteres Surferlebnis zu bieten oder den Inhalt unserer Website zu personalisieren. Beispiel: Wir sammeln Informationen darüber, welche Seiten Sie besuchen, damit wir Ihnen relevantere Informationen präsentieren können."
882
+ },
883
+ "marketing": {
884
+ "title": "Marketing",
885
+ "text": "Zur Personalisierung und Messung der Effektivität von Werbung auf unserer Website und anderen Websites. Beispiel: Wir können Ihnen eine personalisierte Werbung auf der Grundlage der von Ihnen besuchten Seiten auf unserer Website anzeigen."
886
+ },
887
+ "privacyPolicy": "Datenschutzbestimmungen",
888
+ "saveSelection": "Auswahl speichern",
889
+ "acceptAll": "Alles akzeptieren"
856
890
  }
857
891
  }