@vaadin/card 24.8.0-alpha9 → 25.0.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/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  A visual content container.
4
4
 
5
- > ⚠️ This component is experimental and the API may change. In order to use it, enable the feature flag by setting `window.Vaadin.featureFlags.cardComponent = true`.
6
-
7
5
  [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/components/card)
8
6
 
9
7
  [![npm version](https://badgen.net/npm/v/@vaadin/card)](https://www.npmjs.com/package/@vaadin/card)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/card",
3
- "version": "24.8.0-alpha9",
3
+ "version": "25.0.0-alpha2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,21 +34,20 @@
34
34
  "web-component"
35
35
  ],
36
36
  "dependencies": {
37
- "@vaadin/component-base": "24.8.0-alpha9",
38
- "@vaadin/vaadin-lumo-styles": "24.8.0-alpha9",
39
- "@vaadin/vaadin-material-styles": "24.8.0-alpha9",
40
- "@vaadin/vaadin-themable-mixin": "24.8.0-alpha9",
37
+ "@vaadin/component-base": "25.0.0-alpha2",
38
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha2",
39
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
41
40
  "lit": "^3.0.0"
42
41
  },
43
42
  "devDependencies": {
44
- "@vaadin/chai-plugins": "24.8.0-alpha9",
45
- "@vaadin/test-runner-commands": "24.8.0-alpha9",
46
- "@vaadin/testing-helpers": "^1.1.0",
43
+ "@vaadin/chai-plugins": "25.0.0-alpha2",
44
+ "@vaadin/test-runner-commands": "25.0.0-alpha2",
45
+ "@vaadin/testing-helpers": "^2.0.0",
47
46
  "sinon": "^18.0.0"
48
47
  },
49
48
  "web-types": [
50
49
  "web-types.json",
51
50
  "web-types.lit.json"
52
51
  ],
53
- "gitHead": "4de3809275ddfd733b0d13fd02af8faf73eb6770"
52
+ "gitHead": "67ffcd5355cf21ce1b5039c598525109fc4c164b"
54
53
  }
@@ -307,10 +307,6 @@ class Card extends ElementMixin(ThemableMixin(PolylitMixin(LitElement))) {
307
307
  };
308
308
  }
309
309
 
310
- static get experimental() {
311
- return true;
312
- }
313
-
314
310
  /** @protected */
315
311
  ready() {
316
312
  super.ready();
@@ -6,12 +6,13 @@ import { addGlobalThemeStyles, css, registerStyles } from '@vaadin/vaadin-themab
6
6
 
7
7
  const cardProps = css`
8
8
  html {
9
- --vaadin-card-background: var(--lumo-shade-5pct);
9
+ --vaadin-card-background: var(--lumo-contrast-5pct);
10
10
  --vaadin-card-border-radius: var(--lumo-border-radius-l);
11
11
  --vaadin-card-border-width: 0;
12
12
  --vaadin-card-border-color: var(--lumo-contrast-20pct);
13
13
  --vaadin-card-padding: var(--lumo-space-m);
14
14
  --vaadin-card-gap: var(--lumo-space-m);
15
+ --vaadin-card-shadow: none;
15
16
  }
16
17
  `;
17
18
 
@@ -21,7 +22,7 @@ const card = css`
21
22
  :host {
22
23
  background: var(--vaadin-card-background);
23
24
  border-radius: var(--vaadin-card-border-radius);
24
- box-shadow: var(--vaadin-card-box-shadow);
25
+ box-shadow: var(--vaadin-card-shadow);
25
26
  position: relative;
26
27
  }
27
28
 
@@ -29,28 +30,27 @@ const card = css`
29
30
  :host::before {
30
31
  content: '';
31
32
  position: absolute;
32
- inset: 0;
33
- pointer-events: none;
34
- border-radius: inherit;
33
+ inset: var(--_card-border-inset, 0);
34
+ border-radius: var(--_card-border-pseudo-radius, inherit);
35
35
  border: var(--vaadin-card-border, var(--vaadin-card-border-width) solid var(--vaadin-card-border-color));
36
+ pointer-events: none;
36
37
  }
37
38
 
38
39
  :host([theme~='outlined']) {
39
40
  --vaadin-card-border-width: 1px;
40
- --vaadin-card-background: transparent;
41
+ --vaadin-card-background: var(--lumo-base-color);
41
42
  }
42
43
 
43
44
  :host([theme~='elevated']) {
44
- --vaadin-card-background: var(--lumo-tint-10pct);
45
- --vaadin-card-box-shadow: var(--lumo-box-shadow-xs);
46
- /* TODO I would like to update --lumo-box-shadow-xs to this (30pct instead of 50pct): */
47
- --lumo-box-shadow-xs: 0 1px 4px -1px var(--lumo-shade-30pct);
45
+ --vaadin-card-background: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct)) var(--lumo-base-color);
46
+ --vaadin-card-shadow: var(--lumo-box-shadow-xs);
47
+ --vaadin-card-border-width: 1px;
48
+ --_card-border-inset: calc(-1 * var(--vaadin-card-border-width));
49
+ --_card-border-pseudo-radius: calc(var(--vaadin-card-border-radius) + var(--vaadin-card-border-width));
48
50
  }
