@trafilea/afrodita-components 6.38.1 → 6.38.4

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,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import * as react from 'react';
3
- import react__default, { FC, SVGProps, ReactNode, CSSProperties, ElementType, ReactFragment, AriaAttributes, HTMLAttributes, LabelHTMLAttributes, DetailedHTMLProps, VideoHTMLAttributes, RefObject } from 'react';
3
+ import react__default, { FC, SVGProps, ReactNode, CSSProperties, ElementType, ReactFragment, AriaAttributes, HTMLAttributes, LabelHTMLAttributes, DetailedHTMLProps, VideoHTMLAttributes, ReactElement, RefObject } from 'react';
4
4
  import { ComponentSize as ComponentSize$1 } from 'src/types/enums';
5
5
  import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
6
6
  import { TextProps as TextProps$1 } from 'src/components/text/Text';
@@ -4095,7 +4095,7 @@ declare const SubscriptionPlanSelector: FC<SubscriptionPlanSelectorProps>;
4095
4095
 
4096
4096
  declare type BenefitProps = {
4097
4097
  icon?: Pick<IconProps$1, 'name' | 'fill' | 'width' | 'height'>;
4098
- text: string | ReactNode;
4098
+ text: string | ReactElement;
4099
4099
  };
4100
4100
  declare type SizeOptionProps = {
4101
4101
  key: string;
@@ -4105,7 +4105,12 @@ declare type SizeOptionProps = {
4105
4105
  };
4106
4106
  declare type OfferAtCartProps = {
4107
4107
  className?: string;
4108
- title: ReactNode | string;
4108
+ title: {
4109
+ content: string | ReactElement | {
4110
+ __html: string;
4111
+ };
4112
+ bold?: boolean;
4113
+ };
4109
4114
  image: ImageProps;
4110
4115
  benefits: BenefitProps[];
4111
4116
  sizeOptions: SizeOptionProps[];
@@ -5379,6 +5379,12 @@ var sizeOptions = [
5379
5379
  value: '4XL',
5380
5380
  disabled: false,
5381
5381
  },
5382
+ {
5383
+ key: '4XL / 10XXL',
5384
+ label: '4XL / 10XXL',
5385
+ value: '4XL / 10XXL',
5386
+ disabled: false,
5387
+ },
5382
5388
  ];
5383
5389
 
5384
5390
  var ErrorText = newStyled.h3(templateObject_1$20 || (templateObject_1$20 = __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; });
@@ -21836,7 +21842,7 @@ var SubscriptionPlanSelector = function (_a) {
21836
21842
  }, useV2Style: true, checked: !radiosStatuses.oneTime.disabled && radiosStatuses.oneTime.checked, disabled: radiosStatuses.oneTime.disabled }, void 0), jsx$1(StyledPrice, { testId: "single-purchase", finalPrice: "$".concat(decimalFormat(Number(discountedPrice))), disabled: radiosStatuses.oneTime.disabled, highlighted: !radiosStatuses.oneTime.disabled && radiosStatuses.oneTime.highlighted, size: ComponentSize.Large, originalPrice: "$".concat(decimalFormat(Number(listPrice))) }, void 0)] }), void 0)] }), void 0));
21837
21843
  };
21838
21844
 
21839
- var Container = newStyled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: 100%;\n margin-bottom: 20px;\n border: 1px;\n padding: 12px;\n border-radius: 8px;\n gap: 14px;\n"], ["\n display: flex;\n flex-direction: column;\n width: 100%;\n margin-bottom: 20px;\n border: 1px;\n padding: 12px;\n border-radius: 8px;\n gap: 14px;\n"])));
21845
+ var Container = newStyled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: 100%;\n padding: 12px;\n border: 1px solid #e5e5e5;\n border-radius: 8px;\n gap: 14px;\n margin: auto;\n"], ["\n display: flex;\n flex-direction: column;\n width: 100%;\n padding: 12px;\n border: 1px solid #e5e5e5;\n border-radius: 8px;\n gap: 14px;\n margin: auto;\n"])));
21840
21846
  var Body = newStyled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n gap: 8px;\n width: 100%;\n height: ", ";\n"], ["\n display: flex;\n gap: 8px;\n width: 100%;\n height: ", ";\n"])), function (_a) {
21841
21847
  var height = _a.height;
