@trafilea/afrodita-components 6.11.0 → 6.11.1

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
@@ -3482,6 +3482,12 @@ declare type SpinnerProps = {
3482
3482
  };
3483
3483
  declare const Spinner: React.FC<SpinnerProps>;
3484
3484
 
3485
+ declare type VideoProps = {
3486
+ thumbnail: string;
3487
+ source: string;
3488
+ };
3489
+ declare const Video: React.FC<VideoProps>;
3490
+
3485
3491
  declare const useOnClickOutside: <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: (event: Event) => void) => void;
3486
3492
 
3487
3493
  declare type UseWindowDimensions = (breakpoints?: ThemeBreakpoints, options?: {
@@ -3507,21 +3513,20 @@ declare global {
3507
3513
  }
3508
3514
  }
3509
3515
 
3516
+ declare type BuildImageUrl = ({ src, width, }: {
3517
+ cdn: string;
3518
+ src: string;
3519
+ width?: string | number;
3520
+ height?: string | number;
3521
+ quality?: string | number;
3522
+ }) => string;
3523
+ declare const buildImageUrl: BuildImageUrl;
3524
+
3510
3525
  /**
3511
3526
  * @returns number formatted with "," and 2 decimals as string
3512
3527
  */
3513
3528
  declare const decimalFormat: (number: number) => string;
3514
3529
 
3515
- declare const isEmpty: (value: string) => boolean;
3516
- declare const isEmail: (value: string) => boolean;
3517
- declare const isNumber: (value: string) => boolean;
3518
- declare const isPhoneNumber: (value: string) => boolean;
3519
- declare const isValidDate: (value: string) => boolean;
3520
-
3521
- declare const simulateMouseClick: (element: HTMLElement) => void;
3522
-
3523
- declare const sliceString: (str: string, maxLength: number) => string;
3524
-
3525
3530
  declare const formatPrice: (value: number, { locale, currency }?: {
3526
3531
  locale?: string | undefined;
3527
3532
  currency?: string | undefined;
@@ -3531,4 +3536,14 @@ declare const getSrcSet: (imgLink: string, ...breakpoints: number[]) => string;
3531
3536
 
3532
3537
  declare const mediaQueries: facepaint.DynamicStyleFunction;
3533
3538
 
3534
- export { AbsorbencyLevel, Accordion, AccordionOptions, AmazonButton, AssetsProvider, Autoship, AutoshipV2, BeforeAfterCard, BeforeAfterVariant, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, ButtonType, BuyNowPayLater, CTAProps, _default as Card, CardSectionType, CartProductItem, CategorySquareTag, CategoryTag, Checkbox, ClubOfferTag, ClubRadioGroupInput, Collection, ColorPickerOption, ComponentPosition, ComponentSize, ContentType, index_d as CrossSell, DeliveryDetails, DiscountTag, Drawer, DropdownDialog, DropdownListIcons, DropdownListIconsItem, DropdownListIconsSubItem, DropdownOption, Filter, FilterChange, FilteringDropdown, Tags as FilteringTags, Filters, FitGuarantee, FitPredictor, HurryUp, HurryUpProps, Icon, IconButton, IconProps, IconWithOpacityProps, IconsWithTitle, Image, ImageCardWithDescription, ImageProps, Input, InputValidationType, Icon$1 as LibIcon, IconProps$1 as LibIconProps, Modal, MotivatorProgressBar, MultiColorPicker, Note, OfferBanner, OrderBar, Overlay, PackSelector, PackSelectorV2, Pagination, PaginatorBlog, Pattern, PaymentMethod, PaypalButton, Portal, PriceLabel, PriceLabelV2, PriceLabelV3, ProductGallery, ProductGalleryMobile, ProductGalleryMobileV2, ProductGalleryMobileV3, ProgressBar, QuantityPicker, RadioGroupInput, RadioGroupOption, RadioInput, RadioPrimary, Rating, Review, Review$1 as ReviewDetail, ReviewsHeader, ScrollToTop, SearchBar, SearchBarOptionItem, SearchNavigation, SeasonOfferTag, ShortBanner, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeChartTable, SizeDropdown, SizeFitGuide, SizeOption, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, SpinnerProps, StarList, StrengthBars, Tab, Tabs, Text, TextButton, TextWithImage, Theme, ThemeAssets, ThemeBasicPallete, ThemeBreakpoints, ThemeColorPallete, ThemeColors, ThemeComponent, ThemeFonts, ThemeProvider, ThemeProviderProps, ThemeTypography, ThemeVariables, Timer, Tooltip, Totals, TrackingProgress, TrackingProgressV2, WithTestId, componentSizeMapper, decimalFormat, formatPrice, getSrcSet, imageVideoProps, isEmail, isEmpty, isNumber, isPhoneNumber, isValidDate, mediaQueries, modalEvent, SeasonOfferRoundedTag as seasonOfferRoundedTag, simulateMouseClick, sliceString, useModal, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
3539
+ declare const simulateMouseClick: (element: HTMLElement) => void;
3540
+
3541
+ declare const sliceString: (str: string, maxLength: number) => string;
3542
+
3543
+ declare const isEmpty: (value: string) => boolean;
3544
+ declare const isEmail: (value: string) => boolean;
3545
+ declare const isNumber: (value: string) => boolean;
3546
+ declare const isPhoneNumber: (value: string) => boolean;
3547
+ declare const isValidDate: (value: string) => boolean;
3548
+
3549
+ export { AbsorbencyLevel, Accordion, AccordionOptions, AmazonButton, AssetsProvider, Autoship, AutoshipV2, BeforeAfterCard, BeforeAfterVariant, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, ButtonType, BuyNowPayLater, CTAProps, _default as Card, CardSectionType, CartProductItem, CategorySquareTag, CategoryTag, Checkbox, ClubOfferTag, ClubRadioGroupInput, Collection, ColorPickerOption, ComponentPosition, ComponentSize, ContentType, index_d as CrossSell, DeliveryDetails, DiscountTag, Drawer, DropdownDialog, DropdownListIcons, DropdownListIconsItem, DropdownListIconsSubItem, DropdownOption, Filter, FilterChange, FilteringDropdown, Tags as FilteringTags, Filters, FitGuarantee, FitPredictor, HurryUp, HurryUpProps, Icon, IconButton, IconProps, IconWithOpacityProps, IconsWithTitle, Image, ImageCardWithDescription, ImageProps, Input, InputValidationType, Icon$1 as LibIcon, IconProps$1 as LibIconProps, Modal, MotivatorProgressBar, MultiColorPicker, Note, OfferBanner, OrderBar, Overlay, PackSelector, PackSelectorV2, Pagination, PaginatorBlog, Pattern, PaymentMethod, PaypalButton, Portal, PriceLabel, PriceLabelV2, PriceLabelV3, ProductGallery, ProductGalleryMobile, ProductGalleryMobileV2, ProductGalleryMobileV3, ProgressBar, QuantityPicker, RadioGroupInput, RadioGroupOption, RadioInput, RadioPrimary, Rating, Review, Review$1 as ReviewDetail, ReviewsHeader, ScrollToTop, SearchBar, SearchBarOptionItem, SearchNavigation, SeasonOfferTag, ShortBanner, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeChartTable, SizeDropdown, SizeFitGuide, SizeOption, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, SpinnerProps, StarList, StrengthBars, Tab, Tabs, Text, TextButton, TextWithImage, Theme, ThemeAssets, ThemeBasicPallete, ThemeBreakpoints, ThemeColorPallete, ThemeColors, ThemeComponent, ThemeFonts, ThemeProvider, ThemeProviderProps, ThemeTypography, ThemeVariables, Timer, Tooltip, Totals, TrackingProgress, TrackingProgressV2, Video, VideoProps, WithTestId, buildImageUrl, componentSizeMapper, decimalFormat, formatPrice, getSrcSet, imageVideoProps, isEmail, isEmpty, isNumber, isPhoneNumber, isValidDate, mediaQueries, modalEvent, SeasonOfferRoundedTag as seasonOfferRoundedTag, simulateMouseClick, sliceString, useModal, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
@@ -3351,7 +3351,9 @@ var buildImageUrl = function (_a) {
3351
3351
  var source = "/external/".concat(baseUrl.host.replaceAll('.', ''));
3352
3352
  var width = getValidSize(widthString);
3353
3353
  var height = getValidSize(heightString);
3354
- return "".concat(cdn).concat(source, "/images").concat(baseUrl.pathname, "?width=").concat(width, "&height=").concat(height, "&quality=").concat(quality, "&url=").concat(url);
3354
+ var format = src.includes('.svg') ? '&format=svg' : '';
3355
+ var params = "width=".concat(width, "&height=").concat(height, "&quality=").concat(quality, "&url=").concat(url).concat(format);
3356
+ return "".concat(cdn).concat(source, "/images").concat(baseUrl.pathname, "?").concat(params);
3355
3357
  }
3356
3358
  catch (e) {
3357
3359
  console.warn("[Afrodita][buildImageUrl] [src:".concat(src, "] ERROR:").concat(e));
@@ -4502,38 +4504,6 @@ var decimalFormat = function (number) {
4502
4504
  return number.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
4503
4505
  };
4504
4506
 
4505
- var isEmpty = function (value) {
4506
- return value.length === 0;
4507
- };
4508
- var isEmail = function (value) {
4509
- return /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(value);
4510
- };
4511
- var isNumber$1 = function (value) {
4512
- return /^[0-9]*$/.test(value);
4513
- };
4514
- var isPhoneNumber = function (value) {
4515
- return /^\d{10}$/.test(value);
4516
- };
4517
- var isValidDate = function (value) {
4518
- return /^\d{4}-\d{2}-\d{2}$/.test(value);
4519
- };
4520
-
4521
- var mouseClickEvents = ['mousedown', 'click', 'mouseup'];
4522
- var simulateMouseClick = function (element) {
4523
- mouseClickEvents.forEach(function (mouseEventType) {
4524
- return element.dispatchEvent(new MouseEvent(mouseEventType, {
4525
- view: window,
4526
- bubbles: true,
4527
- cancelable: true,
4528
- buttons: 1,
4529
- }));
4530
- });
4531
- };
4532
-
4533
- var sliceString = function (str, maxLength) {
4534
- return str.length > maxLength ? "".concat(str.slice(0, maxLength), "...") : str;
4535
- };
4536
-
4537
4507
  var getSrcSet = function (imgLink) {
4538
4508
  var breakpoints = [];
4539
4509
  for (var _i = 1; _i < arguments.length; _i++) {
@@ -4629,6 +4599,38 @@ var mediaQueries = index$2(["@media(max-width: 900px)", "@media(min-width: 900px
4629
4599
  literal: true,
4630
4600
  });
4631
4601
 
4602
+ var mouseClickEvents = ['mousedown', 'click', 'mouseup'];
4603
+ var simulateMouseClick = function (element) {
4604
+ mouseClickEvents.forEach(function (mouseEventType) {
4605
+ return element.dispatchEvent(new MouseEvent(mouseEventType, {
4606
+ view: window,
4607
+ bubbles: true,
4608
+ cancelable: true,
4609
+ buttons: 1,
4610
+ }));
4611
+ });
4612
+ };
4613
+
4614
+ var sliceString = function (str, maxLength) {
4615
+ return str.length > maxLength ? "".concat(str.slice(0, maxLength), "...") : str;
4616
+ };
4617
+
4618
+ var isEmpty = function (value) {
4619
+ return value.length === 0;
4620
+ };
4621
+ var isEmail = function (value) {
4622
+ return /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(value);
4623
+ };
4624
+ var isNumber$1 = function (value) {
4625
+ return /^[0-9]*$/.test(value);
4626
+ };
4627
+ var isPhoneNumber = function (value) {
4628
+ return /^\d{10}$/.test(value);
4629
+ };
4630
+ var isValidDate = function (value) {
4631
+ return /^\d{4}-\d{2}-\d{2}$/.test(value);
4632
+ };
4633
+
4632
4634
  var ErrorText = newStyled.h3(templateObject_1$1O || (templateObject_1$1O = __makeTemplateObject(["\n color: ", " !important;\n font-size: 0.75rem;\n font-weight: 600;\n margin: 0;\n font-height: 1rem;\n margin-left: 0.313rem;\n"], ["\n color: ", " !important;\n font-size: 0.75rem;\n font-weight: 600;\n margin: 0;\n font-height: 1rem;\n margin-left: 0.313rem;\n"])), function (props) { return props.color; });
4633
4635
  var ErrorContainer = newStyled.div(templateObject_2$1c || (templateObject_2$1c = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-top: 12px;\n"], ["\n display: flex;\n align-items: center;\n margin-top: 12px;\n"])));
4634
4636
  var Error$1 = function (_a) {
@@ -19824,5 +19826,5 @@ var Spinner = function (_a) {
19824
19826
  return (jsx$1(Container, __assign$1({ size: size, "data-testid": "Container" }, { children: complete ? (jsx$1(Icon.Actions.LightCheck, { fill: fill, svgProps: { strokeWidth: completeIconStroke } }, void 0)) : (jsx$1(StyledSpinner, { duration: animationDuration, "data-testid": "Loading", color: fill, background: background, size: borderSize !== null && borderSize !== void 0 ? borderSize : ComponentSize.Small }, void 0)) }), void 0));
19825
19827
  };
19826
19828
 
19827
- export { AbsorbencyLevel, Accordion$1 as Accordion, AccordionOptions, AmazonButton, AssetsProvider, Autoship, AutoshipV2, BeforeAfterCard, BeforeAfterVariant, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, BuyNowPayLater, Card$2 as Card, CardSectionType, CartProductItem, CategorySquareTag, CategoryTag, Checkbox, ClubOfferTag, ClubRadioGroupInput, Collection, ComponentPosition, ComponentSize, index$1 as CrossSell, DeliveryDetails, DiscountTag$1 as DiscountTag, Drawer, DropdownDialog, DropdownListIcons, FilteringDropdown, Tags as FilteringTags, Filters, FitGuarantee, FitPredictor, Global, HurryUp, Icon, IconButton, IconsWithTitle, Image$3 as Image, ImageCardWithDescription, Input$3 as Input, InputValidationType, Icon$1 as LibIcon, Modal, MotivatorProgressBar, MultiColorPicker, Note, OfferBanner, OrderBar, Overlay, PackSelector, PackSelectorV2, Pagination, PaginatorBlog, PaymentMethod, PaypalButton, Portal, PriceLabel, PriceLabelV2, PriceLabelV3, ProductGallery, ProductGalleryMobile, ProductGalleryMobileV2, ProductGalleryMobileV3, ProgressBar, QuantityPicker, RadioGroupInput, RadioInput, RadioPrimary, Rating, Review, Review$1 as ReviewDetail, ReviewsHeader, ScrollToTop, SearchBar, SearchNavigation, SeasonOfferTag, ShortBanner, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeChartTable, SizeDropdown, SizeFitGuide, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, StarList, StrengthBars, Tab, Tabs, Text$7 as Text, TextButton, TextWithImage, ThemeProvider, ThemeVariables, Timer, Tooltip, Totals, TrackingProgress, TrackingProgressV2, componentSizeMapper, css, decimalFormat, formatPrice, getSrcSet, isEmail, isEmpty, isNumber$1 as isNumber, isPhoneNumber, isValidDate, mediaQueries, modalEvent, SeasonOfferRoundedTag as seasonOfferRoundedTag, simulateMouseClick, sliceString, newStyled as styled, useModal, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
19829
+ export { AbsorbencyLevel, Accordion$1 as Accordion, AccordionOptions, AmazonButton, AssetsProvider, Autoship, AutoshipV2, BeforeAfterCard, BeforeAfterVariant, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, BuyNowPayLater, Card$2 as Card, CardSectionType, CartProductItem, CategorySquareTag, CategoryTag, Checkbox, ClubOfferTag, ClubRadioGroupInput, Collection, ComponentPosition, ComponentSize, index$1 as CrossSell, DeliveryDetails, DiscountTag$1 as DiscountTag, Drawer, DropdownDialog, DropdownListIcons, FilteringDropdown, Tags as FilteringTags, Filters, FitGuarantee, FitPredictor, Global, HurryUp, Icon, IconButton, IconsWithTitle, Image$3 as Image, ImageCardWithDescription, Input$3 as Input, InputValidationType, Icon$1 as LibIcon, Modal, MotivatorProgressBar, MultiColorPicker, Note, OfferBanner, OrderBar, Overlay, PackSelector, PackSelectorV2, Pagination, PaginatorBlog, PaymentMethod, PaypalButton, Portal, PriceLabel, PriceLabelV2, PriceLabelV3, ProductGallery, ProductGalleryMobile, ProductGalleryMobileV2, ProductGalleryMobileV3, ProgressBar, QuantityPicker, RadioGroupInput, RadioInput, RadioPrimary, Rating, Review, Review$1 as ReviewDetail, ReviewsHeader, ScrollToTop, SearchBar, SearchNavigation, SeasonOfferTag, ShortBanner, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeChartTable, SizeDropdown, SizeFitGuide, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, StarList, StrengthBars, Tab, Tabs, Text$7 as Text, TextButton, TextWithImage, ThemeProvider, ThemeVariables, Timer, Tooltip, Totals, TrackingProgress, TrackingProgressV2, Video$1 as Video, buildImageUrl, componentSizeMapper, css, decimalFormat, formatPrice, getSrcSet, isEmail, isEmpty, isNumber$1 as isNumber, isPhoneNumber, isValidDate, mediaQueries, modalEvent, SeasonOfferRoundedTag as seasonOfferRoundedTag, simulateMouseClick, sliceString, newStyled as styled, useModal, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
19828
19830
  //# sourceMappingURL=index.esm.js.map