@asantemedia-org/leybold-design-system 1.0.21 → 1.0.23
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 +1 -1
- package/dist/index.esm.scss +44 -0
- package/dist/index.js +74 -114
- package/dist/index.scss +44 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -925,7 +925,7 @@ var ProductCardHorizontal = function (_a) {
|
|
|
925
925
|
// Alias for backward compatibility
|
|
926
926
|
var ProductCardHorizontalParts = ProductCardHorizontal;
|
|
927
927
|
|
|
928
|
-
var styles$f = {"productDetails":"ProductCardDetails-module__productDetails___-sx2l"};
|
|
928
|
+
var styles$f = {"productDetails":"ProductCardDetails-module__productDetails___-sx2l","spareCard":"ProductCardDetails-module__spareCard___vC1Ju"};
|
|
929
929
|
|
|
930
930
|
// Adapter to map design system props to ProductCardHorizontalParts props
|
|
931
931
|
var SpareCardAdapter = function (props) {
|
package/dist/index.esm.scss
CHANGED
|
@@ -1815,6 +1815,50 @@ h3.ProductCardHorizontal-module__productTitle___xBuu7 {
|
|
|
1815
1815
|
.ProductCardDetails-module__productDetails___-sx2l .accordion-section__content {
|
|
1816
1816
|
padding: 0 0 1rem 0;
|
|
1817
1817
|
}
|
|
1818
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector {
|
|
1819
|
+
display: inline-flex;
|
|
1820
|
+
align-items: center;
|
|
1821
|
+
gap: 0.5rem;
|
|
1822
|
+
margin-top: 0.25rem;
|
|
1823
|
+
}
|
|
1824
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector__value {
|
|
1825
|
+
font-weight: 600;
|
|
1826
|
+
font-size: 0.95rem;
|
|
1827
|
+
color: #4a4e54;
|
|
1828
|
+
}
|
|
1829
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector__unit {
|
|
1830
|
+
font-size: 0.85rem;
|
|
1831
|
+
color: #99a1ab;
|
|
1832
|
+
}
|
|
1833
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector__dropdown {
|
|
1834
|
+
-webkit-appearance: none;
|
|
1835
|
+
-moz-appearance: none;
|
|
1836
|
+
appearance: none;
|
|
1837
|
+
background-color: transparent;
|
|
1838
|
+
border: none;
|
|
1839
|
+
border-radius: 0;
|
|
1840
|
+
padding: 0.25rem 1.75rem 0.25rem 0.5rem;
|
|
1841
|
+
font-size: 0.85rem;
|
|
1842
|
+
color: #e2001a;
|
|
1843
|
+
cursor: pointer;
|
|
1844
|
+
transition: border-color 0.2s ease, background-color 0.2s ease;
|
|
1845
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
|
|
1846
|
+
background-repeat: no-repeat;
|
|
1847
|
+
background-position: right 0.5rem center;
|
|
1848
|
+
}
|
|
1849
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector__dropdown:hover {
|
|
1850
|
+
background-color: #dae0e3;
|
|
1851
|
+
}
|
|
1852
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector__dropdown:focus {
|
|
1853
|
+
outline: none;
|
|
1854
|
+
box-shadow: 0 0 0 2px rgba(196, 38, 46, 0.15);
|
|
1855
|
+
}
|
|
1856
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector__dropdown option {
|
|
1857
|
+
padding: 0.5rem;
|
|
1858
|
+
}
|
|
1859
|
+
.ProductCardDetails-module__productDetails___-sx2l .ProductCardDetails-module__spareCard___vC1Ju {
|
|
1860
|
+
background-color: white;
|
|
1861
|
+
}
|
|
1818
1862
|
:root {
|
|
1819
1863
|
--leybold-red: #e2001a;
|
|
1820
1864
|
--leybold-black: #000000;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var proSolidSvgIcons = require('@fortawesome/pro-solid-svg-icons');
|
|
8
|
-
var edwardsvacuumDesignSystem = require('@asantemedia-org/edwardsvacuum-design-system');
|
|
1
|
+
import React, { useMemo, useState, useCallback, useRef, useEffect } from 'react';
|
|
2
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
|
+
import { faArrowLeft, faArrowLeftLong, faArrowRight, faArrowRightLong, faChevronRight, faChevronLeft, faArrowUpRightFromSquare, faGlobe, faXmark as faXmark$1 } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
+
import { faInstagram, faYoutube, faLinkedinIn, faXTwitter, faFacebookF } from '@fortawesome/free-brands-svg-icons';
|
|
5
|
+
import { faChevronRight as faChevronRight$1, faArrowUpRightFromSquare as faArrowUpRightFromSquare$1 } from '@fortawesome/pro-solid-svg-icons';
|
|
6
|
+
import { ProductDetailsCard, AlgoliaDynamicSearchRaw, QrForm } from '@asantemedia-org/edwardsvacuum-design-system';
|
|
9
7
|
|
|
10
8
|
function _extends() {
|
|
11
9
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -139,20 +137,20 @@ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
|
139
137
|
var getIcon = function (icon) {
|
|
140
138
|
switch (icon) {
|
|
141
139
|
case "arrow-right":
|
|
142
|
-
return /*#__PURE__*/React.createElement(
|
|
143
|
-
icon:
|
|
140
|
+
return /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
141
|
+
icon: faArrowRight
|
|
144
142
|
});
|
|
145
143
|
case "external":
|
|
146
|
-
return /*#__PURE__*/React.createElement(
|
|
147
|
-
icon:
|
|
144
|
+
return /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
145
|
+
icon: faArrowUpRightFromSquare
|
|
148
146
|
});
|
|
149
147
|
case "chevron-left":
|
|
150
|
-
return /*#__PURE__*/React.createElement(
|
|
151
|
-
icon:
|
|
148
|
+
return /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
149
|
+
icon: faChevronLeft
|
|
152
150
|
});
|
|
153
151
|
case "chevron-right":
|
|
154
|
-
return /*#__PURE__*/React.createElement(
|
|
155
|
-
icon:
|
|
152
|
+
return /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
153
|
+
icon: faChevronRight
|
|
156
154
|
});
|
|
157
155
|
default:
|
|
158
156
|
return null;
|
|
@@ -233,19 +231,19 @@ var Button = function (_a) {
|
|
|
233
231
|
"data-force-state": props['data-force-state']
|
|
234
232
|
}, props), !isIconOnly && children, isCarouselLeft && /*#__PURE__*/React.createElement("span", {
|
|
235
233
|
className: iconClasses
|
|
236
|
-
}, /*#__PURE__*/React.createElement(
|
|
237
|
-
icon:
|
|
234
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
235
|
+
icon: faArrowLeft,
|
|
238
236
|
className: styles$k.button__icon__default
|
|
239
|
-
}), /*#__PURE__*/React.createElement(
|
|
240
|
-
icon:
|
|
237
|
+
}), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
238
|
+
icon: faArrowLeftLong,
|
|
241
239
|
className: styles$k.button__icon__hover
|
|
242
240
|
})), isCarouselRight && /*#__PURE__*/React.createElement("span", {
|
|
243
241
|
className: iconClasses
|
|
244
|
-
}, /*#__PURE__*/React.createElement(
|
|
245
|
-
icon:
|
|
242
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
243
|
+
icon: faArrowRight,
|
|
246
244
|
className: styles$k.button__icon__default
|
|
247
|
-
}), /*#__PURE__*/React.createElement(
|
|
248
|
-
icon:
|
|
245
|
+
}), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
246
|
+
icon: faArrowRightLong,
|
|
249
247
|
className: styles$k.button__icon__hover
|
|
250
248
|
})), !isIconOnly && iconElement && /*#__PURE__*/React.createElement("span", {
|
|
251
249
|
className: iconClasses
|
|
@@ -310,13 +308,13 @@ var AtlasCopcoIcon = function (_a) {
|
|
|
310
308
|
var SocialIconComponent = function (_a) {
|
|
311
309
|
var platform = _a.platform;
|
|
312
310
|
var iconMap = {
|
|
313
|
-
facebook:
|
|
314
|
-
x:
|
|
315
|
-
linkedin:
|
|
316
|
-
youtube:
|
|
317
|
-
instagram:
|
|
311
|
+
facebook: faFacebookF,
|
|
312
|
+
x: faXTwitter,
|
|
313
|
+
linkedin: faLinkedinIn,
|
|
314
|
+
youtube: faYoutube,
|
|
315
|
+
instagram: faInstagram
|
|
318
316
|
};
|
|
319
|
-
return /*#__PURE__*/React.createElement(
|
|
317
|
+
return /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
320
318
|
icon: iconMap[platform]
|
|
321
319
|
});
|
|
322
320
|
};
|
|
@@ -419,8 +417,8 @@ var FooterBottom = function (_a) {
|
|
|
419
417
|
className: styles$j.footer__countrySelector
|
|
420
418
|
}, countrySelector.showIcon !== false && /*#__PURE__*/React.createElement("span", {
|
|
421
419
|
className: styles$j.footer__countrySelectorIcon
|
|
422
|
-
}, /*#__PURE__*/React.createElement(
|
|
423
|
-
icon:
|
|
420
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
421
|
+
icon: faGlobe
|
|
424
422
|
})), countrySelector.label));
|
|
425
423
|
};
|
|
426
424
|
// =============================================================================
|
|
@@ -611,8 +609,8 @@ var PaginationButton = function (_a) {
|
|
|
611
609
|
className: "".concat(styles$i.navButton, " ").concat(styles$i["navButton--".concat(direction)], " ").concat(disabled ? styles$i.navButtonDisabled : "", " ").concat(className || ""),
|
|
612
610
|
"aria-label": ariaLabel || label,
|
|
613
611
|
tabIndex: disabled ? -1 : 0
|
|
614
|
-
}, /*#__PURE__*/React.createElement("span", null, label), direction === "next" && /*#__PURE__*/React.createElement(
|
|
615
|
-
icon:
|
|
612
|
+
}, /*#__PURE__*/React.createElement("span", null, label), direction === "next" && /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
613
|
+
icon: faChevronRight$1,
|
|
616
614
|
className: styles$i.navIcon,
|
|
617
615
|
"aria-hidden": "true"
|
|
618
616
|
})));
|
|
@@ -690,7 +688,7 @@ var Pagination = function (_a) {
|
|
|
690
688
|
className = _a.className,
|
|
691
689
|
_g = _a.ariaLabel,
|
|
692
690
|
ariaLabel = _g === void 0 ? "Pagination" : _g;
|
|
693
|
-
var pageNumbers =
|
|
691
|
+
var pageNumbers = useMemo(function () {
|
|
694
692
|
return generatePageNumbers(currentPage, totalPages, maxVisiblePages);
|
|
695
693
|
}, [currentPage, totalPages, maxVisiblePages]);
|
|
696
694
|
var handlePageChange = function (page) {
|
|
@@ -770,21 +768,21 @@ var Image = function (_a) {
|
|
|
770
768
|
className = _g === void 0 ? "" : _g,
|
|
771
769
|
srcSet = _a.srcSet,
|
|
772
770
|
sizes = _a.sizes;
|
|
773
|
-
var _h =
|
|
771
|
+
var _h = useState(true),
|
|
774
772
|
isLoading = _h[0],
|
|
775
773
|
setIsLoading = _h[1];
|
|
776
|
-
var _j =
|
|
774
|
+
var _j = useState(false),
|
|
777
775
|
hasError = _j[0],
|
|
778
776
|
setHasError = _j[1];
|
|
779
|
-
var _k =
|
|
777
|
+
var _k = useState(src),
|
|
780
778
|
currentSrc = _k[0],
|
|
781
779
|
setCurrentSrc = _k[1];
|
|
782
|
-
var handleLoad =
|
|
780
|
+
var handleLoad = useCallback(function () {
|
|
783
781
|
setIsLoading(false);
|
|
784
782
|
setHasError(false);
|
|
785
783
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad();
|
|
786
784
|
}, [onLoad]);
|
|
787
|
-
var handleError =
|
|
785
|
+
var handleError = useCallback(function () {
|
|
788
786
|
setIsLoading(false);
|
|
789
787
|
setHasError(true);
|
|
790
788
|
// Try fallback if available and not already using it
|
|
@@ -918,7 +916,7 @@ var ProductCardHorizontal = function (_a) {
|
|
|
918
916
|
className: styles$h.productButton,
|
|
919
917
|
onClick: button.onClick,
|
|
920
918
|
size: "extra-small"
|
|
921
|
-
}, button.label) : /*#__PURE__*/React.createElement(
|
|
919
|
+
}, button.label) : /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
922
920
|
icon: faArrowUpRight,
|
|
923
921
|
className: styles$h.productArrowIcon,
|
|
924
922
|
"aria-hidden": "true"
|
|
@@ -927,7 +925,7 @@ var ProductCardHorizontal = function (_a) {
|
|
|
927
925
|
// Alias for backward compatibility
|
|
928
926
|
var ProductCardHorizontalParts = ProductCardHorizontal;
|
|
929
927
|
|
|
930
|
-
var styles$f = {"productDetails":"ProductCardDetails-module__productDetails___-sx2l"};
|
|
928
|
+
var styles$f = {"productDetails":"ProductCardDetails-module__productDetails___-sx2l","spareCard":"ProductCardDetails-module__spareCard___vC1Ju"};
|
|
931
929
|
|
|
932
930
|
// Adapter to map design system props to ProductCardHorizontalParts props
|
|
933
931
|
var SpareCardAdapter = function (props) {
|
|
@@ -973,7 +971,7 @@ var ProductCardDetails = function (_a) {
|
|
|
973
971
|
};
|
|
974
972
|
return /*#__PURE__*/React.createElement("div", {
|
|
975
973
|
className: styles$f.productDetails
|
|
976
|
-
}, /*#__PURE__*/React.createElement(
|
|
974
|
+
}, /*#__PURE__*/React.createElement(ProductDetailsCard, {
|
|
977
975
|
className: "".concat(className),
|
|
978
976
|
title: title,
|
|
979
977
|
imageUrl: imageUrl,
|
|
@@ -1053,7 +1051,7 @@ var AlgoliaDynamicSearchLeybold = function (props) {
|
|
|
1053
1051
|
ProductCard: ProductCardAdapter,
|
|
1054
1052
|
ProductDetailsCard: ProductCardDetailsAdapter
|
|
1055
1053
|
};
|
|
1056
|
-
return /*#__PURE__*/React.createElement(
|
|
1054
|
+
return /*#__PURE__*/React.createElement(AlgoliaDynamicSearchRaw, _extends({}, props, {
|
|
1057
1055
|
innerComponents: innerComponents
|
|
1058
1056
|
}));
|
|
1059
1057
|
};
|
|
@@ -1105,7 +1103,7 @@ var QrFormButtonAdapter = function (_a) {
|
|
|
1105
1103
|
var QrFormLeybold = function (props) {
|
|
1106
1104
|
return /*#__PURE__*/React.createElement("div", {
|
|
1107
1105
|
className: "qr-journey-form-wrapper"
|
|
1108
|
-
}, /*#__PURE__*/React.createElement(
|
|
1106
|
+
}, /*#__PURE__*/React.createElement(QrForm, _extends({}, props, {
|
|
1109
1107
|
ButtonComponent: QrFormButtonAdapter
|
|
1110
1108
|
})));
|
|
1111
1109
|
};
|
|
@@ -1158,9 +1156,9 @@ var SearchModal = function (_a) {
|
|
|
1158
1156
|
_c = _a.className,
|
|
1159
1157
|
className = _c === void 0 ? '' : _c,
|
|
1160
1158
|
stickyHeaderContent = _a.stickyHeaderContent;
|
|
1161
|
-
var modalRef =
|
|
1162
|
-
var previouslyFocusedElement =
|
|
1163
|
-
|
|
1159
|
+
var modalRef = useRef(null);
|
|
1160
|
+
var previouslyFocusedElement = useRef(null);
|
|
1161
|
+
useEffect(function () {
|
|
1164
1162
|
if (isOpen) {
|
|
1165
1163
|
// Store the previously focused element
|
|
1166
1164
|
previouslyFocusedElement.current = document.activeElement;
|
|
@@ -1182,7 +1180,7 @@ var SearchModal = function (_a) {
|
|
|
1182
1180
|
document.body.style.overflow = '';
|
|
1183
1181
|
};
|
|
1184
1182
|
}, [isOpen]);
|
|
1185
|
-
|
|
1183
|
+
useEffect(function () {
|
|
1186
1184
|
var handleEscape = function (event) {
|
|
1187
1185
|
if (event.key === 'Escape' && isOpen) {
|
|
1188
1186
|
onClose();
|
|
@@ -1194,7 +1192,7 @@ var SearchModal = function (_a) {
|
|
|
1194
1192
|
};
|
|
1195
1193
|
}, [isOpen, onClose]);
|
|
1196
1194
|
// Focus trap implementation
|
|
1197
|
-
|
|
1195
|
+
useEffect(function () {
|
|
1198
1196
|
if (!isOpen || !modalRef.current) return;
|
|
1199
1197
|
var modal = modalRef.current;
|
|
1200
1198
|
var focusableElements = modal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
@@ -1620,7 +1618,7 @@ var FilterSearch = function (_a) {
|
|
|
1620
1618
|
};
|
|
1621
1619
|
return /*#__PURE__*/React.createElement("div", {
|
|
1622
1620
|
className: "".concat(styles$7.filterSearch, " ").concat(className || "")
|
|
1623
|
-
}, !value && /*#__PURE__*/React.createElement(
|
|
1621
|
+
}, !value && /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
1624
1622
|
icon: faMagnifyingGlass,
|
|
1625
1623
|
className: styles$7.searchIcon,
|
|
1626
1624
|
"aria-hidden": "true"
|
|
@@ -1636,8 +1634,8 @@ var FilterSearch = function (_a) {
|
|
|
1636
1634
|
onClick: handleClear,
|
|
1637
1635
|
className: styles$7.clearButton,
|
|
1638
1636
|
"aria-label": "Clear search"
|
|
1639
|
-
}, /*#__PURE__*/React.createElement(
|
|
1640
|
-
icon:
|
|
1637
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
1638
|
+
icon: faXmark$1
|
|
1641
1639
|
})));
|
|
1642
1640
|
};
|
|
1643
1641
|
|
|
@@ -1733,11 +1731,11 @@ var FilterAccordion = function (_a) {
|
|
|
1733
1731
|
variant = _b === void 0 ? 'desktop' : _b,
|
|
1734
1732
|
_c = _a.showCheckbox,
|
|
1735
1733
|
showCheckbox = _c === void 0 ? true : _c;
|
|
1736
|
-
var _d =
|
|
1734
|
+
var _d = useState(""),
|
|
1737
1735
|
searchQuery = _d[0],
|
|
1738
1736
|
setSearchQuery = _d[1];
|
|
1739
1737
|
// Filter facet values based on search query
|
|
1740
|
-
var filteredValues =
|
|
1738
|
+
var filteredValues = useMemo(function () {
|
|
1741
1739
|
if (!searchQuery.trim()) {
|
|
1742
1740
|
return facet.values;
|
|
1743
1741
|
}
|
|
@@ -1864,7 +1862,7 @@ var AppliedFilters = function (_a) {
|
|
|
1864
1862
|
_a.onClearAll;
|
|
1865
1863
|
var className = _a.className;
|
|
1866
1864
|
// Extract all refined (selected) filters
|
|
1867
|
-
var appliedFilters =
|
|
1865
|
+
var appliedFilters = useMemo(function () {
|
|
1868
1866
|
var filters = [];
|
|
1869
1867
|
facets.forEach(function (facet) {
|
|
1870
1868
|
facet.values.forEach(function (value) {
|
|
@@ -1919,7 +1917,7 @@ var FiltersPanel = function (_a) {
|
|
|
1919
1917
|
_d = _a.showCheckbox,
|
|
1920
1918
|
showCheckbox = _d === void 0 ? true : _d;
|
|
1921
1919
|
// Track which accordions are expanded (transient UI state)
|
|
1922
|
-
var _e =
|
|
1920
|
+
var _e = useState(function () {
|
|
1923
1921
|
// Initialize with default expanded facets
|
|
1924
1922
|
var expanded = new Set();
|
|
1925
1923
|
facets.forEach(function (facet) {
|
|
@@ -1932,7 +1930,7 @@ var FiltersPanel = function (_a) {
|
|
|
1932
1930
|
expandedAccordions = _e[0],
|
|
1933
1931
|
setExpandedAccordions = _e[1];
|
|
1934
1932
|
// Sync expansion state when facets change (e.g., new facets appear after refetch)
|
|
1935
|
-
|
|
1933
|
+
useEffect(function () {
|
|
1936
1934
|
setExpandedAccordions(function (prev) {
|
|
1937
1935
|
var next = new Set(prev);
|
|
1938
1936
|
// Add new facets with defaultExpanded
|
|
@@ -1953,7 +1951,7 @@ var FiltersPanel = function (_a) {
|
|
|
1953
1951
|
return next;
|
|
1954
1952
|
});
|
|
1955
1953
|
}, [facets]);
|
|
1956
|
-
var handleAccordionToggle =
|
|
1954
|
+
var handleAccordionToggle = useCallback(function (facetId) {
|
|
1957
1955
|
setExpandedAccordions(function (prev) {
|
|
1958
1956
|
var next = new Set(prev);
|
|
1959
1957
|
if (next.has(facetId)) {
|
|
@@ -1964,13 +1962,13 @@ var FiltersPanel = function (_a) {
|
|
|
1964
1962
|
return next;
|
|
1965
1963
|
});
|
|
1966
1964
|
}, []);
|
|
1967
|
-
var handleValueToggle =
|
|
1965
|
+
var handleValueToggle = useCallback(function (attribute, value) {
|
|
1968
1966
|
onFacetToggle(attribute, value);
|
|
1969
1967
|
}, [onFacetToggle]);
|
|
1970
|
-
var handleRemoveFilter =
|
|
1968
|
+
var handleRemoveFilter = useCallback(function (attribute, value) {
|
|
1971
1969
|
onFacetToggle(attribute, value);
|
|
1972
1970
|
}, [onFacetToggle]);
|
|
1973
|
-
var handleClearAll =
|
|
1971
|
+
var handleClearAll = useCallback(function () {
|
|
1974
1972
|
// Remove all refined facets
|
|
1975
1973
|
facets.forEach(function (facet) {
|
|
1976
1974
|
facet.values.forEach(function (value) {
|
|
@@ -2082,8 +2080,8 @@ var ProductCardVertical = function (_a) {
|
|
|
2082
2080
|
className: styles$6.productCardVertical__button,
|
|
2083
2081
|
"aria-label": "".concat(buttonLabel, " - ").concat(title),
|
|
2084
2082
|
tabIndex: -1
|
|
2085
|
-
}, /*#__PURE__*/React.createElement("span", null, buttonLabel), /*#__PURE__*/React.createElement(
|
|
2086
|
-
icon:
|
|
2083
|
+
}, /*#__PURE__*/React.createElement("span", null, buttonLabel), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
2084
|
+
icon: faArrowUpRightFromSquare$1,
|
|
2087
2085
|
"aria-hidden": "true"
|
|
2088
2086
|
})));
|
|
2089
2087
|
};
|
|
@@ -2361,10 +2359,10 @@ var FilterDrawer = function (_a) {
|
|
|
2361
2359
|
onClose = _a.onClose,
|
|
2362
2360
|
children = _a.children,
|
|
2363
2361
|
className = _a.className;
|
|
2364
|
-
var drawerRef =
|
|
2365
|
-
var previouslyFocusedElement =
|
|
2362
|
+
var drawerRef = useRef(null);
|
|
2363
|
+
var previouslyFocusedElement = useRef(null);
|
|
2366
2364
|
// Focus management
|
|
2367
|
-
|
|
2365
|
+
useEffect(function () {
|
|
2368
2366
|
if (isOpen) {
|
|
2369
2367
|
// Store previously focused element
|
|
2370
2368
|
previouslyFocusedElement.current = document.activeElement;
|
|
@@ -2387,7 +2385,7 @@ var FilterDrawer = function (_a) {
|
|
|
2387
2385
|
};
|
|
2388
2386
|
}, [isOpen]);
|
|
2389
2387
|
// Escape key handler
|
|
2390
|
-
|
|
2388
|
+
useEffect(function () {
|
|
2391
2389
|
var handleEscape = function (event) {
|
|
2392
2390
|
if (event.key === 'Escape' && isOpen) {
|
|
2393
2391
|
onClose();
|
|
@@ -2399,7 +2397,7 @@ var FilterDrawer = function (_a) {
|
|
|
2399
2397
|
};
|
|
2400
2398
|
}, [isOpen, onClose]);
|
|
2401
2399
|
// Focus trap implementation
|
|
2402
|
-
|
|
2400
|
+
useEffect(function () {
|
|
2403
2401
|
if (!isOpen || !drawerRef.current) return;
|
|
2404
2402
|
var drawer = drawerRef.current;
|
|
2405
2403
|
var focusableElements = drawer.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
@@ -2443,7 +2441,7 @@ var FilterDrawer = function (_a) {
|
|
|
2443
2441
|
onClick: onClose,
|
|
2444
2442
|
"aria-label": "Close filters",
|
|
2445
2443
|
className: styles$2.drawerCloseButton
|
|
2446
|
-
}, /*#__PURE__*/React.createElement(
|
|
2444
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
2447
2445
|
icon: faXmark
|
|
2448
2446
|
})), /*#__PURE__*/React.createElement("div", {
|
|
2449
2447
|
ref: drawerRef,
|
|
@@ -2483,7 +2481,7 @@ var FederatedResultsView = function (_a) {
|
|
|
2483
2481
|
var displayProducts = activeTab === "content" ? [] : products;
|
|
2484
2482
|
var displayContents = activeTab === "products" ? [] : contents;
|
|
2485
2483
|
// Content tab single-select handler (clears all others when selecting)
|
|
2486
|
-
var handleContentCategorySelect =
|
|
2484
|
+
var handleContentCategorySelect = useCallback(function (attribute, value) {
|
|
2487
2485
|
var facet = facets.find(function (f) {
|
|
2488
2486
|
return f.attribute === attribute;
|
|
2489
2487
|
});
|
|
@@ -2503,7 +2501,7 @@ var FederatedResultsView = function (_a) {
|
|
|
2503
2501
|
}
|
|
2504
2502
|
}, [facets, onFacetToggle]);
|
|
2505
2503
|
// Track if any filters applied
|
|
2506
|
-
var hasAppliedFilters =
|
|
2504
|
+
var hasAppliedFilters = useMemo(function () {
|
|
2507
2505
|
return facets.some(function (facet) {
|
|
2508
2506
|
return facet.values.some(function (value) {
|
|
2509
2507
|
return value.isRefined;
|
|
@@ -2511,9 +2509,9 @@ var FederatedResultsView = function (_a) {
|
|
|
2511
2509
|
});
|
|
2512
2510
|
}, [facets]);
|
|
2513
2511
|
// Track previous filter state to detect transitions
|
|
2514
|
-
var prevHasAppliedFilters =
|
|
2512
|
+
var prevHasAppliedFilters = useRef(hasAppliedFilters);
|
|
2515
2513
|
// Auto-close drawer when transitioning FROM filters applied TO no filters (mobile only)
|
|
2516
|
-
|
|
2514
|
+
useEffect(function () {
|
|
2517
2515
|
// Only close if we HAD filters and now have NONE (not on initial open)
|
|
2518
2516
|
if (prevHasAppliedFilters.current && !hasAppliedFilters && isFilterDrawerOpen && onFilterDrawerClose) {
|
|
2519
2517
|
onFilterDrawerClose();
|
|
@@ -2675,7 +2673,7 @@ var FederatedSearchExperience = function (_a) {
|
|
|
2675
2673
|
onFilterDrawerToggle = _a.onFilterDrawerToggle,
|
|
2676
2674
|
onFilterDrawerClose = _a.onFilterDrawerClose;
|
|
2677
2675
|
// Track if any filters are active (for red dot indicator)
|
|
2678
|
-
var hasAppliedFilters =
|
|
2676
|
+
var hasAppliedFilters = useMemo(function () {
|
|
2679
2677
|
return facets.some(function (facet) {
|
|
2680
2678
|
return facet.values.some(function (value) {
|
|
2681
2679
|
return value.isRefined;
|
|
@@ -2857,42 +2855,4 @@ var SearchTriggerButton = function (_a) {
|
|
|
2857
2855
|
}, label));
|
|
2858
2856
|
};
|
|
2859
2857
|
|
|
2860
|
-
|
|
2861
|
-
exports.AlgoliaDynamicSearchLeybold = AlgoliaDynamicSearchLeybold;
|
|
2862
|
-
exports.AppliedFilterTag = AppliedFilterTag;
|
|
2863
|
-
exports.AppliedFilters = AppliedFilters;
|
|
2864
|
-
exports.Button = Button;
|
|
2865
|
-
exports.ContentCardHorizontal = ContentCardHorizontal;
|
|
2866
|
-
exports.FederatedInstantResultsLayout = FederatedInstantResultsLayout;
|
|
2867
|
-
exports.FederatedResultsView = FederatedResultsView;
|
|
2868
|
-
exports.FederatedSearchExperience = FederatedSearchExperience;
|
|
2869
|
-
exports.FilterAccordion = FilterAccordion;
|
|
2870
|
-
exports.FilterItem = FilterItem;
|
|
2871
|
-
exports.FilterSearch = FilterSearch;
|
|
2872
|
-
exports.FiltersPanel = FiltersPanel;
|
|
2873
|
-
exports.Footer = Footer;
|
|
2874
|
-
exports.FooterBottom = FooterBottom;
|
|
2875
|
-
exports.FooterLink = FooterLink;
|
|
2876
|
-
exports.FooterLinkGroup = FooterLinkGroup;
|
|
2877
|
-
exports.FooterSocialIcon = FooterSocialIcon;
|
|
2878
|
-
exports.FooterSocialIcons = FooterSocialIcons;
|
|
2879
|
-
exports.ModalCloseButton = ModalCloseButton;
|
|
2880
|
-
exports.Pagination = Pagination;
|
|
2881
|
-
exports.PaginationButton = PaginationButton;
|
|
2882
|
-
exports.PaginationEllipsis = PaginationEllipsis;
|
|
2883
|
-
exports.PaginationItem = PaginationItem;
|
|
2884
|
-
exports.ProductCardHorizontal = ProductCardHorizontal;
|
|
2885
|
-
exports.ProductCardVertical = ProductCardVertical;
|
|
2886
|
-
exports.QrForm = QrFormLeybold;
|
|
2887
|
-
exports.QrFormLeybold = QrFormLeybold;
|
|
2888
|
-
exports.ResultsColumn = ResultsColumn;
|
|
2889
|
-
exports.ResultsCount = ResultsCount;
|
|
2890
|
-
exports.ResultsList = ResultsList;
|
|
2891
|
-
exports.SearchBar = SearchBar;
|
|
2892
|
-
exports.SearchIcon = SearchIcon;
|
|
2893
|
-
exports.SearchInput = SearchInput;
|
|
2894
|
-
exports.SearchModal = SearchModal;
|
|
2895
|
-
exports.SearchSubmitButton = SearchSubmitButton;
|
|
2896
|
-
exports.SearchTriggerButton = SearchTriggerButton;
|
|
2897
|
-
exports.SeeAllLinkButton = SeeAllLinkButton;
|
|
2898
|
-
//# sourceMappingURL=index.js.map
|
|
2858
|
+
export { AlgoliaDynamicSearchLeybold as AlgoliaDynamicSearch, AlgoliaDynamicSearchLeybold, AppliedFilterTag, AppliedFilters, Button, ContentCardHorizontal, FederatedInstantResultsLayout, FederatedResultsView, FederatedSearchExperience, FilterAccordion, FilterItem, FilterSearch, FiltersPanel, Footer, FooterBottom, FooterLink, FooterLinkGroup, FooterSocialIcon, FooterSocialIcons, ModalCloseButton, Pagination, PaginationButton, PaginationEllipsis, PaginationItem, ProductCardHorizontal, ProductCardVertical, QrFormLeybold as QrForm, QrFormLeybold, ResultsColumn, ResultsCount, ResultsList, SearchBar, SearchIcon, SearchInput, SearchModal, SearchSubmitButton, SearchTriggerButton, SeeAllLinkButton };
|
package/dist/index.scss
CHANGED
|
@@ -1815,6 +1815,50 @@ h3.ProductCardHorizontal-module__productTitle___xBuu7 {
|
|
|
1815
1815
|
.ProductCardDetails-module__productDetails___-sx2l .accordion-section__content {
|
|
1816
1816
|
padding: 0 0 1rem 0;
|
|
1817
1817
|
}
|
|
1818
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector {
|
|
1819
|
+
display: inline-flex;
|
|
1820
|
+
align-items: center;
|
|
1821
|
+
gap: 0.5rem;
|
|
1822
|
+
margin-top: 0.25rem;
|
|
1823
|
+
}
|
|
1824
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector__value {
|
|
1825
|
+
font-weight: 600;
|
|
1826
|
+
font-size: 0.95rem;
|
|
1827
|
+
color: #4a4e54;
|
|
1828
|
+
}
|
|
1829
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector__unit {
|
|
1830
|
+
font-size: 0.85rem;
|
|
1831
|
+
color: #99a1ab;
|
|
1832
|
+
}
|
|
1833
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector__dropdown {
|
|
1834
|
+
-webkit-appearance: none;
|
|
1835
|
+
-moz-appearance: none;
|
|
1836
|
+
appearance: none;
|
|
1837
|
+
background-color: transparent;
|
|
1838
|
+
border: none;
|
|
1839
|
+
border-radius: 0;
|
|
1840
|
+
padding: 0.25rem 1.75rem 0.25rem 0.5rem;
|
|
1841
|
+
font-size: 0.85rem;
|
|
1842
|
+
color: #e2001a;
|
|
1843
|
+
cursor: pointer;
|
|
1844
|
+
transition: border-color 0.2s ease, background-color 0.2s ease;
|
|
1845
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
|
|
1846
|
+
background-repeat: no-repeat;
|
|
1847
|
+
background-position: right 0.5rem center;
|
|
1848
|
+
}
|
|
1849
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector__dropdown:hover {
|
|
1850
|
+
background-color: #dae0e3;
|
|
1851
|
+
}
|
|
1852
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector__dropdown:focus {
|
|
1853
|
+
outline: none;
|
|
1854
|
+
box-shadow: 0 0 0 2px rgba(196, 38, 46, 0.15);
|
|
1855
|
+
}
|
|
1856
|
+
.ProductCardDetails-module__productDetails___-sx2l .facet-unit-selector__dropdown option {
|
|
1857
|
+
padding: 0.5rem;
|
|
1858
|
+
}
|
|
1859
|
+
.ProductCardDetails-module__productDetails___-sx2l .ProductCardDetails-module__spareCard___vC1Ju {
|
|
1860
|
+
background-color: white;
|
|
1861
|
+
}
|
|
1818
1862
|
:root {
|
|
1819
1863
|
--leybold-red: #e2001a;
|
|
1820
1864
|
--leybold-black: #000000;
|