@vaadin/component-base 25.0.0-beta4 → 25.0.0-beta5

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/component-base",
3
- "version": "25.0.0-beta4",
3
+ "version": "25.0.0-beta5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -33,15 +33,15 @@
33
33
  "dependencies": {
34
34
  "@open-wc/dedupe-mixin": "^1.3.0",
35
35
  "@vaadin/vaadin-development-mode-detector": "^2.0.0",
36
- "@vaadin/vaadin-themable-mixin": "25.0.0-beta4",
36
+ "@vaadin/vaadin-themable-mixin": "25.0.0-beta5",
37
37
  "@vaadin/vaadin-usage-statistics": "^2.1.0",
38
38
  "lit": "^3.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@vaadin/chai-plugins": "25.0.0-beta4",
42
- "@vaadin/test-runner-commands": "25.0.0-beta4",
41
+ "@vaadin/chai-plugins": "25.0.0-beta5",
42
+ "@vaadin/test-runner-commands": "25.0.0-beta5",
43
43
  "@vaadin/testing-helpers": "^2.0.0",
44
44
  "sinon": "^21.0.0"
45
45
  },
46
- "gitHead": "707c30af7ed0afacc13c0afb27d047b043160d1f"
46
+ "gitHead": "ba59e1404cc4bef2dd685476247f758eb28c9922"
47
47
  }
