@adobe-commerce/elsie 1.4.0-beta5 → 1.4.0-beta6

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.4.0-beta5",
3
+ "version": "1.4.0-beta6",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "description": "Domain Package SDK",
6
6
  "engines": {
@@ -36,6 +36,7 @@ export interface CartItemProps
36
36
  totalExcludingTax?: VNode;
37
37
  sku?: VNode;
38
38
  quantity?: number;
39
+ quantityContent?: VNode;
39
40
  description?: VNode;
40
41
  attributes?: VNode;
41
42
  footer?: VNode;
@@ -45,6 +46,7 @@ export interface CartItemProps
45
46
  discount?: VNode;
46
47
  savings?: VNode;
47
48
  actions?: VNode;
49
+ removeContent?: VNode;
48
50
  loading?: boolean;
49
51
  updating?: boolean;
50
52
  onRemove?: () => void;
@@ -71,7 +73,9 @@ export const CartItem: FunctionComponent<CartItemProps> = ({
71
73
  discount,
72
74
  savings,
73
75
  actions,
76
+ removeContent,
74
77
  quantity,
78
+ quantityContent,
75
79
  description,
76
80
  attributes,
77
81
  footer,
@@ -304,18 +308,20 @@ export const CartItem: FunctionComponent<CartItemProps> = ({
304
308
  ['dropin-cart-item__quantity--edit', !!onQuantity],
305
309
  ])}
306
310
  >
307
- {onQuantity
308
- ? quantityComponent
309
- : quantity && (
310
- <span
311
- className={classes(['dropin-cart-item__quantity__value'])}
312
- >
313
- {labels.quantity}:{' '}
314
- <strong className="dropin-cart-item__quantity__number">
315
- {Number(quantity).toLocaleString(locale)}
316
- </strong>
317
- </span>
318
- )}
311
+ {quantityContent ? (
312
+ <VComponent node={quantityContent} />
313
+ ) : onQuantity ? (
314
+ quantityComponent
315
+ ) : (
316
+ quantity && (
317
+ <span className={classes(['dropin-cart-item__quantity__value'])}>
318
+ {labels.quantity}:{' '}
319
+ <strong className="dropin-cart-item__quantity__number">
320
+ {Number(quantity).toLocaleString(locale)}
321
+ </strong>
322
+ </span>
323
+ )
324
+ )}
319
325
 
320
326
  {/* Warning */}
321
327
  {warning && (
@@ -432,12 +438,17 @@ export const CartItem: FunctionComponent<CartItemProps> = ({
432
438
 
433
439
  {/* Footer */}
434
440
  {footer && (
435
- <VComponent node={footer} className={classes(['dropin-cart-item__footer'])} />
441
+ <VComponent
442
+ node={footer}
443
+ className={classes(['dropin-cart-item__footer'])}
444
+ />
436
445
  )}
437
446
  </div>
438
447
 
439
448
  {/* Remove Item */}
440
- {onRemove && (
449
+ {removeContent ? (
450
+ <VComponent node={removeContent} />
451
+ ) : onRemove ? (
441
452
  <Button
442
453
  data-testid="cart-item-remove-button"
443
454
  className={classes(['dropin-cart-item__remove'])}
@@ -459,7 +470,7 @@ export const CartItem: FunctionComponent<CartItemProps> = ({
459
470
  }
460
471
  disabled={updating}
461
472
  />
462
- )}
473
+ ) : null}
463
474
  </div>
464
475
  );
465
476
  };