49
51
 
50
- :host([theme~='elevated'][theme~='outlined']) {
51
- box-shadow:
52
- inset 0 -1px 0 0 var(--lumo-shade-10pct),
53
- var(--vaadin-card-box-shadow);
52
+ :host([theme~='elevated']:not([theme~='outlined'])) {
53
+ --vaadin-card-border-color: var(--lumo-contrast-10pct);
54
54
  }
55
55
 
56
56
  :host(:where([theme~='stretch-media'])) ::slotted([slot='media']:is(img, video, svg, vaadin-icon)) {
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/card",
4
- "version": "24.8.0-alpha9",
4
+ "version": "25.0.0-alpha2",
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/card",
4
- "version": "24.8.0-alpha9",
4
+ "version": "25.0.0-alpha2",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -1,5 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import '@vaadin/vaadin-material-styles/shadow.js';
3
- import '@vaadin/vaadin-material-styles/typography.js';
4
- declare const card: import("lit").CSSResult;
5
- export { card };
@@ -1,63 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import '@vaadin/vaadin-material-styles/shadow.js';
3
- import '@vaadin/vaadin-material-styles/typography.js';
4
- import { addGlobalThemeStyles, css, registerStyles } from '@vaadin/vaadin-themable-mixin/register-styles.js';
5
-
6
- const cardProps = css`
7
- html {
8
- --vaadin-card-background: var(--material-secondary-background-color);
9
- --vaadin-card-border-radius: 8px;
10
- --vaadin-card-border-width: 0;
11
- --vaadin-card-border-color: var(--material-divider-color);
12
- --vaadin-card-padding: 16px;
13
- --vaadin-card-gap: 16px;
14
- }
15
- `;
16
-
17
- addGlobalThemeStyles('card-props', cardProps);
18
-
19
- const card = css`
20
- :host {
21
- background: var(--vaadin-card-background);
22
- border-radius: var(--vaadin-card-border-radius);
23
- box-shadow: var(--vaadin-card-box-shadow);
24
- position: relative;
25
- }
26
-
27
- /* Could be an inset outline on the host as well, but rounded outlines only work since Safari 16.4 */
28
- :host::before {
29
- content: '';
30
- position: absolute;
31
- inset: 0;
32
- pointer-events: none;
33
- border-radius: inherit;
34
- border: var(--vaadin-card-border, var(--vaadin-card-border-width) solid var(--vaadin-card-border-color));
35
- }
36
-
37
- :host([theme~='outlined']) {
38
- --vaadin-card-border-width: 1px;
39
- --vaadin-card-background: transparent;
40
- }
41
-
42
- :host([theme~='elevated']) {
43
- --vaadin-card-background: var(--material-background-color);
44
- --vaadin-card-box-shadow: var(--material-shadow-elevation-2dp);
45
- }
46
-
47
- :host(:where([theme~='stretch-media'])) ::slotted([slot='media']:is(img, video, svg, vaadin-icon)) {
48
- border-radius: 4px;
49
- }
50
-
51
- ::slotted([slot='title']) {
52
- font-size: var(--material-h6-font-size);
53
- font-weight: 700;
54
- }
55
-
56
- ::slotted([slot='subtitle']) {
57
- color: var(--material-secondary-text-color);
58
- }
59
- `;
60
-
61
- registerStyles('vaadin-card', card, { moduleId: 'material-card' });
62
-
63
- export { card };
@@ -1,2 +0,0 @@
1
- import './vaadin-card-styles.js';
2
- import '../../src/vaadin-card.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-card-styles.js';
2
- import '../../src/vaadin-card.js';