package/src/define.js CHANGED
@@ -13,7 +13,7 @@ function dashToCamelCase(dash) {
13
13
 
14
14
  const experimentalMap = {};
15
15
 
16
- export function defineCustomElement(CustomElement, version = '25.0.0-beta4') {
16
+ export function defineCustomElement(CustomElement, version = '25.0.0-beta5') {
17
17
  Object.defineProperty(CustomElement, 'version', {
18
18
  get() {
19
19
  return version;
@@ -129,6 +129,10 @@ export class SlotController extends EventTarget {
129
129
  getSlotChildren() {
130
130
  const { slotName } = this;
131
131
  return Array.from(this.host.childNodes).filter((node) => {
132
+ // Ignore nodes with data-slot-ignore attribute
133
+ if (node.nodeType === Node.ELEMENT_NODE && node.hasAttribute('data-slot-ignore')) {
134
+ return false;
135
+ }
132
136
  // Either an element (any slot) or a text node (only un-named slot).
133
137
  return (
134
138
  (node.nodeType === Node.ELEMENT_NODE && node.slot === slotName) ||
@@ -203,7 +207,13 @@ export class SlotController extends EventTarget {
203
207
 
204
208
  // Calling `slot.assignedNodes()` includes whitespace text nodes in case of default slot:
205
209
  // unlike comment nodes, they are not filtered out. So we need to manually ignore them.
206
- const newNodes = addedNodes.filter((node) => !isEmptyTextNode(node) && !current.includes(node));
210
+ // Also ignore nodes with data-slot-ignore attribute.
211
+ const newNodes = addedNodes.filter(
212
+ (node) =>
213
+ !isEmptyTextNode(node) &&
214
+ !current.includes(node) &&
215
+ !(node.nodeType === Node.ELEMENT_NODE && node.hasAttribute('data-slot-ignore')),
216
+ );
207
217
 
208
218
  if (removedNodes.length) {
209
219
  this.nodes = current.filter((node) => !removedNodes.includes(node));
@@ -6,6 +6,28 @@
6
6
  import { css } from 'lit';
7
7
  import { addGlobalThemeStyles } from '@vaadin/vaadin-themable-mixin/register-styles.js';
8
8
 
9
+ // NOTE: Base color CSS custom properties are explicitly registered as `<color>`
10
+ // here to avoid performance issues in Aura. Aura overrides these properties with
11
+ // values that use complex, nested relative color functions, and without explicit
12
+ // typing, Chrome 142 was found to render components that use them roughly 40% slower.
13
+ [
14
+ '--vaadin-text-color',
15
+ '--vaadin-text-color-disabled',
16
+ '--vaadin-text-color-secondary',
17
+ '--vaadin-border-color',
18
+ '--vaadin-border-color-secondary',
19
+ '--vaadin-background-color',
20
+ ].forEach((propertyName) => {
21
+ CSS.registerProperty({
22
+ name: propertyName,
23
+ syntax: '<color>',
24
+ inherits: true,
25
+ // Use this initial value so the color stays visible when the property
26
+ // is set to an invalid value to make debugging a bit easier.
27
+ initialValue: 'light-dark(black, white)',
28
+ });
29
+ });
30
+
9
31
  addGlobalThemeStyles(
10
32
  'vaadin-base',
11
33
  css`
@@ -40,7 +62,8 @@ addGlobalThemeStyles(
40
62
  --vaadin-padding-m: 12px;
41
63
  --vaadin-padding-l: 16px;
42
64
  --vaadin-padding-xl: 24px;
43
- --vaadin-padding-container: var(--vaadin-padding-xs) var(--vaadin-padding-s);
65
+ --vaadin-padding-block-container: var(--vaadin-padding-xs);
66
+ --vaadin-padding-inline-container: var(--vaadin-padding-s);
44
67
 
45
68
  /* Gap/spacing */
46
69
  --vaadin-gap-xs: 6px;
@@ -89,6 +112,18 @@ addGlobalThemeStyles(
89
112
  /* Cursors for interactive elements */
90
113
  --vaadin-clickable-cursor: pointer;
91
114
  --vaadin-disabled-cursor: not-allowed;
115
+
116
+ /* Use units so that the values can be used in calc() */
117
+ --safe-area-inset-top: env(safe-area-inset-top, 0px);
118
+ --safe-area-inset-right: env(safe-area-inset-right, 0px);
119
+ --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
120
+ --safe-area-inset-left: env(safe-area-inset-left, 0px);
121
+ }
122
+
123
+ @supports not (color: hsl(0 0 0)) {
124
+ :where(html) {
125
+ --_vaadin-safari-17-deg: 1deg;
126
+ }
92
127
  }
93
128
 
94
129
  @media (forced-colors: active) {
@@ -16,44 +16,37 @@ addGlobalThemeStyles(
16
16
  --vaadin-user-color-0: var(--vaadin-user-color, oklch(0.52 0.2 240));
17
17
  --vaadin-user-color-1: oklch(
18
18
  from var(--vaadin-user-color-0) calc(0.62 + clamp(-0.15, (0.6201 - l) * 10000, 0.15)) c
19
- calc(h - var(--_hue-step) * 2 * var(---_vaadin-safari-17-deg, 1))
19
+ calc(h - var(--_hue-step) * 2 * var(--_vaadin-safari-17-deg, 1))
20
20
  );
21
21
  --vaadin-user-color-2: oklch(
22
- from var(--vaadin-user-color-0) l c calc(h - var(--_hue-step) * -2 * var(---_vaadin-safari-17-deg, 1))
22
+ from var(--vaadin-user-color-0) l c calc(h - var(--_hue-step) * -2 * var(--_vaadin-safari-17-deg, 1))
23
23
  );
24
24
  --vaadin-user-color-3: oklch(
25
25
  from var(--vaadin-user-color-0) calc(0.62 + clamp(-0.15, (0.6201 - l) * 10000, 0.15)) c
26
- calc(h - var(--_hue-step) * 0 * var(---_vaadin-safari-17-deg, 1))
26
+ calc(h - var(--_hue-step) * 0 * var(--_vaadin-safari-17-deg, 1))
27
27
  );
28
28
  --vaadin-user-color-4: oklch(
29
- from var(--vaadin-user-color-0) l c calc(h - var(--_hue-step) * 2 * var(---_vaadin-safari-17-deg, 1))
29
+ from var(--vaadin-user-color-0) l c calc(h - var(--_hue-step) * 2 * var(--_vaadin-safari-17-deg, 1))
30
30
  );
31
31
  --vaadin-user-color-5: oklch(
32
32
  from var(--vaadin-user-color-0) calc(0.62 + clamp(-0.15, (0.6201 - l) * 10000, 0.15)) c
33
- calc(h - var(--_hue-step) * -2 * var(---_vaadin-safari-17-deg, 1))
33
+ calc(h - var(--_hue-step) * -2 * var(--_vaadin-safari-17-deg, 1))
34
34
  );
35
35
  --vaadin-user-color-6: oklch(
36
- from var(--vaadin-user-color-0) l c calc(h - var(--_hue-step) * -4 * var(---_vaadin-safari-17-deg, 1))
36
+ from var(--vaadin-user-color-0) l c calc(h - var(--_hue-step) * -4 * var(--_vaadin-safari-17-deg, 1))
37
37
  );
38
38
  --vaadin-user-color-7: oklch(
39
39
  from var(--vaadin-user-color-0) calc(0.62 + clamp(-0.15, (0.6201 - l) * 10000, 0.15)) c
40
- calc(h - var(--_hue-step) * 4 * var(---_vaadin-safari-17-deg, 1))
40
+ calc(h - var(--_hue-step) * 4 * var(--_vaadin-safari-17-deg, 1))
41
41
  );
42
42
  --vaadin-user-color-8: oklch(
43
- from var(--vaadin-user-color-0) l c calc(h - var(--_hue-step) * 4 * var(---_vaadin-safari-17-deg, 1))
43
+ from var(--vaadin-user-color-0) l c calc(h - var(--_hue-step) * 4 * var(--_vaadin-safari-17-deg, 1))
44
44
  );
45
45
  --vaadin-user-color-9: oklch(
46
46
  from var(--vaadin-user-color-0) calc(0.62 + clamp(-0.15, (0.6201 - l) * 10000, 0.15)) c
47
- calc(h - var(--_hue-step) * 6 * var(---_vaadin-safari-17-deg, 1))
47
+ calc(h - var(--_hue-step) * 6 * var(--_vaadin-safari-17-deg, 1))
48
48
  );
49
49
  }
50
-
51
- @supports not (color: hsl(0 0 0)) {
52
- :where(:root),
53
- :where(:host) {
54
- ---_vaadin-safari-17-deg: 1deg;
55
- }
56
- }
57
50
  }
58
51
  `,
59
52
  );