@gearbox-protocol/permissionless-ui 1.26.0 → 1.26.2
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/graph/graph-view.cjs +1 -1
- package/dist/cjs/components/stat-badge/stat-badge.cjs +1 -1
- package/dist/esm/components/graph/graph-view.js +66 -68
- package/dist/esm/components/stat-badge/stat-badge.js +115 -65
- package/dist/types/components/stat-badge/stat-badge.d.ts +8 -0
- 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"),O=require("class-variance-authority"),o=require("react"),q=require("../arc-loader/arc-loader.cjs"),k=require("../../utils/cn.cjs"),A=require("./graph.cjs");function D(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(s,a,l.get?l:{enumerable:!0,get:()=>t[a]})}}return s.default=t,Object.freeze(s)}const H=D(o),V=O.cva("relative w-full overflow-hidden rounded-lg border-border border bg-card text-card-foreground",{variants:{variant:{default:"shadow",elevated:"shadow-lg",outlined:"border-2",ghost:"border-0 shadow-none"},size:{sm:"h-48 sm:h-64",default:"h-64 sm:h-96",lg:"h-96 sm:h-[32rem]",xl:"h-[32rem] sm:h-[48rem]",full:"h-full"},padding:{none:"p-0",sm:"p-2",default:"p-4 sm:p-6",lg:"p-6"}},defaultVariants:{variant:"default",size:"default",padding:"default"}}),j=H.forwardRef(({className:t,variant:s,size:a,padding:l,title:r,description:n,toolbar:i,loading:c=!1,emptyMessage:d,error:u,children:f,...p},v)=>{const m=r||n||i;return e.jsxs("div",{ref:v,className:k.cn("flex flex-col",V({variant:s,size:a,padding:l,className:t})),...p,children:[m&&e.jsxs("div",{className:"mb-4 flex items-start justify-between gap-4 shrink-0",children:[(r||n)&&e.jsxs("div",{className:"flex-1",children:[r&&e.jsx("h3",{className:"text-base sm:text-lg font-semibold leading-none tracking-tight",children:r}),n&&e.jsx("p",{className:"mt-1 text-xs sm:text-sm text-muted-foreground",children:n})]}),i&&e.jsx("div",{className:"shrink-0 w-full",children:i})]}),e.jsxs("div",{className:"relative flex-1 w-full min-h-0",children:[c&&e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center opacity-0 animate-delayed-fade-in",children:e.jsx("div",{className:"flex flex-col items-center gap-2",children:e.jsx(q.ArcLoader,{size:32,strokeWidth:3})})}),u&&e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-2 text-destructive",children:[e.jsx("svg",{className:"h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("span",{className:"text-xs sm:text-sm font-medium",children:u})]})}),!u&&!f&&d&&e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[e.jsx("svg",{className:"h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),e.jsx("span",{className:"text-xs sm:text-sm",children:d})]})}),e.jsx("div",{className:k.cn("w-full h-full transition-[filter] duration-300 delay-300",c&&"blur-sm pointer-events-none"),children:!u&&f})]})]})});j.displayName="GraphView";function M({series:t,data:s,lineColor:a,color:l,topColor:r,bottomColor:n,graphId:i,onUnselectSeries:c,loading:d,title:u,description:f,toolbar:p,emptyMessage:v="No data available",error:m,containerClassName:R,variant:W,size:G,padding:S,yMeasureUnit:g,showCurrentValue:b,..._}){const h=o.useMemo(()=>{if(t&&t.length>0)return t;if(s&&s.length>0){const y=a??l;return[{data:s.map(x=>({time:typeof x.time=="number"?x.time:Number(x.time),value:x.value})),label:"Value",yMeasureUnit:g,...y&&{lineColor:y},...r&&{topColor:r},...n&&{bottomColor:n}}]}return[]},[t,s,g,a,l,r,n]),z=!d&&h.length===0,N=o.useRef(h);h.length>0&&(N.current=h);const w=d&&h.length===0?N.current:h,L=w.length>0;return e.jsx(j,{className:R,variant:W,size:G,padding:S,title:u,description:f,toolbar:p,loading:d,error:m,emptyMessage:z?v:void 0,children:L&&!m&&e.jsx(A.Graph,{series:w,yMeasureUnit:g,...c?{onUnselectSeries:c}:{},...b!==void 0?{showCurrentValue:b}:{},..._})})}function P(t=0){const s=o.useRef(null),a=o.useRef(null),[l,r]=o.useState(null);return o.useEffect(()=>{const n=()=>{if(s.current&&a.current){const d=a.current.clientWidth,u=s.current.clientWidth;r(d-u-t)}},i=a.current,c=i?new ResizeObserver(n):null;return i&&c?.observe(i),()=>{i&&c?.unobserve(i)}},[t]),{graphWidth:l,parentRef:a,asideRef:s}}exports.GraphView=j;exports.GraphViewWithData=M;exports.graphViewVariants=V;exports.useGraphAside=P;
|
|
@@ -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"),y=require("react"),p=require("../status-triangle/status-triangle.cjs"),T=require("../tooltip/simple-tooltip.cjs");require("../tooltip/tooltip.cjs");require("@gearbox-protocol/sdk");const i=require("../../utils/cn.cjs");require("sonner");require("luxon");require("../../utils/z-index.cjs");function w(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(a,t,l.get?l:{enumerable:!0,get:()=>r[t]})}}return a.default=r,Object.freeze(a)}const v=w(y),b=n.cva("w-full h-full rounded-lg border transition-colors",{variants:{variant:{filled:"bg-card border-border",outlined:"bg-transparent border-border",elevated:"bg-card border-border shadow-md",primary:"bg-primary/10 border-primary/20"},size:{sm:"p-4",md:"p-5",default:"p-6"}},defaultVariants:{variant:"filled",size:"default"}}),j=n.cva("font-medium text-muted-foreground",{variants:{size:{sm:"text-xs leading-[0.8125rem]",md:"text-xs leading-[0.9rem]",default:"text-sm leading-[1.0625rem]"}},defaultVariants:{size:"default"}}),h=n.cva("font-medium text-foreground flex",{variants:{size:{sm:"text-sm leading-[1.0625rem]",md:"text-base leading-[1.25rem]",default:"text-xl leading-[1.5625rem]"}},defaultVariants:{size:"default"}}),B=v.forwardRef(({className:r,variant:a,size:t,title:l,titleInfo:d,value:c,valueDescription:o,delta:e,...g},u)=>{const V=()=>{if(d?.text!=null)return d.text;if(e!=null){if(!(e&&e.value!==void 0&&e.value!==0))return null;const m=e.value<0,f=e.value>0,x=s.jsxs("div",{className:i.cn("inline-flex items-center gap-1 text-xs font-medium",m&&"text-destructive",f&&"text-success"),children:[f&&(e.positiveIcon||s.jsx(p.StatusTriangle,{size:4})),m&&(e.negativeIcon||s.jsx(p.StatusTriangle,{size:4,isNegative:!0})),e.label&&s.jsx("span",{children:e.label})]});return e.tooltip!=null?s.jsx(T.SimpleTooltip,{title:s.jsx("div",{className:"cursor-help",children:x}),children:e.tooltip}):x}return null},q=t==="sm"?"mb-2.5":t==="md"?"mb-2":"mb-3";return s.jsxs("div",{ref:u,className:i.cn(b({variant:a,size:t}),r),...g,children:[s.jsxs("div",{className:i.cn("flex items-center",q),children:[s.jsx("div",{className:i.cn(j({size:t}),"flex-1 flex items-center gap-1"),children:l}),V()]}),s.jsxs("div",{className:i.cn(h({size:t})),children:[c,o&&s.jsx("span",{className:"text-muted-foreground text-sm ml-1",children:o})]})]})});B.displayName="StatBadge";const S=n.cva("grid w-full",{variants:{cols:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6"},colsSm:{1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6"},colsMd:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6"},colsLg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6"},colsXl:{1:"xl:grid-cols-1",2:"xl:grid-cols-2",3:"xl:grid-cols-3",4:"xl:grid-cols-4",5:"xl:grid-cols-5",6:"xl:grid-cols-6"},gap:{sm:"gap-2",default:"gap-4",lg:"gap-6",xl:"gap-8"}},defaultVariants:{cols:1,colsMd:2,colsLg:3,colsXl:4,gap:"default"}}),N=v.forwardRef(({className:r,cols:a,colsSm:t,colsMd:l,colsLg:d,colsXl:c,gap:o,children:e,...g},u)=>s.jsx("div",{ref:u,className:i.cn(S({cols:a,colsSm:t,colsMd:l,colsLg:d,colsXl:c,gap:o}),r),...g,children:e}));N.displayName="StatBadgeGrid";exports.StatBadge=B;exports.StatBadgeGrid=N;exports.statBadgeContentVariants=h;exports.statBadgeGridVariants=S;exports.statBadgeTitleVariants=j;exports.statBadgeVariants=b;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { cva as A } from "class-variance-authority";
|
|
3
3
|
import * as B from "react";
|
|
4
4
|
import { useMemo as D, useRef as N, useState as M, useEffect as E } from "react";
|
|
5
|
+
import { ArcLoader as I } from "../arc-loader/arc-loader.js";
|
|
5
6
|
import { cn as j } from "../../utils/cn.js";
|
|
6
|
-
import { Graph as
|
|
7
|
-
const
|
|
7
|
+
import { Graph as O } from "./graph.js";
|
|
8
|
+
const q = A(
|
|
8
9
|
"relative w-full overflow-hidden rounded-lg border-border border bg-card text-card-foreground",
|
|
9
10
|
{
|
|
10
11
|
variants: {
|
|
@@ -34,45 +35,42 @@ const O = A(
|
|
|
34
35
|
padding: "default"
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
),
|
|
38
|
+
), y = B.forwardRef(
|
|
38
39
|
({
|
|
39
40
|
className: n,
|
|
40
41
|
variant: t,
|
|
41
42
|
size: l,
|
|
42
|
-
padding:
|
|
43
|
-
title:
|
|
44
|
-
description:
|
|
45
|
-
toolbar:
|
|
43
|
+
padding: m,
|
|
44
|
+
title: r,
|
|
45
|
+
description: s,
|
|
46
|
+
toolbar: a,
|
|
46
47
|
loading: i = !1,
|
|
47
48
|
emptyMessage: d,
|
|
48
49
|
error: c,
|
|
49
50
|
children: f,
|
|
50
|
-
...
|
|
51
|
-
},
|
|
52
|
-
const u =
|
|
53
|
-
return /* @__PURE__ */
|
|
51
|
+
...p
|
|
52
|
+
}, x) => {
|
|
53
|
+
const u = r || s || a;
|
|
54
|
+
return /* @__PURE__ */ o(
|
|
54
55
|
"div",
|
|
55
56
|
{
|
|
56
|
-
ref:
|
|
57
|
+
ref: x,
|
|
57
58
|
className: j(
|
|
58
59
|
"flex flex-col",
|
|
59
|
-
|
|
60
|
+
q({ variant: t, size: l, padding: m, className: n })
|
|
60
61
|
),
|
|
61
|
-
...
|
|
62
|
+
...p,
|
|
62
63
|
children: [
|
|
63
|
-
u && /* @__PURE__ */
|
|
64
|
-
(
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
u && /* @__PURE__ */ o("div", { className: "mb-4 flex items-start justify-between gap-4 shrink-0", children: [
|
|
65
|
+
(r || s) && /* @__PURE__ */ o("div", { className: "flex-1", children: [
|
|
66
|
+
r && /* @__PURE__ */ e("h3", { className: "text-base sm:text-lg font-semibold leading-none tracking-tight", children: r }),
|
|
67
|
+
s && /* @__PURE__ */ e("p", { className: "mt-1 text-xs sm:text-sm text-muted-foreground", children: s })
|
|
67
68
|
] }),
|
|
68
|
-
|
|
69
|
+
a && /* @__PURE__ */ e("div", { className: "shrink-0 w-full", children: a })
|
|
69
70
|
] }),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
i && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center opacity-0 animate-delayed-fade-in", children: /* @__PURE__ */
|
|
72
|
-
|
|
73
|
-
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm text-muted-foreground", children: "Loading..." })
|
|
74
|
-
] }) }),
|
|
75
|
-
c && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ m("div", { className: "flex flex-col items-center gap-2 text-destructive", children: [
|
|
71
|
+
/* @__PURE__ */ o("div", { className: "relative flex-1 w-full min-h-0", children: [
|
|
72
|
+
i && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center opacity-0 animate-delayed-fade-in", children: /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2", children: /* @__PURE__ */ e(I, { size: 32, strokeWidth: 3 }) }) }),
|
|
73
|
+
c && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center gap-2 text-destructive", children: [
|
|
76
74
|
/* @__PURE__ */ e(
|
|
77
75
|
"svg",
|
|
78
76
|
{
|
|
@@ -94,7 +92,7 @@ const O = A(
|
|
|
94
92
|
),
|
|
95
93
|
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: c })
|
|
96
94
|
] }) }),
|
|
97
|
-
!c && !f && d && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */
|
|
95
|
+
!c && !f && d && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
|
|
98
96
|
/* @__PURE__ */ e(
|
|
99
97
|
"svg",
|
|
100
98
|
{
|
|
@@ -132,35 +130,35 @@ const O = A(
|
|
|
132
130
|
);
|
|
133
131
|
}
|
|
134
132
|
);
|
|
135
|
-
|
|
136
|
-
function
|
|
133
|
+
y.displayName = "GraphView";
|
|
134
|
+
function X({
|
|
137
135
|
series: n,
|
|
138
136
|
data: t,
|
|
139
137
|
lineColor: l,
|
|
140
|
-
color:
|
|
141
|
-
topColor:
|
|
142
|
-
bottomColor:
|
|
143
|
-
graphId:
|
|
138
|
+
color: m,
|
|
139
|
+
topColor: r,
|
|
140
|
+
bottomColor: s,
|
|
141
|
+
graphId: a,
|
|
144
142
|
onUnselectSeries: i,
|
|
145
143
|
loading: d,
|
|
146
144
|
title: c,
|
|
147
145
|
description: f,
|
|
148
|
-
toolbar:
|
|
149
|
-
emptyMessage:
|
|
146
|
+
toolbar: p,
|
|
147
|
+
emptyMessage: x = "No data available",
|
|
150
148
|
error: u,
|
|
151
|
-
containerClassName:
|
|
152
|
-
variant:
|
|
153
|
-
size:
|
|
154
|
-
padding:
|
|
149
|
+
containerClassName: R,
|
|
150
|
+
variant: V,
|
|
151
|
+
size: z,
|
|
152
|
+
padding: G,
|
|
155
153
|
yMeasureUnit: g,
|
|
156
|
-
showCurrentValue:
|
|
154
|
+
showCurrentValue: w,
|
|
157
155
|
...L
|
|
158
156
|
}) {
|
|
159
157
|
const h = D(() => {
|
|
160
158
|
if (n && n.length > 0)
|
|
161
159
|
return n;
|
|
162
160
|
if (t && t.length > 0) {
|
|
163
|
-
const
|
|
161
|
+
const W = l ?? m;
|
|
164
162
|
return [
|
|
165
163
|
{
|
|
166
164
|
data: t.map((v) => ({
|
|
@@ -169,59 +167,59 @@ function Q({
|
|
|
169
167
|
})),
|
|
170
168
|
label: "Value",
|
|
171
169
|
yMeasureUnit: g,
|
|
172
|
-
...
|
|
173
|
-
...
|
|
174
|
-
...
|
|
170
|
+
...W && { lineColor: W },
|
|
171
|
+
...r && { topColor: r },
|
|
172
|
+
...s && { bottomColor: s }
|
|
175
173
|
}
|
|
176
174
|
];
|
|
177
175
|
}
|
|
178
176
|
return [];
|
|
179
|
-
}, [n, t, g, l,
|
|
180
|
-
h.length > 0 && (
|
|
181
|
-
const k = d && h.length === 0 ?
|
|
177
|
+
}, [n, t, g, l, m, r, s]), H = !d && h.length === 0, b = N(h);
|
|
178
|
+
h.length > 0 && (b.current = h);
|
|
179
|
+
const k = d && h.length === 0 ? b.current : h, S = k.length > 0;
|
|
182
180
|
return /* @__PURE__ */ e(
|
|
183
|
-
|
|
181
|
+
y,
|
|
184
182
|
{
|
|
185
|
-
className:
|
|
186
|
-
variant:
|
|
187
|
-
size:
|
|
188
|
-
padding:
|
|
183
|
+
className: R,
|
|
184
|
+
variant: V,
|
|
185
|
+
size: z,
|
|
186
|
+
padding: G,
|
|
189
187
|
title: c,
|
|
190
188
|
description: f,
|
|
191
|
-
toolbar:
|
|
189
|
+
toolbar: p,
|
|
192
190
|
loading: d,
|
|
193
191
|
error: u,
|
|
194
|
-
emptyMessage: H ?
|
|
192
|
+
emptyMessage: H ? x : void 0,
|
|
195
193
|
children: S && !u && /* @__PURE__ */ e(
|
|
196
|
-
|
|
194
|
+
O,
|
|
197
195
|
{
|
|
198
196
|
series: k,
|
|
199
197
|
yMeasureUnit: g,
|
|
200
198
|
...i ? { onUnselectSeries: i } : {},
|
|
201
|
-
...
|
|
199
|
+
...w !== void 0 ? { showCurrentValue: w } : {},
|
|
202
200
|
...L
|
|
203
201
|
}
|
|
204
202
|
)
|
|
205
203
|
}
|
|
206
204
|
);
|
|
207
205
|
}
|
|
208
|
-
function
|
|
209
|
-
const t = N(null), l = N(null), [
|
|
206
|
+
function Y(n = 0) {
|
|
207
|
+
const t = N(null), l = N(null), [m, r] = M(null);
|
|
210
208
|
return E(() => {
|
|
211
|
-
const
|
|
209
|
+
const s = () => {
|
|
212
210
|
if (t.current && l.current) {
|
|
213
211
|
const d = l.current.clientWidth, c = t.current.clientWidth;
|
|
214
|
-
|
|
212
|
+
r(d - c - n);
|
|
215
213
|
}
|
|
216
|
-
},
|
|
217
|
-
return
|
|
218
|
-
|
|
214
|
+
}, a = l.current, i = a ? new ResizeObserver(s) : null;
|
|
215
|
+
return a && i?.observe(a), () => {
|
|
216
|
+
a && i?.unobserve(a);
|
|
219
217
|
};
|
|
220
|
-
}, [n]), { graphWidth:
|
|
218
|
+
}, [n]), { graphWidth: m, parentRef: l, asideRef: t };
|
|
221
219
|
}
|
|
222
220
|
export {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
221
|
+
y as GraphView,
|
|
222
|
+
X as GraphViewWithData,
|
|
223
|
+
q as graphViewVariants,
|
|
224
|
+
Y as useGraphAside
|
|
227
225
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cva as
|
|
3
|
-
import * as
|
|
4
|
-
import { StatusTriangle as
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cva as d } from "class-variance-authority";
|
|
3
|
+
import * as b from "react";
|
|
4
|
+
import { StatusTriangle as v } from "../status-triangle/status-triangle.js";
|
|
5
5
|
import { SimpleTooltip as B } from "../tooltip/simple-tooltip.js";
|
|
6
6
|
import "../tooltip/tooltip.js";
|
|
7
7
|
import "@gearbox-protocol/sdk";
|
|
8
|
-
import { cn as
|
|
8
|
+
import { cn as l } from "../../utils/cn.js";
|
|
9
9
|
import "sonner";
|
|
10
10
|
import "luxon";
|
|
11
11
|
import "../../utils/z-index.js";
|
|
12
|
-
const
|
|
12
|
+
const S = d(
|
|
13
13
|
"w-full h-full rounded-lg border transition-colors",
|
|
14
14
|
{
|
|
15
15
|
variants: {
|
|
@@ -30,7 +30,7 @@ const V = l(
|
|
|
30
30
|
size: "default"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
),
|
|
33
|
+
), V = d("font-medium text-muted-foreground", {
|
|
34
34
|
variants: {
|
|
35
35
|
size: {
|
|
36
36
|
sm: "text-xs leading-[0.8125rem]",
|
|
@@ -41,7 +41,7 @@ const V = l(
|
|
|
41
41
|
defaultVariants: {
|
|
42
42
|
size: "default"
|
|
43
43
|
}
|
|
44
|
-
}),
|
|
44
|
+
}), w = d("font-medium text-foreground flex", {
|
|
45
45
|
variants: {
|
|
46
46
|
size: {
|
|
47
47
|
sm: "text-sm leading-[1.0625rem]",
|
|
@@ -52,70 +52,70 @@ const V = l(
|
|
|
52
52
|
defaultVariants: {
|
|
53
53
|
size: "default"
|
|
54
54
|
}
|
|
55
|
-
}), y =
|
|
55
|
+
}), y = b.forwardRef(
|
|
56
56
|
({
|
|
57
|
-
className:
|
|
58
|
-
variant:
|
|
59
|
-
size:
|
|
60
|
-
title:
|
|
61
|
-
titleInfo:
|
|
62
|
-
value:
|
|
63
|
-
valueDescription:
|
|
64
|
-
delta:
|
|
65
|
-
...
|
|
66
|
-
},
|
|
57
|
+
className: o,
|
|
58
|
+
variant: c,
|
|
59
|
+
size: t,
|
|
60
|
+
title: m,
|
|
61
|
+
titleInfo: s,
|
|
62
|
+
value: n,
|
|
63
|
+
valueDescription: i,
|
|
64
|
+
delta: r,
|
|
65
|
+
...g
|
|
66
|
+
}, u) => {
|
|
67
67
|
const h = () => {
|
|
68
|
-
if (
|
|
69
|
-
if (
|
|
70
|
-
if (!(
|
|
71
|
-
const
|
|
68
|
+
if (s?.text != null) return s.text;
|
|
69
|
+
if (r != null) {
|
|
70
|
+
if (!(r && r.value !== void 0 && r.value !== 0)) return null;
|
|
71
|
+
const f = r.value < 0, p = r.value > 0, x = /* @__PURE__ */ a(
|
|
72
72
|
"div",
|
|
73
73
|
{
|
|
74
|
-
className:
|
|
74
|
+
className: l(
|
|
75
75
|
"inline-flex items-center gap-1 text-xs font-medium",
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
f && "text-destructive",
|
|
77
|
+
p && "text-success"
|
|
78
78
|
),
|
|
79
79
|
children: [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
p && (r.positiveIcon || /* @__PURE__ */ e(v, { size: 4 })),
|
|
81
|
+
f && (r.negativeIcon || /* @__PURE__ */ e(v, { size: 4, isNegative: !0 })),
|
|
82
|
+
r.label && /* @__PURE__ */ e("span", { children: r.label })
|
|
83
83
|
]
|
|
84
84
|
}
|
|
85
85
|
);
|
|
86
|
-
return
|
|
86
|
+
return r.tooltip != null ? /* @__PURE__ */ e(
|
|
87
87
|
B,
|
|
88
88
|
{
|
|
89
|
-
title: /* @__PURE__ */
|
|
90
|
-
children:
|
|
89
|
+
title: /* @__PURE__ */ e("div", { className: "cursor-help", children: x }),
|
|
90
|
+
children: r.tooltip
|
|
91
91
|
}
|
|
92
|
-
) :
|
|
92
|
+
) : x;
|
|
93
93
|
}
|
|
94
94
|
return null;
|
|
95
|
-
}, N =
|
|
96
|
-
return /* @__PURE__ */
|
|
95
|
+
}, N = t === "sm" ? "mb-2.5" : t === "md" ? "mb-2" : "mb-3";
|
|
96
|
+
return /* @__PURE__ */ a(
|
|
97
97
|
"div",
|
|
98
98
|
{
|
|
99
|
-
ref:
|
|
100
|
-
className:
|
|
101
|
-
...
|
|
99
|
+
ref: u,
|
|
100
|
+
className: l(S({ variant: c, size: t }), o),
|
|
101
|
+
...g,
|
|
102
102
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ a("div", { className: l("flex items-center", N), children: [
|
|
104
|
+
/* @__PURE__ */ e(
|
|
105
105
|
"div",
|
|
106
106
|
{
|
|
107
|
-
className:
|
|
108
|
-
|
|
107
|
+
className: l(
|
|
108
|
+
V({ size: t }),
|
|
109
109
|
"flex-1 flex items-center gap-1"
|
|
110
110
|
),
|
|
111
|
-
children:
|
|
111
|
+
children: m
|
|
112
112
|
}
|
|
113
113
|
),
|
|
114
114
|
h()
|
|
115
115
|
] }),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
/* @__PURE__ */ a("div", { className: l(w({ size: t })), children: [
|
|
117
|
+
n,
|
|
118
|
+
i && /* @__PURE__ */ e("span", { className: "text-muted-foreground text-sm ml-1", children: i })
|
|
119
119
|
] })
|
|
120
120
|
]
|
|
121
121
|
}
|
|
@@ -123,15 +123,47 @@ const V = l(
|
|
|
123
123
|
}
|
|
124
124
|
);
|
|
125
125
|
y.displayName = "StatBadge";
|
|
126
|
-
const z =
|
|
126
|
+
const z = d("grid w-full", {
|
|
127
127
|
variants: {
|
|
128
128
|
cols: {
|
|
129
129
|
1: "grid-cols-1",
|
|
130
|
-
2: "grid-cols-
|
|
131
|
-
3: "grid-cols-
|
|
132
|
-
4: "grid-cols-
|
|
133
|
-
5: "grid-cols-
|
|
134
|
-
6: "grid-cols-
|
|
130
|
+
2: "grid-cols-2",
|
|
131
|
+
3: "grid-cols-3",
|
|
132
|
+
4: "grid-cols-4",
|
|
133
|
+
5: "grid-cols-5",
|
|
134
|
+
6: "grid-cols-6"
|
|
135
|
+
},
|
|
136
|
+
colsSm: {
|
|
137
|
+
1: "sm:grid-cols-1",
|
|
138
|
+
2: "sm:grid-cols-2",
|
|
139
|
+
3: "sm:grid-cols-3",
|
|
140
|
+
4: "sm:grid-cols-4",
|
|
141
|
+
5: "sm:grid-cols-5",
|
|
142
|
+
6: "sm:grid-cols-6"
|
|
143
|
+
},
|
|
144
|
+
colsMd: {
|
|
145
|
+
1: "md:grid-cols-1",
|
|
146
|
+
2: "md:grid-cols-2",
|
|
147
|
+
3: "md:grid-cols-3",
|
|
148
|
+
4: "md:grid-cols-4",
|
|
149
|
+
5: "md:grid-cols-5",
|
|
150
|
+
6: "md:grid-cols-6"
|
|
151
|
+
},
|
|
152
|
+
colsLg: {
|
|
153
|
+
1: "lg:grid-cols-1",
|
|
154
|
+
2: "lg:grid-cols-2",
|
|
155
|
+
3: "lg:grid-cols-3",
|
|
156
|
+
4: "lg:grid-cols-4",
|
|
157
|
+
5: "lg:grid-cols-5",
|
|
158
|
+
6: "lg:grid-cols-6"
|
|
159
|
+
},
|
|
160
|
+
colsXl: {
|
|
161
|
+
1: "xl:grid-cols-1",
|
|
162
|
+
2: "xl:grid-cols-2",
|
|
163
|
+
3: "xl:grid-cols-3",
|
|
164
|
+
4: "xl:grid-cols-4",
|
|
165
|
+
5: "xl:grid-cols-5",
|
|
166
|
+
6: "xl:grid-cols-6"
|
|
135
167
|
},
|
|
136
168
|
gap: {
|
|
137
169
|
sm: "gap-2",
|
|
@@ -141,24 +173,42 @@ const z = l("grid w-full", {
|
|
|
141
173
|
}
|
|
142
174
|
},
|
|
143
175
|
defaultVariants: {
|
|
144
|
-
cols:
|
|
176
|
+
cols: 1,
|
|
177
|
+
colsMd: 2,
|
|
178
|
+
colsLg: 3,
|
|
179
|
+
colsXl: 4,
|
|
145
180
|
gap: "default"
|
|
146
181
|
}
|
|
147
|
-
}), G =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
182
|
+
}), G = b.forwardRef(
|
|
183
|
+
({
|
|
184
|
+
className: o,
|
|
185
|
+
cols: c,
|
|
186
|
+
colsSm: t,
|
|
187
|
+
colsMd: m,
|
|
188
|
+
colsLg: s,
|
|
189
|
+
colsXl: n,
|
|
190
|
+
gap: i,
|
|
191
|
+
children: r,
|
|
192
|
+
...g
|
|
193
|
+
}, u) => /* @__PURE__ */ e(
|
|
194
|
+
"div",
|
|
195
|
+
{
|
|
196
|
+
ref: u,
|
|
197
|
+
className: l(
|
|
198
|
+
z({ cols: c, colsSm: t, colsMd: m, colsLg: s, colsXl: n, gap: i }),
|
|
199
|
+
o
|
|
200
|
+
),
|
|
201
|
+
...g,
|
|
202
|
+
children: r
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
);
|
|
156
206
|
G.displayName = "StatBadgeGrid";
|
|
157
207
|
export {
|
|
158
208
|
y as StatBadge,
|
|
159
209
|
G as StatBadgeGrid,
|
|
160
|
-
|
|
210
|
+
w as statBadgeContentVariants,
|
|
161
211
|
z as statBadgeGridVariants,
|
|
162
|
-
|
|
163
|
-
|
|
212
|
+
V as statBadgeTitleVariants,
|
|
213
|
+
S as statBadgeVariants
|
|
164
214
|
};
|
|
@@ -136,6 +136,10 @@ export interface StatBadgeProps extends Omit<React.HTMLAttributes<HTMLDivElement
|
|
|
136
136
|
export declare const StatBadge: React.ForwardRefExoticComponent<StatBadgeProps & React.RefAttributes<HTMLDivElement>>;
|
|
137
137
|
declare const statBadgeGridVariants: (props?: ({
|
|
138
138
|
cols?: 2 | 1 | 3 | 4 | 5 | 6 | null | undefined;
|
|
139
|
+
colsSm?: 2 | 1 | 3 | 4 | 5 | 6 | null | undefined;
|
|
140
|
+
colsMd?: 2 | 1 | 3 | 4 | 5 | 6 | null | undefined;
|
|
141
|
+
colsLg?: 2 | 1 | 3 | 4 | 5 | 6 | null | undefined;
|
|
142
|
+
colsXl?: 2 | 1 | 3 | 4 | 5 | 6 | null | undefined;
|
|
139
143
|
gap?: "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
140
144
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
141
145
|
export interface StatBadgeGridProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof statBadgeGridVariants> {
|
|
@@ -143,6 +147,10 @@ export interface StatBadgeGridProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
143
147
|
* Number of columns in the grid (responsive breakpoints applied automatically)
|
|
144
148
|
*/
|
|
145
149
|
cols?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
150
|
+
colsSm?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
151
|
+
colsMd?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
152
|
+
colsLg?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
153
|
+
colsXl?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
146
154
|
/**
|
|
147
155
|
* Gap size between grid items
|
|
148
156
|
*/
|