@trafilea/afrodita-components 6.38.1 → 6.38.3
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 +8 -3
- package/build/index.esm.js +16 -11
- package/build/index.esm.js.map +1 -1
- package/build/index.js +16 -11
- package/build/index.js.map +1 -1
- package/package.json +1 -1
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 |
|
|
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:
|
|
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[];
|
package/build/index.esm.js
CHANGED
|
@@ -21874,28 +21874,33 @@ var Title = function (_a) {
|
|
|
21874
21874
|
};
|
|
21875
21875
|
|
|
21876
21876
|
var OfferAtCart = function (_a) {
|
|
21877
|
-
var className = _a.className,
|
|
21877
|
+
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
21878
|
var theme = useTheme();
|
|
21879
21879
|
var isMobile = useDeviceType() === 'mobile';
|
|
21880
|
-
var
|
|
21881
|
-
var
|
|
21880
|
+
var _e = useState(), selectedSize = _e[0], setSelectedSize = _e[1];
|
|
21881
|
+
var _f = useState(false), showErrorMessage = _f[0], setShowErrorMessage = _f[1];
|
|
21882
21882
|
var rawBenefitStyles = {
|
|
21883
21883
|
fontSize: isMobile ? '12px' : '14px',
|
|
21884
21884
|
lineHeight: isMobile ? '16px' : '22px',
|
|
21885
21885
|
display: 'inline-block',
|
|
21886
21886
|
margin: 0,
|
|
21887
21887
|
};
|
|
21888
|
-
var
|
|
21889
|
-
|
|
21890
|
-
|
|
21891
|
-
return text;
|
|
21888
|
+
var getTitleProps = function () {
|
|
21889
|
+
if (typeof titleContent === 'string') {
|
|
21890
|
+
return { content: titleContent, bold: bold };
|
|
21892
21891
|
}
|
|
21893
|
-
else if (
|
|
21894
|
-
return
|
|
21892
|
+
else if (isDangerouslySetInnerHTML(titleContent)) {
|
|
21893
|
+
return { dangerouslySetInnerHTML: titleContent };
|
|
21895
21894
|
}
|
|
21896
21895
|
else {
|
|
21897
|
-
return
|
|
21896
|
+
return { content: titleContent };
|
|
21897
|
+
}
|
|
21898
|
+
};
|
|
21899
|
+
var renderBenefit = function (text) {
|
|
21900
|
+
if (typeof text === 'string') {
|
|
21901
|
+
return jsx$1("span", { style: rawBenefitStyles, dangerouslySetInnerHTML: { __html: text } }, void 0);
|
|
21898
21902
|
}
|
|
21903
|
+
return text;
|
|
21899
21904
|
};
|
|
21900
21905
|
var BenefitsSection = (jsx$1(Benefits, __assign$1({ height: isMobile ? '100%' : '65%' }, { children: benefits.map(function (_a) {
|
|
21901
21906
|
var icon = _a.icon, text = _a.text;
|
|
@@ -21913,7 +21918,7 @@ var OfferAtCart = function (_a) {
|
|
|
21913
21918
|
setShowErrorMessage(true);
|
|
21914
21919
|
}
|
|
21915
21920
|
} }, void 0)] }, void 0));
|
|
21916
|
-
return (jsxs$1(Container, __assign$1({ className: className }, { children: [
|
|
21921
|
+
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
21922
|
};
|
|
21918
21923
|
|
|
21919
21924
|
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 };
|