@genesislcap/foundation-header 14.278.3 → 14.281.0

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.
@@ -3,8 +3,8 @@ import { I18next } from '@genesislcap/foundation-i18n';
3
3
  import { LoginRouting } from '@genesislcap/foundation-login';
4
4
  import { FoundationRouteNavItem } from '@genesislcap/foundation-ui';
5
5
  import { User } from '@genesislcap/foundation-user';
6
- import { Container } from '@genesislcap/web-core';
7
6
  import type { ViewTemplate } from '@genesislcap/web-core';
7
+ import { Container } from '@genesislcap/web-core';
8
8
  import { HeaderConfig } from '../config/config';
9
9
  /**
10
10
  * Events dispatched by the navigation control buttons
@@ -16,6 +16,10 @@ export type NavEventDetailMap = {
16
16
  'misc-icon-clicked': void;
17
17
  'notification-icon-clicked': void;
18
18
  'language-changed': void;
19
+ 'nav-button-clicked': {
20
+ item: FoundationRouteNavItem;
21
+ context: any;
22
+ };
19
23
  };
20
24
  /**
21
25
  * Options for the language selector
@@ -26,7 +30,7 @@ export type LanguageOptions = {
26
30
  selectedLanguage: string;
27
31
  };
28
32
  declare const Navigation_base: abstract new (...args: any[]) => {
29
- $emit<K extends "luminance-icon-clicked" | "logout-clicked" | "misc-icon-clicked" | "notification-icon-clicked" | "language-changed">(...args: NavEventDetailMap[K] extends void ? [type: K, options?: import("@genesislcap/foundation-events").EmitOptions] : [type: K, detail: NavEventDetailMap[K], options?: import("@genesislcap/foundation-events").EmitOptions]): import("@genesislcap/foundation-events").EmitReturn;
33
+ $emit<K extends "luminance-icon-clicked" | "logout-clicked" | "misc-icon-clicked" | "notification-icon-clicked" | "language-changed" | "nav-button-clicked">(...args: NavEventDetailMap[K] extends void ? [type: K, options?: import("@genesislcap/foundation-events").EmitOptions] : [type: K, detail: NavEventDetailMap[K], options?: import("@genesislcap/foundation-events").EmitOptions]): import("@genesislcap/foundation-events").EmitReturn;
30
34
  accessKey: string;
31
35
  readonly accessKeyLabel: string;
32
36
  autocapitalize: string;
@@ -73,17 +77,11 @@ declare const Navigation_base: abstract new (...args: any[]) => {
73
77
  readonly scrollWidth: number;
74
78
  readonly shadowRoot: ShadowRoot;
75
79
  slot: string;
76
- readonly tagName: string; /**
77
- * @internal
78
- * Flag to indicate if the component is ready
79
- */
80
+ readonly tagName: string;
80
81
  attachShadow(init: ShadowRootInit): ShadowRoot;
81
82
  closest<K_3 extends keyof HTMLElementTagNameMap>(selector: K_3): HTMLElementTagNameMap[K_3];
82
83
  closest<K_4 extends keyof SVGElementTagNameMap>(selector: K_4): SVGElementTagNameMap[K_4];
83
84
  closest<E extends Element = Element>(selectors: string): E;
84
- /**
85
- * Called when the component is connected to the DOM
86
- */
87
85
  getAttribute(qualifiedName: string): string;
88
86
  getAttributeNS(namespace: string, localName: string): string;
89
87
  getAttributeNames(): string[];
