@vaadin/button 25.0.0-alpha2 → 25.0.0-alpha21
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 -13
- package/src/styles/vaadin-button-base-styles.js +106 -0
- package/src/vaadin-button.d.ts +9 -8
- package/src/vaadin-button.js +12 -11
- package/vaadin-button.js +1 -1
- package/web-types.json +4 -4
- package/web-types.lit.json +3 -3
- package/src/vaadin-button-core-styles.js +0 -72
- package/theme/lumo/vaadin-button-styles.d.ts +0 -7
- package/theme/lumo/vaadin-button-styles.js +0 -287
- package/theme/lumo/vaadin-button.d.ts +0 -2
- package/theme/lumo/vaadin-button.js +0 -2
- /package/src/{vaadin-button-core-styles.d.ts → styles/vaadin-button-base-styles.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/button",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha21",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,9 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
-
"!src/vaadin-button-base-styles.d.ts",
|
|
25
|
-
"!src/vaadin-button-base-styles.js",
|
|
26
|
-
"theme",
|
|
27
24
|
"vaadin-*.d.ts",
|
|
28
25
|
"vaadin-*.js",
|
|
29
26
|
"web-types.json",
|
|
@@ -37,22 +34,23 @@
|
|
|
37
34
|
],
|
|
38
35
|
"dependencies": {
|
|
39
36
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
40
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
41
|
-
"@vaadin/component-base": "25.0.0-
|
|
42
|
-
"@vaadin/vaadin-
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
|
|
37
|
+
"@vaadin/a11y-base": "25.0.0-alpha21",
|
|
38
|
+
"@vaadin/component-base": "25.0.0-alpha21",
|
|
39
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha21",
|
|
44
40
|
"lit": "^3.0.0"
|
|
45
41
|
},
|
|
46
42
|
"devDependencies": {
|
|
47
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
48
|
-
"@vaadin/icon": "25.0.0-
|
|
49
|
-
"@vaadin/
|
|
43
|
+
"@vaadin/chai-plugins": "25.0.0-alpha21",
|
|
44
|
+
"@vaadin/icon": "25.0.0-alpha21",
|
|
45
|
+
"@vaadin/icons": "25.0.0-alpha21",
|
|
46
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha21",
|
|
50
47
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
51
|
-
"
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha21",
|
|
49
|
+
"sinon": "^21.0.0"
|
|
52
50
|
},
|
|
53
51
|
"web-types": [
|
|
54
52
|
"web-types.json",
|
|
55
53
|
"web-types.lit.json"
|
|
56
54
|
],
|
|
57
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "8fb9e9710c01449edf623a1aaac4655cdc11a933"
|
|
58
56
|
}
|
|
@@ -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/styles/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const buttonStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
text-align: center;
|
|
15
|
+
gap: var(--vaadin-button-gap, 0 var(--vaadin-gap-s));
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
-webkit-tap-highlight-color: transparent;
|
|
18
|
+
-webkit-user-select: none;
|
|
19
|
+
user-select: none;
|
|
20
|
+
cursor: var(--vaadin-clickable-cursor);
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
vertical-align: middle;
|
|
23
|
+
flex-shrink: 0;
|
|
24
|
+
height: var(--vaadin-button-height, auto);
|
|
25
|
+
margin: var(--vaadin-button-margin, 0);
|
|
26
|
+
padding: var(--vaadin-button-padding, var(--vaadin-padding-container));
|
|
27
|
+
font-family: var(--vaadin-button-font-family, inherit);
|
|
28
|
+
font-size: var(--vaadin-button-font-size, inherit);
|
|
29
|
+
line-height: var(--vaadin-button-line-height, inherit);
|
|
30
|
+
font-weight: var(--vaadin-button-font-weight, 500);
|
|
31
|
+
color: var(--vaadin-button-text-color, var(--vaadin-text-color));
|
|
32
|
+
background: var(--vaadin-button-background, var(--vaadin-background-container));
|
|
33
|
+
background-origin: border-box;
|
|
34
|
+
border: var(--vaadin-button-border-width, 1px) solid
|
|
35
|
+
var(--vaadin-button-border-color, var(--vaadin-border-color-secondary));
|
|
36
|
+
border-radius: var(--vaadin-button-border-radius, var(--vaadin-radius-m));
|
|
37
|
+
touch-action: manipulation;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host([hidden]) {
|
|
41
|
+
display: none !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.vaadin-button-container,
|
|
45
|
+
[part='prefix'],
|
|
46
|
+
[part='suffix'] {
|
|
47
|
+
display: contents;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[part='label'] {
|
|
51
|
+
display: inline-flex;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host(:is([focus-ring], :focus-visible)) {
|
|
55
|
+
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
56
|
+
outline-offset: 1px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([theme~='primary']) {
|
|
60
|
+
--vaadin-button-background: var(--vaadin-text-color);
|
|
61
|
+
--vaadin-button-text-color: var(--vaadin-background-color);
|
|
62
|
+
--vaadin-button-border-color: transparent;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host([theme~='tertiary']) {
|
|
66
|
+
background: transparent;
|
|
67
|
+
border-color: transparent;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:host([disabled]) {
|
|
71
|
+
pointer-events: var(--_vaadin-button-disabled-pointer-events, none);
|
|
72
|
+
cursor: var(--vaadin-disabled-cursor);
|
|
73
|
+
opacity: 0.5;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([disabled][theme~='primary']) {
|
|
77
|
+
--vaadin-button-text-color: var(--vaadin-background-container-strong);
|
|
78
|
+
--vaadin-button-background: var(--vaadin-text-color-disabled);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (forced-colors: active) {
|
|
82
|
+
:host {
|
|
83
|
+
--vaadin-button-border-width: 1px;
|
|
84
|
+
--vaadin-button-background: ButtonFace;
|
|
85
|
+
--vaadin-button-text-color: ButtonText;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host([theme~='primary']) {
|
|
89
|
+
forced-color-adjust: none;
|
|
90
|
+
--vaadin-button-background: CanvasText;
|
|
91
|
+
--vaadin-button-text-color: Canvas;
|
|
92
|
+
--vaadin-icon-color: Canvas;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
::slotted(*) {
|
|
96
|
+
forced-color-adjust: auto;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([disabled]) {
|
|
100
|
+
--vaadin-button-background: transparent !important;
|
|
101
|
+
--vaadin-button-border-color: GrayText !important;
|
|
102
|
+
--vaadin-button-text-color: GrayText !important;
|
|
103
|
+
opacity: 1;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
`;
|
package/src/vaadin-button.d.ts
CHANGED
|
@@ -24,14 +24,15 @@ import { ButtonMixin } from './vaadin-button-mixin.js';
|
|
|
24
24
|
* `prefix` | A slot for content before the label (e.g. an icon).
|
|
25
25
|
* `suffix` | A slot for content after the label (e.g. an icon).
|
|
26
26
|
*
|
|
27
|
-
* The following attributes are available for styling:
|
|
27
|
+
* The following state attributes are available for styling:
|
|
28
28
|
*
|
|
29
|
-
* Attribute
|
|
30
|
-
*
|
|
31
|
-
* `active`
|
|
32
|
-
* `disabled`
|
|
33
|
-
* `focus-ring`
|
|
34
|
-
* `focused`
|
|
29
|
+
* Attribute | Description
|
|
30
|
+
* ---------------|-------------
|
|
31
|
+
* `active` | Set when the button is pressed down, either with mouse, touch or the keyboard
|
|
32
|
+
* `disabled` | Set when the button is disabled
|
|
33
|
+
* `focus-ring` | Set when the button is focused using the keyboard
|
|
34
|
+
* `focused` | Set when the button is focused
|
|
35
|
+
* `has-tooltip` | Set when the button has a slotted tooltip
|
|
35
36
|
*
|
|
36
37
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
37
38
|
*/
|
|
@@ -48,7 +49,7 @@ declare class Button extends ButtonMixin(ElementMixin(ThemableMixin(HTMLElement)
|
|
|
48
49
|
* which makes disabled buttons focusable and hoverable, while still
|
|
49
50
|
* preventing them from being triggered:
|
|
50
51
|
*
|
|
51
|
-
* ```
|
|
52
|
+
* ```js
|
|
52
53
|
* // Set before any button is attached to the DOM.
|
|
53
54
|
* window.Vaadin.featureFlags.accessibleDisabledButtons = true
|
|
54
55
|
* ```
|
package/src/vaadin-button.js
CHANGED
|
@@ -8,9 +8,9 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
|
8
8
|
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
|
-
import {
|
|
11
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
-
import { buttonStyles } from './vaadin-button-
|
|
13
|
+
import { buttonStyles } from './styles/vaadin-button-base-styles.js';
|
|
14
14
|
import { ButtonMixin } from './vaadin-button-mixin.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -30,14 +30,15 @@ import { ButtonMixin } from './vaadin-button-mixin.js';
|
|
|
30
30
|
* `prefix` | A slot for content before the label (e.g. an icon).
|
|
31
31
|
* `suffix` | A slot for content after the label (e.g. an icon).
|
|
32
32
|
*
|
|
33
|
-
* The following attributes are available for styling:
|
|
33
|
+
* The following state attributes are available for styling:
|
|
34
34
|
*
|
|
35
|
-
* Attribute
|
|
36
|
-
*
|
|
37
|
-
* `active`
|
|
38
|
-
* `disabled`
|
|
39
|
-
* `focus-ring`
|
|
40
|
-
* `focused`
|
|
35
|
+
* Attribute | Description
|
|
36
|
+
* ---------------|-------------
|
|
37
|
+
* `active` | Set when the button is pressed down, either with mouse, touch or the keyboard
|
|
38
|
+
* `disabled` | Set when the button is disabled
|
|
39
|
+
* `focus-ring` | Set when the button is focused using the keyboard
|
|
40
|
+
* `focused` | Set when the button is focused
|
|
41
|
+
* `has-tooltip` | Set when the button has a slotted tooltip
|
|
41
42
|
*
|
|
42
43
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
43
44
|
*
|
|
@@ -47,7 +48,7 @@ import { ButtonMixin } from './vaadin-button-mixin.js';
|
|
|
47
48
|
* @mixes ElementMixin
|
|
48
49
|
* @mixes ThemableMixin
|
|
49
50
|
*/
|
|
50
|
-
class Button extends ButtonMixin(ElementMixin(
|
|
51
|
+
class Button extends ButtonMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
51
52
|
static get is() {
|
|
52
53
|
return 'vaadin-button';
|
|
53
54
|
}
|
|
@@ -70,7 +71,7 @@ class Button extends ButtonMixin(ElementMixin(CSSInjectionMixin(ThemableMixin(Po
|
|
|
70
71
|
* which makes disabled buttons focusable and hoverable, while still
|
|
71
72
|
* preventing them from being triggered:
|
|
72
73
|
*
|
|
73
|
-
* ```
|
|
74
|
+
* ```js
|
|
74
75
|
* // Set before any button is attached to the DOM.
|
|
75
76
|
* window.Vaadin.featureFlags.accessibleDisabledButtons = true
|
|
76
77
|
* ```
|
package/vaadin-button.js
CHANGED
package/web-types.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/button",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha21",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-button",
|
|
11
|
-
"description": "`<vaadin-button>` is an accessible and customizable button that allows users to perform actions.\n\n```html\n<vaadin-button>Press me</vaadin-button>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------|-------------\n`label` | The label (text) inside the button.\n`prefix` | A slot for content before the label (e.g. an icon).\n`suffix` | A slot for content after the label (e.g. an icon).\n\nThe following attributes are available for styling:\n\nAttribute
|
|
11
|
+
"description": "`<vaadin-button>` is an accessible and customizable button that allows users to perform actions.\n\n```html\n<vaadin-button>Press me</vaadin-button>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------|-------------\n`label` | The label (text) inside the button.\n`prefix` | A slot for content before the label (e.g. an icon).\n`suffix` | A slot for content after the label (e.g. an icon).\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------|-------------\n`active` | Set when the button is pressed down, either with mouse, touch or the keyboard\n`disabled` | Set when the button is disabled\n`focus-ring` | Set when the button is focused using the keyboard\n`focused` | Set when the button is focused\n`has-tooltip` | Set when the button has a slotted tooltip\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "disabled",
|
|
15
|
-
"description": "When disabled, the button is rendered as \"dimmed\" and prevents all\nuser interactions (mouse and keyboard).\n\nSince disabled buttons are not focusable and cannot react to hover\nevents by default, it can cause accessibility issues by making them\nentirely invisible to assistive technologies, and prevents the use\nof Tooltips to explain why the action is not available. This can be\naddressed by enabling the feature flag `accessibleDisabledButtons`,\nwhich makes disabled buttons focusable and hoverable, while still\npreventing them from being triggered:\n\n
|
|
15
|
+
"description": "When disabled, the button is rendered as \"dimmed\" and prevents all\nuser interactions (mouse and keyboard).\n\nSince disabled buttons are not focusable and cannot react to hover\nevents by default, it can cause accessibility issues by making them\nentirely invisible to assistive technologies, and prevents the use\nof Tooltips to explain why the action is not available. This can be\naddressed by enabling the feature flag `accessibleDisabledButtons`,\nwhich makes disabled buttons focusable and hoverable, while still\npreventing them from being triggered:\n\n```js\n// Set before any button is attached to the DOM.\nwindow.Vaadin.featureFlags.accessibleDisabledButtons = true\n```",
|
|
16
16
|
"value": {
|
|
17
17
|
"type": [
|
|
18
18
|
"boolean",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"properties": [
|
|
38
38
|
{
|
|
39
39
|
"name": "disabled",
|
|
40
|
-
"description": "When disabled, the button is rendered as \"dimmed\" and prevents all\nuser interactions (mouse and keyboard).\n\nSince disabled buttons are not focusable and cannot react to hover\nevents by default, it can cause accessibility issues by making them\nentirely invisible to assistive technologies, and prevents the use\nof Tooltips to explain why the action is not available. This can be\naddressed by enabling the feature flag `accessibleDisabledButtons`,\nwhich makes disabled buttons focusable and hoverable, while still\npreventing them from being triggered:\n\n
|
|
40
|
+
"description": "When disabled, the button is rendered as \"dimmed\" and prevents all\nuser interactions (mouse and keyboard).\n\nSince disabled buttons are not focusable and cannot react to hover\nevents by default, it can cause accessibility issues by making them\nentirely invisible to assistive technologies, and prevents the use\nof Tooltips to explain why the action is not available. This can be\naddressed by enabling the feature flag `accessibleDisabledButtons`,\nwhich makes disabled buttons focusable and hoverable, while still\npreventing them from being triggered:\n\n```js\n// Set before any button is attached to the DOM.\nwindow.Vaadin.featureFlags.accessibleDisabledButtons = true\n```",
|
|
41
41
|
"value": {
|
|
42
42
|
"type": [
|
|
43
43
|
"boolean",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/button",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha21",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-button",
|
|
19
|
-
"description": "`<vaadin-button>` is an accessible and customizable button that allows users to perform actions.\n\n```html\n<vaadin-button>Press me</vaadin-button>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------|-------------\n`label` | The label (text) inside the button.\n`prefix` | A slot for content before the label (e.g. an icon).\n`suffix` | A slot for content after the label (e.g. an icon).\n\nThe following attributes are available for styling:\n\nAttribute
|
|
19
|
+
"description": "`<vaadin-button>` is an accessible and customizable button that allows users to perform actions.\n\n```html\n<vaadin-button>Press me</vaadin-button>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------|-------------\n`label` | The label (text) inside the button.\n`prefix` | A slot for content before the label (e.g. an icon).\n`suffix` | A slot for content after the label (e.g. an icon).\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------|-------------\n`active` | Set when the button is pressed down, either with mouse, touch or the keyboard\n`disabled` | Set when the button is disabled\n`focus-ring` | Set when the button is focused using the keyboard\n`focused` | Set when the button is focused\n`has-tooltip` | Set when the button has a slotted tooltip\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
23
23
|
"name": "?disabled",
|
|
24
|
-
"description": "When disabled, the button is rendered as \"dimmed\" and prevents all\nuser interactions (mouse and keyboard).\n\nSince disabled buttons are not focusable and cannot react to hover\nevents by default, it can cause accessibility issues by making them\nentirely invisible to assistive technologies, and prevents the use\nof Tooltips to explain why the action is not available. This can be\naddressed by enabling the feature flag `accessibleDisabledButtons`,\nwhich makes disabled buttons focusable and hoverable, while still\npreventing them from being triggered:\n\n
|
|
24
|
+
"description": "When disabled, the button is rendered as \"dimmed\" and prevents all\nuser interactions (mouse and keyboard).\n\nSince disabled buttons are not focusable and cannot react to hover\nevents by default, it can cause accessibility issues by making them\nentirely invisible to assistive technologies, and prevents the use\nof Tooltips to explain why the action is not available. This can be\naddressed by enabling the feature flag `accessibleDisabledButtons`,\nwhich makes disabled buttons focusable and hoverable, while still\npreventing them from being triggered:\n\n```js\n// Set before any button is attached to the DOM.\nwindow.Vaadin.featureFlags.accessibleDisabledButtons = true\n```",
|
|
25
25
|
"value": {
|
|
26
26
|
"kind": "expression"
|
|
27
27
|
}
|
|
@@ -1,72 +0,0 @@
|
|
|
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 { css } from 'lit';
|
|
7
|
-
|
|
8
|
-
export const buttonStyles = css`
|
|
9
|
-
:host {
|
|
10
|
-
display: inline-block;
|
|
11
|
-
position: relative;
|
|
12
|
-
outline: none;
|
|
13
|
-
white-space: nowrap;
|
|
14
|
-
-webkit-user-select: none;
|
|
15
|
-
user-select: none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
:host([hidden]) {
|
|
19
|
-
display: none !important;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
:host([disabled]) {
|
|
23
|
-
pointer-events: var(--_vaadin-button-disabled-pointer-events, none);
|
|
24
|
-
cursor: not-allowed;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/* Aligns the button with form fields when placed on the same line.
|
|
28
|
-
Note, to make it work, the form fields should have the same "::before" pseudo-element. */
|
|
29
|
-
.vaadin-button-container::before {
|
|
30
|
-
content: '\\2003';
|
|
31
|
-
display: inline-block;
|
|
32
|
-
width: 0;
|
|
33
|
-
max-height: 100%;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.vaadin-button-container {
|
|
37
|
-
display: inline-flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
text-align: center;
|
|
41
|
-
width: 100%;
|
|
42
|
-
height: 100%;
|
|
43
|
-
min-height: inherit;
|
|
44
|
-
text-shadow: inherit;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
[part='prefix'],
|
|
48
|
-
[part='suffix'] {
|
|
49
|
-
flex: none;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
[part='label'] {
|
|
53
|
-
white-space: nowrap;
|
|
54
|
-
overflow: hidden;
|
|
55
|
-
text-overflow: ellipsis;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
@media (forced-colors: active) {
|
|
59
|
-
:host {
|
|
60
|
-
outline: 1px solid;
|
|
61
|
-
outline-offset: -1px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
:host([focused]) {
|
|
65
|
-
outline-width: 2px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
:host([disabled]) {
|
|
69
|
-
outline-color: GrayText;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
`;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
2
|
-
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
3
|
-
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
4
|
-
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
5
|
-
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
6
|
-
declare const button: import("lit").CSSResult;
|
|
7
|
-
export { button };
|
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
2
|
-
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
3
|
-
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
4
|
-
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
5
|
-
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
6
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
|
-
|
|
8
|
-
const button = css`
|
|
9
|
-
:host {
|
|
10
|
-
/* Sizing */
|
|
11
|
-
--lumo-button-size: var(--lumo-size-m);
|
|
12
|
-
min-width: var(--vaadin-button-min-width, calc(var(--_button-size) * 2));
|
|
13
|
-
height: var(--_button-size);
|
|
14
|
-
padding: var(--vaadin-button-padding, 0 calc(var(--_button-size) / 3 + var(--lumo-border-radius-m) / 2));
|
|
15
|
-
margin: var(--vaadin-button-margin, var(--lumo-space-xs) 0);
|
|
16
|
-
box-sizing: border-box;
|
|
17
|
-
/* Style */
|
|
18
|
-
font-family: var(--lumo-font-family);
|
|
19
|
-
font-size: var(--vaadin-button-font-size, var(--lumo-font-size-m));
|
|
20
|
-
font-weight: var(--vaadin-button-font-weight, 500);
|
|
21
|
-
color: var(--_lumo-button-text-color);
|
|
22
|
-
background: var(--_lumo-button-background);
|
|
23
|
-
border: var(--vaadin-button-border, none);
|
|
24
|
-
border-radius: var(--vaadin-button-border-radius, var(--lumo-border-radius-m));
|
|
25
|
-
cursor: var(--lumo-clickable-cursor);
|
|
26
|
-
-webkit-tap-highlight-color: transparent;
|
|
27
|
-
-webkit-font-smoothing: antialiased;
|
|
28
|
-
-moz-osx-font-smoothing: grayscale;
|
|
29
|
-
flex-shrink: 0;
|
|
30
|
-
--_button-size: var(--vaadin-button-height, var(--lumo-button-size));
|
|
31
|
-
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
|
|
32
|
-
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
|
|
33
|
-
/* Used by notification */
|
|
34
|
-
--_lumo-button-background: var(--vaadin-button-background, var(--lumo-contrast-5pct));
|
|
35
|
-
--_lumo-button-text-color: var(--vaadin-button-text-color, var(--lumo-primary-text-color));
|
|
36
|
-
--_lumo-button-primary-background: var(--vaadin-button-primary-background, var(--lumo-primary-color));
|
|
37
|
-
--_lumo-button-primary-text-color: var(--vaadin-button-primary-text-color, var(--lumo-primary-contrast-color));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/* Set only for the internal parts so we don't affect the host vertical alignment */
|
|
41
|
-
[part='label'],
|
|
42
|
-
[part='prefix'],
|
|
43
|
-
[part='suffix'] {
|
|
44
|
-
line-height: var(--lumo-line-height-xs);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
[part='label'] {
|
|
48
|
-
padding: calc(var(--lumo-button-size) / 6) 0;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
:host([theme~='small']) {
|
|
52
|
-
font-size: var(--lumo-font-size-s);
|
|
53
|
-
--lumo-button-size: var(--lumo-size-s);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
:host([theme~='large']) {
|
|
57
|
-
font-size: var(--lumo-font-size-l);
|
|
58
|
-
--lumo-button-size: var(--lumo-size-l);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/* For interaction states */
|
|
62
|
-
:host::before,
|
|
63
|
-
:host::after {
|
|
64
|
-
content: '';
|
|
65
|
-
/* We rely on the host always being relative */
|
|
66
|
-
position: absolute;
|
|
67
|
-
z-index: 1;
|
|
68
|
-
inset: 0;
|
|
69
|
-
background-color: currentColor;
|
|
70
|
-
border-radius: inherit;
|
|
71
|
-
opacity: 0;
|
|
72
|
-
pointer-events: none;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/* Hover */
|
|
76
|
-
|
|
77
|
-
@media (any-hover: hover) {
|
|
78
|
-
:host(:not([disabled]):hover)::before {
|
|
79
|
-
opacity: 0.02;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/* Active */
|
|
84
|
-
|
|
85
|
-
:host::after {
|
|
86
|
-
transition:
|
|
87
|
-
opacity 1.4s,
|
|
88
|
-
transform 0.1s;
|
|
89
|
-
filter: blur(8px);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
:host([active])::before {
|
|
93
|
-
opacity: 0.05;
|
|
94
|
-
transition-duration: 0s;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
:host([active])::after {
|
|
98
|
-
opacity: 0.1;
|
|
99
|
-
transition-duration: 0s, 0s;
|
|
100
|
-
transform: scale(0);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/* Keyboard focus */
|
|
104
|
-
|
|
105
|
-
:host([focus-ring]) {
|
|
106
|
-
box-shadow:
|
|
107
|
-
0 0 0 calc(1px * var(--_focus-ring-gap-on, 0)) var(--_focus-ring-gap-color, var(--lumo-base-color)),
|
|
108
|
-
0 0 0 calc(var(--_focus-ring-width) + 1px * var(--_focus-ring-gap-on, 0)) var(--_focus-ring-color);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
:host([theme~='primary'][focus-ring]) {
|
|
112
|
-
--_focus-ring-gap-on: 1;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/* Types (primary, tertiary, tertiary-inline */
|
|
116
|
-
|
|
117
|
-
:host([theme~='tertiary']),
|
|
118
|
-
:host([theme~='tertiary-inline']) {
|
|
119
|
-
--_background: transparent !important;
|
|
120
|
-
background: var(--vaadin-button-tertiary-background, var(--_background));
|
|
121
|
-
min-width: 0;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
:host([theme~='tertiary']) {
|
|
125
|
-
border: var(--vaadin-button-tertiary-border, none);
|
|
126
|
-
color: var(--vaadin-button-tertiary-text-color, var(--lumo-primary-text-color));
|
|
127
|
-
font-weight: var(--vaadin-button-tertiary-font-weight, 500);
|
|
128
|
-
padding: var(--vaadin-button-tertiary-padding, 0 calc(var(--_button-size) / 6));
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
:host([theme~='tertiary-inline'])::before {
|
|
132
|
-
display: none;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
:host([theme~='tertiary-inline']) {
|
|
136
|
-
margin: 0;
|
|
137
|
-
height: auto;
|
|
138
|
-
padding: 0;
|
|
139
|
-
line-height: inherit;
|
|
140
|
-
font-size: inherit;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
:host([theme~='tertiary-inline']) [part='label'] {
|
|
144
|
-
padding: 0;
|
|
145
|
-
overflow: visible;
|
|
146
|
-
line-height: inherit;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
:host([theme~='primary']) {
|
|
150
|
-
background: var(--_lumo-button-primary-background);
|
|
151
|
-
border: var(--vaadin-button-primary-border, none);
|
|
152
|
-
color: var(--_lumo-button-primary-text-color);
|
|
153
|
-
font-weight: var(--vaadin-button-primary-font-weight, 600);
|
|
154
|
-
min-width: calc(var(--lumo-button-size) * 2.5);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
:host([theme~='primary'])::before {
|
|
158
|
-
background-color: black;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
@media (any-hover: hover) {
|
|
162
|
-
:host([theme~='primary']:not([disabled]):hover)::before {
|
|
163
|
-
opacity: 0.05;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
:host([theme~='primary'][active])::before {
|
|
168
|
-
opacity: 0.1;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
:host([theme~='primary'][active])::after {
|
|
172
|
-
opacity: 0.2;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/* Colors (success, warning, error, contrast) */
|
|
176
|
-
|
|
177
|
-
:host([theme~='success']) {
|
|
178
|
-
color: var(--lumo-success-text-color);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
:host([theme~='success'][theme~='primary']) {
|
|
182
|
-
background-color: var(--lumo-success-color);
|
|
183
|
-
color: var(--lumo-success-contrast-color);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
:host([theme~='warning']) {
|
|
187
|
-
color: var(--lumo-warning-text-color);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
:host([theme~='warning'][theme~='primary']) {
|
|
191
|
-
background-color: var(--lumo-warning-color);
|
|
192
|
-
color: var(--lumo-warning-contrast-color);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
:host([theme~='error']) {
|
|
196
|
-
color: var(--lumo-error-text-color);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
:host([theme~='error'][theme~='primary']) {
|
|
200
|
-
background-color: var(--lumo-error-color);
|
|
201
|
-
color: var(--lumo-error-contrast-color);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
:host([theme~='contrast']) {
|
|
205
|
-
color: var(--lumo-contrast);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
:host([theme~='contrast'][theme~='primary']) {
|
|
209
|
-
background-color: var(--lumo-contrast);
|
|
210
|
-
color: var(--lumo-base-color);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/* Disabled state. Keep selectors after other color variants. */
|
|
214
|
-
|
|
215
|
-
:host([disabled]) {
|
|
216
|
-
color: var(--lumo-disabled-text-color);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
:host([theme~='primary'][disabled]) {
|
|
220
|
-
background-color: var(--lumo-contrast-30pct);
|
|
221
|
-
color: var(--lumo-base-color);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
:host([theme~='primary'][disabled]) [part] {
|
|
225
|
-
opacity: 0.7;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/* Icons */
|
|
229
|
-
|
|
230
|
-
[part] ::slotted(vaadin-icon) {
|
|
231
|
-
display: inline-block;
|
|
232
|
-
width: var(--lumo-icon-size-m);
|
|
233
|
-
height: var(--lumo-icon-size-m);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/* Vaadin icons are based on a 16x16 grid (unlike Lumo and Material icons with 24x24), so they look too big by default */
|
|
237
|
-
[part] ::slotted(vaadin-icon[icon^='vaadin:']) {
|
|
238
|
-
padding: 0.25em;
|
|
239
|
-
box-sizing: border-box !important;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
[part='prefix'] {
|
|
243
|
-
margin-left: -0.25em;
|
|
244
|
-
margin-right: 0.25em;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
[part='suffix'] {
|
|
248
|
-
margin-left: 0.25em;
|
|
249
|
-
margin-right: -0.25em;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/* Icon-only */
|
|
253
|
-
|
|
254
|
-
:host([theme~='icon']:not([theme~='tertiary-inline'])) {
|
|
255
|
-
min-width: var(--lumo-button-size);
|
|
256
|
-
padding-left: calc(var(--lumo-button-size) / 4);
|
|
257
|
-
padding-right: calc(var(--lumo-button-size) / 4);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
:host([theme~='icon']) [part='prefix'],
|
|
261
|
-
:host([theme~='icon']) [part='suffix'] {
|
|
262
|
-
margin-left: 0;
|
|
263
|
-
margin-right: 0;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/* RTL specific styles */
|
|
267
|
-
|
|
268
|
-
:host([dir='rtl']) [part='prefix'] {
|
|
269
|
-
margin-left: 0.25em;
|
|
270
|
-
margin-right: -0.25em;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
:host([dir='rtl']) [part='suffix'] {
|
|
274
|
-
margin-left: -0.25em;
|
|
275
|
-
margin-right: 0.25em;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
:host([dir='rtl'][theme~='icon']) [part='prefix'],
|
|
279
|
-
:host([dir='rtl'][theme~='icon']) [part='suffix'] {
|
|
280
|
-
margin-left: 0;
|
|
281
|
-
margin-right: 0;
|
|
282
|
-
}
|
|
283
|
-
`;
|
|
284
|
-
|
|
285
|
-
registerStyles('vaadin-button', button, { moduleId: 'lumo-button' });
|
|
286
|
-
|
|
287
|
-
export { button };
|
|
File without changes
|