@spectrum-web-components/card 1.3.0-beta.2 → 1.3.0-testing.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/card",
3
- "version": "1.3.0-beta.2",
3
+ "version": "1.3.0-testing.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -58,13 +58,13 @@
58
58
  "lit-html"
59
59
  ],
60
60
  "dependencies": {
61
- "@spectrum-web-components/asset": "^1.3.0-beta.2",
62
- "@spectrum-web-components/base": "^1.3.0-beta.2",
63
- "@spectrum-web-components/checkbox": "^1.3.0-beta.2",
64
- "@spectrum-web-components/divider": "^1.3.0-beta.2",
65
- "@spectrum-web-components/icons-workflow": "^1.3.0-beta.2",
66
- "@spectrum-web-components/shared": "^1.3.0-beta.2",
67
- "@spectrum-web-components/styles": "^1.3.0-beta.2"
61
+ "@spectrum-web-components/asset": "^1.3.0-testing.0",
62
+ "@spectrum-web-components/base": "^1.3.0-testing.0",
63
+ "@spectrum-web-components/checkbox": "^1.3.0-testing.0",
64
+ "@spectrum-web-components/divider": "^1.3.0-testing.0",
65
+ "@spectrum-web-components/icons-workflow": "^1.3.0-testing.0",
66
+ "@spectrum-web-components/shared": "^1.3.0-testing.0",
67
+ "@spectrum-web-components/styles": "^1.3.0-testing.0"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@spectrum-css/card": "10.0.0-s2-foundations.20"
@@ -74,6 +74,5 @@
74
74
  "sideEffects": [
75
75
  "./sp-*.js",
76
76
  "./**/*.dev.js"
77
- ],
78
- "gitHead": "98f10907cae715b337db287dc3e661c0c8385e9b"
77
+ ]
79
78
  }
