@vellumlabs/cexplorer-sdk 1.1.26 → 1.2.1
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/screenDropdown/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/screenDropdown/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAA+C,MAAM,OAAO,CAAC;AAGpE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;;;;;;;;;;;;OAcG;IACH,OAAO,EAAE,gBAAgB,CAAC;IAE1B;;;;;OAKG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA6LxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useDropdownState as r}from"../../stores/dropdownState.js";import{generateUrlWithParams as a}from"../../utils/generateUrlWithParams.js";import{Link as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useDropdownState as r}from"../../stores/dropdownState.js";import{generateUrlWithParams as a}from"../../utils/generateUrlWithParams.js";import{Link as n}from"@tanstack/react-router";import{ChevronDown as o}from"lucide-react";import l,{useState as s,useLayoutEffect as i,useEffect as c}from"react";import{createPortal as m}from"react-dom";const d=({id:d,label:u,options:p,hideChevron:f=!1,triggerClassName:x,wrapperClassname:b,disableHover:h=!1,closeOnSelect:v=!1,card:g})=>{const{openId:N,setOpenId:w}=r(),[y,C]=s(!1),[j,M]=s(!1),[R,k]=s(!1),[T,z]=s(0),B=l.createRef(),E=l.createRef(),H=l.createRef();let L;const O=()=>{h||j||(L=setTimeout(()=>{C(!1)},200))},I=()=>{h||(clearTimeout(L),k(!0),setTimeout(()=>{k(!1)},300),C(!0),N!==d&&w(d))};return i(()=>{y&&(()=>{if(!B.current)return;const e=B.current.closest("nav");if(e){const t=e.getBoundingClientRect();z(t.bottom)}else{const e=B.current.getBoundingClientRect();z(e.bottom)}})()},[y]),c(()=>{const e=new AbortController,t=e.signal;return y&&document.addEventListener("mousedown",e=>{var t,r,a;if(v){if(0!==e.button)return;setTimeout(()=>{C(!1),M(!1)},150)}else E.current&&!E.current.contains(e.target)&&((null==(t=null==H?void 0:H.current)?void 0:t.contains(e.target))||(null==(r=null==B?void 0:B.current)?void 0:r.contains(e.target))||(null==(a=null==E?void 0:E.current)?void 0:a.contains(e.target))||(C(!1),M(!1)))},{signal:t}),()=>{e.abort()}},[y,E,H,B,v]),c(()=>{N&&N!==d&&C(!1)},[N,d]),e("div",{className:`z-50 ${b||""} ${y?"flex h-full items-center":""}`,onMouseEnter:I,onMouseLeave:O,ref:B,"aria-haspopup":!0,"aria-expanded":y,children:[e("button",{ref:H,onClick:()=>{R||(y||M(!j),C(!y),w(N===d?null:d))},className:"flex items-center gap-1/2 font-medium "+x,children:[t("span",{className:"text-text-sm",children:u}),!f&&t("span",{children:t(o,{size:16,strokeWidth:2.5,className:"translate-y-[1px] duration-150 "+(y&&"rotate-180")})})]}),y&&m(e("div",{ref:E,className:"fixed left-1/2 z-50 flex w-full max-w-[1410px] -translate-x-1/2 rounded-b-l border border-border border-t-primary bg-cardBg p-2 text-text-sm shadow-lg",style:{top:T+"px"},onMouseEnter:I,onMouseLeave:O,children:[g,t("section",{className:"flex w-[max(800px,95%)] justify-around gap-1",children:Object.keys(p).map(r=>e("div",{className:"flex flex-col items-start gap-1 font-medium",role:"menuitem","aria-label":"Menu item",children:[t("div",{className:"flex min-h-[1.5rem] items-start pb-1",children:p[r].labelHref?t(n,{to:p[r].labelHref,className:"text-primary hover:underline",children:p[r].label}):t("p",{className:"text-primary",children:p[r].label})}),p[r].options.map(e=>{var r;return t(n,{to:a(e.href,e.params),className:"text-text-sm",children:e.label},(null==e?void 0:e.href)+""+(null==(r=null==e?void 0:e.params)?void 0:r.tab))})]},r))})]}),document.body)]})};export{d as ScreenDropdown};
|
|
Binary file
|