@agg-build/ui 2.7.3 → 3.0.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/{chunk-EDQ64EKO.mjs → chunk-JTSLZARU.mjs} +6 -5
- package/dist/{chunk-FMYYPNZZ.mjs → chunk-KO6VTRV6.mjs} +101 -27
- package/dist/{chunk-AHQA3B7D.mjs → chunk-KX3TQ7WC.mjs} +1 -1
- package/dist/{chunk-7DM45TMO.mjs → chunk-MKU5Q6PN.mjs} +21 -13
- package/dist/{chunk-MZBYIXYA.mjs → chunk-R362GNI2.mjs} +1310 -500
- package/dist/{chunk-JQKJDSTW.mjs → chunk-VR5ZRDQT.mjs} +3 -2
- package/dist/{chunk-O27JUYCF.mjs → chunk-XIDQ2A6W.mjs} +645 -346
- package/dist/events.js +168 -91
- package/dist/events.mjs +3 -3
- package/dist/index.js +2784 -1606
- package/dist/index.mjs +9 -7
- package/dist/modals.js +98 -29
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +2510 -1333
- package/dist/pages.mjs +8 -6
- package/dist/primitives.js +94 -26
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +1739 -1143
- package/dist/trading.mjs +4 -4
- package/dist/types/events/orderbook/orderbook.utils.d.mts +1 -1
- package/dist/types/events/orderbook/orderbook.utils.d.ts +1 -1
- package/dist/types/pages/user-profile/components/available-balance-card.d.mts +5 -1
- package/dist/types/pages/user-profile/components/available-balance-card.d.ts +5 -1
- package/dist/types/pages/user-profile/components/manage-balances-modal.d.mts +8 -0
- package/dist/types/pages/user-profile/components/manage-balances-modal.d.ts +8 -0
- package/dist/types/pages/user-profile/components/open-order-row.d.mts +1 -0
- package/dist/types/pages/user-profile/components/open-order-row.d.ts +1 -0
- package/dist/types/pages/user-profile/index.d.mts +1 -0
- package/dist/types/pages/user-profile/index.d.ts +1 -0
- package/dist/types/pages/user-profile/position-view-model.d.mts +15 -4
- package/dist/types/pages/user-profile/position-view-model.d.ts +15 -4
- package/dist/types/primitives/select/index.d.mts +1 -1
- package/dist/types/primitives/select/index.d.ts +1 -1
- package/dist/types/primitives/select/select.types.d.mts +8 -0
- package/dist/types/primitives/select/select.types.d.ts +8 -0
- package/dist/types/profile/profile-modal.constants.d.mts +1 -1
- package/dist/types/profile/profile-modal.constants.d.ts +1 -1
- package/dist/types/trading/place-order/index.place-order.constants.d.mts +3 -1
- package/dist/types/trading/place-order/index.place-order.constants.d.ts +3 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +10 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +10 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +17 -5
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +17 -5
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ConnectKalshiModal,
|
|
4
4
|
dispatchAggDepositNotification
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KX3TQ7WC.mjs";
|
|
6
6
|
import {
|
|
7
7
|
BoltIcon,
|
|
8
8
|
Button,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
shortenAddress,
|
|
36
36
|
useOptionalToast,
|
|
37
37
|
venueLogoLabels
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-KO6VTRV6.mjs";
|
|
39
39
|
|
|
40
40
|
// src/deposit/index.tsx
|
|
41
41
|
import { useAggAuthState, useAggUiConfig, useDepositAddresses, useLabels as useLabels11 } from "@agg-build/hooks";
|
|
@@ -2491,7 +2491,7 @@ var PROFILE_TAB_KEYS = {
|
|
|
2491
2491
|
PROFILE_ACCOUNTS: "profile-accounts",
|
|
2492
2492
|
TRADING_ACCESS: "trading-access"
|
|
2493
2493
|
};
|
|
2494
|
-
var
|
|
2494
|
+
var getProfileTabItems = () => [
|
|
2495
2495
|
{
|
|
2496
2496
|
value: PROFILE_TAB_KEYS.PROFILE_ACCOUNTS,
|
|
2497
2497
|
label: "Profile & accounts",
|
|
@@ -2938,6 +2938,7 @@ var ProfileModal = ({
|
|
|
2938
2938
|
const { user } = useAggAuthState2();
|
|
2939
2939
|
const toastCtx = useOptionalToast();
|
|
2940
2940
|
const [activeTab, setActiveTab] = useState4(PROFILE_TAB_KEYS.PROFILE_ACCOUNTS);
|
|
2941
|
+
const profileTabItems = useMemo3(() => getProfileTabItems(), []);
|
|
2941
2942
|
const resolvedInitialUsername = (_a = username != null ? username : user == null ? void 0 : user.username) != null ? _a : "";
|
|
2942
2943
|
const [draftUsername, setDraftUsername] = useState4(resolvedInitialUsername);
|
|
2943
2944
|
const [draftAvatarFile, setDraftAvatarFile] = useState4();
|
|
@@ -3324,7 +3325,7 @@ var ProfileModal = ({
|
|
|
3324
3325
|
className: "w-full [&>div]:w-full",
|
|
3325
3326
|
variant: "underline",
|
|
3326
3327
|
classNames: { tabList: "w-full" },
|
|
3327
|
-
items:
|
|
3328
|
+
items: profileTabItems.map((tab) => ({
|
|
3328
3329
|
value: tab.value,
|
|
3329
3330
|
label: tab.label,
|
|
3330
3331
|
icon: /* @__PURE__ */ jsx20(Icon, { name: tab.icon, size: "small" })
|
|
@@ -3348,7 +3349,7 @@ var ProfileModal = ({
|
|
|
3348
3349
|
),
|
|
3349
3350
|
role: "tablist",
|
|
3350
3351
|
"aria-label": "Profile sections",
|
|
3351
|
-
children:
|
|
3352
|
+
children: profileTabItems.map((tab) => {
|
|
3352
3353
|
const isActive = activeTab === tab.value;
|
|
3353
3354
|
return /* @__PURE__ */ jsxs20(
|
|
3354
3355
|
"button",
|
|
@@ -8528,7 +8528,13 @@ NumberValue.displayName = "NumberValue";
|
|
|
8528
8528
|
|
|
8529
8529
|
// src/primitives/select/index.tsx
|
|
8530
8530
|
import { useLabels as useLabels14, useSdkUiConfig as useSdkUiConfig14 } from "@agg-build/hooks";
|
|
8531
|
-
import {
|
|
8531
|
+
import {
|
|
8532
|
+
useCallback as useCallback4,
|
|
8533
|
+
useEffect as useEffect7,
|
|
8534
|
+
useLayoutEffect as useLayoutEffect2,
|
|
8535
|
+
useRef as useRef7,
|
|
8536
|
+
useState as useState8
|
|
8537
|
+
} from "react";
|
|
8532
8538
|
import { createPortal } from "react-dom";
|
|
8533
8539
|
|
|
8534
8540
|
// src/primitives/select/select.constants.ts
|
|
@@ -8565,7 +8571,11 @@ var Select = ({
|
|
|
8565
8571
|
triggerClassName,
|
|
8566
8572
|
contentClassName,
|
|
8567
8573
|
itemClassName,
|
|
8568
|
-
disabled = SELECT_DEFAULT_IS_DISABLED
|
|
8574
|
+
disabled = SELECT_DEFAULT_IS_DISABLED,
|
|
8575
|
+
variant = "default",
|
|
8576
|
+
openOnHover = false,
|
|
8577
|
+
contentAlign = "start",
|
|
8578
|
+
contentSideOffset = 8
|
|
8569
8579
|
}) => {
|
|
8570
8580
|
var _a;
|
|
8571
8581
|
const labels = useLabels14();
|
|
@@ -8576,17 +8586,30 @@ var Select = ({
|
|
|
8576
8586
|
const isDisabled = resolveIsSelectDisabled({ disabled, items });
|
|
8577
8587
|
const selectedItem = resolveSelectedItem(items, value);
|
|
8578
8588
|
const [isOpen, setIsOpen] = useState8(false);
|
|
8579
|
-
const [menuRect, setMenuRect] = useState8(
|
|
8580
|
-
null
|
|
8581
|
-
);
|
|
8589
|
+
const [menuRect, setMenuRect] = useState8(null);
|
|
8582
8590
|
const containerRef = useRef7(null);
|
|
8583
8591
|
const portalRef = useRef7(null);
|
|
8584
|
-
const
|
|
8592
|
+
const closeTimerRef = useRef7(null);
|
|
8593
|
+
const openedByHoverRef = useRef7(false);
|
|
8594
|
+
const handleClose = useCallback4(() => {
|
|
8595
|
+
setIsOpen(false);
|
|
8596
|
+
openedByHoverRef.current = false;
|
|
8597
|
+
}, []);
|
|
8585
8598
|
const updateMenuRect = useCallback4(() => {
|
|
8586
8599
|
const el = containerRef.current;
|
|
8587
8600
|
if (!el) return;
|
|
8588
8601
|
const r = el.getBoundingClientRect();
|
|
8589
|
-
setMenuRect({
|
|
8602
|
+
setMenuRect({
|
|
8603
|
+
top: r.bottom + contentSideOffset,
|
|
8604
|
+
left: r.left,
|
|
8605
|
+
right: r.right,
|
|
8606
|
+
width: r.width
|
|
8607
|
+
});
|
|
8608
|
+
}, [contentSideOffset]);
|
|
8609
|
+
useEffect7(() => {
|
|
8610
|
+
return () => {
|
|
8611
|
+
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
8612
|
+
};
|
|
8590
8613
|
}, []);
|
|
8591
8614
|
useLayoutEffect2(() => {
|
|
8592
8615
|
if (!isOpen) {
|
|
@@ -8624,7 +8647,33 @@ var Select = ({
|
|
|
8624
8647
|
document.addEventListener("keydown", handleKeyDown);
|
|
8625
8648
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
8626
8649
|
}, [isOpen, handleClose]);
|
|
8627
|
-
const
|
|
8650
|
+
const handlePointerEnter = (event) => {
|
|
8651
|
+
if (!openOnHover || isDisabled || event.pointerType === "touch") return;
|
|
8652
|
+
if (closeTimerRef.current) {
|
|
8653
|
+
clearTimeout(closeTimerRef.current);
|
|
8654
|
+
closeTimerRef.current = null;
|
|
8655
|
+
}
|
|
8656
|
+
if (isOpen) return;
|
|
8657
|
+
openedByHoverRef.current = true;
|
|
8658
|
+
setIsOpen(true);
|
|
8659
|
+
};
|
|
8660
|
+
const handlePointerLeave = (event) => {
|
|
8661
|
+
if (!openOnHover || event.pointerType === "touch") return;
|
|
8662
|
+
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
8663
|
+
closeTimerRef.current = setTimeout(() => {
|
|
8664
|
+
handleClose();
|
|
8665
|
+
closeTimerRef.current = null;
|
|
8666
|
+
}, 120);
|
|
8667
|
+
};
|
|
8668
|
+
const handleTriggerClick = () => {
|
|
8669
|
+
if (openedByHoverRef.current && isOpen) {
|
|
8670
|
+
openedByHoverRef.current = false;
|
|
8671
|
+
return;
|
|
8672
|
+
}
|
|
8673
|
+
setIsOpen((previousValue) => !previousValue);
|
|
8674
|
+
};
|
|
8675
|
+
const isInline = variant === "inline";
|
|
8676
|
+
const triggerRadiusClass = triggerClassName != null ? triggerClassName : isInline ? "rounded-agg-sm" : "rounded-agg-md";
|
|
8628
8677
|
const listbox = menuRect ? /* @__PURE__ */ jsx129(
|
|
8629
8678
|
"div",
|
|
8630
8679
|
{
|
|
@@ -8635,16 +8684,20 @@ var Select = ({
|
|
|
8635
8684
|
style: {
|
|
8636
8685
|
position: "fixed",
|
|
8637
8686
|
top: menuRect.top,
|
|
8638
|
-
left: menuRect.left,
|
|
8687
|
+
left: contentAlign === "start" ? menuRect.left : void 0,
|
|
8688
|
+
right: contentAlign === "end" ? window.innerWidth - menuRect.right : void 0,
|
|
8639
8689
|
width: menuRect.width,
|
|
8640
8690
|
zIndex: SELECT_DROPDOWN_Z
|
|
8641
8691
|
},
|
|
8642
8692
|
className: cn(
|
|
8643
8693
|
AGG_ROOT_CLASS_NAME,
|
|
8644
8694
|
rootClassName,
|
|
8645
|
-
"agg-select-content pointer-events-auto max-h-[min(20rem,calc(100vh-4rem))] overflow-y-auto
|
|
8695
|
+
"agg-select-content pointer-events-auto max-h-[min(20rem,calc(100vh-4rem))] overflow-y-auto border border-agg-separator bg-agg-secondary flex flex-col",
|
|
8696
|
+
isInline ? "min-w-[120px] gap-0 rounded-agg-lg py-1 shadow-[0_8px_16px_rgba(0,0,0,0.12)]" : "gap-1 rounded-[12px] p-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]",
|
|
8646
8697
|
contentClassName
|
|
8647
8698
|
),
|
|
8699
|
+
onPointerEnter: handlePointerEnter,
|
|
8700
|
+
onPointerLeave: handlePointerLeave,
|
|
8648
8701
|
children: items.map((item) => {
|
|
8649
8702
|
const isSelected = item.value === value;
|
|
8650
8703
|
const isHidden = item.hidden === true;
|
|
@@ -8658,9 +8711,10 @@ var Select = ({
|
|
|
8658
8711
|
disabled: item.disabled,
|
|
8659
8712
|
className: cn(
|
|
8660
8713
|
"agg-select-item",
|
|
8661
|
-
"relative flex w-full items-center
|
|
8714
|
+
"relative flex w-full items-center text-left text-agg-sm leading-agg-5 outline-none",
|
|
8715
|
+
isInline ? "gap-2 px-4 py-2" : "gap-3 rounded-[6px] py-3 pl-3 pr-5",
|
|
8662
8716
|
"hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
|
|
8663
|
-
isSelected ? "bg-agg-primary/10 font-agg-normal text-agg-primary" : "font-agg-normal text-agg-foreground",
|
|
8717
|
+
isSelected ? isInline ? "font-agg-bold text-agg-foreground" : "bg-agg-primary/10 font-agg-normal text-agg-primary" : "font-agg-normal text-agg-foreground",
|
|
8664
8718
|
item.disabled && "cursor-not-allowed opacity-60",
|
|
8665
8719
|
itemClassName
|
|
8666
8720
|
),
|
|
@@ -8672,6 +8726,13 @@ var Select = ({
|
|
|
8672
8726
|
handleClose();
|
|
8673
8727
|
},
|
|
8674
8728
|
children: [
|
|
8729
|
+
isInline && isSelected ? /* @__PURE__ */ jsx129(
|
|
8730
|
+
"span",
|
|
8731
|
+
{
|
|
8732
|
+
className: "agg-select-item-indicator absolute bottom-2 left-0 top-2 w-1 bg-agg-primary",
|
|
8733
|
+
"aria-hidden": true
|
|
8734
|
+
}
|
|
8735
|
+
) : null,
|
|
8675
8736
|
item.icon ? /* @__PURE__ */ jsx129(
|
|
8676
8737
|
"span",
|
|
8677
8738
|
{
|
|
@@ -8701,7 +8762,11 @@ var Select = ({
|
|
|
8701
8762
|
"div",
|
|
8702
8763
|
{
|
|
8703
8764
|
ref: containerRef,
|
|
8704
|
-
className: cn(
|
|
8765
|
+
className: cn(
|
|
8766
|
+
"group/agg-select relative inline-flex",
|
|
8767
|
+
isInline ? "w-auto" : "w-full",
|
|
8768
|
+
className
|
|
8769
|
+
),
|
|
8705
8770
|
children: [
|
|
8706
8771
|
/* @__PURE__ */ jsxs122(
|
|
8707
8772
|
"button",
|
|
@@ -8713,19 +8778,19 @@ var Select = ({
|
|
|
8713
8778
|
disabled: isDisabled,
|
|
8714
8779
|
className: cn(
|
|
8715
8780
|
"agg-select-trigger",
|
|
8716
|
-
"flex
|
|
8717
|
-
"
|
|
8781
|
+
"flex cursor-pointer items-center gap-2 font-agg-sans text-agg-foreground outline-none disabled:cursor-not-allowed disabled:opacity-60",
|
|
8782
|
+
isInline ? "h-auto w-auto bg-transparent px-2 py-1 pr-8 text-left text-agg-base leading-agg-6" : "h-10 w-full border border-agg-separator bg-agg-secondary px-3 py-[9px] pr-10 text-left text-agg-sm leading-agg-5",
|
|
8718
8783
|
triggerRadiusClass,
|
|
8719
|
-
getMotionClassName(
|
|
8784
|
+
!isInline && getMotionClassName(
|
|
8720
8785
|
enableAnimations,
|
|
8721
8786
|
"transition-[border-color,box-shadow] duration-200 ease-in-out"
|
|
8722
8787
|
),
|
|
8723
|
-
isOpen && "border-2 border-agg-primary px-[11px] py-2 ring-0",
|
|
8724
|
-
"hover:border-agg-primary"
|
|
8725
|
-
"focus:border-agg-primary focus:ring-0",
|
|
8726
|
-
"disabled:cursor-not-allowed disabled:opacity-60"
|
|
8788
|
+
!isInline && isOpen && "border-2 border-agg-primary px-[11px] py-2 ring-0",
|
|
8789
|
+
!isInline && "hover:border-agg-primary focus:border-agg-primary focus:ring-0"
|
|
8727
8790
|
),
|
|
8728
|
-
onClick:
|
|
8791
|
+
onClick: handleTriggerClick,
|
|
8792
|
+
onPointerEnter: handlePointerEnter,
|
|
8793
|
+
onPointerLeave: handlePointerLeave,
|
|
8729
8794
|
children: [
|
|
8730
8795
|
(selectedItem == null ? void 0 : selectedItem.icon) ? /* @__PURE__ */ jsx129("span", { className: "h-4 w-4 shrink-0 [&_svg]:h-full [&_svg]:w-full", children: selectedItem.icon }) : (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ jsx129(
|
|
8731
8796
|
RemoteImage,
|
|
@@ -8739,14 +8804,23 @@ var Select = ({
|
|
|
8739
8804
|
]
|
|
8740
8805
|
}
|
|
8741
8806
|
),
|
|
8742
|
-
/* @__PURE__ */ jsx129(
|
|
8743
|
-
|
|
8807
|
+
/* @__PURE__ */ jsx129(
|
|
8808
|
+
"span",
|
|
8744
8809
|
{
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8810
|
+
className: cn(
|
|
8811
|
+
"agg-select-chevron pointer-events-none absolute inset-y-0 inline-flex items-center justify-center",
|
|
8812
|
+
isInline ? "right-2 text-agg-foreground" : "right-3 text-agg-muted-foreground"
|
|
8813
|
+
),
|
|
8814
|
+
children: /* @__PURE__ */ jsx129(
|
|
8815
|
+
Icon,
|
|
8816
|
+
{
|
|
8817
|
+
name: isOpen ? "chevron-up" : "chevron-down-thin",
|
|
8818
|
+
size: "small",
|
|
8819
|
+
color: "currentColor"
|
|
8820
|
+
}
|
|
8821
|
+
)
|
|
8748
8822
|
}
|
|
8749
|
-
)
|
|
8823
|
+
),
|
|
8750
8824
|
isOpen && typeof document !== "undefined" && listbox ? createPortal(listbox, resolveSelectPortalContainer(containerRef.current)) : null
|
|
8751
8825
|
]
|
|
8752
8826
|
}
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
resolveUnifiedOrderBookEntries,
|
|
25
25
|
sortOutcomeSelectorOutcomes,
|
|
26
26
|
useEventTradingContext
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-VR5ZRDQT.mjs";
|
|
28
28
|
import {
|
|
29
29
|
AutocompleteSelect,
|
|
30
30
|
Badge,
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
sortCategoriesForNavigation,
|
|
77
77
|
sortOutcomes,
|
|
78
78
|
splitEventsByLifecycle
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-KO6VTRV6.mjs";
|
|
80
80
|
|
|
81
81
|
// src/events/item/index.tsx
|
|
82
82
|
import {
|
|
@@ -2349,7 +2349,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
2349
2349
|
}, [chartOutcomeLabel, (_d = tradingContext == null ? void 0 : tradingContext.selectedOutcome) == null ? void 0 : _d.label]);
|
|
2350
2350
|
const {
|
|
2351
2351
|
chart: { selectedChartTimeRange },
|
|
2352
|
-
formatting: { formatPercent },
|
|
2352
|
+
formatting: { formatPercent, formatPrice },
|
|
2353
2353
|
general: { theme }
|
|
2354
2354
|
} = useSdkUiConfig2();
|
|
2355
2355
|
const isDarkTheme = theme === "dark";
|
|
@@ -2624,8 +2624,8 @@ var EventListItemDetailsGraphSection = ({
|
|
|
2624
2624
|
});
|
|
2625
2625
|
return {
|
|
2626
2626
|
value: outcome.id,
|
|
2627
|
-
label: `${(_d3 = outcome.title) != null ? _d3 : outcome.label} ${formatProbabilityCents(price)}`,
|
|
2628
|
-
ariaLabel: `${(_e2 = outcome.title) != null ? _e2 : outcome.label} ${formatProbabilityCents(price)}`
|
|
2627
|
+
label: `${(_d3 = outcome.title) != null ? _d3 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`,
|
|
2628
|
+
ariaLabel: `${(_e2 = outcome.title) != null ? _e2 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`
|
|
2629
2629
|
};
|
|
2630
2630
|
})
|
|
2631
2631
|
}
|
|
@@ -3225,6 +3225,7 @@ var OrderbookRow = ({
|
|
|
3225
3225
|
entry,
|
|
3226
3226
|
formatNumber,
|
|
3227
3227
|
formatCurrency,
|
|
3228
|
+
formatPrice,
|
|
3228
3229
|
enableAnimations,
|
|
3229
3230
|
showBadge,
|
|
3230
3231
|
badgeLabel
|
|
@@ -3293,7 +3294,7 @@ var OrderbookRow = ({
|
|
|
3293
3294
|
"w-9 min-w-9 md:min-w-10 md:w-10 text-agg-sm font-agg-bold leading-agg-5",
|
|
3294
3295
|
priceClassName
|
|
3295
3296
|
),
|
|
3296
|
-
children: formatProbabilityCents(entry.row.price)
|
|
3297
|
+
children: formatProbabilityCents(entry.row.price, formatPrice)
|
|
3297
3298
|
}
|
|
3298
3299
|
),
|
|
3299
3300
|
/* @__PURE__ */ jsx6(OrderbookVenueLogos, { venues })
|
|
@@ -3315,7 +3316,10 @@ var Orderbook = ({
|
|
|
3315
3316
|
className
|
|
3316
3317
|
}) => {
|
|
3317
3318
|
var _a, _b, _c, _d, _e;
|
|
3318
|
-
const {
|
|
3319
|
+
const {
|
|
3320
|
+
enableWebsocketsLogs,
|
|
3321
|
+
formatting: { formatPrice }
|
|
3322
|
+
} = useAggUiConfig();
|
|
3319
3323
|
const labels = __spreadValues(__spreadValues({}, orderbookDefaultLabels), labelsProp);
|
|
3320
3324
|
const scrollContainerRef = useRef5(null);
|
|
3321
3325
|
const spreadRowRef = useRef5(null);
|
|
@@ -3380,6 +3384,7 @@ var Orderbook = ({
|
|
|
3380
3384
|
entry,
|
|
3381
3385
|
formatNumber,
|
|
3382
3386
|
formatCurrency,
|
|
3387
|
+
formatPrice,
|
|
3383
3388
|
enableAnimations,
|
|
3384
3389
|
showBadge: index === askEntries.length - 1,
|
|
3385
3390
|
badgeLabel: labels.asks
|
|
@@ -3392,7 +3397,7 @@ var Orderbook = ({
|
|
|
3392
3397
|
ref: spreadRowRef,
|
|
3393
3398
|
className: "agg-orderbook-spread flex items-center border-y border-agg-separator h-9 px-5 py-2 gap-3 md:gap-10",
|
|
3394
3399
|
role: "separator",
|
|
3395
|
-
"aria-label": `${labels.midPrice}: ${formatProbabilityCents((_b = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _b : null)}, ${labels.spread}: ${formatProbabilityCents((_c = spreadEntry == null ? void 0 : spreadEntry.spread) != null ? _c : null)}`,
|
|
3400
|
+
"aria-label": `${labels.midPrice}: ${formatProbabilityCents((_b = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _b : null, formatPrice)}, ${labels.spread}: ${formatProbabilityCents((_c = spreadEntry == null ? void 0 : spreadEntry.spread) != null ? _c : null)}`,
|
|
3396
3401
|
children: [
|
|
3397
3402
|
/* @__PURE__ */ jsxs5(
|
|
3398
3403
|
Typography,
|
|
@@ -3402,7 +3407,7 @@ var Orderbook = ({
|
|
|
3402
3407
|
children: [
|
|
3403
3408
|
"Last: ",
|
|
3404
3409
|
labels.lastOutcome ? `${labels.lastOutcome} ` : "",
|
|
3405
|
-
formatProbabilityCents((_d = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _d : null)
|
|
3410
|
+
formatProbabilityCents((_d = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _d : null, formatPrice)
|
|
3406
3411
|
]
|
|
3407
3412
|
}
|
|
3408
3413
|
),
|
|
@@ -3429,6 +3434,7 @@ var Orderbook = ({
|
|
|
3429
3434
|
entry,
|
|
3430
3435
|
formatNumber,
|
|
3431
3436
|
formatCurrency,
|
|
3437
|
+
formatPrice,
|
|
3432
3438
|
enableAnimations,
|
|
3433
3439
|
showBadge: index === 0,
|
|
3434
3440
|
badgeLabel: labels.bids
|
|
@@ -3599,6 +3605,7 @@ var buildVenueMarketIdByVenue = (venueMarkets) => {
|
|
|
3599
3605
|
};
|
|
3600
3606
|
|
|
3601
3607
|
// src/events/market-details/market-details-outcome-button.tsx
|
|
3608
|
+
import { useAggUiConfig as useAggUiConfig2 } from "@agg-build/hooks";
|
|
3602
3609
|
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
3603
3610
|
var marketDetailsOutcomeButtonToneClasses = {
|
|
3604
3611
|
positive: {
|
|
@@ -3649,6 +3656,7 @@ var OutcomePriceContent = ({
|
|
|
3649
3656
|
value,
|
|
3650
3657
|
textClassName
|
|
3651
3658
|
}) => {
|
|
3659
|
+
const { formatPrice } = useAggUiConfig2().formatting;
|
|
3652
3660
|
if (isLoading) {
|
|
3653
3661
|
return /* @__PURE__ */ jsx8(
|
|
3654
3662
|
"span",
|
|
@@ -3667,7 +3675,7 @@ var OutcomePriceContent = ({
|
|
|
3667
3675
|
as: "span",
|
|
3668
3676
|
variant: isSelected ? "body-strong" : "body",
|
|
3669
3677
|
className: cn("shrink-0 whitespace-nowrap", textClassName),
|
|
3670
|
-
children: formatProbabilityCents(value)
|
|
3678
|
+
children: formatProbabilityCents(value, formatPrice)
|
|
3671
3679
|
}
|
|
3672
3680
|
);
|
|
3673
3681
|
};
|
|
@@ -3786,7 +3794,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
3786
3794
|
var _a, _b, _c;
|
|
3787
3795
|
const config = useSdkUiConfig3();
|
|
3788
3796
|
const {
|
|
3789
|
-
formatting: { formatPercent, formatCompactCurrency },
|
|
3797
|
+
formatting: { formatPercent, formatCompactCurrency, formatPrice },
|
|
3790
3798
|
general: { theme }
|
|
3791
3799
|
} = config;
|
|
3792
3800
|
const isDarkTheme = theme === "dark";
|
|
@@ -4000,8 +4008,8 @@ var MarketDetailsGraphPanel = ({
|
|
|
4000
4008
|
const price = outcome.probability;
|
|
4001
4009
|
return {
|
|
4002
4010
|
value: outcome.id,
|
|
4003
|
-
label: `${(_a3 = outcome == null ? void 0 : outcome.title) != null ? _a3 : outcome.label} ${formatProbabilityCents(price)}`,
|
|
4004
|
-
ariaLabel: `${(_b3 = outcome == null ? void 0 : outcome.title) != null ? _b3 : outcome.label} ${formatProbabilityCents(price)}`
|
|
4011
|
+
label: `${(_a3 = outcome == null ? void 0 : outcome.title) != null ? _a3 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`,
|
|
4012
|
+
ariaLabel: `${(_b3 = outcome == null ? void 0 : outcome.title) != null ? _b3 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`
|
|
4005
4013
|
};
|
|
4006
4014
|
})
|
|
4007
4015
|
}
|