@agg-build/ui 4.2.0 → 4.7.1

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.
Files changed (74) hide show
  1. package/README.md +25 -16
  2. package/dist/{chunk-DNPDXL2D.mjs → chunk-3RQCBGIK.mjs} +341 -105
  3. package/dist/{chunk-GNEFI4SO.mjs → chunk-C4GFVJ62.mjs} +725 -400
  4. package/dist/{chunk-UDBHAZJJ.mjs → chunk-EOLR7DHL.mjs} +568 -145
  5. package/dist/{chunk-6X6Y4INU.mjs → chunk-LXQ3U4X2.mjs} +2 -2
  6. package/dist/{chunk-QW7VFURU.mjs → chunk-RDBMHBR2.mjs} +67 -3
  7. package/dist/{chunk-WDCH4RRS.mjs → chunk-WYCSTAN7.mjs} +1 -1
  8. package/dist/{chunk-FTL25XKE.mjs → chunk-XN2NB2NP.mjs} +1 -1
  9. package/dist/events.js +1149 -661
  10. package/dist/events.mjs +6 -4
  11. package/dist/index.js +3320 -2291
  12. package/dist/index.mjs +12 -8
  13. package/dist/modals.js +9 -2
  14. package/dist/modals.mjs +3 -3
  15. package/dist/pages.js +2789 -1762
  16. package/dist/pages.mjs +8 -6
  17. package/dist/primitives.js +30 -3
  18. package/dist/primitives.mjs +1 -1
  19. package/dist/styles.css +1 -1
  20. package/dist/tailwind.css +1 -1
  21. package/dist/trading.js +338 -102
  22. package/dist/trading.mjs +4 -4
  23. package/dist/types/events/index.d.mts +1 -0
  24. package/dist/types/events/index.d.ts +1 -0
  25. package/dist/types/events/item-details/event-list-item-details-market-selector.d.mts +4 -1
  26. package/dist/types/events/item-details/event-list-item-details-market-selector.d.ts +4 -1
  27. package/dist/types/events/item-details/event-list-item-details.types.d.mts +25 -1
  28. package/dist/types/events/item-details/event-list-item-details.types.d.ts +25 -1
  29. package/dist/types/events/item-details/index.d.mts +1 -1
  30. package/dist/types/events/item-details/index.d.ts +1 -1
  31. package/dist/types/events/list/event-list.constants.d.mts +3 -1
  32. package/dist/types/events/list/event-list.constants.d.ts +3 -1
  33. package/dist/types/events/list/event-list.types.d.mts +17 -0
  34. package/dist/types/events/list/event-list.types.d.ts +17 -0
  35. package/dist/types/events/list/event-list.utils.d.mts +4 -0
  36. package/dist/types/events/list/event-list.utils.d.ts +4 -0
  37. package/dist/types/events/list/index.d.mts +2 -2
  38. package/dist/types/events/list/index.d.ts +2 -2
  39. package/dist/types/events/market-details/index.d.mts +1 -1
  40. package/dist/types/events/market-details/index.d.ts +1 -1
  41. package/dist/types/events/market-details/market-details.types.d.mts +4 -0
  42. package/dist/types/events/market-details/market-details.types.d.ts +4 -0
  43. package/dist/types/events/shared/format-event-title.d.mts +9 -1
  44. package/dist/types/events/shared/format-event-title.d.ts +9 -1
  45. package/dist/types/events/shared/format-sports-event-time.d.mts +2 -0
  46. package/dist/types/events/shared/format-sports-event-time.d.ts +2 -0
  47. package/dist/types/events/shared/sports-live-score.d.mts +10 -0
  48. package/dist/types/events/shared/sports-live-score.d.ts +10 -0
  49. package/dist/types/pages/event-market/event-market.types.d.mts +4 -0
  50. package/dist/types/pages/event-market/event-market.types.d.ts +4 -0
  51. package/dist/types/pages/event-market/index.d.mts +1 -0
  52. package/dist/types/pages/event-market/index.d.ts +1 -0
  53. package/dist/types/pages/home/event-discovery-url-state.d.mts +35 -0
  54. package/dist/types/pages/home/event-discovery-url-state.d.ts +35 -0
  55. package/dist/types/pages/user-profile/components/available-balance-card.d.mts +5 -0
  56. package/dist/types/pages/user-profile/components/available-balance-card.d.ts +5 -0
  57. package/dist/types/pages/user-profile/components/open-order-row.d.mts +1 -0
  58. package/dist/types/pages/user-profile/components/open-order-row.d.ts +1 -0
  59. package/dist/types/pages/user-profile/components/positions-activity.d.mts +1 -1
  60. package/dist/types/pages/user-profile/components/positions-activity.d.ts +1 -1
  61. package/dist/types/pages/user-profile/user-profile.types.d.mts +1 -1
  62. package/dist/types/pages/user-profile/user-profile.types.d.ts +1 -1
  63. package/dist/types/trading/place-order/index.d.mts +1 -1
  64. package/dist/types/trading/place-order/index.d.ts +1 -1
  65. package/dist/types/trading/place-order/index.place-order.execution-steps.d.mts +13 -1
  66. package/dist/types/trading/place-order/index.place-order.execution-steps.d.ts +13 -1
  67. package/dist/types/trading/place-order/index.place-order.execution-view.d.mts +2 -1
  68. package/dist/types/trading/place-order/index.place-order.execution-view.d.ts +2 -1
  69. package/dist/types/trading/place-order/index.place-order.types.d.mts +9 -0
  70. package/dist/types/trading/place-order/index.place-order.types.d.ts +9 -0
  71. package/dist/types/trading/place-order/index.place-order.utils.d.mts +6 -0
  72. package/dist/types/trading/place-order/index.place-order.utils.d.ts +6 -0
  73. package/package.json +3 -3
  74. /package/dist/{chunk-KHHFHXXD.mjs → chunk-JH4B3ZHQ.mjs} +0 -0
