@trafilea/afrodita-components 6.32.0 → 6.33.0
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 +13 -12
- package/build/index.esm.js +66 -35
- package/build/index.esm.js.map +1 -1
- package/build/index.js +65 -34
- package/build/index.js.map +1 -1
- package/build/theme/truekind.theme.js +1 -1
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -147,7 +147,7 @@ declare type StyledIconProps = {
|
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
declare type Actions$1 = 'actions/add' | 'actions/check_box_empty' | 'actions/check_box_light' | 'actions/check_box_solid' | 'actions/check' | 'actions/circle_check' | 'actions/circle_clear' | 'actions/circle_info' | 'actions/circle_minus' | 'actions/circle_plus' | 'actions/circle_question' | 'actions/circle_solid_check' | 'actions/circle_solid_clear' | 'actions/circle_solid_info' | 'actions/circle_solid_minus' | 'actions/circle_solid_plus' | 'actions/circle_solid_question' | 'actions/circle_solid_styled_check' | 'actions/circle_solid_warning' | 'actions/circle_solid_reload' | 'actions/circle_warning' | 'actions/clear_light' | 'actions/close' | 'actions/copy_outlined' | 'actions/copy' | 'actions/edit' | 'actions/light_check' | 'actions/light_exclamation' | 'actions/like_solid' | 'actions/like' | 'actions/minus' | 'actions/not_allowed' | 'actions/question' | 'actions/radio_empty' | 'actions/radio_filled' | 'actions/settings_solid' | 'actions/settings' | 'actions/share' | 'actions/signout' | 'actions/signout_light' | 'actions/trash' | 'actions/warning' | 'actions/navigate' | 'actions/camera';
|
|
150
|
-
declare type Arrows$1 = 'arrows/chevron_down' | 'arrows/chevron_down_variant' | 'arrows/chevron_left' | 'arrows/chevron_left_lite' | 'arrows/chevron_left_variant' | 'arrows/chevron_right' | 'arrows/chevron_right_lite' | 'arrows/chevron_right_variant' | 'arrows/chevron_up' | 'arrows/chevron_up_solid' | 'arrows/chevron_up_variant' | 'arrows/circle_chevron_down' | 'arrows/circle_chevron_left' | 'arrows/circle_chevron_right' | 'arrows/circle_chevron_up' | 'arrows/circle_line_down' | 'arrows/circle_line_left' | 'arrows/circle_line_right' | 'arrows/circle_line_up' | 'arrows/circle_up' | 'arrows/double_arrow_up' | 'arrows/chevron_right_grey';
|
|
150
|
+
declare type Arrows$1 = 'arrows/chevron_down' | 'arrows/chevron_down_variant' | 'arrows/chevron_left' | 'arrows/chevron_left_lite' | 'arrows/chevron_left_variant' | 'arrows/chevron_right' | 'arrows/chevron_right_lite' | 'arrows/chevron_right_variant' | 'arrows/chevron_up' | 'arrows/chevron_up_solid' | 'arrows/chevron_up_variant' | 'arrows/circle_chevron_down' | 'arrows/circle_chevron_left' | 'arrows/circle_chevron_right' | 'arrows/circle_chevron_up' | 'arrows/circle_line_down' | 'arrows/circle_line_left' | 'arrows/circle_line_right' | 'arrows/circle_line_up' | 'arrows/circle_up' | 'arrows/double_arrow_up' | 'arrows/chevron_right_grey' | 'arrows/circle_round';
|
|
151
151
|
declare type Custom$1 = 'custom/atom' | 'custom/bra' | 'custom/bubbles' | 'custom/bullet_one' | 'custom/bullet_three' | 'custom/bullet_two' | 'custom/certified' | 'custom/clinically_tested' | 'custom/cruelty_free' | 'custom/fair_advantages' | 'custom/frown' | 'custom/frown' | 'custom/money_flow' | 'custom/new_sixty_days_guarantee' | 'custom/packs_and_bundles' | 'custom/seamless_support_bra' | 'custom/sixty_days_bold' | 'custom/sixty_days_guarantee' | 'custom/smiling' | 'custom/subscription' | 'custom/thumbs_down' | 'custom/thumbs_up' | 'custom/underwear' | 'custom/wire_free_comfort' | 'custom/wire_free_comfort_bold' | 'custom/tk_sixty_days_bold' | 'custom/free_shipping_truck' | 'custom/higher_discounts' | 'custom/zoom' | 'custom/focus' | 'custom/beauty_face' | 'custom/bar' | 'custom/ears' | 'custom/pain' | 'custom/rociar' | 'custom/star' | 'custom/time' | 'custom/winter_light' | 'custom/priority_support' | 'custom/sound_on' | 'custom/sound_off';
|
|
152
152
|
declare type Download$1 = 'download/apple_store' | 'download/google_play';
|
|
153
153
|
declare type Emoji$1 = 'emoji/blowing_kiss' | 'emoji/frowning' | 'emoji/grinning' | 'emoji/grinning_with_sweat' | 'emoji/relieved' | 'emoji/smiling_v2' | 'emoji/smiling_v3' | 'emoji/thinking';
|
|
@@ -196,9 +196,10 @@ declare const Image: React.FC<ImageProps>;
|
|
|
196
196
|
declare type ToggleProps = {
|
|
197
197
|
onToggle: (value: boolean) => void;
|
|
198
198
|
isChecked?: boolean;
|
|
199
|
+
color?: string;
|
|
199
200
|
};
|
|
200
201
|
|
|
201
|
-
declare const ToggleComponent: ({ onToggle, isChecked }: ToggleProps) => JSX.Element;
|
|
202
|
+
declare const ToggleComponent: ({ onToggle, isChecked, color, }: ToggleProps) => JSX.Element;
|
|
202
203
|
|
|
203
204
|
declare type Props = Omit<IconProps$1, 'name'>;
|
|
204
205
|
declare type IconComponent = react__default.FC<Props>;
|
|
@@ -2482,6 +2483,7 @@ declare type CTAProps = {
|
|
|
2482
2483
|
declare type DropdownOption<T> = {
|
|
2483
2484
|
key: string;
|
|
2484
2485
|
label: string;
|
|
2486
|
+
selectedLabel?: string;
|
|
2485
2487
|
value: T;
|
|
2486
2488
|
disabled: boolean;
|
|
2487
2489
|
imageURL?: string;
|
|
@@ -3188,11 +3190,12 @@ interface RadioProps {
|
|
|
3188
3190
|
checked?: boolean;
|
|
3189
3191
|
disabled?: boolean;
|
|
3190
3192
|
onChange: (option: RadioGroupOption$1) => void;
|
|
3191
|
-
style?:
|
|
3192
|
-
labelStyle?:
|
|
3193
|
+
style?: React.CSSProperties;
|
|
3194
|
+
labelStyle?: React.CSSProperties;
|
|
3193
3195
|
useV2Style?: boolean;
|
|
3196
|
+
icon?: ReactNode;
|
|
3194
3197
|
}
|
|
3195
|
-
declare const RadioInput: ({ style, name, value, id, label, checked, disabled, onChange, size, useV2Style, labelStyle, }: RadioProps) => JSX.Element;
|
|
3198
|
+
declare const RadioInput: ({ style, name, value, id, label, checked, disabled, onChange, size, useV2Style, labelStyle, icon, }: RadioProps) => JSX.Element;
|
|
3196
3199
|
|
|
3197
3200
|
interface StarListProps {
|
|
3198
3201
|
rating: number;
|
|
@@ -3785,12 +3788,13 @@ declare type VideoProps = {
|
|
|
3785
3788
|
} & DetailedHTMLProps<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
|
|
3786
3789
|
declare const Video: React.FC<VideoProps>;
|
|
3787
3790
|
|
|
3788
|
-
declare type AutoshipFrequency
|
|
3791
|
+
declare type AutoshipFrequency = {
|
|
3789
3792
|
values: number[];
|
|
3790
3793
|
unit: string;
|
|
3794
|
+
labels?: string[];
|
|
3791
3795
|
};
|
|
3792
3796
|
interface ISubscriptionFrequencyDropdown {
|
|
3793
|
-
frequency: AutoshipFrequency
|
|
3797
|
+
frequency: AutoshipFrequency;
|
|
3794
3798
|
onChange?: (value: DropdownOption<number>) => void;
|
|
3795
3799
|
}
|
|
3796
3800
|
declare const AutoshipFrequencyDropdown: FC<ISubscriptionFrequencyDropdown>;
|
|
@@ -3964,6 +3968,7 @@ declare type SelectorOnChangeProps = {
|
|
|
3964
3968
|
};
|
|
3965
3969
|
declare type RadioConfig = {
|
|
3966
3970
|
label: string;
|
|
3971
|
+
icon?: ReactNode;
|
|
3967
3972
|
disabled: boolean;
|
|
3968
3973
|
checked: boolean;
|
|
3969
3974
|
};
|
|
@@ -3971,10 +3976,6 @@ declare type RadiosConfig = {
|
|
|
3971
3976
|
oneTime: RadioConfig;
|
|
3972
3977
|
subscription: RadioConfig;
|
|
3973
3978
|
};
|
|
3974
|
-
declare type AutoshipFrequency = {
|
|
3975
|
-
values: number[];
|
|
3976
|
-
unit: string;
|
|
3977
|
-
};
|
|
3978
3979
|
declare type TooltipContent = {
|
|
3979
3980
|
text: string;
|
|
3980
3981
|
color?: string;
|
|
@@ -4087,4 +4088,4 @@ declare type Partner = 'RevelBeauty' | 'TheSpaDr' | 'TheBodCon';
|
|
|
4087
4088
|
declare type PartnerContent = 'RevelBeauty-1' | 'RevelBeauty-2' | 'TheSpaDr-1' | 'TheSpaDr-2' | 'TheBodCon';
|
|
4088
4089
|
declare const CancellationFlowAccordionContentPerPartner: Record<Partner, JSX.Element[]>;
|
|
4089
4090
|
|
|
4090
|
-
export { AbsorbencyLevel, Accordion, AccordionOptions, AmazonButton, AssetsProvider, Autoship,
|
|
4091
|
+
export { AbsorbencyLevel, Accordion, AccordionOptions, AmazonButton, AssetsProvider, Autoship, AutoshipFrequencyDropdown, AutoshipV2, BasicAccordion, BeforeAfterCard, BeforeAfterVariant, 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, 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, HurryUp, HurryUpProps, Icon, IconButton, IconProps, IconWithOpacityProps, IconsWithTitle, Image, ImageCardWithDescription, ImageProps, Input, InputValidationType, JoinClubCard, Icon$1 as LibIcon, IconProps$1 as LibIconProps, Modal, MotivatorProgressBar, MultiColorPicker, Note, 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, 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, SizeSelector, SizeTable, SliderNavigation, Spacing, Spinner, SpinnerProps, StarList, StrengthBars, SubscriptionPlanSelector, 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, WithTestId, buildImageUrl, componentSizeMapper, decimalFormat, formatPrice, getSrcSet, imageVideoProps, isEmail, isEmpty, isNumber, isPhoneNumber, isValidDate, mediaQueries, modalEvent, SeasonOfferRoundedTag as seasonOfferRoundedTag, simulateMouseClick, sliceString, useDeviceType, useModal, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
|
package/build/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as jsx$1, jsxs as jsxs$1, Fragment as Fragment$2 } from 'react/jsx-runtime';
|
|
2
2
|
import * as React$2 from 'react';
|
|
3
|
-
import React__default, { useContext, createContext, forwardRef, createElement, Fragment as Fragment$1, useRef, useLayoutEffect, useMemo, useState, useEffect, useCallback, useReducer, createRef, isValidElement, cloneElement, memo, useImperativeHandle } from 'react';
|
|
3
|
+
import React__default, { useContext, createContext, forwardRef, createElement, Fragment as Fragment$1, useRef, useLayoutEffect, useMemo, useState, useEffect, useCallback, useReducer, createRef, isValidElement, cloneElement, memo, useImperativeHandle, Children } from 'react';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
|
|
6
6
|
/*! *****************************************************************************
|
|
@@ -3934,17 +3934,20 @@ var templateObject_1$25;
|
|
|
3934
3934
|
|
|
3935
3935
|
var LabelWrapper = newStyled.label(templateObject_1$24 || (templateObject_1$24 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 10px;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n gap: 10px;\n cursor: pointer;\n"])));
|
|
3936
3936
|
var SwitchWrapper = newStyled.div(templateObject_2$1v || (templateObject_2$1v = __makeTemplateObject(["\n position: relative;\n width: 36px;\n height: 20px;\n background: #949494;\n border-radius: 60px;\n padding: 4px;\n transition: 300ms all;\n\n &:before {\n transition: 300ms all;\n content: '';\n position: absolute;\n width: 16px;\n height: 16px;\n border-radius: 35px;\n top: 50%;\n left: 2.5px;\n background: white;\n transform: translate(0, -50%);\n }\n"], ["\n position: relative;\n width: 36px;\n height: 20px;\n background: #949494;\n border-radius: 60px;\n padding: 4px;\n transition: 300ms all;\n\n &:before {\n transition: 300ms all;\n content: '';\n position: absolute;\n width: 16px;\n height: 16px;\n border-radius: 35px;\n top: 50%;\n left: 2.5px;\n background: white;\n transform: translate(0, -50%);\n }\n"])));
|
|
3937
|
-
var InputWrapper$1 = newStyled.input(templateObject_3$1a || (templateObject_3$1a = __makeTemplateObject(["\n opacity: 0;\n position: absolute;\n\n &:checked + div {\n background:
|
|
3937
|
+
var InputWrapper$1 = newStyled.input(templateObject_3$1a || (templateObject_3$1a = __makeTemplateObject(["\n opacity: 0;\n position: absolute;\n\n &:checked + div {\n background: ", ";\n\n &:before {\n transform: translate(14.5px, -50%);\n }\n }\n"], ["\n opacity: 0;\n position: absolute;\n\n &:checked + div {\n background: ", ";\n\n &:before {\n transform: translate(14.5px, -50%);\n }\n }\n"])), function (_a) {
|
|
3938
|
+
var $color = _a.$color;
|
|
3939
|
+
return $color;
|
|
3940
|
+
});
|
|
3938
3941
|
var templateObject_1$24, templateObject_2$1v, templateObject_3$1a;
|
|
3939
3942
|
|
|
3940
3943
|
var ToggleComponent = function (_a) {
|
|
3941
|
-
var onToggle = _a.onToggle, _b = _a.isChecked, isChecked = _b === void 0 ? false : _b;
|
|
3942
|
-
var
|
|
3944
|
+
var onToggle = _a.onToggle, _b = _a.isChecked, isChecked = _b === void 0 ? false : _b, _c = _a.color, color = _c === void 0 ? '#882a2b' : _c;
|
|
3945
|
+
var _d = useState(isChecked), checked = _d[0], setChecked = _d[1];
|
|
3943
3946
|
var handleChange = function (e) {
|
|
3944
3947
|
setChecked(function (value) { return !value; });
|
|
3945
3948
|
onToggle(e.target.checked);
|
|
3946
3949
|
};
|
|
3947
|
-
return (jsxs$1(LabelWrapper, { children: [jsx$1(InputWrapper$1, { checked: checked, type: "checkbox", onChange: handleChange, value: "".concat(checked) }, void 0), jsx$1(SwitchWrapper, {}, void 0)] }, void 0));
|
|
3950
|
+
return (jsxs$1(LabelWrapper, { children: [jsx$1(InputWrapper$1, { checked: checked, type: "checkbox", onChange: handleChange, value: "".concat(checked), "$color": color }, void 0), jsx$1(SwitchWrapper, {}, void 0)] }, void 0));
|
|
3948
3951
|
};
|
|
3949
3952
|
|
|
3950
3953
|
var Add = function (props) { return jsx$1(Icon$1, __assign$1({}, props, { name: "actions/add" }), void 0); };
|
|
@@ -5636,8 +5639,9 @@ function SimpleDropdown(_a) {
|
|
|
5636
5639
|
var options = _a.options, _b = _a.disabled, disabled = _b === void 0 ? false : _b, initialValue = _a.initialValue, placeHolder = _a.placeHolder, label = _a.label, _c = _a.wide, wide = _c === void 0 ? false : _c, _d = _a.sort, sort = _d === void 0 ? false : _d, onChange = _a.onChange, value = _a.value, _e = _a.testId, testId = _e === void 0 ? 'simple-dropdown' : _e, required = _a.required, showRequiredPlaceholder = _a.showRequiredPlaceholder, selectedOptionWeight = _a.selectedOptionWeight;
|
|
5637
5640
|
var _f = useState(value || initialValue), selectedValue = _f[0], setSelectedValue = _f[1];
|
|
5638
5641
|
var selectedOptionLabel = useMemo(function () {
|
|
5642
|
+
var _a;
|
|
5639
5643
|
if (selectedValue) {
|
|
5640
|
-
return selectedValue.label;
|
|
5644
|
+
return (_a = selectedValue.selectedLabel) !== null && _a !== void 0 ? _a : selectedValue.label;
|
|
5641
5645
|
}
|
|
5642
5646
|
return showRequiredPlaceholder ? (jsx$1(RequiredPlaceholder, { children: placeHolder }, void 0)) : (placeHolder);
|
|
5643
5647
|
}, [selectedValue, showRequiredPlaceholder, placeHolder]);
|
|
@@ -5745,21 +5749,24 @@ var StyledLabel$3 = newStyled(Label$6)(templateObject_3$14 || (templateObject_3$
|
|
|
5745
5749
|
var theme = _a.theme;
|
|
5746
5750
|
return theme.component.radio.lineHeight;
|
|
5747
5751
|
});
|
|
5748
|
-
var StyledLabelV2 = newStyled(Label$6)(templateObject_4$U || (templateObject_4$U = __makeTemplateObject(["\n font-size: ", ";\n font-weight: 600 !important;\n line-height: ", " !important;\n"], ["\n font-size: ", ";\n font-weight: 600 !important;\n line-height: ", " !important;\n"])), function (_a) {
|
|
5752
|
+
var StyledLabelV2 = newStyled(Label$6)(templateObject_4$U || (templateObject_4$U = __makeTemplateObject(["\n font-size: ", ";\n font-weight: 600 !important;\n line-height: ", " !important;\n\n color: ", ";\n"], ["\n font-size: ", ";\n font-weight: 600 !important;\n line-height: ", " !important;\n\n color: ", ";\n"])), function (_a) {
|
|
5749
5753
|
var theme = _a.theme;
|
|
5750
5754
|
return theme.component.radio.textSize;
|
|
5751
5755
|
}, function (_a) {
|
|
5752
5756
|
var theme = _a.theme;
|
|
5753
5757
|
return theme.component.radio.lineHeight;
|
|
5758
|
+
}, function (_a) {
|
|
5759
|
+
var disabled = _a.disabled;
|
|
5760
|
+
return (disabled ? 'var(--colors-shades-250-color)' : 'inherit');
|
|
5754
5761
|
});
|
|
5755
5762
|
var RadioInput = function (_a) {
|
|
5756
|
-
var style = _a.style, name = _a.name, value = _a.value, id = _a.id, label = _a.label, _b = _a.checked, checked = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, onChange = _a.onChange, _d = _a.size, size = _d === void 0 ? ComponentSize.Medium : _d, _e = _a.useV2Style, useV2Style = _e === void 0 ? false : _e, labelStyle = _a.labelStyle;
|
|
5763
|
+
var style = _a.style, name = _a.name, value = _a.value, id = _a.id, label = _a.label, _b = _a.checked, checked = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, onChange = _a.onChange, _d = _a.size, size = _d === void 0 ? ComponentSize.Medium : _d, _e = _a.useV2Style, useV2Style = _e === void 0 ? false : _e, labelStyle = _a.labelStyle, icon = _a.icon;
|
|
5757
5764
|
var theme = useTheme();
|
|
5758
5765
|
var handleChange = function (event, label) {
|
|
5759
5766
|
var value = event.currentTarget.value;
|
|
5760
5767
|
onChange({ value: value, label: label });
|
|
5761
5768
|
};
|
|
5762
|
-
return (jsxs$1(Wrapper$7, { children: [jsxs$1(Container$1a, __assign$1({ theme: theme, size: size, style: style, "data-testid": "container" }, { children: [jsx$1(Input$4, { id: "".concat(name, "-").concat(id), type: "radio", name: name, value: value, checked: checked, onChange: function (e) { return (disabled ? null : handleChange(e, label)); }, disabled: disabled, style: style }, void 0), jsx$1(CustomRadio$2, { size: size, isChecked: checked, disabled: disabled, theme: theme, "data-testid": "custom-radio", style: style }, void 0)] }), void 0), useV2Style ? (
|
|
5769
|
+
return (jsxs$1(Wrapper$7, { children: [jsxs$1(Container$1a, __assign$1({ theme: theme, size: size, style: style, "data-testid": "container" }, { children: [jsx$1(Input$4, { id: "".concat(name, "-").concat(id), type: "radio", name: name, value: value, checked: checked, onChange: function (e) { return (disabled ? null : handleChange(e, label)); }, disabled: disabled, style: style }, void 0), jsx$1(CustomRadio$2, { size: size, isChecked: checked, disabled: disabled, theme: theme, "data-testid": "custom-radio", style: style }, void 0)] }), void 0), useV2Style ? (jsxs$1(StyledLabelV2, __assign$1({ htmlFor: "".concat(name, "-").concat(id), "data-testid": "label", variant: "regular", size: size, disabled: disabled, style: labelStyle }, { children: [icon, " ", label] }), void 0)) : (jsx$1(StyledLabel$3, __assign$1({ htmlFor: "".concat(name, "-").concat(id), "data-testid": "label", variant: "regular", size: size, disabled: disabled }, { children: label }), void 0))] }, void 0));
|
|
5763
5770
|
};
|
|
5764
5771
|
var templateObject_1$1S, templateObject_2$1l, templateObject_3$14, templateObject_4$U;
|
|
5765
5772
|
|
|
@@ -20545,10 +20552,20 @@ var AutoshipFrequencyDropdown = function (_a) {
|
|
|
20545
20552
|
};
|
|
20546
20553
|
return (jsx$1(Fragment$2, { children: options.length > 1 ? (jsxs$1(FlexContainer$2, __assign$1({ onClick: function (e) { return e.stopPropagation(); } }, { children: [jsx$1(DeliveryFrequencyLabel, __assign$1({ variant: "body" }, { children: "Deliver every:" }), void 0), jsx$1(SimpleDropdown, { testId: "subscription-frequency", initialValue: options[0], options: options, onChange: handleChange, placeHolder: "" }, void 0)] }), void 0)) : (jsxs$1(DeliveryFrequencyLabel, __assign$1({ variant: "body" }, { children: ["Deliver every ", options[0].label.toLowerCase()] }), void 0)) }, void 0));
|
|
20547
20554
|
};
|
|
20555
|
+
var getLabel = function (number, frequency) {
|
|
20556
|
+
return "".concat(number, " ").concat(number === 1 ? frequency.unit.slice(0, -1) : frequency.unit);
|
|
20557
|
+
};
|
|
20558
|
+
var getSelectedLabel = function (number, index, frequency) {
|
|
20559
|
+
var _a;
|
|
20560
|
+
var label = getLabel(number, frequency);
|
|
20561
|
+
var additionalLabel = ((_a = frequency.labels) === null || _a === void 0 ? void 0 : _a[index]) ? " ".concat(frequency.labels[index]) : '';
|
|
20562
|
+
return "".concat(label).concat(additionalLabel);
|
|
20563
|
+
};
|
|
20548
20564
|
var getDropdownOptions = function (frequency) {
|
|
20549
|
-
return frequency.values.map(function (number) { return ({
|
|
20565
|
+
return frequency.values.map(function (number, index) { return ({
|
|
20550
20566
|
key: "drop-down-autoship-".concat(number),
|
|
20551
|
-
label:
|
|
20567
|
+
label: getLabel(number, frequency),
|
|
20568
|
+
selectedLabel: getSelectedLabel(number, index, frequency),
|
|
20552
20569
|
value: number,
|
|
20553
20570
|
disabled: false,
|
|
20554
20571
|
}); });
|
|
@@ -20560,7 +20577,7 @@ var templateObject_1$a, templateObject_2$9;
|
|
|
20560
20577
|
|
|
20561
20578
|
var BenefitsList = function (_a) {
|
|
20562
20579
|
var benefits = _a.benefits, isSelected = _a.isSelected, selectedColor = _a.selectedColor, baseColor = _a.baseColor;
|
|
20563
|
-
return (jsx$1(Fragment$2, { children: benefits.map(function (benefit
|
|
20580
|
+
return (jsx$1(Fragment$2, { children: benefits.map(function (benefit) { return (jsxs$1(Benefit$1, { children: [jsx$1(Icon.Actions.Check, { "data-testid": "icon-check", width: 1.2, height: 1.2, fill: isSelected ? selectedColor : baseColor }, void 0), jsx$1(BenefitText$1, { variant: "body", dangerouslySetInnerHTML: { __html: benefit } }, void 0)] }, benefit)); }) }, void 0));
|
|
20564
20581
|
};
|
|
20565
20582
|
|
|
20566
20583
|
var ContainerWrapper$1 = newStyled.div(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n max-height: 180px;\n width: auto;\n max-width: 450px;\n gap: 5px;\n @media (max-width: 480px) {\n gap: 0px;\n font-size: 12px !important;\n }\n"], ["\n display: flex;\n flex-direction: row;\n max-height: 180px;\n width: auto;\n max-width: 450px;\n gap: 5px;\n @media (max-width: 480px) {\n gap: 0px;\n font-size: 12px !important;\n }\n"])));
|
|
@@ -21210,7 +21227,10 @@ var SubscriptionHeader = newStyled.div(templateObject_6 || (templateObject_6 = _
|
|
|
21210
21227
|
var theme = _a.theme;
|
|
21211
21228
|
return theme.colors.pallete.primary.color;
|
|
21212
21229
|
});
|
|
21213
|
-
var BenefitsContainer = newStyled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-bottom: 5px;\n"], ["\n margin-bottom: 5px;\n"])))
|
|
21230
|
+
var BenefitsContainer = newStyled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-bottom: 5px;\n\n p {\n color: ", ";\n }\n"], ["\n margin-bottom: 5px;\n\n p {\n color: ", ";\n }\n"])), function (_a) {
|
|
21231
|
+
var disabled = _a.disabled;
|
|
21232
|
+
return (disabled ? 'var(--colors-shades-250-color)' : 'inherit');
|
|
21233
|
+
});
|
|
21214
21234
|
var StyledPrice = newStyled(PriceLabelV2$1)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n div p {\n color: ", ";\n }\n"], ["\n div p {\n color: ", ";\n }\n"])), function (_a) {
|
|
21215
21235
|
var selected = _a.selected, theme = _a.theme;
|
|
21216
21236
|
return selected ? theme.colors.shades[700].color : theme.colors.shades[200].color;
|
|
@@ -21223,24 +21243,16 @@ var TooltipWrapper = newStyled.div(templateObject_10 || (templateObject_10 = __m
|
|
|
21223
21243
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
|
21224
21244
|
|
|
21225
21245
|
var SubscriptionPlanSelector = function (_a) {
|
|
21226
|
-
var _b, _c;
|
|
21227
21246
|
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;
|
|
21228
21247
|
var theme = useTheme();
|
|
21229
|
-
var
|
|
21248
|
+
var _b = useState({
|
|
21230
21249
|
oneTime: radios.oneTime,
|
|
21231
21250
|
subscription: radios.subscription,
|
|
21232
|
-
}), radiosStatuses =
|
|
21233
|
-
|
|
21234
|
-
|
|
21235
|
-
|
|
21236
|
-
|
|
21237
|
-
label: "".concat(number, " ").concat(number === 1 ? frequency.unit.slice(0, -1) : frequency),
|
|
21238
|
-
value: number,
|
|
21239
|
-
disabled: false,
|
|
21240
|
-
}); });
|
|
21241
|
-
};
|
|
21242
|
-
var dropdownOptions = frequency ? getDropDownOptions(frequency) : undefined;
|
|
21243
|
-
var _e = useState((_c = (_b = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : undefined), subscriptionPeriod = _e[0], setSubscriptionPeriod = _e[1];
|
|
21251
|
+
}), radiosStatuses = _b[0], setRadiosStatuses = _b[1];
|
|
21252
|
+
useEffect(function () {
|
|
21253
|
+
setRadiosStatuses(function (prevStatuses) { return (__assign$1(__assign$1({}, prevStatuses), { oneTime: __assign$1(__assign$1({}, prevStatuses.oneTime), { checked: prevStatuses.oneTime.disabled ? false : prevStatuses.oneTime.checked }), subscription: __assign$1(__assign$1({}, prevStatuses.subscription), { checked: prevStatuses.subscription.disabled ? false : prevStatuses.subscription.checked }) })); });
|
|
21254
|
+
}, [radiosStatuses.oneTime.disabled, radiosStatuses.subscription.disabled]);
|
|
21255
|
+
var _c = useState(frequency === null || frequency === void 0 ? void 0 : frequency.values[0]), subscriptionPeriod = _c[0], setSubscriptionPeriod = _c[1];
|
|
21244
21256
|
var listPrice = pricing.listPrice, discountedPrice = pricing.discountedPrice, subscriptionDiscountPercentage = pricing.subscriptionDiscountPercentage;
|
|
21245
21257
|
var subscriptionAdditionalDiscount = discountedPrice * (subscriptionDiscountPercentage / 100);
|
|
21246
21258
|
var subscriptionFinalPrice = Number((discountedPrice - subscriptionAdditionalDiscount).toFixed(2));
|
|
@@ -21265,33 +21277,52 @@ var SubscriptionPlanSelector = function (_a) {
|
|
|
21265
21277
|
}
|
|
21266
21278
|
}, [dataObject, onChange]);
|
|
21267
21279
|
var handleRadioClicked = function (radioValue) {
|
|
21280
|
+
var isDisabled = function (value) {
|
|
21281
|
+
return ((value === 'subscription' && radiosStatuses.subscription.disabled) ||
|
|
21282
|
+
(value === 'oneTime' && radiosStatuses.oneTime.disabled));
|
|
21283
|
+
};
|
|
21284
|
+
if (isDisabled(radioValue)) {
|
|
21285
|
+
return;
|
|
21286
|
+
}
|
|
21268
21287
|
setRadiosStatuses(function (prevStatuses) { return (__assign$1(__assign$1({}, prevStatuses), { oneTime: __assign$1(__assign$1({}, prevStatuses.oneTime), { checked: radioValue === 'oneTime' }), subscription: __assign$1(__assign$1({}, prevStatuses.subscription), { checked: radioValue === 'subscription' }) })); });
|
|
21288
|
+
if (radioValue === 'oneTime') {
|
|
21289
|
+
setSubscriptionPeriod(undefined);
|
|
21290
|
+
}
|
|
21291
|
+
else if (radioValue === 'subscription' && frequency) {
|
|
21292
|
+
setSubscriptionPeriod(frequency.values[0]);
|
|
21293
|
+
}
|
|
21269
21294
|
};
|
|
21270
|
-
var
|
|
21271
|
-
|
|
21272
|
-
setSubscriptionPeriod(value.value);
|
|
21295
|
+
var handleFrequencyChange = function (value) {
|
|
21296
|
+
setSubscriptionPeriod(radiosStatuses.subscription.checked ? value.value : undefined);
|
|
21273
21297
|
};
|
|
21274
21298
|
var benefitsColor = benefitsColorMapper(theme);
|
|
21275
21299
|
var renderBenefitsOrChildren = function () {
|
|
21300
|
+
var isDisabled = radiosStatuses.subscription.disabled || !radiosStatuses.subscription.checked;
|
|
21276
21301
|
if (children) {
|
|
21277
|
-
|
|
21302
|
+
var disabledStyle_1 = isDisabled ? { opacity: 0.5, pointerEvents: 'none' } : {};
|
|
21303
|
+
return Children.map(children, function (child) {
|
|
21304
|
+
return isValidElement(child)
|
|
21305
|
+
? cloneElement(child, { style: __assign$1(__assign$1({}, child.props.style), disabledStyle_1) })
|
|
21306
|
+
: child;
|
|
21307
|
+
});
|
|
21278
21308
|
}
|
|
21279
21309
|
else if (benefits) {
|
|
21280
|
-
|
|
21310
|
+
var isSelected = radiosStatuses.subscription.checked;
|
|
21311
|
+
return (jsx$1(BenefitsList, { benefits: benefits, isSelected: isSelected, selectedColor: benefitsColor.selected, baseColor: isDisabled ? 'var(--colors-shades-250-color)' : benefitsColor.base }, void 0));
|
|
21281
21312
|
}
|
|
21282
21313
|
return null;
|
|
21283
21314
|
};
|
|
21284
|
-
return (jsxs$1(Container, __assign$1({ className: className }, { children: [jsxs$1(SubscriptionContainer, __assign$1({ onClick: function () { return handleRadioClicked('subscription'); }, "data-testid": "subscription-purchase-block", selected: radiosStatuses.subscription.checked }, { children: [jsx$1(DiscountTag, __assign$1({ className: discountTagClassName, isSelected: radiosStatuses.subscription.checked }, { 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, name: "subscription", id: "subscription", value: "subscription", size: ComponentSize.Medium, style: { marginRight: '10px' }, useV2Style: true, onChange: function () {
|
|
21315
|
+
return (jsxs$1(Container, __assign$1({ className: className }, { children: [jsxs$1(SubscriptionContainer, __assign$1({ onClick: function () { return handleRadioClicked('subscription'); }, "data-testid": "subscription-purchase-block", selected: radiosStatuses.subscription.checked }, { children: [jsx$1(DiscountTag, __assign$1({ className: discountTagClassName, isSelected: radiosStatuses.subscription.checked }, { 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 () {
|
|
21285
21316
|
setRadiosStatuses(function (prev) { return ({
|
|
21286
21317
|
subscription: __assign$1(__assign$1({}, prev.subscription), { checked: true }),
|
|
21287
21318
|
oneTime: __assign$1(__assign$1({}, prev.oneTime), { checked: false }),
|
|
21288
21319
|
}); });
|
|
21289
|
-
}, checked: radiosStatuses.subscription.checked, disabled: radiosStatuses.subscription.
|
|
21320
|
+
}, checked: !radiosStatuses.subscription.disabled && radiosStatuses.subscription.checked, disabled: !radiosStatuses.subscription.checked }, void 0), jsx$1(TooltipWrapper, { children: jsx$1(Tooltip, __assign$1({ position: 0, content: tooltip === null || tooltip === void 0 ? void 0 : tooltip.content, header: tooltip === null || tooltip === void 0 ? void 0 : 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))), selected: radiosStatuses.subscription.checked, size: ComponentSize.Large, originalPrice: "$".concat(decimalFormat(Number(listPrice))) }, void 0)] }, void 0), jsx$1(BenefitsContainer, __assign$1({ disabled: !radiosStatuses.subscription.checked }, { children: renderBenefitsOrChildren() }), void 0), radiosStatuses.subscription.checked && frequency && (jsx$1(AutoshipFrequencyDropdown, { frequency: frequency, onChange: handleFrequencyChange }, void 0))] }), void 0), jsxs$1(SinglePurchaseContainer, __assign$1({ "data-testid": "single-purchase-block", selected: radiosStatuses.oneTime.checked, 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 () {
|
|
21290
21321
|
setRadiosStatuses(function (prev) { return ({
|
|
21291
21322
|
subscription: __assign$1(__assign$1({}, prev.subscription), { checked: false }),
|
|
21292
21323
|
oneTime: __assign$1(__assign$1({}, prev.oneTime), { checked: true }),
|
|
21293
21324
|
}); });
|
|
21294
|
-
}, useV2Style: true, checked: radiosStatuses.oneTime.checked, disabled: radiosStatuses.oneTime.disabled }, void 0), jsx$1(StyledPrice, { testId: "single-purchase", finalPrice: "$".concat(decimalFormat(Number(discountedPrice))), selected: radiosStatuses.oneTime.checked, size: ComponentSize.Large, originalPrice: "$".concat(decimalFormat(Number(listPrice))) }, void 0)] }), void 0)] }), void 0));
|
|
21325
|
+
}, 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))), selected: radiosStatuses.oneTime.checked, size: ComponentSize.Large, originalPrice: "$".concat(decimalFormat(Number(listPrice))) }, void 0)] }), void 0)] }), void 0));
|
|
21295
21326
|
};
|
|
21296
21327
|
|
|
21297
21328
|
export { AbsorbencyLevel, Accordion$1 as Accordion, AccordionOptions, AmazonButton, AssetsProvider, Autoship, AutoshipFrequencyDropdown, 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, 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, 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, buildImageUrl, componentSizeMapper, createCache, css, decimalFormat, formatPrice, getSrcSet, isEmail, isEmpty, isNumber$1 as isNumber, isPhoneNumber, isValidDate, mediaQueries, modalEvent, SeasonOfferRoundedTag as seasonOfferRoundedTag, simulateMouseClick, sliceString, newStyled as styled, useDeviceType, useModal, useModalEvent, useOnClickOutside, useTheme, useThemeAssets, useWindowDimensions };
|