@gearbox-protocol/ui-kit 4.0.0-next.50 → 4.0.0-next.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"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"),c=require("../stack/stack.cjs"),q=require("../text/use-title-text.cjs");require("../../help-tip/help-tip.cjs");require("react");require("react-intl");const l=require("../../../utils/apy-breakdown.cjs");require("@gearbox-protocol/sdk/onchain");require("clsx");require("tailwind-merge");require("luxon");require("../../../utils/z-index.cjs");const f=require("../values/points-value.cjs");require("viem");require("../../points-icon/points-icon.cjs");require("../../token-icon/token-icon.cjs");require("../../tooltip/simple-tooltip.cjs");require("../../tooltip/tooltip.cjs");require("../../badge/badge.cjs");require("../../badge/chip.cjs");const _=require("../../vertical-indicator/vertical-indicator.cjs"),n=require("./constants.cjs");function I({children:e}){return t.jsx(c.Stack,{gap:"sm","data-testid":n.InfoListTest.root,children:e})}function i({title:e,size:r="sm",align:s="start","data-testid":o=n.InfoListTest.line,...u}){const a=q.useTitleText();return t.jsx(_.VerticalIndicator,{label:a(e),size:r,align:s,"data-testid":o,...u})}function d({data:e,title:r="components.yieldBreakdown.points"}){return!e||l.pointProgramsOf(e).length===0?null:t.jsx(i,{title:r,value:t.jsx(f.PointsValue,{data:e})})}exports.InfoListTest=n.InfoListTest;exports.InfoLine=i;exports.InfoList=I;exports.PointsInfoLine=d;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { Stack as
|
|
3
|
-
import { useTitleText as
|
|
2
|
+
import { Stack as s } from "../stack/stack.js";
|
|
3
|
+
import { useTitleText as f } from "../text/use-title-text.js";
|
|
4
4
|
import "../../help-tip/help-tip.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "react-intl";
|
|
7
|
-
import { pointProgramsOf as
|
|
7
|
+
import { pointProgramsOf as a } from "../../../utils/apy-breakdown.js";
|
|
8
8
|
import "@gearbox-protocol/sdk/onchain";
|
|
9
9
|
import "clsx";
|
|
10
10
|
import "tailwind-merge";
|
|
11
11
|
import "luxon";
|
|
12
12
|
import "../../../utils/z-index.js";
|
|
13
|
-
import { PointsValue as
|
|
13
|
+
import { PointsValue as l } from "../values/points-value.js";
|
|
14
14
|
import "viem";
|
|
15
15
|
import "../../points-icon/points-icon.js";
|
|
16
16
|
import "../../token-icon/token-icon.js";
|
|
@@ -18,38 +18,41 @@ import "../../tooltip/simple-tooltip.js";
|
|
|
18
18
|
import "../../tooltip/tooltip.js";
|
|
19
19
|
import "../../badge/badge.js";
|
|
20
20
|
import "../../badge/chip.js";
|
|
21
|
-
import { VerticalIndicator as
|
|
21
|
+
import { VerticalIndicator as u } from "../../vertical-indicator/vertical-indicator.js";
|
|
22
22
|
import { InfoListTest as i } from "./constants.js";
|
|
23
|
-
function
|
|
23
|
+
function D({
|
|
24
24
|
children: t
|
|
25
25
|
}) {
|
|
26
|
-
return /* @__PURE__ */ o(
|
|
26
|
+
return /* @__PURE__ */ o(s, { gap: "sm", "data-testid": i.root, children: t });
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function c({
|
|
29
29
|
title: t,
|
|
30
|
-
|
|
30
|
+
size: r = "sm",
|
|
31
|
+
align: m = "start",
|
|
32
|
+
"data-testid": n = i.line,
|
|
33
|
+
...p
|
|
31
34
|
}) {
|
|
32
|
-
const
|
|
35
|
+
const e = f();
|
|
33
36
|
return /* @__PURE__ */ o(
|
|
34
|
-
|
|
37
|
+
u,
|
|
35
38
|
{
|
|
36
|
-
label:
|
|
37
|
-
size:
|
|
38
|
-
align:
|
|
39
|
-
"data-testid":
|
|
40
|
-
...
|
|
39
|
+
label: e(t),
|
|
40
|
+
size: r,
|
|
41
|
+
align: m,
|
|
42
|
+
"data-testid": n,
|
|
43
|
+
...p
|
|
41
44
|
}
|
|
42
45
|
);
|
|
43
46
|
}
|
|
44
|
-
function
|
|
47
|
+
function E({
|
|
45
48
|
data: t,
|
|
46
49
|
title: r = "components.yieldBreakdown.points"
|
|
47
50
|
}) {
|
|
48
|
-
return !t ||
|
|
51
|
+
return !t || a(t).length === 0 ? null : /* @__PURE__ */ o(c, { title: r, value: /* @__PURE__ */ o(l, { data: t }) });
|
|
49
52
|
}
|
|
50
53
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
c as InfoLine,
|
|
55
|
+
D as InfoList,
|
|
53
56
|
i as InfoListTest,
|
|
54
|
-
|
|
57
|
+
E as PointsInfoLine
|
|
55
58
|
};
|
|
@@ -9,22 +9,11 @@ export declare function InfoList({ children, }: {
|
|
|
9
9
|
readonly children: React.ReactNode;
|
|
10
10
|
}): React.ReactElement;
|
|
11
11
|
export interface InfoLineProps extends Omit<VerticalIndicatorProps, "label" | "title"> {
|
|
12
|
-
/**
|
|
13
|
-
* Left-hand label: a locale key, or a node when the text is composed.
|
|
14
|
-
* Shadows the native `title` attribute on purpose — a row's label is not a
|
|
15
|
-
* browser tooltip, and `tip` is what puts one behind the help icon.
|
|
16
|
-
*/
|
|
17
12
|
readonly title: TitleText;
|
|
13
|
+
readonly "data-testid"?: string;
|
|
18
14
|
}
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
* Everything `VerticalIndicator` takes passes straight through; this only
|
|
23
|
-
* fixes the defaults the list depends on. They sit before the spread, so a
|
|
24
|
-
* caller overrides any of them — `data-testid` included, which is how a row
|
|
25
|
-
* that a test needs to single out names itself.
|
|
26
|
-
*/
|
|
27
|
-
export declare function InfoLine({ title, ...rest }: InfoLineProps): React.ReactElement;
|
|
15
|
+
/** One row of the list — the reference `VerticalIndicator` markup. */
|
|
16
|
+
export declare function InfoLine({ title, size, align, "data-testid": testId, ...rest }: InfoLineProps): React.ReactElement;
|
|
28
17
|
export interface PointsInfoLineProps {
|
|
29
18
|
readonly data: ApyBreakdown | undefined;
|
|
30
19
|
readonly title?: TitleText;
|