@vaadin/side-nav 24.8.4 → 25.0.0-alpha10

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/README.md CHANGED
@@ -41,29 +41,6 @@ Once installed, import the component in your application:
41
41
  import '@vaadin/side-nav';
42
42
  ```
43
43
 
44
- ## Themes
45
-
46
- Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
47
- The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/side-nav/vaadin-side-nav.js) of the package uses the Lumo theme.
48
-
49
- To use the Material theme, import the component from the `theme/material` folder:
50
-
51
- ```js
52
- import '@vaadin/side-nav/theme/material/vaadin-side-nav.js';
53
- ```
54
-
55
- You can also import the Lumo version of the component explicitly:
56
-
57
- ```js
58
- import '@vaadin/side-nav/theme/lumo/vaadin-side-nav.js';
59
- ```
60
-
61
- Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
62
-
63
- ```js
64
- import '@vaadin/side-nav/src/vaadin-side-nav.js';
65
- ```
66
-
67
44
  ## Contributing
68
45
 
69
46
  Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/side-nav",
3
- "version": "24.8.4",
3
+ "version": "25.0.0-alpha10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,6 +21,8 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
+ "!src/styles/*-base-styles.d.ts",
25
+ "!src/styles/*-base-styles.js",
24
26
  "theme",
25
27
  "vaadin-*.d.ts",
26
28
  "vaadin-*.js",
@@ -35,17 +37,16 @@
35
37
  ],
36
38
  "dependencies": {
37
39
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "~24.8.4",
39
- "@vaadin/component-base": "~24.8.4",
40
- "@vaadin/vaadin-lumo-styles": "~24.8.4",
41
- "@vaadin/vaadin-material-styles": "~24.8.4",
42
- "@vaadin/vaadin-themable-mixin": "~24.8.4",
40
+ "@vaadin/a11y-base": "25.0.0-alpha10",
41
+ "@vaadin/component-base": "25.0.0-alpha10",
42
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
43
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
43
44
  "lit": "^3.0.0"
44
45
  },
45
46
  "devDependencies": {
46
- "@vaadin/chai-plugins": "~24.8.4",
47
- "@vaadin/test-runner-commands": "~24.8.4",
48
- "@vaadin/testing-helpers": "^1.1.0",
47
+ "@vaadin/chai-plugins": "25.0.0-alpha10",
48
+ "@vaadin/test-runner-commands": "25.0.0-alpha10",
49
+ "@vaadin/testing-helpers": "^2.0.0",
49
50
  "lit": "^3.0.0",
50
51
  "sinon": "^18.0.0"
51
52
  },
@@ -53,5 +54,5 @@
53
54
  "web-types.json",
54
55
  "web-types.lit.json"
55
56
  ],
56
- "gitHead": "849e54e967563080a685965e2dced02060b3ab23"
57
+ "gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
57
58
  }
@@ -3,6 +3,8 @@
3
3
  * Copyright (c) 2023 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import './vaadin-side-nav-item.js';
7
- import './vaadin-side-nav-styles.js';
8
- import '../../src/vaadin-side-nav.js';
6
+ import type { CSSResult } from 'lit';
7
+
8
+ export const sideNavStyles: CSSResult;
9
+
10
+ export const sideNavSlotStyles: CSSResult;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2023 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import '@vaadin/component-base/src/style-props.js';
7
+ import { css } from 'lit';
8
+ import { sharedStyles } from './vaadin-side-nav-shared-base-styles.js';
9
+
10
+ const sideNav = css`
11
+ :host {
12
+ white-space: nowrap;
13
+ touch-action: manipulation;
14
+ }
15
+
16
+ [part='label'] {
17
+ align-self: start;
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: start;
21
+ gap: var(--vaadin-side-nav-item-gap, var(--vaadin-gap-container-inline));
22
+ padding: var(--vaadin-side-nav-item-padding, var(--vaadin-padding-container));
23
+ font-size: var(--vaadin-side-nav-label-font-size, 0.875em);
24
+ font-weight: var(--vaadin-side-nav-label-font-weight, 500);
25
+ color: var(--vaadin-side-nav-label-color, var(--vaadin-color-subtle));
26
+ line-height: var(--vaadin-side-nav-label-line-height, inherit);
27
+ border-radius: var(--vaadin-side-nav-item-border-radius, var(--vaadin-radius-m));
28
+ touch-action: manipulation;
29
+ }
30
+ `;
31
+
32
+ export const sideNavStyles = [sharedStyles, sideNav];
33
+
34
+ export const sideNavSlotStyles = css`
35
+ :where(vaadin-side-nav:has(vaadin-icon[slot='prefix'])) {
36
+ --_has-prefix-icon: '';
37
+ }
38
+
39
+ :where(vaadin-side-nav-item:has(> vaadin-icon[slot='prefix']))::part(link) {
40
+ --_has-prefix-icon:;
41
+ }
42
+ `;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2023 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import type { CSSResult } from 'lit';
7
+
8
+ export const sideNavStyles: CSSResult;
9
+
10
+ export const sideNavSlotStyles: CSSResult;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2023 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import { css } from 'lit';
7
+
8
+ export const sideNavStyles = css`
9
+ :host {
10
+ display: block;
11
+ }
12
+
13
+ :host([hidden]) {
14
+ display: none !important;
15
+ }
16
+
17
+ button {
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: inherit;
21
+ width: 100%;
22
+ margin: 0;
23
+ padding: 0;
24
+ background-color: initial;
25
+ color: inherit;
26
+ border: initial;
27
+ outline: none;
28
+ font: inherit;
29
+ text-align: inherit;
30
+ }
31
+
32
+ [part='children'] {
33
+ padding: 0;
34
+ margin: 0;
35
+ list-style-type: none;
36
+ }
37
+ `;
38
+
39
+ export const sideNavSlotStyles = css``;
@@ -3,5 +3,6 @@
3
3
  * Copyright (c) 2023 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import './vaadin-side-nav-item-styles.js';
7
- import '../../src/vaadin-side-nav-item.js';
6
+ import type { CSSResult } from 'lit';
7
+
8
+ export const sideNavItemStyles: CSSResult;
@@ -0,0 +1,122 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2023 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import '@vaadin/component-base/src/style-props.js';
7
+ import { css } from 'lit';
8
+ import { sharedStyles } from './vaadin-side-nav-shared-base-styles.js';
9
+
10
+ const sideNavItem = css`
11
+ [part='content'] {
12
+ display: flex;
13
+ align-items: center;
14
+ padding: var(--vaadin-side-nav-item-padding, var(--vaadin-padding-container));
15
+ gap: var(--vaadin-side-nav-item-gap, var(--vaadin-gap-container-inline));
16
+ font-size: var(--vaadin-side-nav-item-font-size, 1em);
17
+ font-weight: var(--vaadin-side-nav-item-font-weight, 500);
18
+ line-height: var(--vaadin-side-nav-item-line-height, inherit);
19
+ color: var(--vaadin-side-nav-item-color, var(--vaadin-color-subtle));
20
+ background: var(--vaadin-side-nav-item-background, transparent);
21
+ background-origin: border-box;
22
+ border: var(--vaadin-side-nav-item-border-width, 0) solid var(--vaadin-side-nav-item-border-color, transparent);
23
+ border-radius: var(--vaadin-side-nav-item-border-radius, var(--vaadin-radius-m));
24
+ cursor: var(--vaadin-clickable-cursor);
25
+ touch-action: manipulation;
26
+ }
27
+
28
+ :host([current]) [part='content'] {
29
+ --vaadin-side-nav-item-background: var(--vaadin-background-container);
30
+ --vaadin-side-nav-item-color: var(--vaadin-color);
31
+ }
32
+
33
+ :host([disabled]) {
34
+ --vaadin-clickable-cursor: var(--vaadin-disabled-cursor);
35
+ }
36
+
37
+ :host([disabled]) [part='content'] {
38
+ --vaadin-side-nav-item-color: var(--vaadin-color-disabled);
39
+ }
40
+
41
+ [part='link'] {
42
+ flex: auto;
43
+ min-width: 0;
44
+ display: flex;
45
+ align-items: center;
46
+ gap: inherit;
47
+ text-decoration: none;
48
+ color: inherit;
49
+ outline: 0;
50
+ }
51
+
52
+ :host(:not([has-children])) [part='toggle-button'] {
53
+ display: none !important;
54
+ }
55
+
56
+ slot:not([name]) {
57
+ display: block;
58
+ flex: auto;
59
+ min-width: 0;
60
+ overflow: hidden;
61
+ text-overflow: ellipsis;
62
+ /* Don't clip ascenders or descenders */
63
+ padding-block: 0.25em;
64
+ margin-block: -0.25em;
65
+ }
66
+
67
+ slot:is([name='prefix'], [name='suffix'])::slotted(*) {
68
+ flex: none;
69
+ }
70
+
71
+ /* Reserved space for icon */
72
+ slot[name='prefix']::before {
73
+ content: var(--_has-prefix-icon);
74
+ display: block;
75
+ width: var(--vaadin-icon-size, 1lh);
76
+ flex: none;
77
+ }
78
+
79
+ [part='content']:not(:has([href])):has([part='toggle-button']:focus-visible),
80
+ [part='content']:has(:not([part='toggle-button']):focus-visible),
81
+ [part='content']:has([href]) [part='toggle-button']:focus-visible {
82
+ outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
83
+ }
84
+
85
+ [part='content']:not(:has([href])) [part='toggle-button']:focus-visible {
86
+ outline: 0;
87
+ }
88
+
89
+ /* Hierarchy indentation */
90
+ [part='content']::before {
91
+ content: '';
92
+ --_hierarchy-indent: calc(var(--_level, 0) * var(--vaadin-side-nav-child-indent, var(--vaadin-icon-size, 1lh)));
93
+ --_icon-indent: calc(var(--_level, 0) * var(--vaadin-side-nav-item-gap, var(--vaadin-gap-container-inline)));
94
+ width: calc(var(--_hierarchy-indent) + var(--_icon-indent));
95
+ flex: none;
96
+ margin-inline-start: calc(var(--vaadin-side-nav-item-gap, var(--vaadin-gap-container-inline)) * -1);
97
+ }
98
+
99
+ slot[name='children'] {
100
+ --_level: calc(var(--_level-2, 0) + 1);
101
+ }
102
+
103
+ slot[name='children']::slotted(*) {
104
+ --_level-2: var(--_level);
105
+ }
106
+
107
+ @media (forced-colors: active) {
108
+ :host([current]) [part='content'] {
109
+ color: Highlight;
110
+ }
111
+
112
+ :host([disabled]) [part='content'] {
113
+ --vaadin-side-nav-item-color: GrayText;
114
+ }
115
+
116
+ :host([disabled]) [part='toggle-button']::before {
117
+ background: GrayText;
118
+ }
119
+ }
120
+ `;
121
+
122
+ export const sideNavItemStyles = [sharedStyles, sideNavItem];
@@ -3,5 +3,6 @@
3
3
  * Copyright (c) 2023 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import './vaadin-side-nav-item-styles.js';
7
- import '../../src/vaadin-side-nav-item.js';
6
+ import type { CSSResult } from 'lit';
7
+
8
+ export const sideNavItemStyles: CSSResult;
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { css } from 'lit';
7
7
 
8
- export const sideNavItemBaseStyles = css`
8
+ export const sideNavItemStyles = css`
9
9
  :host {
10
10
  display: block;
11
11
  }
@@ -35,7 +35,6 @@ export const sideNavItemBaseStyles = css`
35
35
  }
