@trafilea/afrodita-components 5.0.0-beta.86 → 5.0.0-beta.89
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 +5 -2
- package/build/index.esm.js +34 -9
- package/build/index.esm.js.map +1 -1
- package/build/index.js +34 -8
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -1688,6 +1688,8 @@ interface PaginationProps {
|
|
|
1688
1688
|
}
|
|
1689
1689
|
declare const Pagination: ({ from, to, currentPage, onChange, underlineActive, boldActive, disabled, }: PaginationProps) => JSX.Element;
|
|
1690
1690
|
|
|
1691
|
+
declare const PaginatorBlog: ({ from, to, currentPage, onChange, }: Pick<PaginationProps, 'from' | 'to' | 'onChange' | 'currentPage'>) => JSX.Element;
|
|
1692
|
+
|
|
1691
1693
|
declare const Text: ({ variant, children, testId, ...allProps }: TextProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1692
1694
|
declare type TextHeroProps = {
|
|
1693
1695
|
variant: 'hero1' | 'hero2' | 'hero3';
|
|
@@ -1805,8 +1807,9 @@ interface SearchBarProps {
|
|
|
1805
1807
|
allResults?: number;
|
|
1806
1808
|
initialTerm?: string;
|
|
1807
1809
|
shouldClear?: boolean;
|
|
1810
|
+
isBlogSearchBar?: boolean;
|
|
1808
1811
|
}
|
|
1809
|
-
declare const SearchBar: ({ suggestions, resultOptions, onChange, onSearch, onClose, resultsPanelDataTestId, allResults, initialTerm, shouldClear, }: SearchBarProps) => JSX.Element;
|
|
1812
|
+
declare const SearchBar: ({ suggestions, resultOptions, onChange, onSearch, onClose, resultsPanelDataTestId, allResults, initialTerm, shouldClear, isBlogSearchBar, }: SearchBarProps) => JSX.Element;
|
|
1810
1813
|
|
|
1811
1814
|
interface ProductGalleryMobileProps {
|
|
1812
1815
|
images: ImageType[];
|
|
@@ -2055,4 +2058,4 @@ declare const formatPrice: (value: number, { locale, currency }?: {
|
|
|
2055
2058
|
currency?: string | undefined;
|
|
2056
2059
|
}) => string;
|
|
2057
2060
|
|
|
2058
|
-
export { Accordion, AccordionOptions, AmazonButton, AssetsProvider, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, ButtonType, CTAProps, _default as Card, CardSectionType, CartProductItem, CategoryTag, Checkbox, Collection, ColorPickerOption, ComponentPosition, ComponentSize, index_d as CrossSell, DeliveryDetails, DiscountTag, Drawer, DropdownListIcons, DropdownListIconsItem, DropdownListIconsSubItem, DropdownOption, Filter, FilterChange, FilteringDropdown, Tags as FilteringTags, Filters, FitPredictor, Icon, IconButton, IconProps, IconWithOpacityProps, IconsWithTitle, Image, ImageType, Input, InputValidationType, Modal, MultiColorPicker, Note, OfferBanner, OrderBar, Overlay, PackSelector, Pagination, Pattern, PaymentMethod, PaypalButton, Portal, PriceLabel, PriceLabelHomeColPDP, ProductGallery, ProductGalleryMobile, ProgressBar, QuantityPicker, RadioGroupInput, RadioGroupOption, RadioInput, Rating, Review, ScrollToTop, SearchBar, SearchBarOptionItem, SearchNavigation, SeasonOfferTag, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeFitGuide, SizeOption, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, StarList, Tab, Tabs, Text, TextButton, TextWithImage, Theme, ThemeAssets, ThemeBasicPallete, ThemeBreakpoints, ThemeColorPallete, ThemeColors, ThemeComponent, ThemeFonts, ThemeProvider, ThemeTypography, ThemeVariables, Timer, Tooltip, Totals, WithTestId, decimalFormat, formatPrice, imageVideoProps, isEmail, isEmpty, isNumber, isPhoneNumber, isValidDate, modalEvent, simulateMouseClick, sliceString, useModal, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
|
|
2061
|
+
export { Accordion, AccordionOptions, AmazonButton, AssetsProvider, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, ButtonType, CTAProps, _default as Card, CardSectionType, CartProductItem, CategoryTag, Checkbox, Collection, ColorPickerOption, ComponentPosition, ComponentSize, index_d as CrossSell, DeliveryDetails, DiscountTag, Drawer, DropdownListIcons, DropdownListIconsItem, DropdownListIconsSubItem, DropdownOption, Filter, FilterChange, FilteringDropdown, Tags as FilteringTags, Filters, FitPredictor, Icon, IconButton, IconProps, IconWithOpacityProps, IconsWithTitle, Image, ImageType, Input, InputValidationType, Modal, MultiColorPicker, Note, OfferBanner, OrderBar, Overlay, PackSelector, Pagination, PaginatorBlog, Pattern, PaymentMethod, PaypalButton, Portal, PriceLabel, PriceLabelHomeColPDP, ProductGallery, ProductGalleryMobile, ProgressBar, QuantityPicker, RadioGroupInput, RadioGroupOption, RadioInput, Rating, Review, ScrollToTop, SearchBar, SearchBarOptionItem, SearchNavigation, SeasonOfferTag, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeFitGuide, SizeOption, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, StarList, Tab, Tabs, Text, TextButton, TextWithImage, Theme, ThemeAssets, ThemeBasicPallete, ThemeBreakpoints, ThemeColorPallete, ThemeColors, ThemeComponent, ThemeFonts, ThemeProvider, ThemeTypography, ThemeVariables, Timer, Tooltip, Totals, WithTestId, decimalFormat, formatPrice, imageVideoProps, isEmail, isEmpty, isNumber, isPhoneNumber, isValidDate, modalEvent, simulateMouseClick, sliceString, useModal, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
|
package/build/index.esm.js
CHANGED
|
@@ -4664,6 +4664,9 @@ var PriceLabelHomeColPDP = function (_a) {
|
|
|
4664
4664
|
var _b;
|
|
4665
4665
|
var finalPrice = _a.finalPrice, originalPrice = _a.originalPrice, discount = _a.discount, color = _a.color, testId = _a.testId, _c = _a.originalPriceStyled, originalPriceStyled = _c === void 0 ? false : _c, _d = _a.size, size = _d === void 0 ? ComponentSize.Medium : _d;
|
|
4666
4666
|
var theme = useTheme();
|
|
4667
|
+
var isDiffFinalAndOriginalPrice = originalPrice !== finalPrice;
|
|
4668
|
+
var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
|
|
4669
|
+
var isDiscount = discount && isDiffFinalAndOriginalPrice;
|
|
4667
4670
|
var finalPriceArray = typeof finalPrice === 'string' && finalPrice.includes('.') && finalPrice.includes('$')
|
|
4668
4671
|
? finalPrice.split('$')[1].split('.')
|
|
4669
4672
|
: ['', ''];
|
|
@@ -4673,7 +4676,7 @@ var PriceLabelHomeColPDP = function (_a) {
|
|
|
4673
4676
|
weight: 700,
|
|
4674
4677
|
};
|
|
4675
4678
|
var OriginalPrice = function () { return (jsx$1(Price, __assign$1({ size: originalPriceStyled ? size : ComponentSize.Small, color: theme.colors.shades['300'].color, margin: true, underlined: true, "data-testid": getTestId(testId, 'original-product-price') }, { children: originalPrice }), void 0)); };
|
|
4676
|
-
return (jsxs$1(Container$H, { children: [
|
|
4679
|
+
return (jsxs$1(Container$H, { children: [isOriginalPrice && jsx$1(OriginalPrice, {}, void 0), jsxs$1(FinalPriceStyledContainer, __assign$1({ "data-testid": getTestId(testId, 'final-product-price') }, { children: [jsx$1(Price, __assign$1({ margin: true, finalPriceStyledSmall: true, style: { fontSize: '14px', marginTop: '-5px' } }, priceCommonProps, { children: "$" }), void 0), jsx$1(Price, __assign$1({ finalPriceStyled: true }, priceCommonProps, { children: finalPriceArray[0] ? finalPriceArray[0] : (_b = "".concat(finalPrice)) === null || _b === void 0 ? void 0 : _b.split('$')[1] }), void 0), jsx$1(Price, __assign$1({ finalPriceStyledSmall: true, style: { fontSize: '14px', marginTop: '-6px' } }, priceCommonProps, { children: finalPriceArray[1] ? finalPriceArray[1] : '00' }), void 0)] }), void 0), isDiscount && (jsx$1(TagContainer, __assign$1({ size: ComponentSize.Small }, { children: discount && (jsx$1(DiscountTag, __assign$1({}, discount, { size: ComponentSize.Medium, style: { fontSize: '14px', letterSpacing: '-0.05rem' } }), void 0)) }), void 0))] }, void 0));
|
|
4677
4680
|
};
|
|
4678
4681
|
|
|
4679
4682
|
var OneColorSelector = function (_a) {
|
|
@@ -12325,7 +12328,7 @@ var IconContainer$1 = newStyled.div(templateObject_2$c || (templateObject_2$c =
|
|
|
12325
12328
|
var PageNumbersContainer = newStyled.div(templateObject_3$c || (templateObject_3$c = __makeTemplateObject(["\n display: flex;\n ", ";\n"], ["\n display: flex;\n ", ";\n"])), mediaQueries({
|
|
12326
12329
|
margin: ['0 0.75rem', '0 1.25rem'],
|
|
12327
12330
|
}));
|
|
12328
|
-
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) {
|
|
12329
12332
|
var bold = _a.bold;
|
|
12330
12333
|
return (bold ? '700' : '500');
|
|
12331
12334
|
}, function (_a) {
|
|
@@ -12338,7 +12341,10 @@ var PageNumber = newStyled.span(templateObject_4$7 || (templateObject_4$7 = __ma
|
|
|
12338
12341
|
fontSize: ['1rem', '1.25rem'],
|
|
12339
12342
|
lineHeight: ['1.5rem', '1.75rem'],
|
|
12340
12343
|
width: ['1.25rem', '1.875rem'],
|
|
12341
|
-
}))
|
|
12344
|
+
}), function (_a) {
|
|
12345
|
+
var background = _a.background;
|
|
12346
|
+
return background || 'unset';
|
|
12347
|
+
});
|
|
12342
12348
|
var templateObject_1$o, templateObject_2$c, templateObject_3$c, templateObject_4$7;
|
|
12343
12349
|
|
|
12344
12350
|
var Pagination = function (_a) {
|
|
@@ -12355,6 +12361,22 @@ var Pagination = function (_a) {
|
|
|
12355
12361
|
return (jsxs$1(Container$g, __assign$1({ "data-testid": "PaginationContainer" }, { children: [jsx$1(IconContainer$1, __assign$1({ onClick: function () { return handlePageChange(page - 1); }, "data-testid": "LeftChevron" }, { children: jsx$1(Icon.Arrows.ChevronLeft, { fill: disabled ? theme.colors.shades['250'].color : theme.colors.shades['700'].color }, void 0) }), void 0), jsx$1(PageNumbersContainer, __assign$1({ "data-testid": "PageNumbersContainer", theme: theme }, { children: new Array(to - from + 1).fill(0).map(function (_, i) { return (jsx$1(PageNumber, __assign$1({ onClick: function () { return handlePageChange(i + from); }, bold: boldActive && page === i + from, underline: underlineActive && page === i + from, role: 'button', color: disabled ? theme.colors.shades['250'].color : theme.colors.shades['700'].color, borderColor: disabled ? theme.colors.shades['250'].color : theme.colors.shades['700'].color, theme: theme }, { children: i + from }), i)); }) }), void 0), jsx$1(IconContainer$1, __assign$1({ onClick: function () { return handlePageChange(page + 1); }, "data-testid": "RightChevron" }, { children: jsx$1(Icon.Arrows.ChevronRight, { fill: disabled ? theme.colors.shades['250'].color : theme.colors.shades['700'].color }, void 0) }), void 0)] }), void 0));
|
|
12356
12362
|
};
|
|
12357
12363
|
|
|
12364
|
+
var PaginatorBlog = function (_a) {
|
|
12365
|
+
var from = _a.from, to = _a.to, _b = _a.currentPage, currentPage = _b === void 0 ? from : _b, onChange = _a.onChange;
|
|
12366
|
+
var theme = useTheme();
|
|
12367
|
+
var _c = React__default.useState(currentPage), page = _c[0], setPage = _c[1];
|
|
12368
|
+
var handlePageChange = function (page) {
|
|
12369
|
+
if (page < from || page > to) {
|
|
12370
|
+
return;
|
|
12371
|
+
}
|
|
12372
|
+
setPage(page);
|
|
12373
|
+
onChange(page);
|
|
12374
|
+
};
|
|
12375
|
+
return (jsxs$1(Container$g, __assign$1({ "data-testid": "PaginatorBlogContainer" }, { children: [jsx$1(IconContainer$1, __assign$1({ onClick: function () { return handlePageChange(page - 1); }, "data-testid": "PaginatorBlogLeftChevron" }, { children: jsx$1(Icon.Arrows.ChevronLeft, { fill: page === 1 ? theme.colors.shades['white'].color : theme.colors.shades['700'].color }, void 0) }), void 0), jsx$1(PageNumbersContainer, __assign$1({ "data-testid": "PaginatorBlogPageNumbersContainer", theme: theme }, { children: new Array(to - from + 1).fill(0).map(function (_, i) { return (jsx$1(PageNumber, __assign$1({ onClick: function () { return handlePageChange(i + from); }, background: page === i + from ? 'black' : '', role: 'button', color: page === i + from
|
|
12376
|
+
? theme.colors.shades['white'].color
|
|
12377
|
+
: theme.colors.shades['700'].color, borderColor: theme.colors.shades['700'].color, theme: theme, bold: false, underline: false }, { children: i + from }), i)); }) }), void 0), jsx$1(IconContainer$1, __assign$1({ onClick: function () { return handlePageChange(page + 1); }, "data-testid": "PaginatorBlogRightChevron" }, { children: jsx$1(Icon.Arrows.ChevronRight, { fill: page === to ? theme.colors.shades['white'].color : theme.colors.shades['700'].color }, void 0) }), void 0)] }), void 0));
|
|
12378
|
+
};
|
|
12379
|
+
|
|
12358
12380
|
var Container$f = newStyled.div(templateObject_1$n || (templateObject_1$n = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n width: auto;\n padding: 0.688rem 0rem;\n ", ",\n"], ["\n display: flex;\n flex-direction: row;\n width: auto;\n padding: 0.688rem 0rem;\n ", ",\n"])), mediaQueries({
|
|
12359
12381
|
borderTop: ['0.063rem solid var(--colors-shades-100-color)', 'none'],
|
|
12360
12382
|
}));
|
|
@@ -12509,10 +12531,13 @@ var SearchIconContainer = newStyled.div({
|
|
|
12509
12531
|
alignSelf: 'center',
|
|
12510
12532
|
});
|
|
12511
12533
|
var SearchControl = function (_a) {
|
|
12512
|
-
var open = _a.open, onSearch = _a.onSearch, onClose = _a.onClose;
|
|
12534
|
+
var open = _a.open, onSearch = _a.onSearch, onClose = _a.onClose, _b = _a.showSearchIcon, showSearchIcon = _b === void 0 ? false : _b;
|
|
12513
12535
|
var theme = useTheme();
|
|
12514
12536
|
var isMobile = useWindowDimensions(theme.mediaQueries).isMobile;
|
|
12515
|
-
if (
|
|
12537
|
+
if (showSearchIcon) {
|
|
12538
|
+
return (jsx(SearchIconContainer, { children: jsx(Icon.Navigation.Search, { height: 1.25, width: 1.25 }, void 0) }, void 0));
|
|
12539
|
+
}
|
|
12540
|
+
else if (isMobile) {
|
|
12516
12541
|
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));
|
|
12517
12542
|
}
|
|
12518
12543
|
else {
|
|
@@ -12546,12 +12571,12 @@ var Container$c = newStyled.div({
|
|
|
12546
12571
|
display: 'flex',
|
|
12547
12572
|
});
|
|
12548
12573
|
var SearchBar = function (_a) {
|
|
12549
|
-
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;
|
|
12574
|
+
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;
|
|
12550
12575
|
var theme = useTheme();
|
|
12551
12576
|
if (initialTerm) {
|
|
12552
12577
|
initialState$1.term = initialTerm;
|
|
12553
12578
|
}
|
|
12554
|
-
var
|
|
12579
|
+
var _d = useReducer(reducer, initialState$1), state = _d[0], dispatch = _d[1];
|
|
12555
12580
|
var ref = useRef(null);
|
|
12556
12581
|
var shouldDisplaySuggestion = function () {
|
|
12557
12582
|
return resultOptions.length === 0 && suggestions.length > 0 && !state.term;
|
|
@@ -12583,7 +12608,7 @@ var SearchBar = function (_a) {
|
|
|
12583
12608
|
e.stopPropagation();
|
|
12584
12609
|
onSearch(state.term);
|
|
12585
12610
|
}
|
|
12586
|
-
} }, 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));
|
|
12611
|
+
} }, 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));
|
|
12587
12612
|
};
|
|
12588
12613
|
|
|
12589
12614
|
function _extends() {
|
|
@@ -17272,5 +17297,5 @@ var AccordionOptions = function (_a) {
|
|
|
17272
17297
|
};
|
|
17273
17298
|
var templateObject_1;
|
|
17274
17299
|
|
|
17275
|
-
export { Accordion$1 as Accordion, AccordionOptions, AmazonButton, AssetsProvider, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, Card$2 as Card, CardSectionType, CartProductItem, CategoryTag, Checkbox, Collection, ComponentPosition, ComponentSize, index as CrossSell, DeliveryDetails, DiscountTag, Drawer, DropdownListIcons, FilteringDropdown, Tags as FilteringTags, Filters, FitPredictor, Icon, IconButton, IconsWithTitle, Image, Input$1 as Input, InputValidationType, Modal, MultiColorPicker, Note, OfferBanner, OrderBar, Overlay, PackSelector, Pagination, PaymentMethod, PaypalButton, Portal, PriceLabel, PriceLabelHomeColPDP, ProductGallery, ProductGalleryMobile, ProgressBar, QuantityPicker, RadioGroupInput, RadioInput, Rating, Review, ScrollToTop, SearchBar, SearchNavigation, SeasonOfferTag, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeFitGuide, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, StarList, Tab, Tabs, Text$6 as Text, TextButton, TextWithImage, ThemeProvider, ThemeVariables, Timer, Tooltip, Totals, decimalFormat, formatPrice, isEmail, isEmpty, isNumber$1 as isNumber, isPhoneNumber, isValidDate, modalEvent, simulateMouseClick, sliceString, useModal, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
|
|
17300
|
+
export { Accordion$1 as Accordion, AccordionOptions, AmazonButton, AssetsProvider, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, Card$2 as Card, CardSectionType, CartProductItem, CategoryTag, Checkbox, Collection, ComponentPosition, ComponentSize, index as CrossSell, DeliveryDetails, DiscountTag, Drawer, DropdownListIcons, FilteringDropdown, Tags as FilteringTags, Filters, FitPredictor, Icon, IconButton, IconsWithTitle, Image, Input$1 as Input, InputValidationType, Modal, MultiColorPicker, Note, OfferBanner, OrderBar, Overlay, PackSelector, Pagination, PaginatorBlog, PaymentMethod, PaypalButton, Portal, PriceLabel, PriceLabelHomeColPDP, ProductGallery, ProductGalleryMobile, ProgressBar, QuantityPicker, RadioGroupInput, RadioInput, Rating, Review, ScrollToTop, SearchBar, SearchNavigation, SeasonOfferTag, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeFitGuide, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, StarList, Tab, Tabs, Text$6 as Text, TextButton, TextWithImage, ThemeProvider, ThemeVariables, Timer, Tooltip, Totals, decimalFormat, formatPrice, isEmail, isEmpty, isNumber$1 as isNumber, isPhoneNumber, isValidDate, modalEvent, simulateMouseClick, sliceString, useModal, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
|
|
17276
17301
|
//# sourceMappingURL=index.esm.js.map
|