@gearbox-protocol/ui-kit 4.0.0-next.49 → 4.0.0-next.50
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"),o=require("../stack/stack.cjs"),u=require("../text/use-title-text.cjs");require("../../help-tip/help-tip.cjs");require("react");require("react-intl");const c=require("../../../utils/apy-breakdown.cjs");require("@gearbox-protocol/sdk/onchain");require("clsx");require("tailwind-merge");require("luxon");require("../../../utils/z-index.cjs");const a=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 q=require("../../vertical-indicator/vertical-indicator.cjs"),n=require("./constants.cjs");function l({children:e}){return t.jsx(o.Stack,{gap:"sm","data-testid":n.InfoListTest.root,children:e})}function i({title:e,...r}){const s=u.useTitleText();return t.jsx(q.VerticalIndicator,{label:s(e),size:"sm",align:"start","data-testid":n.InfoListTest.line,...r})}function f({data:e,title:r="components.yieldBreakdown.points"}){return!e||c.pointProgramsOf(e).length===0?null:t.jsx(i,{title:r,value:t.jsx(a.PointsValue,{data:e})})}exports.InfoListTest=n.InfoListTest;exports.InfoLine=i;exports.InfoList=l;exports.PointsInfoLine=f;
|
|
@@ -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 n } from "../stack/stack.js";
|
|
3
|
+
import { useTitleText as p } 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 e } 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 s } 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,45 +18,38 @@ 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 f } from "../../vertical-indicator/vertical-indicator.js";
|
|
22
22
|
import { InfoListTest as i } from "./constants.js";
|
|
23
|
-
function
|
|
23
|
+
function q({
|
|
24
24
|
children: t
|
|
25
25
|
}) {
|
|
26
|
-
return /* @__PURE__ */ o(
|
|
26
|
+
return /* @__PURE__ */ o(n, { gap: "sm", "data-testid": i.root, children: t });
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function l({
|
|
29
29
|
title: t,
|
|
30
|
-
|
|
31
|
-
tip: m,
|
|
32
|
-
valueDescription: n,
|
|
33
|
-
valueTo: p,
|
|
34
|
-
testId: e
|
|
30
|
+
...r
|
|
35
31
|
}) {
|
|
36
|
-
const
|
|
32
|
+
const m = p();
|
|
37
33
|
return /* @__PURE__ */ o(
|
|
38
|
-
|
|
34
|
+
f,
|
|
39
35
|
{
|
|
40
|
-
label:
|
|
41
|
-
tip: m,
|
|
42
|
-
value: r,
|
|
43
|
-
valueTo: p,
|
|
44
|
-
valueDescription: n,
|
|
36
|
+
label: m(t),
|
|
45
37
|
size: "sm",
|
|
46
|
-
align: "
|
|
47
|
-
"data-testid":
|
|
38
|
+
align: "start",
|
|
39
|
+
"data-testid": i.line,
|
|
40
|
+
...r
|
|
48
41
|
}
|
|
49
42
|
);
|
|
50
43
|
}
|
|
51
|
-
function
|
|
44
|
+
function A({
|
|
52
45
|
data: t,
|
|
53
46
|
title: r = "components.yieldBreakdown.points"
|
|
54
47
|
}) {
|
|
55
|
-
return !t ||
|
|
48
|
+
return !t || e(t).length === 0 ? null : /* @__PURE__ */ o(l, { title: r, value: /* @__PURE__ */ o(s, { data: t }) });
|
|
56
49
|
}
|
|
57
50
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
l as InfoLine,
|
|
52
|
+
q as InfoList,
|
|
60
53
|
i as InfoListTest,
|
|
61
|
-
|
|
54
|
+
A as PointsInfoLine
|
|
62
55
|
};
|
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import { ApyBreakdown } from '@gearbox-protocol/sdk/model';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
import { TitleText } from '../text';
|
|
4
|
+
import { VerticalIndicatorProps } from '../../vertical-indicator';
|
|
4
5
|
import { InfoListTest } from './constants';
|
|
5
6
|
export { InfoListTest };
|
|
6
7
|
/** Label / value rows under a form — the projected state of an operation. */
|
|
7
8
|
export declare function InfoList({ children, }: {
|
|
8
9
|
readonly children: React.ReactNode;
|
|
9
10
|
}): React.ReactElement;
|
|
10
|
-
export interface InfoLineProps {
|
|
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
|
+
*/
|
|
11
17
|
readonly title: TitleText;
|
|
12
|
-
readonly value: React.ReactNode;
|
|
13
|
-
/** Tooltip content behind the help icon next to the label. */
|
|
14
|
-
readonly tip?: React.ReactNode;
|
|
15
|
-
/** Caption under the value (right-aligned), e.g. "for 0.00 USDC". */
|
|
16
|
-
readonly valueDescription?: React.ReactNode;
|
|
17
|
-
/** New value after an arrow (value → valueTo); the old one is dimmed. */
|
|
18
|
-
readonly valueTo?: React.ReactNode;
|
|
19
|
-
readonly testId?: string;
|
|
20
18
|
}
|
|
21
|
-
/**
|
|
22
|
-
|
|
19
|
+
/**
|
|
20
|
+
* One row of the list — the reference `VerticalIndicator` markup.
|
|
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;
|
|
23
28
|
export interface PointsInfoLineProps {
|
|
24
29
|
readonly data: ApyBreakdown | undefined;
|
|
25
30
|
readonly title?: TitleText;
|