@trafilea/afrodita-components 6.16.1 → 6.16.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 +13 -7
- package/build/index.esm.js +37 -25
- package/build/index.esm.js.map +1 -1
- package/build/index.js +37 -25
- package/build/index.js.map +1 -1
- package/build/theme/revel.theme.d.ts +1 -0
- package/build/theme/shapermint.theme.d.ts +1 -0
- package/build/theme/thebodcon.theme.d.ts +1 -0
- package/build/theme/thespadr.theme.d.ts +1 -0
- package/build/theme/truekind.theme.d.ts +1 -0
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -3096,9 +3096,9 @@ var ThemeProvider = function (_a) {
|
|
|
3096
3096
|
var _b;
|
|
3097
3097
|
var unparsedTheme = _a.theme, isSameOriginIcons = _a.isSameOriginIcons, children = _a.children, config = _a.config;
|
|
3098
3098
|
//TODO Analyze why we are doing this and remove
|
|
3099
|
-
var theme = React$2.useMemo(function () { return
|
|
3100
|
-
var assets = __assign$1(__assign$1({}, theme.assets), { isSameOriginIcons: isSameOriginIcons, cdn:
|
|
3101
|
-
var themeWithOtherVariables = __assign$1(__assign$1({}, theme), { assets: assets });
|
|
3099
|
+
var theme = React$2.useMemo(function () { return applyVariablesIntoTheme(__assign$1({}, unparsedTheme)); }, [unparsedTheme]);
|
|
3100
|
+
var assets = __assign$1(__assign$1({}, theme.assets), { isSameOriginIcons: isSameOriginIcons, cdn: config && config.useTrafileaAssets ? "".concat(config.cdn, "/assets/common") : (_b = theme.assets) === null || _b === void 0 ? void 0 : _b.cdn });
|
|
3101
|
+
var themeWithOtherVariables = __assign$1(__assign$1({}, theme), { assets: assets, config: config });
|
|
3102
3102
|
return (jsxRuntime.jsx(ThemeProvider$1, __assign$1({ theme: themeWithOtherVariables }, { children: jsxRuntime.jsx(AssetsProvider, __assign$1({ assets: assets }, { children: children }), void 0) }), void 0));
|
|
3103
3103
|
};
|
|
3104
3104
|
var useTheme = function () { return useTheme$1(); };
|
|
@@ -4671,22 +4671,18 @@ var Container$19 = newStyled.div(templateObject_1$1R || (templateObject_1$1R = _
|
|
|
4671
4671
|
var _b = _a.height, height = _b === void 0 ? '100%' : _b;
|
|
4672
4672
|
return height;
|
|
4673
4673
|
});
|
|
4674
|
-
var FlexCentered = newStyled.div(templateObject_2$1f || (templateObject_2$1f = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 10px;\n width:
|
|
4675
|
-
var LeftSide = newStyled.div(templateObject_3$Z || (templateObject_3$Z = __makeTemplateObject(["\n width:
|
|
4676
|
-
var RightSide = newStyled.div(templateObject_4$K || (templateObject_4$K = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items:
|
|
4674
|
+
var FlexCentered = newStyled.div(templateObject_2$1f || (templateObject_2$1f = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 10px;\n width: 90%;\n height: 100%;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 10px;\n width: 90%;\n height: 100%;\n"])));
|
|
4675
|
+
var LeftSide = newStyled.div(templateObject_3$Z || (templateObject_3$Z = __makeTemplateObject(["\n width: 110px;\n height: 100%;\n flex-shrink: 0;\n resize: vertical;\n"], ["\n width: 110px;\n height: 100%;\n flex-shrink: 0;\n resize: vertical;\n"])));
|
|
4676
|
+
var RightSide = newStyled.div(templateObject_4$K || (templateObject_4$K = __makeTemplateObject(["\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n align-items: center;\n height: 100%;\n"], ["\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n align-items: center;\n height: 100%;\n"])));
|
|
4677
4677
|
var FlexStart = newStyled.div(templateObject_5$w || (templateObject_5$w = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: start;\n gap: 5px;\n width: 100%;\n padding: 12px;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: start;\n gap: 5px;\n width: 100%;\n padding: 12px;\n"])));
|
|
4678
4678
|
var templateObject_1$1R, templateObject_2$1f, templateObject_3$Z, templateObject_4$K, templateObject_5$w;
|
|
4679
4679
|
|
|
4680
4680
|
var _this$1 = undefined;
|
|
4681
|
-
var
|
|
4682
|
-
var
|
|
4681
|
+
var CouponCard = function (_a) {
|
|
4682
|
+
var image = _a.image, title = _a.title, content = _a.content, couponCode = _a.couponCode, offerLink = _a.offerLink, width = _a.width, height = _a.height, _b = _a.btnText, btnText = _b === void 0 ? 'Redeem Offer' : _b;
|
|
4683
4683
|
var _c = React$2.useState(false), showCoupon = _c[0], setShowCoupon = _c[1];
|
|
4684
|
-
var _d = React$2.useState('176px'), containerHeight = _d[0], setContainerHeight = _d[1];
|
|
4685
4684
|
var handleCopy = React$2.useCallback(function (couponCode) { return (couponCode ? navigator.clipboard.writeText(couponCode) : undefined); }, []);
|
|
4686
|
-
|
|
4687
|
-
setContainerHeight(function (prev) { return (showCoupon ? '220px' : prev); });
|
|
4688
|
-
}, [showCoupon]);
|
|
4689
|
-
return (jsxRuntime.jsxs(Container$19, __assign$1({ height: containerHeight, width: width }, { children: [jsxRuntime.jsx(LeftSide, { children: jsxRuntime.jsx(Image$3, { src: imgSrc, alt: "Product", width: "100%", height: "100%", borderRadius: "8px 0 0 8px" }, void 0) }, void 0), jsxRuntime.jsxs(RightSide, { children: [jsxRuntime.jsxs(FlexStart, { children: [jsxRuntime.jsx(Text$7, __assign$1({ variant: "body", weight: "bold", size: "small" }, { children: title }), void 0), content] }, void 0), jsxRuntime.jsx(FlexCentered, { children: !showCoupon ? (jsxRuntime.jsx(ButtonPrimary, { type: "button", text: btnText, wide: true, size: exports.ComponentSize.Small, onClick: function () { return setShowCoupon(function (prev) { return !prev; }); } }, void 0)) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ButtonSecondaryOutline, { "data-testid": "coupon-code-btn", testId: "coupon-code-btn", type: "button", text: couponCode !== null && couponCode !== void 0 ? couponCode : '', wide: true, size: exports.ComponentSize.Small, icon: {
|
|
4685
|
+
return (jsxRuntime.jsxs(Container$19, __assign$1({ height: height, width: width }, { children: [jsxRuntime.jsx(LeftSide, { children: jsxRuntime.jsx(Image$3, { objectFit: "cover", src: image.src, alt: image.alt, width: "100%", height: "100%", borderRadius: "8px 0 0 8px" }, void 0) }, void 0), jsxRuntime.jsxs(RightSide, { children: [jsxRuntime.jsxs(FlexStart, { children: [jsxRuntime.jsx(Text$7, __assign$1({ variant: "body", weight: "bold", size: "small" }, { children: title }), void 0), content] }, void 0), jsxRuntime.jsx(FlexCentered, { children: !showCoupon ? (jsxRuntime.jsx(ButtonPrimary, { type: "button", text: btnText, wide: true, size: exports.ComponentSize.Large, onClick: function () { return setShowCoupon(function (prev) { return !prev; }); } }, void 0)) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ButtonSecondaryOutline, { "data-testid": "coupon-code-btn", testId: "coupon-code-btn", type: "button", text: couponCode !== null && couponCode !== void 0 ? couponCode : '', wide: true, size: exports.ComponentSize.Small, icon: {
|
|
4690
4686
|
name: 'actions/copy_outlined',
|
|
4691
4687
|
position: 'right',
|
|
4692
4688
|
margin: '10px',
|
|
@@ -4696,7 +4692,7 @@ var Coupon = function (_a) {
|
|
|
4696
4692
|
// Partner titles
|
|
4697
4693
|
var REVEL_BEAUTY_TITLE = 'REVEL BEAUTY';
|
|
4698
4694
|
var THE_SPA_DR_TITLE = 'THE SPA DR.';
|
|
4699
|
-
//
|
|
4695
|
+
// CouponCard contents
|
|
4700
4696
|
var CouponDefaultBody = function (firstLine, secondLine) { return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Text$7, __assign$1({ variant: "body", weight: "regular", size: "small", style: { textAlign: 'initial' } }, { children: firstLine }), void 0), jsxRuntime.jsx(Text$7, __assign$1({ variant: "heading5", weight: "bold" }, { children: secondLine }), void 0)] }, void 0)); };
|
|
4701
4697
|
var TheBodConContent = function () { return (jsxRuntime.jsxs(FlexContainer$2, { children: [jsxRuntime.jsxs(Text$7, __assign$1({ variant: "body", weight: "regular", size: "small" }, { children: [jsxRuntime.jsx(Bold, { children: "FREE and PREMIUM" }, void 0), " access to The BodCon Community App."] }), void 0), jsxRuntime.jsxs(Text$7, __assign$1({ variant: "body", weight: "regular", size: "small" }, { children: ["The #1 Body Confidence Community. You'll have ", jsxRuntime.jsx(Bold, { children: "FREE access to:" }, void 0)] }), void 0), jsxRuntime.jsxs("ul", __assign$1({ style: { marginBottom: '5px', padding: '11px' } }, { children: [jsxRuntime.jsx("li", __assign$1({ style: { marginBottom: '5px' } }, { children: jsxRuntime.jsx(Text$7, __assign$1({ variant: "body", weight: "regular", size: "small" }, { children: "Our confidence series: great courses made by the top influencers in the field, just for you to start your body-confidence journey!" }), void 0) }), void 0), jsxRuntime.jsx("li", { children: jsxRuntime.jsx(Text$7, __assign$1({ variant: "body", weight: "regular", size: "small" }, { children: "Our more than 1.000 women's community and get-togethers to talk about women's empowerment." }), void 0) }, void 0)] }), void 0), jsxRuntime.jsxs(Text$7, __assign$1({ variant: "body", weight: "regular", size: "small" }, { children: [jsxRuntime.jsx(Bold, { children: "FREE" }, void 0), " access to The BodCon 2023 replays!"] }), void 0), jsxRuntime.jsx(Text$7, __assign$1({ variant: "body", weight: "regular", size: "small" }, { children: "Empower yourself and change how you see and feel about your body forever." }), void 0)] }, void 0)); };
|
|
4702
4698
|
var cancellationFlowContentPerKey = {
|
|
@@ -4706,15 +4702,30 @@ var cancellationFlowContentPerKey = {
|
|
|
4706
4702
|
'TheSpaDr-2': CouponDefaultBody('Nourish Antioxidant Serum', '$10 OFF'),
|
|
4707
4703
|
TheBodCon: TheBodConContent(),
|
|
4708
4704
|
};
|
|
4709
|
-
var
|
|
4705
|
+
var couponDimensions = {
|
|
4706
|
+
width: '95%',
|
|
4707
|
+
height: '215px',
|
|
4708
|
+
};
|
|
4710
4709
|
var CancellationFlowAccordionContentPerPartner = {
|
|
4711
4710
|
RevelBeauty: [
|
|
4712
|
-
jsxRuntime.jsx(
|
|
4713
|
-
|
|
4711
|
+
jsxRuntime.jsx(CouponCard, { width: couponDimensions.width, height: couponDimensions.height, title: REVEL_BEAUTY_TITLE, image: {
|
|
4712
|
+
src: 'https://cdn.shopify.com/s/files/1/2679/8624/files/Beauty_Lift_and_Tighten_Serum.png?v=1709316823',
|
|
4713
|
+
alt: 'Daily Essentials 4-Step Skin Care System',
|
|
4714
|
+
}, content: cancellationFlowContentPerKey['RevelBeauty-1'], couponCode: 'CLUBFRIENDS', offerLink: 'https://revelbeauty.com/products/lift-tighten-serum' }, "RevelBeauty-1"),
|
|
4715
|
+
jsxRuntime.jsx(CouponCard, { width: couponDimensions.width, height: couponDimensions.height, title: REVEL_BEAUTY_TITLE, image: {
|
|
4716
|
+
src: 'https://cdn.shopify.com/s/files/1/2679/8624/files/revel-beauty-orders-above-50.png?v=1709326588',
|
|
4717
|
+
alt: 'Daily Essentials 4-Step Skin Care System',
|
|
4718
|
+
}, content: cancellationFlowContentPerKey['RevelBeauty-2'], couponCode: 'SHIPPINGONUS', offerLink: 'https://revelbeauty.com/' }, "RevelBeauty-2"),
|
|
4714
4719
|
],
|
|
4715
4720
|
TheSpaDr: [
|
|
4716
|
-
jsxRuntime.jsx(
|
|
4717
|
-
|
|
4721
|
+
jsxRuntime.jsx(CouponCard, { width: couponDimensions.width, height: couponDimensions.height, title: THE_SPA_DR_TITLE, image: {
|
|
4722
|
+
src: 'https://cdn.shopify.com/s/files/1/2679/8624/files/Daily_Essentials_4-Step_Skin_Care_System.png?v=1709333354',
|
|
4723
|
+
alt: 'Daily Essentials 4-Step Skin Care System',
|
|
4724
|
+
}, content: cancellationFlowContentPerKey['TheSpaDr-1'], couponCode: 'SHMCLUBFRIENDS', offerLink: 'https://thespadr.com/products/4-step-age-defying-clean-skincare-system-3?variant=42658350727366' }, "TheSpaDr-1"),
|
|
4725
|
+
jsxRuntime.jsx(CouponCard, { width: couponDimensions.width, height: couponDimensions.height, title: THE_SPA_DR_TITLE, image: {
|
|
4726
|
+
src: 'https://cdn.shopify.com/s/files/1/2679/8624/files/Nourish_Antioxidant_Serum.png?v=1709333354',
|
|
4727
|
+
alt: 'Daily Essentials 4-Step Skin Care System',
|
|
4728
|
+
}, content: cancellationFlowContentPerKey['TheSpaDr-2'], couponCode: 'SHMCLUB10OFF', offerLink: 'https://thespadr.com/products/step-2-age-defying-lift-tight-serum?variant=15992476860510' }, "TheSpaDr-2"),
|
|
4718
4729
|
],
|
|
4719
4730
|
TheBodCon: [cancellationFlowContentPerKey['TheBodCon']],
|
|
4720
4731
|
};
|
|
@@ -19891,6 +19902,7 @@ var templateObject_1$4, templateObject_2$3, templateObject_3$1, templateObject_4
|
|
|
19891
19902
|
var StyledButton = newStyled(Ye.Button)(function (props) { return ({
|
|
19892
19903
|
background: props.bgColor,
|
|
19893
19904
|
height: '100%',
|
|
19905
|
+
width: '100%',
|
|
19894
19906
|
maxHeight: '48px',
|
|
19895
19907
|
border: 'none',
|
|
19896
19908
|
display: 'flex',
|
|
@@ -19920,14 +19932,14 @@ var StyledController = newStyled.div(templateObject_2$2 || (templateObject_2$2 =
|
|
|
19920
19932
|
var templateObject_1$3, templateObject_2$2;
|
|
19921
19933
|
|
|
19922
19934
|
var StyledDisclosure = newStyled(Ye)(function (_a) {
|
|
19923
|
-
var background = _a.background;
|
|
19935
|
+
var background = _a.background, width = _a.width;
|
|
19924
19936
|
return ({
|
|
19925
19937
|
display: 'flex',
|
|
19926
19938
|
flexDirection: 'column',
|
|
19927
19939
|
justifyContent: 'center',
|
|
19928
19940
|
gap: '10px',
|
|
19929
19941
|
background: background !== null && background !== void 0 ? background : '',
|
|
19930
|
-
width: 'auto',
|
|
19942
|
+
width: width !== null && width !== void 0 ? width : 'auto',
|
|
19931
19943
|
borderRadius: '8px',
|
|
19932
19944
|
border: '0.063rem solid',
|
|
19933
19945
|
borderColor: '#e5e5e5',
|
|
@@ -19951,10 +19963,10 @@ var AccordionContent = function (_a) {
|
|
|
19951
19963
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(StyledButton, __assign$1({ "data-testid": "styled-button", disabled: disabled, bgColor: bgColor }, { children: [jsxRuntime.jsx(HeaderContentComponent, { open: open, header: header, headerOnOpen: headerOnOpen }, void 0), jsxRuntime.jsxs(StyledController, { children: [jsxRuntime.jsx(Text$7, __assign$1({ variant: "body", weight: "demi", size: "small", color: fillControlsCollor }, { children: "View Offers" }), void 0), jsxRuntime.jsx("span", __assign$1({ style: { marginTop: '3px' } }, { children: jsxRuntime.jsx(ControlIconComponent, { open: open, openIcon: openIcon, closeIcon: closeIcon, fillControlsCollor: fillControlsCollor }, void 0) }), void 0)] }, void 0)] }), void 0), open && (jsxRuntime.jsx(StyledContent, __assign$1({ width: contentWidth, bgColor: bgColor, onClick: function (e) { return e.stopPropagation(); } }, { children: jsxRuntime.jsx(StyledPanel, { children: children }, void 0) }), void 0))] }, void 0));
|
|
19952
19964
|
};
|
|
19953
19965
|
var BasicAccordion = function (_a) {
|
|
19954
|
-
var children = _a.children, header = _a.header, bgColor = _a.bgColor, headerOnOpen = _a.headerOnOpen, _b = _a.defaultOpen, defaultOpen = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, openIcon = _a.openIcon, closeIcon = _a.closeIcon, onClick = _a.onClick, _d = _a.
|
|
19955
|
-
return (jsxRuntime.jsx(StyledDisclosure, __assign$1({ as: "div", background: bgColor, defaultOpen: defaultOpen, disabled: disabled, onClick: onClick }, { children: function (_a) {
|
|
19966
|
+
var children = _a.children, header = _a.header, bgColor = _a.bgColor, headerOnOpen = _a.headerOnOpen, _b = _a.defaultOpen, defaultOpen = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, openIcon = _a.openIcon, closeIcon = _a.closeIcon, onClick = _a.onClick, _d = _a.width, width = _d === void 0 ? '100%' : _d, fillControlsCollor = _a.fillControlsCollor;
|
|
19967
|
+
return (jsxRuntime.jsx(StyledDisclosure, __assign$1({ "data-testid": "accordion-container", as: "div", background: bgColor, defaultOpen: defaultOpen, disabled: disabled, onClick: onClick, width: width }, { children: function (_a) {
|
|
19956
19968
|
var open = _a.open;
|
|
19957
|
-
return (jsxRuntime.jsx(AccordionContent, __assign$1({ open: open, disabled: disabled, bgColor: bgColor, fillControlsCollor: fillControlsCollor, header: header, headerOnOpen: headerOnOpen, openIcon: openIcon, closeIcon: closeIcon
|
|
19969
|
+
return (jsxRuntime.jsx(AccordionContent, __assign$1({ open: open, disabled: disabled, bgColor: bgColor, fillControlsCollor: fillControlsCollor, header: header, headerOnOpen: headerOnOpen, openIcon: openIcon, closeIcon: closeIcon }, { children: children }), void 0));
|
|
19958
19970
|
} }), void 0));
|
|
19959
19971
|
};
|
|
19960
19972
|
|
|
@@ -20140,7 +20152,7 @@ exports.Checkbox = Checkbox;
|
|
|
20140
20152
|
exports.ClubOfferTag = ClubOfferTag;
|
|
20141
20153
|
exports.ClubRadioGroupInput = ClubRadioGroupInput;
|
|
20142
20154
|
exports.Collection = Collection;
|
|
20143
|
-
exports.
|
|
20155
|
+
exports.CouponCard = CouponCard;
|
|
20144
20156
|
exports.CrossSell = index$1;
|
|
20145
20157
|
exports.DeliveryDetails = DeliveryDetails;
|
|
20146
20158
|
exports.DiscountTag = DiscountTag$1;
|