@trafilea/afrodita-components 4.3.1-beta.9 → 4.4.0-beta.2

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 CHANGED
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { IconProps as IconProps$1 } from 'src/types/types';
2
3
  import React, { FC, ReactNode, ElementType, CSSProperties, AriaAttributes, AnchorHTMLAttributes, LabelHTMLAttributes, RefObject } from 'react';
3
4
  import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
4
5
  import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
@@ -111,10 +112,14 @@ interface SearchBarOptionItem {
111
112
 
112
113
  declare const SixtyDaysGuarantee: ({ height, width, fill, title }: IconProps) => JSX.Element;
113
114
 
115
+ declare const Frown: ({ height, width, fill, title }: IconProps$1) => JSX.Element;
116
+
114
117
  declare const Custom_SixtyDaysGuarantee: typeof SixtyDaysGuarantee;
118
+ declare const Custom_Frown: typeof Frown;
115
119
  declare namespace Custom {
116
120
  export {
117
121
  Custom_SixtyDaysGuarantee as SixtyDaysGuarantee,
122
+ Custom_Frown as Frown,
118
123
  };
119
124
  }
120
125
 
@@ -568,8 +573,9 @@ interface RatingProps {
568
573
  size?: ComponentSize;
569
574
  reviews: number;
570
575
  reviewsText: string;
576
+ wrapWithParenthesis?: boolean;
571
577
  }
572
- declare const Rating: ({ size, reviews, reviewsText, rating, }: RatingProps) => JSX.Element;
578
+ declare const Rating: ({ size, reviews, reviewsText, rating, wrapWithParenthesis, }: RatingProps) => JSX.Element;
573
579
 
574
580
  interface FitPredictorProps {
575
581
  onClick: () => void;
@@ -825,6 +831,31 @@ declare type ThemeComponent = {
825
831
  };
826
832
  };
827
833
  };
834
+ stars: {
835
+ element: {
836
+ color: string;
837
+ xsmall: {
838
+ width: string;
839
+ height: string;
840
+ marginRight: string;
841
+ };
842
+ small: {
843
+ width: string;
844
+ height: string;
845
+ marginRight: string;
846
+ };
847
+ medium: {
848
+ width: string;
849
+ height: string;
850
+ marginRight: string;
851
+ };
852
+ large: {
853
+ width: string;
854
+ height: string;
855
+ marginRight: string;
856
+ };
857
+ };
858
+ };
828
859
  card: {
829
860
  borderRadius: string;
830
861
  };
@@ -1566,16 +1597,8 @@ declare const Overlay: _emotion_styled.StyledComponent<{
1566
1597
  opened?: boolean | undefined;
1567
1598
  }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
1568
1599
  declare const Modal: FC<ModalProps>;
1569
- declare type ModalEventDetail = {
1570
- id: string;
1571
- type: 'open' | 'close';
1572
- };
1573
- declare const modalEvent: (id: string, detail: Omit<ModalEventDetail, 'id'>) => void;
1574
- declare global {
1575
- interface WindowEventMap {
1576
- modal: CustomEvent<ModalEventDetail>;
1577
- }
1578
- }
1600
+ declare const modalEvent: (id: string, detail: Omit<Events['modal'], 'id'>) => void;
1601
+ declare const useModalEvent: (id: string, cb: (event: CustomEvent<Events['modal']>) => void) => void;
1579
1602
 
