@asantemedia-org/edwardsvacuum-design-system 1.6.57 → 1.6.59
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/assets/3697809e28f9e0fe.png +0 -0
- package/dist/index.esm.js +45 -52
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +45 -52
- package/dist/index.js.map +1 -1
- package/dist/stories/components/Card/card.d.ts +4 -3
- package/dist/stories/experiences/Algolia-dynamic-search/algolia-dynamic-search-base.d.ts +3 -3
- package/dist/stories/experiences/Algolia-dynamic-search/algolia-dynamic-search.types.d.ts +0 -1
- package/dist/stories/experiences/QRFormJourney/FormFieldType.d.ts +1 -1
- package/dist/stories/experiences/QRFormJourney/Qr-form/i18n.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -317,6 +317,9 @@ var AccordionSection = function (_a) {
|
|
|
317
317
|
}, shouldRenderChildren ? children : null));
|
|
318
318
|
};
|
|
319
319
|
|
|
320
|
+
var placholderimg = "3697809e28f9e0fe.png";
|
|
321
|
+
|
|
322
|
+
var PLACEHOLDER_INDICATOR = "?placeholder-storybook";
|
|
320
323
|
// Utility function to retrieve correct SCSS module class names
|
|
321
324
|
var getStyle$1 = function (className) {
|
|
322
325
|
if (styles$2[className]) return styles$2[className];
|
|
@@ -338,22 +341,10 @@ var cardSizeMapping = function (size) {
|
|
|
338
341
|
}
|
|
339
342
|
return classSrting;
|
|
340
343
|
};
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
try {
|
|
346
|
-
// Try loading from local assets (works in Storybook)
|
|
347
|
-
return require("../../../assets/edwards-webshop-placeholder.png").default.src;
|
|
348
|
-
} catch (error) {
|
|
349
|
-
// If that fails, load from node_modules (works in host app)
|
|
350
|
-
try {
|
|
351
|
-
return require("@asantemedia-org/edwardsvacuum-design-system/dist/assets/edwards-webshop-placeholder.png").default;
|
|
352
|
-
} catch (error) {
|
|
353
|
-
console.error("Placeholder image not found in either local assets or node_modules.", error);
|
|
354
|
-
return ""; // Fallback empty string if no image is found
|
|
355
|
-
}
|
|
356
|
-
}
|
|
344
|
+
// Helper function to check if image is a placeholder (from ACAS-14821)
|
|
345
|
+
var isPlaceholderImg = function (imageUrl) {
|
|
346
|
+
console.log(imageUrl);
|
|
347
|
+
return !!imageUrl && imageUrl.indexOf(PLACEHOLDER_INDICATOR) > -1;
|
|
357
348
|
};
|
|
358
349
|
var Card = function (_a) {
|
|
359
350
|
var contentCategoryLabel = _a.contentCategoryLabel,
|
|
@@ -369,7 +360,6 @@ var Card = function (_a) {
|
|
|
369
360
|
cardLink = _a.cardLink,
|
|
370
361
|
city = _a.city,
|
|
371
362
|
country = _a.country,
|
|
372
|
-
placeholder = _a.placeholder,
|
|
373
363
|
onClick = _a.onClick,
|
|
374
364
|
_b = _a.usePlainClasses,
|
|
375
365
|
usePlainClasses = _b === void 0 ? false : _b;
|
|
@@ -381,7 +371,8 @@ var Card = function (_a) {
|
|
|
381
371
|
var width = cardSizeMapping(size);
|
|
382
372
|
var categoryColour = colour ? usePlainClasses ? "cmp-card__content-category-wrapper__colour-".concat(colour) : getStyle$1("cmp-card__content-category-wrapper__colour-".concat(colour)) : "";
|
|
383
373
|
var cardFooterColour = colour ? usePlainClasses ? "cmp-card__footer--color-".concat(colour) : getStyle$1("cmp-card__footer--color-".concat(colour)) : "";
|
|
384
|
-
|
|
374
|
+
// Image placeholder fallback logic from ACAS-14821
|
|
375
|
+
var contentImage = !imageUrl ? placholderimg + PLACEHOLDER_INDICATOR : imageUrl;
|
|
385
376
|
return /*#__PURE__*/React.createElement("div", {
|
|
386
377
|
className: classnames(getClassName("cmp-card"), mode, width, className && (usePlainClasses ? className : getStyle$1(className)))
|
|
387
378
|
}, /*#__PURE__*/React.createElement("a", {
|
|
@@ -391,7 +382,7 @@ var Card = function (_a) {
|
|
|
391
382
|
}, /*#__PURE__*/React.createElement("div", {
|
|
392
383
|
className: getClassName("cmp-card__content-wrapper")
|
|
393
384
|
}, cardStyle !== "type-card-panel" && cardStyle !== "type-card-no-image" && /*#__PURE__*/React.createElement("div", {
|
|
394
|
-
className: "".concat(getClassName("cmp-card__image-wrapper"), " ").concat(
|
|
385
|
+
className: "".concat(getClassName("cmp-card__image-wrapper"), " ").concat(isPlaceholderImg(contentImage) ? getClassName("placeholderImage") : "")
|
|
395
386
|
}, /*#__PURE__*/React.createElement("picture", null, /*#__PURE__*/React.createElement("img", {
|
|
396
387
|
src: contentImage,
|
|
397
388
|
alt: imageAlt
|
|
@@ -430,7 +421,6 @@ var ProductCard = function (_a) {
|
|
|
430
421
|
cardLink = _a.cardLink,
|
|
431
422
|
cta = _a.cta,
|
|
432
423
|
cardStyle = _a.cardStyle,
|
|
433
|
-
placeholder = _a.placeholder,
|
|
434
424
|
onClick = _a.onClick,
|
|
435
425
|
_c = _a.usePlainClasses,
|
|
436
426
|
usePlainClasses = _c === void 0 ? false : _c;
|
|
@@ -440,7 +430,8 @@ var ProductCard = function (_a) {
|
|
|
440
430
|
};
|
|
441
431
|
var width = cardSizeMapping(size);
|
|
442
432
|
var mode = usePlainClasses ? "cmp-card--".concat(cardStyle) : getStyle$1("cmp-card--".concat(cardStyle));
|
|
443
|
-
|
|
433
|
+
// Image placeholder fallback logic from ACAS-14821
|
|
434
|
+
var productImage = !imageUrl || imageUrl === 'https://uk.my.edwardsvacuum.com?placeholder-storybook' ? placholderimg.src + PLACEHOLDER_INDICATOR : imageUrl;
|
|
444
435
|
return /*#__PURE__*/React.createElement("div", {
|
|
445
436
|
className: classnames(getClassName("cmp-card"), mode, width, className)
|
|
446
437
|
}, /*#__PURE__*/React.createElement("a", {
|
|
@@ -455,7 +446,7 @@ var ProductCard = function (_a) {
|
|
|
455
446
|
}, /*#__PURE__*/React.createElement("figure", null, /*#__PURE__*/React.createElement("img", {
|
|
456
447
|
src: productImage,
|
|
457
448
|
alt: imageAlt,
|
|
458
|
-
className:
|
|
449
|
+
className: isPlaceholderImg(productImage) ? "placeholderImage" : ''
|
|
459
450
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
460
451
|
className: getClassName("cmp-card--type-card-product__meta")
|
|
461
452
|
}, /*#__PURE__*/React.createElement("p", {
|
|
@@ -475,7 +466,6 @@ var ProductDetailsCard = function (_a) {
|
|
|
475
466
|
var title = _a.title;
|
|
476
467
|
_a.imageUrl;
|
|
477
468
|
var imageAlt = _a.imageAlt;
|
|
478
|
-
_a.placeholder;
|
|
479
469
|
_a.onClick;
|
|
480
470
|
var hit = _a.hit,
|
|
481
471
|
facets = _a.facets,
|
|
@@ -612,7 +602,7 @@ var Button = function (_a) {
|
|
|
612
602
|
}, props), label);
|
|
613
603
|
};
|
|
614
604
|
|
|
615
|
-
var PRODUCT_DETAILS =
|
|
605
|
+
var PRODUCT_DETAILS = "productDetails";
|
|
616
606
|
var DynamicHeading = function (_a) {
|
|
617
607
|
var _b = _a.titleSize,
|
|
618
608
|
titleSize = _b === void 0 ? "h2" : _b,
|
|
@@ -623,16 +613,16 @@ var DynamicHeading = function (_a) {
|
|
|
623
613
|
};
|
|
624
614
|
var getCallToActionProps = function (type, url) {
|
|
625
615
|
var callType = type === null || type === void 0 ? void 0 : type.toLowerCase();
|
|
626
|
-
var finalUrl = url ||
|
|
627
|
-
var target =
|
|
616
|
+
var finalUrl = url || "";
|
|
617
|
+
var target = "";
|
|
628
618
|
switch (callType) {
|
|
629
|
-
case
|
|
630
|
-
target =
|
|
619
|
+
case "external":
|
|
620
|
+
target = "_blank";
|
|
631
621
|
break;
|
|
632
|
-
case
|
|
622
|
+
case "email":
|
|
633
623
|
finalUrl = "mailto:".concat(url);
|
|
634
624
|
break;
|
|
635
|
-
case
|
|
625
|
+
case "phone":
|
|
636
626
|
finalUrl = "tel:".concat(url);
|
|
637
627
|
break;
|
|
638
628
|
}
|
|
@@ -651,18 +641,17 @@ var AlgoliaDynamicSearch = function (_a, useScopedStyles, styles) {
|
|
|
651
641
|
callToActionUrl = _a.callToActionUrl,
|
|
652
642
|
callToActionTargetSelector = _a.callToActionTargetSelector,
|
|
653
643
|
_c = _a.queryType,
|
|
654
|
-
queryType = _c === void 0 ?
|
|
644
|
+
queryType = _c === void 0 ? "unknown" : _c,
|
|
655
645
|
hits = _a.hits,
|
|
656
646
|
hitCta = _a.hitCta,
|
|
657
647
|
showProductPrice = _a.showProductPrice,
|
|
658
648
|
query = _a.query,
|
|
659
649
|
_d = _a.backgroundColour,
|
|
660
|
-
backgroundColour = _d === void 0 ?
|
|
650
|
+
backgroundColour = _d === void 0 ? "" : _d,
|
|
661
651
|
_e = _a.maxResults,
|
|
662
652
|
maxResults = _e === void 0 ? 10 : _e,
|
|
663
653
|
_f = _a.isLoading,
|
|
664
654
|
isLoading = _f === void 0 ? false : _f,
|
|
665
|
-
placeholder = _a.placeholder,
|
|
666
655
|
analytics = _a.analytics,
|
|
667
656
|
facets = _a.facets,
|
|
668
657
|
innerComponents = _a.innerComponents;
|
|
@@ -685,12 +674,12 @@ var AlgoliaDynamicSearch = function (_a, useScopedStyles, styles) {
|
|
|
685
674
|
var backgroundStyles = {
|
|
686
675
|
"dark-grey": {
|
|
687
676
|
buttonStyle: "outlineWhite",
|
|
688
|
-
containerBackground: getModifierClass(
|
|
677
|
+
containerBackground: getModifierClass("hasStyleGreyBackground"),
|
|
689
678
|
textColour: "white"
|
|
690
679
|
},
|
|
691
|
-
|
|
680
|
+
silver: {
|
|
692
681
|
buttonStyle: "primary",
|
|
693
|
-
containerBackground: getModifierClass(
|
|
682
|
+
containerBackground: getModifierClass("hasStyleSilverGradientBackground"),
|
|
694
683
|
textColour: "black"
|
|
695
684
|
}
|
|
696
685
|
};
|
|
@@ -703,53 +692,53 @@ var AlgoliaDynamicSearch = function (_a, useScopedStyles, styles) {
|
|
|
703
692
|
if (!hits || hits.length === 0) {
|
|
704
693
|
return null;
|
|
705
694
|
}
|
|
706
|
-
var baseClass = getClass(
|
|
695
|
+
var baseClass = getClass("");
|
|
707
696
|
// Memoize wrapper class names
|
|
708
697
|
var wrapperClasses = React.useMemo(function () {
|
|
709
|
-
return [baseClass, widgetStyleProps.containerBackground, isLoading ? getModifierClass(
|
|
698
|
+
return [baseClass, widgetStyleProps.containerBackground, isLoading ? getModifierClass("isLoading") : "", queryType === "content" ? getModifierClass("isQueryContent") : ""].filter(Boolean).join(" ");
|
|
710
699
|
}, [baseClass, widgetStyleProps.containerBackground, isLoading, queryType, getModifierClass]);
|
|
711
700
|
return /*#__PURE__*/React.createElement("div", {
|
|
712
701
|
className: wrapperClasses
|
|
713
702
|
}, isLoading && /*#__PURE__*/React.createElement("div", {
|
|
714
|
-
className: getClass(
|
|
703
|
+
className: getClass("__placeholder")
|
|
715
704
|
}, /*#__PURE__*/React.createElement("div", {
|
|
716
|
-
className: getClass(
|
|
705
|
+
className: getClass("__placeholder__loading")
|
|
717
706
|
})), /*#__PURE__*/React.createElement("div", {
|
|
718
|
-
className: getClass(
|
|
707
|
+
className: getClass("__container")
|
|
719
708
|
}, queryType != PRODUCT_DETAILS && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
720
|
-
className: getClass(
|
|
709
|
+
className: getClass("__header")
|
|
721
710
|
}, /*#__PURE__*/React.createElement("div", {
|
|
722
|
-
className: getClass(
|
|
711
|
+
className: getClass("__header__text")
|
|
723
712
|
}, /*#__PURE__*/React.createElement(DynamicHeading, {
|
|
724
713
|
titleSize: titleSize
|
|
725
714
|
}, heading), /*#__PURE__*/React.createElement("p", null, subtext)), callToActionUrl && /*#__PURE__*/React.createElement("div", {
|
|
726
|
-
className: getClass(
|
|
715
|
+
className: getClass("__header__cta")
|
|
727
716
|
}, function () {
|
|
728
717
|
var _a = getCallToActionProps(callToActionType, callToActionUrl),
|
|
729
718
|
finalUrl = _a.finalUrl,
|
|
730
719
|
target = _a.target;
|
|
731
|
-
var isAnchor = !!callToActionTargetSelector || (callToActionType === null || callToActionType === void 0 ? void 0 : callToActionType.toLowerCase()) !==
|
|
720
|
+
var isAnchor = !!callToActionTargetSelector || (callToActionType === null || callToActionType === void 0 ? void 0 : callToActionType.toLowerCase()) !== "internal";
|
|
732
721
|
return /*#__PURE__*/React.createElement(Button$1, {
|
|
733
|
-
element: isAnchor ?
|
|
722
|
+
element: isAnchor ? "a" : "button",
|
|
734
723
|
buttonStyle: widgetStyleProps === null || widgetStyleProps === void 0 ? void 0 : widgetStyleProps.buttonStyle,
|
|
735
724
|
label: callToActionText,
|
|
736
725
|
href: isAnchor ? finalUrl : undefined,
|
|
737
726
|
target: target,
|
|
738
|
-
rel: target ===
|
|
727
|
+
rel: target === "_blank" ? "noopener noreferrer" : undefined,
|
|
739
728
|
"data-target-selector": callToActionTargetSelector,
|
|
740
729
|
onClick: !isAnchor ? function () {
|
|
741
730
|
if (finalUrl) {
|
|
742
|
-
window.open(finalUrl, target ||
|
|
731
|
+
window.open(finalUrl, target || "_self", target === "_blank" ? "noopener,noreferrer" : undefined);
|
|
743
732
|
}
|
|
744
733
|
} : undefined
|
|
745
734
|
});
|
|
746
735
|
}()))), /*#__PURE__*/React.createElement("div", {
|
|
747
|
-
className: queryType == PRODUCT_DETAILS ? getClass(
|
|
736
|
+
className: queryType == PRODUCT_DETAILS ? getClass("__cards__cardSingle") : getClass("__cards")
|
|
748
737
|
}, hits.slice(0, maxResults).map(function (hit, index) {
|
|
749
738
|
var Component = Card$1;
|
|
750
739
|
var title = hit.title;
|
|
751
740
|
var cardStyle = "";
|
|
752
|
-
var imageUrl = hit.imageUrl
|
|
741
|
+
var imageUrl = hit.imageUrl;
|
|
753
742
|
var hitUtm = new URLSearchParams({
|
|
754
743
|
utm_source: "web",
|
|
755
744
|
utm_medium: "alg",
|
|
@@ -793,7 +782,6 @@ var AlgoliaDynamicSearch = function (_a, useScopedStyles, styles) {
|
|
|
793
782
|
className: cardClassName,
|
|
794
783
|
title: title,
|
|
795
784
|
imageUrl: imageUrl,
|
|
796
|
-
placeholder: hit.image ? false : true,
|
|
797
785
|
hit: hit,
|
|
798
786
|
cta: hitCta,
|
|
799
787
|
size: "",
|
|
@@ -1028,6 +1016,7 @@ var defaultQrFormTranslations = {
|
|
|
1028
1016
|
label_city: "City",
|
|
1029
1017
|
label_postcodeOrZip: "Postcode or ZIP",
|
|
1030
1018
|
consent_acceptPolicy: "I accept the policy",
|
|
1019
|
+
consent_viewPolicy: "View Policy",
|
|
1031
1020
|
consent_default: "Consent",
|
|
1032
1021
|
consent_requiredMessage: "Please acknowledge this consent"
|
|
1033
1022
|
};
|
|
@@ -1061,7 +1050,11 @@ var QrForm = function (props) {
|
|
|
1061
1050
|
return {
|
|
1062
1051
|
type: consent.type === "info" ? "info" : "checkbox",
|
|
1063
1052
|
name: "consent_".concat(index + 1),
|
|
1064
|
-
label: consent.
|
|
1053
|
+
label: consent.policyLink ? /*#__PURE__*/React.createElement("span", null, consent.policyText || i18n.consent_acceptPolicy, " ", /*#__PURE__*/React.createElement("a", {
|
|
1054
|
+
href: consent.policyLink,
|
|
1055
|
+
target: "_blank",
|
|
1056
|
+
rel: "noopener noreferrer"
|
|
1057
|
+
}, i18n.consent_viewPolicy || "View Policy")) : consent.policyText ? consent.policyText : "".concat(i18n.consent_default).concat(index + 1),
|
|
1065
1058
|
value: "true",
|
|
1066
1059
|
required: !!consent.policyMandatory,
|
|
1067
1060
|
errorMessage: consent.policyMandatory ? i18n.consent_requiredMessage : ""
|