@cleartrip/ct-platform-supercoins-floating-island 1.0.1-beta.2 → 1.0.1-beta.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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("@lottiefiles/dotlottie-react");var o,s="index-module_island_container__4TL4c",a="index-module_island__lpIBI",r="index-module_expand__Slboq",d="index-module_tooltip__jBD1B",_="index-module_content_wrapper__0ZFTx",l="index-module_supercoins_wrapper__tv2r9",c="index-module_heading__YU4VL",m="index-module_supercoins_logo__476z2",p="index-module_supercoins__aVo4c",u="index-module_supercoins_animation_wrapper__7lDYZ",x="index-module_supercoins_increment_wrapper__ot0MN",f="index-module_supercoins_increment__HfHz9",h="index-module_lottie-canvas__b-B9p";function g(e){var o=e.onAnimationEnd,s=void 0===o?function(){}:o,a=i.useState(null),r=a[0],d=a[1];return i.useEffect((function(){if(r){var e=setTimeout((function(){r.setFrame(274),r.play()}),2800);return r.addEventListener("complete",s),function(){clearTimeout(e)}}}),[r]),n.jsx(t.DotLottieReact,{src:"
|
|
1
|
+
"use strict";var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("@lottiefiles/dotlottie-react");var o,s="index-module_island_container__4TL4c",a="index-module_island__lpIBI",r="index-module_expand__Slboq",d="index-module_tooltip__jBD1B",_="index-module_content_wrapper__0ZFTx",l="index-module_supercoins_wrapper__tv2r9",c="index-module_heading__YU4VL",m="index-module_supercoins_logo__476z2",p="index-module_supercoins__aVo4c",u="index-module_supercoins_animation_wrapper__7lDYZ",x="index-module_supercoins_increment_wrapper__ot0MN",f="index-module_supercoins_increment__HfHz9",h="index-module_lottie-canvas__b-B9p";function g(e){var o=e.onAnimationEnd,s=void 0===o?function(){}:o,a=i.useState(null),r=a[0],d=a[1];return i.useEffect((function(){if(r){var e=setTimeout((function(){r.setFrame(274),r.play()}),2800);return r.addEventListener("complete",s),function(){clearTimeout(e)}}}),[r]),n.jsx(t.DotLottieReact,{src:"https://storage.cloud.google.com/offermgmt-prod/offermgmt/lottie/Floating_SC.lottie",className:h,dotLottieRefCallback:function(e){d(e)}})}!function(e,n){void 0===n&&(n={});var i=n.insertAt;if("undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&t.firstChild?t.insertBefore(o,t.firstChild):t.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("*{box-sizing:border-box;margin:0;padding:0}.index-module_island_container__4TL4c{font-family:Inter;position:relative}.index-module_island__lpIBI{align-items:center;animation:index-module_island_fadein__hqMds 1s 1 forwards,index-module_island_slideDown__bo-l7 1s 1 forwards,index-module_island_slideUp__k-yM5 1s 9s forwards,index-module_island_fadeOut__1aBg8 1s 9s forwards;background-color:#003ea2;border-radius:16px;display:flex;height:92px;justify-content:center;margin-top:18px;opacity:.1;position:absolute;top:0;transform:translateY(-10px);width:336px;z-index:-1}.index-module_expand__Slboq{animation:index-module_expand__Slboq 1s 1 forwards,index-module_compress__8Xyt- 1s 9s 1 forwards;height:0;position:relative;width:336px}.index-module_tooltip__jBD1B{position:absolute;right:20px;top:-9px;width:25px}.index-module_content_wrapper__0ZFTx{animation:index-module_contentwrapper_slidedown__L32FG 1s;animation-fill-mode:forwards;animation-iteration-count:1;transform:translateY(-8px)}.index-module_supercoins_wrapper__tv2r9{align-items:center;animation:index-module_supercoins_slidedown__FKn-p .5s cubic-bezier(.65,.05,.36,1) .2s 1 forwards;display:flex;gap:4px;height:max-content;justify-content:center;line-height:32px;margin-left:auto;margin-right:auto;transform:translateY(-4px);width:max-content}.index-module_heading__YU4VL{animation:index-module_scale_down__4sBhs .5s 3.5s 1 forwards;color:#fff;font-size:14px;line-height:16px;opacity:.7;text-align:center}.index-module_supercoins_logo__476z2{height:28px;width:28px}.index-module_supercoins__aVo4c{color:#fff;font-size:32px;font-weight:600;line-height:36px}.index-module_supercoins_animation_wrapper__7lDYZ{animation:index-module_supercoins_animation_wrapper_scaleup__O6Yq0 .85s 2.5s 1 forwards,index-module_scale_down__4sBhs .5s 3.5s 1 forwards;display:flex;position:relative}.index-module_supercoins_increment_wrapper__ot0MN{animation:index-module_supercoins_increment_wrapper_width__nZPna 1s 1s 1 forwards;direction:ltr;display:flex;height:36px;justify-content:left;max-width:168px;width:0}.index-module_supercoins_increment__HfHz9{animation:index-module_supercoins_increment_slidedown__R45HT 1s 1s 1 forwards;color:#b7eda8;font-size:32px;font-weight:600;left:var(--supercoins-increment-shift_left_by);line-height:36px;opacity:0;position:absolute;top:-50%;white-space:nowrap}.index-module_lottie-canvas__b-B9p{animation:index-module_island_fadein__hqMds 1s;animation-fill-mode:forwards;animation-iteration-count:1;border-radius:16px;height:92px;left:0;opacity:.1;position:absolute;top:0;width:336px}@keyframes index-module_animation_exit__dkIsm{0%{height:96px}to{height:0}}@keyframes index-module_scale_down__4sBhs{0%{opacity:1;scale:1}to{opacity:0;scale:0}}@keyframes index-module_supercoins_animation_wrapper_scaleup__O6Yq0{0%{scale:1}50%{scale:1.1}90%{scale:.9}to{scale:1}}@keyframes index-module_supercoins_increment_wrapper_width__nZPna{0%{width:0}to{width:var(--supercoins-increment-width)}}@keyframes index-module_supercoins_increment_slidedown__R45HT{0%{opacity:0;top:-50%}to{opacity:1;top:0}}@keyframes index-module_island_fadein__hqMds{0%{opacity:.1}to{opacity:1}}@keyframes index-module_island_fadeOut__1aBg8{0%{opacity:1}to{opacity:0}}@keyframes index-module_contentwrapper_slidedown__L32FG{0%{transform:translateY(-8px)}to{transform:translateY(0)}}@keyframes index-module_supercoins_slidedown__FKn-p{0%{transform:translateY(-4px)}to{transform:translateY(0)}}@keyframes index-module_island_slideDown__bo-l7{0%{transform:translateY(-10px)}to{transform:translateY(0)}}@keyframes index-module_island_slideUp__k-yM5{0%{transform:translateY(0)}to{transform:translateY(-10px)}}@keyframes index-module_expand__Slboq{0%{height:0}to{height:126px}}@keyframes index-module_compress__8Xyt-{0%{height:126px}to{height:0}}"),exports.ISLAND_ALIGN=void 0,(o=exports.ISLAND_ALIGN||(exports.ISLAND_ALIGN={}))[o.left=0]="left",o[o.right=1]="right";var w=exports.ISLAND_ALIGN.right;exports.SupercoinsFloatingIsland=function(t){var o,h,y,v,b=t.islandStyles,N=void 0===b?"":b,L=t.superCoins,j=void 0===L?5e3:L,k=t.align,S=void 0===k?w:k,I=t.onAnimationStart,Y=void 0===I?function(){}:I,q=t.onAnimationEnd,A=void 0===q?function(){}:q;o=j,h=document.querySelector(":root"),y=45,v=100,o>99&&o<999?y=50:o>999&&o<9999?(y=50,v=120):o>9999&&(y=50,v=150),null==h||h.style.setProperty("--supercoins-increment-shift_left_by","".concat(y,"%")),null==h||h.style.setProperty("--supercoins-increment-width","".concat(v,"px"));var B=i.useState(j-40),D=B[0],E=B[1],T=i.useRef(null);i.useEffect((function(){var e;if(T.current)return null===(e=null==T?void 0:T.current)||void 0===e||e.addEventListener("animationstart",n),function(){var e;null===(e=null==T?void 0:T.current)||void 0===e||e.removeEventListener("animationstart",n)};function n(){return setInterval((function(){E((function(e){return e<j?e+1:e}))}),50)}}),[]),i.useEffect((function(){Y()}),[]);var z=S===exports.ISLAND_ALIGN.left?{left:0}:{right:0};return n.jsxs("div",e.__assign({className:"".concat(s," ").concat(N)},{children:[n.jsx("div",{className:r}),n.jsxs("div",e.__assign({style:z,className:a},{children:[n.jsx("img",{src:"https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/floating_island_tooltip.png",className:d}),n.jsx(g,{onAnimationEnd:A}),n.jsxs("div",e.__assign({className:_},{children:[n.jsx("p",e.__assign({className:c},{children:"Your SuperCoin balance"})),n.jsxs("div",e.__assign({className:u},{children:[n.jsxs("div",e.__assign({className:l},{children:[n.jsx("img",{src:"https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/supercoin_island.png",className:m}),n.jsx("p",e.__assign({className:p},{children:j}))]})),n.jsx("div",e.__assign({className:x},{children:n.jsxs("p",e.__assign({className:f,ref:T},{children:["= ₹",D]}))}))]}))]}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=ct-platform-supercoins-floating-island.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ct-platform-supercoins-floating-island.cjs.js","sources":["../packages/components/SupercoinsFloatingIsland/src/SupercoinsFloatingIsland.types.ts","../packages/components/SupercoinsFloatingIsland/src/LottieWrapper.tsx","../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/SupercoinsFloatingIsland/src/constants.ts","../packages/components/SupercoinsFloatingIsland/src/SupercoinsFloatingIsland.tsx","../packages/components/SupercoinsFloatingIsland/src/utils/setCSSVariable.ts"],"sourcesContent":[null,null,"function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null],"names":["ISLAND_ALIGN","LottieWrapper","_a","_b","onAnimationEnd","_c","useState","dotLottie","setDotLottie","useEffect","timeout","setTimeout","setFrame","play","addEventListener","clearTimeout","_jsx","DotLottieReact","src","className","styles","dotLottieRefCallback","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","DEFAULT_ISLAND_ALIGNMENT","right","lengthOfSupercoins","ctx","leftShiftBy","width","islandStyles","superCoins","_d","align","_e","onAnimationStart","_f","querySelector","setProperty","concat","_g","incrementSupercoin","setIncrementSupercoin","supercoinsIncrementElement","useRef","current","startIncrementing","removeEventListener","setInterval","prev","alignStyles","left","_jsxs","__assign","children","jsx","jsxs"],"mappings":"oIAAYA,ogBCQY,SAAAC,EAAcC,GAClC,IAAAC,EAAAD,EAAAE,eAAAA,OAAiB,IAAAD,EAAA,WAAQ,EAAAA,EAEnBE,EAA4BC,EAAAA,SAA2B,MAAtDC,EAASF,EAAA,GAAEG,EAAYH,EAAA,GAmB9B,OAdAI,EAAAA,WAAU,WACN,GAAKF,EAAL,CACA,IAAMG,EAAUC,YAAW,WACvBJ,EAAUK,SAAS,KACnBL,EAAUM,MACb,GAAE,MAIH,OAFAN,EAAUO,iBAAiB,WAAYV,GAEhC,WACHW,aAAaL,EACjB,CAVuB,CAW3B,GAAG,CAACH,IAGAS,MAACC,EAAAA,eAAc,CAEXC,IAAI,
|
|
1
|
+
{"version":3,"file":"ct-platform-supercoins-floating-island.cjs.js","sources":["../packages/components/SupercoinsFloatingIsland/src/SupercoinsFloatingIsland.types.ts","../packages/components/SupercoinsFloatingIsland/src/LottieWrapper.tsx","../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/SupercoinsFloatingIsland/src/constants.ts","../packages/components/SupercoinsFloatingIsland/src/SupercoinsFloatingIsland.tsx","../packages/components/SupercoinsFloatingIsland/src/utils/setCSSVariable.ts"],"sourcesContent":[null,null,"function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null],"names":["ISLAND_ALIGN","LottieWrapper","_a","_b","onAnimationEnd","_c","useState","dotLottie","setDotLottie","useEffect","timeout","setTimeout","setFrame","play","addEventListener","clearTimeout","_jsx","DotLottieReact","src","className","styles","dotLottieRefCallback","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","DEFAULT_ISLAND_ALIGNMENT","right","lengthOfSupercoins","ctx","leftShiftBy","width","islandStyles","superCoins","_d","align","_e","onAnimationStart","_f","querySelector","setProperty","concat","_g","incrementSupercoin","setIncrementSupercoin","supercoinsIncrementElement","useRef","current","startIncrementing","removeEventListener","setInterval","prev","alignStyles","left","_jsxs","__assign","children","jsx","jsxs"],"mappings":"oIAAYA,ogBCQY,SAAAC,EAAcC,GAClC,IAAAC,EAAAD,EAAAE,eAAAA,OAAiB,IAAAD,EAAA,WAAQ,EAAAA,EAEnBE,EAA4BC,EAAAA,SAA2B,MAAtDC,EAASF,EAAA,GAAEG,EAAYH,EAAA,GAmB9B,OAdAI,EAAAA,WAAU,WACN,GAAKF,EAAL,CACA,IAAMG,EAAUC,YAAW,WACvBJ,EAAUK,SAAS,KACnBL,EAAUM,MACb,GAAE,MAIH,OAFAN,EAAUO,iBAAiB,WAAYV,GAEhC,WACHW,aAAaL,EACjB,CAVuB,CAW3B,GAAG,CAACH,IAGAS,MAACC,EAAAA,eAAc,CAEXC,IAAI,sFACJC,UAAWC,EACXC,qBAvBqB,SAACd,GAC1BC,EAAaD,EACjB,GAwBJ,ECtCA,SAAqBe,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,Y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tslib";import{jsx as n,jsxs as i}from"react/jsx-runtime";import{useState as t,useEffect as o,useRef as a}from"react";import{DotLottieReact as r}from"@lottiefiles/dotlottie-react";var s,d="index-module_island_container__4TL4c",l="index-module_island__lpIBI",_="index-module_expand__Slboq",m="index-module_tooltip__jBD1B",c="index-module_content_wrapper__0ZFTx",p="index-module_supercoins_wrapper__tv2r9",u="index-module_heading__YU4VL",f="index-module_supercoins_logo__476z2",x="index-module_supercoins__aVo4c",h="index-module_supercoins_animation_wrapper__7lDYZ",g="index-module_supercoins_increment_wrapper__ot0MN",w="index-module_supercoins_increment__HfHz9",y="index-module_lottie-canvas__b-B9p";function v(e){var i=e.onAnimationEnd,a=void 0===i?function(){}:i,s=t(null),d=s[0],l=s[1];return o((function(){if(d){var e=setTimeout((function(){d.setFrame(274),d.play()}),2800);return d.addEventListener("complete",a),function(){clearTimeout(e)}}}),[d]),n(r,{src:"
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as i}from"react/jsx-runtime";import{useState as t,useEffect as o,useRef as a}from"react";import{DotLottieReact as r}from"@lottiefiles/dotlottie-react";var s,d="index-module_island_container__4TL4c",l="index-module_island__lpIBI",_="index-module_expand__Slboq",m="index-module_tooltip__jBD1B",c="index-module_content_wrapper__0ZFTx",p="index-module_supercoins_wrapper__tv2r9",u="index-module_heading__YU4VL",f="index-module_supercoins_logo__476z2",x="index-module_supercoins__aVo4c",h="index-module_supercoins_animation_wrapper__7lDYZ",g="index-module_supercoins_increment_wrapper__ot0MN",w="index-module_supercoins_increment__HfHz9",y="index-module_lottie-canvas__b-B9p";function v(e){var i=e.onAnimationEnd,a=void 0===i?function(){}:i,s=t(null),d=s[0],l=s[1];return o((function(){if(d){var e=setTimeout((function(){d.setFrame(274),d.play()}),2800);return d.addEventListener("complete",a),function(){clearTimeout(e)}}}),[d]),n(r,{src:"https://storage.cloud.google.com/offermgmt-prod/offermgmt/lottie/Floating_SC.lottie",className:y,dotLottieRefCallback:function(e){l(e)}})}!function(e,n){void 0===n&&(n={});var i=n.insertAt;if("undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&t.firstChild?t.insertBefore(o,t.firstChild):t.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("*{box-sizing:border-box;margin:0;padding:0}.index-module_island_container__4TL4c{font-family:Inter;position:relative}.index-module_island__lpIBI{align-items:center;animation:index-module_island_fadein__hqMds 1s 1 forwards,index-module_island_slideDown__bo-l7 1s 1 forwards,index-module_island_slideUp__k-yM5 1s 9s forwards,index-module_island_fadeOut__1aBg8 1s 9s forwards;background-color:#003ea2;border-radius:16px;display:flex;height:92px;justify-content:center;margin-top:18px;opacity:.1;position:absolute;top:0;transform:translateY(-10px);width:336px;z-index:-1}.index-module_expand__Slboq{animation:index-module_expand__Slboq 1s 1 forwards,index-module_compress__8Xyt- 1s 9s 1 forwards;height:0;position:relative;width:336px}.index-module_tooltip__jBD1B{position:absolute;right:20px;top:-9px;width:25px}.index-module_content_wrapper__0ZFTx{animation:index-module_contentwrapper_slidedown__L32FG 1s;animation-fill-mode:forwards;animation-iteration-count:1;transform:translateY(-8px)}.index-module_supercoins_wrapper__tv2r9{align-items:center;animation:index-module_supercoins_slidedown__FKn-p .5s cubic-bezier(.65,.05,.36,1) .2s 1 forwards;display:flex;gap:4px;height:max-content;justify-content:center;line-height:32px;margin-left:auto;margin-right:auto;transform:translateY(-4px);width:max-content}.index-module_heading__YU4VL{animation:index-module_scale_down__4sBhs .5s 3.5s 1 forwards;color:#fff;font-size:14px;line-height:16px;opacity:.7;text-align:center}.index-module_supercoins_logo__476z2{height:28px;width:28px}.index-module_supercoins__aVo4c{color:#fff;font-size:32px;font-weight:600;line-height:36px}.index-module_supercoins_animation_wrapper__7lDYZ{animation:index-module_supercoins_animation_wrapper_scaleup__O6Yq0 .85s 2.5s 1 forwards,index-module_scale_down__4sBhs .5s 3.5s 1 forwards;display:flex;position:relative}.index-module_supercoins_increment_wrapper__ot0MN{animation:index-module_supercoins_increment_wrapper_width__nZPna 1s 1s 1 forwards;direction:ltr;display:flex;height:36px;justify-content:left;max-width:168px;width:0}.index-module_supercoins_increment__HfHz9{animation:index-module_supercoins_increment_slidedown__R45HT 1s 1s 1 forwards;color:#b7eda8;font-size:32px;font-weight:600;left:var(--supercoins-increment-shift_left_by);line-height:36px;opacity:0;position:absolute;top:-50%;white-space:nowrap}.index-module_lottie-canvas__b-B9p{animation:index-module_island_fadein__hqMds 1s;animation-fill-mode:forwards;animation-iteration-count:1;border-radius:16px;height:92px;left:0;opacity:.1;position:absolute;top:0;width:336px}@keyframes index-module_animation_exit__dkIsm{0%{height:96px}to{height:0}}@keyframes index-module_scale_down__4sBhs{0%{opacity:1;scale:1}to{opacity:0;scale:0}}@keyframes index-module_supercoins_animation_wrapper_scaleup__O6Yq0{0%{scale:1}50%{scale:1.1}90%{scale:.9}to{scale:1}}@keyframes index-module_supercoins_increment_wrapper_width__nZPna{0%{width:0}to{width:var(--supercoins-increment-width)}}@keyframes index-module_supercoins_increment_slidedown__R45HT{0%{opacity:0;top:-50%}to{opacity:1;top:0}}@keyframes index-module_island_fadein__hqMds{0%{opacity:.1}to{opacity:1}}@keyframes index-module_island_fadeOut__1aBg8{0%{opacity:1}to{opacity:0}}@keyframes index-module_contentwrapper_slidedown__L32FG{0%{transform:translateY(-8px)}to{transform:translateY(0)}}@keyframes index-module_supercoins_slidedown__FKn-p{0%{transform:translateY(-4px)}to{transform:translateY(0)}}@keyframes index-module_island_slideDown__bo-l7{0%{transform:translateY(-10px)}to{transform:translateY(0)}}@keyframes index-module_island_slideUp__k-yM5{0%{transform:translateY(0)}to{transform:translateY(-10px)}}@keyframes index-module_expand__Slboq{0%{height:0}to{height:126px}}@keyframes index-module_compress__8Xyt-{0%{height:126px}to{height:0}}"),function(e){e[e.left=0]="left",e[e.right=1]="right"}(s||(s={}));var b=s.right;var k=function(r){var y,k,Y,N,B=r.islandStyles,q=void 0===B?"":B,S=r.superCoins,T=void 0===S?5e3:S,z=r.align,L=void 0===z?b:z,C=r.onAnimationStart,E=void 0===C?function(){}:C,F=r.onAnimationEnd,I=void 0===F?function(){}:F;y=T,k=document.querySelector(":root"),Y=45,N=100,y>99&&y<999?Y=50:y>999&&y<9999?(Y=50,N=120):y>9999&&(Y=50,N=150),null==k||k.style.setProperty("--supercoins-increment-shift_left_by","".concat(Y,"%")),null==k||k.style.setProperty("--supercoins-increment-width","".concat(N,"px"));var M=t(T-40),j=M[0],D=M[1],H=a(null);o((function(){var e;if(H.current)return null===(e=null==H?void 0:H.current)||void 0===e||e.addEventListener("animationstart",n),function(){var e;null===(e=null==H?void 0:H.current)||void 0===e||e.removeEventListener("animationstart",n)};function n(){return setInterval((function(){D((function(e){return e<T?e+1:e}))}),50)}}),[]),o((function(){E()}),[]);var Z=L===s.left?{left:0}:{right:0};return i("div",e({className:"".concat(d," ").concat(q)},{children:[n("div",{className:_}),i("div",e({style:Z,className:l},{children:[n("img",{src:"https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/floating_island_tooltip.png",className:m}),n(v,{onAnimationEnd:I}),i("div",e({className:c},{children:[n("p",e({className:u},{children:"Your SuperCoin balance"})),i("div",e({className:h},{children:[i("div",e({className:p},{children:[n("img",{src:"https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/supercoin_island.png",className:f}),n("p",e({className:x},{children:T}))]})),n("div",e({className:g},{children:i("p",e({className:w,ref:H},{children:["= ₹",j]}))}))]}))]}))]}))]}))};export{s as ISLAND_ALIGN,k as SupercoinsFloatingIsland};
|
|
2
2
|
//# sourceMappingURL=ct-platform-supercoins-floating-island.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ct-platform-supercoins-floating-island.esm.js","sources":["../packages/components/SupercoinsFloatingIsland/src/SupercoinsFloatingIsland.types.ts","../packages/components/SupercoinsFloatingIsland/src/LottieWrapper.tsx","../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/SupercoinsFloatingIsland/src/constants.ts","../packages/components/SupercoinsFloatingIsland/src/SupercoinsFloatingIsland.tsx","../packages/components/SupercoinsFloatingIsland/src/utils/setCSSVariable.ts"],"sourcesContent":[null,null,"function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null],"names":["ISLAND_ALIGN","LottieWrapper","_a","_b","onAnimationEnd","_c","useState","dotLottie","setDotLottie","useEffect","timeout","setTimeout","setFrame","play","addEventListener","clearTimeout","_jsx","DotLottieReact","src","className","styles","dotLottieRefCallback","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","DEFAULT_ISLAND_ALIGNMENT","right","SupercoinsFloatingIsland","lengthOfSupercoins","ctx","leftShiftBy","width","islandStyles","superCoins","_d","align","_e","onAnimationStart","_f","querySelector","setProperty","concat","_g","incrementSupercoin","setIncrementSupercoin","supercoinsIncrementElement","useRef","current","startIncrementing","removeEventListener","setInterval","prev","alignStyles","left","_jsxs","__assign","children"],"mappings":"iNAAYA,ogBCQY,SAAAC,EAAcC,GAClC,IAAAC,EAAAD,EAAAE,eAAAA,OAAiB,IAAAD,EAAA,WAAQ,EAAAA,EAEnBE,EAA4BC,EAA2B,MAAtDC,EAASF,EAAA,GAAEG,EAAYH,EAAA,GAmB9B,OAdAI,GAAU,WACN,GAAKF,EAAL,CACA,IAAMG,EAAUC,YAAW,WACvBJ,EAAUK,SAAS,KACnBL,EAAUM,MACb,GAAE,MAIH,OAFAN,EAAUO,iBAAiB,WAAYV,GAEhC,WACHW,aAAaL,EACjB,CAVuB,CAW3B,GAAG,CAACH,IAGAS,EAACC,EAAc,CAEXC,IAAI,
|
|
1
|
+
{"version":3,"file":"ct-platform-supercoins-floating-island.esm.js","sources":["../packages/components/SupercoinsFloatingIsland/src/SupercoinsFloatingIsland.types.ts","../packages/components/SupercoinsFloatingIsland/src/LottieWrapper.tsx","../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/SupercoinsFloatingIsland/src/constants.ts","../packages/components/SupercoinsFloatingIsland/src/SupercoinsFloatingIsland.tsx","../packages/components/SupercoinsFloatingIsland/src/utils/setCSSVariable.ts"],"sourcesContent":[null,null,"function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null],"names":["ISLAND_ALIGN","LottieWrapper","_a","_b","onAnimationEnd","_c","useState","dotLottie","setDotLottie","useEffect","timeout","setTimeout","setFrame","play","addEventListener","clearTimeout","_jsx","DotLottieReact","src","className","styles","dotLottieRefCallback","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","DEFAULT_ISLAND_ALIGNMENT","right","SupercoinsFloatingIsland","lengthOfSupercoins","ctx","leftShiftBy","width","islandStyles","superCoins","_d","align","_e","onAnimationStart","_f","querySelector","setProperty","concat","_g","incrementSupercoin","setIncrementSupercoin","supercoinsIncrementElement","useRef","current","startIncrementing","removeEventListener","setInterval","prev","alignStyles","left","_jsxs","__assign","children"],"mappings":"iNAAYA,ogBCQY,SAAAC,EAAcC,GAClC,IAAAC,EAAAD,EAAAE,eAAAA,OAAiB,IAAAD,EAAA,WAAQ,EAAAA,EAEnBE,EAA4BC,EAA2B,MAAtDC,EAASF,EAAA,GAAEG,EAAYH,EAAA,GAmB9B,OAdAI,GAAU,WACN,GAAKF,EAAL,CACA,IAAMG,EAAUC,YAAW,WACvBJ,EAAUK,SAAS,KACnBL,EAAUM,MACb,GAAE,MAIH,OAFAN,EAAUO,iBAAiB,WAAYV,GAEhC,WACHW,aAAaL,EACjB,CAVuB,CAW3B,GAAG,CAACH,IAGAS,EAACC,EAAc,CAEXC,IAAI,sFACJC,UAAWC,EACXC,qBAvBqB,SAACd,GAC1BC,EAAaD,EACjB,GAwBJ,ECtCA,SAAqBe,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,6sHFzBA,SAAYtB,GACRA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,MAAA,GAAA,OACH,CAHD,CAAYA,IAAAA,EAGX,CAAA,IGDM,IACMqC,EAA2BrC,EAAasC,MCW/C,IAAAC,EAA2B,SAACrC,GAC9B,ICfmCsC,EAC7BC,EACFC,EACAC,EDYJxC,EAAAD,EAAA0C,aAAAA,OAAe,IAAAzC,EAAA,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AAKG,UAAWC,IAChB8C,WAAKtC,MAAOoC,EAAa7C,UAAWC,GAAgB,CAAAgD,SAAA,CAChDpD,EACI,MAAA,CAAAE,IAAI,mHACJC,UAAWC,IAEfJ,EAACf,GAAcG,eAAgBA,IAC/B8D,EAAA,MAAAC,EAAA,CAAKhD,UAAWC,GAAyB,CAAAgD,SAAA,CACrCpD,SAAGG,UAAWC,GAAiB,CAAAgD,SDnE5B,4BCoEHF,EAAA,MAAAC,EAAA,CAAKhD,UAAWC,GAAsC,CAAAgD,SAAA,CAClDF,EAAK,MAAAC,EAAA,CAAAhD,UAAWC,GACZ,CAAAgD,SAAA,CAAApD,EAAA,MAAA,CACIE,IAAI,4GACJC,UAAWC,IAEfJ,EAAG,IAAAmD,EAAA,CAAAhD,UAAWC,GAAuB,CAAAgD,SAAAvB,SAEzC7B,EAAK,MAAAmD,EAAA,CAAAhD,UAAWC,GAAsC,CAAAgD,SAClDF,SACI/C,UAAWC,EACXG,IAAKkC,GAA0B,CAAAW,SAAA,CAAA,MAE3Bb,wBAQpC","x_google_ignoreList":[2]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleartrip/ct-platform-supercoins-floating-island",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.3",
|
|
4
4
|
"description": "SuperCoins Floating Island Component",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/ct-platform-supercoins-floating-island.cjs.js",
|