@trafilea/afrodita-components 5.0.0-beta.87 → 5.0.0-beta.88
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/build/index.d.ts +2 -1
- package/build/index.esm.js +13 -7
- package/build/index.esm.js.map +1 -1
- package/build/index.js +13 -7
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -1805,8 +1805,9 @@ interface SearchBarProps {
|
|
|
1805
1805
|
allResults?: number;
|
|
1806
1806
|
initialTerm?: string;
|
|
1807
1807
|
shouldClear?: boolean;
|
|
1808
|
+
isBlogSearchBar?: boolean;
|
|
1808
1809
|
}
|
|
1809
|
-
declare const SearchBar: ({ suggestions, resultOptions, onChange, onSearch, onClose, resultsPanelDataTestId, allResults, initialTerm, shouldClear, }: SearchBarProps) => JSX.Element;
|
|
1810
|
+
declare const SearchBar: ({ suggestions, resultOptions, onChange, onSearch, onClose, resultsPanelDataTestId, allResults, initialTerm, shouldClear, isBlogSearchBar, }: SearchBarProps) => JSX.Element;
|
|
1810
1811
|
|
|
1811
1812
|
interface ProductGalleryMobileProps {
|
|
1812
1813
|
images: ImageType[];
|
package/build/index.esm.js
CHANGED
|
@@ -12328,7 +12328,7 @@ var IconContainer$1 = newStyled.div(templateObject_2$c || (templateObject_2$c =
|
|
|
12328
12328
|
var PageNumbersContainer = newStyled.div(templateObject_3$c || (templateObject_3$c = __makeTemplateObject(["\n display: flex;\n ", ";\n"], ["\n display: flex;\n ", ";\n"])), mediaQueries({
|
|
12329
12329
|
margin: ['0 0.75rem', '0 1.25rem'],
|
|
12330
12330
|
}));
|
|
12331
|
-
var PageNumber = newStyled.span(templateObject_4$7 || (templateObject_4$7 = __makeTemplateObject(["\n font-weight: ", ";\n color: ", ";\n text-align: center;\n cursor: pointer;\n border-bottom: ", ";\n ", ";\n"], ["\n font-weight: ", ";\n color: ", ";\n text-align: center;\n cursor: pointer;\n border-bottom: ", ";\n ", ";\n"])), function (_a) {
|
|
12331
|
+
var PageNumber = newStyled.span(templateObject_4$7 || (templateObject_4$7 = __makeTemplateObject(["\n font-weight: ", ";\n color: ", ";\n text-align: center;\n cursor: pointer;\n border-bottom: ", ";\n ", ";\n background: ", ";\n"], ["\n font-weight: ", ";\n color: ", ";\n text-align: center;\n cursor: pointer;\n border-bottom: ", ";\n ", ";\n background: ", ";\n"])), function (_a) {
|
|
12332
12332
|
var bold = _a.bold;
|
|
12333
12333
|
return (bold ? '700' : '500');
|
|
12334
12334
|
}, function (_a) {
|
|
@@ -12341,7 +12341,10 @@ var PageNumber = newStyled.span(templateObject_4$7 || (templateObject_4$7 = __ma
|
|
|
12341
12341
|
fontSize: ['1rem', '1.25rem'],
|
|
12342
12342
|
lineHeight: ['1.5rem', '1.75rem'],
|
|
12343
12343
|
width: ['1.25rem', '1.875rem'],
|
|
12344
|
-
}))
|
|
12344
|
+
}), function (_a) {
|
|
12345
|
+
var background = _a.background;
|
|
12346
|
+
return background || 'unset';
|
|
12347
|
+
});
|
|
12345
12348
|
var templateObject_1$o, templateObject_2$c, templateObject_3$c, templateObject_4$7;
|
|
12346
12349
|
|
|
12347
12350
|
var Pagination = function (_a) {
|
|
@@ -12512,10 +12515,13 @@ var SearchIconContainer = newStyled.div({
|
|
|
12512
12515
|
alignSelf: 'center',
|
|
12513
12516
|
});
|
|
12514
12517
|
var SearchControl = function (_a) {
|
|
12515
|
-
var open = _a.open, onSearch = _a.onSearch, onClose = _a.onClose;
|
|
12518
|
+
var open = _a.open, onSearch = _a.onSearch, onClose = _a.onClose, _b = _a.showSearchIcon, showSearchIcon = _b === void 0 ? false : _b;
|
|
12516
12519
|
var theme = useTheme();
|
|
12517
12520
|
var isMobile = useWindowDimensions(theme.mediaQueries).isMobile;
|
|
12518
|
-
if (
|
|
12521
|
+
if (showSearchIcon) {
|
|
12522
|
+
return (jsx(SearchIconContainer, { children: jsx(Icon.Navigation.Search, { height: 1.25, width: 1.25 }, void 0) }, void 0));
|
|
12523
|
+
}
|
|
12524
|
+
else if (isMobile) {
|
|
12519
12525
|
return open ? (jsx(ClearButton, { onClick: onClose }, void 0)) : (jsx(SearchIconContainer, { children: jsx(Icon.Navigation.Search, { height: 1.25, width: 1.25 }, void 0) }, void 0));
|
|
12520
12526
|
}
|
|
12521
12527
|
else {
|
|
@@ -12549,12 +12555,12 @@ var Container$c = newStyled.div({
|
|
|
12549
12555
|
display: 'flex',
|
|
12550
12556
|
});
|
|
12551
12557
|
var SearchBar = function (_a) {
|
|
12552
|
-
var suggestions = _a.suggestions, resultOptions = _a.resultOptions, onChange = _a.onChange, onSearch = _a.onSearch, onClose = _a.onClose, resultsPanelDataTestId = _a.resultsPanelDataTestId, allResults = _a.allResults, initialTerm = _a.initialTerm, _b = _a.shouldClear, shouldClear = _b === void 0 ? false : _b;
|
|
12558
|
+
var suggestions = _a.suggestions, resultOptions = _a.resultOptions, onChange = _a.onChange, onSearch = _a.onSearch, onClose = _a.onClose, resultsPanelDataTestId = _a.resultsPanelDataTestId, allResults = _a.allResults, initialTerm = _a.initialTerm, _b = _a.shouldClear, shouldClear = _b === void 0 ? false : _b, _c = _a.isBlogSearchBar, isBlogSearchBar = _c === void 0 ? false : _c;
|
|
12553
12559
|
var theme = useTheme();
|
|
12554
12560
|
if (initialTerm) {
|
|
12555
12561
|
initialState$1.term = initialTerm;
|
|
12556
12562
|
}
|
|
12557
|
-
var
|
|
12563
|
+
var _d = useReducer(reducer, initialState$1), state = _d[0], dispatch = _d[1];
|
|
12558
12564
|
var ref = useRef(null);
|
|
12559
12565
|
var shouldDisplaySuggestion = function () {
|
|
12560
12566
|
return resultOptions.length === 0 && suggestions.length > 0 && !state.term;
|
|
@@ -12586,7 +12592,7 @@ var SearchBar = function (_a) {
|
|
|
12586
12592
|
e.stopPropagation();
|
|
12587
12593
|
onSearch(state.term);
|
|
12588
12594
|
}
|
|
12589
|
-
} }, void 0), jsx$1(SearchControl, { open: state.open, onClose: handleOnClose, onSearch: function () { return onSearch(state.term); } }, void 0)] }), void 0), state.open && !!options.length && (jsx$1(ResultsPanel, { testId: resultsPanelDataTestId, options: options, header: shouldDisplaySuggestion() ? 'Most popular products' : undefined, footer: allResults ? "View all results (".concat(allResults, ")") : undefined, onViewAll: function () { return onSearch(state.term); } }, void 0))] }), void 0));
|
|
12595
|
+
} }, void 0), jsx$1(SearchControl, { showSearchIcon: isBlogSearchBar, open: state.open, onClose: handleOnClose, onSearch: function () { return onSearch(state.term); } }, void 0)] }), void 0), state.open && !!options.length && (jsx$1(ResultsPanel, { testId: resultsPanelDataTestId, options: options, header: shouldDisplaySuggestion() ? 'Most popular products' : undefined, footer: allResults ? "View all results (".concat(allResults, ")") : undefined, onViewAll: function () { return onSearch(state.term); } }, void 0))] }), void 0));
|
|
12590
12596
|
};
|
|
12591
12597
|
|
|
12592
12598
|
function _extends() {
|