@vaadin/tabs 25.0.0-alpha4 → 25.0.0-alpha6
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/package.json +11 -9
- package/src/styles/vaadin-tab-base-styles.js +93 -0
- package/src/styles/vaadin-tab-core-styles.d.ts +8 -0
- package/src/styles/vaadin-tabs-base-styles.js +106 -0
- package/src/styles/vaadin-tabs-core-styles.d.ts +8 -0
- package/src/styles/{vaadin-tabs-styles.js → vaadin-tabs-core-styles.js} +0 -2
- package/src/vaadin-tab.js +4 -3
- package/src/vaadin-tabs.js +4 -3
- package/theme/lumo/vaadin-tabs-styles.js +0 -1
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
- /package/src/styles/{vaadin-tab-styles.d.ts → vaadin-tab-base-styles.d.ts} +0 -0
- /package/src/styles/{vaadin-tab-styles.js → vaadin-tab-core-styles.js} +0 -0
- /package/src/styles/{vaadin-tabs-styles.d.ts → vaadin-tabs-base-styles.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/tabs",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha6",
|
|
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,16 +37,16 @@
|
|
|
35
37
|
],
|
|
36
38
|
"dependencies": {
|
|
37
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
39
|
-
"@vaadin/component-base": "25.0.0-
|
|
40
|
-
"@vaadin/item": "25.0.0-
|
|
41
|
-
"@vaadin/vaadin-lumo-styles": "25.0.0-
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-
|
|
40
|
+
"@vaadin/a11y-base": "25.0.0-alpha6",
|
|
41
|
+
"@vaadin/component-base": "25.0.0-alpha6",
|
|
42
|
+
"@vaadin/item": "25.0.0-alpha6",
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha6",
|
|
44
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha6",
|
|
43
45
|
"lit": "^3.0.0"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
47
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
48
|
+
"@vaadin/chai-plugins": "25.0.0-alpha6",
|
|
49
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha6",
|
|
48
50
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
49
51
|
"sinon": "^18.0.0"
|
|
50
52
|
},
|
|
@@ -52,5 +54,5 @@
|
|
|
52
54
|
"web-types.json",
|
|
53
55
|
"web-types.lit.json"
|
|
54
56
|
],
|
|
55
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "cd1d084198d2b326c58d44bb39fa4845b71ce551"
|
|
56
58
|
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 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 tabStyles = css`
|
|
10
|
+
@layer base {
|
|
11
|
+
:host {
|
|
12
|
+
flex-shrink: 0;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
gap: var(--vaadin-tab-gap, var(--vaadin-gap-container-inline));
|
|
17
|
+
padding: var(--vaadin-tab-padding, var(--vaadin-padding-container));
|
|
18
|
+
cursor: var(--vaadin-clickable-cursor);
|
|
19
|
+
font-size: var(--vaadin-tab-font-size, 1em);
|
|
20
|
+
font-weight: var(--vaadin-tab-font-weight, 500);
|
|
21
|
+
line-height: var(--vaadin-tab-line-height, inherit);
|
|
22
|
+
color: var(--vaadin-tab-color, var(--vaadin-color-subtle));
|
|
23
|
+
background: var(--vaadin-tab-background, transparent);
|
|
24
|
+
border-radius: var(--vaadin-tab-border-radius, var(--vaadin-radius-m));
|
|
25
|
+
-webkit-tap-highlight-color: transparent;
|
|
26
|
+
-webkit-user-select: none;
|
|
27
|
+
user-select: none;
|
|
28
|
+
touch-action: manipulation;
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([hidden]) {
|
|
33
|
+
display: none !important;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:host([orientation='vertical']) {
|
|
37
|
+
justify-content: start;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host([selected]) {
|
|
41
|
+
--vaadin-tab-background: var(--vaadin-background-container);
|
|
42
|
+
--vaadin-tab-color: var(--vaadin-color);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([disabled]) {
|
|
46
|
+
cursor: var(--vaadin-disabled-cursor);
|
|
47
|
+
opacity: 0.5;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host(:is([focus-ring], :focus-visible)) {
|
|
51
|
+
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
52
|
+
outline-offset: calc(var(--vaadin-focus-ring-width) * -1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
slot {
|
|
56
|
+
gap: inherit;
|
|
57
|
+
align-items: inherit;
|
|
58
|
+
justify-content: inherit;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
::slotted(a) {
|
|
62
|
+
color: inherit;
|
|
63
|
+
cursor: inherit;
|
|
64
|
+
text-decoration: inherit;
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: inherit;
|
|
67
|
+
justify-content: inherit;
|
|
68
|
+
gap: inherit;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
::slotted(a)::before {
|
|
72
|
+
content: '';
|
|
73
|
+
position: absolute;
|
|
74
|
+
inset: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@media (forced-colors: active) {
|
|
78
|
+
:host {
|
|
79
|
+
border: 1px solid Canvas;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:host([selected]) {
|
|
83
|
+
color: Highlight;
|
|
84
|
+
border-color: Highlight;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
:host([disabled]) {
|
|
88
|
+
color: GrayText;
|
|
89
|
+
opacity: 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 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 tabsStyles = css`
|
|
10
|
+
@layer base {
|
|
11
|
+
:host {
|
|
12
|
+
display: flex;
|
|
13
|
+
max-width: 100%;
|
|
14
|
+
max-height: 100%;
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host([hidden]) {
|
|
19
|
+
display: none !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([orientation='vertical']) {
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[part='tabs'] {
|
|
27
|
+
flex: 1;
|
|
28
|
+
overflow: auto;
|
|
29
|
+
overscroll-behavior: contain;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
gap: var(--vaadin-tabs-gap, var(--vaadin-gap-container-inline));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([orientation='horizontal']) [part='tabs'] {
|
|
36
|
+
flex-direction: row;
|
|
37
|
+
scrollbar-width: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* scrollbar-width is supported in Safari 18.2, use the following for earlier */
|
|
41
|
+
:host([orientation='horizontal']) [part='tabs']::-webkit-scrollbar {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[part$='button'] {
|
|
46
|
+
position: absolute;
|
|
47
|
+
z-index: 1;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
opacity: 0;
|
|
50
|
+
cursor: var(--vaadin-clickable-cursor);
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
height: 100%;
|
|
53
|
+
padding: var(--vaadin-tab-padding, var(--vaadin-padding-container));
|
|
54
|
+
background: var(--vaadin-background-color);
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
-webkit-tap-highlight-color: transparent;
|
|
59
|
+
touch-action: manipulation;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
[part='forward-button'] {
|
|
63
|
+
inset-inline-end: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host([overflow~='start']) [part='back-button'],
|
|
67
|
+
:host([overflow~='end']) [part='forward-button'] {
|
|
68
|
+
pointer-events: auto;
|
|
69
|
+
opacity: 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[part$='button']::before {
|
|
73
|
+
content: '';
|
|
74
|
+
display: block;
|
|
75
|
+
width: var(--vaadin-icon-size, 1lh);
|
|
76
|
+
height: var(--vaadin-icon-size, 1lh);
|
|
77
|
+
background: currentColor;
|
|
78
|
+
mask-image: var(--_vaadin-icon-chevron-down);
|
|
79
|
+
rotate: 90deg;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[part='forward-button']::before {
|
|
83
|
+
rotate: -90deg;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:host(:is([orientation='vertical'], [theme~='hide-scroll-buttons'])) [part$='button'] {
|
|
87
|
+
display: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@media (pointer: coarse) {
|
|
91
|
+
:host(:not([theme~='show-scroll-buttons'])) [part$='button'] {
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:host([dir='rtl']) [part$='button']::before {
|
|
97
|
+
scale: 1 -1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@media (forced-colors: active) {
|
|
101
|
+
[part$='button']::before {
|
|
102
|
+
background: CanvasText;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
@@ -24,7 +24,6 @@ export const tabsStyles = css`
|
|
|
24
24
|
display: flex;
|
|
25
25
|
align-self: stretch;
|
|
26
26
|
overflow-x: auto;
|
|
27
|
-
-webkit-overflow-scrolling: touch;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
/* This seems more future-proof than \`overflow: -moz-scrollbars-none\` which is marked obsolete
|
|
@@ -43,7 +42,6 @@ export const tabsStyles = css`
|
|
|
43
42
|
:host([orientation='vertical']) [part='tabs'] {
|
|
44
43
|
height: 100%;
|
|
45
44
|
overflow-y: auto;
|
|
46
|
-
-webkit-overflow-scrolling: touch;
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
[part='back-button'],
|
package/src/vaadin-tab.js
CHANGED
|
@@ -9,8 +9,9 @@ import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
|
9
9
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
10
|
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
11
11
|
import { ItemMixin } from '@vaadin/item/src/vaadin-item-mixin.js';
|
|
12
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
-
import { tabStyles } from './styles/vaadin-tab-styles.js';
|
|
14
|
+
import { tabStyles } from './styles/vaadin-tab-core-styles.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* `<vaadin-tab>` is a Web Component providing an accessible and customizable tab.
|
|
@@ -40,13 +41,13 @@ import { tabStyles } from './styles/vaadin-tab-styles.js';
|
|
|
40
41
|
* @mixes ItemMixin
|
|
41
42
|
* @mixes ThemableMixin
|
|
42
43
|
*/
|
|
43
|
-
class Tab extends ItemMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
|
|
44
|
+
class Tab extends ItemMixin(ThemableMixin(ElementMixin(LumoInjectionMixin(PolylitMixin(LitElement))))) {
|
|
44
45
|
static get is() {
|
|
45
46
|
return 'vaadin-tab';
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
static get styles() {
|
|
49
|
-
return
|
|
50
|
+
return tabStyles;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
/** @protected */
|
package/src/vaadin-tabs.js
CHANGED
|
@@ -8,8 +8,9 @@ import { html, LitElement } from 'lit';
|
|
|
8
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
9
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
10
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
11
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
-
import { tabsStyles } from './styles/vaadin-tabs-styles.js';
|
|
13
|
+
import { tabsStyles } from './styles/vaadin-tabs-core-styles.js';
|
|
13
14
|
import { TabsMixin } from './vaadin-tabs-mixin.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -52,13 +53,13 @@ import { TabsMixin } from './vaadin-tabs-mixin.js';
|
|
|
52
53
|
* @mixes TabsMixin
|
|
53
54
|
* @mixes ThemableMixin
|
|
54
55
|
*/
|
|
55
|
-
class Tabs extends TabsMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
56
|
+
class Tabs extends TabsMixin(ElementMixin(ThemableMixin(LumoInjectionMixin(PolylitMixin(LitElement))))) {
|
|
56
57
|
static get is() {
|
|
57
58
|
return 'vaadin-tabs';
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
static get styles() {
|
|
61
|
-
return
|
|
62
|
+
return tabsStyles;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
/** @protected */
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|