@bytebrand/fe-ui-core-autobahn 1.0.170 → 1.0.172

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.
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
 
3
3
  export type AccountMenuIconName =
4
- | 'layout-grid' | 'car-front' | 'bookmark' | 'star' | 'scale' | 'user' | 'help-circle' | 'log-out';
4
+ | 'layout-grid' | 'car-front' | 'bookmark' | 'star' | 'scale' | 'user' | 'help-circle' | 'log-out'
5
+ | 'settings' | 'store';
6
+ type FilledIconName = 'settings' | 'store';
5
7
 
6
8
  /**
7
9
  * Row icons of the Konto menu (Figma "Konto / Kontomenü", 64243:14111): Lucide-style glyphs in a
@@ -9,7 +11,7 @@ export type AccountMenuIconName =
9
11
  * square-cornered, unlike lucide-react 0.288's — so the paths are Figma's export, not the lib Icon.
10
12
  * `at` moves each export to where Figma places it in the frame: the group inset minus half the stroke.
11
13
  */
12
- const GLYPHS: Record<AccountMenuIconName, { at: [number, number]; d: string[] }> = {
14
+ const GLYPHS: Record<Exclude<AccountMenuIconName, FilledIconName>, { at: [number, number]; d: string[] }> = {
13
15
  'layout-grid': {
14
16
  at: [1.85, 1.85],
15
17
  d: [
@@ -66,7 +68,23 @@ const GLYPHS: Record<AccountMenuIconName, { at: [number, number]; d: string[] }>
66
68
  },
67
69
  };
68
70
 
71
+ /** Filled Material glyphs supplied for the role rows (2026-10-28): "settings" (Bildeinstellungen)
72
+ * and "store" (the dealer rows). Unlike the stroked Figma glyphs they are filled 24-unit glyphs;
73
+ * viewBox 1 1 22 22 only trims their empty margin, so they keep their own size in the 22px frame.
74
+ * Their masks were full 24px rects (no-ops), so dropped. */
75
+ const FILLED: Record<FilledIconName, string> = {
76
+ settings: 'M13.5 21.5H10.475C10.2583 21.5 10.0667 21.425 9.9 21.275C9.73334 21.125 9.63334 20.9333 9.6 20.7L9.3 18.45C9.03334 18.3667 8.76267 18.2417 8.488 18.075C8.21267 17.9083 7.95834 17.7333 7.725 17.55L5.65 18.45C5.43334 18.5333 5.221 18.5417 5.013 18.475C4.80434 18.4083 4.63334 18.275 4.5 18.075L3 15.45C2.88334 15.25 2.85 15.0373 2.9 14.812C2.95 14.5873 3.05834 14.4083 3.225 14.275L5.05 12.9C5.01667 12.75 4.996 12.6 4.988 12.45C4.97934 12.3 4.975 12.15 4.975 12C4.975 11.8667 4.97934 11.725 4.988 11.575C4.996 11.425 5.01667 11.2667 5.05 11.1L3.225 9.725C3.05834 9.59167 2.95 9.41267 2.9 9.188C2.85 8.96267 2.88334 8.75 3 8.55L4.5 5.95C4.61667 5.75 4.78334 5.61667 5 5.55C5.21667 5.48333 5.425 5.49167 5.625 5.575L7.725 6.45C7.95834 6.26667 8.21267 6.096 8.488 5.938C8.76267 5.77933 9.03334 5.65 9.3 5.55L9.6 3.3C9.63334 3.06667 9.73334 2.875 9.9 2.725C10.0667 2.575 10.2583 2.5 10.475 2.5H13.5C13.7333 2.5 13.9333 2.575 14.1 2.725C14.2667 2.875 14.3667 3.06667 14.4 3.3L14.7 5.55C15 5.66667 15.2707 5.79567 15.512 5.937C15.754 6.079 16 6.25 16.25 6.45L18.375 5.575C18.575 5.49167 18.7793 5.48333 18.988 5.55C19.196 5.61667 19.3667 5.75 19.5 5.95L21 8.55C21.1167 8.75 21.15 8.96267 21.1 9.188C21.05 9.41267 20.9417 9.59167 20.775 9.725L18.925 11.125C18.9583 11.2917 18.975 11.4417 18.975 11.575V12C18.975 12.1333 18.9707 12.2707 18.962 12.412C18.954 12.554 18.9333 12.7167 18.9 12.9L20.725 14.275C20.9083 14.4083 21.025 14.5873 21.075 14.812C21.125 15.0373 21.0833 15.25 20.95 15.45L19.45 18.05C19.3333 18.25 19.1667 18.3833 18.95 18.45C18.7333 18.5167 18.5167 18.5083 18.3 18.425L16.25 17.55C16 17.75 15.746 17.925 15.488 18.075C15.2293 18.225 14.9667 18.35 14.7 18.45L14.4 20.7C14.3667 20.9333 14.2667 21.125 14.1 21.275C13.9333 21.425 13.7333 21.5 13.5 21.5ZM12 15C12.8333 15 13.5417 14.7083 14.125 14.125C14.7083 13.5417 15 12.8333 15 12C15 11.1667 14.7083 10.4583 14.125 9.875C13.5417 9.29167 12.8333 9 12 9C11.1667 9 10.4583 9.29167 9.875 9.875C9.29167 10.4583 9 11.1667 9 12C9 12.8333 9.29167 13.5417 9.875 14.125C10.4583 14.7083 11.1667 15 12 15ZM12 13.5C11.5833 13.5 11.2293 13.354 10.938 13.062C10.646 12.7707 10.5 12.4167 10.5 12C10.5 11.5833 10.646 11.2293 10.938 10.938C11.2293 10.646 11.5833 10.5 12 10.5C12.4167 10.5 12.7707 10.646 13.062 10.938C13.354 11.2293 13.5 11.5833 13.5 12C13.5 12.4167 13.354 12.7707 13.062 13.062C12.7707 13.354 12.4167 13.5 12 13.5ZM11 20H12.975L13.325 17.325C13.8417 17.1917 14.3083 17 14.725 16.75C15.1417 16.5 15.55 16.1833 15.95 15.8L18.425 16.85L19.425 15.15L17.25 13.525C17.3333 13.2583 17.3877 13 17.413 12.75C17.4377 12.5 17.45 12.25 17.45 12C17.45 11.7333 17.4377 11.4793 17.413 11.238C17.3877 10.996 17.3333 10.75 17.25 10.5L19.425 8.85L18.45 7.15L15.925 8.2C15.5917 7.85 15.1917 7.53733 14.725 7.262C14.2583 6.98733 13.7917 6.79167 13.325 6.675L13 4H11.025L10.675 6.675C10.175 6.79167 9.70834 6.975 9.275 7.225C8.84167 7.475 8.425 7.79167 8.025 8.175L5.55 7.15L4.575 8.85L6.725 10.45C6.64167 10.7 6.58334 10.95 6.55 11.2C6.51667 11.45 6.5 11.7167 6.5 12C6.5 12.2667 6.51667 12.525 6.55 12.775C6.58334 13.025 6.64167 13.275 6.725 13.525L4.575 15.15L5.55 16.85L8.025 15.8C8.40834 16.1833 8.81667 16.5 9.25 16.75C9.68334 17 10.1583 17.1917 10.675 17.325L11 20Z',
77
+ store: 'M5 6C4.71666 6 4.479 5.90433 4.287 5.713C4.09566 5.521 4 5.28333 4 5C4 4.71667 4.09566 4.479 4.287 4.287C4.479 4.09567 4.71666 4 5 4H19C19.2833 4 19.5207 4.09567 19.712 4.287C19.904 4.479 20 4.71667 20 5C20 5.28333 19.904 5.521 19.712 5.713C19.5207 5.90433 19.2833 6 19 6H5ZM5 20C4.71666 20 4.479 19.904 4.287 19.712C4.09566 19.5207 4 19.2833 4 19V14H3.825C3.50833 14 3.25 13.879 3.05 13.637C2.85 13.3957 2.78333 13.1167 2.85 12.8L3.85 7.8C3.9 7.56667 4.01666 7.375 4.2 7.225C4.38333 7.075 4.59166 7 4.825 7H19.175C19.4083 7 19.6167 7.075 19.8 7.225C19.9833 7.375 20.1 7.56667 20.15 7.8L21.15 12.8C21.2167 13.1167 21.15 13.3957 20.95 13.637C20.75 13.879 20.4917 14 20.175 14H20V19C20 19.2833 19.904 19.5207 19.712 19.712C19.5207 19.904 19.2833 20 19 20C18.7167 20 18.4793 19.904 18.288 19.712C18.096 19.5207 18 19.2833 18 19V14H14V19C14 19.2833 13.9043 19.5207 13.713 19.712C13.521 19.904 13.2833 20 13 20H5ZM6 18H12V14H6V18ZM5.05 12H18.95L18.35 9H5.65L5.05 12Z',
78
+ };
79
+
69
80
  const AccountMenuIcon: React.FunctionComponent<{ name: AccountMenuIconName }> = ({ name }) => {
81
+ if (name === 'settings' || name === 'store') {
82
+ return (
83
+ <svg className="acct-icon" width="22" height="22" viewBox="1 1 22 22" fill="currentColor" aria-hidden="true">
84
+ <path d={FILLED[name]} />
85
+ </svg>
86
+ );
87
+ }
70
88
  const { at, d } = GLYPHS[name];
71
89
  return (
72
90
  <svg
package/chrome/TopBar.tsx CHANGED
@@ -35,10 +35,12 @@ const R_FAVOURITES = '/favourites';
35
35
  const R_SAVED_SEARCHES = '/my-searches';
36
36
  const R_MY_VEHICLES = '/my-vehicles/overview';
37
37
  const R_SETTINGS = '/my-settings';
38
- /** DashboardPage branches internally on authStore.isDealer — the Konto menu links it for dealers/admins only. */
38
+ const R_MY_ORDERS = '/account/my-orders';
39
+ /** DashboardPage branches internally on authStore.isDealer — same route serves regular users too. */
39
40
  const R_DASHBOARD = '/account/dashboard';
40
41
  const R_IMAGE_SETTINGS = '/account/image-settings';
41
42
  const R_KONTAKT = '/account/kontakt';
43
+ const R_COMPARE = '/compare';
42
44
 
43
45
  /** lib Icon strokes are in lucide's 24-unit viewBox: drawn at 22px this is the Konto menu's 1.8px. */
44
46
  const ACCT_ICON_STROKE = (1.8 * 24) / 22;
@@ -92,18 +94,19 @@ export interface TopBarProps {
92
94
  favoritesCount?: number;
93
95
  /** unread Suchaufträge count — badge on the bell. Defaults to 0 (no badge). */
94
96
  notificationCount?: number;
95
- /** placed-orders count (profileStore.totalOrdered). Not shown: the Konto menu follows the role list
96
- * (no "Meine Bestellung" row); kept so hosts that pass it still compile. */
97
+ /** placed-orders count (profileStore.totalOrdered) — the "Meine Bestellung" row shows only above 0. */
97
98
  ordersCount?: number;
98
99
  /** saved searches (filterStore.savedSearchStrings.length) — badge on the "Gespeicherte Suchen" row. */
99
100
  savedSearchesCount?: number;
100
- /** cars picked for comparison (compareStore.vehiclesIDsToCompare.length). Not shown, same as ordersCount. */
101
+ /** cars picked for comparison (compareStore.vehiclesIDsToCompare.length) — badge on "Fahrzeuge vergleichen". */
101
102
  compareCount?: number;
102
103
  /** active language tag (appStore.language) — ticks the current language row. */
103
104
  language?: string;
104
- /** dealer-main account (authStore.isDealerMain) — Übersicht, Bildeinstellungen and the dealer switch. */
105
+ /** any dealer account (authStore.isDealer: main, admin, employee, accountant) — Meine Fahrzeuge. */
106
+ isDealer?: boolean;
107
+ /** dealer-main account (authStore.isDealerMain) — Bildeinstellungen and the dealer switch. */
105
108
  isDealerMain?: boolean;
106
- /** dealer admin (authStore.isDealerAdmin) — Übersicht and Bildeinstellungen, like isDealerMain. */
109
+ /** dealer admin (authStore.isDealerAdmin) — Bildeinstellungen, like isDealerMain. */
107
110
  isDealerAdmin?: boolean;
108
111
  /** dealer employee (authStore.isEmployee) — the "Meine Händler" switch, like isDealerMain. */
109
112
  isEmployee?: boolean;
@@ -149,8 +152,11 @@ const TopBar: React.FunctionComponent<TopBarProps> = ({
149
152
  userLabel,
150
153
  favoritesCount = 0,
151
154
  notificationCount = 0,
155
+ ordersCount = 0,
152
156
  savedSearchesCount = 0,
157
+ compareCount = 0,
153
158
  language = 'de',
159
+ isDealer = false,
154
160
  isDealerMain = false,
155
161
  isDealerAdmin = false,
156
162
  isEmployee = false,
@@ -221,18 +227,22 @@ const TopBar: React.FunctionComponent<TopBarProps> = ({
221
227
  );
222
228
 
223
229
  /** one Konto-menu row (Figma "acct-row"): 22px icon, label, count badge when above 0. `icon` is a
224
- * Figma glyph; `lucide` is a lib Icon for the rows Figma doesn't draw (guest, dealer). */
230
+ * menu glyph; `lucide` is a lib Icon for the guest rows Figma doesn't draw. `checked` (dealer rows)
231
+ * marks the active choice with the same check as the language rows. */
225
232
  const acctRow = (
226
233
  key: string,
227
234
  label: string,
228
235
  onClick: () => void,
229
- opts: { icon?: AccountMenuIconName; lucide?: string; badge?: number } = {},
236
+ opts: { icon?: AccountMenuIconName; lucide?: string; badge?: number; checked?: boolean } = {},
230
237
  ): JSX.Element => (
231
- <button key={key} type="button" className="acct-row" onClick={onClick}>
238
+ <button key={key} type="button" className="acct-row" onClick={onClick} aria-pressed={opts.checked}>
232
239
  {opts.icon && <AccountMenuIcon name={opts.icon} />}
233
240
  {opts.lucide && <Icon name={opts.lucide} size={22} stroke={ACCT_ICON_STROKE} cls="acct-icon" />}
234
241
  <span className="acct-label">{label}</span>
235
242
  {!!opts.badge && opts.badge > 0 && <span className="acct-badge">{opts.badge}</span>}
243
+ {opts.checked && (
244
+ <span className="acct-check"><Icon name="check" size={13} color="#fff" stroke={3} /></span>
245
+ )}
236
246
  </button>
237
247
  );
238
248
 
@@ -259,9 +269,9 @@ const TopBar: React.FunctionComponent<TopBarProps> = ({
259
269
  );
260
270
 
261
271
  /** Konto menu (Figma "Kontomenü (geöffnet)", 64243:14205 desktop / 64243:14299 mobile — the same
262
- * 312px dropdown at every width): the name, then groups split by lines. Rows and roles follow the
263
- * PM's role list (2026-10-28): Übersicht and Bildeinstellungen for dealers/admins only, the dealer
264
- * switch for employees, everything else for every user. Rows Figma doesn't draw use the same style. */
272
+ * 312px dropdown at every width): the name, then groups split by lines — Figma's rows for every
273
+ * user, Profil, then the role rows (Meine Fahrzeuge for every dealer account, the dealer switch
274
+ * for employees, Bildeinstellungen for dealers/admins). Rows Figma doesn't draw use the same style. */
265
275
  const isDealerOrAdmin = isDealerMain || isDealerAdmin;
266
276
  const showDealers = (isDealerMain || isEmployee) && dealers.length > 1;
267
277
  const renderAccountMenu = (): JSX.Element => (
@@ -273,15 +283,20 @@ const TopBar: React.FunctionComponent<TopBarProps> = ({
273
283
  <span className="acct-name">{userLabel || t('autobahn:chrome.myAccount')}</span>
274
284
  </div>
275
285
  <div className="acct-list">
276
- {isDealerOrAdmin &&
277
- acctRow('overview', t('autobahn:chrome.acct.overview'), () => goRoute(R_DASHBOARD), { icon: 'layout-grid' })}
278
- {acctRow('profile', t('autobahn:chrome.acct.profile'), () => goRoute(R_SETTINGS), { icon: 'user' })}
279
- {acctRow('myVehicles', t('autobahn:chrome.myVehicles'), () => goRoute(R_MY_VEHICLES), { icon: 'car-front' })}
286
+ {acctRow('overview', t('autobahn:chrome.acct.overview'), () => goRoute(R_DASHBOARD), { icon: 'layout-grid' })}
287
+ {ordersCount > 0 &&
288
+ acctRow('myOrder', t('autobahn:chrome.acct.myOrder'), () => goRoute(R_MY_ORDERS), { icon: 'car-front' })}
280
289
  {acctRow('savedSearches', t('autobahn:chrome.acct.savedSearches'), () => goRoute(R_SAVED_SEARCHES), { icon: 'bookmark', badge: savedSearchesCount })}
281
290
  {acctRow('favorites', t('autobahn:chrome.acct.favorites'), () => goRoute(R_FAVOURITES), { icon: 'star', badge: favoritesCount })}
291
+ {acctRow('compare', t('autobahn:chrome.acct.compare'), () => goRoute(R_COMPARE), { icon: 'scale', badge: compareCount })}
292
+ </div>
293
+ <div className="acct-list">
294
+ {acctRow('profile', t('autobahn:chrome.acct.profile'), () => goRoute(R_SETTINGS), { icon: 'user' })}
282
295
  </div>
283
- {(showDealers || isDealerOrAdmin) && (
296
+ {(isDealer || showDealers || isDealerOrAdmin) && (
284
297
  <div className="acct-list">
298
+ {isDealer &&
299
+ acctRow('myVehicles', t('autobahn:chrome.myVehicles'), () => goRoute(R_MY_VEHICLES), { lucide: 'car' })}
285
300
  {showDealers && (
286
301
  <>
287
302
  <div className="acct-sub">{t('autobahn:chrome.myDealers')} ({dealers.length})</div>
@@ -289,12 +304,12 @@ const TopBar: React.FunctionComponent<TopBarProps> = ({
289
304
  acctRow(`dealer-${d.dealer.id}`, d.dealer.email, () => {
290
305
  setAccount(false);
291
306
  if (!d.isActive && onDealerSelect) onDealerSelect(d.dealer.id);
292
- }, { lucide: d.isActive ? 'check' : 'store' }),
307
+ }, { icon: 'store', checked: d.isActive }),
293
308
  )}
294
309
  </>
295
310
  )}
296
311
  {isDealerOrAdmin &&
297
- acctRow('imageSettings', t('autobahn:chrome.imageSettings'), () => goRoute(R_IMAGE_SETTINGS), { lucide: 'image' })}
312
+ acctRow('imageSettings', t('autobahn:chrome.imageSettings'), () => goRoute(R_IMAGE_SETTINGS), { icon: 'settings' })}
298
313
  </div>
299
314
  )}
300
315
  <div className="acct-list">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core-autobahn",
3
- "version": "1.0.170",
3
+ "version": "1.0.172",
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",