@bytebrand/fe-ui-core-autobahn 1.0.189 → 1.0.190

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 (42) hide show
  1. package/cards/CarCard.tsx +388 -391
  2. package/cards/CarRow.tsx +1 -5
  3. package/cards/cardParts.tsx +4 -6
  4. package/cards/index.ts +0 -6
  5. package/chrome/Footer.tsx +3 -16
  6. package/chrome/TopBar.tsx +266 -139
  7. package/compat/CookieModal/CookieModal.tsx +6 -20
  8. package/compat/CookieModal/Modal.tsx +3 -6
  9. package/compat/CookieModal/modals/ManageCookieModal/ManageCookieModal.tsx +15 -43
  10. package/compat/CookieModal/modals/PreviewCookieModal/PreviewCookieModal.tsx +3 -4
  11. package/compat/CookieModal/useModal.ts +1 -5
  12. package/compat/Loader/Loader.tsx +7 -1
  13. package/compat/MdField/MdField.tsx +4 -28
  14. package/compat/TimePicker/TimePicker.tsx +2 -12
  15. package/data/toAutobahnCar.ts +2 -16
  16. package/iconsvg/IconSVG.tsx +5 -1
  17. package/locales/de/autobahn.json +12 -43
  18. package/locales/en/autobahn.json +10 -41
  19. package/package.json +30 -30
  20. package/theme/md3.css +11573 -15526
  21. package/ui/CreditCostNotice.tsx +43 -0
  22. package/ui/Dropdown.tsx +10 -29
  23. package/ui/FormCheckbox.tsx +2 -22
  24. package/ui/FormField.tsx +1 -2
  25. package/ui/Icon.tsx +0 -6
  26. package/ui/Modal.tsx +6 -84
  27. package/ui/Skeleton.tsx +20 -79
  28. package/ui/index.ts +3 -2
  29. package/ui/usePortalMenuPosition.ts +15 -27
  30. package/utils/index.ts +0 -10
  31. package/vdp/FinanceCalculator.tsx +11 -20
  32. package/vdp/VdpModules.tsx +15 -37
  33. package/vdp/types.ts +5 -5
  34. package/vehiclesProps/decoratedLightProps.tsx +0 -4
  35. package/vehiclesProps/decoratedProps.tsx +0 -4
  36. package/cards/CarCardSkeleton.tsx +0 -103
  37. package/cards/CarRowSkeleton.tsx +0 -152
  38. package/chrome/AccountMenuIcon.tsx +0 -109
  39. package/ui/MfieldCheckIcon.tsx +0 -13
  40. package/ui/scrollFieldIntoView.ts +0 -41
  41. package/utils/cookieConsent.ts +0 -84
  42. package/vehiclesProps/accidentDisclosure.ts +0 -25
@@ -1,18 +1,14 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import useModal from './useModal';
3
3
  import { updateCookieList } from '../../utils/CommonUtils';
4
- import { OPEN_COOKIE_SETTINGS_EVENT } from '../../utils/cookieConsent';
5
4
  import Modal from './Modal';
6
- import { TranslationFunction } from '../../types';
7
5
 
8
6
  export interface ICookieModal {
9
7
  handleSentryInit?: () => void;
10
- /** the host's `t` with the `autobahn` namespace (`cookieModal.*`); without it the dialog is German */
11
- t?: TranslationFunction;
12
8
  }
13
9
 
