@bytebrand/fe-ui-core-autobahn 1.0.194 → 1.0.196

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/package.json CHANGED
@@ -1,30 +1,30 @@
1
- {
2
- "name": "@bytebrand/fe-ui-core-autobahn",
3
- "version": "1.0.194",
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.196",
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,44 +1,44 @@
1
- import React from 'react';
2
-
3
- import Icon from './Icon';
4
- import { TranslationFunction } from '../types';
5
-
6
- /** ADV-405 statutory German wording. The i18n fallback, so a stale locale cache (or a host that only loads the de locale) never shows the raw key. */
7
- export const CREDIT_COST_WARNING_DE = 'Achtung! Kreditaufnahme kostet Geld.';
8
-
9
- export type CreditCostNoticeTone = 'light' | 'dark';
10
- export type CreditCostNoticeSize = 'standard' | 'small';
11
-
12
- export interface CreditCostNoticeProps {
13
- t: TranslationFunction;
14
- /** light = Figma "Ton=Hell" (default), dark = "Ton=Dunkel" (dark hero backgrounds only). */
15
- tone?: CreditCostNoticeTone;
16
- /** standard ≈ 8×10 px padding, small ≈ 5×6 px (small cards / narrow price columns). */
17
- size?: CreditCostNoticeSize;
18
- /** extra class(es) for the host's size/colour/spacing rules (font size and colour follow the host block's conditions line). */
19
- cls?: string;
20
- }
21
-
22
- /**
23
- * Kreditkosten-Hinweis (ADV-405, Verbraucherkreditreform 2026): the warning
24
- * "Achtung! Kreditaufnahme kostet Geld." with a Lucide info icon. Static, always
25
- * visible, real text; the icon is hidden from screen readers. The English locale
26
- * shows "Warning! Financing comes at a cost." (the text follows the page language,
27
- * so no lang attribute of its own). Hosts decide visibility (financing/leasing
28
- * shown, Kaufen hidden).
29
- */
30
- const CreditCostNotice: React.FunctionComponent<CreditCostNoticeProps> = ({ t, tone = 'light', size = 'standard', cls }) => {
31
- const className = ['ccn', `ccn--${tone}`, size === 'small' ? 'ccn--small' : '', cls || ''].filter(Boolean).join(' ');
32
- return (
33
- <div className={className}>
34
- <span className="ccn-icon" aria-hidden="true">
35
- <Icon name="info" size={16} stroke={2} />
36
- </span>
37
- <span className="ccn-text">
38
- {t('autobahn:finance.creditCostWarning', { defaultValue: CREDIT_COST_WARNING_DE })}
39
- </span>
40
- </div>
41
- );
42
- };
43
-
44
- export default CreditCostNotice;
1
+ import React from 'react';
2
+
3
+ import Icon from './Icon';
4
+ import { TranslationFunction } from '../types';
5
+
6
+ /** ADV-405 statutory German wording. The i18n fallback, so a stale locale cache (or a host that only loads the de locale) never shows the raw key. */
7
+ export const CREDIT_COST_WARNING_DE = 'Achtung! Kreditaufnahme kostet Geld.';
8
+
9
+ export type CreditCostNoticeTone = 'light' | 'dark';
10
+ export type CreditCostNoticeSize = 'standard' | 'small';
11
+
12
+ export interface CreditCostNoticeProps {
13
+ t: TranslationFunction;
14
+ /** light = Figma "Ton=Hell" (default), dark = "Ton=Dunkel" (dark hero backgrounds only). */
15
+ tone?: CreditCostNoticeTone;
16
+ /** standard ≈ 8×10 px padding, small ≈ 5×6 px (small cards / narrow price columns). */
17
+ size?: CreditCostNoticeSize;
18
+ /** extra class(es) for the host's size/colour/spacing rules (font size and colour follow the host block's conditions line). */
19
+ cls?: string;
20
+ }
21
+
22
+ /**
23
+ * Kreditkosten-Hinweis (ADV-405, Verbraucherkreditreform 2026): the warning
24
+ * "Achtung! Kreditaufnahme kostet Geld." with a Lucide info icon. Static, always
25
+ * visible, real text; the icon is hidden from screen readers. The English locale
26
+ * shows "Warning! Financing comes at a cost." (the text follows the page language,
27
+ * so no lang attribute of its own). Hosts decide visibility (financing/leasing
28
+ * shown, Kaufen hidden).
29
+ */
30
+ const CreditCostNotice: React.FunctionComponent<CreditCostNoticeProps> = ({ t, tone = 'light', size = 'standard', cls }) => {
31
+ const className = ['ccn', `ccn--${tone}`, size === 'small' ? 'ccn--small' : '', cls || ''].filter(Boolean).join(' ');
32
+ return (
33
+ <div className={className}>
34
+ <span className="ccn-icon" aria-hidden="true">
35
+ <Icon name="info" size={16} stroke={2} />
36
+ </span>
37
+ <span className="ccn-text">
38
+ {t('autobahn:finance.creditCostWarning', { defaultValue: CREDIT_COST_WARNING_DE })}
39
+ </span>
40
+ </div>
41
+ );
42
+ };
43
+
44
+ export default CreditCostNotice;
@@ -3937,14 +3937,21 @@ export const ReviewsTeaser: React.FunctionComponent<ReviewsTeaserProps> = ({ cou
3937
3937
  };
3938
3938
 
3939
3939
  export interface CustomerRatingsProps {
3940
- /** the loaded reviews (REAL — from the WP json-quotes source). */
3940
+ /** the loaded reviews (REAL — Bewertung Welt via fe-landing's /angebot/customer-quotes). */
3941
3941
  reviews: VdpReview[];
3942
3942
  /**
3943
- * Overall auto.de Google rating to display instead of the average of the few
3944
- * loaded reviews (which skews to 5,0 — the review feed only carries 5-star
3945
- * quotes). The page passes the real aggregate (4,6 per Google, review round 9).
3943
+ * Overall auto.de rating to display instead of the average of the few loaded
3944
+ * reviews (which skews to 5,0 — only 4-5 star quotes are loaded). The page passes
3945
+ * the real site-wide aggregate.
3946
3946
  */
3947
3947
  average?: number;
3948
+ /**
3949
+ * Site-wide review count shown next to the average (Bewertung Welt `summary`). When set,
3950
+ * the header shows it instead of reviews.length and the expander reads "Weitere N …".
3951
+ */
3952
+ total?: number;
3953
+ /** portals the average/total come from, e.g. "Google & Trustpilot" (default "Google"). */
3954
+ sourceLabel?: string;
3948
3955
  /** i18n function (drilled from the page). */
3949
3956
  t: TranslationFunction;
3950
3957
  }
@@ -3957,10 +3964,11 @@ export interface CustomerRatingsProps {
3957
3964
  * the WordPress json-quotes feed); the page loads them and passes them in. When no
3958
3965
  * reviews load, the page renders nothing (no fabricated content).
3959
3966
  */
3960
- export const CustomerRatings: React.FunctionComponent<CustomerRatingsProps> = ({ reviews, average, t }) => {
3967
+ export const CustomerRatings: React.FunctionComponent<CustomerRatingsProps> = ({ reviews, average, total, sourceLabel, t }) => {
3961
3968
  const [showAll, setShowAll] = useState(false);
3962
3969
  if (!reviews || !reviews.length) return null;
3963
3970
  const count = reviews.length;
3971
+ const headerCount = total != null && total > 0 ? total : count;
3964
3972
  const avg = average != null ? average : reviews.reduce((s, r) => s + (r.rating || 0), 0) / count;
3965
3973
  const shown = showAll ? reviews : reviews.slice(0, 4);
3966
3974
  return (
@@ -3976,7 +3984,7 @@ export const CustomerRatings: React.FunctionComponent<CustomerRatingsProps> = ({
3976
3984
  <span>
3977
3985
  <Stars value={avg} size={16} />
3978
3986
  <span className="md-label-sm" style={{ display: 'block' }}>
3979
- {t('autobahn:reviews.ratingCount', { count })} · via Google
3987
+ {t('autobahn:reviews.ratingCount', { count: headerCount })} · via {sourceLabel || 'Google'}
3980
3988
  </span>
3981
3989
  </span>
3982
3990
  </div>
@@ -4029,7 +4037,12 @@ export const CustomerRatings: React.FunctionComponent<CustomerRatingsProps> = ({
4029
4037
  </div>
4030
4038
  {reviews.length > 4 && (
4031
4039
  <button className="mbtn mbtn--text" style={{ marginTop: 4 }} onClick={() => setShowAll((a) => !a)}>
4032
- {showAll ? t('autobahn:ratings.showLess') : t('autobahn:ratings.showMore', { count })}
4040
+ {showAll
4041
+ ? t('autobahn:ratings.showLess')
4042
+ // with a site-wide total in the header, "Alle N" would contradict it — only the loaded ones expand
4043
+ : headerCount !== count
4044
+ ? t('autobahn:ratings.showMoreLoaded', { count: count - 4 })
4045
+ : t('autobahn:ratings.showMore', { count })}
4033
4046
  <Icon name={showAll ? 'chevron-up' : 'chevron-down'} size={16} />
4034
4047
  </button>
4035
4048
  )}