@trafilea/afrodita-components 7.10.2 → 7.10.4
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/es/components/motivator-progress-bar/MotivatorProgressBar.js +1 -1
- package/build/es/components/shared/button/BaseButton.js +1 -1
- package/build/index.d.ts +5 -1
- package/build/lib/components/motivator-progress-bar/MotivatorProgressBar.js +1 -1
- package/build/lib/components/shared/button/BaseButton.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n,__assign as r}from"tslib";import{jsxs as e,jsx as o}from"react/jsx-runtime";import t from"@emotion/styled";import{useTheme as
|
|
1
|
+
import{__makeTemplateObject as n,__assign as r}from"tslib";import{jsxs as e,jsx as o}from"react/jsx-runtime";import t from"@emotion/styled";import i from"html-react-parser";import{useTheme as d}from"../../core/theme/Theme.js";var a,c,u=t.div(a||(a=n(["\n @keyframes loading {\n 0% {\n transform: translateX(0);\n }\n to {\n transform: translateX(400%);\n }\n }\n\n height: ",";\n background-color: ",";\n width: ",";\n border-radius: ",";\n left: ",";\n animation: ",";\n"],["\n @keyframes loading {\n 0% {\n transform: translateX(0);\n }\n to {\n transform: translateX(400%);\n }\n }\n\n height: ",";\n background-color: ",";\n width: ",";\n border-radius: ",";\n left: ",";\n animation: ",";\n"])),(function(n){return n.height||"0.5rem"}),(function(n){return n.backgroundColor}),(function(n){var r=n.percent;return r?f(r):"50%"}),(function(n){return n.borderRadius||"0.25rem"}),(function(n){return n.percent?"0":"-50%"}),(function(n){return n.percent?"none":"loading 1s ease-in 0.5s infinite"})),l=t.div((function(n){var r=n.backgroundColor;return{height:n.height||"0.5rem",width:"100%",backgroundColor:r,borderRadius:n.borderRadius||"0.25rem"}})),s=t.div({display:"grid",gridTemplateColumns:"1fr 10fr 1fr",justifyContent:"center",alignItems:"center",width:"416px",gap:"8px",maxWidth:"100%",padding:"0 16px",position:"relative"}),g=t.div((function(n){return{width:"475px",maxWidth:"100%",display:"flex",gap:"13px",padding:"16px 0",flexDirection:"column",alignItems:"center",background:n.backgroundColor}})),m=t.div(c||(c=n(["\n padding: 0 1rem;\n text-align: center;\n"],["\n padding: 0 1rem;\n text-align: center;\n"]))),f=function(n){return n<=100&&n>=0?"".concat(n,"%"):"0%"},h=t.div((function(n){return{fontWeight:n.isBold?600:400}})),p=function(n){var t=n.fillColor,a=void 0===t?"#F7A08B":t,c=n.backgroundColor,f=void 0===c?"#F7F7F7":c,p=n.unfilledColor,v=void 0===p?"#EEBFBD":p,b=n.currencyCode,C=void 0===b?"$":b,k=n.endingValue,x=void 0===k?70:k,B=n.currentAmount,y=void 0===B?0:B,M=n.rewardUnlockedMessage,w=n.isClubBarMotivatorTest,F=void 0!==w&&w,S=n.remainingAmountMessage,A=n.hasProgressBar,P=void 0===A||A,T=d(),X=y>=x,j=function(n,r){var e=n/r;return e>1?100:100*e}(y,x);return e(g,r({backgroundColor:f},{children:[P&&e(s,r({"data-testid":"MPBContainer"},{children:[e(h,{children:[C,y]},void 0),o(l,r({backgroundColor:v||T.colors.shades[100].color,"data-testid":"MPBBackground"},{children:o(u,{"data-testid":"MPBBar",backgroundColor:a,percent:j},void 0)}),void 0),e(h,r({isBold:!0},{children:[C,x]}),void 0)]}),void 0),X?o(m,{dangerouslySetInnerHTML:{__html:M}},void 0):function(){var n=Math.round(100*(x-y))/100;if(F)return e(m,{children:["Spend ",C,n," more to unlock ",o("strong",{children:"Free Priority Shipping"},void 0)," with Club!"]},void 0);var r=null!=S?S:"Spend currencyCoderemainingAmount more to get <strong>Free Shipping</strong>";return r=(r=r.replace("currencyCode",C)).replace("remainingAmount",n.toString()),o(m,{children:i(r)},void 0)}()]}),void 0)};export{p as MotivatorProgressBar};
|
|
2
2
|
//# sourceMappingURL=MotivatorProgressBar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as i}from"@emotion/react/jsx-runtime";var r=function(r){var t=r.children,n=r.renderLeading,a=r.renderTrailing,d=r.disabled,o=r.type,s=void 0===o?"button":o,c=r.onClick,l=r.className,b=r.inline,m=r.uppercase,p=void 0===m||m,u=r.testId,f=void 0===u?"base-button":u,x=r.id,v=r["aria-describedby"];return i("button",e({onClick:c,disabled:d,className:l,type:s,"data-testid":f,css:{display:b?"inline-flex":"flex",justifyContent:"center",alignItems:"center",padding:"0.75rem 2rem",textDecoration:"none",textTransform:p?"uppercase":"unset",boxSizing:"border-box",cursor:"pointer"},id:x,"aria-describedby":v},{children:[n,t,a]}),void 0)};export{r as default};
|
|
2
2
|
//# sourceMappingURL=BaseButton.js.map
|
package/build/index.d.ts
CHANGED
|
@@ -2816,6 +2816,7 @@ declare type CTAProps = {
|
|
|
2816
2816
|
alignItems?: CSSProperties['alignItems'];
|
|
2817
2817
|
progress?: number;
|
|
2818
2818
|
innerSpan?: boolean;
|
|
2819
|
+
'aria-describedby'?: string;
|
|
2819
2820
|
};
|
|
2820
2821
|
declare type DropdownOption<T> = {
|
|
2821
2822
|
key: string;
|
|
@@ -3531,6 +3532,7 @@ interface BaseCTAProps {
|
|
|
3531
3532
|
alignItems?: CSSProperties['alignItems'];
|
|
3532
3533
|
innerSpan?: boolean;
|
|
3533
3534
|
progress?: number;
|
|
3535
|
+
'aria-describedby'?: string;
|
|
3534
3536
|
}
|
|
3535
3537
|
|
|
3536
3538
|
declare type ButtonProps = {
|
|
@@ -3595,8 +3597,9 @@ interface MotivatorProgressBarProps {
|
|
|
3595
3597
|
currencyCode?: string;
|
|
3596
3598
|
isClubBarMotivatorTest?: boolean;
|
|
3597
3599
|
remainingAmountMessage?: string;
|
|
3600
|
+
hasProgressBar?: boolean;
|
|
3598
3601
|
}
|
|
3599
|
-
declare const MotivatorProgressBar: ({ fillColor, backgroundColor, unfilledColor, currencyCode, endingValue, currentAmount, rewardUnlockedMessage, isClubBarMotivatorTest, remainingAmountMessage }: MotivatorProgressBarProps) => JSX.Element;
|
|
3602
|
+
declare const MotivatorProgressBar: ({ fillColor, backgroundColor, unfilledColor, currencyCode, endingValue, currentAmount, rewardUnlockedMessage, isClubBarMotivatorTest, remainingAmountMessage, hasProgressBar, }: MotivatorProgressBarProps) => JSX.Element;
|
|
3600
3603
|
|
|
3601
3604
|
interface OrderBarProps {
|
|
3602
3605
|
message: string;
|
|
@@ -4071,6 +4074,7 @@ interface BaseButtonProps {
|
|
|
4071
4074
|
uppercase?: boolean;
|
|
4072
4075
|
testId?: string;
|
|
4073
4076
|
id?: string;
|
|
4077
|
+
'aria-describedby'?: string;
|
|
4074
4078
|
}
|
|
4075
4079
|
|
|
4076
4080
|
declare type BaseProps = Pick<BaseButtonProps, 'disabled' | 'type' | 'onClick' | 'testId'>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),r=require("@emotion/styled"),t=require("../../core/theme/Theme.js")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),r=require("@emotion/styled"),t=require("html-react-parser"),i=require("../../core/theme/Theme.js");function o(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var a,d,u=o(r),s=o(t),l=u.default.div(a||(a=n.__makeTemplateObject(["\n @keyframes loading {\n 0% {\n transform: translateX(0);\n }\n to {\n transform: translateX(400%);\n }\n }\n\n height: ",";\n background-color: ",";\n width: ",";\n border-radius: ",";\n left: ",";\n animation: ",";\n"],["\n @keyframes loading {\n 0% {\n transform: translateX(0);\n }\n to {\n transform: translateX(400%);\n }\n }\n\n height: ",";\n background-color: ",";\n width: ",";\n border-radius: ",";\n left: ",";\n animation: ",";\n"])),(function(n){return n.height||"0.5rem"}),(function(n){return n.backgroundColor}),(function(n){var e=n.percent;return e?h(e):"50%"}),(function(n){return n.borderRadius||"0.25rem"}),(function(n){return n.percent?"0":"-50%"}),(function(n){return n.percent?"none":"loading 1s ease-in 0.5s infinite"})),c=u.default.div((function(n){var e=n.backgroundColor;return{height:n.height||"0.5rem",width:"100%",backgroundColor:e,borderRadius:n.borderRadius||"0.25rem"}})),g=u.default.div({display:"grid",gridTemplateColumns:"1fr 10fr 1fr",justifyContent:"center",alignItems:"center",width:"416px",gap:"8px",maxWidth:"100%",padding:"0 16px",position:"relative"}),f=u.default.div((function(n){return{width:"475px",maxWidth:"100%",display:"flex",gap:"13px",padding:"16px 0",flexDirection:"column",alignItems:"center",background:n.backgroundColor}})),m=u.default.div(d||(d=n.__makeTemplateObject(["\n padding: 0 1rem;\n text-align: center;\n"],["\n padding: 0 1rem;\n text-align: center;\n"]))),h=function(n){return n<=100&&n>=0?"".concat(n,"%"):"0%"},v=u.default.div((function(n){return{fontWeight:n.isBold?600:400}}));exports.MotivatorProgressBar=function(r){var t=r.fillColor,o=void 0===t?"#F7A08B":t,a=r.backgroundColor,d=void 0===a?"#F7F7F7":a,u=r.unfilledColor,h=void 0===u?"#EEBFBD":u,p=r.currencyCode,x=void 0===p?"$":p,b=r.endingValue,k=void 0===b?70:b,C=r.currentAmount,j=void 0===C?0:C,_=r.rewardUnlockedMessage,y=r.isClubBarMotivatorTest,B=void 0!==y&&y,M=r.remainingAmountMessage,w=r.hasProgressBar,F=void 0===w||w,P=i.useTheme(),T=j>=k,S=function(n,e){var r=n/e;return r>1?100:100*r}(j,k);return e.jsxs(f,n.__assign({backgroundColor:d},{children:[F&&e.jsxs(g,n.__assign({"data-testid":"MPBContainer"},{children:[e.jsxs(v,{children:[x,j]},void 0),e.jsx(c,n.__assign({backgroundColor:h||P.colors.shades[100].color,"data-testid":"MPBBackground"},{children:e.jsx(l,{"data-testid":"MPBBar",backgroundColor:o,percent:S},void 0)}),void 0),e.jsxs(v,n.__assign({isBold:!0},{children:[x,k]}),void 0)]}),void 0),T?e.jsx(m,{dangerouslySetInnerHTML:{__html:_}},void 0):function(){var n=Math.round(100*(k-j))/100;if(B)return e.jsxs(m,{children:["Spend ",x,n," more to unlock ",e.jsx("strong",{children:"Free Priority Shipping"},void 0)," with Club!"]},void 0);var r=null!=M?M:"Spend currencyCoderemainingAmount more to get <strong>Free Shipping</strong>";return r=(r=r.replace("currencyCode",x)).replace("remainingAmount",n.toString()),e.jsx(m,{children:s.default(r)},void 0)}()]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=MotivatorProgressBar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),i=require("@emotion/react/jsx-runtime");module.exports=function(
|
|
1
|
+
"use strict";var e=require("tslib"),i=require("@emotion/react/jsx-runtime");module.exports=function(r){var t=r.children,n=r.renderLeading,s=r.renderTrailing,d=r.disabled,a=r.type,o=void 0===a?"button":a,c=r.onClick,l=r.className,u=r.inline,b=r.uppercase,p=void 0===b||b,m=r.testId,x=void 0===m?"base-button":m,g=r.id,v=r["aria-describedby"];return i.jsxs("button",e.__assign({onClick:c,disabled:d,className:l,type:o,"data-testid":x,css:{display:u?"inline-flex":"flex",justifyContent:"center",alignItems:"center",padding:"0.75rem 2rem",textDecoration:"none",textTransform:p?"uppercase":"unset",boxSizing:"border-box",cursor:"pointer"},id:g,"aria-describedby":v},{children:[n,t,s]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=BaseButton.js.map
|
package/package.json
CHANGED