@vaadin/radio-group 24.0.0-alpha10 → 24.0.0-alpha11

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