@vaadin/card 25.0.0-alpha9 → 25.0.0-beta1
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 +9 -11
- package/src/styles/vaadin-card-base-styles.js +7 -6
- package/src/vaadin-card.js +1 -1
- package/vaadin-card.js +1 -1
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
- package/src/styles/vaadin-card-core-styles.d.ts +0 -8
- package/src/styles/vaadin-card-core-styles.js +0 -228
- package/theme/lumo/vaadin-card-styles.d.ts +0 -6
- package/theme/lumo/vaadin-card-styles.js +0 -82
- package/theme/lumo/vaadin-card.d.ts +0 -2
- package/theme/lumo/vaadin-card.js +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/card",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,9 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
-
"!src/styles/*-base-styles.d.ts",
|
|
25
|
-
"!src/styles/*-base-styles.js",
|
|
26
|
-
"theme",
|
|
27
24
|
"vaadin-*.d.ts",
|
|
28
25
|
"vaadin-*.js",
|
|
29
26
|
"web-types.json",
|
|
@@ -36,20 +33,21 @@
|
|
|
36
33
|
"web-component"
|
|
37
34
|
],
|
|
38
35
|
"dependencies": {
|
|
39
|
-
"@vaadin/component-base": "25.0.0-
|
|
40
|
-
"@vaadin/vaadin-
|
|
41
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha9",
|
|
36
|
+
"@vaadin/component-base": "25.0.0-beta1",
|
|
37
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-beta1",
|
|
42
38
|
"lit": "^3.0.0"
|
|
43
39
|
},
|
|
44
40
|
"devDependencies": {
|
|
45
|
-
"@vaadin/
|
|
46
|
-
"@vaadin/
|
|
41
|
+
"@vaadin/avatar": "25.0.0-beta1",
|
|
42
|
+
"@vaadin/chai-plugins": "25.0.0-beta1",
|
|
43
|
+
"@vaadin/test-runner-commands": "25.0.0-beta1",
|
|
47
44
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
48
|
-
"
|
|
45
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-beta1",
|
|
46
|
+
"sinon": "^21.0.0"
|
|
49
47
|
},
|
|
50
48
|
"web-types": [
|
|
51
49
|
"web-types.json",
|
|
52
50
|
"web-types.lit.json"
|
|
53
51
|
],
|
|
54
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "1d20cf54e582d1f2e209126d4586f8b4c01c50e0"
|
|
55
53
|
}
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
* Copyright (c) 2024 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import '@vaadin/component-base/src/style-props.js';
|
|
6
|
+
import '@vaadin/component-base/src/styles/style-props.js';
|
|
7
7
|
import { css } from 'lit';
|
|
8
8
|
|
|
9
9
|
export const cardStyles = css`
|
|
10
10
|
:host {
|
|
11
11
|
--_content: 0;
|
|
12
12
|
--_footer: 0;
|
|
13
|
-
--_gap: var(--vaadin-card-gap, var(--vaadin-gap-
|
|
13
|
+
--_gap: var(--vaadin-card-gap, var(--vaadin-gap-m));
|
|
14
14
|
--_header: max(var(--_header-prefix), var(--_title), var(--_subtitle), var(--_header-suffix));
|
|
15
15
|
--_header-prefix: 0;
|
|
16
16
|
--_header-suffix: 0;
|
|
17
17
|
--_media: 0;
|
|
18
|
-
--_padding: var(--vaadin-card-padding, var(--vaadin-padding));
|
|
18
|
+
--_padding: var(--vaadin-card-padding, var(--vaadin-padding-m));
|
|
19
19
|
--_subtitle: 0;
|
|
20
20
|
--_title: 0;
|
|
21
21
|
background: var(--vaadin-card-background, var(--vaadin-background-container));
|
|
@@ -31,7 +31,8 @@ export const cardStyles = css`
|
|
|
31
31
|
|
|
32
32
|
/* Could be an inset outline on the host as well, but let's reserve that for a potential focus outline */
|
|
33
33
|
:host::before {
|
|
34
|
-
border: var(--vaadin-card-border-width, 0) solid
|
|
34
|
+
border: var(--vaadin-card-border-width, 0) solid
|
|
35
|
+
var(--vaadin-card-border-color, var(--vaadin-border-color-secondary));
|
|
35
36
|
border-radius: inherit;
|
|
36
37
|
content: '';
|
|
37
38
|
inset: 0;
|
|
@@ -133,7 +134,7 @@ export const cardStyles = css`
|
|
|
133
134
|
}
|
|
134
135
|
|
|
135
136
|
::slotted([slot='title']) {
|
|
136
|
-
color: var(--vaadin-card-title-color, var(--vaadin-color)) !important;
|
|
137
|
+
color: var(--vaadin-card-title-color, var(--vaadin-text-color)) !important;
|
|
137
138
|
font-size: var(--vaadin-card-title-font-size, inherit) !important;
|
|
138
139
|
font-weight: var(--vaadin-card-title-font-weight, 500) !important;
|
|
139
140
|
line-height: var(--vaadin-card-title-line-height, inherit) !important;
|
|
@@ -141,7 +142,7 @@ export const cardStyles = css`
|
|
|
141
142
|
}
|
|
142
143
|
|
|
143
144
|
::slotted([slot='subtitle']) {
|
|
144
|
-
color: var(--vaadin-card-subtitle-color, var(--vaadin-color-
|
|
145
|
+
color: var(--vaadin-card-subtitle-color, var(--vaadin-text-color-secondary)) !important;
|
|
145
146
|
font-size: var(--vaadin-card-subtitle-font-size, inherit) !important;
|
|
146
147
|
font-weight: var(--vaadin-card-subtitle-font-weight, 400) !important;
|
|
147
148
|
line-height: var(--vaadin-card-subtitle-line-height, inherit) !important;
|
package/src/vaadin-card.js
CHANGED
|
@@ -10,7 +10,7 @@ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
|
10
10
|
import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
|
|
11
11
|
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
-
import { cardStyles } from './styles/vaadin-card-
|
|
13
|
+
import { cardStyles } from './styles/vaadin-card-base-styles.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* `<vaadin-card>` is a versatile container for grouping related content and actions.
|
package/vaadin-card.js
CHANGED
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2024 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css } from 'lit';
|
|
7
|
-
|
|
8
|
-
export const cardStyles = css`
|
|
9
|
-
:host {
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
box-sizing: border-box;
|
|
13
|
-
padding: var(--_padding);
|
|
14
|
-
gap: var(--_gap);
|
|
15
|
-
--_padding: var(--vaadin-card-padding, 1em);
|
|
16
|
-
--_gap: var(--vaadin-card-gap, 1em);
|
|
17
|
-
--_media: 0;
|
|
18
|
-
--_title: 0;
|
|
19
|
-
--_subtitle: 0;
|
|
20
|
-
--_header: max(var(--_header-prefix), var(--_title), var(--_subtitle), var(--_header-suffix));
|
|
21
|
-
--_header-prefix: 0;
|
|
22
|
-
--_header-suffix: 0;
|
|
23
|
-
--_content: 0;
|
|
24
|
-
--_footer: 0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
:host([hidden]) {
|
|
28
|
-
display: none !important;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
:host(:not([theme~='horizontal'])) {
|
|
32
|
-
justify-content: space-between;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
:host([_m]) {
|
|
36
|
-
--_media: 1;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
:host([_t]) {
|
|
40
|
-
--_title: 1;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
:host([_st]) {
|
|
44
|
-
--_subtitle: 1;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
:host([_h]) {
|
|
48
|
-
--_header: 1;
|
|
49
|
-
--_title: 0;
|
|
50
|
-
--_subtitle: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
:host([_hp]) {
|
|
54
|
-
--_header-prefix: 1;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
:host([_hs]) {
|
|
58
|
-
--_header-suffix: 1;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
:host([_c]) {
|
|
62
|
-
--_content: 1;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
:host([_f]) {
|
|
66
|
-
--_footer: 1;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
[part='media'],
|
|
70
|
-
[part='header'],
|
|
71
|
-
[part='content'],
|
|
72
|
-
[part='footer'] {
|
|
73
|
-
display: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
:host([_m]) [part='media'],
|
|
77
|
-
:host([_c]) [part='content'] {
|
|
78
|
-
display: block;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
:host([_f]) [part='footer'] {
|
|
82
|
-
display: flex;
|
|
83
|
-
gap: var(--_gap);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
:host(:is([_h], [_t], [_st], [_hp], [_hs])) [part='header'] {
|
|
87
|
-
display: grid;
|
|
88
|
-
align-items: center;
|
|
89
|
-
gap: var(--_gap);
|
|
90
|
-
row-gap: 0;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
:host([_hs]) [part='header'] {
|
|
94
|
-
grid-template-columns: 1fr auto;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
:host([_hp]) [part='header'] {
|
|
98
|
-
grid-template-columns: repeat(var(--_header-prefix), auto) 1fr;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
slot {
|
|
102
|
-
border-radius: inherit;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
::slotted([slot='header-prefix']) {
|
|
106
|
-
grid-column: 1;
|
|
107
|
-
grid-row: 1 / span calc(var(--_title) + var(--_subtitle));
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
::slotted([slot='header']),
|
|
111
|
-
::slotted([slot='title']) {
|
|
112
|
-
grid-column: calc(1 + var(--_header-prefix));
|
|
113
|
-
grid-row: 1;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
::slotted([slot='subtitle']) {
|
|
117
|
-
grid-column: calc(1 + var(--_header-prefix));
|
|
118
|
-
grid-row: calc(1 + var(--_title));
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
::slotted([slot='header-suffix']) {
|
|
122
|
-
grid-column: calc(2 + var(--_header-prefix));
|
|
123
|
-
grid-row: 1 / span calc(var(--_title) + var(--_subtitle));
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/* Horizontal */
|
|
127
|
-
:host([theme~='horizontal']) {
|
|
128
|
-
display: grid;
|
|
129
|
-
grid-template-columns: repeat(var(--_media), minmax(auto, max-content)) 1fr;
|
|
130
|
-
align-items: start;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
:host([theme~='horizontal'][_f]) {
|
|
134
|
-
grid-template-rows: 1fr auto;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
:host([theme~='horizontal'][_c]) {
|
|
138
|
-
grid-template-rows: repeat(var(--_header), auto) 1fr;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
[part='media'] {
|
|
142
|
-
grid-column: 1;
|
|
143
|
-
grid-row: 1 / span calc(var(--_header) + var(--_content) + var(--_footer));
|
|
144
|
-
align-self: stretch;
|
|
145
|
-
border-radius: inherit;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
[part='header'] {
|
|
149
|
-
margin-bottom: auto;
|
|
150
|
-
grid-column: calc(1 + var(--_media));
|
|
151
|
-
grid-row: 1;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
[part='content'] {
|
|
155
|
-
grid-column: calc(1 + var(--_media));
|
|
156
|
-
grid-row: calc(1 + var(--_header));
|
|
157
|
-
flex: auto;
|
|
158
|
-
min-height: 0;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
[part='footer'] {
|
|
162
|
-
grid-column: calc(1 + var(--_media));
|
|
163
|
-
grid-row: calc(1 + var(--_header) + var(--_content));
|
|
164
|
-
border-radius: inherit;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
:host([theme~='horizontal']) [part='footer'] {
|
|
168
|
-
align-self: end;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
:host(:not([theme~='horizontal'])) ::slotted([slot='media']:is(img, video, svg)) {
|
|
172
|
-
max-width: 100%;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
::slotted([slot='media']) {
|
|
176
|
-
vertical-align: middle;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
:host(:is([theme~='cover-media'], [theme~='stretch-media']))
|
|
180
|
-
::slotted([slot='media']:is(img, video, svg, vaadin-icon)) {
|
|
181
|
-
width: 100%;
|
|
182
|
-
height: auto;
|
|
183
|
-
aspect-ratio: var(--vaadin-card-media-aspect-ratio, 16/9);
|
|
184
|
-
object-fit: cover;
|
|
185
|
-
/* Fixes an issue where an icon overflows the card boundaries on Firefox: https://github.com/vaadin/web-components/issues/8641 */
|
|
186
|
-
overflow: hidden;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
:host([theme~='horizontal']:is([theme~='cover-media'], [theme~='stretch-media'])) {
|
|
190
|
-
grid-template-columns: repeat(var(--_media), minmax(auto, 0.5fr)) 1fr;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
:host([theme~='horizontal']:is([theme~='cover-media'], [theme~='stretch-media']))
|
|
194
|
-
::slotted([slot='media']:is(img, video, svg, vaadin-icon)) {
|
|
195
|
-
height: 100%;
|
|
196
|
-
aspect-ratio: auto;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
:host([theme~='cover-media']) ::slotted([slot='media']:is(img, video, svg, vaadin-icon)) {
|
|
200
|
-
margin-top: calc(var(--_padding) * -1);
|
|
201
|
-
margin-inline: calc(var(--_padding) * -1);
|
|
202
|
-
width: calc(100% + var(--_padding) * 2);
|
|
203
|
-
max-width: none;
|
|
204
|
-
border-radius: inherit;
|
|
205
|
-
border-end-end-radius: 0;
|
|
206
|
-
border-end-start-radius: 0;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
:host([theme~='horizontal'][theme~='cover-media']) ::slotted([slot='media']:is(img, video, svg, vaadin-icon)) {
|
|
210
|
-
margin-inline-end: 0;
|
|
211
|
-
width: calc(100% + var(--_padding));
|
|
212
|
-
height: calc(100% + var(--_padding) * 2);
|
|
213
|
-
border-radius: inherit;
|
|
214
|
-
border-start-end-radius: 0;
|
|
215
|
-
border-end-end-radius: 0;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/* Scroller in content */
|
|
219
|
-
[part='content'] ::slotted(vaadin-scroller) {
|
|
220
|
-
margin-inline: calc(var(--_padding) * -1);
|
|
221
|
-
padding-inline: var(--_padding);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
[part='content'] ::slotted(vaadin-scroller)::before,
|
|
225
|
-
[part='content'] ::slotted(vaadin-scroller)::after {
|
|
226
|
-
margin-inline: calc(var(--_padding) * -1);
|
|
227
|
-
}
|
|
228
|
-
`;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
2
|
-
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
3
|
-
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
4
|
-
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
5
|
-
import { addGlobalThemeStyles, css, registerStyles } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
6
|
-
|
|
7
|
-
const cardProps = css`
|
|
8
|
-
html {
|
|
9
|
-
--vaadin-card-background: var(--lumo-contrast-5pct);
|
|
10
|
-
--vaadin-card-border-radius: var(--lumo-border-radius-l);
|
|
11
|
-
--vaadin-card-border-width: 0;
|
|
12
|
-
--vaadin-card-border-color: var(--lumo-contrast-20pct);
|
|
13
|
-
--vaadin-card-padding: var(--lumo-space-m);
|
|
14
|
-
--vaadin-card-gap: var(--lumo-space-m);
|
|
15
|
-
--vaadin-card-shadow: none;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
addGlobalThemeStyles('card-props', cardProps);
|
|
20
|
-
|
|
21
|
-
const card = css`
|
|
22
|
-
:host {
|
|
23
|
-
background: var(--vaadin-card-background);
|
|
24
|
-
border-radius: var(--vaadin-card-border-radius);
|
|
25
|
-
box-shadow: var(--vaadin-card-shadow);
|
|
26
|
-
position: relative;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/* Could be an inset outline on the host as well, but rounded outlines only work since Safari 16.4 */
|
|
30
|
-
:host::before {
|
|
31
|
-
content: '';
|
|
32
|
-
position: absolute;
|
|
33
|
-
inset: var(--_card-border-inset, 0);
|
|
34
|
-
border-radius: var(--_card-border-pseudo-radius, inherit);
|
|
35
|
-
border: var(--vaadin-card-border, var(--vaadin-card-border-width) solid var(--vaadin-card-border-color));
|
|
36
|
-
pointer-events: none;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
:host([theme~='outlined']) {
|
|
40
|
-
--vaadin-card-border-width: 1px;
|
|
41
|
-
--vaadin-card-background: var(--lumo-base-color);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
:host([theme~='elevated']) {
|
|
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));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
:host([theme~='elevated']:not([theme~='outlined'])) {
|
|
53
|
-
--vaadin-card-border-color: var(--lumo-contrast-10pct);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
:host(:where([theme~='stretch-media'])) ::slotted([slot='media']:is(img, video, svg, vaadin-icon)) {
|
|
57
|
-
border-radius: var(--lumo-border-radius-m);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
:host([theme~='elevated'][theme~='cover-media']) ::slotted([slot='media']:is(img, video, svg, vaadin-icon)) {
|
|
61
|
-
margin-top: calc((var(--_padding) + var(--vaadin-card-border-width)) * -1);
|
|
62
|
-
margin-inline: calc((var(--_padding) + var(--vaadin-card-border-width)) * -1);
|
|
63
|
-
width: calc(100% + (var(--_padding) + var(--vaadin-card-border-width)) * 2);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
::slotted([slot='title']) {
|
|
67
|
-
font-size: var(--lumo-font-size-l);
|
|
68
|
-
line-height: var(--lumo-line-height-xs);
|
|
69
|
-
font-weight: 600;
|
|
70
|
-
color: var(--lumo-header-text-color);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
::slotted([slot='subtitle']) {
|
|
74
|
-
font-size: var(--lumo-font-size-m);
|
|
75
|
-
line-height: var(--lumo-line-height-xs);
|
|
76
|
-
color: var(--lumo-secondary-text-color);
|
|
77
|
-
}
|
|
78
|
-
`;
|
|
79
|
-
|
|
80
|
-
registerStyles('vaadin-card', card, { moduleId: 'lumo-card' });
|
|
81
|
-
|
|
82
|
-
export { card };
|