@bytebrand/fe-ui-core-autobahn 1.0.204 → 1.0.205
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 +1 -1
- package/package.json +1 -1
- package/theme/md3.css +15 -0
- package/ui/CreditKeyFigures.tsx +9 -4
package/cards/cardParts.tsx
CHANGED
|
@@ -1214,7 +1214,7 @@ export const PricePaths: React.FunctionComponent<PricePathsProps> = ({ car, t, c
|
|
|
1214
1214
|
Laufzeit" terms here (same .pp-hero-terms size/colour, wraps in the narrow column);
|
|
1215
1215
|
without any real figure the old terms line stays. Leasing row below unchanged. */}
|
|
1216
1216
|
{hasCreditKeyFigures(finKf) ? (
|
|
1217
|
-
<CreditKeyFigures t={t} figures={finKf} details={detailsLink('financing')} cls="pp-ckf" />
|
|
1217
|
+
<CreditKeyFigures t={t} figures={finKf} details={detailsLink('financing')} cls="pp-ckf" fit={false} />
|
|
1218
1218
|
) : (
|
|
1219
1219
|
<>
|
|
1220
1220
|
{t('autobahn:card.price.financeTerms', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/fe-ui-core-autobahn",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.205",
|
|
4
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
5
|
"main": "index.ts",
|
|
6
6
|
"license": "UNLICENSED",
|
package/theme/md3.css
CHANGED
|
@@ -15656,3 +15656,18 @@ color: #005CFF;
|
|
|
15656
15656
|
.md3 .ckf .ckf-details > * {
|
|
15657
15657
|
font-size: inherit !important;
|
|
15658
15658
|
}
|
|
15659
|
+
|
|
15660
|
+
/* ADV-405 (PM 19.11): SRL desktop list card + dashboard row (PricePaths, .pp-ckf): the key figures
|
|
15661
|
+
keep the column's own 10.5px terms size and flow as one wrapping paragraph (about three lines in
|
|
15662
|
+
the ~210px column) instead of the two-line auto-fit. Elsewhere the separator between the two
|
|
15663
|
+
lines stays hidden. */
|
|
15664
|
+
.md3 .ckf:not(.ckf--flow) > .ckf-sep {
|
|
15665
|
+
display: none !important; /* host dot rules (e.g. .ad-req-terms .cc-terms-dot) must not show it */
|
|
15666
|
+
}
|
|
15667
|
+
.md3 .ckf.ckf--flow .ckf-line {
|
|
15668
|
+
display: inline;
|
|
15669
|
+
white-space: normal;
|
|
15670
|
+
}
|
|
15671
|
+
.md3 .ckf.ckf--flow .ckf-sep {
|
|
15672
|
+
display: inline;
|
|
15673
|
+
}
|
package/ui/CreditKeyFigures.tsx
CHANGED
|
@@ -29,6 +29,9 @@ export interface CreditKeyFiguresProps {
|
|
|
29
29
|
details?: React.ReactNode;
|
|
30
30
|
/** host class(es) for size/colour/spacing (follow the host block's conditions line). */
|
|
31
31
|
cls?: string;
|
|
32
|
+
/** false: no two-line auto-fit — the host keeps its own font size and lets the figures flow as
|
|
33
|
+
* one wrapping paragraph (SRL desktop price column, PM 19.11: "own size, three lines are fine"). */
|
|
34
|
+
fit?: boolean;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
const real = (n: number | null | undefined): n is number => typeof n === 'number' && isFinite(n) && n > 0;
|
|
@@ -80,7 +83,7 @@ const useIsoLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : use
|
|
|
80
83
|
* optional `details` element (the host's details link/button) ends line 2, always labelled
|
|
81
84
|
* "Details" (card.price.detailsLink), as in the PM's mock.
|
|
82
85
|
*/
|
|
83
|
-
const CreditKeyFigures: React.FunctionComponent<CreditKeyFiguresProps> = ({ t, figures, details, cls }) => {
|
|
86
|
+
const CreditKeyFigures: React.FunctionComponent<CreditKeyFiguresProps> = ({ t, figures, details, cls, fit: autoFit = true }) => {
|
|
84
87
|
const [line1, line2] = creditKeyFigureLines(t, figures);
|
|
85
88
|
const ref = useRef<HTMLDivElement>(null);
|
|
86
89
|
const detailsLabel = t('autobahn:card.price.detailsLink', { defaultValue: 'Details' });
|
|
@@ -89,7 +92,7 @@ const CreditKeyFigures: React.FunctionComponent<CreditKeyFiguresProps> = ({ t, f
|
|
|
89
92
|
|
|
90
93
|
useIsoLayoutEffect(() => {
|
|
91
94
|
const el = ref.current;
|
|
92
|
-
if (!el || typeof window === 'undefined') return undefined;
|
|
95
|
+
if (!autoFit || !el || typeof window === 'undefined') return undefined;
|
|
93
96
|
const fit = (): void => {
|
|
94
97
|
el.style.fontSize = '';
|
|
95
98
|
const lines = Array.prototype.slice.call(el.querySelectorAll('.ckf-line')) as HTMLElement[];
|
|
@@ -113,7 +116,7 @@ const CreditKeyFigures: React.FunctionComponent<CreditKeyFiguresProps> = ({ t, f
|
|
|
113
116
|
});
|
|
114
117
|
ro.observe(el);
|
|
115
118
|
return () => ro.disconnect();
|
|
116
|
-
}, [key]);
|
|
119
|
+
}, [key, autoFit]);
|
|
117
120
|
|
|
118
121
|
const renderParts = (parts: string[]): React.ReactNode =>
|
|
119
122
|
parts.map((part, i) => (
|
|
@@ -123,8 +126,10 @@ const CreditKeyFigures: React.FunctionComponent<CreditKeyFiguresProps> = ({ t, f
|
|
|
123
126
|
</React.Fragment>
|
|
124
127
|
));
|
|
125
128
|
return (
|
|
126
|
-
<div ref={ref} className={'ckf' + (cls ? ` ${cls}` : '')}>
|
|
129
|
+
<div ref={ref} className={'ckf' + (autoFit ? '' : ' ckf--flow') + (cls ? ` ${cls}` : '')}>
|
|
127
130
|
{line1.length > 0 && <span className="ckf-line">{renderParts(line1)}</span>}
|
|
131
|
+
{/* separator between the two lines — only shown when they flow as one paragraph (ckf--flow) */}
|
|
132
|
+
{line1.length > 0 && (line2.length > 0 || detailsEl) && <span className="ckf-sep cc-terms-dot"> · </span>}
|
|
128
133
|
{(line2.length > 0 || detailsEl) && (
|
|
129
134
|
<span className="ckf-line">
|
|
130
135
|
{renderParts(line2)}
|