@edgex-web/components 0.2.0-beta.21 → 0.2.0-beta.22

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/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { o as e, C as i, D as t, n, p as r, L as p, o as d, S as L, T as h, W as D, y as g, r as u, A as w, h as W, w as C, G as m, q as E, z as A, v as O, F as T, t as M, E as S, u as l, j as f, x as P, m as _, k as c, I as v } from "./index-geNBCKUf.mjs";
1
+ import { o as e, C as i, D as t, n, p as r, L as p, o as d, S as L, T as h, W as D, y as g, r as u, A as w, h as W, w as C, G as m, q as E, z as A, v as O, F as T, t as M, E as S, u as l, j as f, x as P, m as _, k as c, I as v } from "./index-BRTnkVLg.mjs";
2
2
  import "react";
3
3
  export {
4
4
  e as ChromeLoader,
package/dist/index.umd.js CHANGED
@@ -145,7 +145,7 @@ ${dg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
145
145
  ${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
146
146
  ${u?"ring-1 ring-white":""}
147
147
  `,children:[k.jsx("span",{className:"text-sm leading-[18px] font-medium",children:c("deposit.asset")}),k.jsxs("div",{className:"flex items-center space-x-2",children:[k.jsx("img",{src:t.iconUrl,alt:a(t),className:"w-4 h-4 rounded-full"}),k.jsx("span",{className:"text-sm text-white ml-1",children:a(t)}),k.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${u?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[k.jsx("g",{clipPath:"url(#clip0_asset_selector)",children:k.jsx("path",{d:"M5.32733 7.6716C5.13944 7.83432 4.86056 7.83432 4.67267 7.6716L1.68366 5.08304C1.33371 4.77997 1.54804 4.20508 2.01099 4.20508L7.98901 4.20508C8.45196 4.20508 8.66629 4.77998 8.31634 5.08304L5.32733 7.6716Z",fill:"#F9F9F9"})}),k.jsx("defs",{children:k.jsx("clipPath",{id:"clip0_asset_selector",children:k.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),k.jsx(nu,{as:x.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:k.jsx(mt.Options,{className:`
148
- absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
148
+ absolute z-50 mt-1 w-full max-h-[230px] overflow-y-auto rounded-lg
149
149
  bg-fill-input-primary border border-line-divider-secondary shadow-lg
150
150
  focus:outline-none
151
151
  `,children:e.map(l=>k.jsx(mt.Option,{value:l,className:({active:f,selected:p})=>`relative cursor-pointer select-none py-3 px-3 ${p?"bg-fill-btn-secondary":f?"bg-fill-input-secondary":""}`,children:({selected:f,active:p})=>k.jsxs("div",{className:"flex items-center space-x-3",children:[k.jsx("img",{src:l.iconUrl,alt:a(l),className:"w-5 h-5 rounded-full"}),k.jsxs("div",{className:"flex flex-col",children:[k.jsx("span",{className:`text-sm font-medium ${f||p?"text-text-primary":"text-text-tertiary"}`,children:a(l)}),s===xn&&i==="perpetual"&&l.token==="USDC"&&k.jsx("p",{className:"mt-2 text-xs text-text-tertiary whitespace-pre-line",children:c("deposit.defaultSpotNotice")})]})]})},a(l)))})})]})})})},Eh=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,walletType:s=xn,txType:i="deposit",accountType:c})=>{const a=x.useCallback(w=>i==="withdraw"?s===xn?w.allowAaWithdraw!==!1:w.allowWithdraw!==!1:s===xn?w.allowAaDeposit!==!1:w.allowDeposit!==!1,[i,s]),u=x.useMemo(()=>{const w=new Set,$=[];for(const E of t)if(a(E))for(const S of E.tokenList||[]){const N=S.symbol||S.token;!N||!(i!=="withdraw"||S.withdrawEnable===!0&&S.pullOff===!1)||w.has(N)||(w.add(N),$.push({token:N,symbol:N,iconUrl:S.iconUrl,decimals:S.decimals,tokenAddress:S.tokenAddress}))}return $},[t,a,i]),l=w=>{n(w.chainId)},f=w=>{const $=w.symbol||w.token;o($);const E=[];for(const S of t){if(!a(S))continue;(S.tokenList||[]).some(B=>(B.symbol||B.token)===$)&&E.push(S.chainId)}!E.includes(e.chainId)&&E[0]!==void 0&&n(E[0])},p=x.useMemo(()=>{var E,S;const w=r||((E=u[0])==null?void 0:E.symbol)||((S=u[0])==null?void 0:S.token);if(!w)return[];const $=[];for(const N of t){if(!a(N))continue;const B=(N.tokenList||[]).find(F=>(F.symbol||F.token)===w?i==="withdraw"?F.withdrawEnable===!0&&F.pullOff===!1:!0:!1);B&&$.push({...N,tokenList:[{token:B.token,symbol:B.symbol,iconUrl:B.iconUrl,decimals:B.decimals,tokenAddress:B.tokenAddress}]})}return $},[t,r,u,a,i]),d=x.useMemo(()=>p.find(w=>w.chainId===e.chainId)||p[0],[p,e.chainId]),h=x.useMemo(()=>u,[u]),m=x.useMemo(()=>{if(h.length!==0)return h.find(w=>w.token===r||w.symbol===r)||h[0]},[h,r]);return x.useEffect(()=>{if(h.length===0)return;if(!h.some($=>($.symbol||$.token)===r)){const $=h[0];o($.symbol||$.token)}},[h,r,o]),x.useEffect(()=>{if(p.length===0)return;p.some($=>$.chainId===e.chainId)||n(p[0].chainId)},[p,e.chainId,n]),k.jsxs("div",{className:"space-y-4",children:[h.length>0&&m&&k.jsx(s3,{tokens:h,selectedToken:m,onTokenChange:f,walletType:s,accountType:c}),k.jsx(o3,{chains:p,selectedChain:d,onChainChange:w=>{const $=t.find(E=>E.chainId===w.chainId);$&&l($)},walletType:s,className:"w-full"})]})},i3=({options:e})=>k.jsx(k.Fragment,{children:e.map(t=>k.jsx(mt.Option,{value:t.value,className:({active:n,selected:r})=>`relative cursor-pointer select-none py-3 px-3 ${r?"bg-fill-btn-secondary":n?"bg-fill-input-secondary":""}`,children:({selected:n,active:r})=>k.jsx("div",{className:"flex items-center justify-between",children:k.jsx("div",{className:"flex items-center space-x-3",children:k.jsx("div",{className:"flex flex-col",children:k.jsx("span",{className:`text-sm font-medium ${n||r?"text-text-primary":"text-text-tertiary"}`,children:t.label})})})})},t.value))}),Sh=({selectedAccount:e,onAccountChange:t,disabled:n=!1,className:r=""})=>{var f;const{t:o}=vt(),s=x.useMemo(()=>[{value:"spot",label:o("account.spot")},{value:"perpetual",label:o("account.perpetual")}],[o]),i=((f=s.find(p=>p.value===(e??"spot")))==null?void 0:f.label)||"",[c,a]=x.useState(e??"spot"),u=e??c,l=p=>{t==null||t(p),e||a(p)};return k.jsx("div",{className:`relative mb-4 ${r}`,children:k.jsx(mt,{value:u,onChange:l,disabled:n,children:({open:p})=>k.jsxs(k.Fragment,{children:[k.jsxs(mt.Button,{className:`