@agg-build/ui 4.15.0 → 4.17.2
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-UFU5HUHC.mjs → chunk-3Y2GCNVL.mjs} +100 -52
- package/dist/{chunk-HK4DEG4E.mjs → chunk-7E4UXCEX.mjs} +223 -169
- package/dist/{chunk-QQ2Q75BF.mjs → chunk-B5ALKYD5.mjs} +210 -184
- package/dist/{chunk-U6ANP4P5.mjs → chunk-BBDFSTIA.mjs} +6 -2
- package/dist/{chunk-MR6AORPA.mjs → chunk-JI5KV4QI.mjs} +4 -3
- package/dist/{chunk-BTQGP257.mjs → chunk-RZLM3M5R.mjs} +2 -2
- package/dist/{chunk-2OQCZNGY.mjs → chunk-TK62UB5F.mjs} +27 -16
- package/dist/events.js +32 -17
- package/dist/events.mjs +3 -3
- package/dist/index.js +1038 -922
- package/dist/index.mjs +9 -38
- package/dist/modals.js +214 -185
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +817 -675
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +6 -2
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +535 -442
- package/dist/trading.mjs +4 -4
- package/dist/types/auth/connect-button-view/connect-button-view.types.d.mts +0 -2
- package/dist/types/auth/connect-button-view/connect-button-view.types.d.ts +0 -2
- package/dist/types/auth/connect-button-view/index.d.mts +1 -1
- package/dist/types/auth/connect-button-view/index.d.ts +1 -1
- package/dist/types/pages/user-profile/components/available-balance-card.d.mts +3 -1
- package/dist/types/pages/user-profile/components/available-balance-card.d.ts +3 -1
- package/dist/types/pages/user-profile/user-profile.types.d.mts +8 -0
- package/dist/types/pages/user-profile/user-profile.types.d.ts +8 -0
- package/dist/types/primitives/modal/index.d.mts +1 -1
- package/dist/types/primitives/modal/index.d.ts +1 -1
- package/dist/types/primitives/modal/modal.types.d.mts +6 -0
- package/dist/types/primitives/modal/modal.types.d.ts +6 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +12 -1
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +12 -1
- package/package.json +3 -3
package/dist/trading.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useClaimWinnings,
|
|
15
15
|
useResolvedMarketClaim,
|
|
16
16
|
venueRequiresSharedKyc
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7E4UXCEX.mjs";
|
|
18
18
|
import {
|
|
19
19
|
SETTLEMENT_SECTION_ID,
|
|
20
20
|
Settlement,
|
|
@@ -32,9 +32,9 @@ import {
|
|
|
32
32
|
prepareSettlementDifferences,
|
|
33
33
|
resolveDifferenceIconClassName,
|
|
34
34
|
useEventTradingContext
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-TK62UB5F.mjs";
|
|
36
|
+
import "./chunk-B5ALKYD5.mjs";
|
|
37
|
+
import "./chunk-BBDFSTIA.mjs";
|
|
38
38
|
export {
|
|
39
39
|
FundKalshiModal,
|
|
40
40
|
PlaceOrder,
|
|
@@ -104,8 +104,6 @@ export type AuthConnectButtonViewProps = {
|
|
|
104
104
|
totalBalance: number;
|
|
105
105
|
/** Aggregated positions value shown in the connected state. */
|
|
106
106
|
positionsBalance: number;
|
|
107
|
-
/** Off-chain Kalshi cash balance in dollars. Null when no venue balance is available. */
|
|
108
|
-
kalshiBalance?: number | null;
|
|
109
107
|
/** Number of closed positions currently eligible to claim. */
|
|
110
108
|
claimReadyCount?: number;
|
|
111
109
|
/** Called when user clicks the claim-winnings action in the indicator tooltip. */
|
|
@@ -104,8 +104,6 @@ export type AuthConnectButtonViewProps = {
|
|
|
104
104
|
totalBalance: number;
|
|
105
105
|
/** Aggregated positions value shown in the connected state. */
|
|
106
106
|
positionsBalance: number;
|
|
107
|
-
/** Off-chain Kalshi cash balance in dollars. Null when no venue balance is available. */
|
|
108
|
-
kalshiBalance?: number | null;
|
|
109
107
|
/** Number of closed positions currently eligible to claim. */
|
|
110
108
|
claimReadyCount?: number;
|
|
111
109
|
/** Called when user clicks the claim-winnings action in the indicator tooltip. */
|
|
@@ -2,6 +2,6 @@ import type { JSX } from "react";
|
|
|
2
2
|
import type { AuthConnectButtonViewProps } from "./connect-button-view.types";
|
|
3
3
|
export type { AuthConnectButtonViewButtonProps, AuthConnectButtonViewClassNames, AuthConnectButtonViewMethod, AuthConnectButtonViewMethodInput, AuthConnectButtonViewProps, } from "./connect-button-view.types";
|
|
4
4
|
export declare const AuthConnectButtonView: {
|
|
5
|
-
({ activeMethodId, addressLabel, buttonProps, challengeContent, classNames, disabled, emailMethod, emailError, emailValue, errorMessage, isAuthenticated, isBalanceLoading, isBusy, isChooserOpen, isProfileMenuOpen, notice, onChooserOpenChange, onDepositClick, onDisconnectClick, onEmailChange, onEmailSubmit, onMethodSelect, onProfileCardClick, onProfileClick, onProfileMenuOpenChange, socialMethods, onWithdrawClick, profileLabel, totalBalance, positionsBalance,
|
|
5
|
+
({ activeMethodId, addressLabel, buttonProps, challengeContent, classNames, disabled, emailMethod, emailError, emailValue, errorMessage, isAuthenticated, isBalanceLoading, isBusy, isChooserOpen, isProfileMenuOpen, notice, onChooserOpenChange, onDepositClick, onDisconnectClick, onEmailChange, onEmailSubmit, onMethodSelect, onProfileCardClick, onProfileClick, onProfileMenuOpenChange, socialMethods, onWithdrawClick, profileLabel, totalBalance, positionsBalance, claimReadyCount, onClaimWinningsClick, walletMethods, isDepositBlocked, }: AuthConnectButtonViewProps): JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
7
|
};
|
|
@@ -2,6 +2,6 @@ import type { JSX } from "react";
|
|
|
2
2
|
import type { AuthConnectButtonViewProps } from "./connect-button-view.types";
|
|
3
3
|
export type { AuthConnectButtonViewButtonProps, AuthConnectButtonViewClassNames, AuthConnectButtonViewMethod, AuthConnectButtonViewMethodInput, AuthConnectButtonViewProps, } from "./connect-button-view.types";
|
|
4
4
|
export declare const AuthConnectButtonView: {
|
|
5
|
-
({ activeMethodId, addressLabel, buttonProps, challengeContent, classNames, disabled, emailMethod, emailError, emailValue, errorMessage, isAuthenticated, isBalanceLoading, isBusy, isChooserOpen, isProfileMenuOpen, notice, onChooserOpenChange, onDepositClick, onDisconnectClick, onEmailChange, onEmailSubmit, onMethodSelect, onProfileCardClick, onProfileClick, onProfileMenuOpenChange, socialMethods, onWithdrawClick, profileLabel, totalBalance, positionsBalance,
|
|
5
|
+
({ activeMethodId, addressLabel, buttonProps, challengeContent, classNames, disabled, emailMethod, emailError, emailValue, errorMessage, isAuthenticated, isBalanceLoading, isBusy, isChooserOpen, isProfileMenuOpen, notice, onChooserOpenChange, onDepositClick, onDisconnectClick, onEmailChange, onEmailSubmit, onMethodSelect, onProfileCardClick, onProfileClick, onProfileMenuOpenChange, socialMethods, onWithdrawClick, profileLabel, totalBalance, positionsBalance, claimReadyCount, onClaimWinningsClick, walletMethods, isDepositBlocked, }: AuthConnectButtonViewProps): JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
7
|
};
|
|
@@ -10,6 +10,8 @@ type AvailableBalanceCardProps = {
|
|
|
10
10
|
label?: string;
|
|
11
11
|
valueLabel: string;
|
|
12
12
|
reservedValueLabel?: string;
|
|
13
|
+
/** Kalshi cash balance. Kalshi holds funds off-chain, so it gets its own row. */
|
|
14
|
+
kalshiValueLabel?: string;
|
|
13
15
|
chains: ChainRow[];
|
|
14
16
|
isLoading?: boolean;
|
|
15
17
|
className?: string;
|
|
@@ -22,7 +24,7 @@ export declare const venueLogosForChain: (chainId: string | number) => VenueLogo
|
|
|
22
24
|
export declare const isVenueBalanceChain: (chainId: string | number) => boolean;
|
|
23
25
|
export declare const chainIconUrl: (label: string, key?: string) => string | undefined;
|
|
24
26
|
export declare const AvailableBalanceCard: {
|
|
25
|
-
({ label, valueLabel, reservedValueLabel, chains, isLoading, className, onManage, manageButtonRef, }: AvailableBalanceCardProps): JSX.Element;
|
|
27
|
+
({ label, valueLabel, reservedValueLabel, kalshiValueLabel, chains, isLoading, className, onManage, manageButtonRef, }: AvailableBalanceCardProps): JSX.Element;
|
|
26
28
|
displayName: string;
|
|
27
29
|
};
|
|
28
30
|
export {};
|
|
@@ -10,6 +10,8 @@ type AvailableBalanceCardProps = {
|
|
|
10
10
|
label?: string;
|
|
11
11
|
valueLabel: string;
|
|
12
12
|
reservedValueLabel?: string;
|
|
13
|
+
/** Kalshi cash balance. Kalshi holds funds off-chain, so it gets its own row. */
|
|
14
|
+
kalshiValueLabel?: string;
|
|
13
15
|
chains: ChainRow[];
|
|
14
16
|
isLoading?: boolean;
|
|
15
17
|
className?: string;
|
|
@@ -22,7 +24,7 @@ export declare const venueLogosForChain: (chainId: string | number) => VenueLogo
|
|
|
22
24
|
export declare const isVenueBalanceChain: (chainId: string | number) => boolean;
|
|
23
25
|
export declare const chainIconUrl: (label: string, key?: string) => string | undefined;
|
|
24
26
|
export declare const AvailableBalanceCard: {
|
|
25
|
-
({ label, valueLabel, reservedValueLabel, chains, isLoading, className, onManage, manageButtonRef, }: AvailableBalanceCardProps): JSX.Element;
|
|
27
|
+
({ label, valueLabel, reservedValueLabel, kalshiValueLabel, chains, isLoading, className, onManage, manageButtonRef, }: AvailableBalanceCardProps): JSX.Element;
|
|
26
28
|
displayName: string;
|
|
27
29
|
};
|
|
28
30
|
export {};
|
|
@@ -249,10 +249,18 @@ export interface UserProfileOpenOrder {
|
|
|
249
249
|
title: string;
|
|
250
250
|
/** Outcome name for the pill, e.g. "Yes" */
|
|
251
251
|
outcomeLabel: string;
|
|
252
|
+
/** Order side. Renders as a "Buy"/"Sell" prefix on the outcome pill. */
|
|
253
|
+
side?: "buy" | "sell";
|
|
252
254
|
/** Venue logo for the market */
|
|
253
255
|
venue: VenueLogoName;
|
|
254
256
|
/** Limit price label, e.g. "21.6¢" */
|
|
255
257
|
limitPriceLabel?: string;
|
|
258
|
+
/**
|
|
259
|
+
* Current market price for this outcome, without the "now" prefix, e.g. "25¢".
|
|
260
|
+
* Omitted when no live price is available — the row then shows the limit price
|
|
261
|
+
* alone rather than a stale or guessed mark.
|
|
262
|
+
*/
|
|
263
|
+
currentPriceLabel?: string;
|
|
256
264
|
/** Filled-out-of-total label, e.g. "0/150" */
|
|
257
265
|
filledLabel: string;
|
|
258
266
|
/** Total notional label, e.g. "$25.86" */
|
|
@@ -249,10 +249,18 @@ export interface UserProfileOpenOrder {
|
|
|
249
249
|
title: string;
|
|
250
250
|
/** Outcome name for the pill, e.g. "Yes" */
|
|
251
251
|
outcomeLabel: string;
|
|
252
|
+
/** Order side. Renders as a "Buy"/"Sell" prefix on the outcome pill. */
|
|
253
|
+
side?: "buy" | "sell";
|
|
252
254
|
/** Venue logo for the market */
|
|
253
255
|
venue: VenueLogoName;
|
|
254
256
|
/** Limit price label, e.g. "21.6¢" */
|
|
255
257
|
limitPriceLabel?: string;
|
|
258
|
+
/**
|
|
259
|
+
* Current market price for this outcome, without the "now" prefix, e.g. "25¢".
|
|
260
|
+
* Omitted when no live price is available — the row then shows the limit price
|
|
261
|
+
* alone rather than a stale or guessed mark.
|
|
262
|
+
*/
|
|
263
|
+
currentPriceLabel?: string;
|
|
256
264
|
/** Filled-out-of-total label, e.g. "0/150" */
|
|
257
265
|
filledLabel: string;
|
|
258
266
|
/** Total notional label, e.g. "$25.86" */
|
|
@@ -3,7 +3,7 @@ export type { ModalBodyClassNames, ModalBodyProps, ModalContainerClassNames, Mod
|
|
|
3
3
|
/** Composes the modal root wrapper using Radix dialog primitives. */
|
|
4
4
|
export declare const Modal: {
|
|
5
5
|
({ open, onOpenChange, children, "aria-label": _ariaLabel, "aria-labelledby": _ariaLabelledBy, }: ModalProps): JSX.Element;
|
|
6
|
-
Container: ({ children, maxWidth, classNames, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, }: ModalContainerProps) => JSX.Element;
|
|
6
|
+
Container: ({ children, maxWidth, classNames, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, onOpenAutoFocus, }: ModalContainerProps) => JSX.Element;
|
|
7
7
|
Header: ({ title, subtitle, leftElement, rightElement, hideClose, closeIcon, classNames, children, hideBorder, }: ModalHeaderProps) => JSX.Element;
|
|
8
8
|
Body: ({ children, classNames }: ModalBodyProps) => JSX.Element;
|
|
9
9
|
Footer: ({ children, classNames, hideBorder, }: ModalFooterProps) => JSX.Element;
|
|
@@ -3,7 +3,7 @@ export type { ModalBodyClassNames, ModalBodyProps, ModalContainerClassNames, Mod
|
|
|
3
3
|
/** Composes the modal root wrapper using Radix dialog primitives. */
|
|
4
4
|
export declare const Modal: {
|
|
5
5
|
({ open, onOpenChange, children, "aria-label": _ariaLabel, "aria-labelledby": _ariaLabelledBy, }: ModalProps): JSX.Element;
|
|
6
|
-
Container: ({ children, maxWidth, classNames, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, }: ModalContainerProps) => JSX.Element;
|
|
6
|
+
Container: ({ children, maxWidth, classNames, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, onOpenAutoFocus, }: ModalContainerProps) => JSX.Element;
|
|
7
7
|
Header: ({ title, subtitle, leftElement, rightElement, hideClose, closeIcon, classNames, children, hideBorder, }: ModalHeaderProps) => JSX.Element;
|
|
8
8
|
Body: ({ children, classNames }: ModalBodyProps) => JSX.Element;
|
|
9
9
|
Footer: ({ children, classNames, hideBorder, }: ModalFooterProps) => JSX.Element;
|
|
@@ -33,6 +33,12 @@ export interface ModalContainerProps {
|
|
|
33
33
|
"aria-label"?: string;
|
|
34
34
|
/** ID of the element that labels the dialog shell. */
|
|
35
35
|
"aria-labelledby"?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Runs when the dialog takes focus on open. Call `preventDefault()` to stop
|
|
38
|
+
* Radix focusing the first tabbable element and place focus yourself — without
|
|
39
|
+
* it the two compete and whichever lands last wins.
|
|
40
|
+
*/
|
|
41
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
36
42
|
}
|
|
37
43
|
export interface ModalHeaderClassNames {
|
|
38
44
|
root?: string;
|
|
@@ -33,6 +33,12 @@ export interface ModalContainerProps {
|
|
|
33
33
|
"aria-label"?: string;
|
|
34
34
|
/** ID of the element that labels the dialog shell. */
|
|
35
35
|
"aria-labelledby"?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Runs when the dialog takes focus on open. Call `preventDefault()` to stop
|
|
38
|
+
* Radix focusing the first tabbable element and place focus yourself — without
|
|
39
|
+
* it the two compete and whichever lands last wins.
|
|
40
|
+
*/
|
|
41
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
36
42
|
}
|
|
37
43
|
export interface ModalHeaderClassNames {
|
|
38
44
|
root?: string;
|
|
@@ -115,7 +115,18 @@ export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, event
|
|
|
115
115
|
* "ok" + real quoteId) sits in the same response — default to that solo so a
|
|
116
116
|
* Kalshi-funded user with no on-chain balance lands on a submittable route.
|
|
117
117
|
*/
|
|
118
|
-
|
|
118
|
+
/** Whether executing this route needs a Kalshi account, alone or as a split leg. */
|
|
119
|
+
export declare const routeCardRequiresKalshi: (card: PlaceOrderRouteCard) => boolean;
|
|
120
|
+
export declare const resolveDefaultRouteCardId: (routeCards: PlaceOrderRouteCard[], primaryStatus?: SmartRouteResponse["status"], options?: {
|
|
121
|
+
/**
|
|
122
|
+
* The user has no Kalshi account connected. Kalshi routes stay selectable,
|
|
123
|
+
* but the default skips to the best route that does not need Kalshi — even
|
|
124
|
+
* one that cannot execute yet (e.g. no balance), since a Kalshi route cannot
|
|
125
|
+
* execute either until the user connects. Kalshi is the default only when
|
|
126
|
+
* every route needs it.
|
|
127
|
+
*/
|
|
128
|
+
isKalshiDisconnected?: boolean;
|
|
129
|
+
}) => string | null;
|
|
119
130
|
/** Stable identity for preserving only an explicit venue choice across quote-ID refreshes. */
|
|
120
131
|
export declare const getPlaceOrderRouteCardIdentity: (card: PlaceOrderRouteCard) => string;
|
|
121
132
|
export declare const clampSellSharesToAvailability: (requestedSellShares: number, availableShares: number) => number;
|
|
@@ -115,7 +115,18 @@ export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, event
|
|
|
115
115
|
* "ok" + real quoteId) sits in the same response — default to that solo so a
|
|
116
116
|
* Kalshi-funded user with no on-chain balance lands on a submittable route.
|
|
117
117
|
*/
|
|
118
|
-
|
|
118
|
+
/** Whether executing this route needs a Kalshi account, alone or as a split leg. */
|
|
119
|
+
export declare const routeCardRequiresKalshi: (card: PlaceOrderRouteCard) => boolean;
|
|
120
|
+
export declare const resolveDefaultRouteCardId: (routeCards: PlaceOrderRouteCard[], primaryStatus?: SmartRouteResponse["status"], options?: {
|
|
121
|
+
/**
|
|
122
|
+
* The user has no Kalshi account connected. Kalshi routes stay selectable,
|
|
123
|
+
* but the default skips to the best route that does not need Kalshi — even
|
|
124
|
+
* one that cannot execute yet (e.g. no balance), since a Kalshi route cannot
|
|
125
|
+
* execute either until the user connects. Kalshi is the default only when
|
|
126
|
+
* every route needs it.
|
|
127
|
+
*/
|
|
128
|
+
isKalshiDisconnected?: boolean;
|
|
129
|
+
}) => string | null;
|
|
119
130
|
/** Stable identity for preserving only an explicit venue choice across quote-ID refreshes. */
|
|
120
131
|
export declare const getPlaceOrderRouteCardIdentity: (card: PlaceOrderRouteCard) => string;
|
|
121
132
|
export declare const clampSellSharesToAvailability: (requestedSellShares: number, availableShares: number) => number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agg-build/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.17.2",
|
|
4
4
|
"description": "Pre-built React component library for the AGG prediction market aggregator. Tailwind-based, themeable, with primitives, event surfaces, trading flows, full pages, and modals.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
"liveline": "^0.0.7",
|
|
101
101
|
"react": "^18.0.0 || ^19.0.0",
|
|
102
102
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
103
|
-
"@agg-build/hooks": "^4.
|
|
104
|
-
"@agg-build/sdk": "^4.
|
|
103
|
+
"@agg-build/hooks": "^4.17.2",
|
|
104
|
+
"@agg-build/sdk": "^4.17.1"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
107
|
"@number-flow/react": "^0.6.0",
|