@spectrum-web-components/card 1.0.0 → 1.1.0-beta.0
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 +95 -90
- package/package.json +54 -38
- package/sp-card.dev.js +5 -0
- package/sp-card.dev.js.map +7 -0
- package/sp-card.js +2 -14
- package/sp-card.js.map +7 -1
- package/src/Card.d.ts +27 -6
- package/src/Card.dev.js +303 -0
- package/src/Card.dev.js.map +7 -0
- package/src/Card.js +60 -206
- package/src/Card.js.map +7 -1
- package/src/card-overrides.css.d.ts +2 -0
- package/src/card-overrides.css.dev.js +7 -0
- package/src/card-overrides.css.dev.js.map +7 -0
- package/src/card-overrides.css.js +4 -0
- package/src/card-overrides.css.js.map +7 -0
- package/src/card.css.dev.js +7 -0
- package/src/card.css.dev.js.map +7 -0
- package/src/card.css.js +4 -21
- package/src/card.css.js.map +7 -1
- package/src/index.dev.js +3 -0
- package/src/index.dev.js.map +7 -0
- package/src/index.js +2 -13
- package/src/index.js.map +7 -1
- package/src/spectrum-card.css.dev.js +7 -0
- package/src/spectrum-card.css.dev.js.map +7 -0
- package/src/spectrum-card.css.js +4 -21
- package/src/spectrum-card.css.js.map +7 -1
- package/src/spectrum-config.js +54 -96
- package/stories/card.stories.js +385 -0
- package/stories/card.stories.js.map +7 -0
- package/stories/images.js +4 -0
- package/stories/images.js.map +7 -0
- package/test/benchmark/test-basic.js +16 -0
- package/test/benchmark/test-basic.js.map +7 -0
- package/test/card-memory.test.js +5 -0
- package/test/card-memory.test.js.map +7 -0
- package/test/card.test-vrt.js +5 -0
- package/test/card.test-vrt.js.map +7 -0
- package/test/card.test.js +353 -0
- package/test/card.test.js.map +7 -0
- package/CHANGELOG.md +0 -123
- package/custom-elements.json +0 -153
- package/src/Card.ts +0 -237
- package/src/card.css +0 -58
- package/src/card.css.ts +0 -20
- package/src/index.ts +0 -12
- package/src/spectrum-card.css +0 -812
- package/src/spectrum-card.css.ts +0 -20
- package/src/spectrum-vars.json +0 -52
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ image/caption pairs.
|
|
|
9
9
|
|
|
10
10
|
[](https://www.npmjs.com/package/@spectrum-web-components/card)
|
|
11
11
|
[](https://bundlephobia.com/result?p=@spectrum-web-components/card)
|
|
12
|
+
[](https://webcomponents.dev/edit/collection/fO75441E1Q5ZlI0e9pgq/0lwluuJO4nR1daE9dyRw/src/index.stories.js)
|
|
12
13
|
|
|
13
14
|
```
|
|
14
15
|
yarn add @spectrum-web-components/card
|
|
@@ -29,7 +30,7 @@ import { Card } from '@spectrum-web-components/card';
|
|
|
29
30
|
## Example
|
|
30
31
|
|
|
31
32
|
```html demo
|
|
32
|
-
<sp-card heading="Card Heading" subheading="JPG">
|
|
33
|
+
<sp-card heading="Card Heading" subheading="JPG Photo">
|
|
33
34
|
<img
|
|
34
35
|
slot="cover-photo"
|
|
35
36
|
src="https://picsum.photos/200/300"
|
|
@@ -39,18 +40,44 @@ import { Card } from '@spectrum-web-components/card';
|
|
|
39
40
|
</sp-card>
|
|
40
41
|
```
|
|
41
42
|
|
|
43
|
+
```html demo
|
|
44
|
+
<sp-card heading="Card Title" subheading="JPG">
|
|
45
|
+
<img slot="preview" src="https://picsum.photos/200/300" alt="Demo Image" />
|
|
46
|
+
<div slot="footer">Footer</div>
|
|
47
|
+
</sp-card>
|
|
48
|
+
```
|
|
49
|
+
|
|
42
50
|
## Heading
|
|
43
51
|
|
|
44
|
-
By default, the heading for an
|
|
52
|
+
By default, the heading for an `<sp-card>` is applied via the `heading` attribute, which is restricted to string content only. For HTML content, use the `heading` slot instead.
|
|
45
53
|
|
|
46
54
|
```html demo
|
|
47
|
-
<sp-card
|
|
55
|
+
<sp-card
|
|
56
|
+
subheading="JPG Photo"
|
|
57
|
+
style="--spectrum-card-body-header-height: auto;"
|
|
58
|
+
>
|
|
48
59
|
<h1 slot="heading">Card Heading</h1>
|
|
49
60
|
<img alt="" slot="cover-photo" src="https://picsum.photos/200/300" />
|
|
50
61
|
<div slot="footer">Footer</div>
|
|
51
62
|
</sp-card>
|
|
52
63
|
```
|
|
53
64
|
|
|
65
|
+
## Linking
|
|
66
|
+
|
|
67
|
+
An `<sp-card>` can be provided with an `href` attribute in order for it to act as one large anchor element. When leveraging the `href` attribute, the `download`, `target` and `rel` attributes customize the card's linking behavior. Use them as follows:
|
|
68
|
+
|
|
69
|
+
<!-- prettier-ignore -->
|
|
70
|
+
```html
|
|
71
|
+
<sp-card
|
|
72
|
+
heading="Card Title"
|
|
73
|
+
subheading="JPG"
|
|
74
|
+
href="https://opensource.adobe.com/spectrum-web-components"
|
|
75
|
+
target="_blank"
|
|
76
|
+
>
|
|
77
|
+
<img slot="cover-photo" src="https://picsum.photos/200/300" alt="Demo Image" />
|
|
78
|
+
</sp-card>
|
|
79
|
+
```
|
|
80
|
+
|
|
54
81
|
## Variants
|
|
55
82
|
|
|
56
83
|
There are multiple card variants to choose from in Spectrum. The `variant`
|
|
@@ -63,7 +90,7 @@ Normal cards can contain a heading, a subheading, a cover photo, and a footer.
|
|
|
63
90
|
```html
|
|
64
91
|
<sp-card heading="Card Heading">
|
|
65
92
|
<img alt="" slot="cover-photo" src="https://picsum.photos/200/300" />
|
|
66
|
-
<span slot="subheading">JPG</span>
|
|
93
|
+
<span slot="subheading">JPG photo</span>
|
|
67
94
|
<div slot="footer">Footer</div>
|
|
68
95
|
</sp-card>
|
|
69
96
|
```
|
|
@@ -73,45 +100,38 @@ Normal cards can contain a heading, a subheading, a cover photo, and a footer.
|
|
|
73
100
|
Cards can be supplied an `actions` via a names slot.
|
|
74
101
|
|
|
75
102
|
```html
|
|
76
|
-
<sp-card heading="Card Heading" subheading="JPG">
|
|
103
|
+
<sp-card heading="Card Heading" subheading="JPG Photo">
|
|
77
104
|
<img
|
|
78
105
|
slot="cover-photo"
|
|
79
106
|
src="https://picsum.photos/200/300"
|
|
80
107
|
alt="Demo Image"
|
|
81
108
|
/>
|
|
82
109
|
<div slot="footer">Footer</div>
|
|
83
|
-
<sp-action-menu
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
</sp-menu-item>
|
|
97
|
-
<sp-menu-divider></sp-menu-divider>
|
|
98
|
-
<sp-menu-item>
|
|
99
|
-
Save Selection
|
|
100
|
-
</sp-menu-item>
|
|
101
|
-
<sp-menu-item disabled>
|
|
102
|
-
Make Work Path
|
|
103
|
-
</sp-menu-item>
|
|
104
|
-
</sp-menu>
|
|
110
|
+
<sp-action-menu
|
|
111
|
+
label="More Actions"
|
|
112
|
+
slot="actions"
|
|
113
|
+
placement="bottom-end"
|
|
114
|
+
quiet
|
|
115
|
+
>
|
|
116
|
+
<sp-menu-item>Deselect</sp-menu-item>
|
|
117
|
+
<sp-menu-item>Select Inverse</sp-menu-item>
|
|
118
|
+
<sp-menu-item>Feather...</sp-menu-item>
|
|
119
|
+
<sp-menu-item>Select and Mask...</sp-menu-item>
|
|
120
|
+
<sp-menu-divider></sp-menu-divider>
|
|
121
|
+
<sp-menu-item>Save Selection</sp-menu-item>
|
|
122
|
+
<sp-menu-item disabled>Make Work Path</sp-menu-item>
|
|
105
123
|
</sp-action-menu>
|
|
106
124
|
</sp-card>
|
|
107
125
|
```
|
|
108
126
|
|
|
109
|
-
###
|
|
127
|
+
### No Preview Image
|
|
110
128
|
|
|
111
|
-
|
|
129
|
+
Cards with no preview image can contain a heading, a subheading, and a footer.
|
|
112
130
|
|
|
113
|
-
```html
|
|
114
|
-
<sp-card
|
|
131
|
+
```html demo
|
|
132
|
+
<sp-card heading="Card Title" subheading="No Preview Image">
|
|
133
|
+
<div slot="footer">Footer</div>
|
|
134
|
+
</sp-card>
|
|
115
135
|
```
|
|
116
136
|
|
|
117
137
|
### Quiet
|
|
@@ -120,7 +140,7 @@ Quiet cards can contain a heading, a subheading, a cover photo, a description, a
|
|
|
120
140
|
|
|
121
141
|
```html
|
|
122
142
|
<div style="width: 208px; height: 264px">
|
|
123
|
-
<sp-card variant="quiet" heading="Card Heading" subheading="JPG">
|
|
143
|
+
<sp-card variant="quiet" heading="Card Heading" subheading="JPG Photo">
|
|
124
144
|
<img alt="" slot="preview" src="https://picsum.photos/200/300" />
|
|
125
145
|
<div slot="description">10/15/18</div>
|
|
126
146
|
<div slot="footer">Footer</div>
|
|
@@ -135,7 +155,7 @@ When leveraging the `asset` attribute, a card can be declared as representing a
|
|
|
135
155
|
<sp-card
|
|
136
156
|
variant="quiet"
|
|
137
157
|
heading="Card Heading"
|
|
138
|
-
subheading="JPG"
|
|
158
|
+
subheading="JPG Photo"
|
|
139
159
|
asset="file"
|
|
140
160
|
>
|
|
141
161
|
<img alt="" slot="preview" src="https://picsum.photos/200/300" />
|
|
@@ -150,7 +170,7 @@ Or a `folder`:
|
|
|
150
170
|
|
|
151
171
|
```html
|
|
152
172
|
<div style="width: 208px; height: 264px">
|
|
153
|
-
<sp-card variant="quiet" subheading="JPG" asset="folder">
|
|
173
|
+
<sp-card variant="quiet" subheading="JPG Photo" asset="folder">
|
|
154
174
|
<img alt="" slot="preview" src="https://picsum.photos/200/300" />
|
|
155
175
|
<div slot="heading">Folder Name</div>
|
|
156
176
|
<div slot="description">10/15/18</div>
|
|
@@ -163,31 +183,22 @@ Quiet cards will also accept `actions` via a named slot.
|
|
|
163
183
|
|
|
164
184
|
```html
|
|
165
185
|
<div style="width: 208px; height: 264px">
|
|
166
|
-
<sp-card variant="quiet" heading="Card Heading" subheading="JPG">
|
|
186
|
+
<sp-card variant="quiet" heading="Card Heading" subheading="JPG Photo">
|
|
167
187
|
<img alt="" slot="preview" src="https://picsum.photos/200/300" />
|
|
168
188
|
<div slot="description">10/15/18</div>
|
|
169
|
-
<sp-action-menu
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
</sp-menu-item>
|
|
183
|
-
<sp-menu-divider></sp-menu-divider>
|
|
184
|
-
<sp-menu-item>
|
|
185
|
-
Save Selection
|
|
186
|
-
</sp-menu-item>
|
|
187
|
-
<sp-menu-item disabled>
|
|
188
|
-
Make Work Path
|
|
189
|
-
</sp-menu-item>
|
|
190
|
-
</sp-menu>
|
|
189
|
+
<sp-action-menu
|
|
190
|
+
label="More Actions"
|
|
191
|
+
slot="actions"
|
|
192
|
+
placement="bottom-end"
|
|
193
|
+
quiet
|
|
194
|
+
>
|
|
195
|
+
<sp-menu-item>Deselect</sp-menu-item>
|
|
196
|
+
<sp-menu-item>Select Inverse</sp-menu-item>
|
|
197
|
+
<sp-menu-item>Feather...</sp-menu-item>
|
|
198
|
+
<sp-menu-item>Select and Mask...</sp-menu-item>
|
|
199
|
+
<sp-menu-divider></sp-menu-divider>
|
|
200
|
+
<sp-menu-item>Save Selection</sp-menu-item>
|
|
201
|
+
<sp-menu-item disabled>Make Work Path</sp-menu-item>
|
|
191
202
|
</sp-action-menu>
|
|
192
203
|
</sp-card>
|
|
193
204
|
</div>
|
|
@@ -198,8 +209,8 @@ Quiet cards will also accept `actions` via a named slot.
|
|
|
198
209
|
Gallery cards can contain a heading, a subheading, an image preview, a description, and a footer.
|
|
199
210
|
|
|
200
211
|
```html
|
|
201
|
-
<div style="width: 532px; height: 224px">
|
|
202
|
-
<sp-card variant="gallery" heading="Card Heading" subheading="JPG">
|
|
212
|
+
<div style="width: 532px; max-width: 100%; height: 224px">
|
|
213
|
+
<sp-card variant="gallery" heading="Card Heading" subheading="JPG Photo">
|
|
203
214
|
<img alt="" slot="preview" src="https://picsum.photos/532/192" />
|
|
204
215
|
<div slot="description">10/15/18</div>
|
|
205
216
|
<div slot="footer">Footer</div>
|
|
@@ -207,13 +218,13 @@ Gallery cards can contain a heading, a subheading, an image preview, a descripti
|
|
|
207
218
|
</div>
|
|
208
219
|
```
|
|
209
220
|
|
|
210
|
-
###
|
|
221
|
+
### Size
|
|
211
222
|
|
|
212
|
-
|
|
223
|
+
`size="s"` will delivery the `<sp-card>` element at a "small" size. It can be leveraged with a standard card:
|
|
213
224
|
|
|
214
225
|
```html demo
|
|
215
226
|
<div style="width: 208px; height: 264px">
|
|
216
|
-
<sp-card
|
|
227
|
+
<sp-card size="s" heading="Card Heading" subheading="JPG Photo">
|
|
217
228
|
<img
|
|
218
229
|
slot="cover-photo"
|
|
219
230
|
alt="Demo Image"
|
|
@@ -227,10 +238,8 @@ The `small` attriibute can be applied to a standard card:
|
|
|
227
238
|
A `horizontal` card:
|
|
228
239
|
|
|
229
240
|
```html demo
|
|
230
|
-
<div
|
|
231
|
-
|
|
232
|
-
>
|
|
233
|
-
<sp-card small horizontal heading="Card Heading" subheading="JPG">
|
|
241
|
+
<div style="color: var(--spectrum-neutral-content-color-default);">
|
|
242
|
+
<sp-card size="s" horizontal heading="Card Heading" subheading="JPG Photo">
|
|
234
243
|
<sp-icon slot="preview" style="width: 36px; height: 36px;">
|
|
235
244
|
<svg
|
|
236
245
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -253,33 +262,29 @@ Or a `quiet` card:
|
|
|
253
262
|
|
|
254
263
|
```html demo
|
|
255
264
|
<div
|
|
256
|
-
style="color: var(--spectrum-
|
|
265
|
+
style="color: var(--spectrum-neutral-content-color-default); width: 110px;"
|
|
257
266
|
>
|
|
258
|
-
<sp-card
|
|
267
|
+
<sp-card
|
|
268
|
+
size="s"
|
|
269
|
+
heading="Card Heading"
|
|
270
|
+
subheading="JPG Photo"
|
|
271
|
+
variant="quiet"
|
|
272
|
+
>
|
|
259
273
|
<img src="https://picsum.photos/110" alt="Demo Image" slot="preview" />
|
|
260
274
|
<div slot="footer">Footer</div>
|
|
261
|
-
<sp-action-menu
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
</sp-menu-item>
|
|
275
|
-
<sp-menu-divider></sp-menu-divider>
|
|
276
|
-
<sp-menu-item>
|
|
277
|
-
Save Selection
|
|
278
|
-
</sp-menu-item>
|
|
279
|
-
<sp-menu-item disabled>
|
|
280
|
-
Make Work Path
|
|
281
|
-
</sp-menu-item>
|
|
282
|
-
</sp-menu>
|
|
275
|
+
<sp-action-menu
|
|
276
|
+
label="More Actions"
|
|
277
|
+
slot="actions"
|
|
278
|
+
placement="bottom-end"
|
|
279
|
+
quiet
|
|
280
|
+
>
|
|
281
|
+
<sp-menu-item>Deselect</sp-menu-item>
|
|
282
|
+
<sp-menu-item>Select Inverse</sp-menu-item>
|
|
283
|
+
<sp-menu-item>Feather...</sp-menu-item>
|
|
284
|
+
<sp-menu-item>Select and Mask...</sp-menu-item>
|
|
285
|
+
<sp-menu-divider></sp-menu-divider>
|
|
286
|
+
<sp-menu-item>Save Selection</sp-menu-item>
|
|
287
|
+
<sp-menu-item disabled>Make Work Path</sp-menu-item>
|
|
283
288
|
</sp-action-menu>
|
|
284
289
|
</sp-card>
|
|
285
290
|
</div>
|
package/package.json
CHANGED
|
@@ -1,63 +1,79 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/card",
|
|
3
|
+
"version": "1.1.0-beta.0",
|
|
3
4
|
"publishConfig": {
|
|
4
5
|
"access": "public"
|
|
5
6
|
},
|
|
7
|
+
"description": "",
|
|
8
|
+
"license": "Apache-2.0",
|
|
6
9
|
"repository": {
|
|
7
10
|
"type": "git",
|
|
8
11
|
"url": "https://github.com/adobe/spectrum-web-components.git",
|
|
9
12
|
"directory": "packages/card"
|
|
10
13
|
},
|
|
14
|
+
"author": "",
|
|
15
|
+
"homepage": "https://opensource.adobe.com/spectrum-web-components/components/card",
|
|
11
16
|
"bugs": {
|
|
12
17
|
"url": "https://github.com/adobe/spectrum-web-components/issues"
|
|
13
18
|
},
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"spectrum css",
|
|
17
|
-
"web components",
|
|
18
|
-
"lit-element",
|
|
19
|
-
"lit-html"
|
|
20
|
-
],
|
|
21
|
-
"version": "1.0.0",
|
|
22
|
-
"description": "",
|
|
23
|
-
"main": "src/index.js",
|
|
24
|
-
"module": "src/index.js",
|
|
19
|
+
"main": "./src/index.js",
|
|
20
|
+
"module": "./src/index.js",
|
|
25
21
|
"type": "module",
|
|
26
22
|
"exports": {
|
|
27
|
-
".":
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
".": {
|
|
24
|
+
"development": "./src/index.dev.js",
|
|
25
|
+
"default": "./src/index.js"
|
|
26
|
+
},
|
|
30
27
|
"./package.json": "./package.json",
|
|
31
|
-
"./
|
|
32
|
-
|
|
28
|
+
"./src/Card.js": {
|
|
29
|
+
"development": "./src/Card.dev.js",
|
|
30
|
+
"default": "./src/Card.js"
|
|
31
|
+
},
|
|
32
|
+
"./src/card-overrides.css.js": "./src/card-overrides.css.js",
|
|
33
|
+
"./src/card.css.js": "./src/card.css.js",
|
|
34
|
+
"./src/index.js": {
|
|
35
|
+
"development": "./src/index.dev.js",
|
|
36
|
+
"default": "./src/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./sp-card.js": {
|
|
39
|
+
"development": "./sp-card.dev.js",
|
|
40
|
+
"default": "./sp-card.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
|
|
33
45
|
},
|
|
34
46
|
"files": [
|
|
47
|
+
"**/*.d.ts",
|
|
48
|
+
"**/*.js",
|
|
49
|
+
"**/*.js.map",
|
|
35
50
|
"custom-elements.json",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"*.js.map",
|
|
39
|
-
"/src/"
|
|
51
|
+
"!stories/",
|
|
52
|
+
"!test/"
|
|
40
53
|
],
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
54
|
+
"keywords": [
|
|
55
|
+
"spectrum css",
|
|
56
|
+
"web components",
|
|
57
|
+
"lit-element",
|
|
58
|
+
"lit-html"
|
|
44
59
|
],
|
|
45
|
-
"
|
|
46
|
-
"
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@spectrum-web-components/asset": "^1.1.0-beta.0",
|
|
62
|
+
"@spectrum-web-components/base": "^1.1.0-beta.0",
|
|
63
|
+
"@spectrum-web-components/checkbox": "^1.1.0-beta.0",
|
|
64
|
+
"@spectrum-web-components/divider": "^1.1.0-beta.0",
|
|
65
|
+
"@spectrum-web-components/icons-workflow": "^1.1.0-beta.0",
|
|
66
|
+
"@spectrum-web-components/shared": "^1.1.0-beta.0",
|
|
67
|
+
"@spectrum-web-components/styles": "^1.1.0-beta.0"
|
|
47
68
|
},
|
|
48
|
-
"author": "",
|
|
49
|
-
"license": "Apache-2.0",
|
|
50
69
|
"devDependencies": {
|
|
51
|
-
"@spectrum-css/card": "^
|
|
52
|
-
},
|
|
53
|
-
"dependencies": {
|
|
54
|
-
"@spectrum-web-components/asset": "^0.1.5",
|
|
55
|
-
"@spectrum-web-components/base": "^0.1.3",
|
|
56
|
-
"@spectrum-web-components/checkbox": "^0.5.4",
|
|
57
|
-
"@spectrum-web-components/icons-workflow": "^0.3.6",
|
|
58
|
-
"@spectrum-web-components/quick-actions": "^0.1.3",
|
|
59
|
-
"@spectrum-web-components/shared": "^0.7.4",
|
|
60
|
-
"tslib": "^2.0.0"
|
|
70
|
+
"@spectrum-css/card": "^10.0.0-s2-foundations.20"
|
|
61
71
|
},
|
|
62
|
-
"
|
|
72
|
+
"types": "./src/index.d.ts",
|
|
73
|
+
"customElements": "custom-elements.json",
|
|
74
|
+
"sideEffects": [
|
|
75
|
+
"./sp-*.js",
|
|
76
|
+
"./**/*.dev.js"
|
|
77
|
+
],
|
|
78
|
+
"gitHead": "8840da116b3429f0b4de70ad7f690ae3de1c9448"
|
|
63
79
|
}
|
package/sp-card.dev.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-card.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Card } from './src/Card.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-card', Card);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-card': Card;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAE9B,cAAc,WAAW,IAAI;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/sp-card.js
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { Card } from './src/Card.js';
|
|
13
|
-
customElements.define('sp-card', Card);
|
|
14
|
-
//# sourceMappingURL=sp-card.js.map
|
|
1
|
+
"use strict";import{Card as e}from"./src/Card.js";import{defineElement as a}from"@spectrum-web-components/base/src/define-element.js";a("sp-card",e);
|
|
2
|
+
//# sourceMappingURL=sp-card.js.map
|
package/sp-card.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-card.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Card } from './src/Card.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-card', Card);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-card': Card;\n }\n}\n"],
|
|
5
|
+
"mappings": "aAYA,OAAS,QAAAA,MAAY,gBACrB,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,UAAWD,CAAI",
|
|
6
|
+
"names": ["Card", "defineElement"]
|
|
7
|
+
}
|
package/src/Card.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
|
2
2
|
import '@spectrum-web-components/asset/sp-asset.js';
|
|
3
3
|
import '@spectrum-web-components/checkbox/sp-checkbox.js';
|
|
4
|
-
import '@spectrum-web-components/
|
|
5
|
-
|
|
4
|
+
import '@spectrum-web-components/popover/sp-popover.js';
|
|
5
|
+
import '@spectrum-web-components/divider/sp-divider.js';
|
|
6
|
+
declare const Card_base: typeof SpectrumElement & {
|
|
7
|
+
new (...args: any[]): import("@spectrum-web-components/shared/src/observe-slot-presence.js").SlotPresenceObservingInterface;
|
|
8
|
+
prototype: import("@spectrum-web-components/shared/src/observe-slot-presence.js").SlotPresenceObservingInterface;
|
|
9
|
+
} & {
|
|
10
|
+
new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
|
|
11
|
+
prototype: import("@spectrum-web-components/base").SizedElementInterface;
|
|
12
|
+
} & {
|
|
13
|
+
new (...args: any[]): import("@spectrum-web-components/shared/src/like-anchor.js").LikeAnchorInterface;
|
|
14
|
+
prototype: import("@spectrum-web-components/shared/src/like-anchor.js").LikeAnchorInterface;
|
|
15
|
+
};
|
|
6
16
|
/**
|
|
7
17
|
* @element sp-card
|
|
8
18
|
*
|
|
@@ -19,22 +29,33 @@ export declare class Card extends Card_base {
|
|
|
19
29
|
static get styles(): CSSResultArray;
|
|
20
30
|
asset?: 'file' | 'folder';
|
|
21
31
|
variant: 'standard' | 'gallery' | 'quiet';
|
|
22
|
-
selected: boolean;
|
|
32
|
+
get selected(): boolean;
|
|
33
|
+
set selected(selected: boolean);
|
|
34
|
+
private _selected;
|
|
23
35
|
heading: string;
|
|
24
36
|
horizontal: boolean;
|
|
25
|
-
|
|
37
|
+
private likeAnchor?;
|
|
26
38
|
focused: boolean;
|
|
27
39
|
toggles: boolean;
|
|
40
|
+
value: string;
|
|
28
41
|
subheading: string;
|
|
29
|
-
|
|
42
|
+
protected get hasCoverPhoto(): boolean;
|
|
43
|
+
protected get hasPreview(): boolean;
|
|
44
|
+
click(): void;
|
|
30
45
|
private handleFocusin;
|
|
31
46
|
private handleFocusout;
|
|
32
47
|
private handleKeydown;
|
|
33
48
|
private handleSelectedChange;
|
|
34
49
|
toggleSelected(): void;
|
|
50
|
+
private announceChange;
|
|
51
|
+
private stopPropagationOnHref;
|
|
52
|
+
private handlePointerdown;
|
|
35
53
|
protected get renderHeading(): TemplateResult;
|
|
36
54
|
protected get renderPreviewImage(): TemplateResult;
|
|
55
|
+
protected get renderCoverImage(): TemplateResult;
|
|
56
|
+
protected get images(): TemplateResult[];
|
|
37
57
|
private renderImage;
|
|
58
|
+
private get renderSubtitleAndDescription();
|
|
38
59
|
protected render(): TemplateResult;
|
|
39
60
|
protected firstUpdated(changes: PropertyValues): void;
|
|
40
61
|
}
|