@asantemedia-org/edwardsvacuum-design-system 1.2.9 → 1.3.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/dist/index.esm.js CHANGED
@@ -4570,8 +4570,6 @@ const faChevronRight = {
4570
4570
  icon: [320, 512, [9002], "f054", "M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]
4571
4571
  };
4572
4572
 
4573
- var placeHolderImage = "3697809e28f9e0fe.png";
4574
-
4575
4573
  // Utility function to retrieve correct SCSS module class names
4576
4574
  var getStyle = function (className) {
4577
4575
  if (styles$3[className]) return styles$3[className];
@@ -4593,6 +4591,23 @@ var cardSizeMapping = function (size) {
4593
4591
  }
4594
4592
  return classSrting;
4595
4593
  };
4594
+ var getImageUrl = function (imageUrl) {
4595
+ if (imageUrl) {
4596
+ return imageUrl; // If an image URL is provided, use it.
4597
+ }
4598
+ try {
4599
+ // Try loading from local assets (works in Storybook)
4600
+ return require('../../../assets/edwards-webshop-placeholder.png').default.src;
4601
+ } catch (error) {
4602
+ // If that fails, load from node_modules (works in host app)
4603
+ try {
4604
+ return require('@asantemedia-org/edwardsvacuum-design-system/dist/assets/3697809e28f9e0fe.png').default.src;
4605
+ } catch (error) {
4606
+ console.error("Placeholder image not found in either local assets or node_modules.", error);
4607
+ return ''; // Fallback empty string if no image is found
4608
+ }
4609
+ }
4610
+ };
4596
4611
  var Card = function (_a) {
4597
4612
  var contentCategoryLabel = _a.contentCategoryLabel,
4598
4613
  className = _a.className,
@@ -4611,7 +4626,7 @@ var Card = function (_a) {
4611
4626
  var mode = getStyle("cmp-card--".concat(cardStyle));
4612
4627
  var width = cardSizeMapping(size);
4613
4628
  var categoryColour = colour ? "cmp-card__content-category-wrapper__colour-".concat(colour) : '';
4614
- var contentImage = imageUrl ? imageUrl : placeHolderImage.src;
4629
+ var contentImage = getImageUrl(imageUrl);
4615
4630
  return /*#__PURE__*/React.createElement("div", {
4616
4631
  className: classnames(getStyle('cmp-card'), mode, width, getStyle(className))
4617
4632
  }, /*#__PURE__*/React.createElement("a", {
@@ -4659,10 +4674,9 @@ var ProductCard = function (_a) {
4659
4674
  cta = _a.cta,
4660
4675
  cardStyle = _a.cardStyle,
4661
4676
  onClick = _a.onClick;
4662
- console.log(imageUrl);
4663
4677
  var width = cardSizeMapping(size);
4664
4678
  var mode = getStyle("cmp-card--".concat(cardStyle));
4665
- var productImage = imageUrl ? imageUrl : placeHolderImage.src;
4679
+ var productImage = getImageUrl(imageUrl);
4666
4680
  return /*#__PURE__*/React.createElement("div", {
4667
4681
  className: classnames(getStyle('cmp-card'), mode, width, className)
4668
4682
  }, /*#__PURE__*/React.createElement("a", {