@bytebrand/fe-ui-core-autobahn 1.0.58 → 1.0.59
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/chrome/TopBar.tsx +60 -56
- package/package.json +1 -1
- package/theme/md3.css +42 -9
package/chrome/TopBar.tsx
CHANGED
|
@@ -466,8 +466,8 @@ const TopBar: React.FunctionComponent<TopBarProps> = ({
|
|
|
466
466
|
}}
|
|
467
467
|
>
|
|
468
468
|
<div
|
|
469
|
-
className="container"
|
|
470
|
-
style={{ height: 64, display: 'flex', alignItems: 'center', gap: 16
|
|
469
|
+
className="container topbar-container"
|
|
470
|
+
style={{ height: 64, display: 'flex', alignItems: 'center', gap: 16 }}
|
|
471
471
|
>
|
|
472
472
|
{/* mobile hamburger */}
|
|
473
473
|
<button
|
|
@@ -481,7 +481,7 @@ const TopBar: React.FunctionComponent<TopBarProps> = ({
|
|
|
481
481
|
|
|
482
482
|
{/* full navigation — '/' belongs to WordPress behind traefik, not the SPA (see HOME_PATH). */}
|
|
483
483
|
<a href={HOME_PATH} style={{ flex: 'none', display: 'inline-flex' }}>
|
|
484
|
-
<img src={logoUrl} height="32" style={{ cursor: 'pointer', display: 'block' }} alt="auto.de" />
|
|
484
|
+
<img src={logoUrl} height="32" className="topbar-logo" style={{ cursor: 'pointer', display: 'block' }} alt="auto.de" />
|
|
485
485
|
</a>
|
|
486
486
|
|
|
487
487
|
{renderNav('hide-mobile', {
|
|
@@ -493,64 +493,68 @@ const TopBar: React.FunctionComponent<TopBarProps> = ({
|
|
|
493
493
|
|
|
494
494
|
<div style={{ flex: 1 }} />
|
|
495
495
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
<
|
|
500
|
-
<IconButton name="
|
|
501
|
-
{
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
</span>
|
|
505
|
-
{/* Suchaufträge → /my-searches (saved searches list) — desktop-only; no Figma mobile
|
|
506
|
-
header variant includes a bell icon. */}
|
|
507
|
-
<span className="hide-mobile" style={{ position: 'relative', display: 'inline-flex' }}>
|
|
508
|
-
<IconButton name="bell" label={t('autobahn:chrome.savedSearches')} onClick={() => goRoute(R_SAVED_SEARCHES)} />
|
|
509
|
-
{notificationCount > 0 && (
|
|
510
|
-
<span style={badgeStyle}>{notificationCount}</span>
|
|
511
|
-
)}
|
|
512
|
-
</span>
|
|
513
|
-
|
|
514
|
-
{/* Mobile-only reduced icon set — which ONE extra icon (besides search+account, both
|
|
515
|
-
always shown) appears depends on `variant`, per the 3 Figma mobile header specs. */}
|
|
516
|
-
{variant === 'browsing' && (
|
|
517
|
-
<span className="show-mobile" style={{ position: 'relative', display: 'inline-flex' }}>
|
|
496
|
+
{/* Action icons cluster — its own (smaller) gap, separate from the outer 16px gap between
|
|
497
|
+
hamburger/logo/nav: the Header-System spec calls for ~2-6px between actions but keeps
|
|
498
|
+
the wider spacing everywhere else. */}
|
|
499
|
+
<div className="topbar-actions" style={{ display: 'flex', alignItems: 'center' }}>
|
|
500
|
+
<IconButton name="search" label={t('autobahn:chrome.search')} onClick={goSearch} />
|
|
501
|
+
{/* Merkliste → /favourites with a real count badge — desktop-only now; the mobile row
|
|
502
|
+
below shows it ONLY for the 'browsing' variant instead. */}
|
|
503
|
+
<span className="hide-mobile" style={{ position: 'relative', display: 'inline-flex' }}>
|
|
518
504
|
<IconButton name="heart" label={t('autobahn:chrome.favorites')} onClick={() => goRoute(R_FAVOURITES)} />
|
|
519
|
-
{favoritesCount > 0 &&
|
|
505
|
+
{favoritesCount > 0 && (
|
|
506
|
+
<span style={badgeStyle}>{favoritesCount}</span>
|
|
507
|
+
)}
|
|
520
508
|
</span>
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
<span className="
|
|
524
|
-
<IconButton name="
|
|
509
|
+
{/* Suchaufträge → /my-searches (saved searches list) — desktop-only; no Figma mobile
|
|
510
|
+
header variant includes a bell icon. */}
|
|
511
|
+
<span className="hide-mobile" style={{ position: 'relative', display: 'inline-flex' }}>
|
|
512
|
+
<IconButton name="bell" label={t('autobahn:chrome.savedSearches')} onClick={() => goRoute(R_SAVED_SEARCHES)} />
|
|
513
|
+
{notificationCount > 0 && (
|
|
514
|
+
<span style={badgeStyle}>{notificationCount}</span>
|
|
515
|
+
)}
|
|
525
516
|
</span>
|
|
526
|
-
)}
|
|
527
517
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
<
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
518
|
+
{/* Mobile-only reduced icon set — which ONE extra icon (besides search+account, both
|
|
519
|
+
always shown) appears depends on `variant`, per the 3 Figma mobile header specs. */}
|
|
520
|
+
{variant === 'browsing' && (
|
|
521
|
+
<span className="show-mobile" style={{ position: 'relative', display: 'inline-flex' }}>
|
|
522
|
+
<IconButton name="heart" label={t('autobahn:chrome.favorites')} onClick={() => goRoute(R_FAVOURITES)} />
|
|
523
|
+
{favoritesCount > 0 && <span style={badgeStyle}>{favoritesCount}</span>}
|
|
524
|
+
</span>
|
|
525
|
+
)}
|
|
526
|
+
{variant === 'conversion' && (
|
|
527
|
+
<span className="show-mobile" style={{ position: 'relative', display: 'inline-flex' }}>
|
|
528
|
+
<IconButton name="phone" label={t('autobahn:chrome.callUs')} onClick={() => goNav({ href: phoneHref })} />
|
|
529
|
+
</span>
|
|
530
|
+
)}
|
|
535
531
|
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
<
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
532
|
+
{/* language segmented control — hidden ≤600px (the account menu carries language rows). */}
|
|
533
|
+
{onLangSelect && (
|
|
534
|
+
<div className="lang-seg hide-mobile" aria-label={t('autobahn:chrome.switchLanguage')}>
|
|
535
|
+
<button type="button" className={'lang-seg-btn' + (language !== 'en' ? ' on' : '')} onClick={() => onLangSelect('de')}>DE</button>
|
|
536
|
+
<button type="button" className={'lang-seg-btn' + (language === 'en' ? ' on' : '')} onClick={() => onLangSelect('en')}>EN</button>
|
|
537
|
+
</div>
|
|
538
|
+
)}
|
|
539
|
+
|
|
540
|
+
{/* Konto trigger + account layer — visible at EVERY width: this menu is the only place
|
|
541
|
+
sign-out / settings / dealer switching exist, so it must never be display:none'd (the
|
|
542
|
+
pre-cutover hide-tablet left 601–980px with no logout at all). Desktop keeps the
|
|
543
|
+
tonal "Konto" pill; ≤600px it collapses to a plain icon (topbar-account-btn CSS) and
|
|
544
|
+
opens the full-width mobile Account Layer instead of the small popover. */}
|
|
545
|
+
<span style={{ position: 'relative', display: 'inline-flex' }}>
|
|
546
|
+
<button
|
|
547
|
+
className="mbtn mbtn--tonal mbtn--sm topbar-account-btn"
|
|
548
|
+
onClick={() => setAccount((a) => !a)}
|
|
549
|
+
aria-expanded={account}
|
|
550
|
+
aria-label={t('autobahn:chrome.account')}
|
|
551
|
+
>
|
|
552
|
+
<Icon name="user" size={18} />
|
|
553
|
+
<span className="hide-mobile">{t('autobahn:chrome.account')}</span>
|
|
554
|
+
</button>
|
|
555
|
+
{account && renderAccountMenu()}
|
|
556
|
+
</span>
|
|
557
|
+
</div>
|
|
554
558
|
</div>
|
|
555
559
|
|
|
556
560
|
{account && renderMobileAccountLayer()}
|
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.59",
|
|
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
|
@@ -5103,6 +5103,16 @@ line-height: 31px;
|
|
|
5103
5103
|
padding: 8px 16px 16px;
|
|
5104
5104
|
}
|
|
5105
5105
|
|
|
5106
|
+
/* Base (desktop) values for the two TopBar layout knobs the mobile Header-System spec overrides
|
|
5107
|
+
below — kept as real CSS rules (not inline styles) since an inline style on the element would
|
|
5108
|
+
always beat the media-query override regardless of specificity. */
|
|
5109
|
+
.md3 .topbar-container {
|
|
5110
|
+
padding: 0 16px;
|
|
5111
|
+
}
|
|
5112
|
+
.md3 .topbar-actions {
|
|
5113
|
+
gap: 16px;
|
|
5114
|
+
}
|
|
5115
|
+
|
|
5106
5116
|
/* mobile-only "Account Layer" sheet (TopBar) — full-width panel under the header, per the Figma
|
|
5107
5117
|
"03 | Account Layer" mockups. .show-mobile forces display:flex (see the ≤600px override
|
|
5108
5118
|
below) — flex-direction:column comes from the inline style on the element itself. */
|
|
@@ -5131,30 +5141,53 @@ line-height: 31px;
|
|
|
5131
5141
|
/* desktop "Konto" pill collapses to a plain icon-only button on mobile — the account layer above
|
|
5132
5142
|
replaces the small popover the pill normally opens on wider screens. */
|
|
5133
5143
|
@media (max-width: 600px) {
|
|
5144
|
+
/* "Header-System" spec dimensions (390px reference) — all scoped to the TopBar's own <header>
|
|
5145
|
+
(or a dedicated class) so none of this touches .icon-btn/.mbtn/.container usage elsewhere in
|
|
5146
|
+
the app (VDP gallery controls, financing modal, other pages' own containers, etc.). */
|
|
5134
5147
|
.md3 .topbar-account-btn {
|
|
5135
5148
|
background: transparent;
|
|
5136
5149
|
border: 0;
|
|
5137
5150
|
padding: 0;
|
|
5138
|
-
|
|
5139
|
-
|
|
5151
|
+
/* Touch target 48×48 — WCAG 2.2 minimum is 24×24, but the spec recommends 48×48 consistently
|
|
5152
|
+
for auto.de given the broad age range and high mobile share. */
|
|
5153
|
+
width: 48px;
|
|
5154
|
+
height: 48px;
|
|
5140
5155
|
min-width: 0;
|
|
5141
5156
|
border-radius: 50%;
|
|
5142
5157
|
}
|
|
5143
5158
|
.md3 .topbar-account-btn:hover {
|
|
5144
5159
|
background: color-mix(in srgb, var(--md-on-surface) 8%, transparent);
|
|
5145
5160
|
}
|
|
5146
|
-
/*
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5161
|
+
/* Visible icon glyphs 24-28px (spec range) — the shared .icon-btn/.mbtn rules force 20px/18px
|
|
5162
|
+
everywhere else in the app, which is fine there but read visibly smaller than the Figma
|
|
5163
|
+
mobile header reference. */
|
|
5164
|
+
.md3 header .icon-btn {
|
|
5165
|
+
width: 48px;
|
|
5166
|
+
height: 48px;
|
|
5167
|
+
}
|
|
5151
5168
|
.md3 header .icon-btn .lucide {
|
|
5152
5169
|
width: 24px;
|
|
5153
5170
|
height: 24px;
|
|
5154
5171
|
}
|
|
5155
5172
|
.md3 header .topbar-account-btn .lucide {
|
|
5156
|
-
width:
|
|
5157
|
-
height:
|
|
5173
|
+
width: 24px;
|
|
5174
|
+
height: 24px;
|
|
5175
|
+
}
|
|
5176
|
+
/* Horizontal margin 12px (spec: "Horizontaler Rand"). */
|
|
5177
|
+
.md3 .topbar-container {
|
|
5178
|
+
padding: 0 12px;
|
|
5179
|
+
}
|
|
5180
|
+
/* Logo 118-126px wide (spec range) — the SVG's own aspect ratio (120:34.909) means the desktop
|
|
5181
|
+
height=32 attribute renders ~110px wide, just under range; this bumps it into range on mobile
|
|
5182
|
+
specifically via a CSS width override (wins over the HTML height attribute). */
|
|
5183
|
+
.md3 .topbar-logo {
|
|
5184
|
+
width: 122px;
|
|
5185
|
+
height: auto;
|
|
5186
|
+
}
|
|
5187
|
+
/* Gap between action icons 2-6px (spec: "Abstand Aktionen") — separate from the wider gap the
|
|
5188
|
+
hamburger/logo/nav still use (that's the outer .container's own gap, untouched here). */
|
|
5189
|
+
.md3 .topbar-actions {
|
|
5190
|
+
gap: 4px;
|
|
5158
5191
|
}
|
|
5159
5192
|
}
|
|
5160
5193
|
/* language segmented DE|EN — active tab filled, inactive ghost */
|