@gearbox-protocol/permissionless-ui 1.17.2 → 1.17.3
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/cjs/components/asset-line/asset-line.cjs +1 -1
- package/dist/cjs/components/options-list/options-list.cjs +1 -1
- package/dist/cjs/components/table/grid-table.cjs +1 -1
- package/dist/cjs/components/table/table.cjs +1 -1
- package/dist/cjs/components/token-icon/token-icon.cjs +1 -1
- package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
- package/dist/esm/components/asset-line/asset-line.js +40 -35
- package/dist/esm/components/options-list/options-list.js +13 -13
- package/dist/esm/components/table/grid-table.js +70 -59
- package/dist/esm/components/table/table.js +47 -44
- package/dist/esm/components/token-icon/token-icon.js +2 -2
- package/dist/esm/components/token-symbol/token-symbol.js +9 -9
- package/dist/globals.css +1 -1
- package/dist/types/components/asset-line/asset-line.d.ts +7 -0
- package/dist/types/components/token-icon/token-icon.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),R=require("react"),g=require("../description/description.cjs"),h=require("../short-string/short-string.cjs"),l=require("../table/grid-table.cjs"),w=require("../token-symbol/token-symbol.cjs"),p=require("../vspace/vspace.cjs"),L=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk");function A(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return s.default=t,Object.freeze(s)}const C=A(R),G={default:24,sm:20,md:24,lg:28},x={default:0,sm:2,md:4,lg:4},S=C.forwardRef(({token:t,tokenLabel:s,tokenDescription:r,network:n,chainId:j,value:a,valueDescription:o,size:c="default",iconSize:b=c,gapSize:d=c,last:_,symbolMaxLength:q,descriptionMaxLength:y,onSelect:m,hideValue:u=!1,rounded:N=!0,className:T},O)=>{const i=s||t?.title,f=c==="md"?"default":c;return e.jsxs(l.GridTableRow,{ref:O,className:L.cn(m&&"cursor-pointer",T),onClick:m,cols:u?"1fr":"1fr 1fr",noRound:!N,last:_,children:[e.jsx(l.GridTableCell,{size:f,className:"text-left",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(w.TokenSymbol,{token:t,size:G[b],chainId:j,network:n}),e.jsxs("div",{className:"flex-1 min-w-0",children:[i&&e.jsx(h.ShortString,{maxLength:q,children:i}),i&&r&&e.jsx(p.VSpace,{height:x[d]}),r&&e.jsx(g.Description,{children:e.jsx(h.ShortString,{maxLength:y,showTooltip:!1,children:String(r)})})]})]})}),!u&&e.jsxs(l.GridTableCell,{size:f,className:"text-right",children:[a,a&&o&&e.jsx(p.VSpace,{height:x[d]}),o&&e.jsx(g.Description,{children:o})]})]})});S.displayName="AssetLine";exports.AssetLine=S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),m=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),m=require("react"),f=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk");function b(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const i=b(m);function x({className:e,children:r,...t}){const l=i.Children.toArray(r).length,a=i.Children.map(r,(o,c)=>{if(i.isValidElement(o)){const u=c===0,d=c===l-1;return i.cloneElement(o,{first:u,last:d})}return o});return n.jsx("div",{className:f.cn("m-0 p-0 w-full flex flex-wrap",e),...t,children:a})}function p({icon:e,title:r,subTitle:t,onClick:s,endingIcon:l,last:a=!1,className:o}){return n.jsxs("button",{type:"button",onClick:s,className:f.cn("relative z-0 pt-5 px-4 flex flex-row items-start gap-4 w-full cursor-pointer text-left","before:absolute before:-z-10 before:left-0 before:hidden before:w-full before:inset-y-0 before:content-[''] before:bg-muted/50 before:rounded-lg","hover:before:block",!a&&"after:absolute after:bottom-0 after:inset-x-3 after:h-px after:content-[''] after:bg-border",o),children:[e&&n.jsx("div",{className:"w-6 h-6 text-muted-foreground flex items-center justify-center",children:e}),n.jsx("div",{className:"pb-5 flex-1 flex flex-col gap-2",children:n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsx("div",{className:"text-base leading-[1.2] font-medium",children:r}),t&&n.jsx("div",{className:"text-sm text-muted-foreground",children:t})]})}),l&&n.jsx("div",{className:"ml-4 text-muted-foreground transition-colors",children:l})]})}exports.OptionsItem=p;exports.OptionsList=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("class-variance-authority"),_=require("react"),m=require("../layout/col/col.cjs"),p=require("../layout/grid/grid.cjs"),l=require("../../utils/cn.cjs");function z(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const d=z(_),T=n.cva("w-full",{variants:{size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}}),y=d.forwardRef(({className:e,size:a,cols:t=12,gap:r=0,...i},o)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx(p.Grid,{ref:o,cols:t,gap:r,className:l.cn(T({size:a,className:e})),...i})}));y.displayName="GridTable";const g=d.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:l.cn("contents","[&>*>*]:after:absolute [&>*>*]:after:bottom-0 [&>*>*]:after:inset-x-0 [&>*>*]:after:h-px [&>*>*]:after:bg-border",e),...a}));g.displayName="GridTableHeader";const x=d.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:l.cn("contents [&>*:last-child>*]:after:hidden",e),...a}));x.displayName="GridTableBody";const G=d.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:l.cn("contents [&>*]:border-t [&>*]:bg-muted/50 [&>*]:font-medium",e),...a}));G.displayName="GridTableFooter";const j=d.forwardRef(({className:e,cols:a,gap:t=0,last:r,height:i,hideValue:o,noHover:w,noRound:b,style:R,...C},V)=>{const u=typeof i=="number"?`${i}px`:i;return s.jsx(p.Grid,{ref:V,cols:a,gap:t,className:l.cn("contents [&>*]:relative [&>*]:transition-colors data-[state=selected]:[&>*]:bg-muted","md:[&>*]:after:absolute md:[&>*]:after:bottom-0 md:[&>*]:after:inset-x-0 md:[&>*]:after:h-px md:[&>*]:after:bg-border",!b&&["md:[&>*:first-child]:after:left-3","md:[&>*:last-child]:after:right-3"],!w&&["[&>*]:z-0","[&>*]:before:absolute [&>*]:before:inset-0 [&>*]:before:-z-10 [&>*]:before:bg-muted/50 [&>*]:before:opacity-0 [&>*]:before:transition-opacity","hover:[&>*]:before:opacity-100",!b&&"[&>*:first-child]:before:rounded-l-lg [&>*:last-child]:before:rounded-r-lg"],r&&"md:[&>*]:after:hidden",o&&"[&>*]:opacity-0",e),style:{...R,...u?{height:u}:{}},...C})});j.displayName="GridTableRow";const h=n.cva("flex items-center justify-startborder-b text-left align-middle font-medium text-muted-foreground !bg-transparent",{variants:{size:{sm:"min-h-8 px-1 py-2 text-xs",default:"min-h-10 px-2 py-2.5",lg:"min-h-12 px-4 py-3"},justify:{start:"justify-start",center:"justify-center",end:"justify-end"}},defaultVariants:{size:"default",justify:"start"}}),c=d.forwardRef(({className:e,size:a,span:t=1,justify:r="start",...i},o)=>s.jsx(m.Col,{ref:o,span:t,className:l.cn(h({size:a,justify:r,className:e})),...i}));c.displayName="GridTableHead";const N=n.cva("align-middle",{variants:{size:{sm:"p-2",default:"p-4",lg:"p-6"},textAlign:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{size:"default"}}),f=d.forwardRef(({className:e,size:a,span:t=1,textAlign:r,...i},o)=>s.jsx(m.Col,{ref:o,span:t,className:l.cn(N({size:a,textAlign:r,className:e})),...i}));f.displayName="GridTableCell";const v=d.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:l.cn("col-span-full mt-4 text-sm text-muted-foreground",e),...a}));v.displayName="GridTableCaption";const H=f,q=c;exports.GridTable=y;exports.GridTableBody=x;exports.GridTableCaption=v;exports.GridTableCell=f;exports.GridTableFooter=G;exports.GridTableHead=c;exports.GridTableHeader=g;exports.GridTableRow=j;exports.Td=H;exports.Th=q;exports.gridTableCellVariants=N;exports.gridTableHeadVariants=h;exports.gridTableVariants=T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("class-variance-authority"),_=require("lucide-react"),C=require("react"),H=require("../buttons/button/button.cjs"),n=require("../tooltip/tooltip.cjs"),s=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk");function V(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const l=V(C),c=i.cva("w-full caption-bottom",{variants:{size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}}),b=l.forwardRef(({className:e,size:a,...t},o)=>r.jsx("div",{className:"relative w-full overflow-auto rounded-lg border border-input bg-card",children:r.jsx("table",{ref:o,className:s.cn(c({size:a,className:e})),...t})}));b.displayName="Table";const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("class-variance-authority"),_=require("lucide-react"),C=require("react"),H=require("../buttons/button/button.cjs"),n=require("../tooltip/tooltip.cjs"),s=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk");function V(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const l=V(C),c=i.cva("w-full caption-bottom",{variants:{size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}}),b=l.forwardRef(({className:e,size:a,...t},o)=>r.jsx("div",{className:"relative w-full overflow-auto rounded-lg border border-input bg-card",children:r.jsx("table",{ref:o,className:s.cn(c({size:a,className:e})),...t})}));b.displayName="Table";const f=l.forwardRef(({className:e,...a},t)=>r.jsx("thead",{ref:t,className:s.cn("[&_tr]:after:inset-x-0 [&_tr]:after:bg-input [&_tr]:hover:bg-transparent [&_tr]:hover:before:opacity-0",e),...a}));f.displayName="TableHeader";const u=l.forwardRef(({className:e,...a},t)=>r.jsx("tbody",{ref:t,className:s.cn("[&_tr:last-child]:after:hidden",e),...a}));u.displayName="TableBody";const m=l.forwardRef(({className:e,...a},t)=>r.jsx("tfoot",{ref:t,className:s.cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...a}));m.displayName="TableFooter";const p=l.forwardRef(({className:e,...a},t)=>r.jsx("tr",{ref:t,className:s.cn("relative transition-colors data-[state=selected]:bg-muted","before:absolute before:inset-0 before:-z-10 before:rounded-lg before:bg-muted/50 before:opacity-0 before:transition-opacity","hover:before:opacity-100","after:absolute after:bottom-0 after:inset-x-3 after:h-px after:bg-border",e),...a}));p.displayName="TableRow";const x=i.cva("border-b bg-muted/50 text-left align-middle font-medium text-muted-foreground border-input",{variants:{size:{sm:"h-8 px-1 text-xs",default:"h-10 px-2",lg:"h-12 px-4"}},defaultVariants:{size:"default"}}),d=l.forwardRef(({className:e,size:a,...t},o)=>r.jsx("th",{ref:o,className:s.cn(x({size:a,className:e})),...t}));d.displayName="TableHead";const g=i.cva("align-middle",{variants:{size:{sm:"p-1",default:"p-2",lg:"p-4"}},defaultVariants:{size:"default"}}),T=l.forwardRef(({className:e,size:a,...t},o)=>r.jsx("td",{ref:o,className:s.cn(g({size:a,className:e})),...t}));T.displayName="TableCell";const y=l.forwardRef(({className:e,...a},t)=>r.jsx("caption",{ref:t,className:s.cn("mt-4 text-sm text-muted-foreground",e),...a}));y.displayName="TableCaption";const h=l.forwardRef(({title:e,isSorted:a,direction:t,setSort:o,placement:j="right",children:v,className:w,...N},R)=>r.jsx(d,{ref:R,className:w,...N,children:r.jsx(n.TooltipProvider,{children:r.jsxs(n.Tooltip,{delayDuration:200,children:[r.jsx(n.TooltipTrigger,{asChild:!0,children:r.jsxs("div",{className:s.cn("group flex items-center gap-1 w-fit cursor-pointer hover:text-foreground",j==="left"?"flex-row-reverse":"flex-row"),onClick:()=>o(t==="asc"?"desc":"asc"),children:[v,r.jsx(H.Button,{variant:"text",size:"auto",className:a?void 0:"opacity-0 group-hover:opacity-100",children:r.jsx(_.ArrowDown,{className:s.cn("h-4 w-4",t==="desc"?"rotate-180":"","transition-transform duration-200 ease-in-out")})})]})}),r.jsxs(n.TooltipContent,{side:"top",children:["Sort by ",e]})]})})}));h.displayName="SortingTableHead";exports.SortingTableHead=h;exports.Table=b;exports.TableBody=u;exports.TableCaption=y;exports.TableCell=T;exports.TableFooter=m;exports.TableHead=d;exports.TableHeader=f;exports.TableRow=p;exports.tableCellVariants=g;exports.tableHeadVariants=x;exports.tableVariants=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),c=require("react"),p=require("../../utils/cn.cjs"),s="https://static.gearbox.fi/tokens/default.svg",i=new Set;function k(t){const e=t.replace("/","").replace(" ","").replace("-f","").replace("-","_").toLowerCase();if(!e)return s;const n=`https://static.gearbox.fi/tokens/${e}.svg`;return i.has(n)?s:n}function m({symbol:t,size:e=48,className:n}){const o=k(t),[r,l]=c.useState(o),[u,d]=c.useState(!1),a=c.useRef(!1),f=()=>{a.current||(a.current=!0,i.add(r),l(s))},g=()=>{d(!0)};return h.jsx("img",{src:r,alt:"",width:e,height:e,className:p.cn("object-contain
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),c=require("react"),p=require("../../utils/cn.cjs"),s="https://static.gearbox.fi/tokens/default.svg",i=new Set;function k(t){const e=t.replace("/","").replace(" ","").replace("-f","").replace("-","_").toLowerCase();if(!e)return s;const n=`https://static.gearbox.fi/tokens/${e}.svg`;return i.has(n)?s:n}function m({symbol:t,size:e=48,className:n}){const o=k(t),[r,l]=c.useState(o),[u,d]=c.useState(!1),a=c.useRef(!1),f=()=>{a.current||(a.current=!0,i.add(r),l(s))},g=()=>{d(!0)};return h.jsx("img",{src:r,alt:"",width:e,height:e,className:p.cn("object-contain",!u&&"bg-gray-200 dark:bg-gray-700 rounded-full",n),style:{width:e,height:e},onError:f,onLoad:g})}function b(t){t.forEach(e=>{const o=`https://static.gearbox.fi/tokens/${e.replace("/","").replace(" ","").replace("-f","").replace("-","_").toLowerCase()}.svg`,r=new window.Image;r.src=o})}exports.TokenIcon=m;exports.preloadTokenIcons=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),m=require("../token-icon/token-icon.cjs");require("react");const d=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk");function f(e){if(e)return typeof e=="string"?e:e.symbol}function x(e){if(e)return typeof e=="string"?e:e.title}function g({token:e,title:s,className:c,comment:r,showIcon:o=!0,showSymbol:l=!1,size:u=24,chainId:h,network:p,maxLength:y,...a}){const n=f(e),i=s||x(e);return t.jsxs("div",{className:d.cn("flex items-center gap-3",c),...a,children:[o&&n&&t.jsx(m.TokenIcon,{symbol:n,size:u,className:"shrink-0 self-center"}),l&&i&&t.jsxs("div",{className:"flex items-center gap-1 self-center",children:[t.jsx("div",{className:"text-xs sm:text-sm md:text-base font-medium truncate whitespace-pre-wrap leading-tight",children:i}),r&&t.jsxs("div",{className:"text-md text-muted-foreground leading-tight",children:["(",r,")"]})]})]})}exports.TokenSymbol=g;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as G from "react";
|
|
3
|
-
import { Description as
|
|
3
|
+
import { Description as n } from "../description/description.js";
|
|
4
4
|
import { ShortString as h } from "../short-string/short-string.js";
|
|
5
5
|
import { GridTableRow as I, GridTableCell as p } from "../table/grid-table.js";
|
|
6
|
-
import { TokenSymbol as
|
|
6
|
+
import { TokenSymbol as j } from "../token-symbol/token-symbol.js";
|
|
7
7
|
import { VSpace as g } from "../vspace/vspace.js";
|
|
8
|
-
import { cn as
|
|
8
|
+
import { cn as y } from "../../utils/cn.js";
|
|
9
9
|
import "sonner";
|
|
10
10
|
import "@gearbox-protocol/sdk";
|
|
11
|
-
const
|
|
11
|
+
const E = {
|
|
12
12
|
default: 24,
|
|
13
13
|
sm: 20,
|
|
14
14
|
md: 24,
|
|
@@ -18,66 +18,71 @@ const y = {
|
|
|
18
18
|
sm: 2,
|
|
19
19
|
md: 4,
|
|
20
20
|
lg: 4
|
|
21
|
-
},
|
|
21
|
+
}, Z = G.forwardRef(
|
|
22
22
|
({
|
|
23
|
-
token:
|
|
23
|
+
token: i,
|
|
24
24
|
tokenLabel: S,
|
|
25
|
-
tokenDescription:
|
|
25
|
+
tokenDescription: l,
|
|
26
26
|
network: N,
|
|
27
27
|
chainId: b,
|
|
28
28
|
value: s,
|
|
29
|
-
valueDescription:
|
|
29
|
+
valueDescription: m,
|
|
30
30
|
size: e = "default",
|
|
31
31
|
iconSize: u = e,
|
|
32
|
-
gapSize:
|
|
33
|
-
last:
|
|
34
|
-
symbolMaxLength:
|
|
35
|
-
descriptionMaxLength:
|
|
36
|
-
onSelect:
|
|
37
|
-
hideValue:
|
|
32
|
+
gapSize: a = e,
|
|
33
|
+
last: w,
|
|
34
|
+
symbolMaxLength: L,
|
|
35
|
+
descriptionMaxLength: R,
|
|
36
|
+
onSelect: c,
|
|
37
|
+
hideValue: d = !1,
|
|
38
|
+
rounded: T = !0,
|
|
38
39
|
className: A
|
|
39
40
|
}, C) => {
|
|
40
|
-
const
|
|
41
|
+
const o = S || i?.title, f = e === "md" ? "default" : e;
|
|
41
42
|
return /* @__PURE__ */ t(
|
|
42
43
|
I,
|
|
43
44
|
{
|
|
44
45
|
ref: C,
|
|
45
|
-
className:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
onClick: d,
|
|
51
|
-
cols: a ? "1fr" : "1fr 1fr",
|
|
52
|
-
noRound: !0,
|
|
46
|
+
className: y(c && "cursor-pointer", A),
|
|
47
|
+
onClick: c,
|
|
48
|
+
cols: d ? "1fr" : "1fr 1fr",
|
|
49
|
+
noRound: !T,
|
|
50
|
+
last: w,
|
|
53
51
|
children: [
|
|
54
|
-
/* @__PURE__ */ r(p, { size:
|
|
52
|
+
/* @__PURE__ */ r(p, { size: f, className: "text-left", children: /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
|
|
55
53
|
/* @__PURE__ */ r(
|
|
56
|
-
|
|
54
|
+
j,
|
|
57
55
|
{
|
|
58
|
-
token:
|
|
59
|
-
size:
|
|
56
|
+
token: i,
|
|
57
|
+
size: E[u],
|
|
60
58
|
chainId: b,
|
|
61
59
|
network: N
|
|
62
60
|
}
|
|
63
61
|
),
|
|
64
62
|
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
o && /* @__PURE__ */ r(h, { maxLength: L, children: o }),
|
|
64
|
+
o && l && /* @__PURE__ */ r(g, { height: x[a] }),
|
|
65
|
+
l && /* @__PURE__ */ r(n, { children: /* @__PURE__ */ r(
|
|
66
|
+
h,
|
|
67
|
+
{
|
|
68
|
+
maxLength: R,
|
|
69
|
+
showTooltip: !1,
|
|
70
|
+
children: String(l)
|
|
71
|
+
}
|
|
72
|
+
) })
|
|
68
73
|
] })
|
|
69
74
|
] }) }),
|
|
70
|
-
!
|
|
75
|
+
!d && /* @__PURE__ */ t(p, { size: f, className: "text-right", children: [
|
|
71
76
|
s,
|
|
72
|
-
s &&
|
|
73
|
-
|
|
77
|
+
s && m && /* @__PURE__ */ r(g, { height: x[a] }),
|
|
78
|
+
m && /* @__PURE__ */ r(n, { children: m })
|
|
74
79
|
] })
|
|
75
80
|
]
|
|
76
81
|
}
|
|
77
82
|
);
|
|
78
83
|
}
|
|
79
84
|
);
|
|
80
|
-
|
|
85
|
+
Z.displayName = "AssetLine";
|
|
81
86
|
export {
|
|
82
|
-
|
|
87
|
+
Z as AssetLine
|
|
83
88
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as m } from "../../utils/cn.js";
|
|
4
4
|
import "sonner";
|
|
5
5
|
import "@gearbox-protocol/sdk";
|
|
6
6
|
function g({
|
|
@@ -8,37 +8,37 @@ function g({
|
|
|
8
8
|
children: o,
|
|
9
9
|
...l
|
|
10
10
|
}) {
|
|
11
|
-
const
|
|
11
|
+
const s = n.Children.toArray(o).length, a = n.Children.map(o, (t, i) => {
|
|
12
12
|
if (n.isValidElement(t)) {
|
|
13
|
-
const
|
|
13
|
+
const d = i === 0, u = i === s - 1;
|
|
14
14
|
return n.cloneElement(t, {
|
|
15
|
-
first:
|
|
15
|
+
first: d,
|
|
16
16
|
last: u
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
20
|
});
|
|
21
|
-
return /* @__PURE__ */ e("div", { className:
|
|
21
|
+
return /* @__PURE__ */ e("div", { className: m("m-0 p-0 w-full flex flex-wrap", r), ...l, children: a });
|
|
22
22
|
}
|
|
23
23
|
function v({
|
|
24
24
|
icon: r,
|
|
25
25
|
title: o,
|
|
26
26
|
subTitle: l,
|
|
27
|
-
onClick:
|
|
28
|
-
endingIcon:
|
|
29
|
-
last:
|
|
27
|
+
onClick: f,
|
|
28
|
+
endingIcon: s,
|
|
29
|
+
last: a = !1,
|
|
30
30
|
className: t
|
|
31
31
|
}) {
|
|
32
32
|
return /* @__PURE__ */ c(
|
|
33
33
|
"button",
|
|
34
34
|
{
|
|
35
35
|
type: "button",
|
|
36
|
-
onClick:
|
|
37
|
-
className:
|
|
36
|
+
onClick: f,
|
|
37
|
+
className: m(
|
|
38
38
|
"relative z-0 pt-5 px-4 flex flex-row items-start gap-4 w-full cursor-pointer text-left",
|
|
39
|
-
"before:absolute before:-z-10 before:left-0 before:hidden before:w-full before:inset-y-0 before:content-[''] before:bg-
|
|
39
|
+
"before:absolute before:-z-10 before:left-0 before:hidden before:w-full before:inset-y-0 before:content-[''] before:bg-muted/50 before:rounded-lg",
|
|
40
40
|
"hover:before:block",
|
|
41
|
-
!
|
|
41
|
+
!a && "after:absolute after:bottom-0 after:inset-x-3 after:h-px after:content-[''] after:bg-border",
|
|
42
42
|
t
|
|
43
43
|
),
|
|
44
44
|
children: [
|
|
@@ -47,7 +47,7 @@ function v({
|
|
|
47
47
|
/* @__PURE__ */ e("div", { className: "text-base leading-[1.2] font-medium", children: o }),
|
|
48
48
|
l && /* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground", children: l })
|
|
49
49
|
] }) }),
|
|
50
|
-
|
|
50
|
+
s && /* @__PURE__ */ e("div", { className: "ml-4 text-muted-foreground transition-colors", children: s })
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
53
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { cva as
|
|
2
|
+
import { cva as f } from "class-variance-authority";
|
|
3
3
|
import * as s from "react";
|
|
4
|
-
import { Col as
|
|
4
|
+
import { Col as c } from "../layout/col/col.js";
|
|
5
5
|
import { Grid as b } from "../layout/grid/grid.js";
|
|
6
|
-
import { cn as
|
|
7
|
-
const
|
|
6
|
+
import { cn as i } from "../../utils/cn.js";
|
|
7
|
+
const h = f("w-full", {
|
|
8
8
|
variants: {
|
|
9
9
|
size: {
|
|
10
10
|
sm: "text-xs",
|
|
@@ -15,91 +15,102 @@ const G = n("w-full", {
|
|
|
15
15
|
defaultVariants: {
|
|
16
16
|
size: "default"
|
|
17
17
|
}
|
|
18
|
-
}),
|
|
19
|
-
({ className: e, size: t, cols: a = 12, gap:
|
|
18
|
+
}), G = s.forwardRef(
|
|
19
|
+
({ className: e, size: t, cols: a = 12, gap: l = 0, ...r }, o) => /* @__PURE__ */ d("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ d(
|
|
20
20
|
b,
|
|
21
21
|
{
|
|
22
|
-
ref:
|
|
22
|
+
ref: o,
|
|
23
23
|
cols: a,
|
|
24
|
-
gap:
|
|
25
|
-
className:
|
|
24
|
+
gap: l,
|
|
25
|
+
className: i(h({ size: t, className: e })),
|
|
26
26
|
...r
|
|
27
27
|
}
|
|
28
28
|
) })
|
|
29
29
|
);
|
|
30
|
-
|
|
31
|
-
const
|
|
30
|
+
G.displayName = "GridTable";
|
|
31
|
+
const N = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ d(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
34
|
ref: a,
|
|
35
|
-
className:
|
|
35
|
+
className: i(
|
|
36
|
+
"contents",
|
|
37
|
+
// Full-width border for header (no insets)
|
|
38
|
+
"[&>*>*]:after:absolute [&>*>*]:after:bottom-0 [&>*>*]:after:inset-x-0 [&>*>*]:after:h-px [&>*>*]:after:bg-border",
|
|
39
|
+
e
|
|
40
|
+
),
|
|
36
41
|
...t
|
|
37
42
|
}
|
|
38
43
|
));
|
|
39
|
-
|
|
40
|
-
const
|
|
44
|
+
N.displayName = "GridTableHeader";
|
|
45
|
+
const v = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ d(
|
|
41
46
|
"div",
|
|
42
47
|
{
|
|
43
48
|
ref: a,
|
|
44
|
-
className:
|
|
49
|
+
className: i("contents [&>*:last-child>*]:after:hidden", e),
|
|
45
50
|
...t
|
|
46
51
|
}
|
|
47
52
|
));
|
|
48
|
-
|
|
49
|
-
const
|
|
53
|
+
v.displayName = "GridTableBody";
|
|
54
|
+
const w = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ d(
|
|
50
55
|
"div",
|
|
51
56
|
{
|
|
52
57
|
ref: a,
|
|
53
|
-
className:
|
|
58
|
+
className: i(
|
|
54
59
|
"contents [&>*]:border-t [&>*]:bg-muted/50 [&>*]:font-medium",
|
|
55
60
|
e
|
|
56
61
|
),
|
|
57
62
|
...t
|
|
58
63
|
}
|
|
59
64
|
));
|
|
60
|
-
|
|
65
|
+
w.displayName = "GridTableFooter";
|
|
61
66
|
const R = s.forwardRef(
|
|
62
67
|
({
|
|
63
68
|
className: e,
|
|
64
69
|
cols: t,
|
|
65
70
|
gap: a = 0,
|
|
66
|
-
last:
|
|
71
|
+
last: l,
|
|
67
72
|
height: r,
|
|
68
|
-
hideValue:
|
|
69
|
-
noHover:
|
|
70
|
-
noRound:
|
|
73
|
+
hideValue: o,
|
|
74
|
+
noHover: y,
|
|
75
|
+
noRound: n,
|
|
71
76
|
style: x,
|
|
72
|
-
...
|
|
73
|
-
},
|
|
74
|
-
const
|
|
77
|
+
...g
|
|
78
|
+
}, T) => {
|
|
79
|
+
const m = typeof r == "number" ? `${r}px` : r;
|
|
75
80
|
return /* @__PURE__ */ d(
|
|
76
81
|
b,
|
|
77
82
|
{
|
|
78
|
-
ref:
|
|
83
|
+
ref: T,
|
|
79
84
|
cols: t,
|
|
80
85
|
gap: a,
|
|
81
|
-
className:
|
|
82
|
-
"contents
|
|
86
|
+
className: i(
|
|
87
|
+
"contents [&>*]:relative [&>*]:transition-colors data-[state=selected]:[&>*]:bg-muted",
|
|
88
|
+
// Bottom border via ::after with insets on first/last cells to avoid rounded corners
|
|
89
|
+
"md:[&>*]:after:absolute md:[&>*]:after:bottom-0 md:[&>*]:after:inset-x-0 md:[&>*]:after:h-px md:[&>*]:after:bg-border",
|
|
90
|
+
!n && [
|
|
91
|
+
"md:[&>*:first-child]:after:left-3",
|
|
92
|
+
"md:[&>*:last-child]:after:right-3"
|
|
93
|
+
],
|
|
83
94
|
// Hover background with optional rounded corners on first and last cells (unless noHover)
|
|
84
|
-
!
|
|
85
|
-
"[&>*]:
|
|
95
|
+
!y && [
|
|
96
|
+
"[&>*]:z-0",
|
|
86
97
|
"[&>*]:before:absolute [&>*]:before:inset-0 [&>*]:before:-z-10 [&>*]:before:bg-muted/50 [&>*]:before:opacity-0 [&>*]:before:transition-opacity",
|
|
87
98
|
"hover:[&>*]:before:opacity-100",
|
|
88
99
|
// Only add rounded corners if noRound is not set
|
|
89
|
-
!
|
|
100
|
+
!n && "[&>*:first-child]:before:rounded-l-lg [&>*:last-child]:before:rounded-r-lg"
|
|
90
101
|
],
|
|
91
|
-
|
|
92
|
-
|
|
102
|
+
l && "md:[&>*]:after:hidden",
|
|
103
|
+
o && "[&>*]:opacity-0",
|
|
93
104
|
e
|
|
94
105
|
),
|
|
95
|
-
style: { ...x, ...
|
|
96
|
-
...
|
|
106
|
+
style: { ...x, ...m ? { height: m } : {} },
|
|
107
|
+
...g
|
|
97
108
|
}
|
|
98
109
|
);
|
|
99
110
|
}
|
|
100
111
|
);
|
|
101
112
|
R.displayName = "GridTableRow";
|
|
102
|
-
const z =
|
|
113
|
+
const z = f(
|
|
103
114
|
"flex items-center justify-startborder-b text-left align-middle font-medium text-muted-foreground !bg-transparent",
|
|
104
115
|
{
|
|
105
116
|
variants: {
|
|
@@ -119,19 +130,19 @@ const z = n(
|
|
|
119
130
|
justify: "start"
|
|
120
131
|
}
|
|
121
132
|
}
|
|
122
|
-
),
|
|
123
|
-
({ className: e, size: t, span: a = 1, justify:
|
|
124
|
-
|
|
133
|
+
), p = s.forwardRef(
|
|
134
|
+
({ className: e, size: t, span: a = 1, justify: l = "start", ...r }, o) => /* @__PURE__ */ d(
|
|
135
|
+
c,
|
|
125
136
|
{
|
|
126
|
-
ref:
|
|
137
|
+
ref: o,
|
|
127
138
|
span: a,
|
|
128
|
-
className:
|
|
139
|
+
className: i(z({ size: t, justify: l, className: e })),
|
|
129
140
|
...r
|
|
130
141
|
}
|
|
131
142
|
)
|
|
132
143
|
);
|
|
133
|
-
|
|
134
|
-
const j =
|
|
144
|
+
p.displayName = "GridTableHead";
|
|
145
|
+
const j = f("align-middle", {
|
|
135
146
|
variants: {
|
|
136
147
|
size: {
|
|
137
148
|
sm: "p-2",
|
|
@@ -147,23 +158,23 @@ const j = n("align-middle", {
|
|
|
147
158
|
defaultVariants: {
|
|
148
159
|
size: "default"
|
|
149
160
|
}
|
|
150
|
-
}),
|
|
151
|
-
({ className: e, size: t, span: a = 1, textAlign:
|
|
152
|
-
|
|
161
|
+
}), u = s.forwardRef(
|
|
162
|
+
({ className: e, size: t, span: a = 1, textAlign: l, ...r }, o) => /* @__PURE__ */ d(
|
|
163
|
+
c,
|
|
153
164
|
{
|
|
154
|
-
ref:
|
|
165
|
+
ref: o,
|
|
155
166
|
span: a,
|
|
156
|
-
className:
|
|
167
|
+
className: i(j({ size: t, textAlign: l, className: e })),
|
|
157
168
|
...r
|
|
158
169
|
}
|
|
159
170
|
)
|
|
160
171
|
);
|
|
161
|
-
|
|
172
|
+
u.displayName = "GridTableCell";
|
|
162
173
|
const C = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ d(
|
|
163
174
|
"div",
|
|
164
175
|
{
|
|
165
176
|
ref: a,
|
|
166
|
-
className:
|
|
177
|
+
className: i(
|
|
167
178
|
"col-span-full mt-4 text-sm text-muted-foreground",
|
|
168
179
|
e
|
|
169
180
|
),
|
|
@@ -171,19 +182,19 @@ const C = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ d(
|
|
|
171
182
|
}
|
|
172
183
|
));
|
|
173
184
|
C.displayName = "GridTableCaption";
|
|
174
|
-
const S =
|
|
185
|
+
const S = u, $ = p;
|
|
175
186
|
export {
|
|
176
|
-
|
|
177
|
-
|
|
187
|
+
G as GridTable,
|
|
188
|
+
v as GridTableBody,
|
|
178
189
|
C as GridTableCaption,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
190
|
+
u as GridTableCell,
|
|
191
|
+
w as GridTableFooter,
|
|
192
|
+
p as GridTableHead,
|
|
193
|
+
N as GridTableHeader,
|
|
183
194
|
R as GridTableRow,
|
|
184
195
|
S as Td,
|
|
185
196
|
$ as Th,
|
|
186
197
|
j as gridTableCellVariants,
|
|
187
198
|
z as gridTableHeadVariants,
|
|
188
|
-
|
|
199
|
+
h as gridTableVariants
|
|
189
200
|
};
|