@asantemedia-org/edwardsvacuum-design-system 1.6.50 → 1.6.52

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.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export { AlgoliaDynamicSearchRaw, AlgoliaDynamicSearchEdwards as AlgoliaDynamicSearch } from "@stories/experiences/Algolia-dynamic-search/algolia-dynamic-search";
2
2
  export type { AlgoliaDynamicSearchProps, InnerComponents, Facet } from "@stories/experiences/Algolia-dynamic-search/algolia-dynamic-search.types";
3
+ export { Card, ProductCard, ProductDetailsCard } from "@stories/components/Card/card";
4
+ export type { CardProps } from "@stories/components/Card/card.types";
3
5
  export { QrForm } from "@stories/experiences/QRFormJourney/Qr-form/Qr-form";
4
6
  export type { allQrFromProps } from "@stories/experiences/QRFormJourney/Qr-form/Qr-form";
5
7
  export type { FormFieldType } from "@stories/experiences/QRFormJourney/FormFieldType";
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useRef, useCallback, useMemo, useEffect } from 'react';
2
2
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3
- import { faChevronDown, faArrowRight, faChevronRight } from '@fortawesome/pro-solid-svg-icons';
3
+ import { faChevronDown, faChevronRight, faArrowRight } from '@fortawesome/pro-solid-svg-icons';
4
4
  import { v4 } from 'uuid';
5
5
  import { PhoneInput } from 'react-international-phone';
6
6
 
@@ -368,45 +368,51 @@ var Card = function (_a) {
368
368
  city = _a.city,
369
369
  country = _a.country,
370
370
  placeholder = _a.placeholder,
371
- onClick = _a.onClick;
372
- var mode = getStyle$1("cmp-card--".concat(cardStyle));
371
+ onClick = _a.onClick,
372
+ _b = _a.usePlainClasses,
373
+ usePlainClasses = _b === void 0 ? false : _b;
374
+ // Helper to get class name - plain or CSS module
375
+ var getClassName = function (name) {
376
+ return usePlainClasses ? name : getStyle$1(name);
377
+ };
378
+ var mode = usePlainClasses ? "cmp-card--".concat(cardStyle) : getStyle$1("cmp-card--".concat(cardStyle));
373
379
  var width = cardSizeMapping(size);
374
- var categoryColour = colour ? getStyle$1("cmp-card__content-category-wrapper__colour-".concat(colour)) : "";
375
- var cardFooterColour = colour ? getStyle$1("cmp-card__footer--color-".concat(colour)) : "";
380
+ var categoryColour = colour ? usePlainClasses ? "cmp-card__content-category-wrapper__colour-".concat(colour) : getStyle$1("cmp-card__content-category-wrapper__colour-".concat(colour)) : "";
381
+ var cardFooterColour = colour ? usePlainClasses ? "cmp-card__footer--color-".concat(colour) : getStyle$1("cmp-card__footer--color-".concat(colour)) : "";
376
382
  var contentImage = getImageUrl(imageUrl);
377
383
  return /*#__PURE__*/React.createElement("div", {
378
- className: classnames(getStyle$1("cmp-card"), mode, width, className && getStyle$1(className))
384
+ className: classnames(getClassName("cmp-card"), mode, width, className && (usePlainClasses ? className : getStyle$1(className)))
379
385
  }, /*#__PURE__*/React.createElement("a", {
380
- className: getStyle$1("cmp-card__link"),
386
+ className: getClassName("cmp-card__link"),
381
387
  href: cardLink,
382
388
  onClick: onClick
383
389
  }, /*#__PURE__*/React.createElement("div", {
384
- className: getStyle$1("cmp-card__content-wrapper")
390
+ className: getClassName("cmp-card__content-wrapper")
385
391
  }, cardStyle !== "type-card-panel" && cardStyle !== "type-card-no-image" && /*#__PURE__*/React.createElement("div", {
386
- className: "".concat(getStyle$1("cmp-card__image-wrapper"), " ").concat(!imageUrl || placeholder ? getStyle$1("placeholderImage") : "")
392
+ className: "".concat(getClassName("cmp-card__image-wrapper"), " ").concat(!imageUrl || placeholder ? getClassName("placeholderImage") : "")
387
393
  }, /*#__PURE__*/React.createElement("picture", null, /*#__PURE__*/React.createElement("img", {
388
394
  src: contentImage,
389
395
  alt: imageAlt
390
396
  }))), cardStyle === "type-card-label" && /*#__PURE__*/React.createElement("div", {
391
- className: classnames(getStyle$1("cmp-card__content-category-wrapper"), categoryColour)
397
+ className: classnames(getClassName("cmp-card__content-category-wrapper"), categoryColour)
392
398
  }, contentCategoryLabel && /*#__PURE__*/React.createElement("p", null, contentCategoryLabel)), /*#__PURE__*/React.createElement("div", {
393
- className: getStyle$1("cmp-card__title-wrapper")
399
+ className: getClassName("cmp-card__title-wrapper")
394
400
  }, date && /*#__PURE__*/React.createElement("div", {
395
- className: getStyle$1("cmp-card__date")
401
+ className: getClassName("cmp-card__date")
396
402
  }, date), title && /*#__PURE__*/React.createElement("h4", {
397
- className: getStyle$1("cmp-card__title")
403
+ className: getClassName("cmp-card__title")
398
404
  }, title), (city || country) && /*#__PURE__*/React.createElement("p", {
399
- className: getStyle$1("cmp-card__city-country")
405
+ className: getClassName("cmp-card__city-country")
400
406
  }, city, " ", city && country ? ", " : "", " ", country), cardStyle === "type-card-panel" ? /*#__PURE__*/React.createElement("span", {
401
- className: classnames(getStyle$1("cmp-card__footer"), cardFooterColour)
407
+ className: classnames(getClassName("cmp-card__footer"), cardFooterColour)
402
408
  }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
403
409
  icon: faChevronRight
404
410
  })) : cardStyle === "label" ? /*#__PURE__*/React.createElement("span", {
405
- className: getStyle$1("cmp-card__footer")
411
+ className: getClassName("cmp-card__footer")
406
412
  }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
407
413
  icon: faArrowRight
408
414
  })) : /*#__PURE__*/React.createElement("span", {
409
- className: getStyle$1("cmp-card__footer")
415
+ className: getClassName("cmp-card__footer")
410
416
  }, /*#__PURE__*/React.createElement("span", null, cta))))));
