@tap-payments/os-micro-frontend-shared 0.3.280-test.1794306071 → 0.3.281

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.
@@ -0,0 +1 @@
1
+ import {nc}from'./chunk-Z2DUFVI5.js';import {forwardRef,useState,useCallback,memo}from'react';import m from'@mui/material/Box';import {styled}from'@mui/material/styles';import {motion}from'framer-motion';import {jsx,jsxs}from'react/jsx-runtime';var o="os-shared-FlipCard",t={root:`${o}-root`,container:`${o}-container`,inner:`${o}-inner`,front:`${o}-front`,back:`${o}-back`,faceContent:`${o}-faceContent`},h=.3;var D=styled(m,{shouldForwardProp:e=>e!=="$interactive"})(({$interactive:e})=>({width:"100%",height:"100%",cursor:e?"pointer":void 0})),I=styled(m)(()=>({width:"inherit",height:"inherit",perspective:"1000px"})),b=styled(motion.div)(()=>({width:"100%",height:"100%",position:"relative",transformStyle:"preserve-3d"})),u=styled(m,{shouldForwardProp:e=>e!=="$side"&&e!=="$direction"})(({$side:e,$direction:y})=>({position:"absolute",backfaceVisibility:"hidden",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",...e==="back"&&{transform:y==="vertical"?"rotateX(180deg)":"rotateY(180deg)"}})),v=styled(m)(()=>({width:"100%",height:"100%"}));var T=forwardRef(function({front:y,back:w,isFlipped:S,defaultFlipped:L=false,onFlip:N,direction:s="horizontal",trigger:P,duration:A=h,disabled:a=false,id:k,className:R,sx:l,"data-testid":M,...c},U){let p=S!==void 0,r=P??(p?void 0:"click"),[_,K]=useState(L),C=p?S:_,f=useCallback(i=>{a||(p||K(i),N?.(i));},[a,p,N]),$=useCallback(()=>{f(!C);},[C,f]),O=()=>{r==="click"&&$();},H=()=>{r==="hover"&&f(true);},X=()=>{r==="hover"&&f(false);},F=!a&&r==="click",Y=i=>{F&&(i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),$()));},g=C?180:0,j=s==="vertical"?{rotateX:g}:{rotateY:g},z=!a&&(r==="click"||r==="hover"),B=a?[{pointerEvents:"none",opacity:.6},...Array.isArray(l)?l:l?[l]:[]]:l;return jsx(D,{...c,ref:U,id:k,"data-testid":M??k??"FlipCard","data-direction":s,className:nc(t.root,R),$interactive:z,role:F?"button":c.role,tabIndex:F?a?-1:0:c.tabIndex,"aria-pressed":F?C:c["aria-pressed"],onClick:O,onKeyDown:Y,onMouseEnter:r==="hover"?H:void 0,onMouseLeave:r==="hover"?X:void 0,sx:B,children:jsx(I,{className:t.container,children:jsxs(b,{className:t.inner,animate:j,transition:{duration:A},children:[jsx(u,{className:t.front,$side:"front",$direction:s,children:jsx(v,{className:t.faceContent,children:y})}),jsx(u,{className:t.back,$side:"back",$direction:s,children:jsx(v,{className:t.faceContent,children:w})})]})})})});T.displayName="FlipCard";var Q=memo(T);export{o as a,t as b,h as c,Q as d};
@@ -0,0 +1 @@
1
+ import {d,r}from'./chunk-CAVYK7HF.js';import {mc,nc}from'./chunk-Z2DUFVI5.js';import {Td,Ye}from'./chunk-3M2GZVQW.js';import {forwardRef,useState,useMemo,useCallback,memo}from'react';import {styled}from'@mui/material/styles';import {jsx,Fragment}from'react/jsx-runtime';var S="os-shared-Logo",n={root:`${S}-root`,skeleton:`${S}-skeleton`},C="logo";var R=styled(d)(({theme:s})=>({borderRadius:"50%",backgroundColor:s.palette.common.white}));var I=forwardRef(({className:s,sx:f,id:a,src:o,width:g=24,height:d=24,isError:E,isLoading:P,fallback:e,onError:u,alt:U=C},v)=>{let[w,H]=useState(),m=useMemo(()=>typeof o!="string"&&!!o?.type?.includes("application/pdf"),[o]),t=useMemo(()=>o?typeof o=="string"?o:(window.URL?URL:webkitURL).createObjectURL(o):"",[o]),r$1=E||!!t&&w===t,M=useMemo(()=>r$1||!o?typeof e=="string"&&e?e:Td:m?Ye:t,[o,e,r$1,m,t]),h=useCallback(j=>{H(t),u?.(j);},[t,u]);return P?jsx(r,{variant:"circular",className:n.skeleton,sx:mc({width:g,height:d,flexShrink:0},f),"data-testid":a??"Logo"}):(r$1||!o)&&e!==void 0&&typeof e!="string"?jsx(Fragment,{children:e}):jsx(R,{ref:v,id:a,"data-testid":a??"Logo",alt:U,src:M,onError:h,className:nc(n.root,s),sx:mc({width:g,height:d,objectFit:m&&o&&!r$1?"none":"contain"},f)})});I.displayName="Logo";var $=memo(I);export{n as a,$ as b};