@@ -135,9 +133,7 @@ declare const Navigation_base: abstract new (...args: any[]) => {
135
133
  readonly nodeName: string;
136
134
  readonly nodeType: number;
137
135
  nodeValue: string;
138
- readonly parentElement: HTMLElement; /**
139
- * Object which defines the language options to be displayed in the language selector
140
- */
136
+ readonly parentElement: HTMLElement;
141
137
  readonly parentNode: ParentNode;
142
138
  readonly previousSibling: ChildNode;
143
139
  textContent: string;
@@ -198,7 +194,13 @@ declare const Navigation_base: abstract new (...args: any[]) => {
198
194
  ariaMultiSelectable: string;
199
195
  ariaOrientation: string;
200
196
  ariaPlaceholder: string;
201
- ariaPosInSet: string;
197
+ ariaPosInSet: string; /**
198
+ * Boolean attribute which controls whether to show the account menu on the navigation bar
199
+ * Control via `show-account-menu`
200
+ *
201
+ * @remarks
202
+ * If this attribute is not set then the account menu is not shown
203
+ */
202
204
  ariaPressed: string;
203
205
  ariaReadOnly: string;
204
206
  ariaRequired: string;
@@ -233,36 +235,9 @@ declare const Navigation_base: abstract new (...args: any[]) => {
233
235
  querySelector<K_7 extends keyof HTMLElementTagNameMap>(selectors: K_7): HTMLElementTagNameMap[K_7];
234
236
  querySelector<K_8 extends keyof SVGElementTagNameMap>(selectors: K_8): SVGElementTagNameMap[K_8];
235
237
  querySelector<E_1 extends Element = Element>(selectors: string): E_1;
236
- querySelectorAll<K_9 extends keyof HTMLElementTagNameMap>(selectors: K_9): NodeListOf<HTMLElementTagNameMap[K_9]>; /**
237
- * Emits the event corresponding to the luminance icon being clicked
238
- *
239
- * @remarks
240
- *
241
- * Activated when the user clicks on the moon icon on the navigation
242
- * bar right hand side
243
- *
244
- * @internal
245
- */
246
- querySelectorAll<K_10 extends keyof SVGElementTagNameMap>(selectors: K_10): NodeListOf<SVGElementTagNameMap[K_10]>; /**
247
- * Emits the event corresponding to the luminance icon being clicked
248
- *
249
- * @remarks
250
- *
251
- * Activated when the user clicks on the moon icon on the navigation
252
- * bar right hand side
253
- *
254
- * @internal
255
- */
256
- querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>; /**
257
- * Emits the event corresponding to the luminance icon being clicked
258
- *
259
- * @remarks
260
- *
261
- * Activated when the user clicks on the moon icon on the navigation
262
- * bar right hand side
263
- *
264
- * @internal
265
- */
238
+ querySelectorAll<K_9 extends keyof HTMLElementTagNameMap>(selectors: K_9): NodeListOf<HTMLElementTagNameMap[K_9]>;
239
+ querySelectorAll<K_10 extends keyof SVGElementTagNameMap>(selectors: K_10): NodeListOf<SVGElementTagNameMap[K_10]>;
240
+ querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
266
241
  replaceChildren(...nodes: (string | Node)[]): void;
267
242
  readonly assignedSlot: HTMLSlotElement;
268
243
  oncopy: (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any;
@@ -300,13 +275,6 @@ declare const Navigation_base: abstract new (...args: any[]) => {
300
275
  ondurationchange: (this: GlobalEventHandlers, ev: Event) => any;
301
276
  onemptied: (this: GlobalEventHandlers, ev: Event) => any;
302
277
  onended: (this: GlobalEventHandlers, ev: Event) => any;
303
- /**
304
- * ZeroHeader is a zero version of the header micro-frontend.
305
- *
306
- * @deprecated - Use RapidHeader instead.
307
- *
308
- * @internal
309
- */
310
278
  onerror: OnErrorEventHandlerNonNull;
311
279
  onfocus: (this: GlobalEventHandlers, ev: FocusEvent) => any;
312
280
  onformdata: (this: GlobalEventHandlers, ev: FormDataEvent) => any;
@@ -352,7 +320,15 @@ declare const Navigation_base: abstract new (...args: any[]) => {
352
320
  onselectstart: (this: GlobalEventHandlers, ev: Event) => any;
353
321
  onslotchange: (this: GlobalEventHandlers, ev: Event) => any;
354
322
  onstalled: (this: GlobalEventHandlers, ev: Event) => any;
355
- onsubmit: (this: GlobalEventHandlers, ev: SubmitEvent) => any;
323
+ onsubmit: (this: GlobalEventHandlers, ev: SubmitEvent) => any; /**
324
+ * Load remote components
325
+ *
326
+ * @remarks
327
+ *
328
+ * With regards to module federation
329
+ *
330
+ * @internal
331
+ */
356
332
  onsuspend: (this: GlobalEventHandlers, ev: Event) => any;
357
333
  ontimeupdate: (this: GlobalEventHandlers, ev: Event) => any;
358
334
  ontoggle: (this: GlobalEventHandlers, ev: Event) => any;
@@ -402,6 +378,8 @@ declare const Navigation_base: abstract new (...args: any[]) => {
402
378
  * @param show-connection-indicator - Boolean attribute which controls whether the navigation bar will display the connection indicator.
403
379
  * @param show-language-selector - Boolean attribute which controls whether the navigation bar will display the language selector.
404
380
  * @param hide-side-bar - Boolean attribute which controls whether the navigation bar will display the side bar.
381
+ * @param show-account-menu - Boolean attribute which controls whether the navigation bar will display the account menu.
382
+ * @param logout-button-position - String attribute which controls the position of the logout button in the header.
405
383
  *
406
384
  * @param userName - String which defines the username to be displayed in the navigation bar.
407
385
  * @param routeButtons - Array of objects which define the route buttons to be displayed in the navigation bar.
@@ -415,6 +393,7 @@ declare const Navigation_base: abstract new (...args: any[]) => {
415
393
  * @fires notification-icon-clicked - Dispatched when the user clicks on the notification icon in the navigation bar.
416
394
  * @fires language-changed - Dispatched when the user changes the language in the language selector.
417
395
  * @fires logout-clicked - Dispatched when the user clicks logout button.
396
+ * @fires nav-button-clicked - Dispatched when the user clicks a navigation button.
418
397
  *
419
398
  */
420
399
  export declare class Navigation extends Navigation_base {
@@ -518,6 +497,15 @@ export declare class Navigation extends Navigation_base {
518
497
  *
519
498
  */
520
499
  hideSideBar: boolean;
500
+ /**
501
+ * String attribute which controls the position of the logout button in the header
502
+ * Control via `logout-button-position`
503
+ *
504
+ * @remarks
505
+ *
506
+ * If this attribute is not set then the logout button is shown in the side nav
507
+ */
508
+ logoutButtonPosition: 'side-nav' | 'account-menu' | 'none';
521
509
  /**
522
510
  * If present the defined route buttons will be rendered in the header 'routes' slot
523
511
  *
@@ -538,6 +526,21 @@ export declare class Navigation extends Navigation_base {
538
526
  * If present the defined {@link @genesislcap/foundation-ui#FoundationRouteNavItem | FoundationRouteNavItems} will be rendered in the header 'routes' slot
539
527
  */
540
528
  routeNavItems: FoundationRouteNavItem[];
529
+ /**
530
+ * Boolean attribute which controls whether to show the account menu on the navigation bar
531
+ * Control via `show-account-menu`
532
+ *
533
+ * @remarks
534
+ * If this attribute is not set then the account menu is not shown
535
+ */
536
+ showAccountMenu: boolean;
537
+ /**
538
+ * Computed property that determines if the account menu should be shown
539
+ * @remarks
540
+ * It will be shown if the attribute is explicitly set to true
541
+ * or the logout button position is set to 'account-menu'
542
+ */
543
+ get shouldShowAccountMenu(): boolean;
541
544
  /**
542
545
  * Load remote components
543
546
  *
@@ -652,6 +655,11 @@ export declare class Navigation extends Navigation_base {
652
655
  * Is languageOptions needed.
653
656
  */
654
657
  toLocalisedText(text: string): string;
658
+ /**
659
+ * Handles the click event for a navigation button
660
+ * @param routeNavItem - The navigation item that was clicked
661
+ */
662
+ handleNavButtonClick(routeNavItem: FoundationRouteNavItem): void;
655
663
  }
656
664
  /**
657
665
  * FoundationHeader.
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BA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3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,iDAqMgD,CAAC"}
1
+ {"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,iDA2VgD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAY1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIzC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,UAAU,CAIpD,CAAC;AAyHF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,+BAkHvB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,yCAI/B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,UAAU,CAEpD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,+BAAc,CAAC"}
1
+ {"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAa1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIzC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,UAAU,CAIpD,CAAC;AA4KF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,+BA8GvB,CAAC;AAiDF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,yCAI/B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,UAAU,CAEpD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,+BAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rapid.template.d.ts","sourceRoot":"","sources":["../../../src/templates/rapid.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAc1C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,UAAU,CAIpD,CAAC;AAyHF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,+BAkHzB,CAAC"}
1
+ {"version":3,"file":"rapid.template.d.ts","sourceRoot":"","sources":["../../../src/templates/rapid.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAc1C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,UAAU,CAIpD,CAAC;AAuKF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,+BAkHzB,CAAC"}
@@ -6,13 +6,13 @@ import { I18next } from '@genesislcap/foundation-i18n';
6
6
  import { LoginConfig, LoginRouting } from '@genesislcap/foundation-login';
7
7
  import { FoundationRouteNav } from '@genesislcap/foundation-ui';
8
8
  import { User } from '@genesislcap/foundation-user';
9
- import { GenesisElement, customElement, observable, attr, Container } from '@genesislcap/web-core';
9
+ import { attr, Container, customElement, GenesisElement, observable } from '@genesislcap/web-core';
10
10
  import logo from '../assets/logo.svg';
11
11
  import { HeaderConfig } from '../config/config';
12
12
  import { rapidTemplate } from '../templates/rapid.template';
13
13
  import { logger } from '../utils';
14
14
  import { MainStyles as styles } from './main.styles';
15
- import { dynamicTemplate as template, LoadingTemplate, mainTemplate } from './main.template';
15
+ import { LoadingTemplate, mainTemplate, dynamicTemplate as template } from './main.template';
16
16
  /**
17
17
  * Navigation micro-frontend includes navigation bar and flyout menu
18
18
  *
@@ -33,6 +33,8 @@ import { dynamicTemplate as template, LoadingTemplate, mainTemplate } from './ma
33
33
  * @param show-connection-indicator - Boolean attribute which controls whether the navigation bar will display the connection indicator.
34
34
  * @param show-language-selector - Boolean attribute which controls whether the navigation bar will display the language selector.
35
35
  * @param hide-side-bar - Boolean attribute which controls whether the navigation bar will display the side bar.
36
+ * @param show-account-menu - Boolean attribute which controls whether the navigation bar will display the account menu.
37
+ * @param logout-button-position - String attribute which controls the position of the logout button in the header.
36
38
  *
37
39
  * @param userName - String which defines the username to be displayed in the navigation bar.
38
40
  * @param routeButtons - Array of objects which define the route buttons to be displayed in the navigation bar.
@@ -46,6 +48,7 @@ import { dynamicTemplate as template, LoadingTemplate, mainTemplate } from './ma
46
48
  * @fires notification-icon-clicked - Dispatched when the user clicks on the notification icon in the navigation bar.
47
49
  * @fires language-changed - Dispatched when the user changes the language in the language selector.
48
50
  * @fires logout-clicked - Dispatched when the user clicks logout button.
51
+ * @fires nav-button-clicked - Dispatched when the user clicks a navigation button.
49
52
  *
50
53
  */
51
54
  let Navigation = class Navigation extends EventEmitter(GenesisElement) {
@@ -102,6 +105,23 @@ let Navigation = class Navigation extends EventEmitter(GenesisElement) {
102
105
  availableLanguages: Object.keys((_a = this.i18next.config.resources) !== null && _a !== void 0 ? _a : {}),
103
106
  selectedLanguage: this.i18next.config.lng,
104
107
  };
108
+ /**
109
+ * String attribute which controls the position of the logout button in the header
110
+ * Control via `logout-button-position`
111
+ *
112
+ * @remarks
113
+ *
114
+ * If this attribute is not set then the logout button is shown in the side nav
115
+ */
116
+ this.logoutButtonPosition = 'side-nav';
117
+ /**
118
+ * Boolean attribute which controls whether to show the account menu on the navigation bar
119
+ * Control via `show-account-menu`
120
+ *
121
+ * @remarks
122
+ * If this attribute is not set then the account menu is not shown
123
+ */
124
+ this.showAccountMenu = false;
105
125
  }
106
126
  /**
107
127
  * Called when the component is connected to the DOM
@@ -143,6 +163,15 @@ let Navigation = class Navigation extends EventEmitter(GenesisElement) {
143
163
  }));
144
164
  }
145
165
  }
166
+ /**
167
+ * Computed property that determines if the account menu should be shown
168
+ * @remarks
169
+ * It will be shown if the attribute is explicitly set to true
170
+ * or the logout button position is set to 'account-menu'
171
+ */
172
+ get shouldShowAccountMenu() {
173
+ return this.showAccountMenu || this.logoutButtonPosition === 'account-menu';
174
+ }
146
175
  /**
147
176
  * Load remote components
148
177
  *
@@ -303,6 +332,19 @@ let Navigation = class Navigation extends EventEmitter(GenesisElement) {
303
332
  ? this.i18next.t(text, { lng: this.i18next.language })
304
333
  : text;
305
334
  }
335
+ /**
336
+ * Handles the click event for a navigation button
337
+ * @param routeNavItem - The navigation item that was clicked
338
+ */
339
+ handleNavButtonClick(routeNavItem) {
340
+ if (routeNavItem.onClick) {
341
+ routeNavItem.onClick({ item: routeNavItem, context: this });
342
+ }
343
+ else if (routeNavItem.routePath) {
344
+ this.navigateTo(routeNavItem.routePath);
345
+ }
346
+ this.$emit('nav-button-clicked', { item: routeNavItem, context: this });
347
+ }
306
348
  };
307
349
  __decorate([
308
350
  Container
@@ -358,12 +400,18 @@ __decorate([
358
400
  __decorate([
359
401
  attr({ mode: 'boolean', attribute: 'hide-side-bar' })
360
402
  ], Navigation.prototype, "hideSideBar", void 0);
403
+ __decorate([
404
+ attr({ attribute: 'logout-button-position' })
405
+ ], Navigation.prototype, "logoutButtonPosition", void 0);
361
406
  __decorate([
362
407
  observable
363
408
  ], Navigation.prototype, "routeButtons", void 0);
364
409
  __decorate([
365
410
  observable
366
411
  ], Navigation.prototype, "routeNavItems", void 0);
412
+ __decorate([
413
+ attr({ mode: 'boolean', attribute: 'show-account-menu' })
414
+ ], Navigation.prototype, "showAccountMenu", void 0);
367
415
  Navigation = __decorate([
368
416
  customElement({
369
417
  name: 'foundation-header',
@@ -1,6 +1,6 @@
1
1
  import { getApp } from '@genesislcap/foundation-shell/app';
2
2
  import { css } from '@genesislcap/web-core';
3
- import { optionTag, iconTag, flyoutTag } from '../tags';
3
+ import { flyoutTag, iconTag, optionTag } from '../tags';
4
4
  /**
5
5
  * Base styles for the foundation-header
6
6
  *
@@ -56,6 +56,8 @@ export const MainStyles = css `
56
56
  align-items: center;
57
57
  margin-left: calc(var(--design-unit) * 4px);
58
58
  gap: calc(var(--design-unit) * 2px);
59
+ line-height: 0;
60
+ font-size: 0;
59
61
  }
60
62
 
61
63
  .nav-leftside:focus-within {
@@ -205,4 +207,152 @@ export const MainStyles = css `
205
207
  display: flex;
206
208
  flex-direction: column;
207
209
  }
210
+
211
+ .account-menu {
212
+ opacity: 0%;
213
+ visibility: hidden;
214
+ margin: 0;
215
+ background-color: var(--neutral-layer-2);
216
+ border-color: var(--neutral-fill-hover);
217
+ border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-1);
218
+ transition:
219
+ opacity 0.1s ease,
220
+ visibility 0.1s ease,
221
+ transform 0.1s ease;
222
+ transform: translateY(calc(var(--design-unit) * -5px));
223
+ padding: 0;
224
+ position: absolute;
225
+ top: 100%;
226
+ right: 0;
227
+ z-index: 1;
228
+ min-width: 130px;
229
+ }
230
+
231
+ .account-menu-wrapper:hover .account-menu {
232
+ opacity: 100%;
233
+ visibility: visible;
234
+ transform: translateY(0);
235
+ }
236
+
237
+ .account-menu-wrapper {
238
+ position: relative;
239
+ padding: 0;
240
+ margin: 0;
241
+ line-height: 0;
242
+ font-size: 0;
243
+ }
244
+
245
+ .account-button {
246
+ position: relative;
247
+ z-index: 2;
248
+ }
249
+
250
+ .account-menu-button {
251
+ height: calc(((var(--base-height-multiplier) + var(--density)) * var(--design-unit) - 8) * 1px);
252
+ width: 100%;
253
+ background-color: var(--neutral-layer-2);
254
+ }
255
+
256
+ .account-menu-button:hover {
257
+ background-color: var(--neutral-fill-hover);
258
+ }
259
+
260
+ .nav-submenu-wrapper {
261
+ position: absolute;
262
+ top: 100%;
263
+ left: 0;
264
+ min-width: 175px;
265
+ background: var(--neutral-layer-2);
266
+ border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-1);
267
+ z-index: 1000;
268
+ opacity: 0%;
269
+ visibility: hidden;
270
+ transform: translateY(-10px);
271
+ transition:
272
+ opacity 0.2s ease-out,
273
+ visibility 0.2s ease-out,
274
+ transform 0.2s ease-out;
275
+ transition-delay: 0.1s;
276
+ }
277
+
278
+ .nav-button-wrapper {
279
+ position: relative;
280
+ display: inline-block;
281
+ }
282
+
283
+ .nav-submenu-wrapper .nav-button-wrapper {
284
+ width: 100%;
285
+ border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-3);
286
+ }
287
+
288
+ .side-nav-buttons-container .nav-submenu-wrapper {
289
+ position: absolute;
290
+ top: 0;
291
+ left: 100%;
292
+ margin-left: calc(var(--design-unit) * 1px);
293
+ min-width: 180px;
294
+ }
295
+
296
+ .nav-button-wrapper:hover .nav-submenu-wrapper {
297
+ opacity: 100%;
298
+ visibility: visible;
299
+ transform: translateY(0);
300
+ transition-delay: 0s;
301
+ }
302
+
303
+ .nav-submenu-wrapper .nav-button-wrapper .nav-submenu-wrapper {
304
+ top: 0;
305
+ left: 100%;
306
+ margin-left: calc(var(--design-unit) * 1px);
307
+ z-index: 1001;
308
+ }
309
+
310
+ .nav-submenu-wrapper .nav-button {
311
+ width: 100%;
312
+ text-align: left;
313
+ border: none;
314
+ background: transparent;
315
+ border-radius: 0;
316
+ margin: 0;
317
+ padding: calc(var(--design-unit) * 1px);
318
+ height: auto;
319
+ display: flex;
320
+ align-items: center;
321
+ justify-content: space-between;
322
+ overflow: hidden;
323
+ text-overflow: ellipsis;
324
+ white-space: nowrap;
325
+ z-index: 1002;
326
+ }
327
+
328
+ .nav-submenu-wrapper .nav-button:hover {
329
+ background-color: var(--neutral-fill-hover);
330
+ }
331
+
332
+ .nav-submenu-wrapper .nav-button::part(control) {
333
+ justify-content: left;
334
+ }
335
+
336
+ .nav-leftside .nav-button-wrapper .nav-button {
337
+ position: relative;
338
+ z-index: 1002;
339
+ }
340
+
341
+ .side-nav-buttons-container .nav-button-wrapper {
342
+ width: 100%;
343
+ }
344
+
345
+ .side-nav-buttons-container .nav-button-wrapper .nav-button {
346
+ width: 100%;
347
+ text-align: left;
348
+ justify-content: flex-start;
349
+ }
350
+
351
+ .side-nav-buttons-container .nav-button-wrapper .nav-button:has(+ .nav-submenu-wrapper) {
352
+ position: relative;
353
+ }
354
+
355
+ .nav-submenu-wrapper .nav-button-wrapper:last-child {
356
+ border-bottom: none;
357
+ }
208
358
  `.withBehaviors(getApp().registerStylesTarget('header'));