@agg-build/ui 2.8.0 → 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-AKLGQ6AB.mjs → chunk-JTSLZARU.mjs} +50 -250
- package/dist/{chunk-2QCNDFNC.mjs → chunk-R362GNI2.mjs} +1120 -400
- package/dist/{chunk-R5S2QOYL.mjs → chunk-XIDQ2A6W.mjs} +152 -59
- package/dist/index.js +1764 -1155
- package/dist/index.mjs +5 -3
- package/dist/modals.js +391 -845
- package/dist/modals.mjs +1 -1
- package/dist/pages.js +1724 -916
- package/dist/pages.mjs +4 -2
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +567 -472
- package/dist/trading.mjs +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/index.d.mts +1 -0
- package/dist/types/pages/user-profile/index.d.ts +1 -0
- package/dist/types/profile/profile-modal.constants.d.mts +1 -2
- package/dist/types/profile/profile-modal.constants.d.ts +1 -2
- package/dist/types/trading/place-order/index.place-order.constants.d.mts +1 -0
- package/dist/types/trading/place-order/index.place-order.constants.d.ts +1 -0
- package/dist/types/trading/place-order/index.place-order.types.d.mts +4 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +4 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +7 -3
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +7 -3
- package/package.json +3 -3
- package/dist/types/profile/tabs/balance-management-tab.d.mts +0 -3
- package/dist/types/profile/tabs/balance-management-tab.d.ts +0 -3
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
CloseIcon,
|
|
13
13
|
CopyButton,
|
|
14
14
|
CreditCardIcon,
|
|
15
|
-
CurrencyInput,
|
|
16
15
|
ExternalLinkIcon,
|
|
17
16
|
Icon,
|
|
18
17
|
LoadingIcon,
|
|
@@ -2483,28 +2482,22 @@ var WithdrawModal = (props) => {
|
|
|
2483
2482
|
WithdrawModal.displayName = "WithdrawModal";
|
|
2484
2483
|
|
|
2485
2484
|
// src/profile/index.tsx
|
|
2486
|
-
import { useState as
|
|
2487
|
-
import { useAggClient, useAggAuthState as useAggAuthState2,
|
|
2485
|
+
import { useState as useState4, useEffect as useEffect5, useCallback as useCallback3, useMemo as useMemo3 } from "react";
|
|
2486
|
+
import { useAggClient, useAggAuthState as useAggAuthState2, useVenueKeyStatus } from "@agg-build/hooks";
|
|
2488
2487
|
import { Venue } from "@agg-build/sdk";
|
|
2489
2488
|
|
|
2490
2489
|
// src/profile/profile-modal.constants.ts
|
|
2491
2490
|
var PROFILE_TAB_KEYS = {
|
|
2492
2491
|
PROFILE_ACCOUNTS: "profile-accounts",
|
|
2493
|
-
TRADING_ACCESS: "trading-access"
|
|
2494
|
-
BALANCE_MANAGEMENT: "balance-management"
|
|
2492
|
+
TRADING_ACCESS: "trading-access"
|
|
2495
2493
|
};
|
|
2496
|
-
var getProfileTabItems = (
|
|
2494
|
+
var getProfileTabItems = () => [
|
|
2497
2495
|
{
|
|
2498
2496
|
value: PROFILE_TAB_KEYS.PROFILE_ACCOUNTS,
|
|
2499
2497
|
label: "Profile & accounts",
|
|
2500
2498
|
icon: "profile-about-tab"
|
|
2501
2499
|
},
|
|
2502
|
-
{ value: PROFILE_TAB_KEYS.TRADING_ACCESS, label: "Trading access", icon: "shield-trust" }
|
|
2503
|
-
{
|
|
2504
|
-
value: PROFILE_TAB_KEYS.BALANCE_MANAGEMENT,
|
|
2505
|
-
label: balanceManagementLabel,
|
|
2506
|
-
icon: "bolt"
|
|
2507
|
-
}
|
|
2500
|
+
{ value: PROFILE_TAB_KEYS.TRADING_ACCESS, label: "Trading access", icon: "shield-trust" }
|
|
2508
2501
|
];
|
|
2509
2502
|
|
|
2510
2503
|
// src/profile/tabs/about-tab.tsx
|
|
@@ -2916,187 +2909,8 @@ var TradingAccessTab = ({
|
|
|
2916
2909
|
};
|
|
2917
2910
|
TradingAccessTab.displayName = "TradingAccessTab";
|
|
2918
2911
|
|
|
2919
|
-
// src/profile/tabs/balance-management-tab.tsx
|
|
2920
|
-
import { useEffect as useEffect5, useMemo as useMemo3, useState as useState4 } from "react";
|
|
2921
|
-
import { useAggLabels, useBalanceRefillPolicies } from "@agg-build/hooks";
|
|
2922
|
-
import { jsx as jsx20, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2923
|
-
var CHAIN_IDS_BY_NETWORK = {
|
|
2924
|
-
mainnet: 1,
|
|
2925
|
-
bnb: 56,
|
|
2926
|
-
polygon: 137,
|
|
2927
|
-
base: 8453,
|
|
2928
|
-
arbitrum: 42161,
|
|
2929
|
-
solana: 792703809,
|
|
2930
|
-
hyperliquid: 1337
|
|
2931
|
-
};
|
|
2932
|
-
var NETWORK_BY_CHAIN_ID = Object.fromEntries(
|
|
2933
|
-
Object.entries(CHAIN_IDS_BY_NETWORK).map(([network, chainId]) => [chainId, network])
|
|
2934
|
-
);
|
|
2935
|
-
var networkItems = SUPPORTED_NETWORKS.filter(
|
|
2936
|
-
(network) => network.value in CHAIN_IDS_BY_NETWORK
|
|
2937
|
-
).map((network) => ({
|
|
2938
|
-
value: network.value,
|
|
2939
|
-
label: network.label,
|
|
2940
|
-
iconUrl: network.iconUrl
|
|
2941
|
-
}));
|
|
2942
|
-
var dollarsToRaw = (amount) => String(Math.round(amount * 1e6));
|
|
2943
|
-
var rawToDollars = (amount) => Number(amount) / 1e6;
|
|
2944
|
-
var BalanceManagementTab = ({ enabled }) => {
|
|
2945
|
-
const labels = useAggLabels().balanceRefill;
|
|
2946
|
-
const { policies, isLoading, isError, createPolicy, updatePolicy } = useBalanceRefillPolicies({
|
|
2947
|
-
enabled
|
|
2948
|
-
});
|
|
2949
|
-
const policy = policies[0];
|
|
2950
|
-
const [network, setNetwork] = useState4("polygon");
|
|
2951
|
-
const [minimum, setMinimum] = useState4(100);
|
|
2952
|
-
const [refillAmount, setRefillAmount] = useState4(50);
|
|
2953
|
-
const [dailyCap, setDailyCap] = useState4(200);
|
|
2954
|
-
const [maximumFee, setMaximumFee] = useState4(2);
|
|
2955
|
-
const [feedback, setFeedback] = useState4(null);
|
|
2956
|
-
useEffect5(() => {
|
|
2957
|
-
var _a;
|
|
2958
|
-
if (!policy) return;
|
|
2959
|
-
setNetwork((_a = NETWORK_BY_CHAIN_ID[policy.targetChainId]) != null ? _a : "polygon");
|
|
2960
|
-
setMinimum(rawToDollars(policy.minimumRaw));
|
|
2961
|
-
setRefillAmount(rawToDollars(policy.refillAmountRaw));
|
|
2962
|
-
setDailyCap(rawToDollars(policy.dailyCapRaw));
|
|
2963
|
-
setMaximumFee(rawToDollars(policy.maxFeeRaw));
|
|
2964
|
-
}, [policy]);
|
|
2965
|
-
const validationError = useMemo3(() => {
|
|
2966
|
-
if (minimum <= 0 || refillAmount <= 0 || dailyCap <= 0 || maximumFee <= 0) {
|
|
2967
|
-
return labels.saveError;
|
|
2968
|
-
}
|
|
2969
|
-
if (dailyCap < Math.max(minimum, refillAmount) + maximumFee) {
|
|
2970
|
-
return labels.saveError;
|
|
2971
|
-
}
|
|
2972
|
-
return null;
|
|
2973
|
-
}, [dailyCap, labels.saveError, maximumFee, minimum, refillAmount]);
|
|
2974
|
-
const isPending = createPolicy.isPending || updatePolicy.isPending;
|
|
2975
|
-
const handleSave = () => __async(null, null, function* () {
|
|
2976
|
-
if (validationError) {
|
|
2977
|
-
setFeedback(validationError);
|
|
2978
|
-
return;
|
|
2979
|
-
}
|
|
2980
|
-
setFeedback(null);
|
|
2981
|
-
const params = {
|
|
2982
|
-
minimumRaw: dollarsToRaw(minimum),
|
|
2983
|
-
refillAmountRaw: dollarsToRaw(refillAmount),
|
|
2984
|
-
dailyCapRaw: dollarsToRaw(dailyCap),
|
|
2985
|
-
maxFeeRaw: dollarsToRaw(maximumFee)
|
|
2986
|
-
};
|
|
2987
|
-
try {
|
|
2988
|
-
if (policy) {
|
|
2989
|
-
yield updatePolicy.mutateAsync({ policyId: policy.id, params });
|
|
2990
|
-
} else {
|
|
2991
|
-
yield createPolicy.mutateAsync(__spreadProps(__spreadValues({}, params), {
|
|
2992
|
-
targetChainId: CHAIN_IDS_BY_NETWORK[network],
|
|
2993
|
-
targetTokenSymbol: "USDC"
|
|
2994
|
-
}));
|
|
2995
|
-
}
|
|
2996
|
-
setFeedback(labels.saved);
|
|
2997
|
-
} catch (e) {
|
|
2998
|
-
setFeedback(labels.saveError);
|
|
2999
|
-
}
|
|
3000
|
-
});
|
|
3001
|
-
const handleStatus = () => __async(null, null, function* () {
|
|
3002
|
-
if (!policy) return;
|
|
3003
|
-
try {
|
|
3004
|
-
yield updatePolicy.mutateAsync({
|
|
3005
|
-
policyId: policy.id,
|
|
3006
|
-
params: { status: policy.status === "enabled" ? "paused" : "enabled" }
|
|
3007
|
-
});
|
|
3008
|
-
setFeedback(labels.saved);
|
|
3009
|
-
} catch (e) {
|
|
3010
|
-
setFeedback(labels.saveError);
|
|
3011
|
-
}
|
|
3012
|
-
});
|
|
3013
|
-
if (isLoading)
|
|
3014
|
-
return /* @__PURE__ */ jsx20("p", { className: "text-agg-sm text-agg-secondary-foreground", children: labels.loading });
|
|
3015
|
-
if (isError)
|
|
3016
|
-
return /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-agg-sm text-agg-error", children: labels.loadError });
|
|
3017
|
-
const latestAttempt = policy == null ? void 0 : policy.latestAttempt;
|
|
3018
|
-
return /* @__PURE__ */ jsxs20("section", { className: "agg-balance-management-tab flex flex-col gap-6", children: [
|
|
3019
|
-
/* @__PURE__ */ jsxs20("div", { className: "flex flex-col gap-2", children: [
|
|
3020
|
-
/* @__PURE__ */ jsx20("h2", { className: "text-agg-lg font-agg-semibold text-agg-foreground", children: labels.title }),
|
|
3021
|
-
/* @__PURE__ */ jsx20("p", { className: "text-agg-sm text-agg-secondary-foreground", children: labels.description })
|
|
3022
|
-
] }),
|
|
3023
|
-
/* @__PURE__ */ jsxs20("div", { className: "rounded-agg-lg border border-agg-separator p-5 flex flex-col gap-5", children: [
|
|
3024
|
-
/* @__PURE__ */ jsxs20("label", { className: "flex flex-col gap-2 text-agg-sm text-agg-foreground", children: [
|
|
3025
|
-
/* @__PURE__ */ jsx20("span", { children: labels.networkLabel }),
|
|
3026
|
-
/* @__PURE__ */ jsx20(
|
|
3027
|
-
Select,
|
|
3028
|
-
{
|
|
3029
|
-
items: networkItems,
|
|
3030
|
-
value: network,
|
|
3031
|
-
onChange: (value) => setNetwork(value),
|
|
3032
|
-
ariaLabel: labels.networkLabel,
|
|
3033
|
-
disabled: Boolean(policy)
|
|
3034
|
-
}
|
|
3035
|
-
)
|
|
3036
|
-
] }),
|
|
3037
|
-
/* @__PURE__ */ jsx20("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
3038
|
-
[labels.minimumLabel, minimum, setMinimum],
|
|
3039
|
-
[labels.refillAmountLabel, refillAmount, setRefillAmount],
|
|
3040
|
-
[labels.dailyCapLabel, dailyCap, setDailyCap],
|
|
3041
|
-
[labels.maximumFeeLabel, maximumFee, setMaximumFee]
|
|
3042
|
-
].map(([label, value, onChange]) => /* @__PURE__ */ jsxs20(
|
|
3043
|
-
"label",
|
|
3044
|
-
{
|
|
3045
|
-
className: "flex flex-col gap-2 rounded-agg-md bg-agg-secondary px-4 py-3 text-agg-sm text-agg-foreground",
|
|
3046
|
-
children: [
|
|
3047
|
-
/* @__PURE__ */ jsx20("span", { children: label }),
|
|
3048
|
-
/* @__PURE__ */ jsx20(
|
|
3049
|
-
CurrencyInput,
|
|
3050
|
-
{
|
|
3051
|
-
value,
|
|
3052
|
-
onChange,
|
|
3053
|
-
min: 0.01,
|
|
3054
|
-
decimalPlaces: 2,
|
|
3055
|
-
ariaLabel: label,
|
|
3056
|
-
classNames: { input: "w-full text-agg-base font-agg-semibold" }
|
|
3057
|
-
}
|
|
3058
|
-
)
|
|
3059
|
-
]
|
|
3060
|
-
},
|
|
3061
|
-
label
|
|
3062
|
-
)) }),
|
|
3063
|
-
/* @__PURE__ */ jsx20("p", { className: "text-agg-xs text-agg-secondary-foreground", children: labels.consent }),
|
|
3064
|
-
policy ? /* @__PURE__ */ jsx20("p", { className: "text-agg-sm text-agg-secondary-foreground", children: policy.status === "enabled" ? labels.activeLabel : labels.pausedLabel }) : null,
|
|
3065
|
-
latestAttempt ? /* @__PURE__ */ jsxs20("p", { className: "text-agg-sm text-agg-secondary-foreground", children: [
|
|
3066
|
-
labels.lastRefill,
|
|
3067
|
-
": ",
|
|
3068
|
-
labels.statuses[latestAttempt.status]
|
|
3069
|
-
] }) : null,
|
|
3070
|
-
feedback ? /* @__PURE__ */ jsx20("p", { role: feedback === labels.saveError ? "alert" : "status", className: "text-agg-sm", children: feedback }) : null,
|
|
3071
|
-
/* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap gap-3", children: [
|
|
3072
|
-
/* @__PURE__ */ jsx20(
|
|
3073
|
-
Button,
|
|
3074
|
-
{
|
|
3075
|
-
variant: "primary",
|
|
3076
|
-
size: "large",
|
|
3077
|
-
isLoading: isPending,
|
|
3078
|
-
disabled: Boolean(validationError),
|
|
3079
|
-
onClick: () => void handleSave(),
|
|
3080
|
-
children: policy ? labels.saveAction : labels.enableAction
|
|
3081
|
-
}
|
|
3082
|
-
),
|
|
3083
|
-
policy ? /* @__PURE__ */ jsx20(
|
|
3084
|
-
Button,
|
|
3085
|
-
{
|
|
3086
|
-
variant: "secondary",
|
|
3087
|
-
size: "large",
|
|
3088
|
-
isLoading: isPending,
|
|
3089
|
-
onClick: () => void handleStatus(),
|
|
3090
|
-
children: policy.status === "enabled" ? labels.pauseAction : labels.resumeAction
|
|
3091
|
-
}
|
|
3092
|
-
) : null
|
|
3093
|
-
] })
|
|
3094
|
-
] })
|
|
3095
|
-
] });
|
|
3096
|
-
};
|
|
3097
|
-
|
|
3098
2912
|
// src/profile/index.tsx
|
|
3099
|
-
import { jsx as
|
|
2913
|
+
import { jsx as jsx20, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3100
2914
|
var ProfileModal = ({
|
|
3101
2915
|
open,
|
|
3102
2916
|
onOpenChange,
|
|
@@ -3121,30 +2935,26 @@ var ProfileModal = ({
|
|
|
3121
2935
|
}) => {
|
|
3122
2936
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
3123
2937
|
const client = useAggClient();
|
|
3124
|
-
const labels = useAggLabels2();
|
|
3125
2938
|
const { user } = useAggAuthState2();
|
|
3126
2939
|
const toastCtx = useOptionalToast();
|
|
3127
|
-
const [activeTab, setActiveTab] =
|
|
3128
|
-
const profileTabItems =
|
|
3129
|
-
() => getProfileTabItems(labels.balanceRefill.tabLabel),
|
|
3130
|
-
[labels.balanceRefill.tabLabel]
|
|
3131
|
-
);
|
|
2940
|
+
const [activeTab, setActiveTab] = useState4(PROFILE_TAB_KEYS.PROFILE_ACCOUNTS);
|
|
2941
|
+
const profileTabItems = useMemo3(() => getProfileTabItems(), []);
|
|
3132
2942
|
const resolvedInitialUsername = (_a = username != null ? username : user == null ? void 0 : user.username) != null ? _a : "";
|
|
3133
|
-
const [draftUsername, setDraftUsername] =
|
|
3134
|
-
const [draftAvatarFile, setDraftAvatarFile] =
|
|
3135
|
-
const [draftAvatarPreview, setDraftAvatarPreview] =
|
|
3136
|
-
const [isSaving, setIsSaving] =
|
|
3137
|
-
const [avatarTypeError, setAvatarTypeError] =
|
|
3138
|
-
const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] =
|
|
2943
|
+
const [draftUsername, setDraftUsername] = useState4(resolvedInitialUsername);
|
|
2944
|
+
const [draftAvatarFile, setDraftAvatarFile] = useState4();
|
|
2945
|
+
const [draftAvatarPreview, setDraftAvatarPreview] = useState4();
|
|
2946
|
+
const [isSaving, setIsSaving] = useState4(false);
|
|
2947
|
+
const [avatarTypeError, setAvatarTypeError] = useState4(null);
|
|
2948
|
+
const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] = useState4(false);
|
|
3139
2949
|
const { data: kalshiStatus, refetch: refetchKalshiStatus } = useVenueKeyStatus(
|
|
3140
2950
|
Venue.kalshi,
|
|
3141
2951
|
open
|
|
3142
2952
|
);
|
|
3143
|
-
|
|
2953
|
+
useEffect5(() => {
|
|
3144
2954
|
var _a2;
|
|
3145
2955
|
setDraftUsername((_a2 = username != null ? username : user == null ? void 0 : user.username) != null ? _a2 : "");
|
|
3146
2956
|
}, [username, user == null ? void 0 : user.username]);
|
|
3147
|
-
|
|
2957
|
+
useEffect5(() => {
|
|
3148
2958
|
if (open) return;
|
|
3149
2959
|
setIsConnectKalshiModalOpen(false);
|
|
3150
2960
|
}, [open]);
|
|
@@ -3268,7 +3078,7 @@ var ProfileModal = ({
|
|
|
3268
3078
|
yield refetchKalshiStatus();
|
|
3269
3079
|
onDisconnectExchange == null ? void 0 : onDisconnectExchange(Venue.kalshi);
|
|
3270
3080
|
}), [client, onDisconnectExchange, refetchKalshiStatus]);
|
|
3271
|
-
const resolvedVenueAccounts =
|
|
3081
|
+
const resolvedVenueAccounts = useMemo3(() => {
|
|
3272
3082
|
var _a2;
|
|
3273
3083
|
const nonKalshiAccounts = (_a2 = user == null ? void 0 : user.venueAccounts) == null ? void 0 : _a2.filter((account) => account.venue !== "kalshi");
|
|
3274
3084
|
if (!kalshiStatus) return user == null ? void 0 : user.venueAccounts;
|
|
@@ -3437,7 +3247,7 @@ var ProfileModal = ({
|
|
|
3437
3247
|
}),
|
|
3438
3248
|
[client, onDisconnectWallet, surfaceError]
|
|
3439
3249
|
);
|
|
3440
|
-
const providerActionMap =
|
|
3250
|
+
const providerActionMap = useMemo3(
|
|
3441
3251
|
() => ({
|
|
3442
3252
|
twitter: {
|
|
3443
3253
|
connect: () => {
|
|
@@ -3479,7 +3289,7 @@ var ProfileModal = ({
|
|
|
3479
3289
|
handleDisconnectTwitter
|
|
3480
3290
|
]
|
|
3481
3291
|
);
|
|
3482
|
-
const resolvedWallets =
|
|
3292
|
+
const resolvedWallets = useMemo3(() => {
|
|
3483
3293
|
var _a2, _b2;
|
|
3484
3294
|
if (wallets) return wallets;
|
|
3485
3295
|
const walletAccounts = (_b2 = (_a2 = user == null ? void 0 : user.accounts) == null ? void 0 : _a2.filter((account) => {
|
|
@@ -3498,8 +3308,8 @@ var ProfileModal = ({
|
|
|
3498
3308
|
};
|
|
3499
3309
|
});
|
|
3500
3310
|
}, [user == null ? void 0 : user.accounts, wallets]);
|
|
3501
|
-
return /* @__PURE__ */
|
|
3502
|
-
/* @__PURE__ */
|
|
3311
|
+
return /* @__PURE__ */ jsxs20(Modal, { open: open && !isConnectKalshiModalOpen, onOpenChange: handleOpenChange, children: [
|
|
3312
|
+
/* @__PURE__ */ jsxs20(
|
|
3503
3313
|
Modal.Container,
|
|
3504
3314
|
{
|
|
3505
3315
|
maxWidth: "800px",
|
|
@@ -3508,8 +3318,8 @@ var ProfileModal = ({
|
|
|
3508
3318
|
container: cn("agg-profile-modal", "min-h-[37.5rem]")
|
|
3509
3319
|
},
|
|
3510
3320
|
children: [
|
|
3511
|
-
/* @__PURE__ */
|
|
3512
|
-
/* @__PURE__ */
|
|
3321
|
+
/* @__PURE__ */ jsx20(Modal.Header, { title: "Edit Profile", classNames: { root: "agg-profile-modal-header" } }),
|
|
3322
|
+
/* @__PURE__ */ jsx20("div", { className: "agg-profile-tabs sm:hidden w-full", children: /* @__PURE__ */ jsx20(
|
|
3513
3323
|
Tabs,
|
|
3514
3324
|
{
|
|
3515
3325
|
className: "w-full [&>div]:w-full",
|
|
@@ -3518,14 +3328,14 @@ var ProfileModal = ({
|
|
|
3518
3328
|
items: profileTabItems.map((tab) => ({
|
|
3519
3329
|
value: tab.value,
|
|
3520
3330
|
label: tab.label,
|
|
3521
|
-
icon: /* @__PURE__ */
|
|
3331
|
+
icon: /* @__PURE__ */ jsx20(Icon, { name: tab.icon, size: "small" })
|
|
3522
3332
|
})),
|
|
3523
3333
|
value: activeTab,
|
|
3524
3334
|
onChange: (val) => setActiveTab(val)
|
|
3525
3335
|
}
|
|
3526
3336
|
) }),
|
|
3527
|
-
/* @__PURE__ */
|
|
3528
|
-
/* @__PURE__ */
|
|
3337
|
+
/* @__PURE__ */ jsx20(Modal.Body, { classNames: { root: cn("agg-profile-modal-body", "overflow-x-visible") }, children: /* @__PURE__ */ jsxs20("div", { className: "agg-profile-layout flex flex-col sm:flex-row sm:gap-10", children: [
|
|
3338
|
+
/* @__PURE__ */ jsx20("div", { className: "shrink-0", children: /* @__PURE__ */ jsx20(
|
|
3529
3339
|
"nav",
|
|
3530
3340
|
{
|
|
3531
3341
|
className: cn(
|
|
@@ -3541,7 +3351,7 @@ var ProfileModal = ({
|
|
|
3541
3351
|
"aria-label": "Profile sections",
|
|
3542
3352
|
children: profileTabItems.map((tab) => {
|
|
3543
3353
|
const isActive = activeTab === tab.value;
|
|
3544
|
-
return /* @__PURE__ */
|
|
3354
|
+
return /* @__PURE__ */ jsxs20(
|
|
3545
3355
|
"button",
|
|
3546
3356
|
{
|
|
3547
3357
|
type: "button",
|
|
@@ -3557,9 +3367,9 @@ var ProfileModal = ({
|
|
|
3557
3367
|
isActive ? "font-agg-normal text-agg-foreground bg-agg-secondary-hover" : "font-agg-normal text-agg-foreground"
|
|
3558
3368
|
),
|
|
3559
3369
|
children: [
|
|
3560
|
-
isActive ? /* @__PURE__ */
|
|
3561
|
-
/* @__PURE__ */
|
|
3562
|
-
/* @__PURE__ */
|
|
3370
|
+
isActive ? /* @__PURE__ */ jsx20("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-agg-primary" }) : null,
|
|
3371
|
+
/* @__PURE__ */ jsx20(Icon, { name: tab.icon, size: "small", color: "currentColor" }),
|
|
3372
|
+
/* @__PURE__ */ jsx20("span", { className: "shrink-0 whitespace-nowrap", children: tab.label })
|
|
3563
3373
|
]
|
|
3564
3374
|
},
|
|
3565
3375
|
tab.value
|
|
@@ -3567,9 +3377,9 @@ var ProfileModal = ({
|
|
|
3567
3377
|
})
|
|
3568
3378
|
}
|
|
3569
3379
|
) }),
|
|
3570
|
-
/* @__PURE__ */
|
|
3571
|
-
activeTab === PROFILE_TAB_KEYS.PROFILE_ACCOUNTS ? /* @__PURE__ */
|
|
3572
|
-
/* @__PURE__ */
|
|
3380
|
+
/* @__PURE__ */ jsxs20("div", { className: "agg-profile-content min-w-0 flex-1", children: [
|
|
3381
|
+
activeTab === PROFILE_TAB_KEYS.PROFILE_ACCOUNTS ? /* @__PURE__ */ jsxs20("div", { className: "agg-profile-accounts-tab flex flex-col gap-8", children: [
|
|
3382
|
+
/* @__PURE__ */ jsx20(
|
|
3573
3383
|
AboutTab,
|
|
3574
3384
|
{
|
|
3575
3385
|
username: username != null ? username : user == null ? void 0 : user.username,
|
|
@@ -3583,7 +3393,7 @@ var ProfileModal = ({
|
|
|
3583
3393
|
avatarError: avatarTypeError
|
|
3584
3394
|
}
|
|
3585
3395
|
),
|
|
3586
|
-
/* @__PURE__ */
|
|
3396
|
+
/* @__PURE__ */ jsx20(
|
|
3587
3397
|
AccountsWalletsTab,
|
|
3588
3398
|
{
|
|
3589
3399
|
socialAccounts: resolvedSocialAccounts,
|
|
@@ -3602,7 +3412,7 @@ var ProfileModal = ({
|
|
|
3602
3412
|
}
|
|
3603
3413
|
)
|
|
3604
3414
|
] }) : null,
|
|
3605
|
-
activeTab === PROFILE_TAB_KEYS.TRADING_ACCESS ? /* @__PURE__ */
|
|
3415
|
+
activeTab === PROFILE_TAB_KEYS.TRADING_ACCESS ? /* @__PURE__ */ jsx20(
|
|
3606
3416
|
TradingAccessTab,
|
|
3607
3417
|
{
|
|
3608
3418
|
venueAccounts: resolvedVenueAccounts,
|
|
@@ -3610,22 +3420,12 @@ var ProfileModal = ({
|
|
|
3610
3420
|
onDisconnectKalshi: handleDisconnectKalshi,
|
|
3611
3421
|
onKycError
|
|
3612
3422
|
}
|
|
3613
|
-
) : null
|
|
3614
|
-
activeTab === PROFILE_TAB_KEYS.BALANCE_MANAGEMENT ? /* @__PURE__ */ jsx21(BalanceManagementTab, { enabled: open }) : null
|
|
3423
|
+
) : null
|
|
3615
3424
|
] })
|
|
3616
3425
|
] }) }),
|
|
3617
|
-
|
|
3618
|
-
/* @__PURE__ */
|
|
3619
|
-
|
|
3620
|
-
{
|
|
3621
|
-
variant: "secondary",
|
|
3622
|
-
size: "large",
|
|
3623
|
-
onClick: handleCancel,
|
|
3624
|
-
className: "min-w-[120px]",
|
|
3625
|
-
children: "Cancel"
|
|
3626
|
-
}
|
|
3627
|
-
),
|
|
3628
|
-
/* @__PURE__ */ jsx21(
|
|
3426
|
+
/* @__PURE__ */ jsxs20(Modal.Footer, { classNames: { root: "agg-profile-modal-footer" }, children: [
|
|
3427
|
+
/* @__PURE__ */ jsx20(Button, { variant: "secondary", size: "large", onClick: handleCancel, className: "min-w-[120px]", children: "Cancel" }),
|
|
3428
|
+
/* @__PURE__ */ jsx20(
|
|
3629
3429
|
Button,
|
|
3630
3430
|
{
|
|
3631
3431
|
variant: "primary",
|
|
@@ -3640,7 +3440,7 @@ var ProfileModal = ({
|
|
|
3640
3440
|
]
|
|
3641
3441
|
}
|
|
3642
3442
|
),
|
|
3643
|
-
/* @__PURE__ */
|
|
3443
|
+
/* @__PURE__ */ jsx20(
|
|
3644
3444
|
ConnectKalshiModal,
|
|
3645
3445
|
{
|
|
3646
3446
|
open: open && isConnectKalshiModalOpen,
|
|
@@ -3655,7 +3455,7 @@ ProfileModal.displayName = "ProfileModal";
|
|
|
3655
3455
|
// src/geo-block-modal/index.tsx
|
|
3656
3456
|
import { useLabels as useLabels17 } from "@agg-build/hooks";
|
|
3657
3457
|
import { useCallback as useCallback4 } from "react";
|
|
3658
|
-
import { jsx as
|
|
3458
|
+
import { jsx as jsx21, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3659
3459
|
var GeoBlockModal = ({
|
|
3660
3460
|
open,
|
|
3661
3461
|
onOpenChange,
|
|
@@ -3667,19 +3467,19 @@ var GeoBlockModal = ({
|
|
|
3667
3467
|
onConfirm == null ? void 0 : onConfirm();
|
|
3668
3468
|
onOpenChange(false);
|
|
3669
3469
|
}, [onConfirm, onOpenChange]);
|
|
3670
|
-
return /* @__PURE__ */
|
|
3470
|
+
return /* @__PURE__ */ jsx21(
|
|
3671
3471
|
Modal,
|
|
3672
3472
|
{
|
|
3673
3473
|
open,
|
|
3674
3474
|
onOpenChange,
|
|
3675
3475
|
"aria-label": labels.trading.geoBlockModalAriaLabel,
|
|
3676
|
-
children: /* @__PURE__ */
|
|
3476
|
+
children: /* @__PURE__ */ jsxs21(
|
|
3677
3477
|
Modal.Container,
|
|
3678
3478
|
{
|
|
3679
3479
|
maxWidth: "480px",
|
|
3680
3480
|
classNames: { container: cn("!rounded-agg-2xl", classNames == null ? void 0 : classNames.container) },
|
|
3681
3481
|
children: [
|
|
3682
|
-
/* @__PURE__ */
|
|
3482
|
+
/* @__PURE__ */ jsx21(
|
|
3683
3483
|
Modal.Header,
|
|
3684
3484
|
{
|
|
3685
3485
|
title: "",
|
|
@@ -3691,19 +3491,19 @@ var GeoBlockModal = ({
|
|
|
3691
3491
|
}
|
|
3692
3492
|
}
|
|
3693
3493
|
),
|
|
3694
|
-
/* @__PURE__ */
|
|
3695
|
-
/* @__PURE__ */
|
|
3494
|
+
/* @__PURE__ */ jsx21(Modal.Body, { classNames: { root: cn("!px-10 !pt-0 !pb-12", classNames == null ? void 0 : classNames.body) }, children: /* @__PURE__ */ jsxs21("div", { className: "flex flex-col items-center gap-8", children: [
|
|
3495
|
+
/* @__PURE__ */ jsx21(
|
|
3696
3496
|
Icon,
|
|
3697
3497
|
{
|
|
3698
3498
|
name: "internet-security",
|
|
3699
3499
|
className: "h-[60px] w-[60px] text-agg-muted-foreground"
|
|
3700
3500
|
}
|
|
3701
3501
|
),
|
|
3702
|
-
/* @__PURE__ */
|
|
3703
|
-
/* @__PURE__ */
|
|
3704
|
-
/* @__PURE__ */
|
|
3502
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex flex-col items-center gap-3 text-center", children: [
|
|
3503
|
+
/* @__PURE__ */ jsx21("h2", { className: "text-agg-2xl font-agg-bold leading-agg-8 text-agg-foreground", children: labels.trading.geoBlockModalTitle }),
|
|
3504
|
+
/* @__PURE__ */ jsx21("p", { className: "text-agg-base font-agg-normal leading-agg-6 text-agg-foreground", children: labels.trading.geoBlockModalDescription })
|
|
3705
3505
|
] }),
|
|
3706
|
-
/* @__PURE__ */
|
|
3506
|
+
/* @__PURE__ */ jsx21(
|
|
3707
3507
|
Button,
|
|
3708
3508
|
{
|
|
3709
3509
|
variant: "secondary",
|