@bytebrand/fe-ui-core-autobahn 1.0.201 → 1.0.203
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/cardParts.tsx +1333 -1290
- package/cards/types.ts +174 -165
- package/data/toAutobahnCar.ts +578 -566
- package/locales/de/autobahn.json +887 -882
- package/locales/en/autobahn.json +887 -882
- package/package.json +30 -30
- package/theme/md3.css +64 -0
- package/ui/CreditKeyFigures.tsx +103 -0
- package/ui/index.ts +96 -93
- package/vdp/FinanceCalculator.tsx +29 -3
- package/vdp/VdpModules.tsx +3863 -3835
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.30",
|
|
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.203",
|
|
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.30",
|
|
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
|
@@ -15593,3 +15593,67 @@ color: #005CFF;
|
|
|
15593
15593
|
line-height: 16px;
|
|
15594
15594
|
}
|
|
15595
15595
|
}
|
|
15596
|
+
|
|
15597
|
+
/* ADV-405 follow-up: financing key figures (Kerndaten) — ui/CreditKeyFigures.tsx. Two lines in the
|
|
15598
|
+
host's conditions-line style (hosts set size/colour via their own class); wraps where narrow. */
|
|
15599
|
+
.md3 .ckf {
|
|
15600
|
+
display: block;
|
|
15601
|
+
}
|
|
15602
|
+
.md3 .ckf-line {
|
|
15603
|
+
display: block;
|
|
15604
|
+
}
|
|
15605
|
+
|
|
15606
|
+
/* ADV-405 follow-up — PricePaths (SRL list card + dashboard row, cardParts.tsx): the financing key
|
|
15607
|
+
figures inside .pp-hero-terms (class .pp-ckf). That host line separates its parts with a plain
|
|
15608
|
+
" · " in the line's own size/colour (no .cc-terms-dot), so CreditKeyFigures' .cc-terms-dot
|
|
15609
|
+
separators are reset to plain inherited text here — same look as the old terms line and the
|
|
15610
|
+
leasing row's .pp-sub-terms dots. (CarCard's .cc-ckf keeps .cc-terms-dot: that is its host style.) */
|
|
15611
|
+
.md3 .pp-ckf .cc-terms-dot {
|
|
15612
|
+
display: inline;
|
|
15613
|
+
margin: 0;
|
|
15614
|
+
color: inherit;
|
|
15615
|
+
font-size: inherit;
|
|
15616
|
+
line-height: inherit;
|
|
15617
|
+
vertical-align: baseline;
|
|
15618
|
+
}
|
|
15619
|
+
|
|
15620
|
+
/* ADV-405 follow-up — checkout key figures (area: CheckoutPage — B Zahlungsdetails .cf-panel,
|
|
15621
|
+
C desktop sidebar .co-aside, D Bestellübersicht card "5. Monatlich zu zahlen"). */
|
|
15622
|
+
|
|
15623
|
+
/* B + C: CreditKeyFigures carries the host class .co-aside-cond (same size/colour/line-height as
|
|
15624
|
+
the old "Anzahlung · Monate" line); give its " · " separators the host's own .co-aside-cond-dot
|
|
15625
|
+
size (18px) instead of .cc-terms-dot's 20px — everything else of the two dot rules is equal. */
|
|
15626
|
+
.md3 .co-aside-cond.ckf .cc-terms-dot {
|
|
15627
|
+
font-size: 18px;
|
|
15628
|
+
}
|
|
15629
|
+
|
|
15630
|
+
/* D: CreditKeyFigures carries .oo-pay-mobile-summary (13px Arimo #0E2238) and shows at every
|
|
15631
|
+
width for financing; the old condensed line joined its parts with plain-text " · " — keep the
|
|
15632
|
+
separators plain text in the host's own size/colour. */
|
|
15633
|
+
.md3 .oo-pay-kf .cc-terms-dot {
|
|
15634
|
+
display: inline;
|
|
15635
|
+
margin: 0;
|
|
15636
|
+
font-size: inherit;
|
|
15637
|
+
line-height: inherit;
|
|
15638
|
+
vertical-align: baseline;
|
|
15639
|
+
color: inherit;
|
|
15640
|
+
}
|
|
15641
|
+
|
|
15642
|
+
/* ADV-405 follow-up — mobile sticky footer (VdpBottomBar) of a car WITH financing key figures
|
|
15643
|
+
(.vdp-bottom-bar--kf, set on every tab so the tab row never moves when switching): on Finanzierung
|
|
15644
|
+
the key figures take 2 lines on ~414px phones, 3 on 375–390px, 4 on ≤360px (measured bars 251 /
|
|
15645
|
+
266 / 281px), so one fixed height per width band; Leasing/Kaufen keep the same height (empty space
|
|
15646
|
+
instead of a jump). Cars without key figures keep the 234px above. */
|
|
15647
|
+
.md3 .vdp-bottom-bar.vdp-bottom-bar--kf {
|
|
15648
|
+
height: 284px;
|
|
15649
|
+
}
|
|
15650
|
+
@media (min-width: 361px) {
|
|
15651
|
+
.md3 .vdp-bottom-bar.vdp-bottom-bar--kf {
|
|
15652
|
+
height: 268px;
|
|
15653
|
+
}
|
|
15654
|
+
}
|
|
15655
|
+
@media (min-width: 410px) {
|
|
15656
|
+
.md3 .vdp-bottom-bar.vdp-bottom-bar--kf {
|
|
15657
|
+
height: 252px;
|
|
15658
|
+
}
|
|
15659
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { TranslationFunction } from '../types';
|
|
4
|
+
import { formatEur, formatEurCents, formatPct } from '../utils/financeFormat';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Financing key figures of the representative example, in the order the PM asked for (ADV-405
|
|
8
|
+
* follow-up, 19.11): "60 Mon. · 24.549 € Nettokredit · Gesamtbetrag: 31.776,28 €" /
|
|
9
|
+
* "6,78 % Sollzins fest · 6,99 % eff. Jahreszins · Details". Same sources as the
|
|
10
|
+
* Finanzierungsdetails layer (FinanceDetailsModal): term = paybackPeriod, net loan =
|
|
11
|
+
* netLoanAmount, total = totalFinancingAmount (falls back to grossLoanAmount), nominal rate =
|
|
12
|
+
* nominalInterestRate, effective rate = annualPercentageRate.
|
|
13
|
+
*/
|
|
14
|
+
export interface CreditKeyFiguresData {
|
|
15
|
+
/** contract term (paybackPeriod) — exactly the layer's "Vertragslaufzeit" (e.g. 48, also with a Schlussrate). */
|
|
16
|
+
months?: number | null;
|
|
17
|
+
/** final instalment (Schlussrate) of the same calculation — not shown; kept for the hosts' data. */
|
|
18
|
+
finalInstallment?: number | null;
|
|
19
|
+
netLoan?: number | null;
|
|
20
|
+
total?: number | null;
|
|
21
|
+
nominal?: number | null;
|
|
22
|
+
apr?: number | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface CreditKeyFiguresProps {
|
|
26
|
+
t: TranslationFunction;
|
|
27
|
+
figures: CreditKeyFiguresData;
|
|
28
|
+
/** optional trailing element of line 2 (the host's existing "Details"/"Finanzierungsdetails" link). */
|
|
29
|
+
details?: React.ReactNode;
|
|
30
|
+
/** host class(es) for size/colour/spacing (follow the host block's conditions line). */
|
|
31
|
+
cls?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const real = (n: number | null | undefined): n is number => typeof n === 'number' && isFinite(n) && n > 0;
|
|
35
|
+
|
|
36
|
+
/** the parts of both lines — only real figures, never a fabricated value; empty lines are dropped. */
|
|
37
|
+
export function creditKeyFigureLines(t: TranslationFunction, f: CreditKeyFiguresData): string[][] {
|
|
38
|
+
const line1: string[] = [];
|
|
39
|
+
const line2: string[] = [];
|
|
40
|
+
if (real(f.months)) {
|
|
41
|
+
// the layer's "Vertragslaufzeit" (not the "N Raten à" count, which is one less with a Schlussrate)
|
|
42
|
+
const months = Math.round(f.months);
|
|
43
|
+
line1.push(t('autobahn:finance.kfMonths', { months, defaultValue: `${months} Mon.` }));
|
|
44
|
+
}
|
|
45
|
+
if (real(f.netLoan)) {
|
|
46
|
+
const v = formatEur(Math.round(f.netLoan));
|
|
47
|
+
line1.push(t('autobahn:finance.kfNetLoan', { value: v, defaultValue: `${v} € Nettokredit` }));
|
|
48
|
+
}
|
|
49
|
+
if (real(f.total)) {
|
|
50
|
+
const v = formatEurCents(f.total);
|
|
51
|
+
line1.push(t('autobahn:finance.kfTotal', { value: v, defaultValue: `Gesamtbetrag: ${v} €` }));
|
|
52
|
+
}
|
|
53
|
+
if (real(f.nominal)) {
|
|
54
|
+
const v = formatPct(f.nominal);
|
|
55
|
+
line2.push(t('autobahn:finance.kfNominal', { value: v, defaultValue: `${v} Sollzins fest` }));
|
|
56
|
+
}
|
|
57
|
+
if (real(f.apr)) {
|
|
58
|
+
const v = formatPct(f.apr);
|
|
59
|
+
line2.push(t('autobahn:finance.kfApr', { value: v, defaultValue: `${v} eff. Jahreszins` }));
|
|
60
|
+
}
|
|
61
|
+
// keep every € / % on its amount's line (no-break space), like the € in the hosts' money strings
|
|
62
|
+
const keepUnits = (part: string): string => part.replace(/ (€|%)/g, '\u00a0$1');
|
|
63
|
+
return [line1.map(keepUnits), line2.map(keepUnits)];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** true when at least one figure is real (otherwise hosts keep their previous conditions line). */
|
|
67
|
+
export function hasCreditKeyFigures(f: CreditKeyFiguresData): boolean {
|
|
68
|
+
return [f.months, f.netLoan, f.total, f.nominal, f.apr].some(real);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Two short lines with the financing key figures (Kerndaten). Plain text in the host's
|
|
73
|
+
* conditions-line style; the " · " separators reuse the quiet .cc-terms-dot. The optional
|
|
74
|
+
* `details` element (the host's existing details link) ends line 2.
|
|
75
|
+
*/
|
|
76
|
+
const CreditKeyFigures: React.FunctionComponent<CreditKeyFiguresProps> = ({ t, figures, details, cls }) => {
|
|
77
|
+
const [line1, line2] = creditKeyFigureLines(t, figures);
|
|
78
|
+
const renderParts = (parts: string[]): React.ReactNode =>
|
|
79
|
+
parts.map((part, i) => (
|
|
80
|
+
<React.Fragment key={i}>
|
|
81
|
+
{i > 0 && <span className="cc-terms-dot"> · </span>}
|
|
82
|
+
{part}
|
|
83
|
+
</React.Fragment>
|
|
84
|
+
));
|
|
85
|
+
return (
|
|
86
|
+
<div className={'ckf' + (cls ? ` ${cls}` : '')}>
|
|
87
|
+
{line1.length > 0 && <span className="ckf-line">{renderParts(line1)}</span>}
|
|
88
|
+
{(line2.length > 0 || details) && (
|
|
89
|
+
<span className="ckf-line">
|
|
90
|
+
{renderParts(line2)}
|
|
91
|
+
{details && (
|
|
92
|
+
<>
|
|
93
|
+
{line2.length > 0 && <span className="cc-terms-dot"> · </span>}
|
|
94
|
+
{details}
|
|
95
|
+
</>
|
|
96
|
+
)}
|
|
97
|
+
</span>
|
|
98
|
+
)}
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export default CreditKeyFigures;
|
package/ui/index.ts
CHANGED
|
@@ -1,93 +1,96 @@
|
|
|
1
|
-
// Autobahn (auto.de redesign) — presentational UI primitives.
|
|
2
|
-
//
|
|
3
|
-
// Typed, pure React 18 + TS port of the design kit's primitives from
|
|
4
|
-
// docs/redesign/design-source/ui_kits/website/ui.jsx. The original kit exported
|
|
5
|
-
// everything via `Object.assign(window, {...})`; here each primitive is a real
|
|
6
|
-
// ES module with an explicit props interface, re-exported below.
|
|
7
|
-
//
|
|
8
|
-
// SCOPING — IMPORTANT:
|
|
9
|
-
// These components rely on the scoped CSS layer at
|
|
10
|
-
// services/fe-main/source/theme/autobahn/ (md3.css)
|
|
11
|
-
// where EVERY utility class is scoped under `.md3` (e.g. `.md3 .mbtn`,
|
|
12
|
-
// `.md3 .chip`, `.md3 .statchip--good`, `.md3 .segmented .on`, `.md3 .mfield`,
|
|
13
|
-
// `.md3 .num`, `.md3 .car-arrow`, `.md3 .imglabel`, `.md3 .md-title`, …).
|
|
14
|
-
// They therefore ONLY render correctly inside a `<div className="md3">` subtree.
|
|
15
|
-
//
|
|
16
|
-
// All components are pure/presentational: no store, no API, no window access.
|
|
17
|
-
|
|
18
|
-
export { default as Icon } from './Icon';
|
|
19
|
-
export type { IconProps } from './Icon';
|
|
20
|
-
|
|
21
|
-
export { default as Button } from './Button';
|
|
22
|
-
export type { ButtonProps, ButtonVariant, ButtonSize } from './Button';
|
|
23
|
-
|
|
24
|
-
export { default as IconButton } from './IconButton';
|
|
25
|
-
export type { IconButtonProps } from './IconButton';
|
|
26
|
-
|
|
27
|
-
export { default as Chip } from './Chip';
|
|
28
|
-
export type { ChipProps } from './Chip';
|
|
29
|
-
|
|
30
|
-
export { default as StatChip } from './StatChip';
|
|
31
|
-
export type { StatChipProps, StatChipTone } from './StatChip';
|
|
32
|
-
|
|
33
|
-
export { default as CreditCostNotice, CREDIT_COST_WARNING_DE } from './CreditCostNotice';
|
|
34
|
-
export type { CreditCostNoticeProps, CreditCostNoticeTone, CreditCostNoticeSize } from './CreditCostNotice';
|
|
35
|
-
|
|
36
|
-
export { default as
|
|
37
|
-
export type {
|
|
38
|
-
|
|
39
|
-
export { default as
|
|
40
|
-
export type {
|
|
41
|
-
|
|
42
|
-
export { default as
|
|
43
|
-
export type {
|
|
44
|
-
|
|
45
|
-
export {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export
|
|
49
|
-
|
|
50
|
-
export { default as
|
|
51
|
-
export type {
|
|
52
|
-
|
|
53
|
-
export { default as
|
|
54
|
-
export type {
|
|
55
|
-
|
|
56
|
-
export { default as
|
|
57
|
-
export type {
|
|
58
|
-
|
|
59
|
-
export { default as
|
|
60
|
-
export type {
|
|
61
|
-
|
|
62
|
-
export { default as
|
|
63
|
-
export type {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
export {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
export
|
|
70
|
-
export {
|
|
71
|
-
export
|
|
72
|
-
export {
|
|
73
|
-
export
|
|
74
|
-
export {
|
|
75
|
-
export
|
|
76
|
-
export {
|
|
77
|
-
export
|
|
78
|
-
export {
|
|
79
|
-
export
|
|
80
|
-
export {
|
|
81
|
-
export
|
|
82
|
-
export {
|
|
83
|
-
export
|
|
84
|
-
export {
|
|
85
|
-
export
|
|
86
|
-
export {
|
|
87
|
-
export
|
|
88
|
-
export {
|
|
89
|
-
export
|
|
90
|
-
export {
|
|
91
|
-
export
|
|
92
|
-
export {
|
|
93
|
-
export
|
|
1
|
+
// Autobahn (auto.de redesign) — presentational UI primitives.
|
|
2
|
+
//
|
|
3
|
+
// Typed, pure React 18 + TS port of the design kit's primitives from
|
|
4
|
+
// docs/redesign/design-source/ui_kits/website/ui.jsx. The original kit exported
|
|
5
|
+
// everything via `Object.assign(window, {...})`; here each primitive is a real
|
|
6
|
+
// ES module with an explicit props interface, re-exported below.
|
|
7
|
+
//
|
|
8
|
+
// SCOPING — IMPORTANT:
|
|
9
|
+
// These components rely on the scoped CSS layer at
|
|
10
|
+
// services/fe-main/source/theme/autobahn/ (md3.css)
|
|
11
|
+
// where EVERY utility class is scoped under `.md3` (e.g. `.md3 .mbtn`,
|
|
12
|
+
// `.md3 .chip`, `.md3 .statchip--good`, `.md3 .segmented .on`, `.md3 .mfield`,
|
|
13
|
+
// `.md3 .num`, `.md3 .car-arrow`, `.md3 .imglabel`, `.md3 .md-title`, …).
|
|
14
|
+
// They therefore ONLY render correctly inside a `<div className="md3">` subtree.
|
|
15
|
+
//
|
|
16
|
+
// All components are pure/presentational: no store, no API, no window access.
|
|
17
|
+
|
|
18
|
+
export { default as Icon } from './Icon';
|
|
19
|
+
export type { IconProps } from './Icon';
|
|
20
|
+
|
|
21
|
+
export { default as Button } from './Button';
|
|
22
|
+
export type { ButtonProps, ButtonVariant, ButtonSize } from './Button';
|
|
23
|
+
|
|
24
|
+
export { default as IconButton } from './IconButton';
|
|
25
|
+
export type { IconButtonProps } from './IconButton';
|
|
26
|
+
|
|
27
|
+
export { default as Chip } from './Chip';
|
|
28
|
+
export type { ChipProps } from './Chip';
|
|
29
|
+
|
|
30
|
+
export { default as StatChip } from './StatChip';
|
|
31
|
+
export type { StatChipProps, StatChipTone } from './StatChip';
|
|
32
|
+
|
|
33
|
+
export { default as CreditCostNotice, CREDIT_COST_WARNING_DE } from './CreditCostNotice';
|
|
34
|
+
export type { CreditCostNoticeProps, CreditCostNoticeTone, CreditCostNoticeSize } from './CreditCostNotice';
|
|
35
|
+
|
|
36
|
+
export { default as CreditKeyFigures, creditKeyFigureLines, hasCreditKeyFigures } from './CreditKeyFigures';
|
|
37
|
+
export type { CreditKeyFiguresProps, CreditKeyFiguresData } from './CreditKeyFigures';
|
|
38
|
+
|
|
39
|
+
export { default as Segmented } from './Segmented';
|
|
40
|
+
export type { SegmentedProps, SegmentedOption } from './Segmented';
|
|
41
|
+
|
|
42
|
+
export { default as FormField } from './FormField';
|
|
43
|
+
export type { FormFieldProps } from './FormField';
|
|
44
|
+
|
|
45
|
+
export { default as Dropdown } from './Dropdown';
|
|
46
|
+
export type { DropdownProps, DropdownOption } from './Dropdown';
|
|
47
|
+
|
|
48
|
+
export { scrollFieldIntoView } from './scrollFieldIntoView';
|
|
49
|
+
|
|
50
|
+
export { default as Spec } from './Spec';
|
|
51
|
+
export type { SpecProps } from './Spec';
|
|
52
|
+
|
|
53
|
+
export { default as Price } from './Price';
|
|
54
|
+
export type { PriceProps } from './Price';
|
|
55
|
+
|
|
56
|
+
export { default as Stars } from './Stars';
|
|
57
|
+
export type { StarsProps } from './Stars';
|
|
58
|
+
|
|
59
|
+
export { default as PriceEvalBar } from './PriceEvalBar';
|
|
60
|
+
export type { PriceEvalBarProps } from './PriceEvalBar';
|
|
61
|
+
|
|
62
|
+
export { default as SaveChip } from './SaveChip';
|
|
63
|
+
export type { SaveChipProps } from './SaveChip';
|
|
64
|
+
|
|
65
|
+
export { default as CardCarousel } from './CardCarousel';
|
|
66
|
+
export type { CardCarouselProps } from './CardCarousel';
|
|
67
|
+
|
|
68
|
+
// ── md3 kit (Group-B in-place rebuild) — form-bound + layout + overlay primitives ──
|
|
69
|
+
export { default as FormDropdown } from './FormDropdown';
|
|
70
|
+
export type { FormDropdownProps } from './FormDropdown';
|
|
71
|
+
export { default as FormCheckbox } from './FormCheckbox';
|
|
72
|
+
export type { FormCheckboxProps } from './FormCheckbox';
|
|
73
|
+
export { default as FormRadioGroup } from './FormRadioGroup';
|
|
74
|
+
export type { FormRadioGroupProps } from './FormRadioGroup';
|
|
75
|
+
export { default as FormRadio } from './FormRadio';
|
|
76
|
+
export type { FormRadioProps } from './FormRadio';
|
|
77
|
+
export { default as Accordion } from './Accordion';
|
|
78
|
+
export type { AccordionProps } from './Accordion';
|
|
79
|
+
export { default as Modal } from './Modal';
|
|
80
|
+
export type { ModalProps, ModalSize } from './Modal';
|
|
81
|
+
export { default as DatePicker } from './DatePicker';
|
|
82
|
+
export type { DatePickerProps } from './DatePicker';
|
|
83
|
+
export { default as Table, Thead, Tbody, Tr, Th, Td } from './Table';
|
|
84
|
+
export type { TableProps, TheadProps, TbodyProps, TrProps, ThProps, TdProps, TableAlign } from './Table';
|
|
85
|
+
export { default as Switch } from './Switch';
|
|
86
|
+
export type { SwitchProps } from './Switch';
|
|
87
|
+
export { default as Textarea } from './Textarea';
|
|
88
|
+
export type { TextareaProps } from './Textarea';
|
|
89
|
+
export { default as Pagination } from './Pagination';
|
|
90
|
+
export type { PaginationProps } from './Pagination';
|
|
91
|
+
export { default as Stepper } from './Stepper';
|
|
92
|
+
export type { StepperProps, StepperStep, StepStatus } from './Stepper';
|
|
93
|
+
export { default as FileUpload } from './FileUpload';
|
|
94
|
+
export type { FileUploadProps } from './FileUpload';
|
|
95
|
+
export { default as Skeleton } from './Skeleton';
|
|
96
|
+
export type { SkeletonProps } from './Skeleton';
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
import React, { useState, useEffect } from 'react';
|
|
17
17
|
import { TranslationFunction } from '../types';
|
|
18
18
|
|
|
19
|
-
import { Button, Icon, Switch, CreditCostNotice } from '../ui';
|
|
19
|
+
import { Button, Icon, Switch, CreditCostNotice, CreditKeyFigures, hasCreditKeyFigures } from '../ui';
|
|
20
|
+
import type { CreditKeyFiguresData } from '../ui';
|
|
20
21
|
import { TIER_LABELS, TIER_KEYS, TIER_COLORS } from '../constants';
|
|
21
22
|
|
|
22
23
|
/** Payment mode segment keys. Mirrors the design's ['fin','leasing','cash']. */
|
|
@@ -362,6 +363,12 @@ export interface FinanceCalculatorProps {
|
|
|
362
363
|
oldMonthly?: number;
|
|
363
364
|
/** effective annual rate (%) for the current mode — supplied, NOT computed here. */
|
|
364
365
|
apr: number;
|
|
366
|
+
/** ADV-405 follow-up: financing key figures (Kerndaten) of the CURRENT calculation — the same
|
|
367
|
+
* financing-config values the Finanzierungsdetails layer shows (paybackPeriod, netLoanAmount,
|
|
368
|
+
* totalFinancingAmount else grossLoanAmount, nominalInterestRate, annualPercentageRate). When
|
|
369
|
+
* at least one is real, the financing conditions line shows them instead of "0 € Anzahlung ·
|
|
370
|
+
* 60 Monate". Financing only (leasing/Kaufen ignore it); omit to keep the old line. */
|
|
371
|
+
creditKeyFigures?: CreditKeyFiguresData;
|
|
365
372
|
/** current down payment in EUR (controlled). */
|
|
366
373
|
down: number;
|
|
367
374
|
/** current term in months (controlled). */
|
|
@@ -489,6 +496,7 @@ const FinanceCalculator: React.FunctionComponent<FinanceCalculatorProps> = ({
|
|
|
489
496
|
ratingLabel,
|
|
490
497
|
monthly,
|
|
491
498
|
oldMonthly,
|
|
499
|
+
creditKeyFigures,
|
|
492
500
|
down,
|
|
493
501
|
term,
|
|
494
502
|
downMin,
|
|
@@ -555,6 +563,9 @@ const FinanceCalculator: React.FunctionComponent<FinanceCalculatorProps> = ({
|
|
|
555
563
|
condParts.push(t('autobahn:finance.downPaymentLabel', { value: eur(down) }));
|
|
556
564
|
condParts.push(t('autobahn:finance.monthsLabel', { months: term, count: term }));
|
|
557
565
|
}
|
|
566
|
+
// ADV-405 follow-up: financing shows the key figures (Kerndaten) in place of the line above —
|
|
567
|
+
// only when at least one figure is real, else the old "0 € Anzahlung · 60 Monate" line stays.
|
|
568
|
+
const keyFigures = mode === 'fin' && creditKeyFigures && hasCreditKeyFigures(creditKeyFigures) ? creditKeyFigures : undefined;
|
|
558
569
|
|
|
559
570
|
return (
|
|
560
571
|
<div className="mcard mcard--elevated fin-calc-card" style={{ padding: 20 }}>
|
|
@@ -883,8 +894,23 @@ const FinanceCalculator: React.FunctionComponent<FinanceCalculatorProps> = ({
|
|
|
883
894
|
{/* col 1 row 2: condition line — financing "0 € Anzahlung · 60 Monate · Finanzierungsdetails",
|
|
884
895
|
leasing "25.000 € Sonderzahlung · 60 Mon. · 10.000 km/Jahr · Details". Buy has nothing
|
|
885
896
|
to show here (no down payment/term/details link of its own) — not rendered at all
|
|
886
|
-
rather than left as an empty reserved-height div.
|
|
887
|
-
|
|
897
|
+
rather than left as an empty reserved-height div.
|
|
898
|
+
ADV-405 follow-up: financing with real key figures → the Kerndaten (2 lines, same
|
|
899
|
+
.fin-cond grid cell/size/colour, wraps where narrow) ending with the same details link. */}
|
|
900
|
+
{keyFigures ? (
|
|
901
|
+
<CreditKeyFigures
|
|
902
|
+
t={t}
|
|
903
|
+
figures={keyFigures}
|
|
904
|
+
cls="fin-cond fin-ckf"
|
|
905
|
+
details={
|
|
906
|
+
onShowDetails && (
|
|
907
|
+
<button type="button" className="cc-terms-link" onClick={onShowDetails}>
|
|
908
|
+
{t('autobahn:finance.financingDetails')}
|
|
909
|
+
</button>
|
|
910
|
+
)
|
|
911
|
+
}
|
|
912
|
+
/>
|
|
913
|
+
) : !isCash && (
|
|
888
914
|
<div className="fin-cond">
|
|
889
915
|
{condParts.map((part, i) => (
|
|
890
916
|
<React.Fragment key={i}>
|