@vaadin/field-base 25.4.0-alpha1 → 25.4.0-alpha2

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/field-base",
3
- "version": "25.4.0-alpha1",
3
+ "version": "25.4.0-alpha2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,17 +32,17 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@open-wc/dedupe-mixin": "^1.3.0",
35
- "@vaadin/a11y-base": "25.4.0-alpha1",
36
- "@vaadin/component-base": "25.4.0-alpha1",
35
+ "@vaadin/a11y-base": "25.4.0-alpha2",
36
+ "@vaadin/component-base": "25.4.0-alpha2",
37
37
  "lit": "^3.0.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@vaadin/chai-plugins": "25.4.0-alpha1",
41
- "@vaadin/input-container": "25.4.0-alpha1",
42
- "@vaadin/test-runner-commands": "25.4.0-alpha1",
40
+ "@vaadin/chai-plugins": "25.4.0-alpha2",
41
+ "@vaadin/input-container": "25.4.0-alpha2",
42
+ "@vaadin/test-runner-commands": "25.4.0-alpha2",
43
43
  "@vaadin/testing-helpers": "^2.0.0",
44
44
  "sinon": "^22.0.0"
45
45
  },
46
46
  "customElements": "custom-elements.json",
47
- "gitHead": "be38ec1866e96508f3f4591f95c949ef55903a34"
47
+ "gitHead": "213f8b55112558d2f976d8730fe44370ca868333"
48
48
  }
@@ -72,6 +72,7 @@ export const checkable = (part, propName = part) => css`
72
72
  margin: 0;
73
73
  padding: 0;
74
74
  border: 0;
75
+ height: auto;
75
76
  }
76
77
 
77
78
  /* visually hidden */
@@ -80,6 +81,9 @@ export const checkable = (part, propName = part) => css`
80
81
  align-self: stretch;
81
82
  appearance: none;
82
83
  cursor: var(--_cursor);
84
+ /* Override 16px from iOS UA stylesheet and CSS resets */
85
+ width: auto !important;
86
+ height: auto !important;
83
87
  /* Ensure minimum click target (WCAG) */
84
88
  margin: min(0px, (24px - 100%) / -2) !important;
85
89
  /* Extend the input to cover the gap between the checkbox/radio and label */
@@ -8,3 +8,5 @@ import type { CSSResult } from 'lit';
8
8
  export const field: CSSResult;
9
9
 
10
10
  export const fieldLabelAside: CSSResult;
11
+
12
+ export const fieldInputHeight: CSSResult;
@@ -17,6 +17,12 @@ export const field = css`
17
17
  --_rows-after-input: ;
18
18
  --_gap: var(--vaadin-input-field-container-gap, var(--vaadin-gap-xs));
19
19
  --_gap-s: round(var(--_gap) / 3, 2px);
20
+ /* Single-line input-field height, 1lh resolves on ::before */
21
+ --_field-input-default-height: calc(
22
+ 1lh + var(--vaadin-padding-block-container) * 2 + var(--vaadin-input-field-border-width, 1px) * 2
23
+ );
24
+ /* Input-field height mirrored by the baseline guide */
25
+ --_field-input-height: var(--_field-input-default-height);
20
26
  display: inline-grid;
21
27
  grid-template:
22
28
  ' label' auto
@@ -55,10 +61,16 @@ export const field = css`
55
61
 
56
62
  /* Baseline alignment guide */
57
63
  :host::before {
64
+ --_baseline-height: var(--vaadin-field-baseline-input-height, var(--_field-input-height));
58
65
  content: '\\2003' / '';
59
66
  grid-column: baseline;
60
67
  grid-row: 1 / baseline;
61
68
  align-self: end;
69
+ /* Center text like the input container */
70
+ display: flex;
71
+ align-items: center;
72
+ box-sizing: border-box;
73
+ height: var(--_baseline-height);
62
74
  font-size: var(--vaadin-input-field-value-font-size, inherit);
63
75
  line-height: var(--vaadin-input-field-value-line-height, inherit);
64
76
  padding: var(
@@ -67,13 +79,7 @@ export const field = css`
67
79
  );
68
80
  border: var(--vaadin-input-field-border-width, 1px) solid transparent;
69
81
  pointer-events: none;
70
- margin-bottom: calc(
71
- var(
72
- --vaadin-field-baseline-input-height,
73
- (1lh + var(--vaadin-padding-block-container) * 2 + var(--vaadin-input-field-border-width, 1px) * 2)
74
- ) *
75
- -1
76
- );
82
+ margin-bottom: calc(var(--_baseline-height) * -1);
77
83
  }
78
84
 
79
85
  [class$='container'] {
@@ -235,3 +241,9 @@ export const fieldLabelAside = css`
235
241
  align-self: baseline;
236
242
  }
237
243
  `;
244
+
245
+ export const fieldInputHeight = css`
246
+ :host {
247
+ --_field-input-height: max(var(--vaadin-input-field-height, 0px), var(--_field-input-default-height));
248
+ }
249
+ `;
@@ -4,6 +4,6 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { button } from './button-base-styles.js';
7
- import { field, fieldLabelAside } from './field-base-styles.js';
7
+ import { field, fieldInputHeight, fieldLabelAside } from './field-base-styles.js';
8
8
 
9
- export const inputFieldShared = [field, fieldLabelAside, button];
9
+ export const inputFieldShared = [field, fieldLabelAside, fieldInputHeight, button];