@trafilea/afrodita-components 6.16.1 → 6.16.2
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 +6 -3
- package/build/index.esm.js +22 -22
- package/build/index.esm.js.map +1 -1
- package/build/index.js +22 -22
- 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
4681
|
var Coupon = function (_a) {
|
|
4682
|
-
var imgSrc = _a.imgSrc, title = _a.title, content = _a.content, couponCode = _a.couponCode, offerLink = _a.offerLink, width = _a.width, _b = _a.btnText, btnText = _b === void 0 ? 'Redeem Offer' : _b;
|
|
4682
|
+
var imgSrc = _a.imgSrc, 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, { 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: {
|
|
4690
4686
|
name: 'actions/copy_outlined',
|
|
4691
4687
|
position: 'right',
|
|
4692
4688
|
margin: '10px',
|
|
@@ -4706,15 +4702,18 @@ 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(Coupon, { width:
|
|
4713
|
-
jsxRuntime.jsx(Coupon, { width:
|
|
4711
|
+
jsxRuntime.jsx(Coupon, { width: couponDimensions.width, height: couponDimensions.height, title: REVEL_BEAUTY_TITLE, imgSrc: 'https://cdn.shopify.com/s/files/1/2679/8624/files/Beauty_Lift_and_Tighten_Serum.png?v=1709316823', content: cancellationFlowContentPerKey['RevelBeauty-1'], couponCode: 'CLUBFRIENDS', offerLink: 'https://revelbeauty.com/products/lift-tighten-serum' }, "RevelBeauty-1"),
|
|
4712
|
+
jsxRuntime.jsx(Coupon, { width: couponDimensions.width, height: couponDimensions.height, title: REVEL_BEAUTY_TITLE, imgSrc: 'https://cdn.shopify.com/s/files/1/2679/8624/files/revel-beauty-orders-above-50.png?v=1709326588', content: cancellationFlowContentPerKey['RevelBeauty-2'], couponCode: 'SHIPPINGONUS', offerLink: 'https://revelbeauty.com/' }, "RevelBeauty-2"),
|
|
4714
4713
|
],
|
|
4715
4714
|
TheSpaDr: [
|
|
4716
|
-
jsxRuntime.jsx(Coupon, { width:
|
|
4717
|
-
jsxRuntime.jsx(Coupon, { width:
|
|
4715
|
+
jsxRuntime.jsx(Coupon, { width: couponDimensions.width, height: couponDimensions.height, title: THE_SPA_DR_TITLE, imgSrc: 'https://cdn.shopify.com/s/files/1/2679/8624/files/Daily_Essentials_4-Step_Skin_Care_System.png?v=1709333354', content: cancellationFlowContentPerKey['TheSpaDr-1'], couponCode: 'SHMCLUBFRIENDS', offerLink: 'https://thespadr.com/products/4-step-age-defying-clean-skincare-system-3?variant=42658350727366' }, "TheSpaDr-1"),
|
|
4716
|
+
jsxRuntime.jsx(Coupon, { width: couponDimensions.width, height: couponDimensions.height, title: THE_SPA_DR_TITLE, imgSrc: 'https://cdn.shopify.com/s/files/1/2679/8624/files/Nourish_Antioxidant_Serum.png?v=1709333354', content: cancellationFlowContentPerKey['TheSpaDr-2'], couponCode: 'SHMCLUB10OFF', offerLink: 'https://thespadr.com/products/step-2-age-defying-lift-tight-serum?variant=15992476860510' }, "TheSpaDr-2"),
|
|
4718
4717
|
],
|
|
4719
4718
|
TheBodCon: [cancellationFlowContentPerKey['TheBodCon']],
|
|
4720
4719
|
};
|
|
@@ -19891,6 +19890,7 @@ var templateObject_1$4, templateObject_2$3, templateObject_3$1, templateObject_4
|
|
|
19891
19890
|
var StyledButton = newStyled(Ye.Button)(function (props) { return ({
|
|
19892
19891
|
background: props.bgColor,
|
|
19893
19892
|
height: '100%',
|
|
19893
|
+
width: '100%',
|
|
19894
19894
|
maxHeight: '48px',
|
|
19895
19895
|
border: 'none',
|
|
19896
19896
|
display: 'flex',
|
|
@@ -19920,14 +19920,14 @@ var StyledController = newStyled.div(templateObject_2$2 || (templateObject_2$2 =
|
|
|
19920
19920
|
var templateObject_1$3, templateObject_2$2;
|
|
19921
19921
|
|
|
19922
19922
|
var StyledDisclosure = newStyled(Ye)(function (_a) {
|
|
19923
|
-
var background = _a.background;
|
|
19923
|
+
var background = _a.background, width = _a.width;
|
|
19924
19924
|
return ({
|
|
19925
19925
|
display: 'flex',
|
|
19926
19926
|
flexDirection: 'column',
|
|
19927
19927
|
justifyContent: 'center',
|
|
19928
19928
|
gap: '10px',
|
|
19929
19929
|
background: background !== null && background !== void 0 ? background : '',
|
|
19930
|
-
width: 'auto',
|
|
19930
|
+
width: width !== null && width !== void 0 ? width : 'auto',
|
|
19931
19931
|
borderRadius: '8px',
|
|
19932
19932
|
border: '0.063rem solid',
|
|
19933
19933
|
borderColor: '#e5e5e5',
|
|
@@ -19951,10 +19951,10 @@ var AccordionContent = function (_a) {
|
|
|
19951
19951
|
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
19952
|
};
|
|
19953
19953
|
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) {
|
|
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.width, width = _d === void 0 ? '100%' : _d, fillControlsCollor = _a.fillControlsCollor;
|
|
19955
|
+
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
19956
|
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
|
|
19957
|
+
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
19958
|
} }), void 0));
|
|
19959
19959
|
};
|
|
19960
19960
|
|