@bass-ui-kit/core 0.1.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.
- package/dist/index.cjs +23 -0
- package/dist/index.d.cts +452 -0
- package/dist/index.d.ts +452 -0
- package/dist/index.js +23 -0
- package/package.json +102 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";var Bt=Object.create;var ne=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var Ht=Object.getOwnPropertyNames;var _t=Object.getPrototypeOf,zt=Object.prototype.hasOwnProperty;var $t=(e,t)=>{for(var o in t)ne(e,o,{get:t[o],enumerable:!0})},ot=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ht(t))!zt.call(e,n)&&n!==o&&ne(e,n,{get:()=>t[n],enumerable:!(a=Et(t,n))||a.enumerable});return e};var N=(e,t,o)=>(o=e!=null?Bt(_t(e)):{},ot(t||!e||!e.__esModule?ne(o,"default",{value:e,enumerable:!0}):o,e)),Ft=e=>ot(ne({},"__esModule",{value:!0}),e);var mo={};$t(mo,{ActionButton:()=>Z,AssetCard:()=>dt,AssetCardGroup:()=>Oe,AssetCardHeader:()=>Fe,AssetCardIcon:()=>je,AssetCardInfo:()=>Ge,AssetCardMain:()=>We,AssetCardRate:()=>Ue,AssetCardRoot:()=>$e,AssetCardSparkline:()=>Ze,AssetCardValue:()=>qe,AssetCardVisuals:()=>Ke,CheckBox:()=>et,CommandBar:()=>ct,CommandBarContainer:()=>pe,CommandEmpty:()=>ge,CommandGroup:()=>xe,CommandInput:()=>me,CommandItem:()=>fe,CommandList:()=>ue,CommandSeparator:()=>be,CopyField:()=>Ce,CopyFieldButton:()=>we,CopyFieldInput:()=>ve,CurrencyInput:()=>ft,CurrencyInputDropdown:()=>Te,CurrencyInputInput:()=>Re,CurrencyInputMaxButton:()=>ke,CurrencyInputRoot:()=>ye,DataTable:()=>wt,Modal:()=>O,ModalAction:()=>ce,ModalBody:()=>ie,ModalCancel:()=>de,ModalFooter:()=>le,ModalHeader:()=>se,ModalTrigger:()=>re,PriceTicker:()=>Tt,Stat:()=>yt,StatExtras:()=>Le,StatLabel:()=>Pe,StatRoot:()=>Ie,StatTrend:()=>Se,StatValue:()=>Me,StatusBadge:()=>Nt,ToastContext:()=>De,ToastProvider:()=>It,Toggle:()=>Ye,ToolTip:()=>he,TransactionStepper:()=>At,buttonVariants:()=>_e,useToast:()=>Vt});module.exports=Ft(mo);var He=require("class-variance-authority");var at=require("tailwind-merge"),nt=require("clsx");function r(...e){return(0,at.twMerge)((0,nt.clsx)(e))}var K=require("react/jsx-runtime");function rt({spinnerIntent:e,className:t}){return(0,K.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,K.jsx)("div",{className:r(jt({spinnerIntent:e}),t)})})}var _e=(0,He.cva)(["font-semibold","flex","justify-around","items-center","shadow-lg","dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.1)]","gap-2","rounded-md","py-2","px-5","md:min-w-35","md:w-auto","md:gap-2.5","md:rounded-lg","md:py-2.5","md:px-6","lg:min-w-40","lg:w-auto","lg:gap-3","lg:rounded-lg","lg:py-3","lg:px-8","active:scale-95"],{variants:{intent:{primary:["border","bg-btn-primary-bg","border-btn-primary-border","!text-btn-primary-text","hover:bg-btn-primary-bg-hover","active:bg-btn-primary-bg-active"],secondary:["dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.3)]","bg-btn-secondary-bg","!text-btn-secondary-text","hover:bg-btn-secondary-bg-hover","active:bg-btn-secondary-bg-active"],danger:["border","bg-btn-danger-bg","border-btn-danger-border","!text-btn-danger-text","hover:bg-btn-danger-bg-hover","active:bg-btn-danger-bg-active"],ghost:["border","bg-btn-ghost-bg","border-btn-ghost-border","!text-slate-500","hover:bg-btn-ghost-bg-hover","active:bg-btn-ghost-bg-active"]},size:{full:["w-full","md:w-full","lg:w-full"],cut:[""]},isDisabled:{true:["bg-btn-disabled-bg","text-btn-disabled-text","border-0","pointer-events-none"],false:[""]},isLoading:{true:["!text-transparent","relative","bg-white","border-2","pointer-events-none"],false:""}},defaultVariants:{intent:"primary",size:"cut",isDisabled:!1},compoundVariants:[{intent:"primary",isLoading:!0,className:""}]}),jt=(0,He.cva)(["border-2","rounded-full","animate-spin","h-3","w-3","md:h-4","md:w-4","lg:h-5","lg:w-5"],{variants:{spinnerIntent:{primary:["border-btn-primary-border","border-t-white"],secondary:["border-btn-secondary-border","border-t-white"],danger:["border-btn-danger-border","border-t-white"],ghost:["border-btn-ghost-border","border-t-white"]}},defaultVariants:{spinnerIntent:"primary"}});function Z({intent:e="primary",size:t="cut",isDisabled:o=!1,isLoading:a=!1,className:n,children:s,onClick:i,...l}){let p=m=>{a||o||i?.(m)};return(0,K.jsxs)("button",{disabled:o||a||l.disabled,className:r(_e({intent:e,size:t,isDisabled:o,isLoading:a}),n),onClick:p,...l,children:[a&&(0,K.jsx)(rt,{spinnerIntent:e}),s]})}Z.Loader=rt;var _=require("react"),st=require("class-variance-authority");var v=N(require("@radix-ui/react-dialog"),1);var d=require("react/jsx-runtime"),ze=(0,_.createContext)(null);function re({children:e}){return(0,d.jsx)(d.Fragment,{children:e})}function se({children:e,className:t}){return(0,d.jsx)("header",{className:r("relative flex items-center justify-between flex-none p-1.5 grow-0 font-sans w-full",t),children:e})}function ie({children:e,className:t}){return(0,d.jsx)("main",{className:r("flex flex-row justify-center mt-[18px] mb-3 p-2 gap-2 flex-none order-1 grow-0",t),children:e})}function le({children:e,className:t}){return(0,d.jsx)("footer",{className:r("mt-1 flex flex-col-reverse gap-3 order-2 h-min w-full grow-0 lg:mt-1 lg:flex-row lg:items-end lg:justify-start lg:gap-5 lg:pl-[5px]",t),children:e})}function de({onClick:e,className:t,...o}){let a=(0,_.useContext)(ze);return(0,d.jsx)(Z,{intent:"ghost",onClick:s=>{e?e(s):(console.log("Default action triggered"),a?.handleClose())},className:r("flex flex-none grow-0 flex-row items-center justify-center rounded-[4px] border-none px-10 py-[10px] font-sans text-sm font-semibold not-italic !text-white min-w-min",t),...o,children:"Cancel"})}function ce({action:e,className:t,onClick:o,...a}){let n=(0,_.useContext)(ze);return(0,d.jsx)(Z,{onClick:i=>{o?o(i):(console.log("Default action triggered"),n?.handleClose())},className:r("flex flex-none grow-0 flex-row items-center justify-center gap-[10px] rounded-[4px] border-none bg-indigo-500 hover:bg-indigo-600 dark:bg-indigo-600 dark:hover:bg-indigo-700 px-10 py-[10px] font-sans text-sm font-semibold not-italic text-white min-w-min",t),...a,children:e})}var Ot=(0,st.cva)(["flex","flex-col","justify-start","bg-surface-card","shadow-2xl","z-50","font-['Inclusive_Sans']","m-0","max-w-none","border-none","overflow-hidden","fixed","gap-3","bottom-0 top-auto left-0 translate-x-0 translate-y-0","mt-auto mb-0 w-full rounded-t-[20px] rounded-b-none","pt-10 pr-6 pb-8 pl-6 max-h-[45vh]","animate-[mobile-slide-up_0.3s_ease-out]","md:top-1/2 md:left-1/2 md:-translate-x-1/2 md:-translate-y-1/2 md:bottom-auto","md:p-8 md:w-min md:h-min md:rounded-[16px] md:max-h-none","md:animate-[modal-appear_0.2s_ease-out]","md:font-optical-sizing-auto"],{variants:{intent:{primary:[],secondary:[],danger:[],ghost:[]}},defaultVariants:{}}),O=({isOpen:e,onOpenChange:t,onClose:o,children:a,trigger:n,className:s,footer:i,title:l,description:p,...m})=>{let[S,b]=(0,_.useState)(e??!1);(0,_.useEffect)(()=>{e!==void 0&&b(e)},[e]);let H=()=>{b(!1),o?.()};return(0,d.jsx)(ze.Provider,{value:{handleClose:H},children:(0,d.jsxs)(v.Root,{open:S,onOpenChange:M=>{b(M),t?.(M),M||o?.()},children:[n&&(0,d.jsx)(re,{children:(0,d.jsx)(v.Trigger,{asChild:!0,children:n})}),(0,d.jsxs)(v.Portal,{children:[(0,d.jsx)(v.Overlay,{onClick:H,className:"fixed inset-0 bg-black/50 backdrop-filter backdrop-blur-sm z-40 animate-fade-in"}),(0,d.jsx)(v.Content,{className:r(Ot(),s),...m,children:l?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(se,{children:[(0,d.jsx)(v.Title,{className:"my-0 font-sans text-2xl font-medium not-italic leading-[22px] text-left dark:text-white",children:l}),(0,d.jsx)(v.Close,{asChild:!0,children:(0,d.jsx)("button",{onClick:H,"aria-label":"Close",type:"button",className:"relative ml-6 right-0 rounded-full hover:bg-slate-200 p-2 cursor-pointer",children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",className:"w-[18px] h-[18px] block dark:text-white",children:(0,d.jsx)("path",{d:"M6.575 7.975L1.675 12.875C1.49167 13.0583 1.25833 13.15 0.975 13.15C0.691667 13.15 0.458333 13.0583 0.275 12.875C0.0916663 12.6917 0 12.4583 0 12.175C0 11.8917 0.0916663 11.6583 0.275 11.475L5.175 6.575L0.275 1.675C0.0916663 1.49167 0 1.25833 0 0.975C0 0.691667 0.0916663 0.458333 0.275 0.275C0.458333 0.0916663 0.691667 0 0.975 0C1.25833 0 1.49167 0.0916663 1.675 0.275L6.575 5.175L11.475 0.275C11.6583 0.0916663 11.8917 0 12.175 0C12.4583 0 12.6917 0.0916663 12.875 0.275C13.0583 0.458333 13.15 0.691667 13.15 0.975C13.15 1.25833 13.0583 1.49167 12.875 1.675L7.975 6.575L12.875 11.475C13.0583 11.6583 13.15 11.8917 13.15 12.175C13.15 12.4583 13.0583 12.6917 12.875 12.875C12.6917 13.0583 12.4583 13.15 12.175 13.15C11.8917 13.15 11.6583 13.0583 11.475 12.875L6.575 7.975Z",fill:"currentColor"})})})})]}),(0,d.jsx)(ie,{children:a}),p&&(0,d.jsx)(v.Description,{className:"text-gray-500 px-8 py-1 text-sm",children:p}),i&&(0,d.jsx)(le,{children:typeof i=="string"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(de,{}),(0,d.jsx)(ce,{action:i})]}):i})]}):(0,d.jsxs)(d.Fragment,{children:[a,p&&(0,d.jsx)(v.Description,{className:"text-gray-500 px-8 py-1 text-sm",children:p})]})})]})]})})};O.Trigger=re;O.Header=se;O.Body=ie;O.Footer=le;O.Action=ce;O.Cancel=de;var Q=N(require("react"),1),it=require("class-variance-authority");var g=require("react/jsx-runtime"),lt=Q.createContext(null);function z(){let e=Q.useContext(lt);if(!e)throw new Error("AssetCard sub-components cannot be rendered outside the AssetCardRoot component.");return e}var Wt=(0,it.cva)("flex flex-col justify-between p-2.5 md:p-4 rounded-2xl bg-gradient-to-b from-white to-gray-50/30 w-48 h-32 md:w-52 md:h-36 lg:w-56 lg:h-[152px] shadow-[0_4px_16px_rgba(0,0,0,0.03),inset_0_1px_0_0_rgba(255,255,255,0.6),inset_0_0_0_1px_rgba(0,0,0,0.04)]",{variants:{size:{md:"",lg:""}},defaultVariants:{size:"lg"}});function $e({className:e,size:t,children:o,...a}){return(0,g.jsx)(lt.Provider,{value:!0,children:(0,g.jsx)("div",{className:r(Wt({size:t}),e),...a,children:o})})}function Fe({className:e,children:t,...o}){return z(),(0,g.jsx)("header",{className:r("flex items-center gap-2",e),...o,children:t})}function je({className:e,children:t,...o}){return z(),(0,g.jsx)("div",{className:r("flex-shrink-0",e),...o,children:t})}function Oe({className:e,children:t,...o}){return z(),(0,g.jsx)("div",{className:r("flex flex-col text-sm leading-tight",e),...o,children:t})}function We({className:e,children:t,...o}){return z(),(0,g.jsx)("main",{className:r("flex flex-row w-full items-center justify-between gap-1 mt-auto",e),...o,children:t})}function Ge({className:e,children:t,...o}){return z(),(0,g.jsx)("div",{className:r("flex flex-col justify-center",e),...o,children:t})}function qe({className:e,children:t,...o}){return z(),(0,g.jsx)("h1",{className:r("text-xl font-semibold font-mono tracking-tight",e),...o,children:t})}function Ue({className:e,rate:t,...o}){return z(),(0,g.jsx)("span",{className:r(`text-sm font-mono ${t>0?"text-emerald-500":t<0?"text-rose-500":"text-amber-500"} font-semibold`,e),...o,children:t>0?`\u25B2 ${t}%`:t<0?`\u25BC ${t}%`:`\u25B6 ${t}%`})}function Ke({className:e,children:t,...o}){return z(),(0,g.jsx)("div",{className:r("flex items-center justify-center overflow-hidden",e),...o,children:t})}var Ze=({data:e,width:t=90,height:o=30,strokeWidth:a=2,className:n,...s})=>{z();let i=Q.useId();if(!e||e.length<2)return null;let l=Math.min(...e),p=Math.max(...e),m=p-l===0?1:p-l,b=e.map((h,f)=>{let W=f/(e.length-1)*t,U=o-(h-l)/m*o;return{x:W,y:U}}).map((h,f)=>`${f===0?"M":"L"} ${h.x.toFixed(1)} ${h.y.toFixed(1)}`).join(" "),H=`${b} L ${t} ${o} L 0 ${o} Z`,M=e[0],G=e[e.length-1]>=M,q=G?"stroke-emerald-500":"stroke-rose-500",j=G?"rgb(16, 185, 129)":"rgb(244, 63, 94)";return(0,g.jsxs)("svg",{width:t,height:o,viewBox:`0 0 ${t} ${o}`,className:r("overflow-visible",n),...s,children:[(0,g.jsx)("defs",{children:(0,g.jsxs)("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,g.jsx)("stop",{offset:"0%",stopColor:j,stopOpacity:.25}),(0,g.jsx)("stop",{offset:"100%",stopColor:j,stopOpacity:0})]})}),(0,g.jsx)("path",{d:H,fill:`url(#${i})`,className:"transition-all duration-300 ease-in-out"}),(0,g.jsx)("path",{d:b,fill:"none",className:r(q,"transition-all duration-300 ease-in-out"),strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"})]})},dt={Root:$e,Header:Fe,Main:We,Group:Oe,Info:Ge,Icon:je,Rate:Ue,Value:qe,Visuals:Ke,Sparkline:Ze};var L=N(require("react"),1);var I=require("cmdk"),T=require("react/jsx-runtime"),pe=L.forwardRef(({className:e,children:t,...o},a)=>(0,T.jsx)(I.Command,{ref:a,className:r("relative flex flex-col overflow-visible rounded-4xl bg-white dark:bg-zinc-900/90 text-zinc-950 dark:text-zinc-100 border border-zinc-200 dark:border-zinc-800 shadow-[0_24px_48px_-12px_rgba(0,0,0,0.4)] backdrop-blur-md w-md md:w-xl lg:w-3xl custom-crypto-glow",e),...o,children:t})),me=L.forwardRef(({className:e,...t},o)=>(0,T.jsx)(I.Command.Input,{ref:o,className:r("flex w-full bg-transparent mx-3 py-4 outline-none placeholder-zinc-500 disabled:cursor-not-allowed disabled:opacity-50 h-10 text-xs px-3 font-medium md:h-12 md:text-sm md:px-4 lg:h-14 lg:text-base lg:px-5 transition-all duration-200",e),...t})),ue=L.forwardRef(({className:e,children:t,...o},a)=>{let s=(0,I.useCommandState)(i=>i.search).trim().length>0;return(0,T.jsx)(I.Command.List,{ref:a,className:r("absolute top-20 z-50 w-full max-h-[300px] overflow-y-auto overflow-x-hidden rounded-xl border border-zinc-200 bg-white p-2 shadow-xl dark:border-zinc-800 dark:bg-zinc-950 text-zinc-950 dark:text-zinc-50 text-xs px-2 w-md md:text-sm md:px-3 md:w-xl lg:text-base lg:px-4 lg:w-3xl",!s&&"hidden",e),...o,children:t})}),ge=L.forwardRef(({className:e,...t},o)=>(0,T.jsx)(I.Command.Empty,{ref:o,className:r("py-6 text-center text-sm text-zinc-500 dark:text-zinc-400 ",e),...t})),xe=L.forwardRef(({className:e,heading:t,children:o,defaultExpanded:a=!1,...n},s)=>{let[i,l]=L.useState(a);return(0,T.jsx)(I.Command.Group,{ref:s,heading:(0,T.jsxs)("div",{onClick:()=>l(!i),className:r("overflow-hidden p-1 text-zinc-950 dark:text-zinc-100","flex w-full cursor-pointer items-center justify-between","[&_[cmdk-group-heading]]:select-none [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:text-[10px] [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-[0.12em] [&_[cmdk-group-heading]]:text-zinc-500",e),children:[(0,T.jsx)("span",{children:t}),(0,T.jsx)("span",{className:"text-[10px] opacity-60",children:i?"\u25B2 Hide":"\u25BC Expand"})]}),className:r("overflow-hidden p-1 text-zinc-950 dark:text-zinc-50",e),...n,children:(0,T.jsx)("div",{className:r(!i&&"hidden"),children:o})})}),fe=L.forwardRef(({className:e,...t},o)=>(0,T.jsx)(I.Command.Item,{ref:o,className:r("relative flex cursor-pointer select-none items-center rounded-xl px-3 py-2.5 mt-1 text-zinc-300 font-medium transition-all duration-150 outline-none data-[selected=true]:bg-white/[0.06] data-[selected=true]:text-white data-[selected=true]:translate-x-0.5 data-[disabled=true]:opacity-40",e),...t})),be=L.forwardRef(({className:e,...t},o)=>(0,T.jsx)(I.Command.Separator,{ref:o,className:r("-mx-1 my-1 h-px bg-zinc-200 dark:bg-zinc-800",e),...t}));pe.displayName="CommandBar.Root";me.displayName="CommandBar.Input";ue.displayName="CommandBar.List";ge.displayName="CommandBar.Empty";xe.displayName="CommandBar.Group";fe.displayName="CommandBar.Item";be.displayName="CommandBar.Separator";var ct={Root:pe,Input:me,List:ue,Empty:ge,Group:xe,Item:fe,Separator:be};var mt=require("react"),ut=require("class-variance-authority");var pt=N(require("react"),1),P=N(require("@radix-ui/react-tooltip"),1);var V=require("react/jsx-runtime"),he=({header:e,trigger:t,children:o,className:a,...n})=>(0,V.jsx)(P.Provider,{delayDuration:200,children:(0,V.jsxs)(P.Root,{...n,children:[(0,V.jsx)(P.Trigger,{asChild:!0,children:pt.default.isValidElement(t)?t:(0,V.jsx)("span",{children:t})}),(0,V.jsx)(P.Portal,{children:(0,V.jsxs)(P.Content,{sideOffset:5,className:r("z-50 overflow-hidden rounded-md border border-zinc-200 bg-white px-2 py-1 text-[10px] md:px-3 md:py-1.5 md:text-xs lg:px-4 lg:py-2 lg:text-sm text-zinc-950 shadow-md animate-in fade-in-0 zoom-in-95 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50",a),children:[e&&(0,V.jsx)("div",{className:"mb-1 font-semibold border-b border-zinc-100 dark:border-zinc-800 pb-1",children:e}),o,(0,V.jsx)(P.Arrow,{className:"fill-white dark:fill-zinc-950 -mt-[2px]",width:12,height:6})]})})]})});var R=require("react/jsx-runtime"),Gt=(0,ut.cva)("flex w-9 px-2 md:w-11 md:px-3 lg:w-14 lg:px-4 items-center justify-center transition-colors active:scale-95 disabled:pointer-events-none disabled:opacity-50",{variants:{intent:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{intent:"secondary"}});function ve({className:e,value:t}){return(0,R.jsx)("input",{type:"text","aria-label":"CopyField Text",value:t,tabIndex:-1,readOnly:!0,className:r("flex-1 border-2 border-copy-border bg-transparent ml-3 px-3 py-2 rounded-lg text-xs md:text-sm lg:text-base text-copy-text outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e)})}function we({className:e,handleClick:t,copied:o,intent:a}){return(0,R.jsx)(he,{trigger:(0,R.jsx)("button",{onClick:t,className:r(Gt({intent:a}),e),"aria-label":"Copy to clipboard",children:o?(0,R.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-6 h-6 text-green-500 animate-in zoom-in lucide lucide-check-icon lucide-check",children:(0,R.jsx)("path",{d:"M20 6 9 17l-5-5"})}):(0,R.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-4 h-6 text-copy-btn-icon lucide lucide-copy-icon lucide-copy",children:[(0,R.jsx)("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),(0,R.jsx)("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})}),children:o?"Copied!!!":"Copy"})}var Ce=({value:e,className:t,intent:o})=>{let[a,n]=(0,mt.useState)(!1),s=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}catch(i){console.error("Failed to copy!",i)}};return(0,R.jsxs)("div",{className:r("flex w-full px-2 py-4 h-14 lg:h-16 overflow-hidden items-center transition-all duration-200 rounded-full bg-copy-bg border-copy-border shadow-lg group",t),children:[(0,R.jsx)(ve,{value:e}),(0,R.jsx)("div",{className:r("px-3 py-2 w-12 lg:w-14 bg-copy-btn-bg border-2 border-copy-btn-icon hover:bg-copy-btn-hover active:bg-slate-900/80 text-zinc-100 rounded-lg m-2 flex items-center justify-center transition-colors shadow-[inset_0_1px_2px_rgba(0,0,0,0.05)] dark:shadow-[inset_0_1px_2px_rgba(0,0,0,0.4)]"),children:(0,R.jsx)(we,{intent:o||"secondary",handleClick:s,copied:a})})]})};Ce.Input=ve;Ce.Button=we;var $=N(require("react"),1),gt=require("class-variance-authority");var A=require("react/jsx-runtime"),qt=(0,gt.cva)(["flex w-full items-center rounded-xl border transition-all duration-300 overflow-hidden","bg-white dark:bg-slate-950","border-slate-200 dark:border-slate-800","ring-offset-white dark:ring-offset-slate-950","focus-within:ring-2 focus-within:ring-indigo-500/50 dark:focus-within:ring-indigo-400/30","shadow-sm dark:shadow-none"],{variants:{size:{default:"h-12",sm:"h-10 text-xs",lg:"h-14 text-base"}},defaultVariants:{size:"default"}}),xt=$.createContext(void 0);function Qe(){let e=$.useContext(xt);if(!e)throw new Error("CurrencyInput sub-components must be rendered within a Root");return e}var Ut=(e,t)=>{if(!e)return"";let[o,a]=e.split("."),n=o?o.replace(/\B(?=(\d{3})+(?!\d))/g,","):e;return a!==void 0?`${n}.${a.slice(0,t)}`:n},Kt=(e,t)=>{let o=e.replace(/[^\d.]/g,""),a=o.split(".");return a.length>2&&(o=`${a[0]}.${a.slice(1).join("")}`),a[1]&&a[1].length>t&&(o=`${a[0]}.${a[1].slice(0,t)}`),o},ye=$.forwardRef(({className:e,size:t,value:o,onChange:a,decimals:n=8,disabled:s,onMax:i,currency:l,onCurrencyChange:p,children:m,...S},b)=>(0,A.jsx)(xt.Provider,{value:{currency:l,onCurrencyChange:p,value:o,displayValue:Ut(o,n),decimals:n,disabled:s,onChange:a,onMax:i},children:(0,A.jsx)("div",{ref:b,className:r(qt({size:t}),e),...S,children:m})}));ye.displayName="CurrencyInput.Root";var ke=$.forwardRef(({className:e,...t},o)=>{let{onMax:a,disabled:n}=Qe();return a?(0,A.jsx)("button",{ref:o,type:"button",disabled:n,onClick:a,className:r("px-4 h-full text-[10px] font-bold uppercase tracking-widest transition-colors border-r border-slate-200 dark:border-slate-800 text-slate-500 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-900 disabled:opacity-30",e),...t,children:"Max"}):null});ke.displayName="CurrencyInput.MaxButton";var Re=$.forwardRef(({className:e,...t},o)=>{let{displayValue:a,decimals:n,onChange:s,disabled:i}=Qe();return(0,A.jsx)("input",{ref:o,type:"text",inputMode:"decimal",autoComplete:"off",placeholder:"0.00",disabled:i,value:a,onChange:l=>s(Kt(l.target.value,n)),className:r("flex-1 bg-transparent px-4 py-2 text-right font-mono text-slate-700 dark:text-white placeholder:text-slate-400 dark:placeholder:text-slate-600 focus:outline-none disabled:cursor-not-allowed",e),...t})});Re.displayName="CurrencyInput.Input";var Te=$.forwardRef(({className:e,options:t,...o},a)=>{let{currency:n,onCurrencyChange:s,disabled:i}=Qe();return(0,A.jsxs)("div",{className:"relative flex h-full items-center border-l border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-900/50",children:[(0,A.jsx)("select",{ref:a,disabled:i,value:n,onChange:l=>s?.(l.target.value),"aria-label":"currency",className:r("h-full bg-transparent px-3 text-xs font-semibold text-slate-700 dark:text-black outline-none cursor-pointer pr-7 appearance-none",e),...o,children:t.map(l=>(0,A.jsx)("option",{className:"bg-white dark:bg-slate-900 text-slate-900 dark:text-white",children:l},l))}),(0,A.jsx)("span",{className:"absolute right-2 text-xs text-slate-600 dark:text-slate-300 pointer-events-none","aria-hidden":"true",children:"\u25BC"})]})});Te.displayName="CurrencyInput.Dropdown";var ft={Root:ye,MaxButton:ke,Input:Re,Dropdown:Te};var X=N(require("react"),1),D=require("@tanstack/react-table");var bt=require("@tanstack/react-table"),J=require("react/jsx-runtime");function ht({row:e,isLoading:t,enableHoverHighlight:o}){return(0,J.jsx)("tr",{className:`
|
|
2
|
+
transition-colors duration-200
|
|
3
|
+
${t?"animate-pulse":""}
|
|
4
|
+
${o?"hover:bg-table-hover/50":""}
|
|
5
|
+
`,children:e.getVisibleCells().map(a=>{let n=["price","holdings","change24h","value","allocation"].includes(a.column.id.toLowerCase()),s=["rank","change24h"].includes(a.column.id.toLowerCase());return(0,J.jsx)("td",{className:`whitespace-nowrap px-4 sm:px-6 py-4 sm:py-5 align-middle first:pl-6 sm:first:pl-8 last:pr-6 sm:last:pr-8
|
|
6
|
+
${s?"hidden md:table-cell":"table-cell"}
|
|
7
|
+
`,children:(0,J.jsx)("div",{className:`flex w-full ${n?"justify-end text-right":"justify-start text-left"}`,children:t?(0,J.jsx)("div",{className:"h-4 w-24 rounded bg-table-skeleton animate-pulse"}):(0,J.jsx)("div",{className:"text-sm font-medium text-table-body-text",children:(0,bt.flexRender)(a.column.columnDef.cell,a.getContext())})})},a.id)})})}var w=require("react/jsx-runtime");function vt({table:e}){let t=e.getState().pagination.pageIndex,o=e.getState().pagination.pageSize,a=e.getFilteredRowModel().rows.length,n=e.getPageCount(),s=a===0?0:t*o+1,i=Math.min((t+1)*o,a);return(0,w.jsxs)("div",{className:"flex w-full items-center justify-between px-4 py-3 sm:px-2",children:[(0,w.jsxs)("div",{className:"text-xs font-medium text-table-header-text text-center sm:text-left",children:["Showing"," ",(0,w.jsx)("span",{className:"font-semibold text-table-body-text",children:s})," ","to ",(0,w.jsx)("span",{className:"font-semibold text-table-body-text",children:i})," ","of"," ",(0,w.jsx)("span",{className:"font-semibold text-table-body-text",children:a})," ","entries"]}),(0,w.jsxs)("div",{className:"flex items-center gap-1.5 self-center sm:self-auto",children:[(0,w.jsx)("button",{onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg border border-table-border bg-table-bg text-table-body-text transition-all hover:bg-table-hover disabled:pointer-events-none disabled:opacity-40",title:"First Page",children:(0,w.jsx)("span",{className:"text-xs",children:"\xAB"})}),(0,w.jsx)("button",{onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg border border-table-border bg-table-bg text-table-body-text transition-all hover:bg-table-hover disabled:pointer-events-none disabled:opacity-40",title:"Previous Page",children:(0,w.jsx)("span",{className:"text-xs",children:"\u2039"})}),(0,w.jsxs)("div",{className:"flex h-8 min-w-8 items-center justify-center rounded-lg bg-table-hover px-2.5 text-xs font-semibold text-table-body-text shadow-inner",children:["Page ",t+1," of ",n||1]}),(0,w.jsx)("button",{onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg border border-table-border bg-table-bg text-table-body-text transition-all hover:bg-table-hover disabled:pointer-events-none disabled:opacity-40",title:"Next Page",children:(0,w.jsx)("span",{className:"text-xs",children:"\u203A"})}),(0,w.jsx)("button",{onClick:()=>e.setPageIndex(n-1),disabled:!e.getCanNextPage(),className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg border border-table-border bg-table-bg text-table-body-text transition-all hover:bg-table-hover disabled:pointer-events-none disabled:opacity-40",title:"Last Page",children:(0,w.jsx)("span",{className:"text-xs",children:"\xBB"})})]})]})}var y=require("react/jsx-runtime");function wt({columns:e,data:t,isLoading:o=!1,skeletonRowCount:a=10,enableHoverHighlight:n=!0,paginateInternally:s=!0,totalRowCount:i,paginationState:l,onPaginationChange:p,sortingState:m,onSortingChange:S}){let b=X.useMemo(()=>e.map(h=>({accessorKey:h.accessorKey,header:h.title,cell:({getValue:f})=>{let W=f(),U=["price","holdings","change24h","value","allocation"].includes(h.accessorKey.toLowerCase());return(0,y.jsx)("div",{className:`
|
|
8
|
+
w-full px-1 text-sm font-medium tracking-wide transition-all duration-200
|
|
9
|
+
${U?"text-right justify-end":"text-left justify-start"}
|
|
10
|
+
truncate max-w-[150px] md:max-w-none
|
|
11
|
+
`,title:String(W),children:String(W)})}})),[e]),[H,M]=X.useState({pageIndex:0,pageSize:a}),[F,G]=X.useState([]),q=X.useMemo(()=>o?Array(a).fill({}):t,[o,t,a]),j=(0,D.useReactTable)({data:q,columns:b,getCoreRowModel:(0,D.getCoreRowModel)(),getPaginationRowModel:s?(0,D.getPaginationRowModel)():void 0,manualPagination:!s,rowCount:i,getSortedRowModel:s?(0,D.getSortedRowModel)():void 0,manualSorting:!s,state:{pagination:l??H,sorting:m??F},onPaginationChange:p??M,onSortingChange:S??G});return(0,y.jsxs)("div",{className:"w-full space-y-4",children:[(0,y.jsx)("div",{className:"w-full overflow-x-auto rounded-2xl border border-table-border bg-table-bg shadow-sm",children:(0,y.jsxs)("table",{className:"w-full border-collapse text-left text-sm min-w-[640px] sm:min-w-full",children:[(0,y.jsx)("thead",{className:"bg-table-header-bg border-b border-table-border",children:j.getHeaderGroups().map(h=>(0,y.jsx)("tr",{children:h.headers.map(f=>{let W=f.column.getCanSort(),U=f.column.getIsSorted(),tt=["price","holdings","change24h","value","allocation"].includes(f.column.id.toLowerCase()),Dt=["rank","change24h"].includes(f.column.id.toLowerCase());return(0,y.jsx)("th",{style:{width:`${f.getSize()}px`},className:`px-4 sm:px-6 py-4.5 font-semibold text-table-header-text text-xs tracking-wider select-none first:pl-6 sm:first:pl-8 last:pr-6 sm:last:pr-8
|
|
12
|
+
${Dt?"hidden md:table-cell":"table-cell"}
|
|
13
|
+
`,children:f.isPlaceholder?null:(0,y.jsxs)("div",{onClick:f.column.getToggleSortingHandler(),className:`flex w-full items-center gap-1.5 ${W?"cursor-pointer hover:text-table-body-text":""} ${tt?"justify-end text-right":"justify-start text-left"}`,children:[(0,y.jsx)("span",{children:(0,D.flexRender)(f.column.columnDef.header,f.getContext())}),W&&!tt&&(0,y.jsxs)("span",{className:"text-[10px] opacity-70",children:[U==="asc"&&"\u{1F53C}",U==="desc"&&"\u{1F53D}"]})]})},f.id)})},h.id))}),(0,y.jsx)("tbody",{className:"divide-y divide-table-border font-medium text-table-body-text",children:j.getRowModel().rows.map(h=>(0,y.jsx)(ht,{row:h,isLoading:o,enableHoverHighlight:n},h.id))})]})}),(0,y.jsx)(vt,{table:j})]})}var Ne=require("react"),Ct=require("class-variance-authority");var B=require("react/jsx-runtime"),Zt=(0,Ct.cva)("font-mono font-semibold text-xs md:text-sm lg:tracking-wide",{variants:{intent:{positive:"text-sentiment-positive-text",negative:"text-sentiment-negative-text",neutral:"text-white"}},defaultVariants:{}});function Pe({className:e,children:t,...o}){return(0,B.jsx)("span",{className:r("font-medium text-muted-foreground text-text-secondary text-xs md:text-sm lg:tracking-wide",e),...o,children:t})}Pe.displayName="Stat.Label";function Se({value:e,trendType:t="neutral",className:o,...a}){let n="neutral";t==="positive-up"?n=e>0?"positive":e<0?"negative":"neutral":t==="negative-up"&&(n=e>0?"negative":e<0?"positive":"neutral");let s=e>0?"+":"";return(0,B.jsx)("span",{className:r(Zt({intent:n}),o),...a,children:`${s}${e}%`})}Se.displayName="Stat.Trend";var Me=({value:e,duration:t=1e3,formatter:o,className:a="",...n})=>{let[s,i]=(0,Ne.useState)(()=>o?o(0):"0");(0,Ne.useEffect)(()=>{let p=null,m=0,S=e,b,H=F=>F*(2-F),M=F=>{p||(p=F);let G=F-p,q=Math.min(G/t,1),j=H(q),h=m+(S-m)*j,f=o?o(h):Math.round(h).toString();i(f),q<1&&(b=requestAnimationFrame(M))};return b=requestAnimationFrame(M),()=>cancelAnimationFrame(b)},[e,t,o]);let l=o?o(e):e.toString();return(0,B.jsx)("div",{className:"flex flex-col justify-center items-center h-14 w-28 rounded-xl md:h-24 md:w-48 md:rounded-b-none md:rounded-t-3xl lg:h-24 lg:w-52 lg:rounded-b-none lg:rounded-t-3xl lg:tracking-wide bg-[linear-gradient(hsla(256,72%,46%,1),hsla(241,72%,46%,0))]",children:(0,B.jsxs)("span",{className:r("font-bold tracking-tight text-slate-100 tabular-nums text-xl md:text-3xl lg:text-4xl",a),...n,children:[(0,B.jsx)("span",{className:"sr-only",children:l}),(0,B.jsx)("span",{"aria-hidden":"true",children:s})]})})};Me.displayName="Stat.Value";function Le({className:e,children:t,...o}){return(0,B.jsx)("section",{className:e,...o,children:t})}Le.displayName="Stat.Extras";var Ie=({className:e,children:t,...o})=>(0,B.jsx)("div",{className:r("lg:relative flex flex-col gap-1 p-4 md:px-5 md:pt-2 lg:pt-6 lg:pb-6 lg:pr-6 lg:pl-6 rounded-xl md:rounded-2xl shadow-sm max-w-fit items-center bg-[linear-gradient(hsla(252,100%,57%,0.8),hsla(241,81%,54%,0.8))] overflow-hidden backdrop-blur-md",e),...o,children:t});Ie.displayName="Stat.Root";var yt={Root:Ie,Label:Pe,Trend:Se,Value:Me,Extras:Le};var Y=require("react"),Rt=require("framer-motion"),u=require("react/jsx-runtime"),Tt=({assets:e,variant:t="marquee",speed:o=30})=>{if(t==="stack")return(0,u.jsx)("div",{className:"divide-y divide-gray-800 rounded-xl border border-gray-800 bg-black",children:e.map(n=>(0,u.jsx)(kt,{asset:n,layout:"stack"},n.id))});let a=[...e,...e,...e];return(0,u.jsxs)("div",{className:"relative w-full overflow-hidden border-y border-gray-800 bg-black py-3",children:[(0,u.jsx)("div",{className:"absolute inset-y-0 left-0 z-10 w-20 bg-gradient-to-r from-black to-transparent pointer-events-none"}),(0,u.jsx)("div",{className:"absolute inset-y-0 right-0 z-10 w-20 bg-gradient-to-l from-black to-transparent pointer-events-none"}),(0,u.jsx)(Rt.motion.div,{className:"flex w-max gap-8 px-4",animate:{x:["0%","-33.33%"]},transition:{ease:"linear",duration:o,repeat:1/0},children:a.map((n,s)=>(0,u.jsx)(kt,{asset:n,layout:"marquee"},`${n.id}-${s}`))})]})},kt=({asset:e,layout:t})=>{let[o,a]=(0,Y.useState)(""),n=(0,Y.useRef)(e.price);(0,Y.useEffect)(()=>{let l=n.current;if(e.price!==l){let p=e.price>l;a(""),requestAnimationFrame(()=>{a(p?"flash-green":"flash-red")}),n.current=e.price}},[e.price]);let s=()=>{a("")},i=e.change24h>=0;return(0,u.jsxs)("div",{onAnimationEnd:s,className:`
|
|
14
|
+
flex items-center justify-between rounded-lg transition-colors duration-300
|
|
15
|
+
${t==="marquee"?"gap-4 py-1 px-3":"w-full p-4 hover:bg-gray-900/50"}
|
|
16
|
+
${o==="flash-green"?"animate-flash-green-bg":""}
|
|
17
|
+
${o==="flash-red"?"animate-flash-red-bg":""}
|
|
18
|
+
`,children:[(0,u.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,u.jsx)("span",{className:"font-medium md:font-bold text-white tracking-tighter md:tracking-wide",children:e.symbol}),t==="stack"&&(0,u.jsx)("span",{className:"md:text-xs md:text-zinc-400 md:font-medium hidden md:inline",children:e.name})]}),(0,u.jsxs)("div",{className:`flex items-center ${t==="marquee"?"gap-3":"gap-6"}`,children:[(0,u.jsxs)("span",{className:`
|
|
19
|
+
font-mono font-normal md:font-semibold tracking-tighter md:tracking-tight transition-colors duration-200
|
|
20
|
+
${o==="flash-green"?"text-green-400 font-bold":""}
|
|
21
|
+
${o==="flash-red"?"text-red-400 font-bold":""}
|
|
22
|
+
${o?"":"text-gray-100"}
|
|
23
|
+
`,children:["$",e.price.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),(0,u.jsxs)("span",{className:`flex items-end ml-0 text-xs font-normal md:font-semibold ${i?"text-green-500":"text-red-500"}`,children:[i?(0,u.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-0.5 h-3.5 w-3.5 lucide lucide-arrow-up-right-icon lucide-arrow-up-right",children:[(0,u.jsx)("path",{d:"M7 7h10v10"}),(0,u.jsx)("path",{d:"M7 17 17 7"})]}):(0,u.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-0.5 h-3.5 w-3.5 lucide lucide-arrow-down-right-icon lucide-arrow-down-right",children:[(0,u.jsx)("path",{d:"m7 7 10 10"}),(0,u.jsx)("path",{d:"M17 7v10H7"})]}),Math.abs(e.change24h).toFixed(2),"%"]})]})]})};var Je=require("class-variance-authority");var x=require("react/jsx-runtime"),Qt=(0,Je.cva)("inline-flex items-center justify-center gap-2 rounded-full pl-1.5 pr-3 py-1 text-xs font-semibold tracking-wide transition-all duration-200",{variants:{status:{successful:"bg-emerald-500/10 text-emerald-700 border border-emerald-500/20",failed:"bg-rose-500/10 text-rose-700 border border-rose-500/20",pending:"bg-indigo-500/10 text-indigo-700 border border-indigo-500/20",live:"bg-sky-500/10 text-sky-700 border border-sky-500/20"}},defaultVariants:{status:"pending"}}),Jt=(0,Je.cva)("inline-flex h-5 w-5 items-center justify-center rounded-full text-white shrink-0 transform-gpu subpixel-antialiased",{variants:{status:{successful:"bg-emerald-600/90",failed:"bg-rose-600/90 relative",pending:"bg-indigo-600/90 relative",live:"bg-sky-600/90 relative"}},defaultVariants:{status:"pending"}}),Nt=({children:e,status:t,className:o,...a})=>(0,x.jsxs)("span",{className:r(Qt({status:t}),o),...a,children:[(0,x.jsxs)("span",{className:r(Jt({status:t})),children:[t==="successful"&&(0,x.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-3 w-3 stroke-[3.5] block shrink-0 lucide lucide-check-icon lucide-check",children:(0,x.jsx)("path",{d:"M20 6 9 17l-5-5"})}),t==="failed"&&(0,x.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-3 w-3 stroke-[3.5] block shrink-0 lucide lucide-triangle-alert-icon lucide-triangle-alert",children:[(0,x.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),(0,x.jsx)("path",{d:"M12 9v4"}),(0,x.jsx)("path",{d:"M12 17h.01"})]}),t==="pending"&&(0,x.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-3 w-3 stroke-[3.5] block shrink-0 lucide lucide-clock-icon lucide-clock",children:[(0,x.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,x.jsx)("path",{d:"M12 6v6l4 2"})]}),t==="live"&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-white"}),(0,x.jsx)("span",{className:"absolute inset-0 rounded-full bg-sky-500 opacity-75 animate-ping"})]})]}),(0,x.jsx)("span",{className:"capitalize leading-none relative",children:e||t})]});var te=require("react"),Lt=require("class-variance-authority");var Ae=N(require("@radix-ui/react-toast"),1);var Pt=require("class-variance-authority");var E=N(require("@radix-ui/react-toast"),1),Ve=require("react"),St=require("framer-motion"),c=require("react/jsx-runtime"),Xt=(0,Pt.cva)("relative overflow-hidden max-w-[320px] p-3 text-sm md:max-w-[380px] md:p-4 lg:max-w-[440px] rounded-xl shadow-lg grid grid-cols-[auto_1fr_auto] gap-x-4 items-start border",{variants:{intent:{error:["bg-toast-error-bg","border-toast-error-border","text-toast-error-text"],warning:["bg-toast-warning-bg","border-toast-warning-border","text-toast-warning-text"],success:["bg-toast-success-bg","border-toast-success-border","text-toast-success-text"],info:["bg-toast-info-bg","border-toast-info-border","text-toast-info-text"]}},defaultVariants:{intent:"info"}}),Yt=({duration:e,open:t})=>(0,c.jsx)("div",{className:"absolute bottom-0 left-0 h-1 w-full bg-black/10 overflow-hidden",children:(0,c.jsx)(St.motion.div,{initial:{width:"100%"},animate:t?{width:"0%"}:{width:"100%"},transition:{duration:e/1e3,ease:"linear"},className:"h-full bg-current"})}),eo=()=>(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,c.jsx)("path",{d:"M20 6 9 17l-5-5"})}),to=()=>(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,c.jsx)("path",{d:"m15 9-6 6"}),(0,c.jsx)("path",{d:"m9 9 6 6"})]}),oo=()=>(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),(0,c.jsx)("path",{d:"M12 9v4"}),(0,c.jsx)("path",{d:"M12 17h.01"})]}),ao=()=>(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,c.jsx)("path",{d:"M12 16v-4"}),(0,c.jsx)("path",{d:"M12 8h.01"})]}),no={success:(0,c.jsx)(eo,{}),error:(0,c.jsx)(to,{}),warning:(0,c.jsx)(oo,{}),info:(0,c.jsx)(ao,{})},Mt=({intent:e,title:t,description:o,className:a,icon:n,action:s,duration:i=5e3,...l})=>{let[p,m]=(0,Ve.useState)(!1),S=n||no[e||"info"];return(0,Ve.useEffect)(()=>{m(!0)},[]),(0,c.jsxs)(E.Root,{onOpenChange:b=>{b||m(!1),l.onOpenChange?.(b)},className:r(Xt({intent:e}),a),duration:i,...l,children:[(0,c.jsx)("div",{className:"flex-shrink-0 pt-0.5",children:S}),(0,c.jsxs)("div",{className:"flex flex-col gap-1 pr-8",children:[(0,c.jsx)(E.Title,{className:"font-semibold",children:t}),(0,c.jsx)(E.Description,{className:"opacity-90",children:o})]}),(0,c.jsx)(E.Close,{className:"p-0.5 shrink-0 opacity-60 hover:opacity-100 transition-opacity cursor-pointer",children:(0,c.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 14 14",fill:"none",className:"w-[12px] h-[12px] block dark:text-white",children:(0,c.jsx)("path",{d:"M6.575 7.975L1.675 12.875C1.49167 13.0583 1.25833 13.15 0.975 13.15C0.691667 13.15 0.458333 13.0583 0.275 12.875C0.0916663 12.6917 0 12.4583 0 12.175C0 11.8917 0.0916663 11.6583 0.275 11.475L5.175 6.575L0.275 1.675C0.0916663 1.49167 0 1.25833 0 0.975C0 0.691667 0.0916663 0.458333 0.275 0.275C0.458333 0.0916663 0.691667 0 0.975 0C1.25833 0 1.49167 0.0916663 1.675 0.275L6.575 5.175L11.475 0.275C11.6583 0.0916663 11.8917 0 12.175 0C12.4583 0 12.6917 0.0916663 12.875 0.275C13.0583 0.458333 13.15 0.691667 13.15 0.975C13.15 1.25833 13.0583 1.49167 12.875 1.675L7.975 6.575L12.875 11.475C13.0583 11.6583 13.15 11.8917 13.15 12.175C13.15 12.4583 13.0583 12.6917 12.875 12.875C12.6917 13.0583 12.4583 13.15 12.175 13.15C11.8917 13.15 11.6583 13.0583 11.475 12.875L6.575 7.975Z",fill:"currentColor"})})}),(0,c.jsx)(Yt,{"data-testid":"toast-progress-bar",duration:i,open:p}),s&&(0,c.jsx)(E.Action,{altText:s?s.label:"",className:a,onClick:s?s.onClick:()=>{},children:s?.label})]})};var ee=require("react/jsx-runtime"),De=(0,te.createContext)(void 0),ro=(0,Lt.cva)("fixed z-[100] m-0 flex flex-col p-6 list-none outline-none overflow-hidden",{variants:{size:{sm:"top-1/4 right-0 w-full max-w-[320px] gap-2",md:"top-0 right-0 w-full max-w-[380px] gap-3",lg:"bottom-0 right-0 w-full max-w-[440px] gap-4"}},defaultVariants:{size:"lg"}}),It=({children:e,size:t,className:o})=>{let[a,n]=(0,te.useState)([]),s=l=>{let p=Math.random().toString(36).substring(2,9);n(m=>[...m,{id:p,...l}])},i=l=>{n(p=>p.filter(m=>m.id!==l))};return(0,ee.jsxs)(De.Provider,{value:{toasts:a,addToast:s,removeToast:i},children:[e,(0,ee.jsxs)(Ae.Provider,{children:[a.map(({id:l,...p})=>(0,ee.jsx)(Mt,{...p,onOpenChange:m=>{p.onOpenChange?.(m),m||setTimeout(()=>i(l),200)}},l)),(0,ee.jsx)(Ae.Viewport,{className:r(ro({size:t}),o)})]})]})},Vt=()=>{let e=(0,te.useContext)(De);if(!e)throw new Error("useToast must be used within a ToastProvider");return e};var Xe=N(require("react"),1),Be=N(require("@radix-ui/react-switch"),1),Ee=N(require("@radix-ui/react-checkbox"),1),oe=require("framer-motion"),ae=require("class-variance-authority");var k=require("react/jsx-runtime"),so=(0,ae.cva)(["relative inline-flex shrink-0 cursor-pointer items-center rounded-full transition-colors bg-toggle-primary-bg/20 disabled:cursor-not-allowed disabled:opacity-40","w-9 h-5 px-1","md:w-11 md:h-6 md:px-1","lg:w-14 lg:h-8 lg:px-1.5"]),io=(0,ae.cva)(["pointer-events-none block rounded-full shadow-md transition-transform bg-slate-50 data-[state=checked]:bg-toggle-primary-bg/90 data-[state=checked]:shadow-[var(--toggle-shadow)]","h-3 w-3 data-[state=checked]:translate-x-4","md:h-[18px] md:w-[18px] md:data-[state=checked]:translate-x-5","lg:h-6 lg:w-6 lg:data-[state=checked]:translate-x-6"]),Ye=Xe.default.forwardRef(({className:e,label:t,"aria-label":o,error:a,...n},s)=>(0,k.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,k.jsxs)("div",{className:"flex items-center gap-3",children:[(0,k.jsx)(Be.Root,{ref:s,"aria-label":o,className:r(so(),e),...n,children:(0,k.jsx)(Be.Thumb,{asChild:!0,children:(0,k.jsx)(oe.motion.span,{layout:!0,transition:{type:"spring",stiffness:500,damping:30},className:r(io())})})}),t&&(0,k.jsx)("label",{className:"text-sm font-medium leading-none text-slate-700 dark:text-slate-200 cursor-pointer",children:t})]}),(0,k.jsx)(oe.AnimatePresence,{children:a&&(0,k.jsx)(oe.motion.span,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"text-xs text-slate-600 font-medium pl-1",children:a})})]}));Ye.displayName="Toggle";var lo=(0,ae.cva)(["peer shrink-0 rounded-sm border-none bg-[#d4d9de] shadow-[inset_2px_2px_4px_#bebebe,inset_-2px_-2px_4px_#ffffff] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","h-4 w-4","md:h-5 md:w-5","lg:h-6 lg:w-6"]),co=(0,ae.cva)(["flex items-center justify-center text-current","[&_svg]:h-3 [&_svg]:w-3","md:[&_svg]:h-3.5 md:[&_svg]:w-3.5","lg:[&_svg]:h-4 lg:[&_svg]:w-4"]),et=Xe.default.forwardRef(({className:e,"aria-label":t,...o},a)=>(0,k.jsx)(Ee.Root,{ref:a,"aria-label":t,className:r(lo(),e),...o,children:(0,k.jsx)(Ee.Indicator,{className:r(co()),asChild:!0,children:(0,k.jsx)(oe.motion.div,{initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",stiffness:400,damping:20},children:(0,k.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#606770",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-check-icon lucide-check",children:(0,k.jsx)("path",{d:"M20 6 9 17l-5-5"})})})})}));et.displayName="CheckBox";var C=require("react/jsx-runtime"),po=({status:e,index:t})=>{let o="w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold border-2 transition-all duration-300 z-10 bg-white";switch(e){case"SUCCESS":return(0,C.jsx)("div",{className:`${o} border-green-500 bg-green-50 text-green-600`,children:"\u2713"});case"PROCESSING":return(0,C.jsx)("div",{className:`${o} border-blue-600 text-blue-600 animate-pulse ring-4 ring-blue-100`,children:(0,C.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-600 animate-ping"})});case"FAILED":return(0,C.jsx)("div",{className:`${o} border-red-500 bg-red-50 text-red-400`,children:"\u2715"});default:return(0,C.jsx)("div",{className:`${o} border-gray-300 text-gray-500`,children:t+1})}},At=({steps:e,className:t=""})=>(0,C.jsx)("div",{className:`w-full max-w-4xl mx-auto p-6 ${t}`,children:(0,C.jsxs)("div",{className:"flex items-center justify-between relative",children:[(0,C.jsx)("div",{className:"absolute top-4 left-0 right-0 h-0.5 bg-gray-200 -z-0"}),e.map((o,a)=>{let n=o.status==="SUCCESS",s=o.status==="PROCESSING",i=o.status==="FAILED";return(0,C.jsxs)("div",{className:"flex flex-col items-center flex-1 relative",children:[a>0&&(0,C.jsx)("div",{className:`absolute top-4 right-[50%] left-[-50%] h-0.5 transition-all duration-500 ${e[a]?.status==="SUCCESS"?"bg-green-500":e[a]?.status==="FAILED"?"bg-red-400":e[a-1]?.status==="SUCCESS"?"bg-green-500":"bg-gray-200"}`}),(0,C.jsx)(po,{status:o.status,index:a}),(0,C.jsxs)("div",{className:"mt-3 text-center px-2",children:[(0,C.jsx)("p",{className:`text-sm font-medium transition-colors duration-300 ${s?"text-blue-600 font-semibold":n?"text-gray-800":i?"text-red-600":"text-gray-500"}`,children:o.label}),o.description&&(0,C.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 max-w-[120px] mx-auto",children:o.description})]})]},o.id)})]})});0&&(module.exports={ActionButton,AssetCard,AssetCardGroup,AssetCardHeader,AssetCardIcon,AssetCardInfo,AssetCardMain,AssetCardRate,AssetCardRoot,AssetCardSparkline,AssetCardValue,AssetCardVisuals,CheckBox,CommandBar,CommandBarContainer,CommandEmpty,CommandGroup,CommandInput,CommandItem,CommandList,CommandSeparator,CopyField,CopyFieldButton,CopyFieldInput,CurrencyInput,CurrencyInputDropdown,CurrencyInputInput,CurrencyInputMaxButton,CurrencyInputRoot,DataTable,Modal,ModalAction,ModalBody,ModalCancel,ModalFooter,ModalHeader,ModalTrigger,PriceTicker,Stat,StatExtras,StatLabel,StatRoot,StatTrend,StatValue,StatusBadge,ToastContext,ToastProvider,Toggle,ToolTip,TransactionStepper,buttonVariants,useToast});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import * as React$1 from 'react';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
import * as Dialog from '@radix-ui/react-dialog';
|
|
7
|
+
import { Command } from 'cmdk';
|
|
8
|
+
import { PaginationState, SortingState } from '@tanstack/react-table';
|
|
9
|
+
import * as Toast from '@radix-ui/react-toast';
|
|
10
|
+
import * as Switch from '@radix-ui/react-switch';
|
|
11
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
12
|
+
import * as Tooltip from '@radix-ui/react-tooltip';
|
|
13
|
+
|
|
14
|
+
declare function ActionButtonLoader({ spinnerIntent, className }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
declare const buttonVariants$1: (props?: ({
|
|
16
|
+
intent?: "primary" | "secondary" | "danger" | "ghost" | null | undefined;
|
|
17
|
+
size?: "full" | "cut" | null | undefined;
|
|
18
|
+
isDisabled?: boolean | null | undefined;
|
|
19
|
+
isLoading?: boolean | null | undefined;
|
|
20
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
21
|
+
declare const spinnerVariants: (props?: ({
|
|
22
|
+
spinnerIntent?: "primary" | "secondary" | "danger" | "ghost" | null | undefined;
|
|
23
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
24
|
+
type ButtonIntent = VariantProps<typeof buttonVariants$1>["intent"];
|
|
25
|
+
type ButtonSize = VariantProps<typeof buttonVariants$1>["size"];
|
|
26
|
+
interface SpinnerProps extends VariantProps<typeof spinnerVariants>, React.AreaHTMLAttributes<HTMLDivElement> {
|
|
27
|
+
}
|
|
28
|
+
type ClassVariant$1 = VariantProps<typeof buttonVariants$1>;
|
|
29
|
+
interface ButtonProps extends ClassVariant$1, React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
30
|
+
intent?: ButtonIntent;
|
|
31
|
+
size?: ButtonSize;
|
|
32
|
+
isDisabled?: boolean;
|
|
33
|
+
isLoading?: boolean;
|
|
34
|
+
}
|
|
35
|
+
declare function ActionButton({ intent, size, isDisabled, isLoading, // Controlled from the outside
|
|
36
|
+
className, children, onClick, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
declare namespace ActionButton {
|
|
38
|
+
var Loader: typeof ActionButtonLoader;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare function ModalTrigger({ children }: {
|
|
42
|
+
children: React__default.ReactNode;
|
|
43
|
+
}): react_jsx_runtime.JSX.Element;
|
|
44
|
+
declare function ModalHeader({ children, className, }: {
|
|
45
|
+
children: React__default.ReactNode;
|
|
46
|
+
className?: string;
|
|
47
|
+
}): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare function ModalBody({ children, className, }: {
|
|
49
|
+
children: React__default.ReactNode;
|
|
50
|
+
className?: string;
|
|
51
|
+
}): react_jsx_runtime.JSX.Element;
|
|
52
|
+
declare function ModalFooter({ children, className, }: {
|
|
53
|
+
children: React__default.ReactNode;
|
|
54
|
+
className?: string;
|
|
55
|
+
}): react_jsx_runtime.JSX.Element;
|
|
56
|
+
declare function ModalCancel({ onClick, className, ...props }: {
|
|
57
|
+
onClick?: React__default.MouseEventHandler<HTMLButtonElement>;
|
|
58
|
+
className?: string;
|
|
59
|
+
}): react_jsx_runtime.JSX.Element;
|
|
60
|
+
declare function ModalAction({ action, className, onClick, ...props }: {
|
|
61
|
+
action?: React__default.ReactNode;
|
|
62
|
+
className?: string;
|
|
63
|
+
onClick?: React__default.MouseEventHandler<HTMLButtonElement>;
|
|
64
|
+
} & React__default.ComponentProps<"button">): react_jsx_runtime.JSX.Element;
|
|
65
|
+
declare const modalVariants: (props?: ({
|
|
66
|
+
intent?: "primary" | "secondary" | "danger" | "ghost" | null | undefined;
|
|
67
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
68
|
+
type ClassVariant = VariantProps<typeof modalVariants>;
|
|
69
|
+
interface ModalProps extends ClassVariant, Omit<React__default.ComponentPropsWithoutRef<typeof Dialog.Content>, "title"> {
|
|
70
|
+
isOpen: boolean;
|
|
71
|
+
onClose?: () => void;
|
|
72
|
+
onOpenChange?: (open: boolean) => void;
|
|
73
|
+
title?: React__default.ReactNode;
|
|
74
|
+
description?: React__default.ReactNode;
|
|
75
|
+
children: React__default.ReactNode;
|
|
76
|
+
footer?: React__default.ReactNode;
|
|
77
|
+
trigger?: React__default.ReactNode;
|
|
78
|
+
className?: string;
|
|
79
|
+
action?: React__default.ReactNode;
|
|
80
|
+
}
|
|
81
|
+
declare const Modal: {
|
|
82
|
+
({ isOpen: externalOpen, onOpenChange, onClose, children, trigger, className, footer, title, description, ...props }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
83
|
+
Trigger: typeof ModalTrigger;
|
|
84
|
+
Header: typeof ModalHeader;
|
|
85
|
+
Body: typeof ModalBody;
|
|
86
|
+
Footer: typeof ModalFooter;
|
|
87
|
+
Action: typeof ModalAction;
|
|
88
|
+
Cancel: typeof ModalCancel;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
declare const AssetCardRootVariants: (props?: ({
|
|
92
|
+
size?: "md" | "lg" | null | undefined;
|
|
93
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
94
|
+
interface AssetCardRootProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof AssetCardRootVariants> {
|
|
95
|
+
}
|
|
96
|
+
declare function AssetCardRoot({ className, size, children, ...props }: AssetCardRootProps): react_jsx_runtime.JSX.Element;
|
|
97
|
+
declare function AssetCardHeader({ className, children, ...props }: React$1.HTMLAttributes<HTMLElement>): react_jsx_runtime.JSX.Element;
|
|
98
|
+
declare function AssetCardIcon({ className, children, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
99
|
+
declare function AssetCardGroup({ className, children, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
100
|
+
declare function AssetCardMain({ className, children, ...props }: React$1.HTMLAttributes<HTMLElement>): react_jsx_runtime.JSX.Element;
|
|
101
|
+
declare function AssetCardInfo({ className, children, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
102
|
+
declare function AssetCardValue({ className, children, ...props }: React$1.HTMLAttributes<HTMLHeadingElement>): react_jsx_runtime.JSX.Element;
|
|
103
|
+
interface AssetCardRateProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
104
|
+
rate: number;
|
|
105
|
+
}
|
|
106
|
+
declare function AssetCardRate({ className, rate, ...props }: AssetCardRateProps): react_jsx_runtime.JSX.Element;
|
|
107
|
+
declare function AssetCardVisuals({ className, children, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
108
|
+
interface SparklineProps extends React$1.SVGProps<SVGSVGElement> {
|
|
109
|
+
data: number[];
|
|
110
|
+
width?: number;
|
|
111
|
+
height?: number;
|
|
112
|
+
strokeWidth?: number;
|
|
113
|
+
}
|
|
114
|
+
declare const AssetCardSparkline: React$1.FC<SparklineProps>;
|
|
115
|
+
declare const AssetCard: {
|
|
116
|
+
Root: typeof AssetCardRoot;
|
|
117
|
+
Header: typeof AssetCardHeader;
|
|
118
|
+
Main: typeof AssetCardMain;
|
|
119
|
+
Group: typeof AssetCardGroup;
|
|
120
|
+
Info: typeof AssetCardInfo;
|
|
121
|
+
Icon: typeof AssetCardIcon;
|
|
122
|
+
Rate: typeof AssetCardRate;
|
|
123
|
+
Value: typeof AssetCardValue;
|
|
124
|
+
Visuals: typeof AssetCardVisuals;
|
|
125
|
+
Sparkline: React$1.FC<SparklineProps>;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
interface CommandBarContainerProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "value" | "defaultValue"> {
|
|
129
|
+
className?: string;
|
|
130
|
+
}
|
|
131
|
+
declare const CommandBarContainer: React$1.ForwardRefExoticComponent<CommandBarContainerProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
132
|
+
interface CommandInputProps extends Omit<React$1.ComponentPropsWithoutRef<typeof Command.Input>, "size"> {
|
|
133
|
+
className?: string;
|
|
134
|
+
}
|
|
135
|
+
declare const CommandInput: React$1.ForwardRefExoticComponent<CommandInputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
136
|
+
interface CommandListProps extends React$1.ComponentPropsWithoutRef<typeof Command.List> {
|
|
137
|
+
className?: string;
|
|
138
|
+
}
|
|
139
|
+
declare const CommandList: React$1.ForwardRefExoticComponent<CommandListProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
140
|
+
declare const CommandEmpty: React$1.ForwardRefExoticComponent<Omit<{
|
|
141
|
+
children?: React$1.ReactNode;
|
|
142
|
+
} & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
|
|
143
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
144
|
+
} & {
|
|
145
|
+
asChild?: boolean;
|
|
146
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
147
|
+
interface CommandGroupContainerProps extends Omit<React$1.ComponentPropsWithoutRef<typeof Command.Group>, "heading"> {
|
|
148
|
+
heading: string;
|
|
149
|
+
defaultExpanded?: boolean;
|
|
150
|
+
}
|
|
151
|
+
declare const CommandGroup: React$1.ForwardRefExoticComponent<CommandGroupContainerProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
152
|
+
declare const CommandItem: React$1.ForwardRefExoticComponent<Omit<{
|
|
153
|
+
children?: React$1.ReactNode;
|
|
154
|
+
} & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
|
|
155
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
156
|
+
} & {
|
|
157
|
+
asChild?: boolean;
|
|
158
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild">, "disabled" | "value" | "onSelect"> & {
|
|
159
|
+
disabled?: boolean;
|
|
160
|
+
onSelect?: (value: string) => void;
|
|
161
|
+
value?: string;
|
|
162
|
+
keywords?: string[];
|
|
163
|
+
forceMount?: boolean;
|
|
164
|
+
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
165
|
+
declare const CommandSeparator: React$1.ForwardRefExoticComponent<Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
|
|
166
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
167
|
+
} & {
|
|
168
|
+
asChild?: boolean;
|
|
169
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
170
|
+
alwaysRender?: boolean;
|
|
171
|
+
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
172
|
+
declare const CommandBar: {
|
|
173
|
+
Root: React$1.ForwardRefExoticComponent<CommandBarContainerProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
174
|
+
Input: React$1.ForwardRefExoticComponent<CommandInputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
175
|
+
List: React$1.ForwardRefExoticComponent<CommandListProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
176
|
+
Empty: React$1.ForwardRefExoticComponent<Omit<{
|
|
177
|
+
children?: React$1.ReactNode;
|
|
178
|
+
} & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
|
|
179
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
180
|
+
} & {
|
|
181
|
+
asChild?: boolean;
|
|
182
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
183
|
+
Group: React$1.ForwardRefExoticComponent<CommandGroupContainerProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
184
|
+
Item: React$1.ForwardRefExoticComponent<Omit<{
|
|
185
|
+
children?: React$1.ReactNode;
|
|
186
|
+
} & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
|
|
187
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
188
|
+
} & {
|
|
189
|
+
asChild?: boolean;
|
|
190
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild">, "disabled" | "value" | "onSelect"> & {
|
|
191
|
+
disabled?: boolean;
|
|
192
|
+
onSelect?: (value: string) => void;
|
|
193
|
+
value?: string;
|
|
194
|
+
keywords?: string[];
|
|
195
|
+
forceMount?: boolean;
|
|
196
|
+
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
197
|
+
Separator: React$1.ForwardRefExoticComponent<Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
|
|
198
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
199
|
+
} & {
|
|
200
|
+
asChild?: boolean;
|
|
201
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
202
|
+
alwaysRender?: boolean;
|
|
203
|
+
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
declare const buttonVariants: (props?: ({
|
|
207
|
+
intent?: "primary" | "secondary" | "ghost" | null | undefined;
|
|
208
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
209
|
+
declare function CopyFieldInput({ className, value, }: {
|
|
210
|
+
className?: string;
|
|
211
|
+
value: string;
|
|
212
|
+
}): react_jsx_runtime.JSX.Element;
|
|
213
|
+
declare function CopyFieldButton({ className, handleClick, copied, intent, }: {
|
|
214
|
+
className?: string;
|
|
215
|
+
handleClick: () => Promise<void>;
|
|
216
|
+
copied: boolean;
|
|
217
|
+
intent?: "primary" | "secondary" | "ghost";
|
|
218
|
+
}): react_jsx_runtime.JSX.Element;
|
|
219
|
+
interface CopyFieldProps {
|
|
220
|
+
value: string;
|
|
221
|
+
className?: string;
|
|
222
|
+
intent?: VariantProps<typeof buttonVariants>["intent"];
|
|
223
|
+
}
|
|
224
|
+
declare const CopyField: {
|
|
225
|
+
({ value, className, intent }: CopyFieldProps): react_jsx_runtime.JSX.Element;
|
|
226
|
+
Input: typeof CopyFieldInput;
|
|
227
|
+
Button: typeof CopyFieldButton;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
declare const currencyInputVariants: (props?: ({
|
|
231
|
+
size?: "lg" | "default" | "sm" | null | undefined;
|
|
232
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
233
|
+
interface RootProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "onChange">, VariantProps<typeof currencyInputVariants> {
|
|
234
|
+
value: string;
|
|
235
|
+
onChange: (value: string) => void;
|
|
236
|
+
decimals?: number;
|
|
237
|
+
disabled?: boolean;
|
|
238
|
+
onMax?: () => void;
|
|
239
|
+
currency: string;
|
|
240
|
+
onCurrencyChange?: (currency: string) => void;
|
|
241
|
+
}
|
|
242
|
+
declare const Root$1: React$1.ForwardRefExoticComponent<RootProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
243
|
+
interface MaxButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
244
|
+
className?: string;
|
|
245
|
+
}
|
|
246
|
+
declare const MaxButton: React$1.ForwardRefExoticComponent<MaxButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
247
|
+
declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange"> & React$1.RefAttributes<HTMLInputElement>>;
|
|
248
|
+
declare const Dropdown: React$1.ForwardRefExoticComponent<React$1.SelectHTMLAttributes<HTMLSelectElement> & {
|
|
249
|
+
options: string[];
|
|
250
|
+
className?: string;
|
|
251
|
+
} & React$1.RefAttributes<HTMLSelectElement>>;
|
|
252
|
+
declare const CurrencyInput: {
|
|
253
|
+
Root: React$1.ForwardRefExoticComponent<RootProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
254
|
+
MaxButton: React$1.ForwardRefExoticComponent<MaxButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
255
|
+
Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange"> & React$1.RefAttributes<HTMLInputElement>>;
|
|
256
|
+
Dropdown: React$1.ForwardRefExoticComponent<React$1.SelectHTMLAttributes<HTMLSelectElement> & {
|
|
257
|
+
options: string[];
|
|
258
|
+
className?: string;
|
|
259
|
+
} & React$1.RefAttributes<HTMLSelectElement>>;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
interface ColumnConfig {
|
|
263
|
+
accessorKey: string;
|
|
264
|
+
title: string;
|
|
265
|
+
}
|
|
266
|
+
interface DataTableProps<TData> {
|
|
267
|
+
columns: ColumnConfig[];
|
|
268
|
+
data: TData[];
|
|
269
|
+
/**
|
|
270
|
+
* Controls the global loading skeleton state.
|
|
271
|
+
* When true, replaces data rows with shimmer blocks.
|
|
272
|
+
* @default false
|
|
273
|
+
*/
|
|
274
|
+
isLoading?: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* The number of skeleton rows to render while isLoading is true.
|
|
277
|
+
* Should perfectly match your pagination page size to prevent layout jumps.
|
|
278
|
+
* @default 10
|
|
279
|
+
*/
|
|
280
|
+
skeletonRowCount?: number;
|
|
281
|
+
/**
|
|
282
|
+
* Enables row highlighting / hover effects.
|
|
283
|
+
* Set to false if you want a plain flat table design.
|
|
284
|
+
* @default true
|
|
285
|
+
*/
|
|
286
|
+
enableHoverHighlight?: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* When true, the component calculates page slicing internally (Client-side).
|
|
289
|
+
* When false, it assumes the parent component is feeding it pre-sliced data (Server-side).
|
|
290
|
+
* @default true
|
|
291
|
+
*/
|
|
292
|
+
paginateInternally?: boolean;
|
|
293
|
+
/**
|
|
294
|
+
* The total count of rows across the entire database.
|
|
295
|
+
* Crucial for Server-side pagination so the bottom bar knows total pages.
|
|
296
|
+
*/
|
|
297
|
+
totalRowCount?: number;
|
|
298
|
+
paginationState?: PaginationState;
|
|
299
|
+
onPaginationChange?: (pagination: PaginationState) => void;
|
|
300
|
+
sortingState?: SortingState;
|
|
301
|
+
onSortingChange?: (sorting: SortingState) => void;
|
|
302
|
+
}
|
|
303
|
+
declare function DataTable<TData>({ columns: userColumns, data, isLoading, skeletonRowCount, enableHoverHighlight, paginateInternally, totalRowCount, paginationState, onPaginationChange, sortingState, onSortingChange, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
304
|
+
|
|
305
|
+
interface StatProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
306
|
+
children: React__default.ReactNode;
|
|
307
|
+
}
|
|
308
|
+
interface ValueProps extends Omit<React__default.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
309
|
+
value: number;
|
|
310
|
+
duration?: number;
|
|
311
|
+
formatter?: (value: number) => string;
|
|
312
|
+
}
|
|
313
|
+
declare function Label({ className, children, ...props }: React__default.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
|
|
314
|
+
declare namespace Label {
|
|
315
|
+
var displayName: string;
|
|
316
|
+
}
|
|
317
|
+
declare function Trend({ value, trendType, className, ...props }: Omit<React__default.HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
318
|
+
value: number;
|
|
319
|
+
trendType?: "positive-up" | "negative-up" | "neutral";
|
|
320
|
+
}): react_jsx_runtime.JSX.Element;
|
|
321
|
+
declare namespace Trend {
|
|
322
|
+
var displayName: string;
|
|
323
|
+
}
|
|
324
|
+
declare const Value: {
|
|
325
|
+
({ value, duration, formatter, className, ...props }: ValueProps): react_jsx_runtime.JSX.Element;
|
|
326
|
+
displayName: string;
|
|
327
|
+
};
|
|
328
|
+
declare function Extras({ className, children, ...props }: React__default.HTMLAttributes<HTMLElement>): react_jsx_runtime.JSX.Element;
|
|
329
|
+
declare namespace Extras {
|
|
330
|
+
var displayName: string;
|
|
331
|
+
}
|
|
332
|
+
declare const Root: {
|
|
333
|
+
({ className, children, ...props }: StatProps): react_jsx_runtime.JSX.Element;
|
|
334
|
+
displayName: string;
|
|
335
|
+
};
|
|
336
|
+
declare const Stat: {
|
|
337
|
+
Root: {
|
|
338
|
+
({ className, children, ...props }: StatProps): react_jsx_runtime.JSX.Element;
|
|
339
|
+
displayName: string;
|
|
340
|
+
};
|
|
341
|
+
Label: typeof Label;
|
|
342
|
+
Trend: typeof Trend;
|
|
343
|
+
Value: {
|
|
344
|
+
({ value, duration, formatter, className, ...props }: ValueProps): react_jsx_runtime.JSX.Element;
|
|
345
|
+
displayName: string;
|
|
346
|
+
};
|
|
347
|
+
Extras: typeof Extras;
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
interface TickerAsset {
|
|
351
|
+
id: string;
|
|
352
|
+
symbol: string;
|
|
353
|
+
name: string;
|
|
354
|
+
price: number;
|
|
355
|
+
change24h: number;
|
|
356
|
+
}
|
|
357
|
+
interface PriceTickerProps {
|
|
358
|
+
assets: TickerAsset[];
|
|
359
|
+
variant?: "marquee" | "stack";
|
|
360
|
+
speed?: number;
|
|
361
|
+
}
|
|
362
|
+
declare const PriceTicker: ({ assets, variant, speed, }: PriceTickerProps) => react_jsx_runtime.JSX.Element;
|
|
363
|
+
|
|
364
|
+
declare const badgeVariants: (props?: ({
|
|
365
|
+
status?: "successful" | "failed" | "pending" | "live" | null | undefined;
|
|
366
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
367
|
+
interface StatusBadgeProps extends React__default.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
368
|
+
children: string;
|
|
369
|
+
status: "successful" | "pending" | "failed" | "live";
|
|
370
|
+
className?: string;
|
|
371
|
+
}
|
|
372
|
+
declare const StatusBadge: ({ children, status, className, ...props }: StatusBadgeProps) => react_jsx_runtime.JSX.Element;
|
|
373
|
+
|
|
374
|
+
declare const ToastVariants: (props?: ({
|
|
375
|
+
intent?: "error" | "warning" | "success" | "info" | null | undefined;
|
|
376
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
377
|
+
interface ToastProps$1 extends VariantProps<typeof ToastVariants>, Toast.ToastProps {
|
|
378
|
+
title?: string;
|
|
379
|
+
description: string;
|
|
380
|
+
icon?: React__default.ReactNode | string;
|
|
381
|
+
className?: string;
|
|
382
|
+
viewPort?: string;
|
|
383
|
+
action?: {
|
|
384
|
+
label: string;
|
|
385
|
+
onClick: () => void;
|
|
386
|
+
};
|
|
387
|
+
closeButton?: React__default.ReactNode;
|
|
388
|
+
duration?: number;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
interface ToastProviderProps {
|
|
392
|
+
children: React__default.ReactNode;
|
|
393
|
+
size?: "sm" | "md" | "lg";
|
|
394
|
+
className?: string;
|
|
395
|
+
}
|
|
396
|
+
interface ToastInstance extends ToastProps {
|
|
397
|
+
id: string;
|
|
398
|
+
}
|
|
399
|
+
interface ToastProps extends VariantProps<typeof ToastVariants>, Toast.ToastProps {
|
|
400
|
+
title?: string;
|
|
401
|
+
description: string;
|
|
402
|
+
icon?: React__default.ReactNode | string;
|
|
403
|
+
className?: string;
|
|
404
|
+
viewPort?: string;
|
|
405
|
+
action?: {
|
|
406
|
+
label: string;
|
|
407
|
+
onClick: () => void;
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
declare const ToastProvider: ({ children, size, className, }: ToastProviderProps) => react_jsx_runtime.JSX.Element;
|
|
412
|
+
declare const useToast: () => ToastContext;
|
|
413
|
+
declare const ToastContext: React$1.Context<ToastContext | undefined>;
|
|
414
|
+
interface ToastContext {
|
|
415
|
+
toasts: ToastInstance[];
|
|
416
|
+
addToast: (toast: ToastProps) => void;
|
|
417
|
+
removeToast: (id: string) => void;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
interface ToggleProps extends React__default.ComponentPropsWithoutRef<typeof Switch.Root> {
|
|
421
|
+
label?: string;
|
|
422
|
+
error?: string;
|
|
423
|
+
"aria-label"?: string;
|
|
424
|
+
}
|
|
425
|
+
declare const Toggle: React__default.ForwardRefExoticComponent<ToggleProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
426
|
+
interface CheckBoxProps extends React__default.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
|
|
427
|
+
"aria-label"?: string;
|
|
428
|
+
}
|
|
429
|
+
declare const CheckBox: React__default.ForwardRefExoticComponent<CheckBoxProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
430
|
+
|
|
431
|
+
interface ToolTipProps {
|
|
432
|
+
header?: React__default.ReactNode;
|
|
433
|
+
trigger?: React__default.ReactNode;
|
|
434
|
+
children?: React__default.ReactNode;
|
|
435
|
+
className?: string;
|
|
436
|
+
}
|
|
437
|
+
declare const ToolTip: ({ header, trigger, children, className, ...props }: ToolTipProps & Tooltip.TooltipProps) => react_jsx_runtime.JSX.Element;
|
|
438
|
+
|
|
439
|
+
type StepStatus = "PENDING" | "PROCESSING" | "SUCCESS" | "FAILED";
|
|
440
|
+
interface TransactionStep {
|
|
441
|
+
id: string;
|
|
442
|
+
label: string;
|
|
443
|
+
status: StepStatus;
|
|
444
|
+
description?: string;
|
|
445
|
+
}
|
|
446
|
+
interface TransactionStepperProps {
|
|
447
|
+
steps: TransactionStep[];
|
|
448
|
+
className?: string;
|
|
449
|
+
}
|
|
450
|
+
declare const TransactionStepper: React__default.FC<TransactionStepperProps>;
|
|
451
|
+
|
|
452
|
+
export { ActionButton, AssetCard, AssetCardGroup, AssetCardHeader, AssetCardIcon, AssetCardInfo, AssetCardMain, AssetCardRate, type AssetCardRateProps, AssetCardRoot, type AssetCardRootProps, AssetCardSparkline, type SparklineProps as AssetCardSparklineProps, AssetCardValue, AssetCardVisuals, type ButtonProps, CheckBox, type ColumnConfig, CommandBar, CommandBarContainer, type CommandBarContainerProps, CommandEmpty, CommandGroup, type CommandGroupContainerProps, CommandInput, type CommandInputProps, CommandItem, CommandList, type CommandListProps, CommandSeparator, CopyField, CopyFieldButton, CopyFieldInput, type CopyFieldProps, CurrencyInput, Dropdown as CurrencyInputDropdown, Input as CurrencyInputInput, MaxButton as CurrencyInputMaxButton, Root$1 as CurrencyInputRoot, type RootProps as CurrencyInputRootProps, DataTable, type DataTableProps, Modal, ModalAction, ModalBody, ModalCancel, ModalFooter, ModalHeader, type ModalProps, ModalTrigger, PriceTicker, type PriceTickerProps, Stat, Extras as StatExtras, Label as StatLabel, type StatProps, Root as StatRoot, Trend as StatTrend, Value as StatValue, type ValueProps as StatValueProps, StatusBadge, type StatusBadgeProps, type StepStatus, type TickerAsset, ToastContext, type ToastProps$1 as ToastProps, ToastProvider, Toggle, type ToggleProps, ToolTip, type TransactionStep, TransactionStepper, type TransactionStepperProps, buttonVariants$1 as buttonVariants, useToast };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import * as React$1 from 'react';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
import * as Dialog from '@radix-ui/react-dialog';
|
|
7
|
+
import { Command } from 'cmdk';
|
|
8
|
+
import { PaginationState, SortingState } from '@tanstack/react-table';
|
|
9
|
+
import * as Toast from '@radix-ui/react-toast';
|
|
10
|
+
import * as Switch from '@radix-ui/react-switch';
|
|
11
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
12
|
+
import * as Tooltip from '@radix-ui/react-tooltip';
|
|
13
|
+
|
|
14
|
+
declare function ActionButtonLoader({ spinnerIntent, className }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
declare const buttonVariants$1: (props?: ({
|
|
16
|
+
intent?: "primary" | "secondary" | "danger" | "ghost" | null | undefined;
|
|
17
|
+
size?: "full" | "cut" | null | undefined;
|
|
18
|
+
isDisabled?: boolean | null | undefined;
|
|
19
|
+
isLoading?: boolean | null | undefined;
|
|
20
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
21
|
+
declare const spinnerVariants: (props?: ({
|
|
22
|
+
spinnerIntent?: "primary" | "secondary" | "danger" | "ghost" | null | undefined;
|
|
23
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
24
|
+
type ButtonIntent = VariantProps<typeof buttonVariants$1>["intent"];
|
|
25
|
+
type ButtonSize = VariantProps<typeof buttonVariants$1>["size"];
|
|
26
|
+
interface SpinnerProps extends VariantProps<typeof spinnerVariants>, React.AreaHTMLAttributes<HTMLDivElement> {
|
|
27
|
+
}
|
|
28
|
+
type ClassVariant$1 = VariantProps<typeof buttonVariants$1>;
|
|
29
|
+
interface ButtonProps extends ClassVariant$1, React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
30
|
+
intent?: ButtonIntent;
|
|
31
|
+
size?: ButtonSize;
|
|
32
|
+
isDisabled?: boolean;
|
|
33
|
+
isLoading?: boolean;
|
|
34
|
+
}
|
|
35
|
+
declare function ActionButton({ intent, size, isDisabled, isLoading, // Controlled from the outside
|
|
36
|
+
className, children, onClick, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
declare namespace ActionButton {
|
|
38
|
+
var Loader: typeof ActionButtonLoader;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare function ModalTrigger({ children }: {
|
|
42
|
+
children: React__default.ReactNode;
|
|
43
|
+
}): react_jsx_runtime.JSX.Element;
|
|
44
|
+
declare function ModalHeader({ children, className, }: {
|
|
45
|
+
children: React__default.ReactNode;
|
|
46
|
+
className?: string;
|
|
47
|
+
}): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare function ModalBody({ children, className, }: {
|
|
49
|
+
children: React__default.ReactNode;
|
|
50
|
+
className?: string;
|
|
51
|
+
}): react_jsx_runtime.JSX.Element;
|
|
52
|
+
declare function ModalFooter({ children, className, }: {
|
|
53
|
+
children: React__default.ReactNode;
|
|
54
|
+
className?: string;
|
|
55
|
+
}): react_jsx_runtime.JSX.Element;
|
|
56
|
+
declare function ModalCancel({ onClick, className, ...props }: {
|
|
57
|
+
onClick?: React__default.MouseEventHandler<HTMLButtonElement>;
|
|
58
|
+
className?: string;
|
|
59
|
+
}): react_jsx_runtime.JSX.Element;
|
|
60
|
+
declare function ModalAction({ action, className, onClick, ...props }: {
|
|
61
|
+
action?: React__default.ReactNode;
|
|
62
|
+
className?: string;
|
|
63
|
+
onClick?: React__default.MouseEventHandler<HTMLButtonElement>;
|
|
64
|
+
} & React__default.ComponentProps<"button">): react_jsx_runtime.JSX.Element;
|
|
65
|
+
declare const modalVariants: (props?: ({
|
|
66
|
+
intent?: "primary" | "secondary" | "danger" | "ghost" | null | undefined;
|
|
67
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
68
|
+
type ClassVariant = VariantProps<typeof modalVariants>;
|
|
69
|
+
interface ModalProps extends ClassVariant, Omit<React__default.ComponentPropsWithoutRef<typeof Dialog.Content>, "title"> {
|
|
70
|
+
isOpen: boolean;
|
|
71
|
+
onClose?: () => void;
|
|
72
|
+
onOpenChange?: (open: boolean) => void;
|
|
73
|
+
title?: React__default.ReactNode;
|
|
74
|
+
description?: React__default.ReactNode;
|
|
75
|
+
children: React__default.ReactNode;
|
|
76
|
+
footer?: React__default.ReactNode;
|
|
77
|
+
trigger?: React__default.ReactNode;
|
|
78
|
+
className?: string;
|
|
79
|
+
action?: React__default.ReactNode;
|
|
80
|
+
}
|
|
81
|
+
declare const Modal: {
|
|
82
|
+
({ isOpen: externalOpen, onOpenChange, onClose, children, trigger, className, footer, title, description, ...props }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
83
|
+
Trigger: typeof ModalTrigger;
|
|
84
|
+
Header: typeof ModalHeader;
|
|
85
|
+
Body: typeof ModalBody;
|
|
86
|
+
Footer: typeof ModalFooter;
|
|
87
|
+
Action: typeof ModalAction;
|
|
88
|
+
Cancel: typeof ModalCancel;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
declare const AssetCardRootVariants: (props?: ({
|
|
92
|
+
size?: "md" | "lg" | null | undefined;
|
|
93
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
94
|
+
interface AssetCardRootProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof AssetCardRootVariants> {
|
|
95
|
+
}
|
|
96
|
+
declare function AssetCardRoot({ className, size, children, ...props }: AssetCardRootProps): react_jsx_runtime.JSX.Element;
|
|
97
|
+
declare function AssetCardHeader({ className, children, ...props }: React$1.HTMLAttributes<HTMLElement>): react_jsx_runtime.JSX.Element;
|
|
98
|
+
declare function AssetCardIcon({ className, children, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
99
|
+
declare function AssetCardGroup({ className, children, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
100
|
+
declare function AssetCardMain({ className, children, ...props }: React$1.HTMLAttributes<HTMLElement>): react_jsx_runtime.JSX.Element;
|
|
101
|
+
declare function AssetCardInfo({ className, children, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
102
|
+
declare function AssetCardValue({ className, children, ...props }: React$1.HTMLAttributes<HTMLHeadingElement>): react_jsx_runtime.JSX.Element;
|
|
103
|
+
interface AssetCardRateProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
104
|
+
rate: number;
|
|
105
|
+
}
|
|
106
|
+
declare function AssetCardRate({ className, rate, ...props }: AssetCardRateProps): react_jsx_runtime.JSX.Element;
|
|
107
|
+
declare function AssetCardVisuals({ className, children, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
108
|
+
interface SparklineProps extends React$1.SVGProps<SVGSVGElement> {
|
|
109
|
+
data: number[];
|
|
110
|
+
width?: number;
|
|
111
|
+
height?: number;
|
|
112
|
+
strokeWidth?: number;
|
|
113
|
+
}
|
|
114
|
+
declare const AssetCardSparkline: React$1.FC<SparklineProps>;
|
|
115
|
+
declare const AssetCard: {
|
|
116
|
+
Root: typeof AssetCardRoot;
|
|
117
|
+
Header: typeof AssetCardHeader;
|
|
118
|
+
Main: typeof AssetCardMain;
|
|
119
|
+
Group: typeof AssetCardGroup;
|
|
120
|
+
Info: typeof AssetCardInfo;
|
|
121
|
+
Icon: typeof AssetCardIcon;
|
|
122
|
+
Rate: typeof AssetCardRate;
|
|
123
|
+
Value: typeof AssetCardValue;
|
|
124
|
+
Visuals: typeof AssetCardVisuals;
|
|
125
|
+
Sparkline: React$1.FC<SparklineProps>;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
interface CommandBarContainerProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "value" | "defaultValue"> {
|
|
129
|
+
className?: string;
|
|
130
|
+
}
|
|
131
|
+
declare const CommandBarContainer: React$1.ForwardRefExoticComponent<CommandBarContainerProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
132
|
+
interface CommandInputProps extends Omit<React$1.ComponentPropsWithoutRef<typeof Command.Input>, "size"> {
|
|
133
|
+
className?: string;
|
|
134
|
+
}
|
|
135
|
+
declare const CommandInput: React$1.ForwardRefExoticComponent<CommandInputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
136
|
+
interface CommandListProps extends React$1.ComponentPropsWithoutRef<typeof Command.List> {
|
|
137
|
+
className?: string;
|
|
138
|
+
}
|
|
139
|
+
declare const CommandList: React$1.ForwardRefExoticComponent<CommandListProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
140
|
+
declare const CommandEmpty: React$1.ForwardRefExoticComponent<Omit<{
|
|
141
|
+
children?: React$1.ReactNode;
|
|
142
|
+
} & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
|
|
143
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
144
|
+
} & {
|
|
145
|
+
asChild?: boolean;
|
|
146
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
147
|
+
interface CommandGroupContainerProps extends Omit<React$1.ComponentPropsWithoutRef<typeof Command.Group>, "heading"> {
|
|
148
|
+
heading: string;
|
|
149
|
+
defaultExpanded?: boolean;
|
|
150
|
+
}
|
|
151
|
+
declare const CommandGroup: React$1.ForwardRefExoticComponent<CommandGroupContainerProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
152
|
+
declare const CommandItem: React$1.ForwardRefExoticComponent<Omit<{
|
|
153
|
+
children?: React$1.ReactNode;
|
|
154
|
+
} & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
|
|
155
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
156
|
+
} & {
|
|
157
|
+
asChild?: boolean;
|
|
158
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild">, "disabled" | "value" | "onSelect"> & {
|
|
159
|
+
disabled?: boolean;
|
|
160
|
+
onSelect?: (value: string) => void;
|
|
161
|
+
value?: string;
|
|
162
|
+
keywords?: string[];
|
|
163
|
+
forceMount?: boolean;
|
|
164
|
+
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
165
|
+
declare const CommandSeparator: React$1.ForwardRefExoticComponent<Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
|
|
166
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
167
|
+
} & {
|
|
168
|
+
asChild?: boolean;
|
|
169
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
170
|
+
alwaysRender?: boolean;
|
|
171
|
+
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
172
|
+
declare const CommandBar: {
|
|
173
|
+
Root: React$1.ForwardRefExoticComponent<CommandBarContainerProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
174
|
+
Input: React$1.ForwardRefExoticComponent<CommandInputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
175
|
+
List: React$1.ForwardRefExoticComponent<CommandListProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
176
|
+
Empty: React$1.ForwardRefExoticComponent<Omit<{
|
|
177
|
+
children?: React$1.ReactNode;
|
|
178
|
+
} & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
|
|
179
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
180
|
+
} & {
|
|
181
|
+
asChild?: boolean;
|
|
182
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
183
|
+
Group: React$1.ForwardRefExoticComponent<CommandGroupContainerProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
184
|
+
Item: React$1.ForwardRefExoticComponent<Omit<{
|
|
185
|
+
children?: React$1.ReactNode;
|
|
186
|
+
} & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
|
|
187
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
188
|
+
} & {
|
|
189
|
+
asChild?: boolean;
|
|
190
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild">, "disabled" | "value" | "onSelect"> & {
|
|
191
|
+
disabled?: boolean;
|
|
192
|
+
onSelect?: (value: string) => void;
|
|
193
|
+
value?: string;
|
|
194
|
+
keywords?: string[];
|
|
195
|
+
forceMount?: boolean;
|
|
196
|
+
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
197
|
+
Separator: React$1.ForwardRefExoticComponent<Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
|
|
198
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
199
|
+
} & {
|
|
200
|
+
asChild?: boolean;
|
|
201
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
202
|
+
alwaysRender?: boolean;
|
|
203
|
+
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
declare const buttonVariants: (props?: ({
|
|
207
|
+
intent?: "primary" | "secondary" | "ghost" | null | undefined;
|
|
208
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
209
|
+
declare function CopyFieldInput({ className, value, }: {
|
|
210
|
+
className?: string;
|
|
211
|
+
value: string;
|
|
212
|
+
}): react_jsx_runtime.JSX.Element;
|
|
213
|
+
declare function CopyFieldButton({ className, handleClick, copied, intent, }: {
|
|
214
|
+
className?: string;
|
|
215
|
+
handleClick: () => Promise<void>;
|
|
216
|
+
copied: boolean;
|
|
217
|
+
intent?: "primary" | "secondary" | "ghost";
|
|
218
|
+
}): react_jsx_runtime.JSX.Element;
|
|
219
|
+
interface CopyFieldProps {
|
|
220
|
+
value: string;
|
|
221
|
+
className?: string;
|
|
222
|
+
intent?: VariantProps<typeof buttonVariants>["intent"];
|
|
223
|
+
}
|
|
224
|
+
declare const CopyField: {
|
|
225
|
+
({ value, className, intent }: CopyFieldProps): react_jsx_runtime.JSX.Element;
|
|
226
|
+
Input: typeof CopyFieldInput;
|
|
227
|
+
Button: typeof CopyFieldButton;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
declare const currencyInputVariants: (props?: ({
|
|
231
|
+
size?: "lg" | "default" | "sm" | null | undefined;
|
|
232
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
233
|
+
interface RootProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "onChange">, VariantProps<typeof currencyInputVariants> {
|
|
234
|
+
value: string;
|
|
235
|
+
onChange: (value: string) => void;
|
|
236
|
+
decimals?: number;
|
|
237
|
+
disabled?: boolean;
|
|
238
|
+
onMax?: () => void;
|
|
239
|
+
currency: string;
|
|
240
|
+
onCurrencyChange?: (currency: string) => void;
|
|
241
|
+
}
|
|
242
|
+
declare const Root$1: React$1.ForwardRefExoticComponent<RootProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
243
|
+
interface MaxButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
244
|
+
className?: string;
|
|
245
|
+
}
|
|
246
|
+
declare const MaxButton: React$1.ForwardRefExoticComponent<MaxButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
247
|
+
declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange"> & React$1.RefAttributes<HTMLInputElement>>;
|
|
248
|
+
declare const Dropdown: React$1.ForwardRefExoticComponent<React$1.SelectHTMLAttributes<HTMLSelectElement> & {
|
|
249
|
+
options: string[];
|
|
250
|
+
className?: string;
|
|
251
|
+
} & React$1.RefAttributes<HTMLSelectElement>>;
|
|
252
|
+
declare const CurrencyInput: {
|
|
253
|
+
Root: React$1.ForwardRefExoticComponent<RootProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
254
|
+
MaxButton: React$1.ForwardRefExoticComponent<MaxButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
255
|
+
Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange"> & React$1.RefAttributes<HTMLInputElement>>;
|
|
256
|
+
Dropdown: React$1.ForwardRefExoticComponent<React$1.SelectHTMLAttributes<HTMLSelectElement> & {
|
|
257
|
+
options: string[];
|
|
258
|
+
className?: string;
|
|
259
|
+
} & React$1.RefAttributes<HTMLSelectElement>>;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
interface ColumnConfig {
|
|
263
|
+
accessorKey: string;
|
|
264
|
+
title: string;
|
|
265
|
+
}
|
|
266
|
+
interface DataTableProps<TData> {
|
|
267
|
+
columns: ColumnConfig[];
|
|
268
|
+
data: TData[];
|
|
269
|
+
/**
|
|
270
|
+
* Controls the global loading skeleton state.
|
|
271
|
+
* When true, replaces data rows with shimmer blocks.
|
|
272
|
+
* @default false
|
|
273
|
+
*/
|
|
274
|
+
isLoading?: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* The number of skeleton rows to render while isLoading is true.
|
|
277
|
+
* Should perfectly match your pagination page size to prevent layout jumps.
|
|
278
|
+
* @default 10
|
|
279
|
+
*/
|
|
280
|
+
skeletonRowCount?: number;
|
|
281
|
+
/**
|
|
282
|
+
* Enables row highlighting / hover effects.
|
|
283
|
+
* Set to false if you want a plain flat table design.
|
|
284
|
+
* @default true
|
|
285
|
+
*/
|
|
286
|
+
enableHoverHighlight?: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* When true, the component calculates page slicing internally (Client-side).
|
|
289
|
+
* When false, it assumes the parent component is feeding it pre-sliced data (Server-side).
|
|
290
|
+
* @default true
|
|
291
|
+
*/
|
|
292
|
+
paginateInternally?: boolean;
|
|
293
|
+
/**
|
|
294
|
+
* The total count of rows across the entire database.
|
|
295
|
+
* Crucial for Server-side pagination so the bottom bar knows total pages.
|
|
296
|
+
*/
|
|
297
|
+
totalRowCount?: number;
|
|
298
|
+
paginationState?: PaginationState;
|
|
299
|
+
onPaginationChange?: (pagination: PaginationState) => void;
|
|
300
|
+
sortingState?: SortingState;
|
|
301
|
+
onSortingChange?: (sorting: SortingState) => void;
|
|
302
|
+
}
|
|
303
|
+
declare function DataTable<TData>({ columns: userColumns, data, isLoading, skeletonRowCount, enableHoverHighlight, paginateInternally, totalRowCount, paginationState, onPaginationChange, sortingState, onSortingChange, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
304
|
+
|
|
305
|
+
interface StatProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
306
|
+
children: React__default.ReactNode;
|
|
307
|
+
}
|
|
308
|
+
interface ValueProps extends Omit<React__default.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
309
|
+
value: number;
|
|
310
|
+
duration?: number;
|
|
311
|
+
formatter?: (value: number) => string;
|
|
312
|
+
}
|
|
313
|
+
declare function Label({ className, children, ...props }: React__default.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
|
|
314
|
+
declare namespace Label {
|
|
315
|
+
var displayName: string;
|
|
316
|
+
}
|
|
317
|
+
declare function Trend({ value, trendType, className, ...props }: Omit<React__default.HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
318
|
+
value: number;
|
|
319
|
+
trendType?: "positive-up" | "negative-up" | "neutral";
|
|
320
|
+
}): react_jsx_runtime.JSX.Element;
|
|
321
|
+
declare namespace Trend {
|
|
322
|
+
var displayName: string;
|
|
323
|
+
}
|
|
324
|
+
declare const Value: {
|
|
325
|
+
({ value, duration, formatter, className, ...props }: ValueProps): react_jsx_runtime.JSX.Element;
|
|
326
|
+
displayName: string;
|
|
327
|
+
};
|
|
328
|
+
declare function Extras({ className, children, ...props }: React__default.HTMLAttributes<HTMLElement>): react_jsx_runtime.JSX.Element;
|
|
329
|
+
declare namespace Extras {
|
|
330
|
+
var displayName: string;
|
|
331
|
+
}
|
|
332
|
+
declare const Root: {
|
|
333
|
+
({ className, children, ...props }: StatProps): react_jsx_runtime.JSX.Element;
|
|
334
|
+
displayName: string;
|
|
335
|
+
};
|
|
336
|
+
declare const Stat: {
|
|
337
|
+
Root: {
|
|
338
|
+
({ className, children, ...props }: StatProps): react_jsx_runtime.JSX.Element;
|
|
339
|
+
displayName: string;
|
|
340
|
+
};
|
|
341
|
+
Label: typeof Label;
|
|
342
|
+
Trend: typeof Trend;
|
|
343
|
+
Value: {
|
|
344
|
+
({ value, duration, formatter, className, ...props }: ValueProps): react_jsx_runtime.JSX.Element;
|
|
345
|
+
displayName: string;
|
|
346
|
+
};
|
|
347
|
+
Extras: typeof Extras;
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
interface TickerAsset {
|
|
351
|
+
id: string;
|
|
352
|
+
symbol: string;
|
|
353
|
+
name: string;
|
|
354
|
+
price: number;
|
|
355
|
+
change24h: number;
|
|
356
|
+
}
|
|
357
|
+
interface PriceTickerProps {
|
|
358
|
+
assets: TickerAsset[];
|
|
359
|
+
variant?: "marquee" | "stack";
|
|
360
|
+
speed?: number;
|
|
361
|
+
}
|
|
362
|
+
declare const PriceTicker: ({ assets, variant, speed, }: PriceTickerProps) => react_jsx_runtime.JSX.Element;
|
|
363
|
+
|
|
364
|
+
declare const badgeVariants: (props?: ({
|
|
365
|
+
status?: "successful" | "failed" | "pending" | "live" | null | undefined;
|
|
366
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
367
|
+
interface StatusBadgeProps extends React__default.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
368
|
+
children: string;
|
|
369
|
+
status: "successful" | "pending" | "failed" | "live";
|
|
370
|
+
className?: string;
|
|
371
|
+
}
|
|
372
|
+
declare const StatusBadge: ({ children, status, className, ...props }: StatusBadgeProps) => react_jsx_runtime.JSX.Element;
|
|
373
|
+
|
|
374
|
+
declare const ToastVariants: (props?: ({
|
|
375
|
+
intent?: "error" | "warning" | "success" | "info" | null | undefined;
|
|
376
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
377
|
+
interface ToastProps$1 extends VariantProps<typeof ToastVariants>, Toast.ToastProps {
|
|
378
|
+
title?: string;
|
|
379
|
+
description: string;
|
|
380
|
+
icon?: React__default.ReactNode | string;
|
|
381
|
+
className?: string;
|
|
382
|
+
viewPort?: string;
|
|
383
|
+
action?: {
|
|
384
|
+
label: string;
|
|
385
|
+
onClick: () => void;
|
|
386
|
+
};
|
|
387
|
+
closeButton?: React__default.ReactNode;
|
|
388
|
+
duration?: number;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
interface ToastProviderProps {
|
|
392
|
+
children: React__default.ReactNode;
|
|
393
|
+
size?: "sm" | "md" | "lg";
|
|
394
|
+
className?: string;
|
|
395
|
+
}
|
|
396
|
+
interface ToastInstance extends ToastProps {
|
|
397
|
+
id: string;
|
|
398
|
+
}
|
|
399
|
+
interface ToastProps extends VariantProps<typeof ToastVariants>, Toast.ToastProps {
|
|
400
|
+
title?: string;
|
|
401
|
+
description: string;
|
|
402
|
+
icon?: React__default.ReactNode | string;
|
|
403
|
+
className?: string;
|
|
404
|
+
viewPort?: string;
|
|
405
|
+
action?: {
|
|
406
|
+
label: string;
|
|
407
|
+
onClick: () => void;
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
declare const ToastProvider: ({ children, size, className, }: ToastProviderProps) => react_jsx_runtime.JSX.Element;
|
|
412
|
+
declare const useToast: () => ToastContext;
|
|
413
|
+
declare const ToastContext: React$1.Context<ToastContext | undefined>;
|
|
414
|
+
interface ToastContext {
|
|
415
|
+
toasts: ToastInstance[];
|
|
416
|
+
addToast: (toast: ToastProps) => void;
|
|
417
|
+
removeToast: (id: string) => void;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
interface ToggleProps extends React__default.ComponentPropsWithoutRef<typeof Switch.Root> {
|
|
421
|
+
label?: string;
|
|
422
|
+
error?: string;
|
|
423
|
+
"aria-label"?: string;
|
|
424
|
+
}
|
|
425
|
+
declare const Toggle: React__default.ForwardRefExoticComponent<ToggleProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
426
|
+
interface CheckBoxProps extends React__default.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
|
|
427
|
+
"aria-label"?: string;
|
|
428
|
+
}
|
|
429
|
+
declare const CheckBox: React__default.ForwardRefExoticComponent<CheckBoxProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
430
|
+
|
|
431
|
+
interface ToolTipProps {
|
|
432
|
+
header?: React__default.ReactNode;
|
|
433
|
+
trigger?: React__default.ReactNode;
|
|
434
|
+
children?: React__default.ReactNode;
|
|
435
|
+
className?: string;
|
|
436
|
+
}
|
|
437
|
+
declare const ToolTip: ({ header, trigger, children, className, ...props }: ToolTipProps & Tooltip.TooltipProps) => react_jsx_runtime.JSX.Element;
|
|
438
|
+
|
|
439
|
+
type StepStatus = "PENDING" | "PROCESSING" | "SUCCESS" | "FAILED";
|
|
440
|
+
interface TransactionStep {
|
|
441
|
+
id: string;
|
|
442
|
+
label: string;
|
|
443
|
+
status: StepStatus;
|
|
444
|
+
description?: string;
|
|
445
|
+
}
|
|
446
|
+
interface TransactionStepperProps {
|
|
447
|
+
steps: TransactionStep[];
|
|
448
|
+
className?: string;
|
|
449
|
+
}
|
|
450
|
+
declare const TransactionStepper: React__default.FC<TransactionStepperProps>;
|
|
451
|
+
|
|
452
|
+
export { ActionButton, AssetCard, AssetCardGroup, AssetCardHeader, AssetCardIcon, AssetCardInfo, AssetCardMain, AssetCardRate, type AssetCardRateProps, AssetCardRoot, type AssetCardRootProps, AssetCardSparkline, type SparklineProps as AssetCardSparklineProps, AssetCardValue, AssetCardVisuals, type ButtonProps, CheckBox, type ColumnConfig, CommandBar, CommandBarContainer, type CommandBarContainerProps, CommandEmpty, CommandGroup, type CommandGroupContainerProps, CommandInput, type CommandInputProps, CommandItem, CommandList, type CommandListProps, CommandSeparator, CopyField, CopyFieldButton, CopyFieldInput, type CopyFieldProps, CurrencyInput, Dropdown as CurrencyInputDropdown, Input as CurrencyInputInput, MaxButton as CurrencyInputMaxButton, Root$1 as CurrencyInputRoot, type RootProps as CurrencyInputRootProps, DataTable, type DataTableProps, Modal, ModalAction, ModalBody, ModalCancel, ModalFooter, ModalHeader, type ModalProps, ModalTrigger, PriceTicker, type PriceTickerProps, Stat, Extras as StatExtras, Label as StatLabel, type StatProps, Root as StatRoot, Trend as StatTrend, Value as StatValue, type ValueProps as StatValueProps, StatusBadge, type StatusBadgeProps, type StepStatus, type TickerAsset, ToastContext, type ToastProps$1 as ToastProps, ToastProvider, Toggle, type ToggleProps, ToolTip, type TransactionStep, TransactionStepper, type TransactionStepperProps, buttonVariants$1 as buttonVariants, useToast };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{cva as ze}from"class-variance-authority";import{twMerge as ft}from"tailwind-merge";import{clsx as bt}from"clsx";function n(...e){return ft(bt(e))}import{jsx as se,jsxs as vt}from"react/jsx-runtime";function $e({spinnerIntent:e,className:t}){return se("div",{className:"absolute inset-0 flex items-center justify-center",children:se("div",{className:n(ht({spinnerIntent:e}),t)})})}var Fe=ze(["font-semibold","flex","justify-around","items-center","shadow-lg","dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.1)]","gap-2","rounded-md","py-2","px-5","md:min-w-35","md:w-auto","md:gap-2.5","md:rounded-lg","md:py-2.5","md:px-6","lg:min-w-40","lg:w-auto","lg:gap-3","lg:rounded-lg","lg:py-3","lg:px-8","active:scale-95"],{variants:{intent:{primary:["border","bg-btn-primary-bg","border-btn-primary-border","!text-btn-primary-text","hover:bg-btn-primary-bg-hover","active:bg-btn-primary-bg-active"],secondary:["dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.3)]","bg-btn-secondary-bg","!text-btn-secondary-text","hover:bg-btn-secondary-bg-hover","active:bg-btn-secondary-bg-active"],danger:["border","bg-btn-danger-bg","border-btn-danger-border","!text-btn-danger-text","hover:bg-btn-danger-bg-hover","active:bg-btn-danger-bg-active"],ghost:["border","bg-btn-ghost-bg","border-btn-ghost-border","!text-slate-500","hover:bg-btn-ghost-bg-hover","active:bg-btn-ghost-bg-active"]},size:{full:["w-full","md:w-full","lg:w-full"],cut:[""]},isDisabled:{true:["bg-btn-disabled-bg","text-btn-disabled-text","border-0","pointer-events-none"],false:[""]},isLoading:{true:["!text-transparent","relative","bg-white","border-2","pointer-events-none"],false:""}},defaultVariants:{intent:"primary",size:"cut",isDisabled:!1},compoundVariants:[{intent:"primary",isLoading:!0,className:""}]}),ht=ze(["border-2","rounded-full","animate-spin","h-3","w-3","md:h-4","md:w-4","lg:h-5","lg:w-5"],{variants:{spinnerIntent:{primary:["border-btn-primary-border","border-t-white"],secondary:["border-btn-secondary-border","border-t-white"],danger:["border-btn-danger-border","border-t-white"],ghost:["border-btn-ghost-border","border-t-white"]}},defaultVariants:{spinnerIntent:"primary"}});function Z({intent:e="primary",size:t="cut",isDisabled:o=!1,isLoading:a=!1,className:r,children:s,onClick:i,...l}){let d=p=>{a||o||i?.(p)};return vt("button",{disabled:o||a||l.disabled,className:n(Fe({intent:e,size:t,isDisabled:o,isLoading:a}),r),onClick:d,...l,children:[a&&se($e,{spinnerIntent:e}),s]})}Z.Loader=$e;import{createContext as wt,useContext as je,useState as Ct,useEffect as yt}from"react";import{cva as kt}from"class-variance-authority";import*as f from"@radix-ui/react-dialog";import{Fragment as Y,jsx as m,jsxs as G}from"react/jsx-runtime";var ie=wt(null);function le({children:e}){return m(Y,{children:e})}function de({children:e,className:t}){return m("header",{className:n("relative flex items-center justify-between flex-none p-1.5 grow-0 font-sans w-full",t),children:e})}function ce({children:e,className:t}){return m("main",{className:n("flex flex-row justify-center mt-[18px] mb-3 p-2 gap-2 flex-none order-1 grow-0",t),children:e})}function pe({children:e,className:t}){return m("footer",{className:n("mt-1 flex flex-col-reverse gap-3 order-2 h-min w-full grow-0 lg:mt-1 lg:flex-row lg:items-end lg:justify-start lg:gap-5 lg:pl-[5px]",t),children:e})}function me({onClick:e,className:t,...o}){let a=je(ie);return m(Z,{intent:"ghost",onClick:s=>{e?e(s):(console.log("Default action triggered"),a?.handleClose())},className:n("flex flex-none grow-0 flex-row items-center justify-center rounded-[4px] border-none px-10 py-[10px] font-sans text-sm font-semibold not-italic !text-white min-w-min",t),...o,children:"Cancel"})}function ue({action:e,className:t,onClick:o,...a}){let r=je(ie);return m(Z,{onClick:i=>{o?o(i):(console.log("Default action triggered"),r?.handleClose())},className:n("flex flex-none grow-0 flex-row items-center justify-center gap-[10px] rounded-[4px] border-none bg-indigo-500 hover:bg-indigo-600 dark:bg-indigo-600 dark:hover:bg-indigo-700 px-10 py-[10px] font-sans text-sm font-semibold not-italic text-white min-w-min",t),...a,children:e})}var Rt=kt(["flex","flex-col","justify-start","bg-surface-card","shadow-2xl","z-50","font-['Inclusive_Sans']","m-0","max-w-none","border-none","overflow-hidden","fixed","gap-3","bottom-0 top-auto left-0 translate-x-0 translate-y-0","mt-auto mb-0 w-full rounded-t-[20px] rounded-b-none","pt-10 pr-6 pb-8 pl-6 max-h-[45vh]","animate-[mobile-slide-up_0.3s_ease-out]","md:top-1/2 md:left-1/2 md:-translate-x-1/2 md:-translate-y-1/2 md:bottom-auto","md:p-8 md:w-min md:h-min md:rounded-[16px] md:max-h-none","md:animate-[modal-appear_0.2s_ease-out]","md:font-optical-sizing-auto"],{variants:{intent:{primary:[],secondary:[],danger:[],ghost:[]}},defaultVariants:{}}),_=({isOpen:e,onOpenChange:t,onClose:o,children:a,trigger:r,className:s,footer:i,title:l,description:d,...p})=>{let[k,g]=Ct(e??!1);yt(()=>{e!==void 0&&g(e)},[e]);let L=()=>{g(!1),o?.()};return m(ie.Provider,{value:{handleClose:L},children:G(f.Root,{open:k,onOpenChange:R=>{g(R),t?.(R),R||o?.()},children:[r&&m(le,{children:m(f.Trigger,{asChild:!0,children:r})}),G(f.Portal,{children:[m(f.Overlay,{onClick:L,className:"fixed inset-0 bg-black/50 backdrop-filter backdrop-blur-sm z-40 animate-fade-in"}),m(f.Content,{className:n(Rt(),s),...p,children:l?G(Y,{children:[G(de,{children:[m(f.Title,{className:"my-0 font-sans text-2xl font-medium not-italic leading-[22px] text-left dark:text-white",children:l}),m(f.Close,{asChild:!0,children:m("button",{onClick:L,"aria-label":"Close",type:"button",className:"relative ml-6 right-0 rounded-full hover:bg-slate-200 p-2 cursor-pointer",children:m("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",className:"w-[18px] h-[18px] block dark:text-white",children:m("path",{d:"M6.575 7.975L1.675 12.875C1.49167 13.0583 1.25833 13.15 0.975 13.15C0.691667 13.15 0.458333 13.0583 0.275 12.875C0.0916663 12.6917 0 12.4583 0 12.175C0 11.8917 0.0916663 11.6583 0.275 11.475L5.175 6.575L0.275 1.675C0.0916663 1.49167 0 1.25833 0 0.975C0 0.691667 0.0916663 0.458333 0.275 0.275C0.458333 0.0916663 0.691667 0 0.975 0C1.25833 0 1.49167 0.0916663 1.675 0.275L6.575 5.175L11.475 0.275C11.6583 0.0916663 11.8917 0 12.175 0C12.4583 0 12.6917 0.0916663 12.875 0.275C13.0583 0.458333 13.15 0.691667 13.15 0.975C13.15 1.25833 13.0583 1.49167 12.875 1.675L7.975 6.575L12.875 11.475C13.0583 11.6583 13.15 11.8917 13.15 12.175C13.15 12.4583 13.0583 12.6917 12.875 12.875C12.6917 13.0583 12.4583 13.15 12.175 13.15C11.8917 13.15 11.6583 13.0583 11.475 12.875L6.575 7.975Z",fill:"currentColor"})})})})]}),m(ce,{children:a}),d&&m(f.Description,{className:"text-gray-500 px-8 py-1 text-sm",children:d}),i&&m(pe,{children:typeof i=="string"?G(Y,{children:[m(me,{}),m(ue,{action:i})]}):i})]}):G(Y,{children:[a,d&&m(f.Description,{className:"text-gray-500 px-8 py-1 text-sm",children:d})]})})]})]})})};_.Trigger=le;_.Header=de;_.Body=ce;_.Footer=pe;_.Action=ue;_.Cancel=me;import*as q from"react";import{cva as Tt}from"class-variance-authority";import{jsx as b,jsxs as Oe}from"react/jsx-runtime";var We=q.createContext(null);function I(){let e=q.useContext(We);if(!e)throw new Error("AssetCard sub-components cannot be rendered outside the AssetCardRoot component.");return e}var Nt=Tt("flex flex-col justify-between p-2.5 md:p-4 rounded-2xl bg-gradient-to-b from-white to-gray-50/30 w-48 h-32 md:w-52 md:h-36 lg:w-56 lg:h-[152px] shadow-[0_4px_16px_rgba(0,0,0,0.03),inset_0_1px_0_0_rgba(255,255,255,0.6),inset_0_0_0_1px_rgba(0,0,0,0.04)]",{variants:{size:{md:"",lg:""}},defaultVariants:{size:"lg"}});function Ge({className:e,size:t,children:o,...a}){return b(We.Provider,{value:!0,children:b("div",{className:n(Nt({size:t}),e),...a,children:o})})}function qe({className:e,children:t,...o}){return I(),b("header",{className:n("flex items-center gap-2",e),...o,children:t})}function Ue({className:e,children:t,...o}){return I(),b("div",{className:n("flex-shrink-0",e),...o,children:t})}function Ke({className:e,children:t,...o}){return I(),b("div",{className:n("flex flex-col text-sm leading-tight",e),...o,children:t})}function Ze({className:e,children:t,...o}){return I(),b("main",{className:n("flex flex-row w-full items-center justify-between gap-1 mt-auto",e),...o,children:t})}function Qe({className:e,children:t,...o}){return I(),b("div",{className:n("flex flex-col justify-center",e),...o,children:t})}function Je({className:e,children:t,...o}){return I(),b("h1",{className:n("text-xl font-semibold font-mono tracking-tight",e),...o,children:t})}function Xe({className:e,rate:t,...o}){return I(),b("span",{className:n(`text-sm font-mono ${t>0?"text-emerald-500":t<0?"text-rose-500":"text-amber-500"} font-semibold`,e),...o,children:t>0?`\u25B2 ${t}%`:t<0?`\u25BC ${t}%`:`\u25B6 ${t}%`})}function Ye({className:e,children:t,...o}){return I(),b("div",{className:n("flex items-center justify-center overflow-hidden",e),...o,children:t})}var et=({data:e,width:t=90,height:o=30,strokeWidth:a=2,className:r,...s})=>{I();let i=q.useId();if(!e||e.length<2)return null;let l=Math.min(...e),d=Math.max(...e),p=d-l===0?1:d-l,g=e.map((x,u)=>{let H=u/(e.length-1)*t,W=o-(x-l)/p*o;return{x:H,y:W}}).map((x,u)=>`${u===0?"M":"L"} ${x.x.toFixed(1)} ${x.y.toFixed(1)}`).join(" "),L=`${g} L ${t} ${o} L 0 ${o} Z`,R=e[0],j=e[e.length-1]>=R,O=j?"stroke-emerald-500":"stroke-rose-500",B=j?"rgb(16, 185, 129)":"rgb(244, 63, 94)";return Oe("svg",{width:t,height:o,viewBox:`0 0 ${t} ${o}`,className:n("overflow-visible",r),...s,children:[b("defs",{children:Oe("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[b("stop",{offset:"0%",stopColor:B,stopOpacity:.25}),b("stop",{offset:"100%",stopColor:B,stopOpacity:0})]})}),b("path",{d:L,fill:`url(#${i})`,className:"transition-all duration-300 ease-in-out"}),b("path",{d:g,fill:"none",className:n(O,"transition-all duration-300 ease-in-out"),strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"})]})},Pt={Root:Ge,Header:qe,Main:Ze,Group:Ke,Info:Qe,Icon:Ue,Rate:Xe,Value:Je,Visuals:Ye,Sparkline:et};import*as N from"react";import{Command as z,useCommandState as St}from"cmdk";import{jsx as T,jsxs as Lt}from"react/jsx-runtime";var ge=N.forwardRef(({className:e,children:t,...o},a)=>T(z,{ref:a,className:n("relative flex flex-col overflow-visible rounded-4xl bg-white dark:bg-zinc-900/90 text-zinc-950 dark:text-zinc-100 border border-zinc-200 dark:border-zinc-800 shadow-[0_24px_48px_-12px_rgba(0,0,0,0.4)] backdrop-blur-md w-md md:w-xl lg:w-3xl custom-crypto-glow",e),...o,children:t})),xe=N.forwardRef(({className:e,...t},o)=>T(z.Input,{ref:o,className:n("flex w-full bg-transparent mx-3 py-4 outline-none placeholder-zinc-500 disabled:cursor-not-allowed disabled:opacity-50 h-10 text-xs px-3 font-medium md:h-12 md:text-sm md:px-4 lg:h-14 lg:text-base lg:px-5 transition-all duration-200",e),...t})),fe=N.forwardRef(({className:e,children:t,...o},a)=>{let s=St(i=>i.search).trim().length>0;return T(z.List,{ref:a,className:n("absolute top-20 z-50 w-full max-h-[300px] overflow-y-auto overflow-x-hidden rounded-xl border border-zinc-200 bg-white p-2 shadow-xl dark:border-zinc-800 dark:bg-zinc-950 text-zinc-950 dark:text-zinc-50 text-xs px-2 w-md md:text-sm md:px-3 md:w-xl lg:text-base lg:px-4 lg:w-3xl",!s&&"hidden",e),...o,children:t})}),be=N.forwardRef(({className:e,...t},o)=>T(z.Empty,{ref:o,className:n("py-6 text-center text-sm text-zinc-500 dark:text-zinc-400 ",e),...t})),he=N.forwardRef(({className:e,heading:t,children:o,defaultExpanded:a=!1,...r},s)=>{let[i,l]=N.useState(a);return T(z.Group,{ref:s,heading:Lt("div",{onClick:()=>l(!i),className:n("overflow-hidden p-1 text-zinc-950 dark:text-zinc-100","flex w-full cursor-pointer items-center justify-between","[&_[cmdk-group-heading]]:select-none [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:text-[10px] [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-[0.12em] [&_[cmdk-group-heading]]:text-zinc-500",e),children:[T("span",{children:t}),T("span",{className:"text-[10px] opacity-60",children:i?"\u25B2 Hide":"\u25BC Expand"})]}),className:n("overflow-hidden p-1 text-zinc-950 dark:text-zinc-50",e),...r,children:T("div",{className:n(!i&&"hidden"),children:o})})}),ve=N.forwardRef(({className:e,...t},o)=>T(z.Item,{ref:o,className:n("relative flex cursor-pointer select-none items-center rounded-xl px-3 py-2.5 mt-1 text-zinc-300 font-medium transition-all duration-150 outline-none data-[selected=true]:bg-white/[0.06] data-[selected=true]:text-white data-[selected=true]:translate-x-0.5 data-[disabled=true]:opacity-40",e),...t})),we=N.forwardRef(({className:e,...t},o)=>T(z.Separator,{ref:o,className:n("-mx-1 my-1 h-px bg-zinc-200 dark:bg-zinc-800",e),...t}));ge.displayName="CommandBar.Root";xe.displayName="CommandBar.Input";fe.displayName="CommandBar.List";be.displayName="CommandBar.Empty";he.displayName="CommandBar.Group";ve.displayName="CommandBar.Item";we.displayName="CommandBar.Separator";var Mt={Root:ge,Input:xe,List:fe,Empty:be,Group:he,Item:ve,Separator:we};import{useState as Vt}from"react";import{cva as At}from"class-variance-authority";import It from"react";import*as h from"@radix-ui/react-tooltip";import{jsx as U,jsxs as tt}from"react/jsx-runtime";var Ce=({header:e,trigger:t,children:o,className:a,...r})=>U(h.Provider,{delayDuration:200,children:tt(h.Root,{...r,children:[U(h.Trigger,{asChild:!0,children:It.isValidElement(t)?t:U("span",{children:t})}),U(h.Portal,{children:tt(h.Content,{sideOffset:5,className:n("z-50 overflow-hidden rounded-md border border-zinc-200 bg-white px-2 py-1 text-[10px] md:px-3 md:py-1.5 md:text-xs lg:px-4 lg:py-2 lg:text-sm text-zinc-950 shadow-md animate-in fade-in-0 zoom-in-95 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50",a),children:[e&&U("div",{className:"mb-1 font-semibold border-b border-zinc-100 dark:border-zinc-800 pb-1",children:e}),o,U(h.Arrow,{className:"fill-white dark:fill-zinc-950 -mt-[2px]",width:12,height:6})]})})]})});import{jsx as P,jsxs as ot}from"react/jsx-runtime";var Dt=At("flex w-9 px-2 md:w-11 md:px-3 lg:w-14 lg:px-4 items-center justify-center transition-colors active:scale-95 disabled:pointer-events-none disabled:opacity-50",{variants:{intent:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{intent:"secondary"}});function ye({className:e,value:t}){return P("input",{type:"text","aria-label":"CopyField Text",value:t,tabIndex:-1,readOnly:!0,className:n("flex-1 border-2 border-copy-border bg-transparent ml-3 px-3 py-2 rounded-lg text-xs md:text-sm lg:text-base text-copy-text outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e)})}function ke({className:e,handleClick:t,copied:o,intent:a}){return P(Ce,{trigger:P("button",{onClick:t,className:n(Dt({intent:a}),e),"aria-label":"Copy to clipboard",children:o?P("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-6 h-6 text-green-500 animate-in zoom-in lucide lucide-check-icon lucide-check",children:P("path",{d:"M20 6 9 17l-5-5"})}):ot("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-4 h-6 text-copy-btn-icon lucide lucide-copy-icon lucide-copy",children:[P("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),P("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})}),children:o?"Copied!!!":"Copy"})}var Re=({value:e,className:t,intent:o})=>{let[a,r]=Vt(!1),s=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)}catch(i){console.error("Failed to copy!",i)}};return ot("div",{className:n("flex w-full px-2 py-4 h-14 lg:h-16 overflow-hidden items-center transition-all duration-200 rounded-full bg-copy-bg border-copy-border shadow-lg group",t),children:[P(ye,{value:e}),P("div",{className:n("px-3 py-2 w-12 lg:w-14 bg-copy-btn-bg border-2 border-copy-btn-icon hover:bg-copy-btn-hover active:bg-slate-900/80 text-zinc-100 rounded-lg m-2 flex items-center justify-center transition-colors shadow-[inset_0_1px_2px_rgba(0,0,0,0.05)] dark:shadow-[inset_0_1px_2px_rgba(0,0,0,0.4)]"),children:P(ke,{intent:o||"secondary",handleClick:s,copied:a})})]})};Re.Input=ye;Re.Button=ke;import*as V from"react";import{cva as Bt}from"class-variance-authority";import{jsx as $,jsxs as $t}from"react/jsx-runtime";var Et=Bt(["flex w-full items-center rounded-xl border transition-all duration-300 overflow-hidden","bg-white dark:bg-slate-950","border-slate-200 dark:border-slate-800","ring-offset-white dark:ring-offset-slate-950","focus-within:ring-2 focus-within:ring-indigo-500/50 dark:focus-within:ring-indigo-400/30","shadow-sm dark:shadow-none"],{variants:{size:{default:"h-12",sm:"h-10 text-xs",lg:"h-14 text-base"}},defaultVariants:{size:"default"}}),at=V.createContext(void 0);function Te(){let e=V.useContext(at);if(!e)throw new Error("CurrencyInput sub-components must be rendered within a Root");return e}var Ht=(e,t)=>{if(!e)return"";let[o,a]=e.split("."),r=o?o.replace(/\B(?=(\d{3})+(?!\d))/g,","):e;return a!==void 0?`${r}.${a.slice(0,t)}`:r},_t=(e,t)=>{let o=e.replace(/[^\d.]/g,""),a=o.split(".");return a.length>2&&(o=`${a[0]}.${a.slice(1).join("")}`),a[1]&&a[1].length>t&&(o=`${a[0]}.${a[1].slice(0,t)}`),o},Ne=V.forwardRef(({className:e,size:t,value:o,onChange:a,decimals:r=8,disabled:s,onMax:i,currency:l,onCurrencyChange:d,children:p,...k},g)=>$(at.Provider,{value:{currency:l,onCurrencyChange:d,value:o,displayValue:Ht(o,r),decimals:r,disabled:s,onChange:a,onMax:i},children:$("div",{ref:g,className:n(Et({size:t}),e),...k,children:p})}));Ne.displayName="CurrencyInput.Root";var Pe=V.forwardRef(({className:e,...t},o)=>{let{onMax:a,disabled:r}=Te();return a?$("button",{ref:o,type:"button",disabled:r,onClick:a,className:n("px-4 h-full text-[10px] font-bold uppercase tracking-widest transition-colors border-r border-slate-200 dark:border-slate-800 text-slate-500 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-900 disabled:opacity-30",e),...t,children:"Max"}):null});Pe.displayName="CurrencyInput.MaxButton";var Se=V.forwardRef(({className:e,...t},o)=>{let{displayValue:a,decimals:r,onChange:s,disabled:i}=Te();return $("input",{ref:o,type:"text",inputMode:"decimal",autoComplete:"off",placeholder:"0.00",disabled:i,value:a,onChange:l=>s(_t(l.target.value,r)),className:n("flex-1 bg-transparent px-4 py-2 text-right font-mono text-slate-700 dark:text-white placeholder:text-slate-400 dark:placeholder:text-slate-600 focus:outline-none disabled:cursor-not-allowed",e),...t})});Se.displayName="CurrencyInput.Input";var Me=V.forwardRef(({className:e,options:t,...o},a)=>{let{currency:r,onCurrencyChange:s,disabled:i}=Te();return $t("div",{className:"relative flex h-full items-center border-l border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-900/50",children:[$("select",{ref:a,disabled:i,value:r,onChange:l=>s?.(l.target.value),"aria-label":"currency",className:n("h-full bg-transparent px-3 text-xs font-semibold text-slate-700 dark:text-black outline-none cursor-pointer pr-7 appearance-none",e),...o,children:t.map(l=>$("option",{className:"bg-white dark:bg-slate-900 text-slate-900 dark:text-white",children:l},l))}),$("span",{className:"absolute right-2 text-xs text-slate-600 dark:text-slate-300 pointer-events-none","aria-hidden":"true",children:"\u25BC"})]})});Me.displayName="CurrencyInput.Dropdown";var zt={Root:Ne,MaxButton:Pe,Input:Se,Dropdown:Me};import*as K from"react";import{useReactTable as jt,getCoreRowModel as Ot,getPaginationRowModel as Wt,getSortedRowModel as Gt,flexRender as qt}from"@tanstack/react-table";import{flexRender as Ft}from"@tanstack/react-table";import{jsx as Q}from"react/jsx-runtime";function nt({row:e,isLoading:t,enableHoverHighlight:o}){return Q("tr",{className:`
|
|
2
|
+
transition-colors duration-200
|
|
3
|
+
${t?"animate-pulse":""}
|
|
4
|
+
${o?"hover:bg-table-hover/50":""}
|
|
5
|
+
`,children:e.getVisibleCells().map(a=>{let r=["price","holdings","change24h","value","allocation"].includes(a.column.id.toLowerCase()),s=["rank","change24h"].includes(a.column.id.toLowerCase());return Q("td",{className:`whitespace-nowrap px-4 sm:px-6 py-4 sm:py-5 align-middle first:pl-6 sm:first:pl-8 last:pr-6 sm:last:pr-8
|
|
6
|
+
${s?"hidden md:table-cell":"table-cell"}
|
|
7
|
+
`,children:Q("div",{className:`flex w-full ${r?"justify-end text-right":"justify-start text-left"}`,children:t?Q("div",{className:"h-4 w-24 rounded bg-table-skeleton animate-pulse"}):Q("div",{className:"text-sm font-medium text-table-body-text",children:Ft(a.column.columnDef.cell,a.getContext())})})},a.id)})})}import{jsx as w,jsxs as ee}from"react/jsx-runtime";function rt({table:e}){let t=e.getState().pagination.pageIndex,o=e.getState().pagination.pageSize,a=e.getFilteredRowModel().rows.length,r=e.getPageCount(),s=a===0?0:t*o+1,i=Math.min((t+1)*o,a);return ee("div",{className:"flex w-full items-center justify-between px-4 py-3 sm:px-2",children:[ee("div",{className:"text-xs font-medium text-table-header-text text-center sm:text-left",children:["Showing"," ",w("span",{className:"font-semibold text-table-body-text",children:s})," ","to ",w("span",{className:"font-semibold text-table-body-text",children:i})," ","of"," ",w("span",{className:"font-semibold text-table-body-text",children:a})," ","entries"]}),ee("div",{className:"flex items-center gap-1.5 self-center sm:self-auto",children:[w("button",{onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg border border-table-border bg-table-bg text-table-body-text transition-all hover:bg-table-hover disabled:pointer-events-none disabled:opacity-40",title:"First Page",children:w("span",{className:"text-xs",children:"\xAB"})}),w("button",{onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg border border-table-border bg-table-bg text-table-body-text transition-all hover:bg-table-hover disabled:pointer-events-none disabled:opacity-40",title:"Previous Page",children:w("span",{className:"text-xs",children:"\u2039"})}),ee("div",{className:"flex h-8 min-w-8 items-center justify-center rounded-lg bg-table-hover px-2.5 text-xs font-semibold text-table-body-text shadow-inner",children:["Page ",t+1," of ",r||1]}),w("button",{onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg border border-table-border bg-table-bg text-table-body-text transition-all hover:bg-table-hover disabled:pointer-events-none disabled:opacity-40",title:"Next Page",children:w("span",{className:"text-xs",children:"\u203A"})}),w("button",{onClick:()=>e.setPageIndex(r-1),disabled:!e.getCanNextPage(),className:"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg border border-table-border bg-table-bg text-table-body-text transition-all hover:bg-table-hover disabled:pointer-events-none disabled:opacity-40",title:"Last Page",children:w("span",{className:"text-xs",children:"\xBB"})})]})]})}import{jsx as A,jsxs as te}from"react/jsx-runtime";function Ut({columns:e,data:t,isLoading:o=!1,skeletonRowCount:a=10,enableHoverHighlight:r=!0,paginateInternally:s=!0,totalRowCount:i,paginationState:l,onPaginationChange:d,sortingState:p,onSortingChange:k}){let g=K.useMemo(()=>e.map(x=>({accessorKey:x.accessorKey,header:x.title,cell:({getValue:u})=>{let H=u(),W=["price","holdings","change24h","value","allocation"].includes(x.accessorKey.toLowerCase());return A("div",{className:`
|
|
8
|
+
w-full px-1 text-sm font-medium tracking-wide transition-all duration-200
|
|
9
|
+
${W?"text-right justify-end":"text-left justify-start"}
|
|
10
|
+
truncate max-w-[150px] md:max-w-none
|
|
11
|
+
`,title:String(H),children:String(H)})}})),[e]),[L,R]=K.useState({pageIndex:0,pageSize:a}),[D,j]=K.useState([]),O=K.useMemo(()=>o?Array(a).fill({}):t,[o,t,a]),B=jt({data:O,columns:g,getCoreRowModel:Ot(),getPaginationRowModel:s?Wt():void 0,manualPagination:!s,rowCount:i,getSortedRowModel:s?Gt():void 0,manualSorting:!s,state:{pagination:l??L,sorting:p??D},onPaginationChange:d??R,onSortingChange:k??j});return te("div",{className:"w-full space-y-4",children:[A("div",{className:"w-full overflow-x-auto rounded-2xl border border-table-border bg-table-bg shadow-sm",children:te("table",{className:"w-full border-collapse text-left text-sm min-w-[640px] sm:min-w-full",children:[A("thead",{className:"bg-table-header-bg border-b border-table-border",children:B.getHeaderGroups().map(x=>A("tr",{children:x.headers.map(u=>{let H=u.column.getCanSort(),W=u.column.getIsSorted(),_e=["price","holdings","change24h","value","allocation"].includes(u.column.id.toLowerCase()),xt=["rank","change24h"].includes(u.column.id.toLowerCase());return A("th",{style:{width:`${u.getSize()}px`},className:`px-4 sm:px-6 py-4.5 font-semibold text-table-header-text text-xs tracking-wider select-none first:pl-6 sm:first:pl-8 last:pr-6 sm:last:pr-8
|
|
12
|
+
${xt?"hidden md:table-cell":"table-cell"}
|
|
13
|
+
`,children:u.isPlaceholder?null:te("div",{onClick:u.column.getToggleSortingHandler(),className:`flex w-full items-center gap-1.5 ${H?"cursor-pointer hover:text-table-body-text":""} ${_e?"justify-end text-right":"justify-start text-left"}`,children:[A("span",{children:qt(u.column.columnDef.header,u.getContext())}),H&&!_e&&te("span",{className:"text-[10px] opacity-70",children:[W==="asc"&&"\u{1F53C}",W==="desc"&&"\u{1F53D}"]})]})},u.id)})},x.id))}),A("tbody",{className:"divide-y divide-table-border font-medium text-table-body-text",children:B.getRowModel().rows.map(x=>A(nt,{row:x,isLoading:o,enableHoverHighlight:r},x.id))})]})}),A(rt,{table:B})]})}import{useState as Kt,useEffect as Zt}from"react";import{cva as Qt}from"class-variance-authority";import{jsx as F,jsxs as Yt}from"react/jsx-runtime";var Jt=Qt("font-mono font-semibold text-xs md:text-sm lg:tracking-wide",{variants:{intent:{positive:"text-sentiment-positive-text",negative:"text-sentiment-negative-text",neutral:"text-white"}},defaultVariants:{}});function Le({className:e,children:t,...o}){return F("span",{className:n("font-medium text-muted-foreground text-text-secondary text-xs md:text-sm lg:tracking-wide",e),...o,children:t})}Le.displayName="Stat.Label";function Ie({value:e,trendType:t="neutral",className:o,...a}){let r="neutral";t==="positive-up"?r=e>0?"positive":e<0?"negative":"neutral":t==="negative-up"&&(r=e>0?"negative":e<0?"positive":"neutral");let s=e>0?"+":"";return F("span",{className:n(Jt({intent:r}),o),...a,children:`${s}${e}%`})}Ie.displayName="Stat.Trend";var Ve=({value:e,duration:t=1e3,formatter:o,className:a="",...r})=>{let[s,i]=Kt(()=>o?o(0):"0");Zt(()=>{let d=null,p=0,k=e,g,L=D=>D*(2-D),R=D=>{d||(d=D);let j=D-d,O=Math.min(j/t,1),B=L(O),x=p+(k-p)*B,u=o?o(x):Math.round(x).toString();i(u),O<1&&(g=requestAnimationFrame(R))};return g=requestAnimationFrame(R),()=>cancelAnimationFrame(g)},[e,t,o]);let l=o?o(e):e.toString();return F("div",{className:"flex flex-col justify-center items-center h-14 w-28 rounded-xl md:h-24 md:w-48 md:rounded-b-none md:rounded-t-3xl lg:h-24 lg:w-52 lg:rounded-b-none lg:rounded-t-3xl lg:tracking-wide bg-[linear-gradient(hsla(256,72%,46%,1),hsla(241,72%,46%,0))]",children:Yt("span",{className:n("font-bold tracking-tight text-slate-100 tabular-nums text-xl md:text-3xl lg:text-4xl",a),...r,children:[F("span",{className:"sr-only",children:l}),F("span",{"aria-hidden":"true",children:s})]})})};Ve.displayName="Stat.Value";function Ae({className:e,children:t,...o}){return F("section",{className:e,...o,children:t})}Ae.displayName="Stat.Extras";var De=({className:e,children:t,...o})=>F("div",{className:n("lg:relative flex flex-col gap-1 p-4 md:px-5 md:pt-2 lg:pt-6 lg:pb-6 lg:pr-6 lg:pl-6 rounded-xl md:rounded-2xl shadow-sm max-w-fit items-center bg-[linear-gradient(hsla(252,100%,57%,0.8),hsla(241,81%,54%,0.8))] overflow-hidden backdrop-blur-md",e),...o,children:t});De.displayName="Stat.Root";var Xt={Root:De,Label:Le,Trend:Ie,Value:Ve,Extras:Ae};import{useEffect as eo,useRef as to,useState as oo}from"react";import{motion as ao}from"framer-motion";import{jsx as v,jsxs as E}from"react/jsx-runtime";var no=({assets:e,variant:t="marquee",speed:o=30})=>{if(t==="stack")return v("div",{className:"divide-y divide-gray-800 rounded-xl border border-gray-800 bg-black",children:e.map(r=>v(st,{asset:r,layout:"stack"},r.id))});let a=[...e,...e,...e];return E("div",{className:"relative w-full overflow-hidden border-y border-gray-800 bg-black py-3",children:[v("div",{className:"absolute inset-y-0 left-0 z-10 w-20 bg-gradient-to-r from-black to-transparent pointer-events-none"}),v("div",{className:"absolute inset-y-0 right-0 z-10 w-20 bg-gradient-to-l from-black to-transparent pointer-events-none"}),v(ao.div,{className:"flex w-max gap-8 px-4",animate:{x:["0%","-33.33%"]},transition:{ease:"linear",duration:o,repeat:1/0},children:a.map((r,s)=>v(st,{asset:r,layout:"marquee"},`${r.id}-${s}`))})]})},st=({asset:e,layout:t})=>{let[o,a]=oo(""),r=to(e.price);eo(()=>{let l=r.current;if(e.price!==l){let d=e.price>l;a(""),requestAnimationFrame(()=>{a(d?"flash-green":"flash-red")}),r.current=e.price}},[e.price]);let s=()=>{a("")},i=e.change24h>=0;return E("div",{onAnimationEnd:s,className:`
|
|
14
|
+
flex items-center justify-between rounded-lg transition-colors duration-300
|
|
15
|
+
${t==="marquee"?"gap-4 py-1 px-3":"w-full p-4 hover:bg-gray-900/50"}
|
|
16
|
+
${o==="flash-green"?"animate-flash-green-bg":""}
|
|
17
|
+
${o==="flash-red"?"animate-flash-red-bg":""}
|
|
18
|
+
`,children:[E("div",{className:"flex items-center gap-2.5",children:[v("span",{className:"font-medium md:font-bold text-white tracking-tighter md:tracking-wide",children:e.symbol}),t==="stack"&&v("span",{className:"md:text-xs md:text-zinc-400 md:font-medium hidden md:inline",children:e.name})]}),E("div",{className:`flex items-center ${t==="marquee"?"gap-3":"gap-6"}`,children:[E("span",{className:`
|
|
19
|
+
font-mono font-normal md:font-semibold tracking-tighter md:tracking-tight transition-colors duration-200
|
|
20
|
+
${o==="flash-green"?"text-green-400 font-bold":""}
|
|
21
|
+
${o==="flash-red"?"text-red-400 font-bold":""}
|
|
22
|
+
${o?"":"text-gray-100"}
|
|
23
|
+
`,children:["$",e.price.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),E("span",{className:`flex items-end ml-0 text-xs font-normal md:font-semibold ${i?"text-green-500":"text-red-500"}`,children:[i?E("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-0.5 h-3.5 w-3.5 lucide lucide-arrow-up-right-icon lucide-arrow-up-right",children:[v("path",{d:"M7 7h10v10"}),v("path",{d:"M7 17 17 7"})]}):E("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-0.5 h-3.5 w-3.5 lucide lucide-arrow-down-right-icon lucide-arrow-down-right",children:[v("path",{d:"m7 7 10 10"}),v("path",{d:"M17 7v10H7"})]}),Math.abs(e.change24h).toFixed(2),"%"]})]})]})};import{cva as it}from"class-variance-authority";import{Fragment as lo,jsx as S,jsxs as J}from"react/jsx-runtime";var ro=it("inline-flex items-center justify-center gap-2 rounded-full pl-1.5 pr-3 py-1 text-xs font-semibold tracking-wide transition-all duration-200",{variants:{status:{successful:"bg-emerald-500/10 text-emerald-700 border border-emerald-500/20",failed:"bg-rose-500/10 text-rose-700 border border-rose-500/20",pending:"bg-indigo-500/10 text-indigo-700 border border-indigo-500/20",live:"bg-sky-500/10 text-sky-700 border border-sky-500/20"}},defaultVariants:{status:"pending"}}),so=it("inline-flex h-5 w-5 items-center justify-center rounded-full text-white shrink-0 transform-gpu subpixel-antialiased",{variants:{status:{successful:"bg-emerald-600/90",failed:"bg-rose-600/90 relative",pending:"bg-indigo-600/90 relative",live:"bg-sky-600/90 relative"}},defaultVariants:{status:"pending"}}),io=({children:e,status:t,className:o,...a})=>J("span",{className:n(ro({status:t}),o),...a,children:[J("span",{className:n(so({status:t})),children:[t==="successful"&&S("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-3 w-3 stroke-[3.5] block shrink-0 lucide lucide-check-icon lucide-check",children:S("path",{d:"M20 6 9 17l-5-5"})}),t==="failed"&&J("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-3 w-3 stroke-[3.5] block shrink-0 lucide lucide-triangle-alert-icon lucide-triangle-alert",children:[S("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),S("path",{d:"M12 9v4"}),S("path",{d:"M12 17h.01"})]}),t==="pending"&&J("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-3 w-3 stroke-[3.5] block shrink-0 lucide lucide-clock-icon lucide-clock",children:[S("circle",{cx:"12",cy:"12",r:"10"}),S("path",{d:"M12 6v6l4 2"})]}),t==="live"&&J(lo,{children:[S("span",{className:"h-1.5 w-1.5 rounded-full bg-white"}),S("span",{className:"absolute inset-0 rounded-full bg-sky-500 opacity-75 animate-ping"})]})]}),S("span",{className:"capitalize leading-none relative",children:e||t})]});import{createContext as Co,useContext as yo,useState as ko}from"react";import{cva as Ro}from"class-variance-authority";import*as oe from"@radix-ui/react-toast";import{cva as co}from"class-variance-authority";import*as M from"@radix-ui/react-toast";import{useEffect as po,useState as mo}from"react";import{motion as uo}from"framer-motion";import{jsx as c,jsxs as X}from"react/jsx-runtime";var go=co("relative overflow-hidden max-w-[320px] p-3 text-sm md:max-w-[380px] md:p-4 lg:max-w-[440px] rounded-xl shadow-lg grid grid-cols-[auto_1fr_auto] gap-x-4 items-start border",{variants:{intent:{error:["bg-toast-error-bg","border-toast-error-border","text-toast-error-text"],warning:["bg-toast-warning-bg","border-toast-warning-border","text-toast-warning-text"],success:["bg-toast-success-bg","border-toast-success-border","text-toast-success-text"],info:["bg-toast-info-bg","border-toast-info-border","text-toast-info-text"]}},defaultVariants:{intent:"info"}}),xo=({duration:e,open:t})=>c("div",{className:"absolute bottom-0 left-0 h-1 w-full bg-black/10 overflow-hidden",children:c(uo.div,{initial:{width:"100%"},animate:t?{width:"0%"}:{width:"100%"},transition:{duration:e/1e3,ease:"linear"},className:"h-full bg-current"})}),fo=()=>c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c("path",{d:"M20 6 9 17l-5-5"})}),bo=()=>X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c("circle",{cx:"12",cy:"12",r:"10"}),c("path",{d:"m15 9-6 6"}),c("path",{d:"m9 9 6 6"})]}),ho=()=>X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),c("path",{d:"M12 9v4"}),c("path",{d:"M12 17h.01"})]}),vo=()=>X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c("circle",{cx:"12",cy:"12",r:"10"}),c("path",{d:"M12 16v-4"}),c("path",{d:"M12 8h.01"})]}),wo={success:c(fo,{}),error:c(bo,{}),warning:c(ho,{}),info:c(vo,{})},lt=({intent:e,title:t,description:o,className:a,icon:r,action:s,duration:i=5e3,...l})=>{let[d,p]=mo(!1),k=r||wo[e||"info"];return po(()=>{p(!0)},[]),X(M.Root,{onOpenChange:g=>{g||p(!1),l.onOpenChange?.(g)},className:n(go({intent:e}),a),duration:i,...l,children:[c("div",{className:"flex-shrink-0 pt-0.5",children:k}),X("div",{className:"flex flex-col gap-1 pr-8",children:[c(M.Title,{className:"font-semibold",children:t}),c(M.Description,{className:"opacity-90",children:o})]}),c(M.Close,{className:"p-0.5 shrink-0 opacity-60 hover:opacity-100 transition-opacity cursor-pointer",children:c("svg",{width:"16",height:"16",viewBox:"0 0 14 14",fill:"none",className:"w-[12px] h-[12px] block dark:text-white",children:c("path",{d:"M6.575 7.975L1.675 12.875C1.49167 13.0583 1.25833 13.15 0.975 13.15C0.691667 13.15 0.458333 13.0583 0.275 12.875C0.0916663 12.6917 0 12.4583 0 12.175C0 11.8917 0.0916663 11.6583 0.275 11.475L5.175 6.575L0.275 1.675C0.0916663 1.49167 0 1.25833 0 0.975C0 0.691667 0.0916663 0.458333 0.275 0.275C0.458333 0.0916663 0.691667 0 0.975 0C1.25833 0 1.49167 0.0916663 1.675 0.275L6.575 5.175L11.475 0.275C11.6583 0.0916663 11.8917 0 12.175 0C12.4583 0 12.6917 0.0916663 12.875 0.275C13.0583 0.458333 13.15 0.691667 13.15 0.975C13.15 1.25833 13.0583 1.49167 12.875 1.675L7.975 6.575L12.875 11.475C13.0583 11.6583 13.15 11.8917 13.15 12.175C13.15 12.4583 13.0583 12.6917 12.875 12.875C12.6917 13.0583 12.4583 13.15 12.175 13.15C11.8917 13.15 11.6583 13.0583 11.475 12.875L6.575 7.975Z",fill:"currentColor"})})}),c(xo,{"data-testid":"toast-progress-bar",duration:i,open:d}),s&&c(M.Action,{altText:s?s.label:"",className:a,onClick:s?s.onClick:()=>{},children:s?.label})]})};import{jsx as dt,jsxs as ct}from"react/jsx-runtime";var Be=Co(void 0),To=Ro("fixed z-[100] m-0 flex flex-col p-6 list-none outline-none overflow-hidden",{variants:{size:{sm:"top-1/4 right-0 w-full max-w-[320px] gap-2",md:"top-0 right-0 w-full max-w-[380px] gap-3",lg:"bottom-0 right-0 w-full max-w-[440px] gap-4"}},defaultVariants:{size:"lg"}}),No=({children:e,size:t,className:o})=>{let[a,r]=ko([]),s=l=>{let d=Math.random().toString(36).substring(2,9);r(p=>[...p,{id:d,...l}])},i=l=>{r(d=>d.filter(p=>p.id!==l))};return ct(Be.Provider,{value:{toasts:a,addToast:s,removeToast:i},children:[e,ct(oe.Provider,{children:[a.map(({id:l,...d})=>dt(lt,{...d,onOpenChange:p=>{d.onOpenChange?.(p),p||setTimeout(()=>i(l),200)}},l)),dt(oe.Viewport,{className:n(To({size:t}),o)})]})]})},Po=()=>{let e=yo(Be);if(!e)throw new Error("useToast must be used within a ToastProvider");return e};import mt from"react";import*as ae from"@radix-ui/react-switch";import*as ne from"@radix-ui/react-checkbox";import{motion as Ee,AnimatePresence as So}from"framer-motion";import{cva as re}from"class-variance-authority";import{jsx as C,jsxs as pt}from"react/jsx-runtime";var Mo=re(["relative inline-flex shrink-0 cursor-pointer items-center rounded-full transition-colors bg-toggle-primary-bg/20 disabled:cursor-not-allowed disabled:opacity-40","w-9 h-5 px-1","md:w-11 md:h-6 md:px-1","lg:w-14 lg:h-8 lg:px-1.5"]),Lo=re(["pointer-events-none block rounded-full shadow-md transition-transform bg-slate-50 data-[state=checked]:bg-toggle-primary-bg/90 data-[state=checked]:shadow-[var(--toggle-shadow)]","h-3 w-3 data-[state=checked]:translate-x-4","md:h-[18px] md:w-[18px] md:data-[state=checked]:translate-x-5","lg:h-6 lg:w-6 lg:data-[state=checked]:translate-x-6"]),ut=mt.forwardRef(({className:e,label:t,"aria-label":o,error:a,...r},s)=>pt("div",{className:"flex flex-col gap-2",children:[pt("div",{className:"flex items-center gap-3",children:[C(ae.Root,{ref:s,"aria-label":o,className:n(Mo(),e),...r,children:C(ae.Thumb,{asChild:!0,children:C(Ee.span,{layout:!0,transition:{type:"spring",stiffness:500,damping:30},className:n(Lo())})})}),t&&C("label",{className:"text-sm font-medium leading-none text-slate-700 dark:text-slate-200 cursor-pointer",children:t})]}),C(So,{children:a&&C(Ee.span,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"text-xs text-slate-600 font-medium pl-1",children:a})})]}));ut.displayName="Toggle";var Io=re(["peer shrink-0 rounded-sm border-none bg-[#d4d9de] shadow-[inset_2px_2px_4px_#bebebe,inset_-2px_-2px_4px_#ffffff] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","h-4 w-4","md:h-5 md:w-5","lg:h-6 lg:w-6"]),Vo=re(["flex items-center justify-center text-current","[&_svg]:h-3 [&_svg]:w-3","md:[&_svg]:h-3.5 md:[&_svg]:w-3.5","lg:[&_svg]:h-4 lg:[&_svg]:w-4"]),gt=mt.forwardRef(({className:e,"aria-label":t,...o},a)=>C(ne.Root,{ref:a,"aria-label":t,className:n(Io(),e),...o,children:C(ne.Indicator,{className:n(Vo()),asChild:!0,children:C(Ee.div,{initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",stiffness:400,damping:20},children:C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#606770",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-check-icon lucide-check",children:C("path",{d:"M20 6 9 17l-5-5"})})})})}));gt.displayName="CheckBox";import{jsx as y,jsxs as He}from"react/jsx-runtime";var Ao=({status:e,index:t})=>{let o="w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold border-2 transition-all duration-300 z-10 bg-white";switch(e){case"SUCCESS":return y("div",{className:`${o} border-green-500 bg-green-50 text-green-600`,children:"\u2713"});case"PROCESSING":return y("div",{className:`${o} border-blue-600 text-blue-600 animate-pulse ring-4 ring-blue-100`,children:y("span",{className:"w-2 h-2 rounded-full bg-blue-600 animate-ping"})});case"FAILED":return y("div",{className:`${o} border-red-500 bg-red-50 text-red-400`,children:"\u2715"});default:return y("div",{className:`${o} border-gray-300 text-gray-500`,children:t+1})}},Do=({steps:e,className:t=""})=>y("div",{className:`w-full max-w-4xl mx-auto p-6 ${t}`,children:He("div",{className:"flex items-center justify-between relative",children:[y("div",{className:"absolute top-4 left-0 right-0 h-0.5 bg-gray-200 -z-0"}),e.map((o,a)=>{let r=o.status==="SUCCESS",s=o.status==="PROCESSING",i=o.status==="FAILED";return He("div",{className:"flex flex-col items-center flex-1 relative",children:[a>0&&y("div",{className:`absolute top-4 right-[50%] left-[-50%] h-0.5 transition-all duration-500 ${e[a]?.status==="SUCCESS"?"bg-green-500":e[a]?.status==="FAILED"?"bg-red-400":e[a-1]?.status==="SUCCESS"?"bg-green-500":"bg-gray-200"}`}),y(Ao,{status:o.status,index:a}),He("div",{className:"mt-3 text-center px-2",children:[y("p",{className:`text-sm font-medium transition-colors duration-300 ${s?"text-blue-600 font-semibold":r?"text-gray-800":i?"text-red-600":"text-gray-500"}`,children:o.label}),o.description&&y("p",{className:"text-xs text-gray-500 mt-0.5 max-w-[120px] mx-auto",children:o.description})]})]},o.id)})]})});export{Z as ActionButton,Pt as AssetCard,Ke as AssetCardGroup,qe as AssetCardHeader,Ue as AssetCardIcon,Qe as AssetCardInfo,Ze as AssetCardMain,Xe as AssetCardRate,Ge as AssetCardRoot,et as AssetCardSparkline,Je as AssetCardValue,Ye as AssetCardVisuals,gt as CheckBox,Mt as CommandBar,ge as CommandBarContainer,be as CommandEmpty,he as CommandGroup,xe as CommandInput,ve as CommandItem,fe as CommandList,we as CommandSeparator,Re as CopyField,ke as CopyFieldButton,ye as CopyFieldInput,zt as CurrencyInput,Me as CurrencyInputDropdown,Se as CurrencyInputInput,Pe as CurrencyInputMaxButton,Ne as CurrencyInputRoot,Ut as DataTable,_ as Modal,ue as ModalAction,ce as ModalBody,me as ModalCancel,pe as ModalFooter,de as ModalHeader,le as ModalTrigger,no as PriceTicker,Xt as Stat,Ae as StatExtras,Le as StatLabel,De as StatRoot,Ie as StatTrend,Ve as StatValue,io as StatusBadge,Be as ToastContext,No as ToastProvider,ut as Toggle,Ce as ToolTip,Do as TransactionStepper,Fe as buttonVariants,Po as useToast};
|
package/package.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bass-ui-kit/core",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "High-performance accessible UI primitives engineered for fintech interfaces.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"react",
|
|
24
|
+
"tailwind",
|
|
25
|
+
"typescript",
|
|
26
|
+
"fintech",
|
|
27
|
+
"components",
|
|
28
|
+
"bass-ui"
|
|
29
|
+
],
|
|
30
|
+
"author": "Ikeurulor Sebastin Chiagoziem",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": "^19.2.0",
|
|
34
|
+
"react-dom": "^19.2.0",
|
|
35
|
+
"framer-motion": "^12.38.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@chromatic-com/storybook": "^5.1.2",
|
|
39
|
+
"@storybook/addon-a11y": "^10.3.5",
|
|
40
|
+
"@storybook/addon-docs": "^10.3.5",
|
|
41
|
+
"@storybook/addon-onboarding": "^10.3.5",
|
|
42
|
+
"@storybook/addon-themes": "^10.3.5",
|
|
43
|
+
"@storybook/addon-viewport": "^9.0.8",
|
|
44
|
+
"@storybook/addon-vitest": "^10.3.5",
|
|
45
|
+
"@storybook/react": "^10.4.0",
|
|
46
|
+
"@storybook/react-vite": "^10.3.5",
|
|
47
|
+
"@storybook/test": "^8.6.15",
|
|
48
|
+
"@storybook/test-runner": "^0.24.3",
|
|
49
|
+
"@tailwindcss/vite": "^4.2.4",
|
|
50
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
51
|
+
"@testing-library/react": "^16.3.2",
|
|
52
|
+
"@testing-library/user-event": "^14.6.1",
|
|
53
|
+
"@types/node": "^22.15.3",
|
|
54
|
+
"@types/react": "19.2.2",
|
|
55
|
+
"@types/react-dom": "19.2.2",
|
|
56
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
57
|
+
"@vitest/browser-playwright": "^4.1.5",
|
|
58
|
+
"@vitest/coverage-v8": "^4.1.5",
|
|
59
|
+
"chromatic": "^16.5.0",
|
|
60
|
+
"eslint": "^9.39.1",
|
|
61
|
+
"eslint-plugin-storybook": "^10.3.5",
|
|
62
|
+
"jsdom": "^29.1.0",
|
|
63
|
+
"playwright": "^1.59.1",
|
|
64
|
+
"storybook": "^10.3.5",
|
|
65
|
+
"tsup": "^8.5.1",
|
|
66
|
+
"typescript": "5.9.2",
|
|
67
|
+
"vite": "^8.0.9",
|
|
68
|
+
"vitest": "^4.1.5",
|
|
69
|
+
"@repo/eslint-config": "0.0.0",
|
|
70
|
+
"@repo/typescript-config": "0.0.0"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"@fontsource-variable/inclusive-sans": "^5.2.8",
|
|
74
|
+
"@fontsource-variable/open-sans": "^5.2.7",
|
|
75
|
+
"@fontsource/inclusive-sans": "^5.2.8",
|
|
76
|
+
"@fontsource/lato": "^5.2.7",
|
|
77
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
78
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
79
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
80
|
+
"@radix-ui/react-switch": "^1.2.6",
|
|
81
|
+
"@radix-ui/react-toast": "^1.2.15",
|
|
82
|
+
"@radix-ui/react-toggle": "^1.1.10",
|
|
83
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
84
|
+
"@tanstack/react-table": "^8.21.3",
|
|
85
|
+
"class-variance-authority": "^0.7.1",
|
|
86
|
+
"clsx": "^2.1.1",
|
|
87
|
+
"cmdk": "^1.1.1",
|
|
88
|
+
"tailwind-merge": "^3.5.0"
|
|
89
|
+
},
|
|
90
|
+
"scripts": {
|
|
91
|
+
"lint": "eslint . --max-warnings 0",
|
|
92
|
+
"generate:component": "turbo gen react-component",
|
|
93
|
+
"check-types": "tsc --noEmit",
|
|
94
|
+
"storybook": "storybook dev -p 6006",
|
|
95
|
+
"build-storybook": "storybook build",
|
|
96
|
+
"build": "tsup index.ts --format esm,cjs --dts --clean --minify --external react --external react-dom --external framer-motion --external @radix-ui/* --external @tanstack/*",
|
|
97
|
+
"dev": "tsup index.ts --format esm --watch --dts",
|
|
98
|
+
"test": "vitest --config vitest.unit.config.ts",
|
|
99
|
+
"test:ui": "vitest",
|
|
100
|
+
"chromatic": "chromatic"
|
|
101
|
+
}
|
|
102
|
+
}
|