@gearbox-protocol/ui-kit 4.4.0 → 4.5.0
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/base/review-button/constants.cjs +1 -1
- package/dist/cjs/components/base/review-button/review-button.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/base/review-button/constants.js +2 -1
- package/dist/esm/components/base/review-button/review-button.js +34 -21
- package/dist/esm/locale/en.json.js +1 -1
- package/dist/types/components/base/review-button/constants.d.ts +1 -0
- package/dist/types/components/base/review-button/review-button.d.ts +7 -1
- package/dist/types/locale/en.json.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={root:"review-button-root",error:"review-button-error",tip:"review-button-tip"};exports.ReviewButtonTest=t;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={root:"review-button-root",error:"review-button-error",tip:"review-button-tip",solution:"review-button-solution"};exports.ReviewButtonTest=t;
|
|
@@ -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"),i=require("../stack/stack.cjs"),r=require("../../buttons/button/button.cjs"),l=require("../../tip-card/tip-card.cjs"),s=require("../../typed-intl/index.cjs"),e=require("./constants.cjs");function m({disabled:d,error:o,tip:a,solution:n,onClick:u,label:c="dialogs.common.review"}){return t.jsxs(i.Stack,{gap:"sm",children:[a?t.jsx(l.TipCard,{textColor:"light",attributeColor:"alert",className:"w-full","data-testid":e.ReviewButtonTest.tip,children:t.jsxs(i.Stack,{gap:"sm",align:"start",children:[t.jsx(s.FormattedMessageTyped,{...a}),n?t.jsx(r.Button,{variant:"outline",size:"sm",onClick:n.onClick,"data-testid":e.ReviewButtonTest.solution,children:t.jsx(s.FormattedMessageTyped,{...n.label})}):null]})}):null,t.jsx(r.Button,{disabled:d,onClick:u,"data-testid":e.ReviewButtonTest.root,children:o?t.jsx("span",{"data-testid":e.ReviewButtonTest.error,children:t.jsx(s.FormattedMessageTyped,{messageId:o})}):t.jsx(s.FormattedMessageTyped,{messageId:c})})]})}exports.ReviewButtonTest=e.ReviewButtonTest;exports.ReviewButton=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e={"errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no open Positions. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.infiniteScrollWrapper.showMore":"Show more","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.sdkStatus.connecting":"Connecting…","components.sdkStatus.connected":"Connected","components.sdkStatus.disconnected":"Not connected","components.notificationCenter.empty":"No notifications yet","components.notificationCenter.requests":"Requests","components.notificationCenter.recent":"Recent","components.notificationCenter.clear":"Clear all","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.tipWindow.title":"Tip","components.value.accruing":"Averaged data is still being computed and will be available shortly.","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.totalAPY":"Overall APY","components.yieldBreakdown.titleNetAtLeverage":"Net APY at {leverage}× Leverage","components.yieldBreakdown.titleNetAtLeverage7d":"Net APY (7d) at {leverage}× Leverage","components.yieldBreakdown.titleNet":"Net APY","components.yieldBreakdown.titleNet7d":"Net APY (7d)","components.yieldBreakdown.collateralApy":"Collateral APY","components.yieldBreakdown.collateralApy7d":"Collateral APY (7d)","components.yieldBreakdown.baseApy":"Base APY","components.yieldBreakdown.baseApy7d":"Base APY (7d)","components.yieldBreakdown.incentive":"Incentive","components.yieldBreakdown.incentiveApy":"Incentive APY","components.yieldBreakdown.incentiveApy7d":"Incentive APY (7d)","components.yieldBreakdown.borrowRate":"Borrow Rate","components.yieldBreakdown.borrowRate7d":"Borrow Rate (7d)","components.yieldBreakdown.programPoints":"{name} Points","components.yieldBreakdown.points":"Points","components.openCopyButtons.copy":"Copy to clipboard","components.openCopyButtons.explorer":"View in explorer","components.poolAssetsTable.asset":"Name","components.poolAssetsTable.exposure":"Exposure","components.poolAssetsTable.cap":"Cap","components.poolAssetsTable.capUtilization":"Cap Utilization","components.poolAssetsTable.capBelowExposure.tip":"The curator has lowered the cap below current exposure. Exposure cannot be increased.","components.poolTable.line.rwa.tip":"This is RWA
|
|
1
|
+
"use strict";const e={"errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no open Positions. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.infiniteScrollWrapper.showMore":"Show more","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.sdkStatus.connecting":"Connecting…","components.sdkStatus.connected":"Connected","components.sdkStatus.disconnected":"Not connected","components.notificationCenter.empty":"No notifications yet","components.notificationCenter.requests":"Requests","components.notificationCenter.recent":"Recent","components.notificationCenter.clear":"Clear all","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.tipWindow.title":"Tip","components.value.accruing":"Averaged data is still being computed and will be available shortly.","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.totalAPY":"Overall APY","components.yieldBreakdown.titleNetAtLeverage":"Net APY at {leverage}× Leverage","components.yieldBreakdown.titleNetAtLeverage7d":"Net APY (7d) at {leverage}× Leverage","components.yieldBreakdown.titleNet":"Net APY","components.yieldBreakdown.titleNet7d":"Net APY (7d)","components.yieldBreakdown.collateralApy":"Collateral APY","components.yieldBreakdown.collateralApy7d":"Collateral APY (7d)","components.yieldBreakdown.baseApy":"Base APY","components.yieldBreakdown.baseApy7d":"Base APY (7d)","components.yieldBreakdown.incentive":"Incentive","components.yieldBreakdown.incentiveApy":"Incentive APY","components.yieldBreakdown.incentiveApy7d":"Incentive APY (7d)","components.yieldBreakdown.borrowRate":"Borrow Rate","components.yieldBreakdown.borrowRate7d":"Borrow Rate (7d)","components.yieldBreakdown.programPoints":"{name} Points","components.yieldBreakdown.points":"Points","components.openCopyButtons.copy":"Copy to clipboard","components.openCopyButtons.explorer":"View in explorer","components.poolAssetsTable.asset":"Name","components.poolAssetsTable.exposure":"Exposure","components.poolAssetsTable.cap":"Cap","components.poolAssetsTable.capUtilization":"Cap Utilization","components.poolAssetsTable.capBelowExposure.tip":"The curator has lowered the cap below current exposure. Exposure cannot be increased.","components.poolTable.line.rwa.tip":"This market is exposed to RWA assets.","components.strategiesTable.line.name.disabled":"This Leverage Opportunity is currently not available","components.strategiesTable.line.rwa":"RWA","components.strategiesTable.line.rwa.tip":"This Leverage Opportunity is available on RWA market.","dialogs.common.review":"Review","components.amountInput.max":"Max","components.amountInput.label":"Amount","components.amountInput.balance":"Balance","components.amountInput.selectToken":"Select token","components.amountInput.inputTitle":"Token Amount","components.leverageInput.label":"Leverage","components.leverageInput.reset":"Reset","components.leverageInput.available":"Available Leverage","components.healthFactorBlock.label":"Health Factor","components.healthFactorBlock.tip":"Health Factor is a numeric representation of your Position 'health'. If your health factor drops below 1 or close to it, you might be liquidated.","components.liquidationPriceBlock.label":"Liquidation Price","components.liquidationPriceBlock.tip":"The asset price at which the Position's health factor would reach 1 and become eligible for liquidation.","components.timeToLiquidationBlock.label":"Time to Liquidation","components.timeToLiquidationBlock.tip":"Time to liquidation estimates how long the Position can stay open if prices remain constant and no yield is earned—only accounting for borrow interest accrual.","components.historyChart.error":"Couldn't load chart data","components.historyChart.empty":"No data","components.positionTypeBadge.pool":"Lend","components.positionTypeBadge.strategy":"Leverage","components.positionTypeBadge.liquidation":"Liquidation","components.positionStatusBadge.active":"Active","components.positionStatusBadge.repaid":"Repaid","components.titleMeta.unknownCurator":"Curator","components.moreAccordion.more":"More details","components.moreAccordion.less":"Less details","components.poolApyBreakdownCard.title":"Net APY","components.poolApyBreakdownCard.title7d":"Net APY (7d)","components.poolApyBreakdownCard.organicApy":"Base APY","components.poolApyBreakdownCard.organicApy7d":"Base APY (7d)","components.poolApyBreakdownCard.incentiveApy":"Incentive APY","components.poolApyBreakdownCard.incentiveApy7d":"Incentive APY (7d)","components.poolApyBreakdownCard.tokenIncentiveApy":"{symbol} Incentive APY","components.poolApyBreakdownCard.tokenIncentiveApy7d":"{symbol} Incentive APY (7d)","components.strategyApyBreakdownCard.formula":"{leverage} × {base}","components.strategyApyBreakdownCard.borrowFormula":"{leverage} × {totalRate} − {borrowRate}","components.leveragePresetChips.label":"Leverage:","components.liquidationParamsTable.lt":"Liquidation Threshold","components.liquidationParamsTable.penalty":"Liquidation Discount","components.liquidationParamsTable.premium":"Liquidation Premium","components.liquidationParamsTable.fee":"Liquidation Fee","components.borrowRateBlock.label":"Borrow Rate","components.borrowRateBlock.tip":"Borrow rate is displayed for your entire Position size in total. You can reduce it in quota management.","components.borrowRateBlock.description":"Your borrow rate consists of the Base Rate plus the Quota Rates for every asset separately.","components.borrowRateBlock.baseRate":"Base Rate for Debt","components.borrowRateBlock.normalization":"Rates Normalization","components.borrowRateBlock.normalization.tip":"Borrowers pay {quota} and {utilization}, which have a different base. Therefore, the total borrow rate value is normalized by Position value or Debt amount.","components.transactionConfirm.previewLoading":"Parsing transaction…","components.transactionConfirm.previewErrorTitle":"Preview error"};module.exports=e;
|
|
@@ -1,39 +1,52 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Stack as
|
|
3
|
-
import { Button as
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as s } from "../stack/stack.js";
|
|
3
|
+
import { Button as m } from "../../buttons/button/button.js";
|
|
4
4
|
import { TipCard as p } from "../../tip-card/tip-card.js";
|
|
5
5
|
import { FormattedMessageTyped as e } from "../../typed-intl/index.js";
|
|
6
|
-
import { ReviewButtonTest as
|
|
7
|
-
function
|
|
8
|
-
disabled:
|
|
9
|
-
error:
|
|
10
|
-
tip:
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
import { ReviewButtonTest as r } from "./constants.js";
|
|
7
|
+
function w({
|
|
8
|
+
disabled: d,
|
|
9
|
+
error: o,
|
|
10
|
+
tip: a,
|
|
11
|
+
solution: i,
|
|
12
|
+
onClick: n,
|
|
13
|
+
label: c = "dialogs.common.review"
|
|
13
14
|
}) {
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
15
|
+
return /* @__PURE__ */ l(s, { gap: "sm", children: [
|
|
16
|
+
a ? /* @__PURE__ */ t(
|
|
16
17
|
p,
|
|
17
18
|
{
|
|
18
19
|
textColor: "light",
|
|
19
20
|
attributeColor: "alert",
|
|
20
21
|
className: "w-full",
|
|
21
|
-
"data-testid":
|
|
22
|
-
children: /* @__PURE__ */
|
|
22
|
+
"data-testid": r.tip,
|
|
23
|
+
children: /* @__PURE__ */ l(s, { gap: "sm", align: "start", children: [
|
|
24
|
+
/* @__PURE__ */ t(e, { ...a }),
|
|
25
|
+
i ? /* @__PURE__ */ t(
|
|
26
|
+
m,
|
|
27
|
+
{
|
|
28
|
+
variant: "outline",
|
|
29
|
+
size: "sm",
|
|
30
|
+
onClick: i.onClick,
|
|
31
|
+
"data-testid": r.solution,
|
|
32
|
+
children: /* @__PURE__ */ t(e, { ...i.label })
|
|
33
|
+
}
|
|
34
|
+
) : null
|
|
35
|
+
] })
|
|
23
36
|
}
|
|
24
37
|
) : null,
|
|
25
38
|
/* @__PURE__ */ t(
|
|
26
|
-
|
|
39
|
+
m,
|
|
27
40
|
{
|
|
28
|
-
disabled:
|
|
29
|
-
onClick:
|
|
30
|
-
"data-testid":
|
|
31
|
-
children:
|
|
41
|
+
disabled: d,
|
|
42
|
+
onClick: n,
|
|
43
|
+
"data-testid": r.root,
|
|
44
|
+
children: o ? /* @__PURE__ */ t("span", { "data-testid": r.error, children: /* @__PURE__ */ t(e, { messageId: o }) }) : /* @__PURE__ */ t(e, { messageId: c })
|
|
32
45
|
}
|
|
33
46
|
)
|
|
34
47
|
] });
|
|
35
48
|
}
|
|
36
49
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
w as ReviewButton,
|
|
51
|
+
r as ReviewButtonTest
|
|
39
52
|
};
|
|
@@ -42,7 +42,7 @@ const e = {
|
|
|
42
42
|
"components.poolAssetsTable.cap": "Cap",
|
|
43
43
|
"components.poolAssetsTable.capUtilization": "Cap Utilization",
|
|
44
44
|
"components.poolAssetsTable.capBelowExposure.tip": "The curator has lowered the cap below current exposure. Exposure cannot be increased.",
|
|
45
|
-
"components.poolTable.line.rwa.tip": "This is RWA
|
|
45
|
+
"components.poolTable.line.rwa.tip": "This market is exposed to RWA assets.",
|
|
46
46
|
"components.strategiesTable.line.name.disabled": "This Leverage Opportunity is currently not available",
|
|
47
47
|
"components.strategiesTable.line.rwa": "RWA",
|
|
48
48
|
"components.strategiesTable.line.rwa.tip": "This Leverage Opportunity is available on RWA market.",
|
|
@@ -3,6 +3,10 @@ import { FormattedMessageTypedProps } from '../../typed-intl';
|
|
|
3
3
|
import { LocaleKeys } from '../../../locale';
|
|
4
4
|
import { ReviewButtonTest } from './constants';
|
|
5
5
|
export { ReviewButtonTest };
|
|
6
|
+
export interface ReviewButtonSolution {
|
|
7
|
+
readonly label: FormattedMessageTypedProps;
|
|
8
|
+
readonly onClick: () => void;
|
|
9
|
+
}
|
|
6
10
|
export interface ReviewButtonProps {
|
|
7
11
|
readonly disabled: boolean;
|
|
8
12
|
/** What blocks the action; takes the button's own label while it is set. */
|
|
@@ -14,6 +18,8 @@ export interface ReviewButtonProps {
|
|
|
14
18
|
* the same `<FormattedMessageTyped>` wrapper.
|
|
15
19
|
*/
|
|
16
20
|
readonly tip?: FormattedMessageTypedProps;
|
|
21
|
+
/** Shown inside the tip. */
|
|
22
|
+
readonly solution?: ReviewButtonSolution;
|
|
17
23
|
readonly onClick: () => void;
|
|
18
24
|
readonly label?: LocaleKeys;
|
|
19
25
|
}
|
|
@@ -24,4 +30,4 @@ export interface ReviewButtonProps {
|
|
|
24
30
|
* above — the arrangement the confirm screen already uses, so a dialog and its
|
|
25
31
|
* confirmation report the same refusal the same way.
|
|
26
32
|
*/
|
|
27
|
-
export declare function ReviewButton({ disabled, error, tip, onClick, label, }: ReviewButtonProps): React.ReactElement;
|
|
33
|
+
export declare function ReviewButton({ disabled, error, tip, solution, onClick, label, }: ReviewButtonProps): React.ReactElement;
|
|
@@ -54,7 +54,7 @@ declare const _default: {
|
|
|
54
54
|
"components.poolAssetsTable.capUtilization": "Cap Utilization",
|
|
55
55
|
"components.poolAssetsTable.capBelowExposure.tip": "The curator has lowered the cap below current exposure. Exposure cannot be increased.",
|
|
56
56
|
|
|
57
|
-
"components.poolTable.line.rwa.tip": "This is RWA
|
|
57
|
+
"components.poolTable.line.rwa.tip": "This market is exposed to RWA assets.",
|
|
58
58
|
|
|
59
59
|
"components.strategiesTable.line.name.disabled": "This Leverage Opportunity is currently not available",
|
|
60
60
|
|