@@ -34,7 +34,7 @@ type PositionsActivityProps = {
34
34
  hasMoreOpenOrders?: boolean;
35
35
  isLoadingMoreOpenOrders?: boolean;
36
36
  onLoadMoreOpenOrders?: () => void;
37
- /** Whether the Open orders tab and its content are available. */
37
+ /** Whether the Open limit orders tab and its content are available. */
38
38
  showOpenOrders?: boolean;
39
39
  /**
40
40
  * Active tab. When provided, the component is controlled — `onTabChange` is
@@ -34,7 +34,7 @@ type PositionsActivityProps = {
34
34
  hasMoreOpenOrders?: boolean;
35
35
  isLoadingMoreOpenOrders?: boolean;
36
36
  onLoadMoreOpenOrders?: () => void;
37
- /** Whether the Open orders tab and its content are available. */
37
+ /** Whether the Open limit orders tab and its content are available. */
38
38
  showOpenOrders?: boolean;
39
39
  /**
40
40
  * Active tab. When provided, the component is controlled — `onTabChange` is
@@ -312,7 +312,7 @@ export interface UserProfilePageProps {
312
312
  tab?: UserProfileTabValue;
313
313
  /** Fires when the user clicks a tab. Use to reflect the change in your URL. */
314
314
  onTabChange?: (tab: UserProfileTabValue) => void;
315
- /** Open orders (resting / partially filled) */
315
+ /** Open limit orders (pending / resting / partially filled) */
316
316
  openOrders?: UserProfileOpenOrder[];
317
317
  /** Activity items */
318
318
  activities?: UserProfileActivity[];
@@ -312,7 +312,7 @@ export interface UserProfilePageProps {
312
312
  tab?: UserProfileTabValue;
313
313
  /** Fires when the user clicks a tab. Use to reflect the change in your URL. */
314
314
  onTabChange?: (tab: UserProfileTabValue) => void;
315
- /** Open orders (resting / partially filled) */
315
+ /** Open limit orders (pending / resting / partially filled) */
316
316
  openOrders?: UserProfileOpenOrder[];
317
317
  /** Activity items */
318
318
  activities?: UserProfileActivity[];
@@ -8,6 +8,6 @@ export type { PlaceOrderExecutionViewProps } from "./index.place-order.execution
8
8
  export type { ExecutionOrderGroup, ExecutionStep, ExecutionStepKind, ExecutionStepStatus, } from "./index.place-order.execution-steps";
9
9
  export type { PlaceOrderClassNames, PlaceOrderExecutionSummary, PlaceOrderResolvedClaimSummary, PlaceOrderTradingLabels, } from "./index.place-order.types";
10
10
  export declare const PlaceOrder: {
11
- ({ className, classNames, eventTradingState, executionMode, isLoading, isPrimaryActionDisabled, isPrimaryActionLoading, isQuotePanelActive, chainBalancesOverride, onAmountChange, onClose, onConnectKalshi, onOutcomeChange, onPrimaryAction, onBeforePrimaryAction, onTabChange, onSuccess, onError, onExecutionStateChange, resolvedClaim, midpointsResult, }: PlaceOrderProps): JSX.Element;
11
+ ({ className, classNames, eventTradingState, executionMode, isLoading, isPrimaryActionDisabled, isPrimaryActionLoading, isQuotePanelActive, chainBalancesOverride, onAmountChange, onClose, onConnectKalshi, onOutcomeChange, onPrimaryAction, onBeforePrimaryAction, onTabChange, onSuccess, onError, onExecutionStateChange, resolvedClaim, showResolvingState, midpointsResult, }: PlaceOrderProps): JSX.Element;
12
12
  displayName: string;
13
13
  };
@@ -8,6 +8,6 @@ export type { PlaceOrderExecutionViewProps } from "./index.place-order.execution
8
8
  export type { ExecutionOrderGroup, ExecutionStep, ExecutionStepKind, ExecutionStepStatus, } from "./index.place-order.execution-steps";
9
9
  export type { PlaceOrderClassNames, PlaceOrderExecutionSummary, PlaceOrderResolvedClaimSummary, PlaceOrderTradingLabels, } from "./index.place-order.types";
10
10
  export declare const PlaceOrder: {
11
- ({ className, classNames, eventTradingState, executionMode, isLoading, isPrimaryActionDisabled, isPrimaryActionLoading, isQuotePanelActive, chainBalancesOverride, onAmountChange, onClose, onConnectKalshi, onOutcomeChange, onPrimaryAction, onBeforePrimaryAction, onTabChange, onSuccess, onError, onExecutionStateChange, resolvedClaim, midpointsResult, }: PlaceOrderProps): JSX.Element;
11
+ ({ className, classNames, eventTradingState, executionMode, isLoading, isPrimaryActionDisabled, isPrimaryActionLoading, isQuotePanelActive, chainBalancesOverride, onAmountChange, onClose, onConnectKalshi, onOutcomeChange, onPrimaryAction, onBeforePrimaryAction, onTabChange, onSuccess, onError, onExecutionStateChange, resolvedClaim, showResolvingState, midpointsResult, }: PlaceOrderProps): JSX.Element;
12
12
  displayName: string;
13
13
  };
@@ -2,7 +2,7 @@ import type { ExecutionRawStepProgress, ExecutionTerminalOrderEvent } from "@agg
2
2
  import type { ExecutionStatusOrder, ExecutionStatusStep, SmartRouteResponse } from "@agg-build/sdk";
3
3
  import { type PlaceOrderTab, type TradingVenue } from "../types";
4
4
  import type { PlaceOrderTradingLabels } from "./index.place-order.types";
5
- export type ExecutionStepStatus = "not-started" | "loading" | "done";
5
+ export type ExecutionStepStatus = "not-started" | "loading" | "done" | "warning" | "failed";
6
6
  export type ExecutionStepKind = "submit" | "setup" | "bridge" | "fill";
7
7
  export type ExecutionStep = {
8
8
  id: string;
@@ -32,3 +32,15 @@ export type DeriveExecutionOrderGroupsArgs = {
32
32
  };
33
33
  export declare const deriveExecutionOrderGroups: ({ quoteData, labels, tradeSide, hasSubmissionResponse, executionSteps, executionOrders, rawExecutionSteps, terminalOrderEvents, forceCompleted, }: DeriveExecutionOrderGroupsArgs) => ExecutionOrderGroup[];
34
34
  export declare const flattenExecutionSteps: (groups: ExecutionOrderGroup[]) => ExecutionStep[];
35
+ export type CalculateExecutionProgressArgs = {
36
+ orderIds: string[];
37
+ submittedOrderIds?: string[];
38
+ executionSteps?: ExecutionStatusStep[];
39
+ executionOrders?: ExecutionStatusOrder[];
40
+ minimumProgress?: number;
41
+ };
42
+ /**
43
+ * Fixed-weight execution progress from canonical backend milestones.
44
+ * Display-only substeps can grow without changing the 20/20/20/40 denominator.
45
+ */
46
+ export declare const calculateExecutionProgress: ({ orderIds, submittedOrderIds, executionSteps, executionOrders, minimumProgress, }: CalculateExecutionProgressArgs) => number;
@@ -2,7 +2,7 @@ import type { ExecutionRawStepProgress, ExecutionTerminalOrderEvent } from "@agg
2
2
  import type { ExecutionStatusOrder, ExecutionStatusStep, SmartRouteResponse } from "@agg-build/sdk";
3
3
  import { type PlaceOrderTab, type TradingVenue } from "../types";
4
4
  import type { PlaceOrderTradingLabels } from "./index.place-order.types";
5
- export type ExecutionStepStatus = "not-started" | "loading" | "done";
5
+ export type ExecutionStepStatus = "not-started" | "loading" | "done" | "warning" | "failed";
6
6
  export type ExecutionStepKind = "submit" | "setup" | "bridge" | "fill";
7
7
  export type ExecutionStep = {
8
8
  id: string;
@@ -32,3 +32,15 @@ export type DeriveExecutionOrderGroupsArgs = {
32
32
  };
33
33
  export declare const deriveExecutionOrderGroups: ({ quoteData, labels, tradeSide, hasSubmissionResponse, executionSteps, executionOrders, rawExecutionSteps, terminalOrderEvents, forceCompleted, }: DeriveExecutionOrderGroupsArgs) => ExecutionOrderGroup[];
34
34
  export declare const flattenExecutionSteps: (groups: ExecutionOrderGroup[]) => ExecutionStep[];
35
+ export type CalculateExecutionProgressArgs = {
36
+ orderIds: string[];
37
+ submittedOrderIds?: string[];
38
+ executionSteps?: ExecutionStatusStep[];
39
+ executionOrders?: ExecutionStatusOrder[];
40
+ minimumProgress?: number;
41
+ };
42
+ /**
43
+ * Fixed-weight execution progress from canonical backend milestones.
44
+ * Display-only substeps can grow without changing the 20/20/20/40 denominator.
45
+ */
46
+ export declare const calculateExecutionProgress: ({ orderIds, submittedOrderIds, executionSteps, executionOrders, minimumProgress, }: CalculateExecutionProgressArgs) => number;
@@ -18,8 +18,9 @@ export type PlaceOrderExecutionViewProps = PlaceOrderExecutionHeaderProps & {
18
18
  enableAnimations: boolean;
19
19
  groups: ExecutionOrderGroup[];
20
20
  labels: PlaceOrderTradingLabels;
21
+ progress: number;
21
22
  };
22
23
  export declare const PlaceOrderExecutionView: {
23
- ({ className, classNames, enableAnimations, eventDateLabel, eventImage, eventTitle, groups, labels, }: PlaceOrderExecutionViewProps): JSX.Element;
24
+ ({ className, classNames, enableAnimations, eventDateLabel, eventImage, eventTitle, groups, labels, progress, }: PlaceOrderExecutionViewProps): JSX.Element;
24
25
  displayName: string;
25
26
  };
@@ -18,8 +18,9 @@ export type PlaceOrderExecutionViewProps = PlaceOrderExecutionHeaderProps & {
18
18
  enableAnimations: boolean;
19
19
  groups: ExecutionOrderGroup[];
20
20
  labels: PlaceOrderTradingLabels;
21
+ progress: number;
21
22
  };
22
23
  export declare const PlaceOrderExecutionView: {
23
- ({ className, classNames, enableAnimations, eventDateLabel, eventImage, eventTitle, groups, labels, }: PlaceOrderExecutionViewProps): JSX.Element;
24
+ ({ className, classNames, enableAnimations, eventDateLabel, eventImage, eventTitle, groups, labels, progress, }: PlaceOrderExecutionViewProps): JSX.Element;
24
25
  displayName: string;
25
26
  };
@@ -81,6 +81,8 @@ export type PlaceOrderProps = {
81
81
  onExecutionStateChange?: (state: PlaceOrderSubmissionProgressState) => void;
82
82
  /** Optional resolved-event claim summary shown in read-only state. */
83
83
  resolvedClaim?: PlaceOrderResolvedClaimSummary;
84
+ /** Render the settlement-pending state for a closed recurring market. */
85
+ showResolvingState?: boolean;
84
86
  /** Pre-fetched midpoint data (best price included) passed from parent. Optional for backward compatibility. */
85
87
  midpointsResult?: UseMidpointsResult;
86
88
  };
@@ -212,6 +214,12 @@ export type PlaceOrderFailureSummary = {
212
214
  kind: PlaceOrderFailureKind;
213
215
  /** Failed venue to pin when retrying the unfilled remainder of a split route. */
214
216
  retryVenue?: TradingVenue;
217
+ executionGroups?: ExecutionOrderGroup[];
218
+ result?: {
219
+ averagePriceLabel: string;
220
+ filledAmountLabel: string;
221
+ payoutLabel: string;
222
+ };
215
223
  steps: PlaceOrderFailureStep[];
216
224
  };
217
225
  export type ResolvePlaceOrderQuoteResultParams = {
@@ -239,6 +247,7 @@ export type ResolvePlaceOrderTabKeyParams = {
239
247
  export type PlaceOrderQuoteStatus = PlaceOrderStatus | undefined;
240
248
  export type PlaceOrderSubmissionProgressPhase = "finding-route" | "submitting" | "executing" | "success" | "failed";
241
249
  export type PlaceOrderExecutionSummary = {
250
+ resultState?: "success" | "partial";
242
251
  tradeSide?: PlaceOrderTab;
243
252
  shares: string;
244
253
  avgPrice: string;
@@ -81,6 +81,8 @@ export type PlaceOrderProps = {
81
81
  onExecutionStateChange?: (state: PlaceOrderSubmissionProgressState) => void;
82
82
  /** Optional resolved-event claim summary shown in read-only state. */
83
83
  resolvedClaim?: PlaceOrderResolvedClaimSummary;
84
+ /** Render the settlement-pending state for a closed recurring market. */
85
+ showResolvingState?: boolean;
84
86
  /** Pre-fetched midpoint data (best price included) passed from parent. Optional for backward compatibility. */
85
87
  midpointsResult?: UseMidpointsResult;
86
88
  };
@@ -212,6 +214,12 @@ export type PlaceOrderFailureSummary = {
212
214
  kind: PlaceOrderFailureKind;
213
215
  /** Failed venue to pin when retrying the unfilled remainder of a split route. */
214
216
  retryVenue?: TradingVenue;
217
+ executionGroups?: ExecutionOrderGroup[];
218
+ result?: {
219
+ averagePriceLabel: string;
220
+ filledAmountLabel: string;
221
+ payoutLabel: string;
222
+ };
215
223
  steps: PlaceOrderFailureStep[];
216
224
  };
217
225
  export type ResolvePlaceOrderQuoteResultParams = {
@@ -239,6 +247,7 @@ export type ResolvePlaceOrderTabKeyParams = {
239
247
  export type PlaceOrderQuoteStatus = PlaceOrderStatus | undefined;
240
248
  export type PlaceOrderSubmissionProgressPhase = "finding-route" | "submitting" | "executing" | "success" | "failed";
241
249
  export type PlaceOrderExecutionSummary = {
250
+ resultState?: "success" | "partial";
242
251
  tradeSide?: PlaceOrderTab;
243
252
  shares: string;
244
253
  avgPrice: string;
@@ -154,6 +154,12 @@ export declare const getPlaceOrderUnfilledRemaining: ({ originalAmount, tradeSid
154
154
  tradeSide: PlaceOrderTab;
155
155
  terminalOrderEvents?: PlaceOrderTerminalOrderEvent[];
156
156
  }) => number;
157
+ /** Returns null when successful legs omit the canonical units needed for a safe retry. */
158
+ export declare const getCanonicalPlaceOrderUnfilledRemaining: ({ originalAmount, tradeSide, terminalOrderEvents, }: {
159
+ originalAmount: number;
160
+ tradeSide: PlaceOrderTab;
161
+ terminalOrderEvents?: PlaceOrderTerminalOrderEvent[];
162
+ }) => number | null;
157
163
  export declare const buildPlaceOrderFailureSummary: ({ actionLabel, canRetryRemaining, errorMessage, eventImage, eventSubtitle, eventTitle, labels, orderId, quoteData, submittedOrders, terminalOrderEvents, }: {
158
164
  actionLabel: string;
159
165
  canRetryRemaining?: boolean;
@@ -154,6 +154,12 @@ export declare const getPlaceOrderUnfilledRemaining: ({ originalAmount, tradeSid
154
154
  tradeSide: PlaceOrderTab;
155
155
  terminalOrderEvents?: PlaceOrderTerminalOrderEvent[];
156
156
  }) => number;
157
+ /** Returns null when successful legs omit the canonical units needed for a safe retry. */
158
+ export declare const getCanonicalPlaceOrderUnfilledRemaining: ({ originalAmount, tradeSide, terminalOrderEvents, }: {
159
+ originalAmount: number;
160
+ tradeSide: PlaceOrderTab;
161
+ terminalOrderEvents?: PlaceOrderTerminalOrderEvent[];
162
+ }) => number | null;
157
163
  export declare const buildPlaceOrderFailureSummary: ({ actionLabel, canRetryRemaining, errorMessage, eventImage, eventSubtitle, eventTitle, labels, orderId, quoteData, submittedOrders, terminalOrderEvents, }: {
158
164
  actionLabel: string;
159
165
  canRetryRemaining?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/ui",
3
- "version": "4.2.0",
3
+ "version": "4.7.1",
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/sdk": "^4.1.0",
104
- "@agg-build/hooks": "^4.0.1"
103
+ "@agg-build/sdk": "^4.7.0",
104
+ "@agg-build/hooks": "^4.7.0"
105
105
  },
106
106
  "dependencies": {
107
107
  "@number-flow/react": "^0.6.0",
File without changes