@vellumlabs/cexplorer-sdk 1.1.24 → 1.1.25

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
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{DateCell as a}from"../../dateCell/index.js";import{formatString as r}from"../../../utils/format.js";import{Link as s}from"@tanstack/react-router";import{useGlobalSearch as l}from"../../../providers/GlobalSearchContext.js";import{AdaWithTooltip as o}from"../../adaWithTooltip/index.js";import{Image as i}from"../../image/index.js";import c from"../../../resources/images/dollar.svg.js";import{Landmark as n,Fingerprint as d,FileText as m,BookOpen as p,Wallet as u,Box as x,ArrowLeftRight as h}from"lucide-react";const f=({item:t,generateImageUrl:a})=>{const{category:r,ident:s,title:l}=t;if("adahandle"===r)return e("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-max bg-[#F2F4F7]",children:e("img",{src:c,alt:"ADA Handle",className:"h-4 w-4"})});if(["pool","asset","drep","user"].includes(r)){const t={pool:"pool",asset:"asset",drep:"user",user:"user"},o=a?a(s,"ico",{pool:"pool",asset:"token",drep:"drep",user:"user"}[r]):void 0;return e(i,{src:o,type:t[r],fallbackletters:l,width:32,height:32,className:"h-8 w-8 shrink-0 rounded-max",alt:l})}const o=(t=>{const a="h-4 w-4 text-[#475467]";switch(t){case"tx":return e(h,{className:a});case"block":return e(x,{className:a});case"address":case"stake":return e(u,{className:a});case"article":return e(p,{className:a});case"page":return e(m,{className:a});case"policy":return e(d,{className:a});case"gov_action_proposal":return e(n,{className:a});default:return null}})(r);return o?e("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-max bg-[#F2F4F7]",children:o}):null},g=({item:i,formatTitle:c})=>{const{handleInput:n,handleSearchChange:d,generateImageUrl:m}=l(),{title:p,ident:u,category:x,...h}=i,g=h.url.replace("/gov/action",""),{to:y,params:b}={to:{pool:"/pool/$id",asset:"/asset/$fingerprint",tx:"/tx/$hash",block:"/block/$hash",stake:"/stake/$stakeAddr",address:"/address/$address",adahandle:"/address/$address",policy:"/policy/$policyId",drep:"/drep/$hash",gov_action_proposal:"/gov/action/"+g.replace("#","%23"),page:h.url,user:h.url,article:h.url},params:{drep:{hash:u},pool:{id:u},asset:{fingerprint:u},tx:{hash:u},block:{hash:u},stake:{stakeAddr:u},address:{address:u},adahandle:{address:u},policy:{policyId:u}}};return e(s,{to:y[x],params:b[x],children:t("div",{className:"flex w-full cursor-pointer items-stretch justify-between border-b border-border pb-1/2 pt-1.5 transition-all duration-100 last:border-b-0 hover:bg-cardBg",onClick:()=>{n("blur"),d("")},children:[t("div",{className:"flex items-center gap-1",children:[e(f,{item:i,generateImageUrl:m}),t("div",{className:"flex w-fit max-w-[350px] flex-col break-words text-text-sm text-primary",children:[e("span",{className:"font-semibold",children:c?r(p,"long"):p}),e("span",{className:"text-text-xs text-grayTextPrimary",children:["page","article"].includes(x)?null==h?void 0:h.url:r(u,"long")})]})]}),h.extra.value&&h.extra.type&&t("div",{className:"flex min-w-[70px] flex-col items-start justify-center text-nowrap text-text",children:["string"==typeof h.extra.value?e(a,{time:h.extra.value,className:"text-text-xs",tabularNums:!1,withoutConvert:!0}):e("span",{className:"text-text-sm text-text",children:e(o,{data:h.extra.value})}),e("span",{className:"text-text-sm text-grayTextPrimary",children:h.extra.type[0].toUpperCase()+h.extra.type.slice(1)})]})]})})};export{g as GlobalSearchCell};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{DateCell as a}from"../../dateCell/index.js";import{formatString as r}from"../../../utils/format.js";import{Link as s}from"@tanstack/react-router";import{useGlobalSearch as l}from"../../../providers/GlobalSearchContext.js";import{AdaWithTooltip as o}from"../../adaWithTooltip/index.js";import{Image as i}from"../../image/index.js";import c from"../../../resources/images/dollar.svg.js";import{Landmark as n,Fingerprint as d,FileText as m,BookOpen as p,Wallet as u,Box as x,ArrowLeftRight as h}from"lucide-react";const f=({item:t,generateImageUrl:a})=>{const{category:r,ident:s,title:l}=t;if("adahandle"===r)return e("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-max bg-[#F2F4F7]",children:e("img",{src:c,alt:"ADA Handle",className:"h-4 w-4"})});if(["pool","asset","drep","user"].includes(r)){const t={pool:"pool",asset:"asset",drep:"user",user:"user"},o=a?a(s,"ico",{pool:"pool",asset:"nft",drep:"drep",user:"user"}[r]):void 0;return e(i,{src:o,type:t[r],fallbackletters:l,width:32,height:32,className:"h-8 w-8 shrink-0 rounded-max",alt:l})}const o=(t=>{const a="h-4 w-4 text-[#475467]";switch(t){case"tx":return e(h,{className:a});case"block":return e(x,{className:a});case"address":case"stake":return e(u,{className:a});case"article":return e(p,{className:a});case"page":return e(m,{className:a});case"policy":return e(d,{className:a});case"gov_action_proposal":return e(n,{className:a});default:return null}})(r);return o?e("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-max bg-[#F2F4F7]",children:o}):null},g=({item:i,formatTitle:c})=>{const{handleInput:n,handleSearchChange:d,generateImageUrl:m}=l(),{title:p,ident:u,category:x,...h}=i,g=h.url.replace("/gov/action",""),{to:y,params:b}={to:{pool:"/pool/$id",asset:"/asset/$fingerprint",tx:"/tx/$hash",block:"/block/$hash",stake:"/stake/$stakeAddr",address:"/address/$address",adahandle:"/address/$address",policy:"/policy/$policyId",drep:"/drep/$hash",gov_action_proposal:"/gov/action/"+g.replace("#","%23"),page:h.url,user:h.url,article:h.url},params:{drep:{hash:u},pool:{id:u},asset:{fingerprint:u},tx:{hash:u},block:{hash:u},stake:{stakeAddr:u},address:{address:u},adahandle:{address:u},policy:{policyId:u}}};return e(s,{to:y[x],params:b[x],children:t("div",{className:"flex w-full cursor-pointer items-stretch justify-between border-b border-border pb-1/2 pt-1.5 transition-all duration-100 last:border-b-0 hover:bg-cardBg",onClick:()=>{n("blur"),d("")},children:[t("div",{className:"flex items-center gap-1",children:[e(f,{item:i,generateImageUrl:m}),t("div",{className:"flex w-fit max-w-[350px] flex-col break-words text-text-sm text-primary",children:[e("span",{className:"font-semibold",children:c?r(p,"long"):p}),e("span",{className:"text-text-xs text-grayTextPrimary",children:["page","article"].includes(x)?null==h?void 0:h.url:r(u,"long")})]})]}),h.extra.value&&h.extra.type&&t("div",{className:"flex min-w-[70px] flex-col items-start justify-center text-nowrap text-text",children:["string"==typeof h.extra.value?e(a,{time:h.extra.value,className:"text-text-xs",tabularNums:!1,withoutConvert:!0}):e("span",{className:"text-text-sm text-text",children:e(o,{data:h.extra.value})}),e("span",{className:"text-text-sm text-grayTextPrimary",children:h.extra.type[0].toUpperCase()+h.extra.type.slice(1)})]})]})})};export{g as GlobalSearchCell};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumlabs/cexplorer-sdk",
3
- "version": "1.1.24",
3
+ "version": "1.1.25",
4
4
  "description": "Cexplorer UI Component Library with theme system",
5
5
  "author": "Vellum Labs",
6
6
  "main": "dist/index.js",