@adobe-commerce/elsie 1.5.0-alpha1 → 1.5.1-alpha003

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": "@adobe-commerce/elsie",
3
- "version": "1.5.0-alpha1",
3
+ "version": "1.5.1-alpha003",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "description": "Domain Package SDK",
6
6
  "engines": {
@@ -23,14 +23,16 @@
23
23
  }
24
24
 
25
25
  .dropin-product-item-card__image-container {
26
- overflow: hidden;
26
+ overflow: visible;
27
27
  width: 100%;
28
28
  height: auto;
29
29
  }
30
30
 
31
31
  .dropin-product-item-card__image img {
32
+ display: block;
32
33
  width: 100%;
33
34
  max-height: 375px;
35
+ border-radius: var(--border-radius-xsmall, 4px);
34
36
  }
35
37
 
36
38
  .dropin-product-item-card__content {
@@ -74,6 +76,42 @@
74
76
  width: 100%;
75
77
  }
76
78
 
79
+ .dropin-product-item-card__image a:focus {
80
+ outline: 1px solid var(--color-neutral-400);
81
+ outline-offset: 1px;
82
+ }
83
+
84
+ .dropin-product-item-card__image {
85
+ display: inline-block;
86
+ border-radius: var(--border-radius-xsmall, 4px);
87
+ outline: none;
88
+ }
89
+
90
+ .dropin-product-item-card__image:focus-visible {
91
+ outline: 2px solid var(--color-interactive-focus, #005fcc);
92
+ outline-offset: 2px;
93
+ z-index: 2;
94
+ }
95
+
96
+ .dropin-product-item-card__image-container {
97
+ overflow: visible;
98
+ width: 100%;
99
+ height: auto;
100
+ }
101
+
102
+ .dropin-product-item-card__image-link {
103
+ display: block;
104
+ border-radius: var(--border-radius-xsmall, 4px);
105
+ outline: none;
106
+ }
107
+
108
+ .dropin-product-item-card__image-link:focus-visible {
109
+ outline: 3px solid var(--color-interactive-focus, #333333);
110
+ outline-offset: 3px;
111
+ position: relative;
112
+ z-index: 1;
113
+ }
114
+
77
115
  /* Medium (portrait tablets and large phones, 768px and up) */
78
116
  /* @media only screen and (min-width: 768px) { } */
79
117
 
@@ -47,13 +47,15 @@ const meta: Meta<ProductItemCardProps> = {
47
47
  options: ['DefaultImage', 'Empty'],
48
48
  mapping: {
49
49
  DefaultImage: (
50
- <Image
51
- src="https://picsum.photos/300/375"
52
- width="300"
53
- height="375"
54
- alt="Product Image"
55
- loading="lazy"
56
- />
50
+ <a href="#" className="dropin-product-item-card__image-link">
51
+ <Image
52
+ src="https://picsum.photos/300/375"
53
+ width="300"
54
+ height="375"
55
+ alt="Product Image"
56
+ loading="lazy"
57
+ />
58
+ </a>
57
59
  ),
58
60
  Empty: null,
59
61
  },
@@ -253,6 +255,7 @@ export const Default: Story = {
253
255
  sku: 'DefaultSku' as any,
254
256
  swatches: 'DefaultSwatches' as any,
255
257
  actionButton: 'DefaultButton' as any,
258
+ imageHref: '#',
256
259
  },
257
260
  };
258
261
 
@@ -22,6 +22,8 @@ export interface ProductItemCardProps
22
22
  actionButton?: VNode;
23
23
  swatches?: VNode;
24
24
  initialized?: boolean;
25
+ imageHref?: string;
26
+ imageLinkLabel?: string;
25
27
  }
26
28
 
27
29
  export const ProductItemCard: FunctionComponent<ProductItemCardProps> = ({
@@ -33,6 +35,8 @@ export const ProductItemCard: FunctionComponent<ProductItemCardProps> = ({
33
35
  actionButton,
34
36
  swatches,
35
37
  initialized = false,
38
+ imageHref,
39
+ imageLinkLabel,
36
40
  ...props
37
41
  }) => {
38
42
  if (!initialized) {
@@ -45,10 +49,23 @@ export const ProductItemCard: FunctionComponent<ProductItemCardProps> = ({
45
49
  >
46
50
  <div className="dropin-product-item-card__image-container">
47
51
  {image && (
48
- <VComponent
49
- node={image}
50
- className={classes(['dropin-product-item-card__image'])}
51
- />
52
+ imageHref ? (
53
+ <a
54
+ href={imageHref}
55
+ className="dropin-product-item-card__image-link"
56
+ aria-label={imageLinkLabel}
57
+ >
58
+ <VComponent
59
+ node={image}
60
+ className={classes(['dropin-product-item-card__image'])}
61
+ />
62
+ </a>
63
+ ) : (
64
+ <VComponent
65
+ node={image}
66
+ className={classes(['dropin-product-item-card__image'])}
67
+ />
68
+ )
52
69
  )}
53
70
  </div>
54
71
  <div className="dropin-product-item-card__content">