@vaadin/checkbox 25.0.0-alpha3 → 25.0.0-alpha5
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-checkbox-base-styles.js +35 -0
- package/src/styles/vaadin-checkbox-core-styles.d.ts +8 -0
- package/src/styles/vaadin-checkbox-core-styles.js +44 -0
- package/src/vaadin-checkbox.js +3 -2
- package/theme/lumo/vaadin-checkbox-styles.js +3 -2
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
- package/src/vaadin-checkbox-styles.js +0 -95
- /package/src/{vaadin-checkbox-styles.d.ts → styles/vaadin-checkbox-base-styles.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/checkbox",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha5",
|
|
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/field-base": "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-alpha5",
|
|
41
|
+
"@vaadin/component-base": "25.0.0-alpha5",
|
|
42
|
+
"@vaadin/field-base": "25.0.0-alpha5",
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha5",
|
|
44
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha5",
|
|
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-alpha5",
|
|
49
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha5",
|
|
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": "7dc87bb2a3cae81ed53259fa10b58f990d50c6fd"
|
|
56
58
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
import { checkable } from '@vaadin/field-base/src/styles/checkable-base-styles.js';
|
|
9
|
+
import { field } from '@vaadin/field-base/src/styles/field-base-styles.js';
|
|
10
|
+
|
|
11
|
+
const checkbox = css`
|
|
12
|
+
@layer base {
|
|
13
|
+
[part='checkbox']::after {
|
|
14
|
+
inset: 0;
|
|
15
|
+
mask-image: var(--_vaadin-icon-checkmark);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host([readonly]) {
|
|
19
|
+
--vaadin-checkbox-background: transparent;
|
|
20
|
+
--vaadin-checkbox-border-color: var(--_vaadin-border-color-strong);
|
|
21
|
+
--vaadin-checkbox-color: var(--_vaadin-color-strong);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([readonly]) [part='checkbox'] {
|
|
25
|
+
border-style: dashed;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([indeterminate]) [part='checkbox']::after {
|
|
29
|
+
inset: calc(var(--_border-width) * -1);
|
|
30
|
+
mask-image: var(--_vaadin-icon-minus);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
export const checkboxStyles = [field, checkable('checkbox'), checkbox];
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
import { checkable } from '@vaadin/field-base/src/styles/checkable-core-styles.js';
|
|
8
|
+
|
|
9
|
+
const checkbox = css`
|
|
10
|
+
[part='helper-text'],
|
|
11
|
+
[part='error-message'] {
|
|
12
|
+
grid-column: 2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host(:not([has-helper])) [part='helper-text'],
|
|
16
|
+
:host(:not([has-error-message])) [part='error-message'] {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (forced-colors: active) {
|
|
21
|
+
[part='checkbox'] {
|
|
22
|
+
outline: 1px solid;
|
|
23
|
+
outline-offset: -1px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([disabled]) [part='checkbox'],
|
|
27
|
+
:host([disabled]) [part='checkbox']::after {
|
|
28
|
+
outline-color: GrayText;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host(:is([checked], [indeterminate])) [part='checkbox']::after {
|
|
32
|
+
outline: 1px solid;
|
|
33
|
+
outline-offset: -1px;
|
|
34
|
+
border-radius: inherit;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host([focused]) [part='checkbox'],
|
|
38
|
+
:host([focused]) [part='checkbox']::after {
|
|
39
|
+
outline-width: 2px;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
export const checkboxStyles = [checkable('checkbox'), checkbox];
|
package/src/vaadin-checkbox.js
CHANGED
|
@@ -8,9 +8,10 @@ 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 { CSSInjectionMixin } from '@vaadin/vaadin-themable-mixin/css-injection-mixin.js';
|
|
11
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
import { checkboxStyles } from './styles/vaadin-checkbox-core-styles.js';
|
|
12
14
|
import { CheckboxMixin } from './vaadin-checkbox-mixin.js';
|
|
13
|
-
import { checkboxStyles } from './vaadin-checkbox-styles.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* `<vaadin-checkbox>` is an input field representing a binary choice.
|
|
@@ -59,7 +60,7 @@ import { checkboxStyles } from './vaadin-checkbox-styles.js';
|
|
|
59
60
|
* @mixes ThemableMixin
|
|
60
61
|
* @mixes ElementMixin
|
|
61
62
|
*/
|
|
62
|
-
export class Checkbox extends CheckboxMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
63
|
+
export class Checkbox extends CheckboxMixin(ElementMixin(ThemableMixin(CSSInjectionMixin(PolylitMixin(LitElement))))) {
|
|
63
64
|
static get is() {
|
|
64
65
|
return 'vaadin-checkbox';
|
|
65
66
|
}
|
|
@@ -250,12 +250,13 @@ registerStyles(
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
:host([invalid]) [part='checkbox'] {
|
|
253
|
-
background: var(--_invalid-background);
|
|
253
|
+
background-color: var(--_invalid-background);
|
|
254
254
|
background-image: linear-gradient(var(--_invalid-background) 0%, var(--_invalid-background) 100%);
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
:host([invalid]:hover) [part='checkbox'] {
|
|
258
|
-
background-image:
|
|
258
|
+
background-image:
|
|
259
|
+
linear-gradient(var(--_invalid-background) 0%, var(--_invalid-background) 100%),
|
|
259
260
|
linear-gradient(var(--_invalid-background) 0%, var(--_invalid-background) 100%);
|
|
260
261
|
}
|
|
261
262
|
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED
|
@@ -1,95 +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 '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
|
-
|
|
8
|
-
export const checkboxStyles = css`
|
|
9
|
-
:host {
|
|
10
|
-
display: inline-block;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
:host([hidden]) {
|
|
14
|
-
display: none !important;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:host([disabled]) {
|
|
18
|
-
-webkit-tap-highlight-color: transparent;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.vaadin-checkbox-container {
|
|
22
|
-
display: grid;
|
|
23
|
-
grid-template-columns: auto 1fr;
|
|
24
|
-
align-items: baseline;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
[part='checkbox'],
|
|
28
|
-
::slotted(input),
|
|
29
|
-
[part='label'] {
|
|
30
|
-
grid-row: 1;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
[part='checkbox'],
|
|
34
|
-
::slotted(input) {
|
|
35
|
-
grid-column: 1;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
[part='helper-text'],
|
|
39
|
-
[part='error-message'] {
|
|
40
|
-
grid-column: 2;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
:host(:not([has-helper])) [part='helper-text'],
|
|
44
|
-
:host(:not([has-error-message])) [part='error-message'] {
|
|
45
|
-
display: none;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
[part='checkbox'] {
|
|
49
|
-
width: var(--vaadin-checkbox-size, 1em);
|
|
50
|
-
height: var(--vaadin-checkbox-size, 1em);
|
|
51
|
-
--_input-border-width: var(--vaadin-input-field-border-width, 0);
|
|
52
|
-
--_input-border-color: var(--vaadin-input-field-border-color, transparent);
|
|
53
|
-
box-shadow: inset 0 0 0 var(--_input-border-width, 0) var(--_input-border-color);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
[part='checkbox']::before {
|
|
57
|
-
display: block;
|
|
58
|
-
content: '\\202F';
|
|
59
|
-
line-height: var(--vaadin-checkbox-size, 1em);
|
|
60
|
-
contain: paint;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/* visually hidden */
|
|
64
|
-
::slotted(input) {
|
|
65
|
-
cursor: inherit;
|
|
66
|
-
margin: 0;
|
|
67
|
-
align-self: stretch;
|
|
68
|
-
-webkit-appearance: none;
|
|
69
|
-
width: initial;
|
|
70
|
-
height: initial;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@media (forced-colors: active) {
|
|
74
|
-
[part='checkbox'] {
|
|
75
|
-
outline: 1px solid;
|
|
76
|
-
outline-offset: -1px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
:host([disabled]) [part='checkbox'],
|
|
80
|
-
:host([disabled]) [part='checkbox']::after {
|
|
81
|
-
outline-color: GrayText;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
:host(:is([checked], [indeterminate])) [part='checkbox']::after {
|
|
85
|
-
outline: 1px solid;
|
|
86
|
-
outline-offset: -1px;
|
|
87
|
-
border-radius: inherit;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
:host([focused]) [part='checkbox'],
|
|
91
|
-
:host([focused]) [part='checkbox']::after {
|
|
92
|
-
outline-width: 2px;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
`;
|
|
File without changes
|