sui-explorer-local
Version:
Local Sui Explorer
40 lines (39 loc) • 8.24 kB
JavaScript
import{j as e}from"./jsx-runtime-ffb262ed.js";import{r as s}from"./index-76fb7be0.js";import{B as W}from"./Banner-e4fb1b05.js";import{C as Y}from"./CopyToClipboard-3da9e59e.js";import{P as l}from"./Placeholder-ef637fc4.js";import{T as g}from"./Text-6932fd32.js";import{H as $}from"./Heading-31d5eddc.js";import"./_commonjsHelpers-de833af9.js";import"./index-dca19ccf.js";import"./info-1b9bdf22.js";import"./IconButton-47608385.js";import"./index-d5a566d3.js";import"./extends-98964cd2.js";import"./Link-0a628896.js";import"./index-d3ea75b5.js";import"./index-1489375c.js";import"./motion-b354e7ba.js";import"./SVGVisualElement-4900b852.js";import"./Check12-709d7c68.js";import"./sizeAndWeight-05769a6b.js";const z=r=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...r,children:e.jsx("path",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3.833 12.833v-4 4Zm0-4v-5s1.834-1.5 4.167 0c2.333 1.5 4.167 0 4.167 0v5s-1.834 1.5-4.167 0c-2.333-1.5-4.167 0-4.167 0Z"})}),D=z;try{Flag16.displayName="Flag16",Flag16.__docgenInfo={description:"",displayName:"Flag16",props:{}}}catch{}const G=r=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 12 12",...r,children:e.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6 2.75a3.25 3.25 0 1 0 0 6.5 3.25 3.25 0 0 0 0-6.5ZM1.25 6a4.75 4.75 0 1 1 9.5 0 4.75 4.75 0 0 1-9.5 0ZM6 5.25a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0V6A.75.75 0 0 1 6 5.25Zm0-2a.75.75 0 0 0 0 1.5h.004a.75.75 0 0 0 0-1.5H6Z",clipRule:"evenodd"})}),J=G;try{Info12.displayName="Info12",Info12.__docgenInfo={description:"",displayName:"Info12",props:{}}}catch{}const K=r=>s.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},s.createElement("path",{d:"M12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14Z",fill:"currentColor",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),s.createElement("path",{d:"M4 6C5.10457 6 6 5.10457 6 4C6 2.89543 5.10457 2 4 2C2.89543 2 2 2.89543 2 4C2 5.10457 2.89543 6 4 6Z",fill:"currentColor",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),s.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.66699 3.5C7.66699 3.22386 7.89085 3 8.16699 3H10.667C11.2858 3 11.8793 3.24583 12.3169 3.68342C12.7545 4.121 13.0003 4.71449 13.0003 5.33333V10.5C13.0003 10.7761 12.7765 11 12.5003 11H11.5003C11.2242 11 11.0003 10.7761 11.0003 10.5V5.33333C11.0003 5.24493 10.9652 5.16014 10.9027 5.09763C10.8402 5.03512 10.7554 5 10.667 5H8.16699C7.89085 5 7.66699 4.77614 7.66699 4.5V3.5Z",fill:"currentColor"}),s.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5 5C4.77614 5 5 5.22386 5 5.5V14.5C5 14.7761 4.77614 15 4.5 15H3.5C3.22386 15 3 14.7761 3 14.5V5.5C3 5.22386 3.22386 5 3.5 5H4.5Z",fill:"currentColor"})),y={Transaction:"Transaction Block"},Q={Transaction:null,Checkpoint:D,Object:null,Package:K,Address:null};function h({title:r,subtitle:f,type:n,before:x,error:v,loading:o,after:j}){const C=Q[n];return e.jsx("div",{"data-testid":"pageheader",className:"group",children:e.jsxs("div",{className:"flex w-full items-center gap-3 sm:gap-5",children:[x&&e.jsx("div",{className:"self-start sm:self-center",children:e.jsx("div",{className:"sm:min-w-16 flex h-10 w-10 min-w-10 items-center justify-center rounded-lg bg-white/60 sm:h-16 sm:w-16 sm:rounded-xl lg:h-18 lg:w-18 lg:min-w-18",children:o?e.jsx(l,{rounded:"xl",width:"100%",height:"100%"}):x})}),e.jsxs("div",{className:"flex w-full flex-col items-start justify-between gap-4 md:flex-row md:items-center",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[C&&e.jsx(C,{className:"text-steel-dark"}),o?e.jsx(l,{rounded:"lg",width:"140px"}):e.jsx(g,{variant:"captionSmall/semibold",color:"hero-dark",children:n in y?y[n]:n})]}),e.jsx("div",{className:"min-w-0 break-words break-all",children:o?e.jsx(l,{rounded:"lg",width:"540px",height:"20px"}):e.jsx(e.Fragment,{children:r&&e.jsxs("div",{className:"flex items-center",children:[e.jsx($,{as:"h3",variant:"heading3/semibold",color:"gray-90",mono:!0,children:r}),e.jsx("div",{className:"ml-2 h-4 w-4 self-start md:h-6 md:w-6",children:e.jsx(Y,{size:"lg",color:"steel",copyText:r})})]})})}),f&&e.jsx("div",{className:"mt-2 break-words",children:o?e.jsx(l,{rounded:"lg",width:"540px",height:"20px"}):e.jsx(g,{variant:"body/medium",color:"gray-75",children:f})})]}),v&&e.jsx("div",{className:"mt-2",children:e.jsx(W,{variant:"neutralWhite",icon:e.jsx(J,{className:"text-issue-dark"}),children:e.jsx(g,{variant:"pBody/medium",color:"issue-dark",children:v})})}),j&&e.jsx("div",{className:"sm:self-center md:ml-auto",children:j})]})]})})}try{h.displayName="PageHeader",h.__docgenInfo={description:"",displayName:"PageHeader",props:{title:{defaultValue:null,description:"",name:"title",required:!0,type:{name:"string"}},subtitle:{defaultValue:null,description:"",name:"subtitle",required:!1,type:{name:"string | null"}},type:{defaultValue:null,description:"",name:"type",required:!0,type:{name:"enum",value:[{value:'"Transaction"'},{value:'"Checkpoint"'},{value:'"Address"'},{value:'"Object"'},{value:'"Package"'}]}},status:{defaultValue:null,description:"",name:"status",required:!1,type:{name:"enum",value:[{value:'"success"'},{value:'"failure"'}]}},before:{defaultValue:null,description:"",name:"before",required:!1,type:{name:"ReactNode"}},after:{defaultValue:null,description:"",name:"after",required:!1,type:{name:"ReactNode"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},loading:{defaultValue:null,description:"",name:"loading",required:!1,type:{name:"boolean"}}}}}catch{}const ve={component:h},a="0x76763c665d5de1f59471e87af92767f3df376580",i={args:{title:a,type:"Address"}},t={args:{title:a,type:"Transaction",status:"success"}},c={args:{...t.args,status:"failure"}},d={args:{title:a,type:"Checkpoint"}},m={args:{title:a,type:"Object"}},p={args:{title:a,type:"Package",subtitle:"Package Name"}},u={args:{title:a,type:"Package",subtitle:a}};var k,w,_;i.parameters={...i.parameters,docs:{...(k=i.parameters)==null?void 0:k.docs,source:{originalSource:`{
args: {
title,
type: 'Address'
}
}`,...(_=(w=i.parameters)==null?void 0:w.docs)==null?void 0:_.source}}};var b,N,P;t.parameters={...t.parameters,docs:{...(b=t.parameters)==null?void 0:b.docs,source:{originalSource:`{
args: {
title,
type: 'Transaction',
status: 'success'
}
}`,...(P=(N=t.parameters)==null?void 0:N.docs)==null?void 0:P.source}}};var T,V,S;c.parameters={...c.parameters,docs:{...(T=c.parameters)==null?void 0:T.docs,source:{originalSource:`{
args: {
...Transaction.args,
status: 'failure'
}
}`,...(S=(V=c.parameters)==null?void 0:V.docs)==null?void 0:S.source}}};var H,O,I;d.parameters={...d.parameters,docs:{...(H=d.parameters)==null?void 0:H.docs,source:{originalSource:`{
args: {
title,
type: 'Checkpoint'
}
}`,...(I=(O=d.parameters)==null?void 0:O.docs)==null?void 0:I.source}}};var E,Z,F;m.parameters={...m.parameters,docs:{...(E=m.parameters)==null?void 0:E.docs,source:{originalSource:`{
args: {
title,
type: 'Object'
}
}`,...(F=(Z=m.parameters)==null?void 0:Z.docs)==null?void 0:F.source}}};var R,q,L;p.parameters={...p.parameters,docs:{...(R=p.parameters)==null?void 0:R.docs,source:{originalSource:`{
args: {
title,
type: 'Package',
subtitle: 'Package Name'
}
}`,...(L=(q=p.parameters)==null?void 0:q.docs)==null?void 0:L.source}}};var M,A,B;u.parameters={...u.parameters,docs:{...(M=u.parameters)==null?void 0:M.docs,source:{originalSource:`{
args: {
title,
type: 'Package',
subtitle: title
}
}`,...(B=(A=u.parameters)==null?void 0:A.docs)==null?void 0:B.source}}};const je=["Address","Transaction","TransactionFailure","Checkpoint","Object","Package","PackageLongSubtitle"];export{i as Address,d as Checkpoint,m as Object,p as Package,u as PackageLongSubtitle,t as Transaction,c as TransactionFailure,je as __namedExportsOrder,ve as default};