package/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
@@ -1,385 +0,0 @@
1
- "use strict";
2
- import { html } from "@spectrum-web-components/base";
3
- import "@spectrum-web-components/card/sp-card.js";
4
- import { landscape, portrait } from "./images";
5
- import "@spectrum-web-components/icons-workflow/icons/sp-icon-file-txt.js";
6
- import "@spectrum-web-components/textfield/sp-textfield.js";
7
- import "@spectrum-web-components/action-menu/sp-action-menu.js";
8
- import "@spectrum-web-components/menu/sp-menu.js";
9
- import "@spectrum-web-components/menu/sp-menu-item.js";
10
- import "@spectrum-web-components/menu/sp-menu-divider.js";
11
- import "@spectrum-web-components/link/sp-link.js";
12
- export default {
13
- component: "sp-card",
14
- title: "Card",
15
- args: {
16
- horizontal: false
17
- },
18
- argTypes: {
19
- horizontal: {
20
- name: "horizontal",
21
- type: { name: "boolean", required: false },
22
- table: {
23
- type: { summary: "boolean" },
24
- defaultValue: { summary: false }
25
- },
26
- control: {
27
- type: "boolean"
28
- }
29
- }
30
- }
31
- };
32
- export const Default = (args) => {
33
- return html`
34
- <sp-card
35
- heading="Card Heading"
36
- subheading="JPG"
37
- ?horizontal=${args.horizontal}
38
- style="width: 200px;"
39
- >
40
- <img slot="cover-photo" src=${portrait} alt="Demo Graphic" />
41
- <div slot="footer">Footer</div>
42
- </sp-card>
43
- `;
44
- };
45
- Default.args = {};
46
- export const SmallQuiet = (args) => {
47
- const { onClick } = args;
48
- return html`
49
- <sp-card
50
- heading="Card Heading"
51
- subheading="JPG"
52
- toggles
53
- ?horizontal=${args.horizontal}
54
- style="width: 200px;"
55
- href="https://opensource.adobe.com/spectrum-web-components"
56
- variant="quiet"
57
- size="s"
58
- toggles
59
- @click=${(event) => {
60
- const composedTarget = event.composedPath()[0];
61
- if (composedTarget.id !== "like-anchor") return;
62
- event.stopPropagation();
63
- event.preventDefault();
64
- onClick && onClick(event);
65
- }}
66
- >
67
- <div slot="footer">
68
- Footer with a
69
- <sp-link href="https://google.com">link to Google</sp-link>
70
- </div>
71
- <sp-action-menu
72
- label="More Actions"
73
- slot="actions"
74
- placement="bottom-end"
75
- quiet
76
- >
77
- <sp-menu-item>Deselect</sp-menu-item>
78
- <sp-menu-item>Select Inverse</sp-menu-item>
79
- <sp-menu-item>Feather...</sp-menu-item>
80
- <sp-menu-item>Select and Mask...</sp-menu-item>
81
- <sp-menu-divider></sp-menu-divider>
82
- <sp-menu-item>Save Selection</sp-menu-item>
83
- <sp-menu-item disabled>Make Work Path</sp-menu-item>
84
- </sp-action-menu>
85
- <img slot="cover-photo" src=${portrait} alt="Demo Graphic" />
86
- </sp-card>
87
- `;
88
- };
89
- SmallQuiet.argTypes = {
90
- onClick: { action: "link click" }
91
- };
92
- export const href = (args) => {
93
- const { onClick } = args;
94
- return html`
95
- <sp-card
96
- heading="Card Heading"
97
- subheading="JPG"
98
- toggles
99
- ?horizontal=${args.horizontal}
100
- style="width: 200px;"
101
- href="https://opensource.adobe.com/spectrum-web-components"
102
- @click=${(event) => {
103
- const composedTarget = event.composedPath()[0];
104
- if (composedTarget.id !== "like-anchor") return;
105
- event.stopPropagation();
106
- event.preventDefault();
107
- onClick && onClick(event);
108
- }}
109
- >
110
- <div slot="footer">
111
- Footer with a
112
- <sp-link href="https://google.com">link to Google</sp-link>
113
- </div>
114
- <sp-action-menu
115
- label="More Actions"
116
- slot="actions"
117
- placement="bottom-end"
118
- quiet
119
- >
120
- <sp-menu-item>Deselect</sp-menu-item>
121
- <sp-menu-item>Select Inverse</sp-menu-item>
122
- <sp-menu-item>Feather...</sp-menu-item>
123
- <sp-menu-item>Select and Mask...</sp-menu-item>
124
- <sp-menu-divider></sp-menu-divider>
125
- <sp-menu-item>Save Selection</sp-menu-item>
126
- <sp-menu-item disabled>Make Work Path</sp-menu-item>
127
- </sp-action-menu>
128
- <img slot="cover-photo" src=${portrait} alt="Demo Graphic" />
129
- </sp-card>
130
- `;
131
- };
132
- href.argTypes = {
133
- onClick: { action: "link click" }
134
- };
135
- export const actions = (args) => {
136
- return html`
137
- <sp-card
138
- heading="Card Heading"
139
- subheading="JPG"
140
- ?horizontal=${args.horizontal}
141
- style="width: 200px;"
142
- >
143
- <img slot="cover-photo" src=${portrait} alt="Demo Graphic" />
144
- <div slot="footer">Footer</div>
145
- <sp-action-menu
146
- label="More Actions"
147
- slot="actions"
148
- placement="bottom-end"
149
- quiet
150
- >
151
- <sp-menu-item>Deselect</sp-menu-item>
152
- <sp-menu-item>Select Inverse</sp-menu-item>
153
- <sp-menu-item>Feather...</sp-menu-item>
154
- <sp-menu-item>Select and Mask...</sp-menu-item>
155
- <sp-menu-divider></sp-menu-divider>
156
- <sp-menu-item>Save Selection</sp-menu-item>
157
- <sp-menu-item disabled>Make Work Path</sp-menu-item>
158
- </sp-action-menu>
159
- </sp-card>
160
- `;
161
- };
162
- export const Gallery = (args) => {
163
- return html`
164
- <sp-card
165
- variant="gallery"
166
- heading="Card Heading"
167
- subheading="JPG"
168
- ?horizontal=${args.horizontal}
169
- >
170
- <img
171
- slot="preview"
172
- src=${landscape}
173
- style="object-fit: cover"
174
- alt="Demo Graphic"
175
- />
176
- <div slot="description">10/15/18</div>
177
- </sp-card>
178
- `;
179
- };
180
- export const noPreviewImage = (args) => {
181
- return html`
182
- <sp-card
183
- heading="Card Heading"
184
- subheading="No preview image"
185
- ?horizontal=${args.horizontal}
186
- style="width: 200px;"
187
- >
188
- <div slot="footer">Footer</div>
189
- </sp-card>
190
- `;
191
- };
192
- export const Quiet = (args) => {
193
- return html`
194
- <div>
195
- <sp-card
196
- variant="quiet"
197
- heading="Card Heading"
198
- subheading="JPG"
199
- ?horizontal=${args.horizontal}
200
- style="width: 208px; height: 264px"
201
- >
202
- <img src=${portrait} alt="Demo Graphic" slot="preview" />
203
- <div slot="description">10/15/18</div>
204
- </sp-card>
205
- </div>
206
- `;
207
- };
208
- export const quietFile = (args) => {
209
- return html`
210
- <div>
211
- <sp-card
212
- variant="quiet"
213
- subheading="JPG"
214
- asset="file"
215
- ?horizontal=${args.horizontal}
216
- style="width: 208px; height: 264px"
217
- >
218
- <img src=${portrait} alt="Demo Graphic" slot="preview" />
219
- <div slot="heading">File Name</div>
220
- <div slot="description">10/15/18</div>
221
- </sp-card>
222
- </div>
223
- `;
224
- };
225
- export const quietFolder = (args) => {
226
- return html`
227
- <div>
228
- <sp-card
229
- variant="quiet"
230
- subheading="JPG"
231
- asset="folder"
232
- ?horizontal=${args.horizontal}
233
- style="width: 208px; height: 264px"
234
- >
235
- <img src=${portrait} alt="Demo Graphic" slot="preview" />
236
- <div slot="heading">Folder Name</div>
237
- <div slot="description">10/15/18</div>
238
- </sp-card>
239
- </div>
240
- `;
241
- };
242
- export const quietActions = (args) => {
243
- return html`
244
- <div>
245
- <sp-card
246
- variant="quiet"
247
- heading="Card Heading"
248
- subheading="JPG"
249
- ?horizontal=${args.horizontal}
250
- style="width: 208px; height: 264px"
251
- >
252
- <img src=${portrait} alt="Demo Graphic" slot="preview" />
253
- <div slot="description">10/15/18</div>
254
- <sp-action-menu
255
- label="More Actions"
256
- slot="actions"
257
- placement="bottom-end"
258
- quiet
259
- >
260
- <sp-menu-item>Deselect</sp-menu-item>
261
- <sp-menu-item>Select Inverse</sp-menu-item>
262
- <sp-menu-item>Feather...</sp-menu-item>
263
- <sp-menu-item>Select and Mask...</sp-menu-item>
264
- <sp-menu-divider></sp-menu-divider>
265
- <sp-menu-item>Save Selection</sp-menu-item>
266
- <sp-menu-item disabled>Make Work Path</sp-menu-item>
267
- </sp-action-menu>
268
- </sp-card>
269
- </div>
270
- `;
271
- };
272
- quietActions.storyName = "Quiet w/ Actions";
273
- export const Horizontal = (args) => {
274
- return html`
275
- <sp-card
276
- ?horizontal=${args.horizontal}
277
- heading="Card Heading"
278
- subheading="JPG"
279
- >
280
- <sp-icon-file-txt
281
- slot="preview"
282
- style="width: 36px; height: 36px;"
283
- ></sp-icon-file-txt>
284
- </sp-card>
285
- `;
286
- };
287
- Horizontal.args = {
288
- horizontal: true
289
- };
290
- export const horizontalWithHREF = (args) => {
291
- return html`
292
- <sp-card
293
- ?horizontal=${args.horizontal}
294
- heading="Card Heading"
295
- subheading="JPG"
296
- href="https://opensource.adobe.com/spectrum-web-components"
297
- target="_blank"
298
- >
299
- <sp-icon-file-txt
300
- slot="preview"
301
- style="width: 36px; height: 36px;"
302
- ></sp-icon-file-txt>
303
- </sp-card>
304
- `;
305
- };
306
- horizontalWithHREF.args = {
307
- horizontal: true
308
- };
309
- export const smallQuiet = (args) => {
310
- return html`
311
- <div>
312
- <sp-card
313
- size=${args.size}
314
- ?horizontal=${args.horizontal}
315
- heading="Card Heading"
316
- subheading="JPG"
317
- variant="quiet"
318
- style="width: 115px"
319
- >
320
- <img src=${portrait} alt="Demo Graphic" slot="preview" />
321
- <div slot="footer">Footer</div>
322
- <sp-action-menu
323
- label="More Actions"
324
- slot="actions"
325
- placement="bottom-end"
326
- quiet
327
- >
328
- <sp-menu-item>Deselect</sp-menu-item>
329
- <sp-menu-item>Select Inverse</sp-menu-item>
330
- <sp-menu-item>Feather...</sp-menu-item>
331
- <sp-menu-item>Select and Mask...</sp-menu-item>
332
- <sp-menu-divider></sp-menu-divider>
333
- <sp-menu-item>Save Selection</sp-menu-item>
334
- <sp-menu-item disabled>Make Work Path</sp-menu-item>
335
- </sp-action-menu>
336
- </sp-card>
337
- </div>
338
- `;
339
- };
340
- smallQuiet.args = {
341
- size: "s"
342
- };
343
- export const SlottedHeading = (args) => {
344
- return html`
345
- <style>
346
- .slotted-textfield-heading {
347
- width: 100%;
348
- }
349
- </style>
350
- <sp-card
351
- style="
352
- --spectrum-card-title-width: 100%;
353
- --spectrum-card-title-padding-right: 0;
354
- --spectrum-card-title-padding-left: 0;
355
- --spectrum-card-body-header-height: auto;
356
- --spectrum-alias-single-line-width: 100%;
357
- "
358
- ?horizontal=${args.horizontal}
359
- >
360
- <img slot="cover-photo" src=${portrait} alt="Demo Graphic" />
361
- <sp-textfield
362
- class="slotted-textfield-heading"
363
- slot="heading"
364
- value="Apr 23 Project"
365
- quiet
366
- ></sp-textfield>
367
- <div slot="subheading">Last modified on 6/17/2020, 3:37 PM</div>
368
- <sp-action-menu
369
- label="More Actions"
370
- slot="actions"
371
- placement="bottom-end"
372
- quiet
373
- >
374
- <sp-menu-item>Deselect</sp-menu-item>
375
- <sp-menu-item>Select Inverse</sp-menu-item>
376
- <sp-menu-item>Feather...</sp-menu-item>
377
- <sp-menu-item>Select and Mask...</sp-menu-item>
378
- <sp-menu-divider></sp-menu-divider>
379
- <sp-menu-item>Save Selection</sp-menu-item>
380
- <sp-menu-item disabled>Make Work Path</sp-menu-item>
381
- </sp-action-menu>
382
- </sp-card>
383
- `;
384
- };
385
- //# sourceMappingURL=card.stories.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["card.stories.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*/\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/card/sp-card.js';\nimport { landscape, portrait } from './images';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-file-txt.js';\nimport '@spectrum-web-components/textfield/sp-textfield.js';\nimport '@spectrum-web-components/action-menu/sp-action-menu.js';\nimport '@spectrum-web-components/menu/sp-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport '@spectrum-web-components/menu/sp-menu-divider.js';\nimport '@spectrum-web-components/link/sp-link.js';\n\nexport default {\n component: 'sp-card',\n title: 'Card',\n args: {\n horizontal: false,\n },\n argTypes: {\n horizontal: {\n name: 'horizontal',\n type: { name: 'boolean', required: false },\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n },\n};\n\nexport interface StoryArgs {\n horizontal?: boolean;\n size?: 's' | 'm';\n onClick?: ((event: Event) => void) | undefined;\n}\n\nexport const Default = (args: StoryArgs): TemplateResult => {\n return html`\n <sp-card\n heading=\"Card Heading\"\n subheading=\"JPG\"\n ?horizontal=${args.horizontal}\n style=\"width: 200px;\"\n >\n <img slot=\"cover-photo\" src=${portrait} alt=\"Demo Graphic\" />\n <div slot=\"footer\">Footer</div>\n </sp-card>\n `;\n};\nDefault.args = {};\n\nexport const SmallQuiet = (args: StoryArgs): TemplateResult => {\n const { onClick } = args;\n return html`\n <sp-card\n heading=\"Card Heading\"\n subheading=\"JPG\"\n toggles\n ?horizontal=${args.horizontal}\n style=\"width: 200px;\"\n href=\"https://opensource.adobe.com/spectrum-web-components\"\n variant=\"quiet\"\n size=\"s\"\n toggles\n @click=${(event: Event) => {\n const composedTarget = event.composedPath()[0] as HTMLElement;\n if (composedTarget.id !== 'like-anchor') return;\n event.stopPropagation();\n event.preventDefault();\n onClick && onClick(event);\n }}\n >\n <div slot=\"footer\">\n Footer with a\n <sp-link href=\"https://google.com\">link to Google</sp-link>\n </div>\n <sp-action-menu\n label=\"More Actions\"\n slot=\"actions\"\n placement=\"bottom-end\"\n quiet\n >\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n <img slot=\"cover-photo\" src=${portrait} alt=\"Demo Graphic\" />\n </sp-card>\n `;\n};\nSmallQuiet.argTypes = {\n onClick: { action: 'link click' },\n};\n\nexport const href = (args: StoryArgs): TemplateResult => {\n const { onClick } = args;\n return html`\n <sp-card\n heading=\"Card Heading\"\n subheading=\"JPG\"\n toggles\n ?horizontal=${args.horizontal}\n style=\"width: 200px;\"\n href=\"https://opensource.adobe.com/spectrum-web-components\"\n @click=${(event: Event) => {\n const composedTarget = event.composedPath()[0] as HTMLElement;\n if (composedTarget.id !== 'like-anchor') return;\n event.stopPropagation();\n event.preventDefault();\n onClick && onClick(event);\n }}\n >\n <div slot=\"footer\">\n Footer with a\n <sp-link href=\"https://google.com\">link to Google</sp-link>\n </div>\n <sp-action-menu\n label=\"More Actions\"\n slot=\"actions\"\n placement=\"bottom-end\"\n quiet\n >\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n <img slot=\"cover-photo\" src=${portrait} alt=\"Demo Graphic\" />\n </sp-card>\n `;\n};\nhref.argTypes = {\n onClick: { action: 'link click' },\n};\n\nexport const actions = (args: StoryArgs): TemplateResult => {\n return html`\n <sp-card\n heading=\"Card Heading\"\n subheading=\"JPG\"\n ?horizontal=${args.horizontal}\n style=\"width: 200px;\"\n >\n <img slot=\"cover-photo\" src=${portrait} alt=\"Demo Graphic\" />\n <div slot=\"footer\">Footer</div>\n <sp-action-menu\n label=\"More Actions\"\n slot=\"actions\"\n placement=\"bottom-end\"\n quiet\n >\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n </sp-card>\n `;\n};\n\nexport const Gallery = (args: StoryArgs): TemplateResult => {\n return html`\n <sp-card\n variant=\"gallery\"\n heading=\"Card Heading\"\n subheading=\"JPG\"\n ?horizontal=${args.horizontal}\n >\n <img\n slot=\"preview\"\n src=${landscape}\n style=\"object-fit: cover\"\n alt=\"Demo Graphic\"\n />\n <div slot=\"description\">10/15/18</div>\n </sp-card>\n `;\n};\n\nexport const noPreviewImage = (args: StoryArgs): TemplateResult => {\n return html`\n <sp-card\n heading=\"Card Heading\"\n subheading=\"No preview image\"\n ?horizontal=${args.horizontal}\n style=\"width: 200px;\"\n >\n <div slot=\"footer\">Footer</div>\n </sp-card>\n `;\n};\n\nexport const Quiet = (args: StoryArgs): TemplateResult => {\n return html`\n <div>\n <sp-card\n variant=\"quiet\"\n heading=\"Card Heading\"\n subheading=\"JPG\"\n ?horizontal=${args.horizontal}\n style=\"width: 208px; height: 264px\"\n >\n <img src=${portrait} alt=\"Demo Graphic\" slot=\"preview\" />\n <div slot=\"description\">10/15/18</div>\n </sp-card>\n </div>\n `;\n};\n\nexport const quietFile = (args: StoryArgs): TemplateResult => {\n return html`\n <div>\n <sp-card\n variant=\"quiet\"\n subheading=\"JPG\"\n asset=\"file\"\n ?horizontal=${args.horizontal}\n style=\"width: 208px; height: 264px\"\n >\n <img src=${portrait} alt=\"Demo Graphic\" slot=\"preview\" />\n <div slot=\"heading\">File Name</div>\n <div slot=\"description\">10/15/18</div>\n </sp-card>\n </div>\n `;\n};\n\nexport const quietFolder = (args: StoryArgs): TemplateResult => {\n return html`\n <div>\n <sp-card\n variant=\"quiet\"\n subheading=\"JPG\"\n asset=\"folder\"\n ?horizontal=${args.horizontal}\n style=\"width: 208px; height: 264px\"\n >\n <img src=${portrait} alt=\"Demo Graphic\" slot=\"preview\" />\n <div slot=\"heading\">Folder Name</div>\n <div slot=\"description\">10/15/18</div>\n </sp-card>\n </div>\n `;\n};\n\nexport const quietActions = (args: StoryArgs): TemplateResult => {\n return html`\n <div>\n <sp-card\n variant=\"quiet\"\n heading=\"Card Heading\"\n subheading=\"JPG\"\n ?horizontal=${args.horizontal}\n style=\"width: 208px; height: 264px\"\n >\n <img src=${portrait} alt=\"Demo Graphic\" slot=\"preview\" />\n <div slot=\"description\">10/15/18</div>\n <sp-action-menu\n label=\"More Actions\"\n slot=\"actions\"\n placement=\"bottom-end\"\n quiet\n >\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n </sp-card>\n </div>\n `;\n};\n\nquietActions.storyName = 'Quiet w/ Actions';\n\nexport const Horizontal = (args: StoryArgs): TemplateResult => {\n return html`\n <sp-card\n ?horizontal=${args.horizontal}\n heading=\"Card Heading\"\n subheading=\"JPG\"\n >\n <sp-icon-file-txt\n slot=\"preview\"\n style=\"width: 36px; height: 36px;\"\n ></sp-icon-file-txt>\n </sp-card>\n `;\n};\nHorizontal.args = {\n horizontal: true,\n};\n\nexport const horizontalWithHREF = (args: StoryArgs): TemplateResult => {\n return html`\n <sp-card\n ?horizontal=${args.horizontal}\n heading=\"Card Heading\"\n subheading=\"JPG\"\n href=\"https://opensource.adobe.com/spectrum-web-components\"\n target=\"_blank\"\n >\n <sp-icon-file-txt\n slot=\"preview\"\n style=\"width: 36px; height: 36px;\"\n ></sp-icon-file-txt>\n </sp-card>\n `;\n};\nhorizontalWithHREF.args = {\n horizontal: true,\n};\n\nexport const smallQuiet = (args: StoryArgs): TemplateResult => {\n return html`\n <div>\n <sp-card\n size=${args.size}\n ?horizontal=${args.horizontal}\n heading=\"Card Heading\"\n subheading=\"JPG\"\n variant=\"quiet\"\n style=\"width: 115px\"\n >\n <img src=${portrait} alt=\"Demo Graphic\" slot=\"preview\" />\n <div slot=\"footer\">Footer</div>\n <sp-action-menu\n label=\"More Actions\"\n slot=\"actions\"\n placement=\"bottom-end\"\n quiet\n >\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n </sp-card>\n </div>\n `;\n};\nsmallQuiet.args = {\n size: 's',\n};\n\nexport const SlottedHeading = (args: StoryArgs): TemplateResult => {\n return html`\n <style>\n .slotted-textfield-heading {\n width: 100%;\n }\n </style>\n <sp-card\n style=\"\n --spectrum-card-title-width: 100%;\n --spectrum-card-title-padding-right: 0;\n --spectrum-card-title-padding-left: 0;\n --spectrum-card-body-header-height: auto;\n --spectrum-alias-single-line-width: 100%;\n \"\n ?horizontal=${args.horizontal}\n >\n <img slot=\"cover-photo\" src=${portrait} alt=\"Demo Graphic\" />\n <sp-textfield\n class=\"slotted-textfield-heading\"\n slot=\"heading\"\n value=\"Apr 23 Project\"\n quiet\n ></sp-textfield>\n <div slot=\"subheading\">Last modified on 6/17/2020, 3:37 PM</div>\n <sp-action-menu\n label=\"More Actions\"\n slot=\"actions\"\n placement=\"bottom-end\"\n quiet\n >\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n </sp-card>\n `;\n};\n"],
5
- "mappings": ";AAWA,SAAS,YAA4B;AAErC,OAAO;AACP,SAAS,WAAW,gBAAgB;AACpC,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,IACF,YAAY;AAAA,EAChB;AAAA,EACA,UAAU;AAAA,IACN,YAAY;AAAA,MACR,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,WAAW,UAAU,MAAM;AAAA,MACzC,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,UAAU;AAAA,QAC3B,cAAc,EAAE,SAAS,MAAM;AAAA,MACnC;AAAA,MACA,SAAS;AAAA,QACL,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,EACJ;AACJ;AAQO,aA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