36
36
 
37
37
  button {
38
- -webkit-appearance: none;
39
38
  appearance: none;
40
39
  flex: none;
41
40
  position: relative;
@@ -69,34 +68,3 @@ export const sideNavItemBaseStyles = css`
69
68
  white-space: nowrap;
70
69
  }
71
70
  `;
72
-
73
- export const sideNavBaseStyles = css`
74
- :host {
75
- display: block;
76
- }
77
-
78
- :host([hidden]) {
79
- display: none !important;
80
- }
81
-
82
- button {
83
- display: flex;
84
- align-items: center;
85
- justify-content: inherit;
86
- width: 100%;
87
- margin: 0;
88
- padding: 0;
89
- background-color: initial;
90
- color: inherit;
91
- border: initial;
92
- outline: none;
93
- font: inherit;
94
- text-align: inherit;
95
- }
96
-
97
- [part='children'] {
98
- padding: 0;
99
- margin: 0;
100
- list-style-type: none;
101
- }
102
- `;
@@ -3,6 +3,6 @@
3
3
  * Copyright (c) 2023 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import './vaadin-side-nav-item.js';
7
- import './vaadin-side-nav-styles.js';
8
- import '../../src/vaadin-side-nav.js';
6
+ import type { CSSResult } from 'lit';
7
+
8
+ export const sharedStyles: CSSResult;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2023 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import '@vaadin/component-base/src/style-props.js';
7
+ import { css } from 'lit';
8
+
9
+ export const sharedStyles = css`
10
+ :host {
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: var(--vaadin-side-nav-items-gap, var(--vaadin-gap-container-block));
14
+ cursor: default;
15
+ -webkit-tap-highlight-color: transparent;
16
+ }
17
+
18
+ :host([hidden]),
19
+ [hidden] {
20
+ display: none !important;
21
+ }
22
+
23
+ button {
24
+ appearance: none;
25
+ margin: 0;
26
+ padding: 0;
27
+ border: 0;
28
+ background: transparent;
29
+ color: inherit;
30
+ font: inherit;
31
+ text-align: inherit;
32
+ cursor: var(--vaadin-clickable-cursor);
33
+ flex: none;
34
+ }
35
+
36
+ [part='toggle-button'] {
37
+ border-radius: var(--vaadin-side-nav-item-border-radius, var(--vaadin-radius-s));
38
+ color: var(--vaadin-color-subtle);
39
+ }
40
+
41
+ [part='toggle-button']::before {
42
+ content: '';
43
+ display: block;
44
+ background: currentColor;
45
+ mask-image: var(--_vaadin-icon-chevron-down);
46
+ width: var(--vaadin-icon-size, 1lh);
47
+ height: var(--vaadin-icon-size, 1lh);
48
+ rotate: -90deg;
49
+ }
50
+
51
+ :host([dir='rtl']) [part='toggle-button']::before {
52
+ scale: -1;
53
+ }
54
+
55
+ :host(:is(vaadin-side-nav-item[expanded], vaadin-side-nav:not([collapsed]))) [part='toggle-button'] {
56
+ rotate: 90deg;
57
+ }
58
+
59
+ :host([dir='rtl']:is(vaadin-side-nav-item[expanded], vaadin-side-nav:not([collapsed]))) [part='toggle-button'] {
60
+ rotate: -90deg;
61
+ }
62
+
63
+ @media (prefers-reduced-motion: no-preference) {
64
+ [part='toggle-button'] {
65
+ transition: rotate 150ms;
66
+ }
67
+ }
68
+
69
+ :host([disabled]) [part='toggle-button'] {
70
+ opacity: 0.5;
71
+ }
72
+
73
+ [part='children'] {
74
+ padding: 0;
75
+ margin: 0;
76
+ list-style-type: none;
77
+ display: flex;
78
+ flex-direction: column;
79
+ gap: var(--vaadin-side-nav-items-gap, var(--vaadin-gap-container-block));
80
+ }
81
+
82
+ :focus-visible {
83
+ outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
84
+ }
85
+
86
+ @media (forced-colors: active) {
87
+ [part='toggle-button']::before {
88
+ background: CanvasText;
89
+ }
90
+ }
91
+ `;
@@ -10,9 +10,10 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
10
10
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
11
11
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
12
12
  import { matchPaths } from '@vaadin/component-base/src/url-utils.js';
13
+ import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
13
14
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
15
  import { location } from './location.js';
15
- import { sideNavItemBaseStyles } from './vaadin-side-nav-base-styles.js';
16
+ import { sideNavItemStyles } from './styles/vaadin-side-nav-item-core-styles.js';
16
17
  import { SideNavChildrenMixin } from './vaadin-side-nav-children-mixin.js';
17
18
 
18
19
  /**
@@ -80,7 +81,9 @@ import { SideNavChildrenMixin } from './vaadin-side-nav-children-mixin.js';
80
81
  * @mixes ElementMixin
81
82
  * @mixes SideNavChildrenMixin
82
83
  */
83
- class SideNavItem extends SideNavChildrenMixin(DisabledMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement))))) {
84
+ class SideNavItem extends SideNavChildrenMixin(
85
+ DisabledMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))),
86
+ ) {
84
87
  static get is() {
85
88
  return 'vaadin-side-nav-item';
86
89
  }
@@ -175,7 +178,7 @@ class SideNavItem extends SideNavChildrenMixin(DisabledMixin(ElementMixin(Themab
175
178
  }
176
179
 
177
180
  static get styles() {
178
- return [sideNavItemBaseStyles];
181
+ return sideNavItemStyles;
179
182
  }
180
183
 
181
184
  constructor() {
@@ -283,9 +286,13 @@ class SideNavItem extends SideNavChildrenMixin(DisabledMixin(ElementMixin(Themab
283
286
  }
284
287
 
285
288
  /** @private */
286
- _onContentClick() {
289
+ _onContentClick(e) {
290
+ // Navigate if path is defined and not clicking on the link directly
291
+ if (this.path && !e.composedPath().find((el) => el === this.$.link)) {
292
+ this.$.link.click();
293
+ }
287
294
  // Toggle item expanded state unless the link has a non-empty path
288
- if (this.path == null && this.hasAttribute('has-children')) {
295
+ else if (this.path == null && this.hasAttribute('has-children') && !this.disabled) {
289
296
  this.__toggleExpanded();
290
297
  }
291
298
  }
@@ -3,14 +3,17 @@
3
3
  * Copyright (c) 2023 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import './vaadin-side-nav-item.js';
6
7
  import { html, LitElement } from 'lit';
7
8
  import { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
8
9
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
10
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
10
11
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
12
+ import { SlotStylesMixin } from '@vaadin/component-base/src/slot-styles-mixin.js';
11
13
  import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
14
+ import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
12
15
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
- import { sideNavBaseStyles } from './vaadin-side-nav-base-styles.js';
16
+ import { sideNavSlotStyles, sideNavStyles } from './styles/vaadin-side-nav-core-styles.js';
14
17
  import { SideNavChildrenMixin } from './vaadin-side-nav-children-mixin.js';
15
18
 
16
19
  /**
@@ -70,7 +73,9 @@ import { SideNavChildrenMixin } from './vaadin-side-nav-children-mixin.js';
70
73
  * @mixes ElementMixin
71
74
  * @mixes SideNavChildrenMixin
72
75
  */
73
- class SideNav extends SideNavChildrenMixin(FocusMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement))))) {
76
+ class SideNav extends SideNavChildrenMixin(
77
+ SlotStylesMixin(FocusMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))))),
78
+ ) {
74
79
  static get is() {
75
80
  return 'vaadin-side-nav';
76
81
  }
@@ -149,7 +154,12 @@ class SideNav extends SideNavChildrenMixin(FocusMixin(ElementMixin(ThemableMixin
149
154
  }
150
155
 
151
156
  static get styles() {
152
- return sideNavBaseStyles;
157
+ return sideNavStyles;
158
+ }
159
+
160
+ /** @protected */
161
+ get slotStyles() {
162
+ return [sideNavSlotStyles];
153
163
  }
154
164
 
155
165
  constructor() {
@@ -72,17 +72,15 @@ export const sideNavItemStyles = css`
72
72
  transform: none;
73
73
  }
74
74
 
75
- @supports selector(:focus-visible) {
76
- [part='link'],
77
- [part='toggle-button'] {
78
- outline: none;
79
- }
75
+ [part='link'],
76
+ [part='toggle-button'] {
77
+ outline: none;
78
+ }
80
79
 
81
- [part='link']:focus-visible,
82
- [part='toggle-button']:focus-visible {
83
- border-radius: var(--lumo-border-radius-m);
84
- box-shadow: 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
85
- }
80
+ [part='link']:focus-visible,
81
+ [part='toggle-button']:focus-visible {
82
+ border-radius: var(--lumo-border-radius-m);
83
+ box-shadow: 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
86
84
  }
87
85
 
88
86
  [part='link']:active {
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/side-nav",
4
- "version": "24.8.4",
4
+ "version": "25.0.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/side-nav",
4
- "version": "24.8.4",
4
+ "version": "25.0.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -1,4 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import '@vaadin/vaadin-material-styles/font-icons.js';
3
- import '@vaadin/vaadin-material-styles/typography.js';
4
- export declare const sideNavItemStyles: import("lit").CSSResult;
@@ -1,149 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import '@vaadin/vaadin-material-styles/font-icons.js';
3
- import '@vaadin/vaadin-material-styles/typography.js';
4
- import { fieldButton } from '@vaadin/vaadin-material-styles/mixins/field-button.js';
5
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
6
-
7
- export const sideNavItemStyles = css`
8
- [part='content'] {
9
- position: relative;
10
- }
11
-
12
- [part='link'] {
13
- width: 100%;
14
- min-height: 32px;
15
- margin: 4px 0;
16
- gap: 8px;
17
- padding: 4px 8px;
18
- padding-inline-start: calc(8px + var(--_child-indent, 0px));
19
- font-family: var(--material-font-family);
20
- font-size: var(--material-small-font-size);
21
- line-height: 1;
22
- font-weight: 500;
23
- color: var(--material-body-text-color);
24
- transition:
25
- background-color 140ms,
26
- color 140ms;
27
- border-radius: 4px;
28
- cursor: default;
29
- }
30
-
31
- [part='link'][href] {
32
- cursor: pointer;
33
- }
34
-
35
- :host([current]) [part='link'] {
36
- color: var(--material-primary-text-color);
37
- }
38
-
39
- :host([disabled]) [part='link'] {
40
- color: var(--material-disabled-text-color);
41
- }
42
-
43
- :host([current]) [part='content']::before {
44
- position: absolute;
45
- content: '';
46
- inset: 4px 0;
47
- background-color: var(--material-primary-color);
48
- opacity: 0.12;
49
- border-radius: 4px;
50
- }
51
-
52
- [part='toggle-button'] {
53
- width: 32px;
54
- height: 32px;
55
- margin-inline-end: -4px;
56
- transform: rotate(90deg);
57
- }
58
-
59
- [part='toggle-button']::before {
60
- font-family: 'material-icons';
61
- font-size: 24px;
62
- width: 24px;
63
- display: inline-block;
64
- content: var(--material-icons-chevron-right);
65
- }
66
-
67
- [part='toggle-button']::after {
68
- display: inline-block;
69
- content: '';
70
- position: absolute;
71
- top: 0;
72
- left: 0;
73
- width: 100%;
74
- height: 100%;
75
- border-radius: 50%;
76
- background-color: var(--material-disabled-text-color);
77
- transform: scale(0);
78
- opacity: 0;
79
- transition:
80
- transform 0s 0.8s,
81
- opacity 0.8s;
82
- will-change: transform, opacity;
83
- }
84
-
85
- [part='toggle-button']:focus-visible::after {
86
- transition-duration: 0.08s, 0.01s;
87
- transition-delay: 0s, 0s;
88
- transform: scale(1.25);
89
- opacity: 0.16;
90
- }
91
-
92
- :host([expanded]) [part='toggle-button'] {
93
- transform: rotate(270deg);
94
- }
95
-
96
- :host([has-children]) [part='content'] {
97
- padding-inline-end: 8px;
98
- }
99
-
100
- @media (any-hover: hover) {
101
- :host(:not([current])) [part='link'][href]:hover {
102
- background-color: var(--material-secondary-background-color);
103
- }
104
-
105
- [part='toggle-button']:hover {
106
- color: var(--material-body-text-color);
107
- }
108
- }
109
-
110
- @supports selector(:focus-visible) {
111
- [part='link'],
112
- [part='toggle-button'] {
113
- outline: none;
114
- }
115
-
116
- :host(:not([current])) [part='link']:focus-visible {
117
- background-color: var(--material-divider-color);
118
- }
119
-
120
- :host([current]) [part='link']:focus-visible::before {
121
- opacity: 0.24;
122
- }
123
- }
124
-
125
- slot[name='prefix']::slotted(:is(vaadin-icon, [class*='icon'])) {
126
- padding: 0.1em;
127
- flex-shrink: 0;
128
- margin-inline-end: 24px;
129
- color: var(--material-secondary-text-color);
130
- }
131
-
132
- :host([disabled]) slot[name='prefix']::slotted(:is(vaadin-icon, [class*='icon'])) {
133
- color: var(--material-disabled-text-color);
134
- }
135
-
136
- :host([current]) slot[name='prefix']::slotted(:is(vaadin-icon, [class*='icon'])) {
137
- color: inherit;
138
- }
139
-
140
- slot[name='children'] {
141
- --_child-indent: calc(var(--_child-indent-2, 0px) + var(--vaadin-side-nav-child-indent, 24px));
142
- }
143
-
144
- slot[name='children']::slotted(*) {
145
- --_child-indent-2: var(--_child-indent);
146
- }
147
- `;
148
-
149
- registerStyles('vaadin-side-nav-item', [fieldButton, sideNavItemStyles], { moduleId: 'material-side-nav-item' });
@@ -1,4 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import '@vaadin/vaadin-material-styles/font-icons.js';
3
- import '@vaadin/vaadin-material-styles/typography.js';
4
- export declare const sideNavStyles: import("lit").CSSResult;
@@ -1,68 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import '@vaadin/vaadin-material-styles/font-icons.js';
3
- import '@vaadin/vaadin-material-styles/typography.js';
4
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
5
-
6
- export const sideNavStyles = css`
7
- :host {
8
- -webkit-tap-highlight-color: transparent;
9
- outline: none;
10
- }
11
-
12
- [part='label'] {
13
- display: flex;
14
- align-items: center;
15
- width: 100%;
16
- min-height: 40px;
17
- margin: 4px 0;
18
- padding: 4px 8px;
19
- outline: none;
20
- box-sizing: border-box;
21
- font-family: var(--material-font-family);
22
- font-size: var(--material-small-font-size);
23
- color: var(--material-secondary-text-color);
24
- line-height: 1;
25
- font-weight: 500;
26
- border-radius: 4px;
27
- }
28
-
29
- :host([focus-ring]) [part='label'] {
30
- background-color: var(--material-divider-color);
31
- }
32
-
33
- [part='toggle-button'] {
34
- display: inline-flex;
35
- align-items: center;
36
- justify-content: center;
37
- width: 24px;
38
- height: 24px;
39
- padding: 4px;
40
- margin-inline: auto -4px;
41
- font-size: var(--material-icon-font-size);
42
- line-height: 1;
43
- color: var(--material-secondary-text-color);
44
- font-family: 'material-icons';
45
- transform: rotate(90deg);
46
- }
47
-
48
- [part='toggle-button']::before {
49
- content: var(--material-icons-chevron-right);
50
- font-size: 24px;
51
- }
52
-
53
- :host(:not([collapsible])) [part='toggle-button'] {
54
- display: none !important;
55
- }
56
-
57
- :host(:not([collapsed])) [part='toggle-button'] {
58
- transform: rotate(270deg);
59
- }
60
-
61
- @media (any-hover: hover) {
62
- [part='label']:hover [part='toggle-button'] {
63
- color: var(--material-body-text-color);
64
- }
65
- }
66
- `;
67
-
68
- registerStyles('vaadin-side-nav', sideNavStyles, { moduleId: 'material-side-nav' });