@asantemedia-org/edwardsvacuum-design-system 1.6.47 → 1.6.49
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.css +12 -3
- package/dist/index.esm.css +12 -3
- package/dist/index.esm.js +48 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +47 -22
- package/dist/index.js.map +1 -1
- package/dist/index.scss +12 -3
- package/dist/stories/components/Button/Button.d.ts +2 -1
- package/dist/stories/components/Card/card.d.ts +1 -0
- package/dist/stories/experiences/Algolia-dynamic-search/algolia-dynamic-search-base.d.ts +3 -25
- package/dist/stories/experiences/Algolia-dynamic-search/algolia-dynamic-search.d.ts +1 -2
- package/dist/stories/experiences/Algolia-dynamic-search/algolia-dynamic-search.types.d.ts +34 -0
- package/dist/stories/experiences/QRFormJourney/Qr-form/Qr-form.d.ts +3 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -562,8 +562,10 @@ var Button = function (_a) {
|
|
|
562
562
|
href = _a.href,
|
|
563
563
|
target = _a.target,
|
|
564
564
|
rel = _a.rel,
|
|
565
|
+
_c = _a.type,
|
|
566
|
+
type = _c === void 0 ? 'button' : _c,
|
|
565
567
|
dataTargetSelector = _a["data-target-selector"],
|
|
566
|
-
props = __rest(_a, ["className", "buttonStyle", "label", "element", "onClick", "href", "target", "rel", 'data-target-selector']);
|
|
568
|
+
props = __rest(_a, ["className", "buttonStyle", "label", "element", "onClick", "href", "target", "rel", "type", 'data-target-selector']);
|
|
567
569
|
var mode = buttonStyle ? getStyle("cmp-button--style-".concat(buttonStyle)) : '';
|
|
568
570
|
var baseClass = getStyle('cmp-button');
|
|
569
571
|
// Add js-modal class if data-target-selector is present
|
|
@@ -581,7 +583,7 @@ var Button = function (_a) {
|
|
|
581
583
|
}
|
|
582
584
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
583
585
|
className: conditionalClasses,
|
|
584
|
-
type:
|
|
586
|
+
type: type,
|
|
585
587
|
onClick: onClick
|
|
586
588
|
}, props), label);
|
|
587
589
|
};
|
|
@@ -638,7 +640,13 @@ var AlgoliaDynamicSearch = function (_a, useScopedStyles, styles) {
|
|
|
638
640
|
isLoading = _f === void 0 ? false : _f,
|
|
639
641
|
placeholder = _a.placeholder,
|
|
640
642
|
analytics = _a.analytics,
|
|
641
|
-
facets = _a.facets
|
|
643
|
+
facets = _a.facets,
|
|
644
|
+
innerComponents = _a.innerComponents;
|
|
645
|
+
// Extract components from innerComponents with defaults
|
|
646
|
+
var Card$1 = (innerComponents === null || innerComponents === void 0 ? void 0 : innerComponents.Card) || Card;
|
|
647
|
+
var ProductCard$1 = (innerComponents === null || innerComponents === void 0 ? void 0 : innerComponents.ProductCard) || ProductCard;
|
|
648
|
+
var ProductDetailsCard$1 = (innerComponents === null || innerComponents === void 0 ? void 0 : innerComponents.ProductDetailsCard) || ProductDetailsCard;
|
|
649
|
+
var Button$1 = (innerComponents === null || innerComponents === void 0 ? void 0 : innerComponents.Button) || Button;
|
|
642
650
|
// Helper to resolve CSS module class names properly
|
|
643
651
|
var getClass = React.useCallback(function (suffix) {
|
|
644
652
|
var fullClassName = "cmpAlgoliaDynamicSearchWidget".concat(suffix);
|
|
@@ -697,7 +705,7 @@ var AlgoliaDynamicSearch = function (_a, useScopedStyles, styles) {
|
|
|
697
705
|
finalUrl = _a.finalUrl,
|
|
698
706
|
target = _a.target;
|
|
699
707
|
var isAnchor = !!callToActionTargetSelector || (callToActionType === null || callToActionType === void 0 ? void 0 : callToActionType.toLowerCase()) !== 'internal';
|
|
700
|
-
return /*#__PURE__*/React.createElement(Button, {
|
|
708
|
+
return /*#__PURE__*/React.createElement(Button$1, {
|
|
701
709
|
element: isAnchor ? 'a' : 'button',
|
|
702
710
|
buttonStyle: widgetStyleProps === null || widgetStyleProps === void 0 ? void 0 : widgetStyleProps.buttonStyle,
|
|
703
711
|
label: callToActionText,
|
|
@@ -714,7 +722,7 @@ var AlgoliaDynamicSearch = function (_a, useScopedStyles, styles) {
|
|
|
714
722
|
}()))), /*#__PURE__*/React.createElement("div", {
|
|
715
723
|
className: queryType == PRODUCT_DETAILS ? getClass('__cards__cardSingle') : getClass('__cards')
|
|
716
724
|
}, hits.slice(0, maxResults).map(function (hit, index) {
|
|
717
|
-
var Component = Card;
|
|
725
|
+
var Component = Card$1;
|
|
718
726
|
var title = hit.title;
|
|
719
727
|
var cardStyle = "";
|
|
720
728
|
var imageUrl = hit.imageUrl || placeholder;
|
|
@@ -731,7 +739,7 @@ var AlgoliaDynamicSearch = function (_a, useScopedStyles, styles) {
|
|
|
731
739
|
var cardClassName = styles === null || styles === void 0 ? void 0 : styles.cmpCard;
|
|
732
740
|
switch (queryType) {
|
|
733
741
|
case "products":
|
|
734
|
-
Component = ProductCard;
|
|
742
|
+
Component = ProductCard$1;
|
|
735
743
|
cardStyle = "type-card-product";
|
|
736
744
|
break;
|
|
737
745
|
case "content":
|
|
@@ -744,7 +752,7 @@ var AlgoliaDynamicSearch = function (_a, useScopedStyles, styles) {
|
|
|
744
752
|
break;
|
|
745
753
|
case PRODUCT_DETAILS:
|
|
746
754
|
cardStyle = "type-card-panel";
|
|
747
|
-
Component = ProductDetailsCard;
|
|
755
|
+
Component = ProductDetailsCard$1;
|
|
748
756
|
break;
|
|
749
757
|
default:
|
|
750
758
|
return null;
|
|
@@ -781,8 +789,17 @@ var AlgoliaDynamicSearch = function (_a, useScopedStyles, styles) {
|
|
|
781
789
|
|
|
782
790
|
var styles = {"cmpAlgoliaDynamicSearchWidget":"algolia-dynamic-search-module__cmpAlgoliaDynamicSearchWidget___WY9hc","isLoading":"algolia-dynamic-search-module__isLoading___X6nUw","cmpAlgoliaDynamicSearchWidget__placeholder":"algolia-dynamic-search-module__cmpAlgoliaDynamicSearchWidget__placeholder___IWqoU","cmpAlgoliaDynamicSearchWidget__container":"algolia-dynamic-search-module__cmpAlgoliaDynamicSearchWidget__container___HB7g0","cmpAlgoliaDynamicSearchWidget__header":"algolia-dynamic-search-module__cmpAlgoliaDynamicSearchWidget__header___vxNjS","cmpAlgoliaDynamicSearchWidget__header__text":"algolia-dynamic-search-module__cmpAlgoliaDynamicSearchWidget__header__text___23-nk","cmpAlgoliaDynamicSearchWidget__cards":"algolia-dynamic-search-module__cmpAlgoliaDynamicSearchWidget__cards___wOPVj","cmpAlgoliaDynamicSearchWidget__cards__cardSingle":"algolia-dynamic-search-module__cmpAlgoliaDynamicSearchWidget__cards__cardSingle___fcWfV","isQueryContent":"algolia-dynamic-search-module__isQueryContent___KXy6j","hasStyleSilverGradientBackground":"algolia-dynamic-search-module__hasStyleSilverGradientBackground___D3SQQ","hasStyleGreyBackground":"algolia-dynamic-search-module__hasStyleGreyBackground___SuPIH","cmpAlgoliaDynamicSearchWidget__placeholder__loading":"algolia-dynamic-search-module__cmpAlgoliaDynamicSearchWidget__placeholder__loading___hbH4m","loading":"algolia-dynamic-search-module__loading___Hb3Uw"};
|
|
783
791
|
|
|
792
|
+
// Edwards-specific components
|
|
793
|
+
var edwardsComponents = {
|
|
794
|
+
Card: Card,
|
|
795
|
+
ProductCard: ProductCard,
|
|
796
|
+
ProductDetailsCard: ProductDetailsCard,
|
|
797
|
+
Button: Button
|
|
798
|
+
};
|
|
784
799
|
var AlgoliaDynamicSearchEdwards = function (props) {
|
|
785
|
-
return AlgoliaDynamicSearch(
|
|
800
|
+
return AlgoliaDynamicSearch(__assign(__assign({}, props), {
|
|
801
|
+
innerComponents: edwardsComponents
|
|
802
|
+
}), true, styles);
|
|
786
803
|
};
|
|
787
804
|
var AlgoliaDynamicSearchRaw = function (props) {
|
|
788
805
|
return AlgoliaDynamicSearch(props, false);
|
|
@@ -1012,6 +1029,8 @@ var QrForm = function (props) {
|
|
|
1012
1029
|
var _g = React.useState(true);
|
|
1013
1030
|
_g[0];
|
|
1014
1031
|
var setIsLoadingCountries = _g[1];
|
|
1032
|
+
// Use custom Button component if provided, otherwise use default
|
|
1033
|
+
var Button$1 = props.ButtonComponent || Button;
|
|
1015
1034
|
var i18n = __assign(__assign({}, defaultQrFormTranslations), props);
|
|
1016
1035
|
var buttonProps = props;
|
|
1017
1036
|
var consentFields = ((_a = props.consents) === null || _a === void 0 ? void 0 : _a.map(function (consent, index) {
|
|
@@ -1130,20 +1149,23 @@ var QrForm = function (props) {
|
|
|
1130
1149
|
selected: true,
|
|
1131
1150
|
disabled: true
|
|
1132
1151
|
}, {
|
|
1133
|
-
label: i18n.
|
|
1134
|
-
value: "
|
|
1152
|
+
label: i18n.label_warrantyClaim,
|
|
1153
|
+
value: "warranty claim"
|
|
1135
1154
|
}, {
|
|
1136
|
-
label: i18n.
|
|
1137
|
-
value: "
|
|
1155
|
+
label: i18n.label_serviceRequest,
|
|
1156
|
+
value: "service request"
|
|
1138
1157
|
}, {
|
|
1139
|
-
label: i18n.
|
|
1140
|
-
value: "
|
|
1158
|
+
label: i18n.label_oilAndSpares,
|
|
1159
|
+
value: "oil and spares"
|
|
1160
|
+
}, {
|
|
1161
|
+
label: i18n.label_other,
|
|
1162
|
+
value: "other"
|
|
1141
1163
|
}]
|
|
1142
1164
|
}, {
|
|
1143
1165
|
type: "textarea",
|
|
1144
1166
|
name: "tell_us_more",
|
|
1145
|
-
placeholder: i18n.
|
|
1146
|
-
label: i18n.
|
|
1167
|
+
placeholder: i18n.label_tellUsMoreOptional,
|
|
1168
|
+
label: i18n.label_tellUsMoreOptional
|
|
1147
1169
|
}], false), /*page 2*/
|
|
1148
1170
|
[{
|
|
1149
1171
|
type: "text",
|
|
@@ -1333,19 +1355,22 @@ var QrForm = function (props) {
|
|
|
1333
1355
|
var isLastPage = pageIndex === pages.length - 1;
|
|
1334
1356
|
var navButtons = generateButtons && /*#__PURE__*/React.createElement("div", {
|
|
1335
1357
|
className: "qr-form-navigation"
|
|
1336
|
-
}, !isFirstPage ? /*#__PURE__*/React.createElement(Button, {
|
|
1358
|
+
}, !isFirstPage ? /*#__PURE__*/React.createElement(Button$1, {
|
|
1337
1359
|
label: i18n === null || i18n === void 0 ? void 0 : i18n.previous,
|
|
1338
1360
|
onClick: formNavigate,
|
|
1339
1361
|
"data-page_target": pageIndex - 1,
|
|
1340
1362
|
buttonStyle: "secondary"
|
|
1341
|
-
}) : /*#__PURE__*/React.createElement("div", null), !isLastPage ? /*#__PURE__*/React.createElement(Button, {
|
|
1363
|
+
}) : /*#__PURE__*/React.createElement("div", null), !isLastPage ? /*#__PURE__*/React.createElement(Button$1, {
|
|
1342
1364
|
label: i18n === null || i18n === void 0 ? void 0 : i18n.next,
|
|
1343
1365
|
onClick: formNavigate,
|
|
1344
1366
|
"data-page_target": pageIndex + 1,
|
|
1345
1367
|
buttonStyle: "primary"
|
|
1346
|
-
}) : /*#__PURE__*/React.createElement(
|
|
1347
|
-
|
|
1348
|
-
|
|
1368
|
+
}) : /*#__PURE__*/React.createElement(Button$1, {
|
|
1369
|
+
label: i18n === null || i18n === void 0 ? void 0 : i18n.submit,
|
|
1370
|
+
onClick: handleSubmit,
|
|
1371
|
+
buttonStyle: "primary",
|
|
1372
|
+
element: "button",
|
|
1373
|
+
type: "submit"
|
|
1349
1374
|
}));
|
|
1350
1375
|
if (isPartial) {
|
|
1351
1376
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1419,7 +1444,7 @@ var QrForm = function (props) {
|
|
|
1419
1444
|
className: "title-wrapper"
|
|
1420
1445
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1421
1446
|
className: "submitted-checked"
|
|
1422
|
-
}), /*#__PURE__*/React.createElement("h2", null, props.thankYouTitle)), /*#__PURE__*/React.createElement("p", null, props.thankYouText), /*#__PURE__*/React.createElement(Button, {
|
|
1447
|
+
}), /*#__PURE__*/React.createElement("h2", null, props.thankYouTitle)), /*#__PURE__*/React.createElement("p", null, props.thankYouText), /*#__PURE__*/React.createElement(Button$1, {
|
|
1423
1448
|
label: buttonProps.buttonText,
|
|
1424
1449
|
href: buttonProps.url,
|
|
1425
1450
|
target: buttonProps.newTab ? '_blank' : '',
|