@bytebrand/fe-ui-core-autobahn 1.0.2 → 1.0.3
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 +25 -25
- package/cards/types.ts +4 -2
- package/package.json +1 -1
- package/theme/md3.css +6 -6
package/cards/cardParts.tsx
CHANGED
|
@@ -495,35 +495,35 @@ export interface GalleryBadgesProps {
|
|
|
495
495
|
|
|
496
496
|
/**
|
|
497
497
|
* Trust/activity pill row rendered under the gallery on the SRP list card — mirrors the mobile
|
|
498
|
-
* VDP gallery header (availability · views · favorites · Geprüft).
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
*
|
|
498
|
+
* VDP gallery header (availability · views · favorites · Geprüft).
|
|
499
|
+
*
|
|
500
|
+
* PM decision (2026-07-10, Viktoriia — "this logic already exists on prod"): the row is all-or-
|
|
501
|
+
* nothing. A missing or zero view/favorite count is NOT shown as "0×" — the whole row (including
|
|
502
|
+
* the always-on availability/Geprüft pills) is hidden rather than reading as an empty/broken card.
|
|
503
|
+
* It only appears once BOTH counts are real and positive.
|
|
503
504
|
*/
|
|
504
|
-
export const GalleryBadges: React.FunctionComponent<GalleryBadgesProps> = ({ car, t }) =>
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
505
|
+
export const GalleryBadges: React.FunctionComponent<GalleryBadgesProps> = ({ car, t }) => {
|
|
506
|
+
if (!car.viewsCount || !car.favoritesCount) return null;
|
|
507
|
+
return (
|
|
508
|
+
<div className="gallery-badges">
|
|
509
|
+
{car.availability && (
|
|
510
|
+
<span className="gallery-pill">
|
|
511
|
+
<Icon name="circle-check" size={16} stroke={2} color="var(--md-good)" />
|
|
512
|
+
{car.availability}
|
|
513
|
+
</span>
|
|
514
|
+
)}
|
|
513
515
|
<span className="gallery-pill">
|
|
514
|
-
<Icon name="eye" size={
|
|
516
|
+
<Icon name="eye" size={16} stroke={1.9} />
|
|
515
517
|
{t('autobahn:card.activity.viewsCount', { count: car.viewsCount })}
|
|
516
518
|
</span>
|
|
517
|
-
)}
|
|
518
|
-
{car.favoritesCount != null && (
|
|
519
519
|
<span className="gallery-pill">
|
|
520
|
-
<Icon name="heart" size={
|
|
520
|
+
<Icon name="heart" size={16} stroke={1.9} />
|
|
521
521
|
{t('autobahn:card.activity.favoritesCount', { count: car.favoritesCount })}
|
|
522
522
|
</span>
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
</
|
|
528
|
-
|
|
529
|
-
|
|
523
|
+
<span className="gallery-pill">
|
|
524
|
+
<Icon name="shield-check" size={16} stroke={1.9} />
|
|
525
|
+
{t('autobahn:card.trust.checked')}
|
|
526
|
+
</span>
|
|
527
|
+
</div>
|
|
528
|
+
);
|
|
529
|
+
};
|
package/cards/types.ts
CHANGED
|
@@ -113,8 +113,10 @@ export interface AutobahnCar {
|
|
|
113
113
|
views?: number;
|
|
114
114
|
|
|
115
115
|
// --- gallery activity strip (real data: UserActionsAPI 'stats/viewers', loaded async and
|
|
116
|
-
// keyed by carId in SearchResultsStore.statsData — see fieldMapping.ts). Absent until
|
|
117
|
-
//
|
|
116
|
+
// keyed by carId in SearchResultsStore.statsData — see fieldMapping.ts). Absent until that
|
|
117
|
+
// fetch resolves. PM decision: the WHOLE badge row (availability/views/favorites/Geprüft)
|
|
118
|
+
// is all-or-nothing — it renders only when BOTH counts are present and > 0; a missing or
|
|
119
|
+
// zero count hides the entire row rather than showing a "0×" pill (GalleryBadges). ---
|
|
118
120
|
/** total detail-page views (stats totalCarImpCount) — shown as the eye pill under the image. */
|
|
119
121
|
viewsCount?: number;
|
|
120
122
|
/** total users who favorited this car (stats totalFavCount) — shown as the heart pill under the image. */
|
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.3",
|
|
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
|
@@ -1006,13 +1006,13 @@
|
|
|
1006
1006
|
/* wraps the carousel + its absolute overlays; flexes to fill whatever height the badge row below
|
|
1007
1007
|
doesn't need, so the row height stays governed by the grid (like before this row existed). */
|
|
1008
1008
|
.md3 .listcard-media-img { position: relative; flex: 1 1 auto; min-height: 0; }
|
|
1009
|
-
/* activity/trust pill row under the SRP card image (availability · views · favorites · Geprüft)
|
|
1010
|
-
|
|
1009
|
+
/* activity/trust pill row under the SRP card image (availability · views · favorites · Geprüft).
|
|
1010
|
+
Sizing/radius per Figma spec: 30px tall, 11px corner radius (NOT a full pill), 1px border. */
|
|
1011
|
+
.md3 .gallery-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px;
|
|
1011
1012
|
border-top: 1px solid var(--md-outline-variant); background: var(--md-sc-lowest); flex: none; }
|
|
1012
|
-
.md3 .gallery-pill { display: inline-flex; align-items: center; gap:
|
|
1013
|
-
border-radius:
|
|
1014
|
-
color: var(--md-on-surface); font-size:
|
|
1015
|
-
.md3 .gallery-pill--good { color: var(--md-good); border-color: var(--md-good); }
|
|
1013
|
+
.md3 .gallery-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
|
|
1014
|
+
border-radius: 11px; border: 1px solid var(--md-outline-variant); background: var(--md-sc-lowest);
|
|
1015
|
+
color: var(--md-on-surface); font-size: 13px; font-weight: 600; white-space: nowrap; }
|
|
1016
1016
|
.md3 .listcard-info { padding: 16px 18px; display: flex; flex-direction: column; gap: 11px; min-width: 0; }
|
|
1017
1017
|
.md3 .listcard-price { position: relative; padding: 16px 18px; border-left: 1px solid var(--md-outline-variant);
|
|
1018
1018
|
display: flex; flex-direction: column; justify-content: flex-start; gap: 16px; background: var(--md-sc-low); }
|