@asantemedia-org/leybold-design-system 1.0.7 → 1.0.9
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.scss +7 -1
- package/dist/index.js +26 -35
- package/dist/index.scss +7 -1
- package/package.json +1 -1
package/dist/index.esm.scss
CHANGED
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
display: flex;
|
|
289
289
|
flex-direction: column;
|
|
290
290
|
gap: 0.5rem;
|
|
291
|
-
padding: 0.5rem;
|
|
291
|
+
padding: 0.5rem !important;
|
|
292
292
|
background-color: white;
|
|
293
293
|
box-shadow: 2.7px 2.7px 5px 0 rgba(0, 0, 0, 0.1);
|
|
294
294
|
}
|
|
@@ -721,6 +721,12 @@
|
|
|
721
721
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
|
722
722
|
font-size: 18px;
|
|
723
723
|
}
|
|
724
|
+
.qr-journey-form-wrapper ::-moz-placeholder {
|
|
725
|
+
font-style: normal;
|
|
726
|
+
}
|
|
727
|
+
.qr-journey-form-wrapper ::placeholder {
|
|
728
|
+
font-style: normal;
|
|
729
|
+
}
|
|
724
730
|
.qr-journey-form-wrapper h1 {
|
|
725
731
|
font-size: 28px;
|
|
726
732
|
font-weight: 400;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var edwardsvacuumDesignSystem = require('@asantemedia-org/edwardsvacuum-design-system');
|
|
1
|
+
import React, { useMemo, useState, useCallback, useRef, useEffect } from 'react';
|
|
2
|
+
import { ProductDetailsCard, AlgoliaDynamicSearchRaw, QrForm } from '@asantemedia-org/edwardsvacuum-design-system';
|
|
5
3
|
|
|
6
4
|
function _extends() {
|
|
7
5
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -277,7 +275,7 @@ const Pagination = ({
|
|
|
277
275
|
className,
|
|
278
276
|
ariaLabel = "Pagination"
|
|
279
277
|
}) => {
|
|
280
|
-
const pageNumbers =
|
|
278
|
+
const pageNumbers = useMemo(() => generatePageNumbers(currentPage, totalPages, maxVisiblePages), [currentPage, totalPages, maxVisiblePages]);
|
|
281
279
|
const handlePageChange = page => {
|
|
282
280
|
if (page >= 1 && page <= totalPages && page !== currentPage) {
|
|
283
281
|
onPageChange(page);
|
|
@@ -349,15 +347,15 @@ const Image = ({
|
|
|
349
347
|
srcSet,
|
|
350
348
|
sizes
|
|
351
349
|
}) => {
|
|
352
|
-
const [isLoading, setIsLoading] =
|
|
353
|
-
const [hasError, setHasError] =
|
|
354
|
-
const [currentSrc, setCurrentSrc] =
|
|
355
|
-
const handleLoad =
|
|
350
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
351
|
+
const [hasError, setHasError] = useState(false);
|
|
352
|
+
const [currentSrc, setCurrentSrc] = useState(src);
|
|
353
|
+
const handleLoad = useCallback(() => {
|
|
356
354
|
setIsLoading(false);
|
|
357
355
|
setHasError(false);
|
|
358
356
|
onLoad?.();
|
|
359
357
|
}, [onLoad]);
|
|
360
|
-
const handleError =
|
|
358
|
+
const handleError = useCallback(() => {
|
|
361
359
|
setIsLoading(false);
|
|
362
360
|
setHasError(true);
|
|
363
361
|
|
|
@@ -536,7 +534,7 @@ const ProductCardDetails = ({
|
|
|
536
534
|
};
|
|
537
535
|
return /*#__PURE__*/React.createElement("div", {
|
|
538
536
|
className: styles$b.productDetails
|
|
539
|
-
}, /*#__PURE__*/React.createElement(
|
|
537
|
+
}, /*#__PURE__*/React.createElement(ProductDetailsCard, {
|
|
540
538
|
className: `${className}`,
|
|
541
539
|
title: title,
|
|
542
540
|
imageUrl: imageUrl,
|
|
@@ -615,7 +613,7 @@ const AlgoliaDynamicSearchLeybold = props => {
|
|
|
615
613
|
ProductCard: ProductCardAdapter,
|
|
616
614
|
ProductDetailsCard: ProductCardDetailsAdapter
|
|
617
615
|
};
|
|
618
|
-
return /*#__PURE__*/React.createElement(
|
|
616
|
+
return /*#__PURE__*/React.createElement(AlgoliaDynamicSearchRaw, _extends({}, props, {
|
|
619
617
|
innerComponents: innerComponents
|
|
620
618
|
}));
|
|
621
619
|
};
|
|
@@ -668,7 +666,7 @@ const QrFormButtonAdapter = ({
|
|
|
668
666
|
const QrFormLeybold = props => {
|
|
669
667
|
return /*#__PURE__*/React.createElement("div", {
|
|
670
668
|
className: "qr-journey-form-wrapper"
|
|
671
|
-
}, /*#__PURE__*/React.createElement(
|
|
669
|
+
}, /*#__PURE__*/React.createElement(QrForm, _extends({}, props, {
|
|
672
670
|
ButtonComponent: QrFormButtonAdapter
|
|
673
671
|
})));
|
|
674
672
|
};
|
|
@@ -714,9 +712,9 @@ const SearchModal = ({
|
|
|
714
712
|
children,
|
|
715
713
|
className = ''
|
|
716
714
|
}) => {
|
|
717
|
-
const modalRef =
|
|
718
|
-
const previouslyFocusedElement =
|
|
719
|
-
|
|
715
|
+
const modalRef = useRef(null);
|
|
716
|
+
const previouslyFocusedElement = useRef(null);
|
|
717
|
+
useEffect(() => {
|
|
720
718
|
if (isOpen) {
|
|
721
719
|
// Store the previously focused element
|
|
722
720
|
previouslyFocusedElement.current = document.activeElement;
|
|
@@ -741,7 +739,7 @@ const SearchModal = ({
|
|
|
741
739
|
document.body.style.overflow = '';
|
|
742
740
|
};
|
|
743
741
|
}, [isOpen]);
|
|
744
|
-
|
|
742
|
+
useEffect(() => {
|
|
745
743
|
const handleEscape = event => {
|
|
746
744
|
if (event.key === 'Escape' && isOpen) {
|
|
747
745
|
onClose();
|
|
@@ -752,7 +750,7 @@ const SearchModal = ({
|
|
|
752
750
|
}, [isOpen, onClose]);
|
|
753
751
|
|
|
754
752
|
// Focus trap implementation
|
|
755
|
-
|
|
753
|
+
useEffect(() => {
|
|
756
754
|
if (!isOpen || !modalRef.current) return;
|
|
757
755
|
const modal = modalRef.current;
|
|
758
756
|
const focusableElements = modal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
@@ -1169,10 +1167,10 @@ const FilterAccordion = ({
|
|
|
1169
1167
|
onValueToggle,
|
|
1170
1168
|
className
|
|
1171
1169
|
}) => {
|
|
1172
|
-
const [searchQuery, setSearchQuery] =
|
|
1170
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
1173
1171
|
|
|
1174
1172
|
// Filter facet values based on search query
|
|
1175
|
-
const filteredValues =
|
|
1173
|
+
const filteredValues = useMemo(() => {
|
|
1176
1174
|
if (!searchQuery.trim()) {
|
|
1177
1175
|
return facet.values;
|
|
1178
1176
|
}
|
|
@@ -1295,7 +1293,7 @@ const AppliedFilters = ({
|
|
|
1295
1293
|
className
|
|
1296
1294
|
}) => {
|
|
1297
1295
|
// Extract all refined (selected) filters
|
|
1298
|
-
const appliedFilters =
|
|
1296
|
+
const appliedFilters = useMemo(() => {
|
|
1299
1297
|
const filters = [];
|
|
1300
1298
|
facets.forEach(facet => {
|
|
1301
1299
|
facet.values.forEach(value => {
|
|
@@ -1360,7 +1358,7 @@ const FiltersPanel = ({
|
|
|
1360
1358
|
className
|
|
1361
1359
|
}) => {
|
|
1362
1360
|
// Track which accordions are expanded
|
|
1363
|
-
const [expandedAccordions, setExpandedAccordions] =
|
|
1361
|
+
const [expandedAccordions, setExpandedAccordions] = useState(() => {
|
|
1364
1362
|
// Initialize with default expanded facets
|
|
1365
1363
|
const expanded = new Set();
|
|
1366
1364
|
facets.forEach(facet => {
|
|
@@ -1370,7 +1368,7 @@ const FiltersPanel = ({
|
|
|
1370
1368
|
});
|
|
1371
1369
|
return expanded;
|
|
1372
1370
|
});
|
|
1373
|
-
const handleAccordionToggle =
|
|
1371
|
+
const handleAccordionToggle = useCallback(facetId => {
|
|
1374
1372
|
setExpandedAccordions(prev => {
|
|
1375
1373
|
const next = new Set(prev);
|
|
1376
1374
|
if (next.has(facetId)) {
|
|
@@ -1381,13 +1379,13 @@ const FiltersPanel = ({
|
|
|
1381
1379
|
return next;
|
|
1382
1380
|
});
|
|
1383
1381
|
}, []);
|
|
1384
|
-
const handleValueToggle =
|
|
1382
|
+
const handleValueToggle = useCallback((attribute, value) => {
|
|
1385
1383
|
onFacetToggle(attribute, value);
|
|
1386
1384
|
}, [onFacetToggle]);
|
|
1387
|
-
const handleRemoveFilter =
|
|
1385
|
+
const handleRemoveFilter = useCallback((attribute, value) => {
|
|
1388
1386
|
onFacetToggle(attribute, value);
|
|
1389
1387
|
}, [onFacetToggle]);
|
|
1390
|
-
const handleClearAll =
|
|
1388
|
+
const handleClearAll = useCallback(() => {
|
|
1391
1389
|
// Remove all refined facets
|
|
1392
1390
|
facets.forEach(facet => {
|
|
1393
1391
|
facet.values.forEach(value => {
|
|
@@ -1775,15 +1773,8 @@ const SearchTriggerButton = ({
|
|
|
1775
1773
|
}, label));
|
|
1776
1774
|
};
|
|
1777
1775
|
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
exports.AppliedFilterTag = AppliedFilterTag;
|
|
1781
|
-
exports.AppliedFilters = AppliedFilters;
|
|
1782
|
-
exports.Button = Button;
|
|
1783
|
-
exports.ContentCardHorizontal = ContentCardHorizontal;
|
|
1784
|
-
exports.FederatedInstantResultsLayout = FederatedInstantResultsLayout;
|
|
1785
|
-
exports.FederatedResultsView = FederatedResultsView;
|
|
1786
|
-
exports.FederatedSearchExperience = FederatedSearchExperience;
|
|
1776
|
+
export { AlgoliaDynamicSearchLeybold as AlgoliaDynamicSearch, AlgoliaDynamicSearchLeybold, AppliedFilterTag, AppliedFilters, Button, ContentCardHorizontal, FederatedInstantResultsLayout, FederatedResultsView, FederatedSearchExperience, FilterAccordion, FilterItem, FilterSearch, FiltersPanel, ModalCloseButton, Pagination, PaginationButton, PaginationEllipsis, PaginationItem, ProductCardHorizontal, QrFormLeybold as QrForm, QrFormLeybold, ResultsColumn, ResultsCount, ResultsList, SearchBar, SearchIcon, SearchInput, SearchModal, SearchSubmitButton, SearchTriggerButton, SeeAllLinkButton };
|
|
1777
|
+
archExperience;
|
|
1787
1778
|
exports.FilterAccordion = FilterAccordion;
|
|
1788
1779
|
exports.FilterItem = FilterItem;
|
|
1789
1780
|
exports.FilterSearch = FilterSearch;
|
package/dist/index.scss
CHANGED
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
display: flex;
|
|
289
289
|
flex-direction: column;
|
|
290
290
|
gap: 0.5rem;
|
|
291
|
-
padding: 0.5rem;
|
|
291
|
+
padding: 0.5rem !important;
|
|
292
292
|
background-color: white;
|
|
293
293
|
box-shadow: 2.7px 2.7px 5px 0 rgba(0, 0, 0, 0.1);
|
|
294
294
|
}
|
|
@@ -721,6 +721,12 @@
|
|
|
721
721
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
|
722
722
|
font-size: 18px;
|
|
723
723
|
}
|
|
724
|
+
.qr-journey-form-wrapper ::-moz-placeholder {
|
|
725
|
+
font-style: normal;
|
|
726
|
+
}
|
|
727
|
+
.qr-journey-form-wrapper ::placeholder {
|
|
728
|
+
font-style: normal;
|
|
729
|
+
}
|
|
724
730
|
.qr-journey-form-wrapper h1 {
|
|
725
731
|
font-size: 28px;
|
|
726
732
|
font-weight: 400;
|