21842
21848
  return height;
@@ -21874,28 +21880,33 @@ var Title = function (_a) {
21874
21880
  };
21875
21881
 
21876
21882
  var OfferAtCart = function (_a) {
21877
- var className = _a.className, title = _a.title, _b = _a.image, src = _b.src, alt = _b.alt, benefits = _a.benefits, _c = _a.ctaText, ctaText = _c === void 0 ? 'Yes, I want this offer' : _c, sizeOptions = _a.sizeOptions, rating = _a.rating, onAddToCart = _a.onAddToCart;
21883
+ var className = _a.className, _b = _a.title, titleContent = _b.content, bold = _b.bold, _c = _a.image, src = _c.src, alt = _c.alt, benefits = _a.benefits, _d = _a.ctaText, ctaText = _d === void 0 ? 'Yes, I want this offer' : _d, sizeOptions = _a.sizeOptions, rating = _a.rating, onAddToCart = _a.onAddToCart;
21878
21884
  var theme = useTheme();
21879
21885
  var isMobile = useDeviceType() === 'mobile';
21880
- var _d = useState(), selectedSize = _d[0], setSelectedSize = _d[1];
21881
- var _e = useState(false), showErrorMessage = _e[0], setShowErrorMessage = _e[1];
21886
+ var _e = useState(), selectedSize = _e[0], setSelectedSize = _e[1];
21887
+ var _f = useState(false), showErrorMessage = _f[0], setShowErrorMessage = _f[1];
21882
21888
  var rawBenefitStyles = {
21883
21889
  fontSize: isMobile ? '12px' : '14px',
21884
21890
  lineHeight: isMobile ? '16px' : '22px',
21885
21891
  display: 'inline-block',
21886
21892
  margin: 0,
21887
21893
  };
21888
- var TitleSection = isDangerouslySetInnerHTML(title) ? (jsx$1(Title, { dangerouslySetInnerHTML: title }, void 0)) : (jsx$1(Title, { content: title }, void 0));
21889
- var renderBenefit = function (text) {
21890
- if (isValidElement(text)) {
21891
- return text;
21894
+ var getTitleProps = function () {
21895
+ if (typeof titleContent === 'string') {
21896
+ return { content: titleContent, bold: bold };
21892
21897
  }
21893
- else if (typeof text === 'string') {
21894
- return jsx$1("span", { style: rawBenefitStyles, dangerouslySetInnerHTML: { __html: text } }, void 0);
21898
+ else if (isDangerouslySetInnerHTML(titleContent)) {
21899
+ return { dangerouslySetInnerHTML: titleContent };
21895
21900
  }
21896
21901
  else {
21897
- return null;
21902
+ return { content: titleContent };
21903
+ }
21904
+ };
21905
+ var renderBenefit = function (text) {
21906
+ if (typeof text === 'string') {
21907
+ return jsx$1("span", { style: rawBenefitStyles, dangerouslySetInnerHTML: { __html: text } }, void 0);
21898
21908
  }
21909
+ return text;
21899
21910
  };
21900
21911
  var BenefitsSection = (jsx$1(Benefits, __assign$1({ height: isMobile ? '100%' : '65%' }, { children: benefits.map(function (_a) {
21901
21912
  var icon = _a.icon, text = _a.text;
@@ -21913,7 +21924,7 @@ var OfferAtCart = function (_a) {
21913
21924
  setShowErrorMessage(true);
21914
21925
  }
21915
21926
  } }, void 0)] }, void 0));
21916
- return (jsxs$1(Container, __assign$1({ className: className }, { children: [TitleSection, jsxs$1(Body, __assign$1({ height: isMobile ? '120px' : '162px' }, { children: [jsxs$1(ImageWrapper, __assign$1({ width: isMobile ? '130px' : '122px' }, { children: [rating && (jsxs$1(RatingWrapper, { children: [jsx$1(Rating, { rating: rating, size: isMobile ? ComponentSize.XXSmall : ComponentSize.XSmall }, void 0), jsxs$1(RatingText, __assign$1({ fontSize: isMobile ? '9px' : '13px' }, { children: [rating, "/5"] }), void 0)] }, void 0)), jsx$1(Image$3, { src: src, alt: alt, width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }, void 0)] }), void 0), jsxs$1(RightContent, { children: [BenefitsSection, !isMobile && ActionsSection, showErrorMessage && (jsx$1(Text$7, __assign$1({ variant: "body", weight: "demi", size: "small", color: theme.colors.semantic.urgent.color }, { children: "Please select a size First" }), void 0))] }, void 0)] }), void 0), isMobile && ActionsSection] }), void 0));
21927
+ return (jsxs$1(Container, __assign$1({ className: className }, { children: [jsx$1(Title, __assign$1({}, getTitleProps()), void 0), jsxs$1(Body, __assign$1({ height: isMobile ? '120px' : '162px' }, { children: [jsxs$1(ImageWrapper, __assign$1({ width: isMobile ? '130px' : '122px' }, { children: [rating && (jsxs$1(RatingWrapper, { children: [jsx$1(Rating, { rating: rating, size: isMobile ? ComponentSize.XXSmall : ComponentSize.XSmall }, void 0), jsxs$1(RatingText, __assign$1({ fontSize: isMobile ? '9px' : '13px' }, { children: [rating, "/5"] }), void 0)] }, void 0)), jsx$1(Image$3, { src: src, alt: alt, width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }, void 0)] }), void 0), jsxs$1(RightContent, { children: [BenefitsSection, !isMobile && ActionsSection, showErrorMessage && (jsx$1(Text$7, __assign$1({ variant: "body", weight: "demi", size: "small", color: theme.colors.semantic.urgent.color }, { children: "Please select a size First" }), void 0))] }, void 0)] }), void 0), isMobile && ActionsSection] }), void 0));
21917
21928
  };
21918
21929
 
21919
21930
  export { AbsorbencyLevel, Accordion$1 as Accordion, AccordionOptions, AmazonButton, AssetsProvider, Autoship, AutoshipFrequencyDropdown, AutoshipOfferCard, AutoshipOfferCardCta, AutoshipV2, BasicAccordion, BeforeAfterCard, BeforeAfterVariant, BenefitsList, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, BuyNowPayLater, CacheProvider, CancellationFlowAccordionContentPerPartner, Card$3 as Card, CardSectionType, CartItemCard, CartProductItem, CategorySquareTag, CategoryTag, Checkbox, ClubOfferSelector, ClubOfferTag, ClubPriceMemberLabel, ClubRadioGroupInput, Collection, ColorPickerWithTooltip, ComponentPosition, ComponentSize, CouponCard, index$1 as CrossSell, DeliveryDetails, DiscountTag$3 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, JoinClubCard, Icon$1 as LibIcon, Modal, MotivatorProgressBar, MultiColorPicker, Note, OfferAtCart, OfferBanner, OrderBar, Overlay, PackSelector, PackSelectorV2, Pagination, PaginatorBlog, PaymentMethod, PaypalButton, Portal, PriceLabel$1 as PriceLabel, PriceLabelV2$1 as PriceLabelV2, PriceLabelV3, ProductCard, ProductCardV2, ProductCardV3, ProductGallery, ProductGalleryMobile, ProductGalleryMobileV2, ProductGalleryMobileV3, ProductGalleryMobileV4, ProductGalleryMobileV5, ProgressBar, QuantityPicker, RadioGroupInput, RadioInput, RadioPrimary, Rating, Review, Review$1 as ReviewDetail, ReviewsHeader, ScrollToTop, SearchBar, SearchNavigation, SeasonOfferTag, ShortBanner, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeChartTable, SizeChartTableV2, SizeChartTableV3, SizeDropdown, SizeFitGuide, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, StarList, StrengthBars, SubscriptionPlanSelector, Tab, Tabs, Text$7 as Text, TextButton, TextWithImage, ThemeProvider, ThemeVariables, Timer, Toast, ToggleComponent, Tooltip, Totals, TrackingProgress, TrackingProgressV2, Video$1 as Video, benefits, benefitsRawHtml, buildImageUrl, componentSizeMapper, createCache, css, decimalFormat, formatPrice, getSrcSet, isDangerouslySetInnerHTML, isEmail, isEmpty, isNumber$1 as isNumber, isPhoneNumber, isValidDate, mediaQueries, modalEvent, SeasonOfferRoundedTag as seasonOfferRoundedTag, simulateMouseClick, sizeOptions, sliceString, newStyled as styled, title, useDeviceType, useModal, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };