@trafilea/afrodita-components 6.43.4 → 6.43.7
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 +23 -10
- package/build/index.esm.js +30 -19
- package/build/index.esm.js.map +1 -1
- package/build/index.js +30 -19
- package/build/index.js.map +1 -1
- package/build/theme/revel.theme.js +4 -0
- package/build/theme/shapermint.theme.js +4 -0
- package/build/theme/thebodcon.theme.js +4 -0
- package/build/theme/thespadr.theme.js +4 -0
- package/build/theme/truekind.theme.js +4 -0
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -2595,12 +2595,16 @@ interface ISubscriptionFrequencyDropdown {
|
|
|
2595
2595
|
}
|
|
2596
2596
|
declare const AutoshipFrequencyDropdown: FC<ISubscriptionFrequencyDropdown>;
|
|
2597
2597
|
|
|
2598
|
-
declare type
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
baseColor: string;
|
|
2598
|
+
declare type Benefit = {
|
|
2599
|
+
iconName: IconName;
|
|
2600
|
+
htmlText: string;
|
|
2601
|
+
fill?: string;
|
|
2603
2602
|
};
|
|
2603
|
+
declare type BenefitsListProps = {
|
|
2604
|
+
benefits: Benefit[];
|
|
2605
|
+
disabled?: boolean;
|
|
2606
|
+
};
|
|
2607
|
+
|
|
2604
2608
|
declare const BenefitsList: FC<BenefitsListProps>;
|
|
2605
2609
|
|
|
2606
2610
|
declare type TimeProps = {
|
|
@@ -3698,13 +3702,14 @@ declare type TextPricingProps = {
|
|
|
3698
3702
|
declare type TextLinkProps = {
|
|
3699
3703
|
variant: 'link';
|
|
3700
3704
|
weight?: 'demi' | 'regular';
|
|
3701
|
-
size?: 'regular' | 'small';
|
|
3705
|
+
size?: 'regular' | 'small' | 'xsmall';
|
|
3702
3706
|
underline?: boolean;
|
|
3703
3707
|
disabled?: boolean;
|
|
3704
3708
|
wide?: never;
|
|
3705
3709
|
original?: never;
|
|
3706
3710
|
allCaps?: never;
|
|
3707
3711
|
href?: string;
|
|
3712
|
+
target?: string;
|
|
3708
3713
|
};
|
|
3709
3714
|
declare type TextLabelProps = {
|
|
3710
3715
|
variant: 'label';
|
|
@@ -3958,8 +3963,9 @@ declare type JoinClubProps = {
|
|
|
3958
3963
|
titleCopy: string | JSX.Element;
|
|
3959
3964
|
style?: React.CSSProperties;
|
|
3960
3965
|
showButton?: boolean;
|
|
3961
|
-
buttonText?: string;
|
|
3966
|
+
buttonText?: string | JSX.Element;
|
|
3962
3967
|
buttonStyle?: React.CSSProperties;
|
|
3968
|
+
termsText?: string | JSX.Element;
|
|
3963
3969
|
};
|
|
3964
3970
|
|
|
3965
3971
|
declare const JoinClubCard: React.FC<JoinClubProps>;
|
|
@@ -4126,24 +4132,31 @@ interface TableProps {
|
|
|
4126
4132
|
declare const SizeChartTableV3: React.FC<TableProps>;
|
|
4127
4133
|
|
|
4128
4134
|
declare type WithBenefits = {
|
|
4129
|
-
benefits:
|
|
4135
|
+
benefits: Benefit[];
|
|
4130
4136
|
children?: never;
|
|
4131
4137
|
};
|
|
4132
4138
|
declare type WithChildren = {
|
|
4133
4139
|
benefits?: never;
|
|
4134
4140
|
children: ReactNode;
|
|
4135
4141
|
};
|
|
4142
|
+
declare type TermsLink = {
|
|
4143
|
+
text: string;
|
|
4144
|
+
url: string;
|
|
4145
|
+
};
|
|
4136
4146
|
declare type CommonProps = {
|
|
4137
4147
|
pricing: PriceType;
|
|
4138
4148
|
currencySymbol: string;
|
|
4139
4149
|
radios: RadiosConfig;
|
|
4140
4150
|
onChange: (values: SelectorOnChangeProps) => void;
|
|
4141
4151
|
tooltip?: TooltipType;
|
|
4142
|
-
frequency?: AutoshipFrequency
|
|
4152
|
+
frequency?: AutoshipFrequency & {
|
|
4153
|
+
showFrequencyText?: boolean;
|
|
4154
|
+
};
|
|
4143
4155
|
className?: string;
|
|
4144
4156
|
discountTagClassName?: string;
|
|
4145
4157
|
closeIcon?: boolean;
|
|
4146
4158
|
discountLabel?: string;
|
|
4159
|
+
termsAndConditions?: TermsLink;
|
|
4147
4160
|
};
|
|
4148
4161
|
declare type SubscriptionPlanSelectorProps = (WithBenefits | WithChildren) & CommonProps;
|
|
4149
4162
|
declare type SubscriptionPlanSelectorRadios = 'oneTime' | 'subscription';
|
|
@@ -4292,4 +4305,4 @@ declare const benefits: (size: 'xsmall' | 'small' | 'regular') => BenefitProps[]
|
|
|
4292
4305
|
declare const benefitsRawHtml: BenefitProps[];
|
|
4293
4306
|
declare const sizeOptions: SizeOptionProps[];
|
|
4294
4307
|
|
|
4295
|
-
export { AbsorbencyLevel, Accordion, AccordionOptions, AmazonButton, AssetsProvider, Autoship, AutoshipFrequency, AutoshipFrequencyDropdown, AutoshipOfferCard, AutoshipOfferCardCta, AutoshipV2, BasicAccordion, BeforeAfterCard, BeforeAfterVariant, BenefitProps, BenefitsList, BenefitsListProps, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, ButtonType, BuyNowPayLater, CTAProps, CancellationFlowAccordionContentPerPartner, _default as Card, CardSectionType, CartItemCard, CartProductItem, CategorySquareTag, CategoryTag, Checkbox, ClubOfferSelector, ClubOfferTag, ClubPriceMemberLabel, ClubRadioGroupInput, Collection, ColorPickerOption, ColorPickerWithTooltip, ColorsState, CommonProps, ComponentPosition, ComponentSize, ContentType, CouponCard, index_d as CrossSell, DeliveryDetails, DeviceType, DiscountTag, Drawer, DropdownDialog, DropdownListIcons, DropdownListIconsItem, DropdownListIconsSubItem, DropdownOption, Filter, FilterChange, FilteringDropdown, Tags as FilteringTags, Filters, FitGuarantee, FitPredictor, HorizontalDivider, HorizontalDividerProps, HurryUp, HurryUpProps, ISubscriptionFrequencyDropdown, Icon, IconButton, IconProps, IconWithOpacityProps, IconsWithTitle, Image, ImageCardWithDescription, ImageProps, Input, InputValidationType, JoinClubCard, Icon$1 as LibIcon, IconProps$1 as LibIconProps, LikeButton, LikeButtonColors, LikeButtonProps, Modal, MotivatorProgressBar, MultiColorPicker, Note, OfferAtCart, OfferAtCartProps, OfferBanner, OrderBar, Overlay, PackSelector, PackSelectorV2, Pagination, PaginatorBlog, Partner, PartnerContent, Pattern, PaymentMethod, PaypalButton, Portal, PriceLabel, PriceLabelV2, PriceLabelV3, PriceType, ProductCard, ProductCardV2, ProductCardV3, ProductGallery, ProductGalleryMobile, ProductGalleryMobileV2, ProductGalleryMobileV3, ProductGalleryMobileV4, ProductGalleryMobileV5, ProgressBar, QuantityPicker, RadioConfig, RadioGroupInput, RadioGroupOption, RadioInput, RadioPrimary, RadiosConfig, Rating, Review, Review$1 as ReviewDetail, ReviewsHeader, ScrollToTop, SearchBar, SearchBarOptionItem, SearchNavigation, SeasonOfferTag, SelectorOnChangeProps, ShortBanner, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeChartTable, SizeChartTableV2, SizeChartTableV3, SizeDropdown, SizeFitGuide, SizeOption, SizeOptionProps, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, SpinnerProps, StarList, StrengthBars, SubscriptionPlanSelector, SubscriptionPlanSelectorProps, SubscriptionPlanSelectorRadios, Tab, Tabs, Text, TextButton, TextWithImage, Theme, ThemeAssets, ThemeBasicPallete, ThemeBreakpoints, ThemeColorPallete, ThemeColors, ThemeComponent, ThemeFonts, ThemeProvider, ThemeProviderProps, ThemeTypography, ThemeVariables, Timer, Toast, ToggleComponent, Tooltip, TooltipContent, TooltipHeader, TooltipType, Totals, TrackingProgress, TrackingProgressV2, Video, VideoProps, WithBenefits, WithChildren, WithTestId, benefits, benefitsRawHtml, buildImageUrl, componentSizeMapper, decimalFormat, formatPrice, getSrcSet, imageVideoProps, isDangerouslySetInnerHTML, isEmail, isEmpty, isNumber, isPhoneNumber, isValidDate, mediaQueries, modalEvent, SeasonOfferRoundedTag as seasonOfferRoundedTag, simulateMouseClick, sizeOptions, sliceString, title, useDeviceType, useModal, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
|
|
4308
|
+
export { AbsorbencyLevel, Accordion, AccordionOptions, AmazonButton, AssetsProvider, Autoship, AutoshipFrequency, AutoshipFrequencyDropdown, AutoshipOfferCard, AutoshipOfferCardCta, AutoshipV2, BasicAccordion, BeforeAfterCard, BeforeAfterVariant, BenefitProps, BenefitsList, BenefitsListProps, Bundle, ButtonPrimary, ButtonSecondary, ButtonSecondaryOutline, ButtonType, BuyNowPayLater, CTAProps, CancellationFlowAccordionContentPerPartner, _default as Card, CardSectionType, CartItemCard, CartProductItem, CategorySquareTag, CategoryTag, Checkbox, ClubOfferSelector, ClubOfferTag, ClubPriceMemberLabel, ClubRadioGroupInput, Collection, ColorPickerOption, ColorPickerWithTooltip, ColorsState, CommonProps, ComponentPosition, ComponentSize, ContentType, CouponCard, index_d as CrossSell, DeliveryDetails, DeviceType, DiscountTag, Drawer, DropdownDialog, DropdownListIcons, DropdownListIconsItem, DropdownListIconsSubItem, DropdownOption, Filter, FilterChange, FilteringDropdown, Tags as FilteringTags, Filters, FitGuarantee, FitPredictor, HorizontalDivider, HorizontalDividerProps, HurryUp, HurryUpProps, ISubscriptionFrequencyDropdown, Icon, IconButton, IconName, IconProps, IconWithOpacityProps, IconsWithTitle, Image, ImageCardWithDescription, ImageProps, Input, InputValidationType, JoinClubCard, Icon$1 as LibIcon, IconProps$1 as LibIconProps, LikeButton, LikeButtonColors, LikeButtonProps, Modal, MotivatorProgressBar, MultiColorPicker, Note, OfferAtCart, OfferAtCartProps, OfferBanner, OrderBar, Overlay, PackSelector, PackSelectorV2, Pagination, PaginatorBlog, Partner, PartnerContent, Pattern, PaymentMethod, PaypalButton, Portal, PriceLabel, PriceLabelV2, PriceLabelV3, PriceType, ProductCard, ProductCardV2, ProductCardV3, ProductGallery, ProductGalleryMobile, ProductGalleryMobileV2, ProductGalleryMobileV3, ProductGalleryMobileV4, ProductGalleryMobileV5, ProgressBar, QuantityPicker, RadioConfig, RadioGroupInput, RadioGroupOption, RadioInput, RadioPrimary, RadiosConfig, Rating, Review, Review$1 as ReviewDetail, ReviewsHeader, ScrollToTop, SearchBar, SearchBarOptionItem, SearchNavigation, SeasonOfferTag, SelectorOnChangeProps, ShortBanner, SimpleDropdown, SimpleOrderItem, SingleColorPicker, SizeChartTable, SizeChartTableV2, SizeChartTableV3, SizeDropdown, SizeFitGuide, SizeOption, SizeOptionProps, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, SpinnerProps, StarList, StrengthBars, SubscriptionPlanSelector, SubscriptionPlanSelectorProps, SubscriptionPlanSelectorRadios, Tab, Tabs, Text, TextButton, TextWithImage, Theme, ThemeAssets, ThemeBasicPallete, ThemeBreakpoints, ThemeColorPallete, ThemeColors, ThemeComponent, ThemeFonts, ThemeProvider, ThemeProviderProps, ThemeTypography, ThemeVariables, Timer, Toast, ToggleComponent, Tooltip, TooltipContent, TooltipHeader, TooltipType, Totals, TrackingProgress, TrackingProgressV2, Video, VideoProps, WithBenefits, WithChildren, WithTestId, benefits, benefitsRawHtml, buildImageUrl, componentSizeMapper, decimalFormat, formatPrice, getSrcSet, imageVideoProps, isDangerouslySetInnerHTML, isEmail, isEmpty, isNumber, isPhoneNumber, isValidDate, mediaQueries, modalEvent, SeasonOfferRoundedTag as seasonOfferRoundedTag, simulateMouseClick, sizeOptions, sliceString, title, useDeviceType, useModal, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
|
package/build/index.esm.js
CHANGED
|
@@ -4883,7 +4883,7 @@ var Text$7 = function (_a) {
|
|
|
4883
4883
|
}
|
|
4884
4884
|
return propsHref;
|
|
4885
4885
|
}, [props.disabled, propsHref]);
|
|
4886
|
-
return (jsx(Tag, __assign$1({}, props, { css: commonCSS, href: href, "data-testid": testId }, { children: children }), void 0));
|
|
4886
|
+
return (jsx(Tag, __assign$1({}, props, { css: commonCSS, href: href, target: variant === 'link' ? props.target : undefined, "data-testid": testId }, { children: children }), void 0));
|
|
4887
4887
|
};
|
|
4888
4888
|
var DEFAULTS = {
|
|
4889
4889
|
heading1: {
|
|
@@ -6676,8 +6676,12 @@ var BenefitText$1 = newStyled(Text$7)(templateObject_2$1g || (templateObject_2$1
|
|
|
6676
6676
|
var templateObject_1$1G, templateObject_2$1g;
|
|
6677
6677
|
|
|
6678
6678
|
var BenefitsList = function (_a) {
|
|
6679
|
-
var benefits = _a.benefits,
|
|
6680
|
-
|
|
6679
|
+
var benefits = _a.benefits, disabled = _a.disabled;
|
|
6680
|
+
var colors = useTheme().colors;
|
|
6681
|
+
return (jsx$1(Fragment$2, { children: benefits.map(function (benefit) {
|
|
6682
|
+
var _a;
|
|
6683
|
+
return (jsxs$1(Benefit$2, { children: [jsx$1(Icon$1, { name: benefit.iconName, fill: disabled ? colors.shades['250'].color : (_a = benefit.fill) !== null && _a !== void 0 ? _a : colors.shades['700'].color, width: "24px", height: "24px" }, void 0), jsx$1(BenefitText$1, { variant: "body", dangerouslySetInnerHTML: { __html: benefit.htmlText } }, void 0)] }, benefit.iconName));
|
|
6684
|
+
}) }, void 0));
|
|
6681
6685
|
};
|
|
6682
6686
|
|
|
6683
6687
|
var TimerContainer$1 = newStyled.div(templateObject_1$1F || (templateObject_1$1F = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
|
|
@@ -20431,8 +20435,8 @@ var ClubCopyTextWrapper = newStyled.div(templateObject_5$a || (templateObject_5$
|
|
|
20431
20435
|
var templateObject_1$l, templateObject_2$e, templateObject_3$e, templateObject_4$b, templateObject_5$a;
|
|
20432
20436
|
|
|
20433
20437
|
function Card(_a) {
|
|
20434
|
-
var children = _a.children, link = _a.link, icon = _a.icon, _b = _a.isChecked, isChecked = _b === void 0 ? false : _b, bodyCopy = _a.bodyCopy, titleCopy = _a.titleCopy, style = _a.style;
|
|
20435
|
-
return (jsxs$1(ContainerWrapper, __assign$1({ "$checked": isChecked, style: style }, { children: [jsxs$1(CardHeaderWrapper, { children: [jsxs$1(ClubCopyWrapper, { children: [icon, jsx$1(ClubCopyTextWrapper, { children: titleCopy }, void 0)] }, void 0), jsx$1("div", { children: children }, void 0)] }, void 0), !isChecked && (jsxs$1(CardBody, __assign$1({ id: "joinClubCardBody" }, { children: [bodyCopy, ' ', jsx$1("a", __assign$1({ href: link, target: "_blank", rel: "noreferrer" }, { children:
|
|
20438
|
+
var children = _a.children, link = _a.link, icon = _a.icon, _b = _a.isChecked, isChecked = _b === void 0 ? false : _b, bodyCopy = _a.bodyCopy, titleCopy = _a.titleCopy, style = _a.style, _c = _a.termsText, termsText = _c === void 0 ? 'Terms here.' : _c;
|
|
20439
|
+
return (jsxs$1(ContainerWrapper, __assign$1({ "$checked": isChecked, style: style }, { children: [jsxs$1(CardHeaderWrapper, { children: [jsxs$1(ClubCopyWrapper, { children: [icon, jsx$1(ClubCopyTextWrapper, { children: titleCopy }, void 0)] }, void 0), jsx$1("div", { children: children }, void 0)] }, void 0), !isChecked && (jsxs$1(CardBody, __assign$1({ id: "joinClubCardBody" }, { children: [bodyCopy, ' ', jsx$1("a", __assign$1({ href: link, target: "_blank", rel: "noreferrer" }, { children: termsText }), void 0)] }), void 0))] }), void 0));
|
|
20436
20440
|
}
|
|
20437
20441
|
|
|
20438
20442
|
var StyledButton = newStyled.button(templateObject_1$k || (templateObject_1$k = __makeTemplateObject(["\n padding: 10px 20px;\n border-radius: 8px;\n background: var(--shapermint-default-complementary-wine-882-a-2-b, #882a2b);\n color: var(--neutrals-white-ffffff, #fff);\n text-align: center;\n font-family: 'Avenir Next';\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 18px;\n text-transform: uppercase;\n border: none;\n cursor: pointer;\n ", ";\n"], ["\n padding: 10px 20px;\n border-radius: 8px;\n background: var(--shapermint-default-complementary-wine-882-a-2-b, #882a2b);\n color: var(--neutrals-white-ffffff, #fff);\n text-align: center;\n font-family: 'Avenir Next';\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 18px;\n text-transform: uppercase;\n border: none;\n cursor: pointer;\n ", ";\n"])), function (_a) {
|
|
@@ -20440,13 +20444,13 @@ var StyledButton = newStyled.button(templateObject_1$k || (templateObject_1$k =
|
|
|
20440
20444
|
return customStyle && __assign$1({}, customStyle);
|
|
20441
20445
|
});
|
|
20442
20446
|
var JoinClubCard = function (_a) {
|
|
20443
|
-
var onCheckToggle = _a.onCheckToggle, isChecked = _a.isChecked, icon = _a.icon, link = _a.link, bodyCopy = _a.bodyCopy, titleCopy = _a.titleCopy, style = _a.style, _b = _a.showButton, showButton = _b === void 0 ? false : _b, _c = _a.buttonText, buttonText = _c === void 0 ? 'ADD' : _c, _d = _a.buttonStyle, buttonStyle = _d === void 0 ? {} : _d;
|
|
20447
|
+
var onCheckToggle = _a.onCheckToggle, isChecked = _a.isChecked, icon = _a.icon, link = _a.link, bodyCopy = _a.bodyCopy, titleCopy = _a.titleCopy, style = _a.style, _b = _a.showButton, showButton = _b === void 0 ? false : _b, _c = _a.buttonText, buttonText = _c === void 0 ? 'ADD' : _c, _d = _a.buttonStyle, buttonStyle = _d === void 0 ? {} : _d, termsText = _a.termsText;
|
|
20444
20448
|
var _e = useState(isChecked), checked = _e[0], setChecked = _e[1];
|
|
20445
20449
|
var handleToggleValue = function (value) {
|
|
20446
20450
|
setChecked(value);
|
|
20447
20451
|
onCheckToggle(value);
|
|
20448
20452
|
};
|
|
20449
|
-
return (jsx$1(Card, __assign$1({ link: link, icon: icon, isChecked: checked, bodyCopy: bodyCopy, titleCopy: titleCopy, style: style }, { children: showButton ? (jsx$1(StyledButton, __assign$1({ onClick: function () { return handleToggleValue(!checked); }, customStyle: buttonStyle }, { children: buttonText }), void 0)) : (jsx$1(ToggleComponent, { onToggle: handleToggleValue, isChecked: checked }, void 0)) }), void 0));
|
|
20453
|
+
return (jsx$1(Card, __assign$1({ link: link, icon: icon, isChecked: checked, bodyCopy: bodyCopy, titleCopy: titleCopy, style: style, termsText: termsText }, { children: showButton ? (jsx$1(StyledButton, __assign$1({ onClick: function () { return handleToggleValue(!checked); }, customStyle: buttonStyle }, { children: buttonText }), void 0)) : (jsx$1(ToggleComponent, { onToggle: handleToggleValue, isChecked: checked }, void 0)) }), void 0));
|
|
20450
20454
|
};
|
|
20451
20455
|
var templateObject_1$k;
|
|
20452
20456
|
|
|
@@ -21900,8 +21904,12 @@ var getSelectedBorder = function (_a) {
|
|
|
21900
21904
|
return "1.5px solid ".concat(colors.shades['700'].color);
|
|
21901
21905
|
};
|
|
21902
21906
|
var ContainerBase = newStyled.div(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n border-radius: 8px;\n\n border: ", ";\n\n ", "\n\n & input:checked + div {\n border-color: ", ";\n }\n\n & label {\n cursor: pointer;\n }\n"], ["\n border-radius: 8px;\n\n border: ", ";\n\n ", "\n\n & input:checked + div {\n border-color: ", ";\n }\n\n & label {\n cursor: pointer;\n }\n"])), function (_a) {
|
|
21903
|
-
var disabled = _a.disabled, theme = _a.theme;
|
|
21904
|
-
return disabled
|
|
21907
|
+
var disabled = _a.disabled, highlighted = _a.highlighted, theme = _a.theme;
|
|
21908
|
+
return disabled
|
|
21909
|
+
? "1px solid ".concat(theme.colors.shades[200].color)
|
|
21910
|
+
: highlighted
|
|
21911
|
+
? getSelectedBorder(theme)
|
|
21912
|
+
: "1.5px solid ".concat(theme.colors.shades[150].color);
|
|
21905
21913
|
}, function (_a) {
|
|
21906
21914
|
var disabled = _a.disabled;
|
|
21907
21915
|
return disabled
|
|
@@ -21916,9 +21924,15 @@ var SinglePurchaseContainer = newStyled(ContainerBase)(templateObject_4$1 || (te
|
|
|
21916
21924
|
return (onClick ? 'cursor: pointer;' : '');
|
|
21917
21925
|
});
|
|
21918
21926
|
var SubscriptionContainer = newStyled(ContainerBase)(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n padding: 16px;\n margin-bottom: 8px;\n position: relative;\n"], ["\n padding: 16px;\n margin-bottom: 8px;\n position: relative;\n"])));
|
|
21919
|
-
var SubscriptionHeader = newStyled.div(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n
|
|
21920
|
-
var
|
|
21921
|
-
return
|
|
21927
|
+
var SubscriptionHeader = newStyled.div(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n padding-bottom: ", ";\n margin-bottom: ", ";\n cursor: pointer;\n border-bottom: ", ";\n\n & input:checked + div {\n border-color: ", ";\n }\n"], ["\n display: flex;\n justify-content: space-between;\n padding-bottom: ", ";\n margin-bottom: ", ";\n cursor: pointer;\n border-bottom: ", ";\n\n & input:checked + div {\n border-color: ", ";\n }\n"])), function (_a) {
|
|
21928
|
+
var _b = _a.showBorder, showBorder = _b === void 0 ? true : _b;
|
|
21929
|
+
return (showBorder ? '10px' : '');
|
|
21930
|
+
}, function (_a) {
|
|
21931
|
+
var _b = _a.showBorder, showBorder = _b === void 0 ? true : _b;
|
|
21932
|
+
return (showBorder ? '8px' : '0');
|
|
21933
|
+
}, function (_a) {
|
|
21934
|
+
var _b = _a.showBorder, showBorder = _b === void 0 ? true : _b, theme = _a.theme;
|
|
21935
|
+
return showBorder ? "1px solid ".concat(theme.colors.shades[200].color) : 'none';
|
|
21922
21936
|
}, function (_a) {
|
|
21923
21937
|
var theme = _a.theme;
|
|
21924
21938
|
return theme.colors.pallete.primary.color;
|
|
@@ -21946,8 +21960,7 @@ var TooltipWrapper = newStyled.div(templateObject_10 || (templateObject_10 = __m
|
|
|
21946
21960
|
var templateObject_1$1, templateObject_2$1, templateObject_3$1, templateObject_4$1, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8$1, templateObject_9$1, templateObject_10;
|
|
21947
21961
|
|
|
21948
21962
|
var SubscriptionPlanSelector = function (_a) {
|
|
21949
|
-
var children = _a.children, benefits = _a.benefits, tooltip = _a.tooltip, pricing = _a.pricing, frequency = _a.frequency, onChange = _a.onChange, className = _a.className, discountTagClassName = _a.discountTagClassName, closeIcon = _a.closeIcon, currencySymbol = _a.currencySymbol, discountLabel = _a.discountLabel, radios = _a.radios;
|
|
21950
|
-
var theme = useTheme();
|
|
21963
|
+
var children = _a.children, benefits = _a.benefits, tooltip = _a.tooltip, pricing = _a.pricing, frequency = _a.frequency, onChange = _a.onChange, className = _a.className, discountTagClassName = _a.discountTagClassName, closeIcon = _a.closeIcon, currencySymbol = _a.currencySymbol, discountLabel = _a.discountLabel, radios = _a.radios, termsAndConditions = _a.termsAndConditions;
|
|
21951
21964
|
var _b = useState({
|
|
21952
21965
|
oneTime: radios.oneTime,
|
|
21953
21966
|
subscription: radios.subscription,
|
|
@@ -21998,7 +22011,6 @@ var SubscriptionPlanSelector = function (_a) {
|
|
|
21998
22011
|
var handleFrequencyChange = function (value) {
|
|
21999
22012
|
setSubscriptionPeriod(radiosStatuses.subscription.checked ? value.value : undefined);
|
|
22000
22013
|
};
|
|
22001
|
-
var benefitsColor = benefitsColorMapper(theme);
|
|
22002
22014
|
var renderBenefitsOrChildren = function () {
|
|
22003
22015
|
var isDisabled = radiosStatuses.subscription.disabled;
|
|
22004
22016
|
if (children) {
|
|
@@ -22010,17 +22022,16 @@ var SubscriptionPlanSelector = function (_a) {
|
|
|
22010
22022
|
});
|
|
22011
22023
|
}
|
|
22012
22024
|
else if (benefits) {
|
|
22013
|
-
|
|
22014
|
-
return (jsx$1(BenefitsList, { benefits: benefits, isSelected: isSelected, selectedColor: benefitsColor.selected, baseColor: isDisabled ? 'var(--colors-shades-250-color)' : benefitsColor.base }, void 0));
|
|
22025
|
+
return jsx$1(BenefitsList, { benefits: benefits, disabled: isDisabled }, void 0);
|
|
22015
22026
|
}
|
|
22016
22027
|
return null;
|
|
22017
22028
|
};
|
|
22018
|
-
return (jsxs$1(Container$1, __assign$1({ className: className }, { children: [jsxs$1(SubscriptionContainer, __assign$1({ onClick: function () { return handleRadioClicked('subscription'); }, "data-testid": "subscription-purchase-block", disabled: radiosStatuses.subscription.disabled }, { children: [jsx$1(DiscountTag, __assign$1({ className: discountTagClassName, disabled: radiosStatuses.subscription.disabled }, { children: discountLabel !== null && discountLabel !== void 0 ? discountLabel : "".concat(subscriptionPctOverListPriceRounded, "% OFF - SAVE ").concat(currencySymbol).concat(subscriptionSaving.toFixed(2)) }), void 0), jsxs$1(SubscriptionHeader, { children: [jsxs$1(FlexContainer, __assign$1({ "data-testid": "subscription-block", onClick: function () { return handleRadioClicked('subscription'); } }, { children: [jsx$1(RadioInput, { label: radios.subscription.label, icon: radios.subscription.icon, name: "subscription", id: "subscription", value: "subscription", size: ComponentSize.Medium, style: { marginRight: '10px' }, useV2Style: true, onChange: function () {
|
|
22029
|
+
return (jsxs$1(Container$1, __assign$1({ className: className }, { children: [jsxs$1(SubscriptionContainer, __assign$1({ highlighted: radiosStatuses.subscription.checked, onClick: function () { return handleRadioClicked('subscription'); }, "data-testid": "subscription-purchase-block", disabled: radiosStatuses.subscription.disabled }, { children: [jsx$1(DiscountTag, __assign$1({ className: discountTagClassName, disabled: radiosStatuses.subscription.disabled }, { children: discountLabel !== null && discountLabel !== void 0 ? discountLabel : "".concat(subscriptionPctOverListPriceRounded, "% OFF - SAVE ").concat(currencySymbol).concat(subscriptionSaving.toFixed(2)) }), void 0), jsxs$1(SubscriptionHeader, __assign$1({ showBorder: radiosStatuses.subscription.checked }, { children: [jsxs$1(FlexContainer, __assign$1({ "data-testid": "subscription-block", onClick: function () { return handleRadioClicked('subscription'); } }, { children: [jsx$1(RadioInput, { label: radios.subscription.label, icon: radios.subscription.icon, name: "subscription", id: "subscription", value: "subscription", size: ComponentSize.Medium, style: { marginRight: '10px' }, useV2Style: true, onChange: function () {
|
|
22019
22030
|
setRadiosStatuses(function (prev) { return ({
|
|
22020
22031
|
subscription: __assign$1(__assign$1({}, prev.subscription), { checked: true }),
|
|
22021
22032
|
oneTime: __assign$1(__assign$1({}, prev.oneTime), { checked: false }),
|
|
22022
22033
|
}); });
|
|
22023
|
-
}, checked: !radiosStatuses.subscription.disabled && radiosStatuses.subscription.checked, disabled: radiosStatuses.subscription.disabled }, void 0), jsx$1(TooltipWrapper, { children: jsx$1(Tooltip, __assign$1({ position: 0, content: tooltip
|
|
22034
|
+
}, checked: !radiosStatuses.subscription.disabled && radiosStatuses.subscription.checked, disabled: radiosStatuses.subscription.disabled }, void 0), tooltip && (jsx$1(TooltipWrapper, { children: jsx$1(Tooltip, __assign$1({ position: 0, content: tooltip.content, header: tooltip.header, maxWidth: "248px", showCloseIcon: closeIcon, closeBtnSize: 0.7 }, { children: jsx$1(Icon.Actions.CircleQuestion, { width: 1 }, void 0) }), void 0) }, void 0))] }), void 0), jsx$1(StyledPrice, { testId: "subscription", finalPrice: "$".concat(decimalFormat(Number(subscriptionFinalPrice))), disabled: radiosStatuses.subscription.disabled, highlighted: !radiosStatuses.subscription.disabled && radiosStatuses.subscription.highlighted, size: ComponentSize.Large, originalPrice: "$".concat(decimalFormat(Number(listPrice))) }, void 0)] }), void 0), radiosStatuses.subscription.checked && (jsxs$1(Fragment$2, { children: [jsx$1(BenefitsContainer, __assign$1({ disabled: radiosStatuses.subscription.disabled }, { children: renderBenefitsOrChildren() }), void 0), termsAndConditions && (jsx$1(Text$7, __assign$1({ variant: "link", underline: true, href: termsAndConditions.url, size: "regular", target: "_blank" }, { children: termsAndConditions.text }), void 0)), (frequency === null || frequency === void 0 ? void 0 : frequency.showFrequencyText) && (jsx$1(AutoshipFrequencyDropdown, { frequency: frequency, onChange: handleFrequencyChange }, void 0))] }, void 0))] }), void 0), jsxs$1(SinglePurchaseContainer, __assign$1({ "data-testid": "single-purchase-block", highlighted: radiosStatuses.oneTime.checked, disabled: radiosStatuses.oneTime.disabled, onClick: function () { return handleRadioClicked('oneTime'); } }, { children: [jsx$1(RadioInput, { label: radios.oneTime.label, icon: radios.oneTime.icon, name: "oneTime", id: "oneTime", value: "oneTime", size: ComponentSize.Medium, onChange: function () {
|
|
22024
22035
|
setRadiosStatuses(function (prev) { return ({
|
|
22025
22036
|
subscription: __assign$1(__assign$1({}, prev.subscription), { checked: false }),
|
|
22026
22037
|
oneTime: __assign$1(__assign$1({}, prev.oneTime), { checked: true }),
|