@vaadin/checkbox 23.2.12 → 23.2.13

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/checkbox",
3
- "version": "23.2.12",
3
+ "version": "23.2.13",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,11 +36,11 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/component-base": "~23.2.12",
40
- "@vaadin/field-base": "~23.2.12",
41
- "@vaadin/vaadin-lumo-styles": "~23.2.12",
42
- "@vaadin/vaadin-material-styles": "~23.2.12",
43
- "@vaadin/vaadin-themable-mixin": "~23.2.12"
39
+ "@vaadin/component-base": "~23.2.13",
40
+ "@vaadin/field-base": "~23.2.13",
41
+ "@vaadin/vaadin-lumo-styles": "~23.2.13",
42
+ "@vaadin/vaadin-material-styles": "~23.2.13",
43
+ "@vaadin/vaadin-themable-mixin": "~23.2.13"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@esm-bundle/chai": "^4.3.4",
@@ -51,5 +51,5 @@
51
51
  "web-types.json",
52
52
  "web-types.lit.json"
53
53
  ],
54
- "gitHead": "ab3cb30a6af93cb7ea2891ba1f688cb68d4cf928"
54
+ "gitHead": "0b8786d43b6b4e419d8482f29595719bf0c9e5e5"
55
55
  }
@@ -84,30 +84,41 @@ class Checkbox extends LabelMixin(
84
84
  align-items: baseline;
85
85
  }
86
86
 
87
- .vaadin-checkbox-wrapper {
88
- position: relative;
89
- height: 100%;
87
+ [part='checkbox'],
88
+ ::slotted(input),
89
+ ::slotted(label) {
90
+ grid-row: 1;
91
+ }
92
+
93
+ [part='checkbox'],
94
+ ::slotted(input) {
95
+ grid-column: 1;
96
+ }
97
+
98
+ [part='checkbox'] {
99
+ width: var(--vaadin-checkbox-size, 1em);
100
+ height: var(--vaadin-checkbox-size, 1em);
101
+ }
102
+
103
+ [part='checkbox']::before {
104
+ display: block;
105
+ content: '\\202F';
106
+ line-height: var(--vaadin-checkbox-size, 1em);
107
+ contain: paint;
90
108
  }
91
109
 
92
110
  /* visually hidden */
93
111
  ::slotted(input) {
94
- position: absolute;
95
- top: 0;
96
- left: 0;
97
- right: 0;
98
- width: 100%;
99
- height: 100%;
100
112
  opacity: 0;
101
113
  cursor: inherit;
102
114
  margin: 0;
115
+ align-self: stretch;
116
+ -webkit-appearance: none;
103
117
  }
104
118
  </style>
105
119
  <div class="vaadin-checkbox-container">
106
- <div class="vaadin-checkbox-wrapper">
107
- <div part="checkbox"></div>
108
- <slot name="input"></slot>
109
- </div>
110
-
120
+ <div part="checkbox"></div>
121
+ <slot name="input"></slot>
111
122
  <slot name="label"></slot>
112
123
 
113
124
  <div style="display: none !important">
@@ -22,23 +22,23 @@ registerStyles(
22
22
  user-select: none;
23
23
  cursor: default;
24
24
  outline: none;
25
+ --_checkbox-size: var(--vaadin-checkbox-size, calc(var(--lumo-size-m) / 2));
25
26
  }
26
27
 
27
28
  :host([has-label]) ::slotted(label) {
28
- padding: var(--lumo-space-xs) var(--lumo-space-s) var(--lumo-space-xs) var(--lumo-space-xs);
29
+ padding-block: var(--lumo-space-xs);
30
+ padding-inline: var(--lumo-space-xs) var(--lumo-space-s);
29
31
  }
30
32
 
31
33
  [part='checkbox'] {
32
- width: calc(var(--lumo-size-m) / 2);
33
- height: calc(var(--lumo-size-m) / 2);
34
+ width: var(--_checkbox-size);
35
+ height: var(--_checkbox-size);
34
36
  margin: var(--lumo-space-xs);
35
37
  position: relative;
36
38
  border-radius: var(--lumo-border-radius-s);
37
39
  background-color: var(--lumo-contrast-20pct);
38
40
  transition: transform 0.2s cubic-bezier(0.12, 0.32, 0.54, 2), background-color 0.15s;
39
- line-height: 1.2;
40
41
  cursor: var(--lumo-clickable-cursor);
41
- flex: none;
42
42
  }
43
43
 
44
44
  :host([indeterminate]) [part='checkbox'],
@@ -46,18 +46,13 @@ registerStyles(
46
46
  background-color: var(--lumo-primary-color);
47
47
  }
48
48
 
49
- /* Needed to align the checkbox nicely on the baseline */
50
- [part='checkbox']::before {
51
- content: '\\2003';
52
- }
53
-
54
49
  /* Checkmark */
55
50
  [part='checkbox']::after {
56
51
  pointer-events: none;
57
52
  font-family: 'lumo-icons';
58
53
  content: var(--lumo-icons-checkmark);
59
54
  color: var(--lumo-primary-contrast-color);
60
- font-size: calc(var(--lumo-size-m) / 2 + 2px);
55
+ font-size: calc(var(--_checkbox-size) + 2px);
61
56
  line-height: 1;
62
57
  position: absolute;
63
58
  top: -1px;
@@ -119,9 +114,9 @@ registerStyles(
119
114
  [part='checkbox']::before {
120
115
  pointer-events: none;
121
116
  color: transparent;
122
- display: inline-block;
123
117
  width: 100%;
124
118
  height: 100%;
119
+ line-height: var(--_checkbox-size);
125
120
  border-radius: inherit;
126
121
  background-color: inherit;
127
122
  transform: scale(1.4);
@@ -12,6 +12,7 @@ registerStyles(
12
12
  user-select: none;
13
13
  outline: none;
14
14
  -webkit-tap-highlight-color: transparent;
15
+ --_checkbox-size: var(--vaadin-checkbox-size, 16px);
15
16
  }
16
17
 
17
18
  :host([has-label]) ::slotted(label) {
@@ -19,25 +20,21 @@ registerStyles(
19
20
  }
20
21
 
21
22
  [part='checkbox'] {
22
- display: inline-block;
23
- width: 16px;
24
- height: 16px;
23
+ width: var(--_checkbox-size);
24
+ height: var(--_checkbox-size);
25
25
  margin: 4px;
26
26
  position: relative;
27
27
  border-radius: 2px;
28
28
  box-shadow: inset 0 0 0 2px var(--material-secondary-text-color);
29
- line-height: 1.275;
30
29
  background-color: transparent;
31
30
  }
32
31
 
33
32
  /* Used for the ripple */
34
33
  [part='checkbox']::before {
35
- /* Needed to align the checkbox nicely on the baseline */
36
- content: '\\2003';
37
34
  pointer-events: none;
38
- display: inline-block;
39
35
  width: 100%;
40
36
  height: 100%;
37
+ line-height: var(--_checkbox-size);
41
38
  border-radius: 50%;
42
39
  background-color: var(--material-disabled-text-color);
43
40
  transform: scale(0);
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/checkbox",
4
- "version": "23.2.12",
4
+ "version": "23.2.13",
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/checkbox",
4
- "version": "23.2.12",
4
+ "version": "23.2.13",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {