@getflip/swirl-components 0.201.0 → 0.201.1

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.
@@ -29,6 +29,11 @@
29
29
  transition: background-color 0.2s;
30
30
  }
31
31
 
32
+ .card:not(.card--has-image) .card__image {
33
+ overflow: hidden;
34
+ height: 0;
35
+ }
36
+
32
37
  a.card,
33
38
  button.card,
34
39
  .card--interactive {
@@ -97,11 +102,6 @@ a.card:focus-visible, button.card:focus-visible, .card--interactive:focus-visibl
97
102
  justify-content: flex-end;
98
103
  }
99
104
 
100
- :not(.card--has-image) .card__image {
101
- overflow: hidden;
102
- height: 0;
103
- }
104
-
105
105
  .card--intent-critical-subdued {
106
106
  background-color: var(--s-surface-critical-subdued);
107
107
  }
@@ -47,6 +47,18 @@ describe("swirl-card", () => {
47
47
  </swirl-card>
48
48
  `);
49
49
  });
50
+ it("renders with an image", async () => {
51
+ const page = await newSpecPage({
52
+ components: [SwirlCard],
53
+ html: `
54
+ <swirl-card href="#" link-target="_blank">
55
+ <img slot="image" alt="Dog in a blanket." src="/sample-2.jpg" />
56
+ </swirl-card>
57
+ `,
58
+ });
59
+ const card = page.root.shadowRoot.firstChild;
60
+ expect(card.classList.contains("card--has-image")).toBeTruthy();
61
+ });
50
62
  it("has adjustable paddings", async () => {
51
63
  const page = await newSpecPage({
52
64
  components: [SwirlCard],