@momo-webplatform/mobase 0.2.96 → 0.2.97
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/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -321,7 +321,7 @@ import*as Wo from"react";import{ChevronDownIcon as Zm}from"@heroicons/react/20/s
|
|
|
321
321
|
.animate-caret-blink {
|
|
322
322
|
animation: caret-blink 1.25s ease-out infinite;
|
|
323
323
|
}
|
|
324
|
-
`})]})]})});bm.displayName="InputOTPSlot";var ym=go.forwardRef(({...e},o)=>Bo("div",{ref:o,role:"separator",...e,children:Bo(W0,{className:"text-gray-400"})}));ym.displayName="InputOTPSeparator";import{useEffect as Cm,useRef as ev,useState as Rm}from"react";import{toPng as tv}from"html-to-image";import wa from"react";import{LucideMessageCircleQuestion as X0}from"lucide-react";import{QRCodeSVG as Y0}from"qrcode.react";async function wm(e){return new Promise((o,t)=>{let a=new window.Image;a.crossOrigin="Anonymous",a.onload=function(){let r=document.createElement("canvas");r.width=a.width,r.height=a.height;let n=r.getContext("2d");if(!n){t("Kh\xF4ng l\u1EA5y \u0111\u01B0\u1EE3c context c\u1EE7a canvas");return}n.drawImage(a,0,0);let s=r.toDataURL("image/png");o(s)},a.onerror=function(r){t(r)},a.src=e})}import $0 from"html-react-parser";import{Fragment as U0,jsx as se,jsxs as Ye}from"react/jsx-runtime";var G0=()=>{let e=[{text:"Ng\u01B0\u1EDDi d\xF9ng l\u01B0u m\xE3 QR v\u1EC1 m\xE1y (nh\u1EA5n gi\u1EEF \u1EA3nh ho\u1EB7c ch\u1EE5p m\xE0n h\xECnh)."},{text:"M\u1EDF \u1EE9ng d\u1EE5ng Ng\xE2n h\xE0ng ho\u1EB7c V\xED \u0111i\u1EC7n t\u1EED"},{text:'Trong app, ch\u1ECDn ch\u1EE9c n\u0103ng "Qu\xE9t QR" (th\u01B0\u1EDDng l\xE0 bi\u1EC3u t\u01B0\u1EE3ng camera/scan) \u0111\u1EC3 t\u1EA3i \u1EA3nh QR \u0111\xE3 l\u01B0u v\u1EC1'},{text:'"Ch\u1ECDn \u1EA3nh t\u1EEB th\u01B0 vi\u1EC7n" / "T\u1EA3i \u1EA3nh QR" ch\u1ECDn \u1EA3nh QR \u0111\xE3 l\u01B0u v\u1EC1'}];return se("ul",{className:"grid grid-cols-1 gap-y-6 -ml-3 list-decimal md:hidden",children:e.map((o,t)=>Ye("li",{className:"flex relative gap-4 items-center",children:[se("div",{className:"flex relative z-20 flex-shrink-0 justify-center items-center w-8 h-8 text-sm font-semibold text-gray-700 bg-gray-100 rounded-full",children:t+1}),Ye("div",{className:"flex flex-1 gap-2 items-start",children:[se("p",{className:"text-sm leading-relaxed text-gray-700",children:$0(o.text)}),t<e.length-1&&se("div",{className:"absolute left-4 top-8 w-px h-12 bg-gray-400 transform -translate-x-1/2"})]})]},t))})},j0=({isQrForAll:e,shortTitle:o,className:t})=>Ye("div",{className:`hidden grid-cols-1 gap-y-6 py-8 text-sm md:grid ${t}`,children:[Ye("div",{className:"flex flex-nowrap items-start",children:[se("div",{className:"relative aspect-[2/3] flex-none overflow-hidden",children:se("img",{className:"w-20",loading:"lazy",src:"https://homepage.momocdn.net/images/s/momo-upload-api-200917091602-637359309621891617.png",alt:"Step 1"})}),Ye("div",{className:"flex-1 pl-4",children:[se("div",{className:"font-semibold text-gray-800 step",children:"B\u01B0\u1EDBc 1 :"}),se("div",{className:"mt-1 text-gray-500",children:e?"M\u1EDF app MoMo ho\u1EB7c \u1EE9ng d\u1EE5ng ng\xE2n h\xE0ng/v\xED \u0111i\u1EC7n t\u1EED ch\u1EA5p nh\u1EADn m\xE3 v\u1EA1ch t\u1EEB QR \u0110a N\u0103ng":"M\u1EDF \u1EE9ng d\u1EE5ng camera m\u1EB7c \u0111\u1ECBnh ho\u1EB7c \u1EE9ng d\u1EE5ng h\u1ED7 tr\u1EE3 QR code c\u1EE7a b\u1EA1n"})]})]}),Ye("div",{className:"flex flex-nowrap items-center",children:[se("div",{className:"relative aspect-[2/3] flex-none overflow-hidden",children:se("img",{className:"w-20",loading:"lazy",src:"https://homepage.momocdn.net/images/s/momo-upload-api-200917091443-637359308837905996.png",alt:"Step 2"})}),Ye("div",{className:"flex-1 pl-4",children:[se("div",{className:"font-semibold text-gray-800 step",children:"B\u01B0\u1EDBc 2 :"}),se("div",{className:"mt-1 text-gray-500",children:"Qu\xE9t m\xE3 QR Code theo h\xECnh b\xEAn ph\u1EA3i"})]})]}),Ye("div",{className:"flex flex-nowrap items-center",children:[se("div",{className:"relative aspect-[2/3] flex-none overflow-hidden",children:se("img",{className:"w-20",loading:"lazy",src:"https://homepage.momocdn.net/images/s/momo-upload-api-200917090146-637359301062519803.png",alt:"Step 3"})}),Ye("div",{className:"flex-1 pl-4",children:[se("div",{className:"font-semibold text-gray-800 step",children:"B\u01B0\u1EDBc 3 :"}),Ye("div",{className:"mt-1 text-gray-500",children:["B\u1EA5m v\xE0o th\xF4ng b\xE1o hi\u1EC3n th\u1ECB \u0111\u1EC3 t\u1EA3i \u1EE9ng d\u1EE5ng ho\u1EB7c ",o||"Truy c\u1EADp ngay"]})]})]})]}),Q0=({isQrForAll:e=!1,shortTitle:o,className:t=""})=>Ye(U0,{children:[se(j0,{isQrForAll:e,shortTitle:o,className:t}),se(G0,{})]}),Hi=Q0;import{jsx as ya,jsxs as Nm}from"react/jsx-runtime";var q0=({children:e,title:o="H\u01B0\u1EDBng d\u1EABn thanh to\xE1n",isQrForAll:t=!1,shortTitle:a,open:r,onOpenChange:n})=>Nm(We,{open:r,onOpenChange:n,children:[ya(Go,{asChild:!0,children:e}),Nm(Le,{position:"bottom",children:[ya(xo,{children:ya(bo,{children:o})}),ya(Je,{children:ya(Hi,{isQrForAll:t,shortTitle:a})})]})]}),_i=q0;import{Fragment as hr,jsx as T,jsxs as ce}from"react/jsx-runtime";var Z0=({img:e="",children:o,isQrForAll:t,onQrLoaded:a,dateExpired:r,priceOrder:n})=>ce(hr,{children:[ce("div",{className:"relative select-none
|
|
324
|
+
`})]})]})});bm.displayName="InputOTPSlot";var ym=go.forwardRef(({...e},o)=>Bo("div",{ref:o,role:"separator",...e,children:Bo(W0,{className:"text-gray-400"})}));ym.displayName="InputOTPSeparator";import{useEffect as Cm,useRef as ev,useState as Rm}from"react";import{toPng as tv}from"html-to-image";import wa from"react";import{LucideMessageCircleQuestion as X0}from"lucide-react";import{QRCodeSVG as Y0}from"qrcode.react";async function wm(e){return new Promise((o,t)=>{let a=new window.Image;a.crossOrigin="Anonymous",a.onload=function(){let r=document.createElement("canvas");r.width=a.width,r.height=a.height;let n=r.getContext("2d");if(!n){t("Kh\xF4ng l\u1EA5y \u0111\u01B0\u1EE3c context c\u1EE7a canvas");return}n.drawImage(a,0,0);let s=r.toDataURL("image/png");o(s)},a.onerror=function(r){t(r)},a.src=e})}import $0 from"html-react-parser";import{Fragment as U0,jsx as se,jsxs as Ye}from"react/jsx-runtime";var G0=()=>{let e=[{text:"Ng\u01B0\u1EDDi d\xF9ng l\u01B0u m\xE3 QR v\u1EC1 m\xE1y (nh\u1EA5n gi\u1EEF \u1EA3nh ho\u1EB7c ch\u1EE5p m\xE0n h\xECnh)."},{text:"M\u1EDF \u1EE9ng d\u1EE5ng Ng\xE2n h\xE0ng ho\u1EB7c V\xED \u0111i\u1EC7n t\u1EED"},{text:'Trong app, ch\u1ECDn ch\u1EE9c n\u0103ng "Qu\xE9t QR" (th\u01B0\u1EDDng l\xE0 bi\u1EC3u t\u01B0\u1EE3ng camera/scan) \u0111\u1EC3 t\u1EA3i \u1EA3nh QR \u0111\xE3 l\u01B0u v\u1EC1'},{text:'"Ch\u1ECDn \u1EA3nh t\u1EEB th\u01B0 vi\u1EC7n" / "T\u1EA3i \u1EA3nh QR" ch\u1ECDn \u1EA3nh QR \u0111\xE3 l\u01B0u v\u1EC1'}];return se("ul",{className:"grid grid-cols-1 gap-y-6 -ml-3 list-decimal md:hidden",children:e.map((o,t)=>Ye("li",{className:"flex relative gap-4 items-center",children:[se("div",{className:"flex relative z-20 flex-shrink-0 justify-center items-center w-8 h-8 text-sm font-semibold text-gray-700 bg-gray-100 rounded-full",children:t+1}),Ye("div",{className:"flex flex-1 gap-2 items-start",children:[se("p",{className:"text-sm leading-relaxed text-gray-700",children:$0(o.text)}),t<e.length-1&&se("div",{className:"absolute left-4 top-8 w-px h-12 bg-gray-400 transform -translate-x-1/2"})]})]},t))})},j0=({isQrForAll:e,shortTitle:o,className:t})=>Ye("div",{className:`hidden grid-cols-1 gap-y-6 py-8 text-sm md:grid ${t}`,children:[Ye("div",{className:"flex flex-nowrap items-start",children:[se("div",{className:"relative aspect-[2/3] flex-none overflow-hidden",children:se("img",{className:"w-20",loading:"lazy",src:"https://homepage.momocdn.net/images/s/momo-upload-api-200917091602-637359309621891617.png",alt:"Step 1"})}),Ye("div",{className:"flex-1 pl-4",children:[se("div",{className:"font-semibold text-gray-800 step",children:"B\u01B0\u1EDBc 1 :"}),se("div",{className:"mt-1 text-gray-500",children:e?"M\u1EDF app MoMo ho\u1EB7c \u1EE9ng d\u1EE5ng ng\xE2n h\xE0ng/v\xED \u0111i\u1EC7n t\u1EED ch\u1EA5p nh\u1EADn m\xE3 v\u1EA1ch t\u1EEB QR \u0110a N\u0103ng":"M\u1EDF \u1EE9ng d\u1EE5ng camera m\u1EB7c \u0111\u1ECBnh ho\u1EB7c \u1EE9ng d\u1EE5ng h\u1ED7 tr\u1EE3 QR code c\u1EE7a b\u1EA1n"})]})]}),Ye("div",{className:"flex flex-nowrap items-center",children:[se("div",{className:"relative aspect-[2/3] flex-none overflow-hidden",children:se("img",{className:"w-20",loading:"lazy",src:"https://homepage.momocdn.net/images/s/momo-upload-api-200917091443-637359308837905996.png",alt:"Step 2"})}),Ye("div",{className:"flex-1 pl-4",children:[se("div",{className:"font-semibold text-gray-800 step",children:"B\u01B0\u1EDBc 2 :"}),se("div",{className:"mt-1 text-gray-500",children:"Qu\xE9t m\xE3 QR Code theo h\xECnh b\xEAn ph\u1EA3i"})]})]}),Ye("div",{className:"flex flex-nowrap items-center",children:[se("div",{className:"relative aspect-[2/3] flex-none overflow-hidden",children:se("img",{className:"w-20",loading:"lazy",src:"https://homepage.momocdn.net/images/s/momo-upload-api-200917090146-637359301062519803.png",alt:"Step 3"})}),Ye("div",{className:"flex-1 pl-4",children:[se("div",{className:"font-semibold text-gray-800 step",children:"B\u01B0\u1EDBc 3 :"}),Ye("div",{className:"mt-1 text-gray-500",children:["B\u1EA5m v\xE0o th\xF4ng b\xE1o hi\u1EC3n th\u1ECB \u0111\u1EC3 t\u1EA3i \u1EE9ng d\u1EE5ng ho\u1EB7c ",o||"Truy c\u1EADp ngay"]})]})]})]}),Q0=({isQrForAll:e=!1,shortTitle:o,className:t=""})=>Ye(U0,{children:[se(j0,{isQrForAll:e,shortTitle:o,className:t}),se(G0,{})]}),Hi=Q0;import{jsx as ya,jsxs as Nm}from"react/jsx-runtime";var q0=({children:e,title:o="H\u01B0\u1EDBng d\u1EABn thanh to\xE1n",isQrForAll:t=!1,shortTitle:a,open:r,onOpenChange:n})=>Nm(We,{open:r,onOpenChange:n,children:[ya(Go,{asChild:!0,children:e}),Nm(Le,{position:"bottom",children:[ya(xo,{children:ya(bo,{children:o})}),ya(Je,{children:ya(Hi,{isQrForAll:t,shortTitle:a})})]})]}),_i=q0;import{Fragment as hr,jsx as T,jsxs as ce}from"react/jsx-runtime";var Z0=({img:e="",children:o,isQrForAll:t,onQrLoaded:a,dateExpired:r,priceOrder:n})=>ce(hr,{children:[ce("div",{className:"qrcode__scan__container relative select-none",children:[ce("div",{className:"flex w-full items-center justify-center space-x-2 md:hidden",children:[T("img",{src:"https://homepage.momocdn.net/pwa/images/logoMomox50.png",width:28,height:28,alt:"QR all",className:"shrink-0 select-none"}),T("div",{className:"h-[14px] w-[2px] shrink-0 select-none bg-gray-200"}),T("img",{src:"https://homepage.momocdn.net/img/momo-amazone-s3-api-250711102030-638878260300337990.png",width:56,height:25,alt:"QR all",className:"shrink-0 select-none"})]}),ce("div",{className:"qrcode__scan select-none",children:[T("div",{className:"qrcode__gradient invisible select-none opacity-0 md:visible md:opacity-100",children:T("img",{alt:"step 1",className:"img-fluid",src:"https://homepage.momocdn.net/jk/momo2020/img/qrcode/qrcode-gradient.png"})}),T("div",{className:"qrcode__border invisible select-none opacity-0 md:visible md:opacity-100",children:T("img",{alt:"step 2",className:"img-fluid",src:"https://homepage.momocdn.net/jk/momo2020/img/qrcode/border-qrcode.svg"})}),T("div",{className:"qrcode__image select-none p-4",children:e?T("img",{alt:"step 3",className:"img-fluid d-block mx-auto",src:e,loading:"lazy",onLoad:a}):wa.Children.map(o,s=>(wa.isValidElement(s),s))})]}),n&&ce("div",{className:"text-sm text-gray-900 md:hidden",children:[T("div",{className:"",children:"Th\xF4ng tin thanh to\xE1n"}),T("div",{className:"text-base font-bold text-gray-900",children:n})]})]}),r&&ce("div",{className:i("mt-3 text-sm text-gray-900 md:hidden"),children:[T("span",{children:"M\xE3 h\u1EBFt h\u1EA1n v\xE0o: "}),T("span",{className:"font-semibold",children:r})]}),T("div",{className:"mt-4 hidden text-sm font-semibold text-gray-900 md:block",children:t?ce(hr,{children:[T("img",{src:"https://homepage.momocdn.net/img/momo-amazone-s3-api-250710143736-638877550567721225.png",width:220,height:28,className:"mx-auto",alt:"QR all"}),T("div",{className:"mt-3",children:"Nh\u1EADn ti\u1EC1n t\u1EEB m\u1ECDi V\xED \u0110i\u1EC7n T\u1EED v\xE0 Ng\xE2n H\xE0ng"})]}):ce(hr,{children:[T("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mr-1 inline h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:T("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M16 20h4M4 12h4m12 0h.01M5 8h2a1 1 0 001-1V5a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1zm12 0h2a1 1 0 001-1V5a1 1 0 00-1-1h-2a1 1 0 00-1 1v2a1 1 0 001 1zM5 20h2a1 1 0 001-1v-2a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1z"})}),"S\u1EED d\u1EE5ng App MoMo ho\u1EB7c",T("br",{}),"\u1EE9ng d\u1EE5ng Camera h\u1ED7 tr\u1EE3 QR code \u0111\u1EC3 qu\xE9t m\xE3."]})})]}),K0=({img:e="",children:o,isQrForAll:t,onQrLoaded:a,dateExpired:r,priceOrder:n,className:s=""})=>ce(hr,{children:[T("div",{className:i(s),children:T(Z0,{dateExpired:r,priceOrder:n,img:e,isQrForAll:t,onQrLoaded:a,children:o})}),T("style",{children:`
|
|
325
325
|
.qrcode__scan__container {
|
|
326
326
|
padding: 15px;
|
|
327
327
|
background-color: white;
|
|
@@ -389,7 +389,7 @@ import*as Wo from"react";import{ChevronDownIcon as Zm}from"@heroicons/react/20/s
|
|
|
389
389
|
transform: translate3d(0, 30%, 0);
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
`})]}),J0=({isQrForAll:e,qrImage:o,qrLink:t,logoQr:a="https://homepage.momocdn.net/img/momo-upload-api-231211171009-638379114093056419.png",expired:r,loading:n,onQrLoaded:s,qrImageBase64:l,qrCodeRef:m,dateExpired:c,priceOrder:d,titleOrder:p})=>{let[g,v]=wa.useState(void 0);return wa.useEffect(()=>{a?wm(a).then(v).catch(()=>v(void 0)):v(void 0)},[a]),wa.useEffect(()=>{t&&g&&typeof s=="function"&&!o&&s()},[t,g,s,o]),ce("div",{className:"relative z-[1]
|
|
392
|
+
`})]}),J0=({isQrForAll:e,qrImage:o,qrLink:t,logoQr:a="https://homepage.momocdn.net/img/momo-upload-api-231211171009-638379114093056419.png",expired:r,loading:n,onQrLoaded:s,qrImageBase64:l,qrCodeRef:m,dateExpired:c,priceOrder:d,titleOrder:p})=>{let[g,v]=wa.useState(void 0);return wa.useEffect(()=>{a?wm(a).then(v).catch(()=>v(void 0)):v(void 0)},[a]),wa.useEffect(()=>{t&&g&&typeof s=="function"&&!o&&s()},[t,g,s,o]),ce("div",{className:"relative z-[1]",children:[ce("div",{className:"relative z-[1] bg-pink-50 bg-repeat-y px-5 py-6 text-center",style:{backgroundImage:"url(https://homepage.momocdn.net/img/momo-amazone-s3-api-250714113823-638880899039487085.png) ",backgroundPosition:"right bottom",backgroundSize:"auto 30px"},ref:m,children:[T("img",{className:"pointer-events-none absolute right-6 top-14 hidden select-none md:flex",src:"https://homepage.momocdn.net/img/momo-amazone-s3-api-250821154232-638913877527374430.png",alt:"pattern-qr"}),T("div",{className:i("mb-2 hidden text-base font-bold text-gray-900 md:block",l&&"opacity-0 md:opacity-100"),children:p||"Qu\xE9t QR \u0111\u1EC3 thanh to\xE1n"}),l&&T("div",{className:"visible absolute left-0 right-0 top-0 z-20 h-full w-full cursor-pointer overflow-hidden opacity-100 md:hidden md:select-none",children:T("img",{src:l,alt:"QR Code",className:"absolute left-1/2 top-1/2 max-h-full max-w-none -translate-x-1/2 -translate-y-1/2"})}),ce(K0,{img:o,isQrForAll:e,onQrLoaded:s,dateExpired:c,priceOrder:d,children:[t&&g&&!o&&T(Y0,{value:t,size:215,imageSettings:{src:`${g}`,height:40,width:40,excavate:!0},level:"H"}),r&&T("div",{className:"absolute inset-0 z-10 flex size-full flex-col items-center justify-center bg-white/90",children:T("span",{className:"text-lg font-bold text-pink-600",children:"QR Code \u0111\xE3 h\u1EBFt h\u1EA1n"})}),n&&T("div",{className:"absolute inset-0 z-10 flex size-full flex-col items-center justify-center bg-white/90",children:T(li,{size:"lg"})})]})]}),ce("div",{className:"qrcode__guide relative z-10 select-none bg-pink-50 bg-repeat-y px-5 pb-5 text-center",style:{backgroundImage:"url(https://homepage.momocdn.net/img/momo-amazone-s3-api-250714113823-638880899039487085.png) ",backgroundPosition:"right top",backgroundSize:"auto 30px"},children:[ce("div",{className:i("qrcode__guide absolute -top-24 right-20 z-50 cursor-pointer select-none md:opacity-0",l&&"opacity-100 md:opacity-0"),children:[ce("div",{className:"ripple size-5 rounded-full",children:[T("div",{className:"ripple-1"}),T("div",{className:"ripple-2"})]}),T("img",{className:"qrcode__hand relative z-10 -mt-1 size-7 select-none object-contain drop-shadow-lg",src:"https://homepage.momocdn.net/img/momo-amazone-s3-api-250714154408-638881046482607959.png",alt:"Momo Hand Icon"})]}),T("div",{className:"mb-2 text-sm font-semibold text-pink-600 md:hidden",children:"Nh\u1EA5n gi\u1EEF QR \u0111\u1EC3 l\u01B0u"}),T(_i,{isQrForAll:!0,shortTitle:"Thanh to\xE1n ngay",title:"H\u01B0\u1EDBng d\u1EABn thanh to\xE1n QR",children:ce("div",{className:"flex cursor-pointer items-center justify-center space-x-1 text-center text-sm font-semibold text-pink-600",children:[T("div",{children:"H\u01B0\u1EDBng d\u1EABn thanh to\xE1n"})," ",T(X0,{className:"size-4"})," "]})}),T("style",{children:`
|
|
393
393
|
.ripple {
|
|
394
394
|
box-sizing: border-box;
|
|
395
395
|
position: relative;
|