411
417
  };
412
418
  var ProductCard = function (_a) {
@@ -423,33 +429,39 @@ var ProductCard = function (_a) {
423
429
  cta = _a.cta,
424
430
  cardStyle = _a.cardStyle,
425
431
  placeholder = _a.placeholder,
426
- onClick = _a.onClick;
432
+ onClick = _a.onClick,
433
+ _c = _a.usePlainClasses,
434
+ usePlainClasses = _c === void 0 ? false : _c;
435
+ // Helper to get class name - plain or CSS module
436
+ var getClassName = function (name) {
437
+ return usePlainClasses ? name : getStyle$1(name);
438
+ };
427
439
  var width = cardSizeMapping(size);
428
- var mode = getStyle$1("cmp-card--".concat(cardStyle));
440
+ var mode = usePlainClasses ? "cmp-card--".concat(cardStyle) : getStyle$1("cmp-card--".concat(cardStyle));
429
441
  var productImage = getImageUrl(imageUrl);
430
442
  return /*#__PURE__*/React.createElement("div", {
431
- className: classnames(getStyle$1("cmp-card"), mode, width, className)
443
+ className: classnames(getClassName("cmp-card"), mode, width, className)
432
444
  }, /*#__PURE__*/React.createElement("a", {
433
445
  href: cardLink,
434
- className: getStyle$1("cmp-card__link"),
446
+ className: getClassName("cmp-card__link"),
435
447
  onClick: onClick,
436
448
  target: "_blank"
437
449
  }, /*#__PURE__*/React.createElement("div", {
438
- className: classnames(getStyle$1("cmp-card--type-card-product__wrapper"), showImage ? "" : getStyle$1("cmp-card--type-card-product-no-image__wrapper"))
450
+ className: classnames(getClassName("cmp-card--type-card-product__wrapper"), showImage ? "" : getClassName("cmp-card--type-card-product-no-image__wrapper"))
439
451
  }, showImage && /*#__PURE__*/React.createElement("div", {
440
- className: getStyle$1("cmp-card--type-card-product__image")
452
+ className: getClassName("cmp-card--type-card-product__image")
441
453
  }, /*#__PURE__*/React.createElement("figure", null, /*#__PURE__*/React.createElement("img", {
442
454
  src: productImage,
443
455
  alt: imageAlt,
444
456
  className: !imageUrl || placeholder ? "placeholderImage" : undefined
445
457
  }))), /*#__PURE__*/React.createElement("div", {
446
- className: getStyle$1("cmp-card--type-card-product__meta")
458
+ className: getClassName("cmp-card--type-card-product__meta")
447
459
  }, /*#__PURE__*/React.createElement("p", {
448
- className: getStyle$1("cmp-card--type-card-product__title")
460
+ className: getClassName("cmp-card--type-card-product__title")
449
461
  }, title), productPrice && showProductPrice !== false ? /*#__PURE__*/React.createElement("p", {
450
- className: getStyle$1("cmp-card--type-card-product__prices")
462
+ className: getClassName("cmp-card--type-card-product__prices")
451
463
  }, productPrice) : "", /*#__PURE__*/React.createElement("p", {
452
- className: getStyle$1("cmp-card--type-card-product__cta")
464
+ className: getClassName("cmp-card--type-card-product__cta")
453
465
  }, cta ? cta : /*#__PURE__*/React.createElement(FontAwesomeIcon, {
454
466
  icon: faArrowRight
455
467
  }))))));
@@ -464,22 +476,31 @@ var ProductDetailsCard = function (_a) {
464
476
  _a.placeholder;
465
477
  _a.onClick;
466
478
  var hit = _a.hit,
467
- facets = _a.facets;
479
+ facets = _a.facets,
480
+ _b = _a.usePlainClasses,
481
+ usePlainClasses = _b === void 0 ? false : _b,
482
+ ProductCardComponent = _a.ProductCardComponent;
483
+ // Helper to get class name - plain or CSS module
484
+ var getClassName = function (name) {
485
+ return usePlainClasses ? name : getStyle$1(name);
486
+ };
487
+ // Use custom ProductCard if provided, otherwise use default
488
+ var SpareCard = ProductCardComponent || ProductCard;
468
489
  // Memoize spares rendering with a limit to prevent freeze
469
490
  var renderSpares = function () {
470
491
  if (!(hit === null || hit === void 0 ? void 0 : hit.spares) || !Array.isArray(hit.spares) || hit.spares.length === 0) return null;
471
492
  // Limit the number of spares to prevent freeze
472
493
  var sparesToRender = hit.spares.slice(0, MAX_SPARES_TO_RENDER);
473
494
  return /*#__PURE__*/React.createElement("ul", {
474
- className: getStyle$1("folding-spares-list")
495
+ className: getClassName("folding-spares-list")
475
496
  }, sparesToRender.map(function (spare, index) {
476
497
  // Safety check - skip if spare is not a valid object
477
498
  if (!spare || typeof spare !== 'object') return null;
478
499
  return /*#__PURE__*/React.createElement("li", {
479
500
  key: spare.objectID || spare.code || "spare-".concat(index)
480
- }, /*#__PURE__*/React.createElement(ProductCard, {
501
+ }, /*#__PURE__*/React.createElement(SpareCard, {
481
502
  cardStyle: "type-card-product",
482
- className: getStyle$1("cmp-card"),
503
+ className: getClassName("cmp-card"),
483
504
  title: spare.name || 'Spare Part',
484
505
  imageUrl: spare['img-product'] || spare.image || '',
485
506
  imageAlt: spare.name || 'Spare Part',
@@ -487,31 +508,33 @@ var ProductDetailsCard = function (_a) {
487
508
  showProductPrice: true,
488
509
  cardLink: spare.url || spare.link || '#',
489
510
  cta: "Go to webshop",
490
- showImage: false
511
+ showImage: false,
512
+ usePlainClasses: usePlainClasses,
513
+ spare: spare
491
514
  }));
492
515
  }), hit.spares.length > MAX_SPARES_TO_RENDER && /*#__PURE__*/React.createElement("li", {
493
- className: getStyle$1("folding-spares-list__more")
516
+ className: getClassName("folding-spares-list__more")
494
517
  }, "+", hit.spares.length - MAX_SPARES_TO_RENDER, " more items"));
495
518
  };
496
519
  return /*#__PURE__*/React.createElement("div", {
497
- className: getStyle$1("cmp-card--type-product_details")
520
+ className: getClassName("cmp-card--type-product_details")
498
521
  }, /*#__PURE__*/React.createElement("div", {
499
- className: getStyle$1("cmp-card--type-product_details__product-info")
522
+ className: getClassName("cmp-card--type-product_details__product-info")
500
523
  }, /*#__PURE__*/React.createElement("div", {
501
- className: getStyle$1("cmp-card--type-product_details__header")
524
+ className: getClassName("cmp-card--type-product_details__header")
502
525
  }, /*#__PURE__*/React.createElement("h3", {
503
- className: getStyle$1("cmp-card--type-product_details__header__title")
526
+ className: getClassName("cmp-card--type-product_details__header__title")
504
527
  }, title), /*#__PURE__*/React.createElement("p", {
505
- className: getStyle$1("cmp-card--type-product_details__header__product-code")
506
- }, "Product:", hit.code), /*#__PURE__*/React.createElement("img", {
507
- src: hit.image,
528
+ className: getClassName("cmp-card--type-product_details__header__product-code")
529
+ }, "Product:", hit === null || hit === void 0 ? void 0 : hit.code), /*#__PURE__*/React.createElement("img", {
530
+ src: hit === null || hit === void 0 ? void 0 : hit.image,
508
531
  alt: imageAlt,
509
- className: getStyle$1("cmp-card--type-product_details__header__product-image")
532
+ className: getClassName("cmp-card--type-product_details__header__product-image")
510
533
  })), facets && /*#__PURE__*/React.createElement(AccordionSection, {
511
534
  title: "Specifications",
512
- className: getStyle$1("folding-specification-holder")
535
+ className: getClassName("folding-specification-holder")
513
536
  }, /*#__PURE__*/React.createElement("ul", {
514
- className: getStyle$1("folding-specification-list")
537
+ className: getClassName("folding-specification-list")
515
538
  }, facets && facets.map(function (facet) {
516
539
  return hit[facet.name] && /*#__PURE__*/React.createElement("li", {
517
540
  key: facet.name
@@ -521,10 +544,10 @@ var ProductDetailsCard = function (_a) {
521
544
  }
522
545
  }) : hit[facet.name]);
523
546
  })))), /*#__PURE__*/React.createElement("div", {
524
- className: getStyle$1("cmp-card--type-product_details__spares-list")
525
- }, hit.spares && hit.spares.length > 0 && /*#__PURE__*/React.createElement(AccordionSection, {
547
+ className: getClassName("cmp-card--type-product_details__spares-list")
548
+ }, (hit === null || hit === void 0 ? void 0 : hit.spares) && hit.spares.length > 0 && /*#__PURE__*/React.createElement(AccordionSection, {
526
549
  title: "Spares & Parts",
527
- className: getStyle$1("folding-spares-holder"),
550
+ className: getClassName("folding-spares-holder"),
528
551
  lazyLoad: true,
529
552
  defaultOpen: true
530
553
  }, renderSpares())));
@@ -1450,5 +1473,5 @@ var QrForm = function (props) {
1450
1473
  })));
1451
1474
  };
1452
1475
 
1453
- export { AccordionSection, AlgoliaDynamicSearchEdwards as AlgoliaDynamicSearch, AlgoliaDynamicSearchRaw, QrForm };
1476
+ export { AccordionSection, AlgoliaDynamicSearchEdwards as AlgoliaDynamicSearch, AlgoliaDynamicSearchRaw, Card, ProductCard, ProductDetailsCard, QrForm };
1454
1477
  //# sourceMappingURL=index.esm.js.map