14
- const CookieModal = ({ handleSentryInit = () => {}, t }: ICookieModal) => {
15
- const { isVisible, toggleModal, openModal } = useModal();
10
+ const CookieModal = ({ handleSentryInit }: ICookieModal) => {
11
+ const { isVisible, toggleModal } = useModal();
16
12
  const [modal, setModal] = useState('');
17
13
 
18
14
  useEffect(
@@ -26,19 +22,6 @@ const CookieModal = ({ handleSentryInit = () => {}, t }: ICookieModal) => {
26
22
  []
27
23
  );
28
24
 
29
- // ADV-268: "Cookie-Einstellungen ändern" (account page) reopens the settings dialog
30
- useEffect(
31
- () => {
32
- const onOpenSettings = () => {
33
- setModal('MANAGE_COOKIE_MODAL');
34
- openModal();
35
- };
36
- window.addEventListener(OPEN_COOKIE_SETTINGS_EVENT, onOpenSettings);
37
- return () => window.removeEventListener(OPEN_COOKIE_SETTINGS_EVENT, onOpenSettings);
38
- },
39
- []
40
- );
41
-
42
25
  useEffect(
43
26
  () => {
44
27
  if (!isVisible) return undefined;
@@ -62,7 +45,6 @@ const CookieModal = ({ handleSentryInit = () => {}, t }: ICookieModal) => {
62
45
  ? <Modal
63
46
  isVisible={isVisible}
64
47
  handleSentryInit={handleSentryInit}
65
- t={t}
66
48
  toggleModal={toggleModal}
67
49
  name={modal}
68
50
  modalProps={modalProps}
@@ -70,4 +52,8 @@ const CookieModal = ({ handleSentryInit = () => {}, t }: ICookieModal) => {
70
52
  : <></>;
71
53
  };
72
54
 
55
+ CookieModal.defaultProps = {
56
+ handleSentryInit: () => {}
57
+ };
58
+
73
59
  export default CookieModal;
@@ -16,7 +16,6 @@ import * as React from 'react';
16
16
  import * as ReactDOM from 'react-dom';
17
17
 
18
18
  import ModalsConfig from './ModalsConfig';
19
- import { TranslationFunction } from '../../types';
20
19
  import styles from './Modal.styl';
21
20
 
22
21
  interface IBasicModal {
@@ -25,7 +24,6 @@ interface IBasicModal {
25
24
  handleSentryInit?: () => void;
26
25
  name: string;
27
26
  modalProps?: any;
28
- t?: TranslationFunction;
29
27
  }
30
28
 
31
29
  const OVERLAY: React.CSSProperties = {
@@ -42,17 +40,16 @@ const SURFACE: React.CSSProperties = {
42
40
  maxWidth: 640, width: '100%', maxHeight: '92vh', overflowY: 'auto'
43
41
  };
44
42
 
45
- const BasicModal = ({ isVisible, toggleModal, name, modalProps, handleSentryInit, t }: IBasicModal) => {
43
+ const BasicModal = ({ isVisible, toggleModal, name, modalProps, handleSentryInit }: IBasicModal) => {
46
44
  if (!isVisible || typeof document === 'undefined') return null;
47
- const label = t ? t('autobahn:cookieModal.dialogLabel') : '';
48
45
  return ReactDOM.createPortal(
49
46
  // wrapped in .md3: autobahn.css scopes every token/utility class (incl.
50
47
  // .mbtn used by the modal buttons) under `.md3` and intentionally does
51
48
  // nothing outside it — a bare document.body portal loses the theme.
52
49
  <div className='md3'>
53
- <div className={styles.overlay} style={OVERLAY} role='dialog' aria-modal='true' aria-label={label && !label.endsWith('cookieModal.dialogLabel') ? label : 'Cookie-Einstellungen'}>
50
+ <div className={styles.overlay} style={OVERLAY} role='dialog' aria-modal='true' aria-label='Cookie-Einstellungen'>
54
51
  <div className={styles.surface} style={SURFACE}>
55
- {ModalsConfig[name] && ModalsConfig[name]({ ...modalProps, toggleModal, handleSentryInit, t })}
52
+ {ModalsConfig[name] && ModalsConfig[name]({ ...modalProps, toggleModal, handleSentryInit })}
56
53
  </div>
57
54
  </div>
58
55
  </div>,
@@ -8,43 +8,19 @@ 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';
13
11
 
14
12
  import styles from './ManageCookieModal.styl';
15
13
 
16
14
  interface IManageCookieModal {
17
15
  toggleModal: () => void;
18
16
  handleSentryInit?: () => void;
19
- /** the host's `t` with the `autobahn` namespace loaded; without it the dialog stays German (fe-landing) */
20
- t?: TranslationFunction;
21
17
  }
22
18
 
23
19
  interface IMarketingSwitches {
24
20
  [key: string]: any;
25
21
  }
26
22
 
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
- };
23
+ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModal) => {
48
24
  const [analytcisMasterSwitch, setAnalyticsMasterSwitch] = useState(false);
49
25
  const [marketingMasterSwitch, setMarketingMasterSwitch] = useState(false);
50
26
  const [analyticsSwitches, setAnalyticsSwitches] = useState<IMarketingSwitches>({});
@@ -68,10 +44,6 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
68
44
  .reduce((acc, item) => ({ ...acc, [item]: !!savedConfig && !savedDisabledMarketing.includes(item) }), {});
69
45
  setAnalyticsSwitches(newAnalyticsSwitches);
70
46
  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));
75
47
  },
76
48
  []
77
49
  );
@@ -114,7 +86,7 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
114
86
  marketing: Object.keys(marketingSwitches).filter(i => !marketingSwitches[i]) || [],
115
87
  analytics: Object.keys(analyticsSwitches).filter(i => !analyticsSwitches[i]) || []
116
88
  };
117
- saveCookieConfig(cookieConfig);
89
+ localStorage.setItem('cookieConfig', JSON.stringify(cookieConfig));
118
90
  updateCookieList(handleSentryInit);
119
91
  toggleModal();
120
92
  };
@@ -138,34 +110,34 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
138
110
  return (
139
111
  <div className={styles.modalWrapper}>
140
112
  <IconSVG name='autodeLogo' customDimensions />
141
- <div className={styles.modalTitle}>{tr('title')}</div>
142
- <div className={styles.modalContent}>{tr('manageText')}</div>
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>
143
115
  <div className={styles.accordions}>
144
116
  <MaterialAccordionGroup
145
- title={tr('necessary.title')}
117
+ title='Notwendig'
146
118
  // tooltipText='Notwendig'
147
119
  withSwitch
148
120
  switchProps={necessarySwitchProps}
149
121
  >
150
- <span className={styles.accordionDescription}>{tr('necessary.text')}</span>
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>
151
123
  {Object.keys(COOKIE_SCHEMA.necessary).map(cookie => {
152
124
  const getLinkFromCategory = _get(COOKIE_SCHEMA_LINKS, [cookie], '');
153
125
  return (
154
126
  <div className={styles.switchBlock} key={cookie} >
155
127
  <span className={styles.switchBlockTitle}>{cookie}</span>
156
- <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>{tr('privacyPolicy')}</a>
128
+ <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>Datenschutzbestimmungen</a>
157
129
  <MaterialSwitch sx={{ marginLeft: 'auto' }} disabled={true} value={true} onChange={() => {}} />
158
130
  </div>
159
131
  );
160
132
  })}
161
133
  </MaterialAccordionGroup>
162
134
  <MaterialAccordionGroup
163
- title={tr('analytics.title')}
135
+ title='Analytisch'
164
136
  withSwitch
165
137
  // tooltipText='Analytisch'
166
138
  switchProps={analyticsSwitchProps}
167
139
  >
168
- <span className={styles.accordionDescription}>{tr('analytics.text')}</span>
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>
169
141
  {Object.keys(COOKIE_SCHEMA.analytics).map(cookie => {
170
142
  const getItemsFromCategory = _get(COOKIE_SCHEMA, `analytics['${cookie}']`, null);
171
143
  const getLinkFromCategory = _get(COOKIE_SCHEMA_LINKS, [cookie], '');
@@ -173,7 +145,7 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
173
145
  return (
174
146
  <div className={styles.switchBlock} key={cookie} >
175
147
  <span className={styles.switchBlockTitle}>{cookie}</span>
176
- <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>{tr('privacyPolicy')}</a>
148
+ <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>Datenschutzbestimmungen</a>
177
149
  <MaterialSwitch
178
150
  sx={{ marginLeft: 'auto' }}
179
151
  value={isChecked}
@@ -184,12 +156,12 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
184
156
  })}
185
157
  </MaterialAccordionGroup>
186
158
  <MaterialAccordionGroup
187
- title={tr('marketing.title')}
159
+ title='Marketing'
188
160
  withSwitch
189
161
  // tooltipText='Marketing'
190
162
  switchProps={marketingSwitchProps}
191
163
  >
192
- <span className={styles.accordionDescription}>{tr('marketing.text')}</span>
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>
193
165
  {Object.keys(COOKIE_SCHEMA.marketing).map(cookie => {
194
166
  const getItemsFromCategory = _get(COOKIE_SCHEMA, `marketing['${cookie}']`, null);
195
167
  const getLinkFromCategory = _get(COOKIE_SCHEMA_LINKS, [cookie], '');
@@ -197,7 +169,7 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
197
169
  return (
198
170
  <div className={styles.switchBlock} key={cookie} >
199
171
  <span className={styles.switchBlockTitle}>{cookie}</span>
200
- <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>{tr('privacyPolicy')}</a>
172
+ <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>Datenschutzbestimmungen</a>
201
173
  <MaterialSwitch
202
174
  sx={{ marginLeft: 'auto' }}
203
175
  value={isChecked}
@@ -209,8 +181,8 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
209
181
  </MaterialAccordionGroup>
210
182
  </div>
211
183
  <div className={styles.buttonsContainer}>
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>
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>
214
186
  </div>
215
187
  </div>
216
188
  );
@@ -3,7 +3,6 @@ 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';
7
6
  import { COOKIE_SCHEMA } from '../../../../constants/common';
8
7
 
9
8
  interface IPreviewCookieModal {
@@ -15,16 +14,16 @@ interface IPreviewCookieModal {
15
14
  const PreviewCookieModal = ({ toggleModal, setModal, handleSentryInit } : IPreviewCookieModal) => {
16
15
  const environment = window.location.origin;
17
16
  const onAcceptAll = () => {
18
- saveCookieConfig({ marketing: [], analytics: [] });
17
+ localStorage.setItem('cookieConfig', JSON.stringify({ marketing: [], analytics: [] }));
19
18
  updateCookieList(handleSentryInit);
20
19
  toggleModal();
21
20
  };
22
21
 
23
22
  const onDisableAll = () => {
24
- saveCookieConfig({
23
+ localStorage.setItem('cookieConfig', JSON.stringify({
25
24
  marketing: Object.values(COOKIE_SCHEMA.marketing).reduce((acc: string[], val: string[]) => acc.concat(val), []),
26
25
  analytics: Object.values(COOKIE_SCHEMA.analytics).reduce((acc: string[], val: string[]) => acc.concat(val), [])
27
- });
26
+ }));
28
27
  updateCookieList(handleSentryInit);
29
28
  toggleModal();
30
29
  };
@@ -7,11 +7,7 @@ const useModal = () => {
7
7
  setIsVisible(!isVisible);
8
8
  };
9
9
 
10
- const openModal = () => {
11
- setIsVisible(true);
12
- };
13
-
14
- return { isVisible, toggleModal, openModal };
10
+ return { isVisible, toggleModal };
15
11
  };
16
12
 
17
13
  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 = 'medium', fluid = false }) => {
13
+ const Loader: React.FC<ILoaderProps> = ({ className, size, fluid }) => {
14
14
  const classNames = classnames(
15
15
  styles.loader,
16
16
  { [styles[size]]: !fluid },
@@ -23,4 +23,10 @@ const Loader: React.FC<ILoaderProps> = ({ className = '', size = 'medium', fluid
23
23
  );
24
24
  };
25
25
 
26
+ Loader.defaultProps = {
27
+ className: '',
28
+ size: 'medium',
29
+ fluid: false
30
+ };
31
+
26
32
  export default Loader;
@@ -8,7 +8,6 @@ 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';
12
11
 
13
12
  export interface MdFieldProps {
14
13
  className?: string;
@@ -33,21 +32,12 @@ export interface MdFieldProps {
33
32
  * when empty and unfocused, then floats up to the normal small-label spot on focus
34
33
  * or once a value is typed. Defaults to false — the static above-field label. */
35
34
  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;
39
35
  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;
46
36
  }
47
37
 
48
38
  const MdField: React.FunctionComponent<MdFieldProps> = ({
49
39
  className, error, sx, required, disabled, multiline, autoComplete,
50
- value, type, name, rows, label, placeholder, floatingLabel, maxLength, showValid, onChange, onBlur
40
+ value, type, name, rows, label, placeholder, floatingLabel, maxLength, onChange
51
41
  }) => {
52
42
  const [reveal, setReveal] = React.useState(false);
53
43
  const [focused, setFocused] = React.useState(false);
@@ -64,7 +54,6 @@ const MdField: React.FunctionComponent<MdFieldProps> = ({
64
54
  // a value is typed, the real <label> appears in its normal static spot above the
65
55
  // field and the native placeholder goes quiet — the two never show at the same time.
66
56
  const hasValue = value != null && value !== '';
67
- const isValid = !!showValid && !disabled && !isPassword && !hasError && hasValue;
68
57
  const resting = !!floatingLabel && !focused && !hasValue;
69
58
  const effectivePlaceholder = floatingLabel ? (resting ? (label || placeholder || '') : '') : (placeholder || '');
70
59
  // The real <label> is skipped entirely while resting (see above), leaving the input with
@@ -82,9 +71,7 @@ const MdField: React.FunctionComponent<MdFieldProps> = ({
82
71
 
83
72
  return (
84
73
  <div className={classnames('mfield-group', className)} style={sx as React.CSSProperties}>
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 ? (
74
+ {label && !resting ? (
88
75
  <label className='md-label-sm mfield-label' htmlFor={generatedId}>
89
76
  {label}{required ? ' *' : ''}
90
77
  </label>
@@ -100,18 +87,8 @@ const MdField: React.FunctionComponent<MdFieldProps> = ({
100
87
  + (hasError ? ' mfield--error' : '')
101
88
  + (disabled ? ' mfield--disabled' : '')
102
89
  + (floatingLabel ? ' mfield--floating' : '')
103
- + (isValid ? ' mfield--valid' : '')
104
90
  }
105
91
  >
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}
115
92
  {multiline ? (
116
93
  <textarea
117
94
  id={generatedId}
@@ -119,7 +96,7 @@ const MdField: React.FunctionComponent<MdFieldProps> = ({
119
96
  value={value == null ? '' : value}
120
97
  onChange={handleChange}
121
98
  onFocus={() => setFocused(true)}
122
- onBlur={() => { setFocused(false); onBlur?.(); }}
99
+ onBlur={() => setFocused(false)}
123
100
  disabled={disabled}
124
101
  rows={rows || 3}
125
102
  maxLength={maxLength}
@@ -138,7 +115,7 @@ const MdField: React.FunctionComponent<MdFieldProps> = ({
138
115
  value={value == null ? '' : value}
139
116
  onChange={handleChange}
140
117
  onFocus={() => setFocused(true)}
141
- onBlur={() => { setFocused(false); onBlur?.(); }}
118
+ onBlur={() => setFocused(false)}
142
119
  disabled={disabled}
143
120
  maxLength={maxLength}
144
121
  placeholder={effectivePlaceholder}
@@ -160,7 +137,6 @@ const MdField: React.FunctionComponent<MdFieldProps> = ({
160
137
  <Icon name={reveal ? 'eye-off' : 'eye'} size={18} />
161
138
  </button>
162
139
  ) : null}
163
- {isValid ? <span className="mfield-ok"><MfieldCheckIcon /></span> : null}
164
140
  </div>
165
141
  {hasError ? (
166
142
  // role="alert" announces this to screen readers the moment it enters the DOM (e.g.
@@ -41,17 +41,9 @@ 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;
44
45
  const interval = 30 * 60 * 1000;
45
46
  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;
55
47
  const nextWeekDays = [...Array(7).keys()].map((days, index) => (
56
48
  {
57
49
  value: index,
@@ -95,9 +87,7 @@ const TimePicker = ({
95
87
  dayRanges.push({ time, value: dayRanges.length, label: `${time} - ${rangeTime}` });
96
88
  } // time ranges for full day
97
89
 
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;
90
+ return currentDay === new Date().getDay() && isWorkingHours() ? currentDayRanges : dayRanges;
101
91
  };
102
92
 
103
93
  useEffect(
@@ -42,20 +42,6 @@ import { TIER_LABELS, RatingTier, CO2_CLASSES, Co2Class } from '../constants/aut
42
42
  export const PLACEHOLDER_IMAGE =
43
43
  'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
44
44
 
45
- /**
46
- * The app-wide no-image asset, set ONCE at app start (fe-main's index.tsx passes its
47
- * PLACEHOLDER_IMAGE_LARGE_URL, built from config.imagesAPI.imgUrlBase) — so every card that
48
- * maps a car without a photo shows the "noimage" picture, not the transparent data URI above,
49
- * without each page having to remember `deps.placeholder` (most didn't: the home page, /search,
50
- * favourites and the dashboard all rendered an empty white photo). `deps.placeholder` still
51
- * wins per call; the data URI stays the last resort (tests, an app that never sets this).
52
- */
53
- let defaultPlaceholder: string = PLACEHOLDER_IMAGE;
54
-
55
- export function setPlaceholderImage(url: string): void {
56
- defaultPlaceholder = url || PLACEHOLDER_IMAGE;
57
- }
58
-
59
45
  /**
60
46
  * Dependencies the SRP container injects. Everything here is what the mapper
61
47
  * needs from the outside world — keeping the function itself pure.
@@ -81,7 +67,7 @@ export interface ToAutobahnCarDeps {
81
67
  t?: (key: string, options?: object) => string;
82
68
  /** active UI language ('de' | 'en' …). Drives de-DE vs en-IN number grouping for the EnVKV line. */
83
69
  language?: string;
84
- /** placeholder image URL override (defaults to the one set with setPlaceholderImage). */
70
+ /** placeholder image URL override (defaults to PLACEHOLDER_IMAGE). */
85
71
  placeholder?: string;
86
72
  /**
87
73
  * Buyer-activity stats for this car — UserActionsAPI 'stats/viewers' response, loaded async and
@@ -286,7 +272,7 @@ function isPluginHybrid(fuel: any): boolean {
286
272
  * `sizeOverride` lets a caller ask for a different size than `deps.imageSize` (e.g. a full-res
287
273
  * set for a lightbox, while the card thumbnail itself stays on the smaller default). */
288
274
  function buildGallery(storeCar: any, deps: ToAutobahnCarDeps, sizeOverride?: 'small' | 'medium' | 'large'): string[] {
289
- const placeholder = deps.placeholder || defaultPlaceholder;
275
+ const placeholder = deps.placeholder || PLACEHOLDER_IMAGE;
290
276
  // Only 'small' and 'large' variants are pre-generated by image-generator; 'medium' has no cached file.
291
277
  const size = sizeOverride || deps.imageSize || 'small';
292
278
 
@@ -7,7 +7,7 @@ type TIconSVG = {
7
7
  customDimensions?: boolean;
8
8
  };
9
9
 
10
- const IconSVG: React.FC<TIconSVG> = ({ name, isWarrantyActive, customDimensions = false, ...props }: TIconSVG) => {
10
+ const IconSVG: React.FC<TIconSVG> = ({ name, isWarrantyActive, customDimensions, ...props }: TIconSVG) => {
11
11
  if (!name) return null;
12
12
 
13
13
  const Component: any = components[name.toString()];
@@ -23,4 +23,8 @@ const IconSVG: React.FC<TIconSVG> = ({ name, isWarrantyActive, customDimensions
23
23
  );
24
24
  };
25
25
 
26
+ IconSVG.defaultProps = {
27
+ customDimensions: false
28
+ };
29
+
26
30
  export default IconSVG;
@@ -65,9 +65,9 @@
65
65
  }
66
66
  },
67
67
  "finance": {
68
+ "creditCostWarning": "Achtung! Kreditaufnahme kostet Geld.",
68
69
  "termSelection": "Laufzeit",
69
70
  "termSelectionMonths": "Laufzeit (Monate)",
70
- "change": "Ändern",
71
71
  "headerTitle": "Dein Angebot",
72
72
  "adjustRate": "Rate anpassen",
73
73
  "secureOffer": "Angebot anfragen",
@@ -88,7 +88,7 @@
88
88
  "detailsShow": "Details anzeigen",
89
89
  "paymentLabel": "Zahlung",
90
90
  "paymentValue": "Überweisung",
91
- "warrantyLabel": "Zusatzgarantie (Multipart)",
91
+ "warrantyLabel": "Garantie",
92
92
  "warrantyValue": "1 Jahr inklusive",
93
93
  "deliveryLabel": "Lieferung",
94
94
  "deliveryValue": "ca. 7–14 Tage · oder Abholung",
@@ -277,16 +277,7 @@
277
277
  "myDealers": "Meine Händler",
278
278
  "dashboard": "Dashboard",
279
279
  "dealerDashboard": "Händler-Dashboard",
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
- }
280
+ "imageSettings": "Bildeinstellungen"
290
281
  },
291
282
  "srp": {
292
283
  "trust": {
@@ -494,12 +485,11 @@
494
485
  "ratings": "Bewertungen"
495
486
  },
496
487
  "section": {
497
- "similar": "Ähnliche Fahrzeuge",
498
- "unavailableSimilar": "Ähnliche / vergleichbare Fahrzeuge"
488
+ "similar": "Ähnliche Fahrzeuge"
499
489
  },
500
490
  "breadcrumb": {
501
491
  "home": "Start",
502
- "used-cars": "Fahrzeuge"
492
+ "used-cars": "Gebrauchtwagen"
503
493
  },
504
494
  "state": {
505
495
  "loading": "Fahrzeug wird geladen…",
@@ -711,7 +701,7 @@
711
701
  },
712
702
  "modal": {
713
703
  "leasingDetails": "Leasingdetails",
714
- "financingDetails": "Finanzierungsdetails",
704
+ "financingDetails": "Finanzierungs-Details",
715
705
  "close": "Schließen",
716
706
  "vehiclePrice": "Fahrzeugpreis ggf. inkl. MwSt.",
717
707
  "leasingAmount": "Leasingbetrag",
@@ -750,13 +740,13 @@
750
740
  "representativeExample": "Repräsentatives Beispiel",
751
741
  "vatDisclaimer": "(alle Preisangaben ggf. inkl. der jeweils gesetzlich gültigen MwSt., derzeit 19%)",
752
742
  "lenderLabel": "Darlehensgeber:",
753
- "lenderName": "Openbank Deutschland AG, Santander-Platz 1, 41061 Mönchengladbach",
743
+ "lenderName": "Open Bank AG, Santander-Platz 1, 41061 Mönchengladbach",
754
744
  "leaseLenderLabel": "Leasinggeber:",
755
- "leaseLenderName": "Openbank Deutschland AG, Santander-Platz 1, 41061 Mönchengladbach",
745
+ "leaseLenderName": "Santander Consumer Leasing GmbH, Santander-Platz 1, 41061 Mönchengladbach",
756
746
  "contractTypeLabel": "Vertragsart:",
757
747
  "contractTypeValue": "Restwertleasing",
758
748
  "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.",
759
- "legalFootnoteAcquisitionPrice": "¹ Der Anschaffungspreis bezeichnet den Preis, den die Openbank Deutschland AG für das Fahrzeug zu bezahlen hat.",
749
+ "legalFootnoteAcquisitionPrice": "¹ Der Anschaffungspreis bezeichnet den Preis, den die Santander Consumer Leasing GmbH für das Fahrzeug zu bezahlen hat.",
760
750
  "legalFootnoteListPriceLease": "² Listenpreis (UVP) = unverbindliche Preisempfehlung des Herstellers.",
761
751
  "closingDisclaimerLine1": "Änderungen und Irrtümer vorbehalten. Farbe und Ausstattung können vom Angebot abweichen.",
762
752
  "closingDisclaimerLine2": "Kostenpflichtige Sonderausstattung möglich.",
@@ -767,8 +757,8 @@
767
757
  "legalNoticeVat": "Alle Preisangaben inkl. der jeweils gesetzlich gültigen MwSt., derzeit 19 %.",
768
758
  "legalNoticeAddServices": "Das Rundum-Sorglos-Paket ist eine einmalige Zahlung.",
769
759
  "listPriceFootnote": "³ Listenpreis (UVP) = unverbindliche Preisempfehlung des Herstellers.",
770
- "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.",
771
- "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.",
760
+ "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.",
761
+ "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.",
772
762
  "sheetTitleFinancing": "Kredit-Rate anpassen",
773
763
  "sheetTitleLeasing": "Leasing-Rate anpassen",
774
764
  "sheetTitleCash": "Kaufen - Details"
@@ -806,8 +796,7 @@
806
796
  "serviceHistory": "Scheckheft",
807
797
  "warranty": "Garantie",
808
798
  "yes": "Ja",
809
- "no": "Nein",
810
- "notSpecified": "keine Angabe"
799
+ "no": "Nein"
811
800
  },
812
801
  "common": {
813
802
  "needsData": "Daten folgt"
@@ -855,25 +844,5 @@
855
844
  "captionSlices": "Scheiben",
856
845
  "captionSteeringWheel": "Lenkrad",
857
846
  "captionWheelsLandingGear": "Räder | Fahrwerk"
858
- },
859
- "cookieModal": {
860
- "dialogLabel": "Cookie-Einstellungen",
861
- "title": "Nach den Cookies geht die Fahrt weiter.",
862
- "manageText": "Für ein bestmögliches Nutzererlebnis setzen wir Cookies und andere Technologien ein. Diese können Sie hier verwalten.",
863
- "necessary": {
864
- "title": "Notwendig",
865
- "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."
866
- },
867
- "analytics": {
868
- "title": "Analytisch",
869
- "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."
870
- },
871
- "marketing": {
872
- "title": "Marketing",
873
- "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."
874
- },
875
- "privacyPolicy": "Datenschutzbestimmungen",
876
- "saveSelection": "Auswahl speichern",
877
- "acceptAll": "Alles akzeptieren"
878
847
  }
879
848
  }