1580
1603
  interface CloseButtonProps {
1581
1604
  onClick: () => void;
@@ -1653,4 +1676,4 @@ declare const formatPrice: (value: number, { locale, currency }?: {
1653
1676
  currency?: string | undefined;
1654
1677
  }) => string;
1655
1678
 
1656
- export { Accordion, AmazonButton, AssetsProvider, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, ButtonType, CTAProps, _default as Card, CardSectionType, CartProductItem, CategoryTag, Checkbox, Collection, Color, ColorPickerOption, ComponentPosition, ComponentSize, index_d as CrossSell, DeliveryDetails, DiscountTag, Drawer, DropdownListIcons, DropdownListIconsItem, DropdownListIconsSubItem, DropdownOption, Filter, FilterChange, FilteringDropdown, Tags as FilteringTags, FitPredictor, Icon, IconButton, IconProps, IconWithOpacityProps, Image, ImageType, Input, InputValidationType, Modal, MultiColorPicker, OfferBanner, OrderBar, Overlay, Pagination, Pattern, PaymentMethod, PaypalButton, Portal, PriceLabel, ProductGallery, ProductGalleryMobile, ProgressBar, QuantityPicker, RadioGroupInput, RadioGroupOption, RadioInput, Rating, Review, ScrollToTop, SearchBar, SearchBarOptionItem, SeasonOfferTag, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeFitGuide, SizeOption, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, StarList, Text, TextButton, Theme, ThemeAssets, ThemeBasicPallete, ThemeBreakpoints, ThemeColorPallete, ThemeColors, ThemeComponent, ThemeFonts, ThemeProvider, ThemeTypography, ThemeVariables, Timer, Tooltip, Totals, WithTestId, decimalFormat, formatPrice, isEmail, isEmpty, isNumber, isPhoneNumber, isValidDate, modalEvent, simulateMouseClick, sliceString, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
1679
+ export { Accordion, AmazonButton, AssetsProvider, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, ButtonType, CTAProps, _default as Card, CardSectionType, CartProductItem, CategoryTag, Checkbox, Collection, Color, ColorPickerOption, ComponentPosition, ComponentSize, index_d as CrossSell, DeliveryDetails, DiscountTag, Drawer, DropdownListIcons, DropdownListIconsItem, DropdownListIconsSubItem, DropdownOption, Filter, FilterChange, FilteringDropdown, Tags as FilteringTags, FitPredictor, Icon, IconButton, IconProps, IconWithOpacityProps, Image, ImageType, Input, InputValidationType, Modal, MultiColorPicker, OfferBanner, OrderBar, Overlay, Pagination, Pattern, PaymentMethod, PaypalButton, Portal, PriceLabel, ProductGallery, ProductGalleryMobile, ProgressBar, QuantityPicker, RadioGroupInput, RadioGroupOption, RadioInput, Rating, Review, ScrollToTop, SearchBar, SearchBarOptionItem, SeasonOfferTag, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeFitGuide, SizeOption, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, StarList, Text, TextButton, Theme, ThemeAssets, ThemeBasicPallete, ThemeBreakpoints, ThemeColorPallete, ThemeColors, ThemeComponent, ThemeFonts, ThemeProvider, ThemeTypography, ThemeVariables, Timer, Tooltip, Totals, WithTestId, decimalFormat, formatPrice, isEmail, isEmpty, isNumber, isPhoneNumber, isValidDate, modalEvent, simulateMouseClick, sliceString, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
@@ -66,9 +66,15 @@ var SixtyDaysGuarantee = function (_a) {
66
66
  return (jsx$1(IconWrapper, __assign({ width: width, height: height, viewBoxX: 68, viewBoxY: 60, title: title }, { children: jsxs$1(Fragment$1, { children: [jsx$1("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.12893 20.0377C6.95506 20.5703 7.22866 21.1476 7.74181 21.3283L7.74182 21.3283C8.25436 21.509 8.80986 21.2242 8.98374 20.6916C13.6669 6.34132 28.7093 -1.37319 42.5168 3.49389C53.5644 7.38818 60.8041 18.2973 60.4618 30.3023L56.7328 26.3617C56.3533 25.9601 55.7341 25.9548 55.3486 26.3495C55.1556 26.5462 55.0573 26.8058 55.0552 27.0667C55.0531 27.3271 55.1473 27.5882 55.3369 27.7882L60.7689 33.5285C60.9627 33.7336 61.2191 33.8353 61.4749 33.8331C61.7301 33.8391 61.9872 33.7419 62.1837 33.5407L67.7069 27.8953C68.0931 27.5012 68.0983 26.8576 67.7186 26.4565C67.5294 26.2561 67.2796 26.1542 67.0285 26.1521C66.778 26.1499 66.5266 26.2475 66.3342 26.4445L62.4178 30.4475C62.8212 17.5178 55.0381 5.75829 43.146 1.56628C28.3162 -3.6612 12.1587 4.62531 7.12893 20.0377ZM5.31341 29.5826C4.92323 42.5 12.7034 54.245 24.5866 58.4339C39.4157 63.6612 55.5738 55.3744 60.6034 39.9626C60.7775 39.4292 60.5032 38.8523 59.9908 38.6717C59.4776 38.4907 58.9228 38.7753 58.7488 39.3086C54.0657 53.6582 39.0226 61.3731 25.2156 56.5061C14.0119 52.5567 6.72506 41.3935 7.28932 29.1894L11.2678 33.394C11.647 33.7951 12.2662 33.8007 12.652 33.4058C12.845 33.2091 12.9431 32.9497 12.9451 32.6888C12.9472 32.4285 12.8533 32.167 12.6637 31.9671L7.2316 26.2268C7.03598 26.0197 6.77654 25.918 6.51822 25.9223C6.26536 25.9181 6.01109 26.0154 5.81628 26.2147L0.293184 31.8604C-0.0932236 32.2545 -0.0982397 32.8981 0.28148 33.2988C0.470773 33.4992 0.72026 33.6014 0.971555 33.6035C1.22211 33.6058 1.47331 33.508 1.66576 33.3109L5.31341 29.5826Z", fill: fill }, void 0), jsx$1("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.12893 20.0377C6.95506 20.5703 7.22866 21.1476 7.74181 21.3283L7.74182 21.3283C8.25436 21.509 8.80986 21.2242 8.98374 20.6916C13.6669 6.34132 28.7093 -1.37319 42.5168 3.49389C53.5644 7.38818 60.8041 18.2973 60.4618 30.3023L56.7328 26.3617C56.3533 25.9601 55.7341 25.9548 55.3486 26.3495C55.1556 26.5462 55.0573 26.8058 55.0552 27.0667C55.0531 27.3271 55.1473 27.5882 55.3369 27.7882L60.7689 33.5285C60.9627 33.7336 61.2191 33.8353 61.4749 33.8331C61.7301 33.8391 61.9872 33.7419 62.1837 33.5407L67.7069 27.8953C68.0931 27.5012 68.0983 26.8576 67.7186 26.4565C67.5294 26.2561 67.2796 26.1542 67.0285 26.1521C66.778 26.1499 66.5266 26.2475 66.3342 26.4445L62.4178 30.4475C62.8212 17.5178 55.0381 5.75829 43.146 1.56628C28.3162 -3.6612 12.1587 4.62531 7.12893 20.0377ZM5.31341 29.5826C4.92323 42.5 12.7034 54.245 24.5866 58.4339C39.4157 63.6612 55.5738 55.3744 60.6034 39.9626C60.7775 39.4292 60.5032 38.8523 59.9908 38.6717C59.4776 38.4907 58.9228 38.7753 58.7488 39.3086C54.0657 53.6582 39.0226 61.3731 25.2156 56.5061C14.0119 52.5567 6.72506 41.3935 7.28932 29.1894L11.2678 33.394C11.647 33.7951 12.2662 33.8007 12.652 33.4058C12.845 33.2091 12.9431 32.9497 12.9451 32.6888C12.9472 32.4285 12.8533 32.167 12.6637 31.9671L7.2316 26.2268C7.03598 26.0197 6.77654 25.918 6.51822 25.9223C6.26536 25.9181 6.01109 26.0154 5.81628 26.2147L0.293184 31.8604C-0.0932235 32.2545 -0.0982397 32.8981 0.28148 33.2988C0.470773 33.4992 0.72026 33.6014 0.971555 33.6035C1.22211 33.6058 1.47331 33.508 1.66576 33.3109L5.31341 29.5826Z", fill: fill }, void 0), jsx$1("path", { d: "M26.4316 13.008L22.1836 19.584C21.0796 21.336 20.4316 22.656 20.4316 24.6C20.4316 27.888 23.0956 30.432 26.6476 30.432C30.1276 30.432 32.8396 28.08 32.8396 24.48C32.8396 21.384 30.4156 19.032 27.4156 19.032C26.8396 19.032 26.0716 19.128 25.6156 19.32L25.5916 19.296L29.9356 13.008H26.4316ZM23.3596 24.672C23.3596 22.68 24.7276 21.312 26.6716 21.312C28.5916 21.312 29.8876 22.704 29.8876 24.624C29.8876 26.64 28.5676 27.984 26.6236 27.984C24.6316 27.984 23.3596 26.448 23.3596 24.672ZM47.32 21.504C47.32 16.008 45.184 12.576 41.344 12.576C37.48 12.576 35.32 16.008 35.32 21.504C35.32 27 37.48 30.432 41.344 30.432C45.184 30.432 47.32 27 47.32 21.504ZM44.368 21.504C44.368 23.88 43.912 27.984 41.344 27.984C38.752 27.984 38.272 23.88 38.272 21.504C38.272 19.128 38.752 14.976 41.344 14.976C43.912 14.976 44.368 19.128 44.368 21.504Z", fill: fill }, void 0), jsx$1("path", { d: "M21.0373 46H24.5513C27.1413 46 30.0253 44.516 30.0253 41.044C30.0253 37.32 27.1413 36.088 24.5513 36.088H21.0373V46ZM22.8013 44.46V37.6H24.2713C26.0913 37.6 28.1353 38.202 28.1353 41.044C28.1353 43.718 26.0913 44.46 24.2713 44.46H22.8013ZM30.1829 46H32.1569L33.0529 43.732H37.3509L38.2749 46H40.2909L36.0209 36.088H34.4949L30.1829 46ZM33.6549 42.22L35.2089 38.188L36.7349 42.22H33.6549ZM42.8317 46H44.5957V41.702L48.3197 36.088H46.2757L43.7557 40.26L41.2637 36.088H39.1077L42.8317 41.702V46Z", fill: fill }, void 0)] }, void 0) }), void 0));
67
67
  };
68
68
 
69
+ var Frown = function (_a) {
70
+ var height = _a.height, width = _a.width, fill = _a.fill, title = _a.title;
71
+ return (jsxs$1(IconWrapper, __assign({ width: width, height: height, viewBoxX: 68, viewBoxY: 68, title: title, fill: "none" }, { children: [jsx$1("path", { d: "M34 64C50.5685 64 64 50.5685 64 34C64 17.4315 50.5685 4 34 4C17.4315 4 4 17.4315 4 34C4 50.5685 17.4315 64 34 64Z", fill: "".concat(fill, "b6") }, void 0), jsx$1("path", { d: "M64 34.0296C64.0064 29.5175 62.9753 25.0627 60.9841 21C59.9702 30.9185 58.3731 39.7073 49.0635 48.6699C39.8271 57.5622 25.9923 57.4947 9 50.0686C14.4495 58.1257 23.0411 64 33.6008 64C41.6631 64 49.3953 60.8424 55.0963 55.2219C60.7972 49.6013 64 41.9783 64 34.0296Z", fill: fill }, void 0), jsx$1("path", { d: "M34 64C50.5685 64 64 50.5685 64 34C64 17.4315 50.5685 4 34 4C17.4315 4 4 17.4315 4 34C4 50.5685 17.4315 64 34 64Z", stroke: "#292929", strokeWidth: "2", strokeLinejoin: "round" }, void 0), jsx$1("path", { d: "M44.1292 48.8737C44.1292 48.8737 41.7372 42.8737 34.1292 42.8737C26.5212 42.8737 24.1292 48.8737 24.1292 48.8737", stroke: "#292929", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, void 0), jsx$1("path", { d: "M24.6292 32.1304C24.6292 33.5111 23.5099 34.6304 22.1292 34.6304C20.7485 34.6304 19.6292 33.5111 19.6292 32.1304C19.6292 30.7497 20.7485 29.6304 22.1292 29.6304C23.5099 29.6304 24.6292 30.7497 24.6292 32.1304Z", fill: "#292929", stroke: "#292929" }, void 0), jsx$1("path", { d: "M48.6292 32.1304C48.6292 33.5111 47.5099 34.6304 46.1292 34.6304C44.7485 34.6304 43.6292 33.5111 43.6292 32.1304C43.6292 30.7497 44.7485 29.6304 46.1292 29.6304C47.5099 29.6304 48.6292 30.7497 48.6292 32.1304Z", fill: "#292929", stroke: "#292929" }, void 0), jsx$1("path", { d: "M14.7553 23.6181C16.5344 19.9142 19.3229 16.7876 22.8 14.5982C26.2771 12.4087 30.3017 11.2452 34.4107 11.2415", stroke: "white", strokeWidth: "6", strokeLinecap: "round", strokeLinejoin: "round" }, void 0)] }), void 0));
72
+ };
73
+
69
74
  var Custom$1 = /*#__PURE__*/Object.freeze({
70
75
  __proto__: null,
71
- SixtyDaysGuarantee: SixtyDaysGuarantee
76
+ SixtyDaysGuarantee: SixtyDaysGuarantee,
77
+ Frown: Frown
72
78
  });
73
79
 
74
80
  var Check = function (_a) {
@@ -6839,43 +6845,51 @@ var StarStyles = {
6839
6845
  display: 'flex',
6840
6846
  });
6841
6847
  },
6842
- xsmall: function () {
6848
+ xsmall: function (theme) {
6843
6849
  return css({
6844
- width: '0.656rem',
6845
- height: '0.656rem',
6846
- marginRight: '0.156rem',
6850
+ svg: {
6851
+ width: theme.component.stars.element.xsmall.width,
6852
+ height: theme.component.stars.element.xsmall.height,
6853
+ marginRight: theme.component.stars.element.xsmall.marginRight,
6854
+ },
6847
6855
  });
6848
6856
  },
6849
- small: function () {
6857
+ small: function (theme) {
6850
6858
  return css({
6851
- width: '0.875rem',
6852
- height: '0.875rem',
6853
- marginRight: '0.25rem',
6859
+ svg: {
6860
+ width: theme.component.stars.element.small.width,
6861
+ height: theme.component.stars.element.small.height,
6862
+ marginRight: theme.component.stars.element.small.marginRight,
6863
+ },
6854
6864
  });
6855
6865
  },
6856
- medium: function () {
6866
+ medium: function (theme) {
6857
6867
  return css({
6858
- width: '1.375rem',
6859
- height: '1.375rem',
6860
- marginRight: '0.375rem',
6868
+ svg: {
6869
+ width: theme.component.stars.element.medium.width,
6870
+ height: theme.component.stars.element.medium.height,
6871
+ marginRight: theme.component.stars.element.medium.marginRight,
6872
+ },
6861
6873
  });
6862
6874
  },
6863
- large: function () {
6875
+ large: function (theme) {
6864
6876
  return css({
6865
- width: '2.375rem',
6866
- height: '2.375rem',
6867
- marginRight: '0.375rem',
6877
+ svg: {
6878
+ width: theme.component.stars.element.large.width,
6879
+ height: theme.component.stars.element.large.height,
6880
+ marginRight: theme.component.stars.element.large.marginRight,
6881
+ },
6868
6882
  });
6869
6883
  },
6870
6884
  };
6871
- var Container$w = newStyled.div(templateObject_1$P || (templateObject_1$P = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
6885
+ var Container$w = newStyled.div(templateObject_1$P || (templateObject_1$P = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
6872
6886
  var templateObject_1$P;
6873
6887
 
6874
6888
  var StarContainer = newStyled.div(function (_a) {
6875
- var size = _a.size;
6889
+ var size = _a.size, theme = _a.theme;
6876
6890
  return [
6877
6891
  StarStyles.baseStyles(),
6878
- StarStyles[size],
6892
+ StarStyles[size](theme),
6879
6893
  ];
6880
6894
  });
6881
6895
  var sizes = {
@@ -6886,8 +6900,9 @@ var sizes = {
6886
6900
  };
6887
6901
  var StarList = function (_a) {
6888
6902
  var rating = _a.rating, starsNumber = _a.starsNumber, fill = _a.fill, _b = _a.size, size = _b === void 0 ? ComponentSize.Medium : _b;
6903
+ var theme = useTheme();
6889
6904
  return (jsx$1(Container$w, { children: __spreadArray([], new Array(starsNumber), true).map(function (_, index) {
6890
- return (jsx$1(StarContainer, __assign({ "data-testid": "star-container", size: size }, { children: index < Math.floor(rating) ? (jsx$1(Icon.PDP.Star, __assign({}, sizes[size], { fill: fill }), void 0)) : index === Math.floor(rating) && rating % 1 != 0 ? (jsx$1(Icon.PDP.StarHalf, __assign({}, sizes[size], { fill: fill }), void 0)) : (jsx$1(Icon.PDP.StarEmpty, __assign({}, sizes[size], { fill: fill }), void 0)) }), index));
6905
+ return (jsx$1(StarContainer, __assign({ "data-testid": "star-container", size: size, theme: theme }, { children: index < Math.floor(rating) ? (jsx$1(Icon.PDP.Star, __assign({}, sizes[size], { fill: fill }), void 0)) : index === Math.floor(rating) && rating % 1 != 0 ? (jsx$1(Icon.PDP.StarHalf, __assign({}, sizes[size], { fill: fill }), void 0)) : (jsx$1(Icon.PDP.StarEmpty, __assign({}, sizes[size], { fill: fill }), void 0)) }), index));
6891
6906
  }) }, void 0));
6892
6907
  };
6893
6908
 
@@ -6934,17 +6949,25 @@ var Container$v = newStyled.div(templateObject_1$O || (templateObject_1$O = __ma
6934
6949
  var templateObject_1$O;
6935
6950
 
6936
6951
  var CustomLabel = newStyled.div(function (_a) {
6937
- var theme = _a.theme, size = _a.size;
6952
+ var theme = _a.theme, size = _a.size, wrapWithParenthesis = _a.wrapWithParenthesis;
6938
6953
  return [
6939
6954
  LabelStyles.baseStyles(theme),
6940
6955
  LabelStyles[size](theme),
6956
+ {
6957
+ ':before': {
6958
+ content: wrapWithParenthesis ? '"("' : '""',
6959
+ },
6960
+ ':after': {
6961
+ content: wrapWithParenthesis ? '")"' : '""',
6962
+ },
6963
+ },
6941
6964
  ];
6942
6965
  });
6943
6966
  var starsNumber = 5;
6944
6967
  var Rating = function (_a) {
6945
- var _b = _a.size, size = _b === void 0 ? ComponentSize.Medium : _b, reviews = _a.reviews, reviewsText = _a.reviewsText, rating = _a.rating;
6968
+ var _b = _a.size, size = _b === void 0 ? ComponentSize.Medium : _b, reviews = _a.reviews, reviewsText = _a.reviewsText, rating = _a.rating, _c = _a.wrapWithParenthesis, wrapWithParenthesis = _c === void 0 ? false : _c;
6946
6969
  var theme = useTheme();
6947
- return (jsxs$1(Container$v, { children: [jsx$1(StarList, { rating: rating, size: size, starsNumber: starsNumber, fill: theme.colors.pallete.primary.color }, void 0), jsxs$1(CustomLabel, __assign({ theme: theme, size: size, "data-testid": "CustomLabel" }, { children: [reviews, " ", reviewsText] }), void 0)] }, void 0));
6970
+ return (jsxs$1(Container$v, { children: [jsx$1(StarList, { rating: rating, size: size, starsNumber: starsNumber, fill: theme.component.stars.element.color }, void 0), jsxs$1(CustomLabel, __assign({ theme: theme, size: size, wrapWithParenthesis: wrapWithParenthesis, "data-testid": "CustomLabel" }, { children: [reviews, " ", reviewsText] }), void 0)] }, void 0));
6948
6971
  };
6949
6972
 
6950
6973
  var Container$u = newStyled.div(templateObject_1$N || (templateObject_1$N = __makeTemplateObject(["\n display: flex;\n align-items: center;\n font-size: 0.88rem;\n"], ["\n display: flex;\n align-items: center;\n font-size: 0.88rem;\n"])));
@@ -12523,21 +12546,15 @@ var ProductItemMobile = function (_a) {
12523
12546
  var title = _a.title, image = _a.image, price = _a.price, rating = _a.rating, size = _a.size, tags = _a.tags, _b = _a.alignName, alignName = _b === void 0 ? 'center' : _b, url = _a.url, className = _a.className;
12524
12547
  var theme = useTheme();
12525
12548
  var styles = getStylesBySize(size);
12526
- var spaces = useMemo(function () {
12527
- var _a, _b;
12528
- var first = (_a = {},
12529
- _a[ComponentSize.Large] = 20,
12530
- _a[ComponentSize.Medium] = 12,
12531
- _a[ComponentSize.Small] = 6,
12549
+ var space = useMemo(function () {
12550
+ var _a;
12551
+ return (_a = {},
12552
+ _a[ComponentSize.Large] = 8,
12553
+ _a[ComponentSize.Medium] = 4,
12554
+ _a[ComponentSize.Small] = 2,
12532
12555
  _a)[size];
12533
- var second = (_b = {},
12534
- _b[ComponentSize.Large] = 12,
12535
- _b[ComponentSize.Medium] = 6,
12536
- _b[ComponentSize.Small] = 4,
12537
- _b)[size];
12538
- return [first, second];
12539
12556
  }, [size]);
12540
- return (jsxs(Container$d, __assign({ as: url ? 'a' : 'div', href: url, className: className }, { children: [tags ? (jsxs(ImageContainer, __assign({ width: styles === null || styles === void 0 ? void 0 : styles.width, height: styles === null || styles === void 0 ? void 0 : styles.height, "data-testid": "tags-image-container" }, { children: [jsx(Image, { src: image.src, alt: image.alt, width: "100%", height: "100%" }, void 0), jsx(SeasonOfferTag, { text: tags.seasonOfferTagText, size: ComponentSize.Small, css: { position: 'absolute', top: 0, left: 0 } }, void 0), jsx(CategoryTag, { text: tags.categoryTagText, size: ComponentSize.Small, css: { position: 'absolute', bottom: '1rem', left: 0 } }, void 0)] }), void 0)) : (jsx(Image, { src: image.src, alt: image.alt, width: styles === null || styles === void 0 ? void 0 : styles.width, height: styles === null || styles === void 0 ? void 0 : styles.height }, void 0)), jsx(Spacing, { size: spaces[0] }, void 0), jsx(H1, __assign({ theme: theme, align: alignName }, { children: title }), void 0), jsx(Spacing, { size: spaces[1] }, void 0), jsx(PriceLabel, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, color: price.color, size: ComponentSize.Small }, void 0), jsx(Rating, { size: size === ComponentSize.Large ? ComponentSize.Small : ComponentSize.XSmall, rating: rating.rating, reviews: rating.reviews, reviewsText: "" }, void 0)] }), void 0));
12557
+ return (jsxs(Container$d, __assign({ as: url ? 'a' : 'div', href: url, className: className }, { children: [tags ? (jsxs(ImageContainer, __assign({ width: styles === null || styles === void 0 ? void 0 : styles.width, height: styles === null || styles === void 0 ? void 0 : styles.height, "data-testid": "tags-image-container" }, { children: [jsx(Image, { src: image.src, alt: image.alt, width: "100%", height: "100%" }, void 0), jsx(SeasonOfferTag, { text: tags.seasonOfferTagText, size: ComponentSize.Small, css: { position: 'absolute', top: 0, left: 0 } }, void 0), jsx(CategoryTag, { text: tags.categoryTagText, size: ComponentSize.Small, css: { position: 'absolute', bottom: '1rem', left: 0 } }, void 0)] }), void 0)) : (jsx(Image, { src: image.src, alt: image.alt, width: styles === null || styles === void 0 ? void 0 : styles.width, height: styles === null || styles === void 0 ? void 0 : styles.height }, void 0)), jsx(Spacing, { size: space }, void 0), jsx(H1, __assign({ theme: theme, align: alignName }, { children: title }), void 0), jsx(Spacing, { size: space }, void 0), jsx(PriceLabel, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, color: price.color, size: ComponentSize.Small }, void 0), jsx(Spacing, { size: space }, void 0), jsx(Rating, { size: size === ComponentSize.Large ? ComponentSize.Small : ComponentSize.XSmall, rating: rating.rating, reviews: rating.reviews, reviewsText: "", wrapWithParenthesis: true }, void 0)] }), void 0));
12541
12558
  };
12542
12559
  var templateObject_1$j, templateObject_2$9;
12543
12560
 
@@ -13295,40 +13312,126 @@ var Portal = function (_a) {
13295
13312
  return createPortal(children, container.current, id);
13296
13313
  };
13297
13314
 
13315
+ var __defProp$1 = Object.defineProperty;
13316
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
13317
+ var __getOwnPropNames$1 = Object.getOwnPropertyNames;
13318
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
13319
+ var __markAsModule$1 = (target) => __defProp$1(target, "__esModule", { value: true });
13320
+ var __export$1 = (target, all) => {
13321
+ for (var name in all)
13322
+ __defProp$1(target, name, { get: all[name], enumerable: true });
13323
+ };
13324
+ var __reExport$1 = (target, module2, copyDefault, desc) => {
13325
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
13326
+ for (let key of __getOwnPropNames$1(module2))
13327
+ if (!__hasOwnProp$1.call(target, key) && (copyDefault || key !== "default"))
13328
+ __defProp$1(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc$1(module2, key)) || desc.enumerable });
13329
+ }
13330
+ return target;
13331
+ };
13332
+ var __toCommonJS$1 = /* @__PURE__ */ ((cache) => {
13333
+ return (module2, temp) => {
13334
+ return cache && cache.get(module2) || (temp = __reExport$1(__markAsModule$1({}), module2, 1), cache && cache.set(module2, temp), temp);
13335
+ };
13336
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
13337
+
13338
+ // src/index.ts
13339
+ var src_exports = {};
13340
+ __export$1(src_exports, {
13341
+ dispatchCustomEvent: () => dispatchCustomEvent,
13342
+ listenEvent: () => listenEvent$1,
13343
+ unlistenEvent: () => unlistenEvent$1
13344
+ });
13345
+ function listenEvent$1(event, handler) {
13346
+ window.addEventListener(event, handler);
13347
+ return () => unlistenEvent$1(event, handler);
13348
+ }
13349
+ function unlistenEvent$1(event, handler) {
13350
+ window.removeEventListener(event, handler);
13351
+ }
13352
+ function dispatchCustomEvent(event, detail) {
13353
+ window.dispatchEvent(new CustomEvent(event, { detail }));
13354
+ }
13355
+ var events = __toCommonJS$1(src_exports);
13356
+
13357
+ var __defProp = Object.defineProperty;
13358
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13359
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13360
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
13361
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
13362
+ var __export = (target, all) => {
13363
+ for (var name in all)
13364
+ __defProp(target, name, { get: all[name], enumerable: true });
13365
+ };
13366
+ var __reExport = (target, module2, copyDefault, desc) => {
13367
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
13368
+ for (let key of __getOwnPropNames(module2))
13369
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
13370
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
13371
+ }
13372
+ return target;
13373
+ };
13374
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
13375
+ return (module2, temp) => {
13376
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
13377
+ };
13378
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
13379
+
13380
+ // src/react/index.ts
13381
+ var react_exports = {};
13382
+ __export(react_exports, {
13383
+ useEvent: () => useEvent
13384
+ });
13385
+ var import_react = React__default;
13386
+
13387
+ // src/index.ts
13388
+ function listenEvent(event, handler) {
13389
+ window.addEventListener(event, handler);
13390
+ return () => unlistenEvent(event, handler);
13391
+ }
13392
+ function unlistenEvent(event, handler) {
13393
+ window.removeEventListener(event, handler);
13394
+ }
13395
+
13396
+ // src/react/index.ts
13397
+ function useEvent(event, handler) {
13398
+ (0, import_react.useEffect)(() => {
13399
+ return listenEvent(event, handler);
13400
+ }, [event, handler]);
13401
+ }
13402
+ var react = __toCommonJS(react_exports);
13403
+
13298
13404
  var visibleStyle = function (_a) {
13299
13405
  var opened = _a.opened;
13300
13406
  return opened
13301
13407
  ? css(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n opacity: 1;\n pointer-events: all;\n transform: translate(-50%, -50%);\n "], ["\n opacity: 1;\n pointer-events: all;\n transform: translate(-50%, -50%);\n "]))) : css(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n opacity: 0;\n pointer-events: none;\n transform: translate(-50%, -40%);\n "], ["\n opacity: 0;\n pointer-events: none;\n transform: translate(-50%, -40%);\n "])));
13302
13408
  };
13303
- var Container$2 = newStyled.div(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n border: 1px solid var(--colors-pallete-primary-color);\n border-radius: var(--radius-regular);\n padding: 20px;\n position: fixed;\n left: 50%;\n top: 50%;\n z-index: var(--zIndex-modal);\n background-color: var(--colors-background-color);\n min-width: var(--component-modal-minWidth);\n transition: transform 0.3s, opacity 0.3s;\n\n ", ";\n"], ["\n border: 1px solid var(--colors-pallete-primary-color);\n border-radius: var(--radius-regular);\n padding: 20px;\n position: fixed;\n left: 50%;\n top: 50%;\n z-index: var(--zIndex-modal);\n background-color: var(--colors-background-color);\n min-width: var(--component-modal-minWidth);\n transition: transform 0.3s, opacity 0.3s;\n\n ", ";\n"])), visibleStyle);
13409
+ var Container$2 = newStyled.div(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n border: 1px solid var(--colors-pallete-primary-color);\n border-radius: var(--radius-regular);\n padding: 20px;\n position: fixed;\n left: 50%;\n top: 50%;\n z-index: var(--zIndex-modal);\n background-color: var(--colors-background-color);\n min-width: var(--component-modal-minWidth);\n transition: transform 0.3s, opacity 0.3s;\n max-width: 90vw;\n max-height: 90vh;\n\n ", ";\n"], ["\n border: 1px solid var(--colors-pallete-primary-color);\n border-radius: var(--radius-regular);\n padding: 20px;\n position: fixed;\n left: 50%;\n top: 50%;\n z-index: var(--zIndex-modal);\n background-color: var(--colors-background-color);\n min-width: var(--component-modal-minWidth);\n transition: transform 0.3s, opacity 0.3s;\n max-width: 90vw;\n max-height: 90vh;\n\n ", ";\n"])), visibleStyle);
13304
13410
  var Overlay = newStyled.div(templateObject_4$1 || (templateObject_4$1 = __makeTemplateObject(["\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.75);\n z-index: var(--zIndex-overlay);\n transition: transform 0.3s, opacity 0.3s;\n\n ", "\n\n transform: none;\n"], ["\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.75);\n z-index: var(--zIndex-overlay);\n transition: transform 0.3s, opacity 0.3s;\n\n ", "\n\n transform: none;\n"])), visibleStyle);
13305
13411
  var Modal = function (_a) {
13306
13412
  var id = _a.id, children = _a.children, _b = _a.dismissable, dismissable = _b === void 0 ? true : _b;
13307
13413
  var _c = useState(false), opened = _c[0], setOpened = _c[1];
13308
- useEffect(function () {
13309
- var onModal = function (e) {
13310
- if (e.detail.id !== id) {
13311
- return;
13312
- }
13313
- setOpened(e.detail.type === 'open');
13314
- };
13315
- window.addEventListener('modal', onModal);
13316
- return function () {
13317
- window.removeEventListener('modal', onModal);
13318
- };
13319
- }, [id]);
13414
+ useModalEvent(id, useCallback(function (e) {
13415
+ setOpened(e.detail.type === 'open');
13416
+ }, []));
13320
13417
  var onDismiss = function () {
13321
13418
  if (!dismissable) {
13322
13419
  return;
13323
13420
  }
13324
- setOpened(false);
13421
+ modalEvent(id, { type: 'close' });
13325
13422
  };
13326
13423
  return (jsxs(Portal, __assign({ id: id }, { children: [jsx(Container$2, __assign({ opened: opened }, { children: children }), void 0), jsx(Overlay, { opened: opened, onClick: onDismiss }, void 0)] }), void 0));
13327
13424
  };
13328
13425
  var modalEvent = function (id, detail) {
13329
- window.dispatchEvent(new CustomEvent('modal', {
13330
- detail: __assign(__assign({}, detail), { id: id }),
13331
- }));
13426
+ events.dispatchCustomEvent('modal', __assign({ id: id }, detail));
13427
+ };
13428
+ var useModalEvent = function (id, cb) {
13429
+ react.useEvent('modal', useCallback(function (event) {
13430
+ if (event.detail.id !== id) {
13431
+ return;
13432
+ }
13433
+ cb(event);
13434
+ }, [id, cb]));
13332
13435
  };
13333
13436
  var templateObject_1$5, templateObject_2$1, templateObject_3$1, templateObject_4$1;
13334
13437
 
@@ -13402,5 +13505,5 @@ var QuantityPicker = function (_a) {
13402
13505
  };
13403
13506
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
13404
13507
 
13405
- export { Accordion, AmazonButton, AssetsProvider, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, Card$1 as Card, CardSectionType, CartProductItem, CategoryTag, Checkbox, Collection, ComponentPosition, ComponentSize, index as CrossSell, DeliveryDetails, DiscountTag, Drawer, DropdownListIcons, FilteringDropdown, Tags as FilteringTags, FitPredictor, Icon, IconButton, Image, Input$1 as Input, InputValidationType, Modal, MultiColorPicker, OfferBanner, OrderBar, Overlay, Pagination, PaymentMethod, PaypalButton, Portal, PriceLabel, ProductGallery, ProductGalleryMobile, ProgressBar, QuantityPicker, RadioGroupInput, RadioInput, Rating, Review, ScrollToTop, SearchBar, SeasonOfferTag, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeFitGuide, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, StarList, Text$5 as Text, TextButton, ThemeProvider, ThemeVariables, Timer, Tooltip, Totals, decimalFormat, formatPrice, isEmail, isEmpty, isNumber, isPhoneNumber, isValidDate, modalEvent, simulateMouseClick, sliceString, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
13508
+ export { Accordion, AmazonButton, AssetsProvider, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, Card$1 as Card, CardSectionType, CartProductItem, CategoryTag, Checkbox, Collection, ComponentPosition, ComponentSize, index as CrossSell, DeliveryDetails, DiscountTag, Drawer, DropdownListIcons, FilteringDropdown, Tags as FilteringTags, FitPredictor, Icon, IconButton, Image, Input$1 as Input, InputValidationType, Modal, MultiColorPicker, OfferBanner, OrderBar, Overlay, Pagination, PaymentMethod, PaypalButton, Portal, PriceLabel, ProductGallery, ProductGalleryMobile, ProgressBar, QuantityPicker, RadioGroupInput, RadioInput, Rating, Review, ScrollToTop, SearchBar, SeasonOfferTag, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeFitGuide, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, StarList, Text$5 as Text, TextButton, ThemeProvider, ThemeVariables, Timer, Tooltip, Totals, decimalFormat, formatPrice, isEmail, isEmpty, isNumber, isPhoneNumber, isValidDate, modalEvent, simulateMouseClick, sliceString, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
13406
13509
  //# sourceMappingURL=index.esm.js.map