@kodiak-finance/orderly-ui-order-entry 2.9.2 → 2.9.4
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/index.js +229 -149
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +231 -151
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +13 -13
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React4, { memo, forwardRef, useId, useState, useImperativeHandle, useEffect, createContext, useMemo, useRef, useCallback, useContext } from 'react';
|
|
2
2
|
import { useLocalStorage, utils, useGetEstLiqPrice, useOrderlyContext, useMemoizedFn, ERROR_MSG_CODES, usePositionStream, useMarkets, MarketsType, useMarginModes, useMarginModeBySymbol, useFeeState, useRwaSymbolsInfoStore, useBadgeBySymbol, useEventEmitter, useDebouncedCallback, useHoldingStream, useAppStore, useIndexPricesStream, useComputedLTV, useBoolean, useFeatureFlag, FlagKeys, useQuery, useAccount, useOrderEntry, useMarginRatio, useTpslPriceChecker, useTrack } from '@kodiak-finance/orderly-hooks';
|
|
3
|
-
import { i18n, useTranslation } from '@kodiak-finance/orderly-i18n';
|
|
3
|
+
import { i18n, useTranslation, Trans } from '@kodiak-finance/orderly-i18n';
|
|
4
4
|
import { useOrderEntryFormErrorMsg, useCanTrade } from '@kodiak-finance/orderly-react-app';
|
|
5
5
|
import { OrderSide, EMPTY_LIST, DistributionType, TrailingCallbackType, OrderType, MarginMode, PositionType, BBOOrderType, ORDER_ENTRY_EST_LIQ_PRICE_CHANGE, OrderLevel, TrackerEventName } from '@kodiak-finance/orderly-types';
|
|
6
|
-
import { registerSimpleDialog, SimpleDialog, registerSimpleSheet, ExclamationFillIcon, modal, Text, Tooltip, TooltipTrigger, Flex, Input, cn, inputFormatter, Box, Slider, textVariants, injectable, Button, ThrottledButton, Grid, Checkbox, Select, SettingFillIcon, useModal, useScreen, InfoCircleIcon, AddCircleIcon, toast, Divider, Switch, SimpleSheet, Badge, TokenIcon, DataTable, IconButton, CloseIcon, CloseCircleFillIcon, ChevronRightIcon, SymbolBadge as SymbolBadge$1, EditIcon as EditIcon$1, SimpleDropdownMenu, CaretDownIcon, DotStatus, PopoverRoot, PopoverTrigger, PopoverContent } from '@kodiak-finance/orderly-ui';
|
|
6
|
+
import { registerSimpleDialog, SimpleDialog, registerSimpleSheet, ExclamationFillIcon, modal, Text, Tooltip, TooltipTrigger, Flex, Input, cn, inputFormatter, Box, Slider, textVariants, injectable, Button, ThrottledButton, Grid, Checkbox, Select, SettingFillIcon, useModal, useScreen, Tips, InfoCircleIcon, AddCircleIcon, toast, Divider, Switch, SimpleSheet, Badge, TokenIcon, DataTable, IconButton, CloseIcon, CloseCircleFillIcon, ChevronRightIcon, SymbolBadge as SymbolBadge$1, EditIcon as EditIcon$1, SimpleDropdownMenu, CaretDownIcon, DotStatus, PopoverRoot, PopoverTrigger, PopoverContent } from '@kodiak-finance/orderly-ui';
|
|
7
7
|
import { TPSLPositionTypeWidget, TPSLAdvancedWidget } from '@kodiak-finance/orderly-ui-tpsl';
|
|
8
8
|
import { Decimal, zero, formatSymbol, removeTrailingZeros, todpIfNeed, getBBOType } from '@kodiak-finance/orderly-utils';
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -71,7 +71,7 @@ var AdditionalInfo = (props) => {
|
|
|
71
71
|
htmlFor: "toggle_order_post_only",
|
|
72
72
|
className: cn(
|
|
73
73
|
"oui-postOnly-label",
|
|
74
|
-
"oui-
|
|
74
|
+
"oui-ms-1 oui-text-2xs peer-data-[disabled]:oui-text-base-contrast-20",
|
|
75
75
|
"oui-cursor-pointer oui-whitespace-nowrap oui-break-normal oui-border-b oui-border-dashed oui-border-line-12"
|
|
76
76
|
),
|
|
77
77
|
children: t("orderEntry.orderType.postOnly")
|
|
@@ -105,7 +105,7 @@ var AdditionalInfo = (props) => {
|
|
|
105
105
|
htmlFor: "toggle_order_iov",
|
|
106
106
|
className: cn(
|
|
107
107
|
"oui-ioc-label",
|
|
108
|
-
"oui-
|
|
108
|
+
"oui-ms-1 oui-text-2xs peer-data-[disabled]:oui-text-base-contrast-20",
|
|
109
109
|
"oui-cursor-pointer oui-whitespace-nowrap oui-break-normal oui-border-b oui-border-dashed oui-border-line-12"
|
|
110
110
|
),
|
|
111
111
|
children: t("orderEntry.orderType.ioc")
|
|
@@ -139,7 +139,7 @@ var AdditionalInfo = (props) => {
|
|
|
139
139
|
htmlFor: "toggle_order_fok",
|
|
140
140
|
className: cn(
|
|
141
141
|
"oui-fok-label",
|
|
142
|
-
"oui-
|
|
142
|
+
"oui-ms-1 oui-text-2xs peer-data-[disabled]:oui-text-base-contrast-20",
|
|
143
143
|
"oui-cursor-pointer oui-whitespace-nowrap oui-break-normal oui-border-b oui-border-dashed oui-border-line-12"
|
|
144
144
|
),
|
|
145
145
|
children: t("orderEntry.orderType.fok")
|
|
@@ -170,7 +170,7 @@ var AdditionalInfo = (props) => {
|
|
|
170
170
|
"label",
|
|
171
171
|
{
|
|
172
172
|
htmlFor: "toggle_order_confirm",
|
|
173
|
-
className: "oui-orderConfirm-label oui-
|
|
173
|
+
className: "oui-orderConfirm-label oui-ms-1 oui-text-2xs",
|
|
174
174
|
children: t("orderEntry.orderConfirm")
|
|
175
175
|
}
|
|
176
176
|
)
|
|
@@ -198,7 +198,7 @@ var AdditionalInfo = (props) => {
|
|
|
198
198
|
"label",
|
|
199
199
|
{
|
|
200
200
|
htmlFor: "toggle_order_hidden",
|
|
201
|
-
className: "oui-orderHidden-label oui-
|
|
201
|
+
className: "oui-orderHidden-label oui-ms-1 oui-cursor-pointer oui-border-b oui-border-dashed oui-border-line-12 oui-text-2xs",
|
|
202
202
|
children: t("orderEntry.hidden")
|
|
203
203
|
}
|
|
204
204
|
)
|
|
@@ -224,7 +224,7 @@ var AdditionalInfo = (props) => {
|
|
|
224
224
|
"label",
|
|
225
225
|
{
|
|
226
226
|
htmlFor: "toggle_order_keep_visible",
|
|
227
|
-
className: "oui-keepVisible-label oui-
|
|
227
|
+
className: "oui-keepVisible-label oui-ms-1 oui-text-2xs",
|
|
228
228
|
children: t("orderEntry.keepVisible")
|
|
229
229
|
}
|
|
230
230
|
)
|
|
@@ -336,7 +336,7 @@ function AdvancedTPSLResult(props) {
|
|
|
336
336
|
/* @__PURE__ */ jsx(
|
|
337
337
|
Text.numeral,
|
|
338
338
|
{
|
|
339
|
-
suffix: /* @__PURE__ */ jsx(Text, { className: "oui-
|
|
339
|
+
suffix: /* @__PURE__ */ jsx(Text, { className: "oui-ms-1 oui-text-base-contrast-36", children: symbolInfo.quote }),
|
|
340
340
|
className: "oui-text-base-contrast",
|
|
341
341
|
dp: symbolInfo.quote_dp,
|
|
342
342
|
children: formattedOrder.tp_trigger_price ?? ""
|
|
@@ -348,7 +348,7 @@ function AdvancedTPSLResult(props) {
|
|
|
348
348
|
formattedOrder.tp_order_type === OrderType.LIMIT ? /* @__PURE__ */ jsx(
|
|
349
349
|
Text.numeral,
|
|
350
350
|
{
|
|
351
|
-
suffix: /* @__PURE__ */ jsx(Text, { className: "oui-
|
|
351
|
+
suffix: /* @__PURE__ */ jsx(Text, { className: "oui-ms-1 oui-text-base-contrast-36", children: symbolInfo.quote }),
|
|
352
352
|
className: "oui-text-base-contrast",
|
|
353
353
|
dp: symbolInfo.quote_dp,
|
|
354
354
|
children: formattedOrder.tp_order_price ?? ""
|
|
@@ -360,7 +360,7 @@ function AdvancedTPSLResult(props) {
|
|
|
360
360
|
/* @__PURE__ */ jsx(
|
|
361
361
|
Text.numeral,
|
|
362
362
|
{
|
|
363
|
-
suffix: /* @__PURE__ */ jsx(Text, { className: "oui-
|
|
363
|
+
suffix: /* @__PURE__ */ jsx(Text, { className: "oui-ms-1 oui-text-base-contrast-36", children: symbolInfo.quote }),
|
|
364
364
|
coloring: true,
|
|
365
365
|
dp: 2,
|
|
366
366
|
children: Number(formattedOrder.tp_pnl)
|
|
@@ -413,7 +413,7 @@ function AdvancedTPSLResult(props) {
|
|
|
413
413
|
/* @__PURE__ */ jsx(
|
|
414
414
|
Text.numeral,
|
|
415
415
|
{
|
|
416
|
-
suffix: /* @__PURE__ */ jsx(Text, { className: "oui-
|
|
416
|
+
suffix: /* @__PURE__ */ jsx(Text, { className: "oui-ms-1 oui-text-base-contrast-36", children: symbolInfo.quote }),
|
|
417
417
|
className: "oui-text-base-contrast",
|
|
418
418
|
dp: symbolInfo.quote_dp,
|
|
419
419
|
children: formattedOrder.sl_trigger_price ?? ""
|
|
@@ -425,7 +425,7 @@ function AdvancedTPSLResult(props) {
|
|
|
425
425
|
formattedOrder.sl_order_type === OrderType.LIMIT ? /* @__PURE__ */ jsx(
|
|
426
426
|
Text.numeral,
|
|
427
427
|
{
|
|
428
|
-
suffix: /* @__PURE__ */ jsx(Text, { className: "oui-
|
|
428
|
+
suffix: /* @__PURE__ */ jsx(Text, { className: "oui-ms-1 oui-text-base-contrast-36", children: symbolInfo.quote }),
|
|
429
429
|
className: "oui-text-base-contrast",
|
|
430
430
|
dp: symbolInfo.quote_dp,
|
|
431
431
|
children: formattedOrder.sl_order_price ?? ""
|
|
@@ -438,7 +438,7 @@ function AdvancedTPSLResult(props) {
|
|
|
438
438
|
Text.numeral,
|
|
439
439
|
{
|
|
440
440
|
coloring: true,
|
|
441
|
-
suffix: /* @__PURE__ */ jsx(Text, { className: "oui-
|
|
441
|
+
suffix: /* @__PURE__ */ jsx(Text, { className: "oui-ms-1 oui-text-base-contrast-36", children: symbolInfo.quote }),
|
|
442
442
|
dp: 2,
|
|
443
443
|
children: Number(formattedOrder.sl_pnl)
|
|
444
444
|
}
|
|
@@ -640,7 +640,7 @@ var OrderConfirmDialog = (props) => {
|
|
|
640
640
|
unit: quote,
|
|
641
641
|
rule: "price",
|
|
642
642
|
className: "oui-text-base-contrast",
|
|
643
|
-
unitClassName: "oui-text-base-contrast-36 oui-
|
|
643
|
+
unitClassName: "oui-text-base-contrast-36 oui-ms-1",
|
|
644
644
|
dp: quote_dp,
|
|
645
645
|
padding: false,
|
|
646
646
|
children: order.order_price
|
|
@@ -670,7 +670,7 @@ var OrderConfirmDialog = (props) => {
|
|
|
670
670
|
"oui-text-base-contrast",
|
|
671
671
|
colorType === "TP" ? "oui-text-trade-profit" : "oui-text-trade-loss"
|
|
672
672
|
),
|
|
673
|
-
unitClassName: "oui-text-base-contrast-36 oui-
|
|
673
|
+
unitClassName: "oui-text-base-contrast-36 oui-ms-1",
|
|
674
674
|
dp: quote_dp,
|
|
675
675
|
padding: false,
|
|
676
676
|
children: price
|
|
@@ -976,7 +976,7 @@ var OrderItem = (props) => {
|
|
|
976
976
|
dp,
|
|
977
977
|
padding: false,
|
|
978
978
|
className: "oui-text-base-contrast",
|
|
979
|
-
unitClassName: "oui-text-base-contrast-36 oui-
|
|
979
|
+
unitClassName: "oui-text-base-contrast-36 oui-ms-1",
|
|
980
980
|
children: value
|
|
981
981
|
}
|
|
982
982
|
)
|
|
@@ -1000,7 +1000,7 @@ var OrderTypeTag = (props) => {
|
|
|
1000
1000
|
default:
|
|
1001
1001
|
return "";
|
|
1002
1002
|
}
|
|
1003
|
-
}, [props.type]);
|
|
1003
|
+
}, [props.type, t]);
|
|
1004
1004
|
return /* @__PURE__ */ jsx(Badge, { color: "neutral", size: "sm", children: typeStr });
|
|
1005
1005
|
};
|
|
1006
1006
|
var Dialog = (props) => {
|
|
@@ -1318,7 +1318,7 @@ var ScaledOrderConfirm = (props) => {
|
|
|
1318
1318
|
dp: base_dp,
|
|
1319
1319
|
padding: false,
|
|
1320
1320
|
intensity: 80,
|
|
1321
|
-
unitClassName: "oui-text-base-contrast-36 oui-
|
|
1321
|
+
unitClassName: "oui-text-base-contrast-36 oui-ms-1",
|
|
1322
1322
|
children: totalQuantity
|
|
1323
1323
|
}
|
|
1324
1324
|
)
|
|
@@ -1333,7 +1333,7 @@ var ScaledOrderConfirm = (props) => {
|
|
|
1333
1333
|
dp: quote_dp,
|
|
1334
1334
|
padding: false,
|
|
1335
1335
|
intensity: 80,
|
|
1336
|
-
unitClassName: "oui-text-base-contrast-36 oui-
|
|
1336
|
+
unitClassName: "oui-text-base-contrast-36 oui-ms-1",
|
|
1337
1337
|
children: national
|
|
1338
1338
|
}
|
|
1339
1339
|
)
|
|
@@ -1771,19 +1771,26 @@ var MarginModeSwitch = (props) => {
|
|
|
1771
1771
|
var OptionCard = (props) => {
|
|
1772
1772
|
const { t } = useTranslation();
|
|
1773
1773
|
const title = props.mode === MarginMode.CROSS ? t("marginMode.crossMargin") : t("marginMode.isolatedMargin");
|
|
1774
|
-
const desc = props.mode === MarginMode.CROSS ? t("marginMode.crossMarginDescription") : t("marginMode.isolatedMarginDescription");
|
|
1775
1774
|
return /* @__PURE__ */ jsxs(
|
|
1776
|
-
"
|
|
1775
|
+
"div",
|
|
1777
1776
|
{
|
|
1778
|
-
|
|
1777
|
+
role: "button",
|
|
1778
|
+
tabIndex: props.disabled ? -1 : 0,
|
|
1779
1779
|
className: cn(
|
|
1780
1780
|
"oui-relative oui-w-full oui-rounded-md oui-p-2",
|
|
1781
1781
|
"oui-bg-base-6",
|
|
1782
|
-
"oui-text-
|
|
1783
|
-
props.disabled ? "oui-cursor-not-allowed oui-opacity-50 oui-border oui-border-transparent" : props.selected ? "oui-border oui-border-[#38e2fe]" : "oui-border oui-border-transparent hover:oui-border-line-12"
|
|
1782
|
+
"oui-text-start",
|
|
1783
|
+
props.disabled ? "oui-cursor-not-allowed oui-opacity-50 oui-border oui-border-transparent" : props.selected ? "oui-border oui-border-[#38e2fe]" : "oui-border oui-border-transparent hover:oui-border-line-12",
|
|
1784
|
+
!props.disabled && "oui-cursor-pointer"
|
|
1784
1785
|
),
|
|
1785
1786
|
onClick: props.disabled ? void 0 : props.onClick,
|
|
1786
|
-
|
|
1787
|
+
onKeyDown: (e) => {
|
|
1788
|
+
if (props.disabled) return;
|
|
1789
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1790
|
+
e.preventDefault();
|
|
1791
|
+
props.onClick();
|
|
1792
|
+
}
|
|
1793
|
+
},
|
|
1787
1794
|
"aria-disabled": props.disabled,
|
|
1788
1795
|
"data-testid": `oui-testid-marginModeSwitch-option-${props.mode}`,
|
|
1789
1796
|
children: [
|
|
@@ -1796,13 +1803,31 @@ var OptionCard = (props) => {
|
|
|
1796
1803
|
children: title
|
|
1797
1804
|
}
|
|
1798
1805
|
),
|
|
1799
|
-
/* @__PURE__ */ jsx(Text, { className: "oui-text-2xs oui-leading-[15px] oui-text-base-contrast-36 oui-font-semibold oui-tracking-[0.03em]", children:
|
|
1806
|
+
props.mode === MarginMode.ISOLATED ? /* @__PURE__ */ jsx(Text, { className: "oui-text-2xs oui-leading-[15px] oui-text-base-contrast-36 oui-font-semibold oui-tracking-[0.03em]", children: /* @__PURE__ */ jsx(
|
|
1807
|
+
Trans,
|
|
1808
|
+
{
|
|
1809
|
+
i18nKey: "marginMode.isolatedMarginDescription",
|
|
1810
|
+
components: [
|
|
1811
|
+
/* @__PURE__ */ jsx(
|
|
1812
|
+
"a",
|
|
1813
|
+
{
|
|
1814
|
+
href: "https://orderly.network/docs/introduction/trade-on-orderly/perpetual-futures/isolated-margin",
|
|
1815
|
+
target: "_blank",
|
|
1816
|
+
rel: "noopener noreferrer",
|
|
1817
|
+
className: "whitespace-nowrap oui-font-semibold oui-text-warning oui-underline oui-underline-offset-2 hover:oui-text-warning/90",
|
|
1818
|
+
onClick: (e) => e.stopPropagation()
|
|
1819
|
+
},
|
|
1820
|
+
"isolated-margin-doc"
|
|
1821
|
+
)
|
|
1822
|
+
]
|
|
1823
|
+
}
|
|
1824
|
+
) }) : /* @__PURE__ */ jsx(Text, { className: "oui-text-2xs oui-leading-[15px] oui-text-base-contrast-36 oui-font-semibold oui-tracking-[0.03em]", children: t("marginMode.crossMarginDescription") })
|
|
1800
1825
|
] }),
|
|
1801
1826
|
props.isCurrent ? /* @__PURE__ */ jsx(
|
|
1802
1827
|
"div",
|
|
1803
1828
|
{
|
|
1804
1829
|
className: cn(
|
|
1805
|
-
"oui-absolute -oui-
|
|
1830
|
+
"oui-absolute -oui-end-px -oui-top-px",
|
|
1806
1831
|
"oui-rounded-bl-md oui-rounded-tr-md",
|
|
1807
1832
|
"oui-bg-[#38e2fe] oui-px-1 oui-py-0.5"
|
|
1808
1833
|
),
|
|
@@ -1817,7 +1842,11 @@ var useMarginModeSwitchScript = (options2) => {
|
|
|
1817
1842
|
const { symbol, close } = options2;
|
|
1818
1843
|
const { isMobile } = useScreen();
|
|
1819
1844
|
const { t } = useTranslation();
|
|
1820
|
-
const {
|
|
1845
|
+
const {
|
|
1846
|
+
marginMode: currentMarginMode,
|
|
1847
|
+
update,
|
|
1848
|
+
isPermissionlessListing
|
|
1849
|
+
} = useMarginModeBySymbol(symbol);
|
|
1821
1850
|
const [selectedMarginMode, setSelectedMarginMode] = useState(currentMarginMode);
|
|
1822
1851
|
useEffect(() => {
|
|
1823
1852
|
setSelectedMarginMode(currentMarginMode);
|
|
@@ -1855,7 +1884,8 @@ var useMarginModeSwitchScript = (options2) => {
|
|
|
1855
1884
|
setSelectedMarginMode,
|
|
1856
1885
|
applyMarginMode,
|
|
1857
1886
|
close,
|
|
1858
|
-
onSelect
|
|
1887
|
+
onSelect,
|
|
1888
|
+
isPermissionlessListing
|
|
1859
1889
|
};
|
|
1860
1890
|
};
|
|
1861
1891
|
var useMarginModeSettingsScript = (options2) => {
|
|
@@ -2004,7 +2034,7 @@ var useMarginModeSettingsScript = (options2) => {
|
|
|
2004
2034
|
setIsOperationLoading(false);
|
|
2005
2035
|
}
|
|
2006
2036
|
},
|
|
2007
|
-
[brokerLockedKeys, selectedKeys, updateMarginMode]
|
|
2037
|
+
[brokerLockedKeys, selectedKeys, t, updateMarginMode]
|
|
2008
2038
|
);
|
|
2009
2039
|
const isLoading = isDataLoading || isMarginModesLoading || isOperationLoading || isSettingMarginMode;
|
|
2010
2040
|
return {
|
|
@@ -2110,8 +2140,8 @@ var MarginModeSettings = (props) => {
|
|
|
2110
2140
|
props.searchKeyword.trim() ? "oui-outline-primary-light" : ""
|
|
2111
2141
|
)
|
|
2112
2142
|
},
|
|
2113
|
-
prefix: /* @__PURE__ */ jsx("div", { className: "oui-
|
|
2114
|
-
suffix: props.searchKeyword ? /* @__PURE__ */ jsx("div", { className: "oui-
|
|
2143
|
+
prefix: /* @__PURE__ */ jsx("div", { className: "oui-ps-3 oui-pe-1", "aria-hidden": "true", children: /* @__PURE__ */ jsx(SearchGlyph, { className: "oui-text-base-contrast-54" }) }),
|
|
2144
|
+
suffix: props.searchKeyword ? /* @__PURE__ */ jsx("div", { className: "oui-pe-2", children: /* @__PURE__ */ jsx(
|
|
2115
2145
|
CloseCircleFillIcon,
|
|
2116
2146
|
{
|
|
2117
2147
|
size: 14,
|
|
@@ -2465,7 +2495,7 @@ var LeverageBadge = (props) => {
|
|
|
2465
2495
|
dp: 0,
|
|
2466
2496
|
rm: Decimal.ROUND_DOWN,
|
|
2467
2497
|
unit: "x",
|
|
2468
|
-
unitClassName: "oui-
|
|
2498
|
+
unitClassName: "oui-ms-0",
|
|
2469
2499
|
children: curLeverage
|
|
2470
2500
|
}
|
|
2471
2501
|
)
|
|
@@ -2837,7 +2867,7 @@ var SlippageEditor = forwardRef((props, ref) => {
|
|
|
2837
2867
|
item
|
|
2838
2868
|
);
|
|
2839
2869
|
}),
|
|
2840
|
-
/* @__PURE__ */ jsx(
|
|
2870
|
+
/* @__PURE__ */ jsx("div", { dir: "ltr", children: /* @__PURE__ */ jsx(
|
|
2841
2871
|
Input,
|
|
2842
2872
|
{
|
|
2843
2873
|
suffix: "%",
|
|
@@ -2854,10 +2884,10 @@ var SlippageEditor = forwardRef((props, ref) => {
|
|
|
2854
2884
|
"oui-h-[40px] oui-w-[74px]"
|
|
2855
2885
|
),
|
|
2856
2886
|
input: "oui-text-base-contrast",
|
|
2857
|
-
additional: "oui-
|
|
2887
|
+
additional: "oui-ps-1"
|
|
2858
2888
|
}
|
|
2859
2889
|
}
|
|
2860
|
-
)
|
|
2890
|
+
) })
|
|
2861
2891
|
] }),
|
|
2862
2892
|
!!error && /* @__PURE__ */ jsx(Box, { mt: 5, className: "-oui-mb-5", children: /* @__PURE__ */ jsx(Text, { size: "2xs", color: "danger", children: error }) })
|
|
2863
2893
|
] });
|
|
@@ -2931,50 +2961,84 @@ var SlippageCell = (props) => {
|
|
|
2931
2961
|
)
|
|
2932
2962
|
}
|
|
2933
2963
|
),
|
|
2934
|
-
/* @__PURE__ */ jsxs(
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2964
|
+
/* @__PURE__ */ jsxs(
|
|
2965
|
+
Flex,
|
|
2966
|
+
{
|
|
2967
|
+
justify: "between",
|
|
2968
|
+
itemAlign: "center",
|
|
2969
|
+
gap: 1,
|
|
2970
|
+
className: "oui-orderEntry-slippage oui-w-full",
|
|
2971
|
+
children: [
|
|
2972
|
+
/* @__PURE__ */ jsx(
|
|
2973
|
+
Text,
|
|
2974
|
+
{
|
|
2975
|
+
className: "oui-slippage-label oui-shrink-0 oui-whitespace-nowrap",
|
|
2976
|
+
size: "2xs",
|
|
2977
|
+
children: t("orderEntry.slippage")
|
|
2978
|
+
}
|
|
2979
|
+
),
|
|
2980
|
+
/* @__PURE__ */ jsx(
|
|
2981
|
+
AuthGuard,
|
|
2982
|
+
{
|
|
2983
|
+
fallback: () => /* @__PURE__ */ jsxs(Text, { size: "2xs", className: "oui-whitespace-nowrap", children: [
|
|
2984
|
+
t("orderEntry.slippage.est"),
|
|
2985
|
+
": -% / ",
|
|
2986
|
+
t("common.max"),
|
|
2987
|
+
": --%"
|
|
2988
|
+
] }),
|
|
2989
|
+
children: /* @__PURE__ */ jsxs(
|
|
2990
|
+
Flex,
|
|
2991
|
+
{
|
|
2992
|
+
gap: 1,
|
|
2993
|
+
itemAlign: "center",
|
|
2994
|
+
justify: "end",
|
|
2995
|
+
className: "oui-slippage-value-container oui-min-w-0 oui-flex-1 oui-whitespace-nowrap",
|
|
2996
|
+
children: [
|
|
2997
|
+
/* @__PURE__ */ jsx(
|
|
2998
|
+
Text.numeral,
|
|
2999
|
+
{
|
|
3000
|
+
size: "2xs",
|
|
3001
|
+
rule: "percentages",
|
|
3002
|
+
prefix: `${t("orderEntry.slippage.est")}: `,
|
|
3003
|
+
suffix: ` / ${t("common.max")}: `,
|
|
3004
|
+
className: "oui-whitespace-nowrap",
|
|
3005
|
+
children: props.estSlippage ?? 0
|
|
3006
|
+
}
|
|
3007
|
+
),
|
|
3008
|
+
/* @__PURE__ */ jsx(
|
|
3009
|
+
"button",
|
|
3010
|
+
{
|
|
3011
|
+
className: "oui-slippage-edit-btn oui-shrink-0 oui-text-2xs",
|
|
3012
|
+
onClick: () => setOpen(),
|
|
3013
|
+
children: /* @__PURE__ */ jsxs(
|
|
3014
|
+
Flex,
|
|
3015
|
+
{
|
|
3016
|
+
itemAlign: "center",
|
|
3017
|
+
className: "oui-gap-0.5 oui-whitespace-nowrap",
|
|
3018
|
+
as: "span",
|
|
3019
|
+
children: [
|
|
3020
|
+
/* @__PURE__ */ jsx(Text, { size: "2xs", className: "oui-text-primary", children: `${props.slippage || "-"}%` }),
|
|
3021
|
+
/* @__PURE__ */ jsx(
|
|
3022
|
+
EditIcon$1,
|
|
3023
|
+
{
|
|
3024
|
+
className: "oui-slippage-edit-icon oui-text-primary oui-hidden md:oui-block",
|
|
3025
|
+
size: 12,
|
|
3026
|
+
opacity: 1
|
|
3027
|
+
}
|
|
3028
|
+
)
|
|
3029
|
+
]
|
|
3030
|
+
}
|
|
3031
|
+
)
|
|
3032
|
+
}
|
|
3033
|
+
)
|
|
3034
|
+
]
|
|
3035
|
+
}
|
|
3036
|
+
)
|
|
3037
|
+
}
|
|
3038
|
+
)
|
|
3039
|
+
]
|
|
3040
|
+
}
|
|
3041
|
+
)
|
|
2978
3042
|
] });
|
|
2979
3043
|
};
|
|
2980
3044
|
var SlippageUI = (props) => {
|
|
@@ -2989,33 +3053,38 @@ function AssetInfo(props) {
|
|
|
2989
3053
|
symbol,
|
|
2990
3054
|
side: props.side
|
|
2991
3055
|
});
|
|
3056
|
+
const estLiqTipsContent = /* @__PURE__ */ jsxs("div", { className: "oui-min-w-[204px] oui-max-w-[280px] oui-text-2xs oui-leading-normal oui-text-base-contrast-80", children: [
|
|
3057
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-pretty", children: t("common.liquidationPrice.tooltip") }),
|
|
3058
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
3059
|
+
"a",
|
|
3060
|
+
{
|
|
3061
|
+
href: "https://orderly.network/docs/introduction/trade-on-orderly/perpetual-futures/liquidations",
|
|
3062
|
+
target: "_blank",
|
|
3063
|
+
rel: "noopener noreferrer",
|
|
3064
|
+
className: "oui-text-primary oui-underline",
|
|
3065
|
+
children: t("common.liquidationPrice.tooltip.learnMore")
|
|
3066
|
+
}
|
|
3067
|
+
) })
|
|
3068
|
+
] });
|
|
2992
3069
|
return /* @__PURE__ */ jsxs(
|
|
2993
3070
|
"div",
|
|
2994
3071
|
{
|
|
2995
3072
|
className: "oui-orderEntry-assetInfo oui-space-y-[2px] xl:oui-space-y-1",
|
|
2996
3073
|
children: [
|
|
2997
3074
|
/* @__PURE__ */ jsxs(Flex, { justify: "between", className: "oui-orderEntry-estLiqPrice", children: [
|
|
2998
|
-
|
|
2999
|
-
|
|
3075
|
+
/* @__PURE__ */ jsx(
|
|
3076
|
+
Tips,
|
|
3000
3077
|
{
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
"a",
|
|
3005
|
-
{
|
|
3006
|
-
href: "https://orderly.network/docs/introduction/trade-on-orderly/perpetual-futures/liquidations",
|
|
3007
|
-
target: "_blank",
|
|
3008
|
-
rel: "noopener noreferrer",
|
|
3009
|
-
className: "oui-text-primary oui-underline",
|
|
3010
|
-
children: t("common.liquidationPrice.tooltip.learnMore")
|
|
3011
|
-
}
|
|
3012
|
-
) })
|
|
3013
|
-
] }),
|
|
3014
|
-
children: /* @__PURE__ */ jsx(
|
|
3078
|
+
title: t("common.tips"),
|
|
3079
|
+
content: estLiqTipsContent,
|
|
3080
|
+
trigger: /* @__PURE__ */ jsx(
|
|
3015
3081
|
Text,
|
|
3016
3082
|
{
|
|
3017
3083
|
size: "2xs",
|
|
3018
|
-
className:
|
|
3084
|
+
className: cn(
|
|
3085
|
+
"oui-estLiqPrice-label oui-cursor-pointer",
|
|
3086
|
+
"oui-border-b oui-border-dashed oui-border-line-12"
|
|
3087
|
+
),
|
|
3019
3088
|
children: t("orderEntry.estLiqPrice")
|
|
3020
3089
|
}
|
|
3021
3090
|
)
|
|
@@ -3028,7 +3097,7 @@ function AssetInfo(props) {
|
|
|
3028
3097
|
size: "2xs",
|
|
3029
3098
|
dp: props.dp,
|
|
3030
3099
|
className: "oui-estLiqPrice-value oui-text-base-contrast-80",
|
|
3031
|
-
unitClassName: "oui-
|
|
3100
|
+
unitClassName: "oui-ms-1 oui-text-base-contrast-36",
|
|
3032
3101
|
children: canTrade ? displayEstLiqPrice ?? "--" : "--"
|
|
3033
3102
|
}
|
|
3034
3103
|
)
|
|
@@ -3125,6 +3194,7 @@ var LTVRiskTooltipUI = (props) => {
|
|
|
3125
3194
|
threshold: isThresholdLoading ? "-" : ltv_threshold,
|
|
3126
3195
|
usdcThreshold: isThresholdLoading ? "-" : negative_usdc_threshold
|
|
3127
3196
|
}) }),
|
|
3197
|
+
marginMode === MarginMode.ISOLATED ? /* @__PURE__ */ jsx(Text, { className: "oui-pb-2", intensity: 54, size: "2xs", children: t("transfer.LTV.isolatedMarginOrderHint") }) : null,
|
|
3128
3198
|
/* @__PURE__ */ jsx(
|
|
3129
3199
|
Button,
|
|
3130
3200
|
{
|
|
@@ -3154,6 +3224,7 @@ var useConvertThreshold = () => {
|
|
|
3154
3224
|
};
|
|
3155
3225
|
};
|
|
3156
3226
|
var useLTVTooltipScript = (marginMode) => {
|
|
3227
|
+
const { isMobile } = useScreen();
|
|
3157
3228
|
const { data: holdingList = [], isLoading: isHoldingLoading } = useHoldingStream();
|
|
3158
3229
|
const {
|
|
3159
3230
|
ltv_threshold,
|
|
@@ -3185,8 +3256,8 @@ var useLTVTooltipScript = (marginMode) => {
|
|
|
3185
3256
|
});
|
|
3186
3257
|
const currentLtv = useComputedLTV();
|
|
3187
3258
|
const onConvert = useCallback(async () => {
|
|
3188
|
-
return modal.show("ConvertDialogId");
|
|
3189
|
-
}, []);
|
|
3259
|
+
return modal.show(isMobile ? "ConvertSheetId" : "ConvertDialogId");
|
|
3260
|
+
}, [isMobile]);
|
|
3190
3261
|
return {
|
|
3191
3262
|
holdingData,
|
|
3192
3263
|
isHoldingLoading,
|
|
@@ -3211,6 +3282,13 @@ var Available = (props) => {
|
|
|
3211
3282
|
const showLTV = useMemo(() => {
|
|
3212
3283
|
return typeof currentLtv === "number" && !Number.isNaN(currentLtv) && currentLtv > 0;
|
|
3213
3284
|
}, [currentLtv]);
|
|
3285
|
+
const availableTooltip = useMemo(() => {
|
|
3286
|
+
return marginMode === MarginMode.ISOLATED ? t("transfer.LTV.isolatedModeUsdcOnly") : t("transfer.LTV.availableCrossMarginHint");
|
|
3287
|
+
}, [marginMode, t]);
|
|
3288
|
+
const availableTipsContent = useMemo(
|
|
3289
|
+
() => /* @__PURE__ */ jsx("div", { className: "oui-text-pretty oui-text-2xs oui-leading-normal oui-text-base-contrast-80", children: availableTooltip }),
|
|
3290
|
+
[availableTooltip]
|
|
3291
|
+
);
|
|
3214
3292
|
return /* @__PURE__ */ jsxs(
|
|
3215
3293
|
Flex,
|
|
3216
3294
|
{
|
|
@@ -3218,14 +3296,31 @@ var Available = (props) => {
|
|
|
3218
3296
|
justify: "between",
|
|
3219
3297
|
className: "oui-orderEntry-available",
|
|
3220
3298
|
children: [
|
|
3221
|
-
|
|
3299
|
+
/* @__PURE__ */ jsx(
|
|
3300
|
+
Tips,
|
|
3301
|
+
{
|
|
3302
|
+
title: t("common.tips"),
|
|
3303
|
+
content: availableTipsContent,
|
|
3304
|
+
trigger: /* @__PURE__ */ jsx(
|
|
3305
|
+
Text,
|
|
3306
|
+
{
|
|
3307
|
+
size: "2xs",
|
|
3308
|
+
className: cn(
|
|
3309
|
+
"oui-available-label oui-cursor-pointer",
|
|
3310
|
+
"oui-border-b oui-border-dashed oui-border-line-12"
|
|
3311
|
+
),
|
|
3312
|
+
children: t("common.available")
|
|
3313
|
+
}
|
|
3314
|
+
)
|
|
3315
|
+
}
|
|
3316
|
+
),
|
|
3222
3317
|
/* @__PURE__ */ jsxs(Flex, { itemAlign: "center", justify: "center", gap: 1, children: [
|
|
3223
3318
|
showLTV && /* @__PURE__ */ jsx(
|
|
3224
|
-
|
|
3319
|
+
Tips,
|
|
3225
3320
|
{
|
|
3226
|
-
|
|
3321
|
+
title: t("common.tips"),
|
|
3227
3322
|
content: /* @__PURE__ */ jsx(LTVRiskTooltipWidget, { marginMode }),
|
|
3228
|
-
|
|
3323
|
+
trigger: /* @__PURE__ */ jsx(
|
|
3229
3324
|
InfoCircleIcon,
|
|
3230
3325
|
{
|
|
3231
3326
|
className: "oui-cursor-pointer oui-text-warning oui-opacity-80"
|
|
@@ -3239,7 +3334,7 @@ var Available = (props) => {
|
|
|
3239
3334
|
unit: quote,
|
|
3240
3335
|
size: "2xs",
|
|
3241
3336
|
className: "oui-available-value oui-text-base-contrast-80",
|
|
3242
|
-
unitClassName: "oui-
|
|
3337
|
+
unitClassName: "oui-ms-1 oui-text-base-contrast-54",
|
|
3243
3338
|
dp: 2,
|
|
3244
3339
|
padding: false,
|
|
3245
3340
|
children: canTrade ? freeCollateral : 0
|
|
@@ -3369,7 +3464,7 @@ var QuantitySlider = memo((props) => {
|
|
|
3369
3464
|
{
|
|
3370
3465
|
className: textVariants({
|
|
3371
3466
|
size: "2xs",
|
|
3372
|
-
className: "oui-quantitySlider-maxQty-btn oui-
|
|
3467
|
+
className: "oui-quantitySlider-maxQty-btn oui-me-1"
|
|
3373
3468
|
}),
|
|
3374
3469
|
onClick: onMax,
|
|
3375
3470
|
"data-testid": "oui-testid-orderEntry-maxQty-value-button",
|
|
@@ -3630,7 +3725,7 @@ var CustomInput = forwardRef(
|
|
|
3630
3725
|
input: cn("oui-mb-1 oui-mt-5 oui-h-5", props?.classNames?.input),
|
|
3631
3726
|
// prefix: cn(props.classNames?.prefix),
|
|
3632
3727
|
suffix: cn(
|
|
3633
|
-
"oui-absolute oui-
|
|
3728
|
+
"oui-absolute oui-end-0 oui-top-0 oui-justify-start oui-py-2 oui-text-2xs oui-text-base-contrast-36",
|
|
3634
3729
|
props.classNames?.suffix
|
|
3635
3730
|
)
|
|
3636
3731
|
},
|
|
@@ -3646,7 +3741,7 @@ var InputLabel = (props) => {
|
|
|
3646
3741
|
{
|
|
3647
3742
|
htmlFor: props.id,
|
|
3648
3743
|
className: cn(
|
|
3649
|
-
"oui-absolute oui-
|
|
3744
|
+
"oui-absolute oui-start-2 oui-top-[7px] oui-text-2xs oui-text-base-contrast-36",
|
|
3650
3745
|
props.className
|
|
3651
3746
|
),
|
|
3652
3747
|
children: props.children
|
|
@@ -3674,7 +3769,7 @@ var BBOOrderTypeSelect = (props) => {
|
|
|
3674
3769
|
value: BBOOrderType.QUEUE5
|
|
3675
3770
|
}
|
|
3676
3771
|
],
|
|
3677
|
-
[]
|
|
3772
|
+
[t]
|
|
3678
3773
|
);
|
|
3679
3774
|
return /* @__PURE__ */ jsx(
|
|
3680
3775
|
Select.options,
|
|
@@ -3830,7 +3925,7 @@ var PriceInput = (props) => {
|
|
|
3830
3925
|
{
|
|
3831
3926
|
className: cn(
|
|
3832
3927
|
"oui-orderEntry-bboSelect",
|
|
3833
|
-
"oui-absolute oui-bottom-1 oui-
|
|
3928
|
+
"oui-absolute oui-bottom-1 oui-start-0"
|
|
3834
3929
|
),
|
|
3835
3930
|
children: /* @__PURE__ */ jsx(
|
|
3836
3931
|
BBOOrderTypeSelect,
|
|
@@ -3852,7 +3947,7 @@ var QtyAndTotalInput = memo((props) => {
|
|
|
3852
3947
|
const { t } = useTranslation();
|
|
3853
3948
|
const { symbolInfo, onFocus, onBlur, getErrorMsg, setOrderValue } = useOrderEntryContext();
|
|
3854
3949
|
const { base, quote, base_dp, quote_dp } = symbolInfo;
|
|
3855
|
-
return /* @__PURE__ */ jsxs(Grid, { cols: 2, className: "oui-group oui-
|
|
3950
|
+
return /* @__PURE__ */ jsxs(Grid, { cols: 2, className: "oui-group oui-gap-1", children: [
|
|
3856
3951
|
/* @__PURE__ */ jsx(
|
|
3857
3952
|
CustomInput,
|
|
3858
3953
|
{
|
|
@@ -3982,7 +4077,7 @@ var QuantityDistributionHint = (props) => {
|
|
|
3982
4077
|
quantity: /* @__PURE__ */ jsx(DescendingQuantity, {})
|
|
3983
4078
|
}
|
|
3984
4079
|
];
|
|
3985
|
-
}, []);
|
|
4080
|
+
}, [t]);
|
|
3986
4081
|
const currentContent = useMemo(() => {
|
|
3987
4082
|
return content.find((item) => item.type === type);
|
|
3988
4083
|
}, [content, type]);
|
|
@@ -3998,7 +4093,7 @@ var QuantityDistributionHint = (props) => {
|
|
|
3998
4093
|
intensity: type === item.type ? 500 : 600,
|
|
3999
4094
|
width: 78,
|
|
4000
4095
|
p: 2,
|
|
4001
|
-
className: "oui-cursor-pointer oui-rounded-
|
|
4096
|
+
className: "oui-cursor-pointer oui-rounded-s",
|
|
4002
4097
|
onClick: () => {
|
|
4003
4098
|
setType(item.type);
|
|
4004
4099
|
},
|
|
@@ -4016,10 +4111,10 @@ var QuantityDistributionHint = (props) => {
|
|
|
4016
4111
|
intensity: 500,
|
|
4017
4112
|
width: "100%",
|
|
4018
4113
|
className: cn(
|
|
4019
|
-
"oui-rounded-
|
|
4020
|
-
type === DistributionType.FLAT && "oui-rounded-
|
|
4021
|
-
type === DistributionType.ASCENDING && "oui-rounded-
|
|
4022
|
-
type === DistributionType.DESCENDING && "oui-rounded-
|
|
4114
|
+
"oui-rounded-e",
|
|
4115
|
+
type === DistributionType.FLAT && "oui-rounded-es",
|
|
4116
|
+
type === DistributionType.ASCENDING && "oui-rounded-s",
|
|
4117
|
+
type === DistributionType.DESCENDING && "oui-rounded-ss"
|
|
4023
4118
|
),
|
|
4024
4119
|
children: [
|
|
4025
4120
|
/* @__PURE__ */ jsx("div", { children: currentContent?.formula }),
|
|
@@ -4081,7 +4176,7 @@ var QuantityDistribution = (props) => {
|
|
|
4081
4176
|
className: cn(
|
|
4082
4177
|
"oui-quantityDistribution-option-label",
|
|
4083
4178
|
"oui-text-2xs",
|
|
4084
|
-
"oui-
|
|
4179
|
+
"oui-ms-1",
|
|
4085
4180
|
"oui-whitespace-nowrap oui-break-normal"
|
|
4086
4181
|
),
|
|
4087
4182
|
children: distributionTypeMap[type]
|
|
@@ -4417,7 +4512,7 @@ var ScaledQuantityUnit = (props) => {
|
|
|
4417
4512
|
classNames: {
|
|
4418
4513
|
trigger: cn(
|
|
4419
4514
|
"oui-orderEntry-scaledQuantityUnit-btn",
|
|
4420
|
-
"oui-absolute oui-
|
|
4515
|
+
"oui-absolute oui-end-0 oui-top-1",
|
|
4421
4516
|
"oui-w-full oui-justify-end",
|
|
4422
4517
|
"oui-shadow-none"
|
|
4423
4518
|
)
|
|
@@ -4463,7 +4558,7 @@ var ScaledQuantityInput = memo((props) => {
|
|
|
4463
4558
|
suffix,
|
|
4464
4559
|
id: "order_quantity_input",
|
|
4465
4560
|
name: "order_quantity_input",
|
|
4466
|
-
className: "oui-orderEntry-scaledOrder-quantityInput !oui-rounded-
|
|
4561
|
+
className: "oui-orderEntry-scaledOrder-quantityInput !oui-rounded-e",
|
|
4467
4562
|
value: props.order_quantity,
|
|
4468
4563
|
error: getErrorMsg(
|
|
4469
4564
|
"order_quantity",
|
|
@@ -4486,7 +4581,7 @@ var ScaledQuantityInput = memo((props) => {
|
|
|
4486
4581
|
suffix,
|
|
4487
4582
|
id: "order_total_input",
|
|
4488
4583
|
name: "order_total_input",
|
|
4489
|
-
className: "oui-orderEntry-scaledOrder-totalInput !oui-rounded-
|
|
4584
|
+
className: "oui-orderEntry-scaledOrder-totalInput !oui-rounded-e",
|
|
4490
4585
|
value: props.total,
|
|
4491
4586
|
error: getErrorMsg("order_quantity", `${errors?.total?.value} ${quote}`),
|
|
4492
4587
|
onChange: (val) => {
|
|
@@ -4535,7 +4630,7 @@ var TotalOrdersInput = memo((props) => {
|
|
|
4535
4630
|
label: t("orderEntry.totalOrders"),
|
|
4536
4631
|
placeholder: "2-20",
|
|
4537
4632
|
id: "order_total_orders_input",
|
|
4538
|
-
className: "oui-orderEntry-scaledOrder-totalOrdersInput !oui-rounded-
|
|
4633
|
+
className: "oui-orderEntry-scaledOrder-totalOrdersInput !oui-rounded-s",
|
|
4539
4634
|
value: props.total_orders,
|
|
4540
4635
|
error: getErrorMsg("total_orders"),
|
|
4541
4636
|
onChange: (val) => {
|
|
@@ -4563,7 +4658,7 @@ var ScaledOrderInput = (props) => {
|
|
|
4563
4658
|
end_price: values.end_price
|
|
4564
4659
|
}
|
|
4565
4660
|
),
|
|
4566
|
-
/* @__PURE__ */ jsxs(Grid, { cols: 2, className: "oui-group oui-
|
|
4661
|
+
/* @__PURE__ */ jsxs(Grid, { cols: 2, className: "oui-group oui-gap-1", children: [
|
|
4567
4662
|
/* @__PURE__ */ jsx(
|
|
4568
4663
|
ScaledQuantityInput,
|
|
4569
4664
|
{
|
|
@@ -4698,7 +4793,7 @@ var TrailingCallbackSelect = memo(
|
|
|
4698
4793
|
classNames: {
|
|
4699
4794
|
trigger: cn(
|
|
4700
4795
|
"oui-orderEntry-trailingCallbackSelect-btn",
|
|
4701
|
-
"oui-absolute oui-
|
|
4796
|
+
"oui-absolute oui-end-0 oui-top-1",
|
|
4702
4797
|
"oui-w-[124px] oui-justify-end",
|
|
4703
4798
|
"oui-text-base-contrast-36"
|
|
4704
4799
|
)
|
|
@@ -4801,7 +4896,7 @@ var TrailingCallbackInput = memo(
|
|
|
4801
4896
|
/* @__PURE__ */ jsx(
|
|
4802
4897
|
CallbackRatePercentages,
|
|
4803
4898
|
{
|
|
4804
|
-
className: "oui-trailingCallback-percentages oui-absolute oui-bottom-1 oui-
|
|
4899
|
+
className: "oui-trailingCallback-percentages oui-absolute oui-bottom-1 oui-start-2",
|
|
4805
4900
|
callback_rate
|
|
4806
4901
|
}
|
|
4807
4902
|
)
|
|
@@ -5175,7 +5270,7 @@ var PNLInput = (props) => {
|
|
|
5175
5270
|
onBlur();
|
|
5176
5271
|
},
|
|
5177
5272
|
suffix: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5178
|
-
isPercentageMode && !!value && /* @__PURE__ */ jsx(Text, { size: "2xs", color: "inherit", className: "oui-
|
|
5273
|
+
isPercentageMode && !!value && /* @__PURE__ */ jsx(Text, { size: "2xs", color: "inherit", className: "oui-ms-[2px]", children: "%" }),
|
|
5179
5274
|
/* @__PURE__ */ jsx(
|
|
5180
5275
|
PNLMenus,
|
|
5181
5276
|
{
|
|
@@ -5234,7 +5329,7 @@ var PnlInputProvider = (props) => {
|
|
|
5234
5329
|
{
|
|
5235
5330
|
rule: "percentages",
|
|
5236
5331
|
className: cn(
|
|
5237
|
-
"oui-
|
|
5332
|
+
"oui-ms-1 oui-text-xs",
|
|
5238
5333
|
type === "TP" ? "oui-text-trade-profit" : "oui-text-trade-loss"
|
|
5239
5334
|
),
|
|
5240
5335
|
children: values.ROI
|
|
@@ -5244,14 +5339,14 @@ var PnlInputProvider = (props) => {
|
|
|
5244
5339
|
{
|
|
5245
5340
|
rule: "price",
|
|
5246
5341
|
className: cn(
|
|
5247
|
-
"oui-
|
|
5342
|
+
"oui-ms-1 oui-text-xs",
|
|
5248
5343
|
type === "TP" ? "oui-text-trade-profit" : "oui-text-trade-loss"
|
|
5249
5344
|
),
|
|
5250
5345
|
children: values.PnL
|
|
5251
5346
|
}
|
|
5252
5347
|
)
|
|
5253
5348
|
] });
|
|
5254
|
-
}, [mode, values.ROI, values.PnL, values.trigger_price]);
|
|
5349
|
+
}, [mode, t, type, values.ROI, values.PnL, values.trigger_price]);
|
|
5255
5350
|
const memoizedValue = useMemo(() => {
|
|
5256
5351
|
return { mode, setMode, tipsEle };
|
|
5257
5352
|
}, [mode, setMode, tipsEle]);
|
|
@@ -5320,7 +5415,7 @@ var OrderTPSL = (props) => {
|
|
|
5320
5415
|
{
|
|
5321
5416
|
className: cn(
|
|
5322
5417
|
"oui-orderEntry-tpsl-body",
|
|
5323
|
-
"oui-
|
|
5418
|
+
"oui-overflow-hidden oui-transition-all",
|
|
5324
5419
|
props.switchState ? "oui-max-h-[120px]" : "oui-max-h-0"
|
|
5325
5420
|
),
|
|
5326
5421
|
onTransitionEnd: () => {
|
|
@@ -5464,7 +5559,6 @@ var TPSLTriggerPriceInput = (props) => {
|
|
|
5464
5559
|
const { t } = useTranslation();
|
|
5465
5560
|
const { errorMsgVisible } = useOrderEntryContext();
|
|
5466
5561
|
const { tipsEle } = usePnlInputContext();
|
|
5467
|
-
const [prefix, setPrefix] = useState(`${props.type} Price`);
|
|
5468
5562
|
const [placeholder, setPlaceholder] = useState("USDC");
|
|
5469
5563
|
const [tipVisible, setTipVisible] = useState(false);
|
|
5470
5564
|
const [isFocused, setIsFocused] = useState(false);
|
|
@@ -5489,31 +5583,17 @@ var TPSLTriggerPriceInput = (props) => {
|
|
|
5489
5583
|
tipsEle,
|
|
5490
5584
|
props.displayErrorMessage
|
|
5491
5585
|
]);
|
|
5492
|
-
const
|
|
5493
|
-
let _prefix = props.type === "TP" ? t("tpsl.tpPrice") : t("tpsl.slPrice");
|
|
5494
|
-
if (trigger_price) {
|
|
5495
|
-
_prefix = props.type === "TP" ? t("tpsl.tp") : t("tpsl.sl");
|
|
5496
|
-
}
|
|
5497
|
-
return _prefix;
|
|
5498
|
-
};
|
|
5586
|
+
const prefix = isFocused || innerValue ? props.type === "TP" ? t("tpsl.tp") : t("tpsl.sl") : props.type === "TP" ? t("tpsl.tpPrice") : t("tpsl.slPrice");
|
|
5499
5587
|
const onValueChange = (value) => {
|
|
5500
5588
|
setInnerValue(value);
|
|
5501
5589
|
props.onChange(value);
|
|
5502
5590
|
};
|
|
5503
|
-
useEffect(() => {
|
|
5504
|
-
setPrefix(getPrefixLabel(props.values.trigger_price));
|
|
5505
|
-
if (!isFocused) {
|
|
5506
|
-
setInnerValue(props.values.trigger_price ?? "");
|
|
5507
|
-
}
|
|
5508
|
-
}, [props.type, props.values.trigger_price]);
|
|
5509
5591
|
const onFocus = () => {
|
|
5510
|
-
setPrefix(props.type === "TP" ? t("tpsl.tp") : t("tpsl.sl"));
|
|
5511
5592
|
setPlaceholder("");
|
|
5512
5593
|
setTipVisible(true);
|
|
5513
5594
|
setIsFocused(true);
|
|
5514
5595
|
};
|
|
5515
5596
|
const onBlur = () => {
|
|
5516
|
-
setPrefix(getPrefixLabel(props.values.trigger_price));
|
|
5517
5597
|
setPlaceholder("USDC");
|
|
5518
5598
|
setTipVisible(false);
|
|
5519
5599
|
setIsFocused(false);
|
|
@@ -5542,10 +5622,10 @@ var TPSLTriggerPriceInput = (props) => {
|
|
|
5542
5622
|
additional: "oui-text-base-contrast-54",
|
|
5543
5623
|
root: cn(
|
|
5544
5624
|
"oui-orderEntry-tpsl-triggerPrice",
|
|
5545
|
-
"oui-
|
|
5625
|
+
"oui-pe-2 md:oui-pe-3",
|
|
5546
5626
|
props.classNames?.root
|
|
5547
5627
|
),
|
|
5548
|
-
prefix: cn("oui-
|
|
5628
|
+
prefix: cn("oui-pe-1 md:oui-pe-2", props.classNames?.prefix),
|
|
5549
5629
|
input: cn(
|
|
5550
5630
|
"oui-text-2xs placeholder:oui-text-2xs",
|
|
5551
5631
|
props.classNames?.input
|
|
@@ -6091,7 +6171,7 @@ var OrderEntry = (props) => {
|
|
|
6091
6171
|
onClick: () => {
|
|
6092
6172
|
setPinned(false);
|
|
6093
6173
|
},
|
|
6094
|
-
className: "oui-group oui-absolute oui-
|
|
6174
|
+
className: "oui-group oui-absolute oui-end-2 oui-top-2",
|
|
6095
6175
|
"data-testid": "oui-testid-orderEntry-pinned-button"
|
|
6096
6176
|
}
|
|
6097
6177
|
)
|
|
@@ -6109,7 +6189,7 @@ var OrderEntry = (props) => {
|
|
|
6109
6189
|
overlay: "!oui-bg-base-10/60",
|
|
6110
6190
|
content: cn(
|
|
6111
6191
|
"oui-rounded-[16px] oui-border-none !oui-p-0",
|
|
6112
|
-
isMobile ? "oui-inset-y-0 oui-
|
|
6192
|
+
isMobile ? "oui-inset-y-0 oui-end-0 oui-w-[280px]" : "!oui-bottom-[40px] oui-end-3 oui-top-[44px] !oui-h-auto oui-w-[360px]"
|
|
6113
6193
|
)
|
|
6114
6194
|
},
|
|
6115
6195
|
contentProps: { side: "right", closeable: false },
|