@agg-build/ui 4.7.4 → 4.9.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.
Files changed (80) hide show
  1. package/dist/{chunk-2347CDTT.mjs → chunk-GG57TRNE.mjs} +393 -155
  2. package/dist/{chunk-CB3DDQBP.mjs → chunk-GKYBQEBC.mjs} +462 -171
  3. package/dist/{chunk-3X5ICUUC.mjs → chunk-GVIS3YXU.mjs} +2 -2
  4. package/dist/{chunk-XR6C3MZX.mjs → chunk-H7L4HDXS.mjs} +266 -162
  5. package/dist/{chunk-UQ7XJIAZ.mjs → chunk-NYL6A6AD.mjs} +953 -785
  6. package/dist/{chunk-MAQ52KM5.mjs → chunk-TNNLRRHC.mjs} +1 -1
  7. package/dist/{chunk-VQTOMYOA.mjs → chunk-XQLLZTEW.mjs} +296 -166
  8. package/dist/events.js +1195 -1041
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +4726 -3772
  11. package/dist/index.mjs +58 -19
  12. package/dist/modals.js +1886 -1181
  13. package/dist/modals.mjs +12 -4
  14. package/dist/pages.js +3551 -2872
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +953 -785
  17. package/dist/primitives.mjs +1 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +2255 -1710
  21. package/dist/trading.mjs +10 -6
  22. package/dist/types/index.d.mts +1 -0
  23. package/dist/types/index.d.ts +1 -0
  24. package/dist/types/kyc/index.d.mts +3 -0
  25. package/dist/types/kyc/index.d.ts +3 -0
  26. package/dist/types/kyc/shared-kyc-modal.d.mts +12 -0
  27. package/dist/types/kyc/shared-kyc-modal.d.ts +12 -0
  28. package/dist/types/kyc/shared-kyc.d.mts +31 -0
  29. package/dist/types/kyc/shared-kyc.d.ts +31 -0
  30. package/dist/types/kyc/use-shared-kyc-flow.d.mts +19 -0
  31. package/dist/types/kyc/use-shared-kyc-flow.d.ts +19 -0
  32. package/dist/types/modals/index.d.mts +2 -0
  33. package/dist/types/modals/index.d.ts +2 -0
  34. package/dist/types/pages/event-market/event-market.shared.d.mts +2 -1
  35. package/dist/types/pages/event-market/event-market.shared.d.ts +2 -1
  36. package/dist/types/pages/event-market/event-market.types.d.mts +2 -0
  37. package/dist/types/pages/event-market/event-market.types.d.ts +2 -0
  38. package/dist/types/pages/event-market/sports-event-market-page.d.mts +1 -1
  39. package/dist/types/pages/event-market/sports-event-market-page.d.ts +1 -1
  40. package/dist/types/pages/user-profile/components/positions-value-card.d.mts +17 -1
  41. package/dist/types/pages/user-profile/components/positions-value-card.d.ts +17 -1
  42. package/dist/types/pages/user-profile/components/user-info-card.d.mts +11 -1
  43. package/dist/types/pages/user-profile/components/user-info-card.d.ts +11 -1
  44. package/dist/types/paper-trading/index.d.mts +6 -0
  45. package/dist/types/paper-trading/index.d.ts +6 -0
  46. package/dist/types/paper-trading/paper-onboarding-modal.d.mts +15 -0
  47. package/dist/types/paper-trading/paper-onboarding-modal.d.ts +15 -0
  48. package/dist/types/paper-trading/paper-onboarding-modal.types.d.mts +33 -0
  49. package/dist/types/paper-trading/paper-onboarding-modal.types.d.ts +33 -0
  50. package/dist/types/paper-trading/paper-trading-badge.d.mts +50 -0
  51. package/dist/types/paper-trading/paper-trading-badge.d.ts +50 -0
  52. package/dist/types/paper-trading/paper-trading-onboarding.d.mts +16 -0
  53. package/dist/types/paper-trading/paper-trading-onboarding.d.ts +16 -0
  54. package/dist/types/primitives/header/header.types.d.mts +16 -0
  55. package/dist/types/primitives/header/header.types.d.ts +16 -0
  56. package/dist/types/primitives/header/index.d.mts +1 -1
  57. package/dist/types/primitives/header/index.d.ts +1 -1
  58. package/dist/types/primitives/icon/registry.d.mts +20 -0
  59. package/dist/types/primitives/icon/registry.d.ts +20 -0
  60. package/dist/types/primitives/icon/svg/paper-buying-power.d.mts +11 -0
  61. package/dist/types/primitives/icon/svg/paper-buying-power.d.ts +11 -0
  62. package/dist/types/primitives/icon/svg/paper-earnings.d.mts +11 -0
  63. package/dist/types/primitives/icon/svg/paper-earnings.d.ts +11 -0
  64. package/dist/types/primitives/icon/svg/paper-onboarding-funds.d.mts +12 -0
  65. package/dist/types/primitives/icon/svg/paper-onboarding-funds.d.ts +12 -0
  66. package/dist/types/primitives/icon/svg/paper-onboarding-markets.d.mts +12 -0
  67. package/dist/types/primitives/icon/svg/paper-onboarding-markets.d.ts +12 -0
  68. package/dist/types/primitives/icon/svg/paper-onboarding-performance.d.mts +12 -0
  69. package/dist/types/primitives/icon/svg/paper-onboarding-performance.d.ts +12 -0
  70. package/dist/types/primitives/modal/modal.types.d.mts +6 -0
  71. package/dist/types/primitives/modal/modal.types.d.ts +6 -0
  72. package/dist/types/trading/index.d.mts +1 -0
  73. package/dist/types/trading/index.d.ts +1 -0
  74. package/dist/types/trading/place-order/index.d.mts +1 -1
  75. package/dist/types/trading/place-order/index.d.ts +1 -1
  76. package/dist/types/trading/place-order/index.place-order.types.d.mts +8 -0
  77. package/dist/types/trading/place-order/index.place-order.types.d.ts +8 -0
  78. package/dist/types/trading/types.d.mts +2 -0
  79. package/dist/types/trading/types.d.ts +2 -0
  80. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  formatRecurringCountdown,
15
15
  formatShareAmount,
16
16
  useHomePageModals
17
- } from "./chunk-VQTOMYOA.mjs";
17
+ } from "./chunk-XQLLZTEW.mjs";
18
18
  import {
19
19
  EventList,
20
20
  EventListItem,
@@ -32,17 +32,20 @@ import {
32
32
  orderbookRowLimitDefault,
33
33
  resolveEventDetailsSyncKey,
34
34
  useCenterOrderbookSpread
35
- } from "./chunk-3X5ICUUC.mjs";
35
+ } from "./chunk-GVIS3YXU.mjs";
36
36
  import {
37
37
  CARD_NETWORK_OPTIONS,
38
38
  DepositModal,
39
39
  GeoBlockModal,
40
+ PaperOnboardingModal,
41
+ PaperTradingBadge,
42
+ PaperTradingOnboarding,
40
43
  ProfileModal,
41
44
  WithdrawModal,
42
45
  buildTerminalSummary,
43
46
  clearPendingCardSession,
44
47
  getPendingCardSession
45
- } from "./chunk-2347CDTT.mjs";
48
+ } from "./chunk-GG57TRNE.mjs";
46
49
  import {
47
50
  AggNotificationEventsProvider,
48
51
  DEPOSIT_MODAL_OPEN_EVENT,
@@ -55,13 +58,16 @@ import {
55
58
  PlaceOrderSuccessView,
56
59
  SettlementDetails,
57
60
  WITHDRAW_MODAL_OPEN_EVENT,
61
+ createAggClientSharedKycInitiator,
58
62
  parseAmount,
59
63
  parseVenue,
60
64
  requestAggDepositModalOpen,
61
65
  requestAggWithdrawModalOpen,
62
66
  useClaimWinnings,
63
- useResolvedMarketClaim
64
- } from "./chunk-CB3DDQBP.mjs";
67
+ useResolvedMarketClaim,
68
+ useSharedKycFlow,
69
+ venueRequiresSharedKyc
70
+ } from "./chunk-GKYBQEBC.mjs";
65
71
  import {
66
72
  SETTLEMENT_SECTION_ID,
67
73
  Settlement,
@@ -82,7 +88,7 @@ import {
82
88
  resolveOrderBookRows,
83
89
  resolveUnifiedOrderBookEntries,
84
90
  useEventTradingContext
85
- } from "./chunk-MAQ52KM5.mjs";
91
+ } from "./chunk-TNNLRRHC.mjs";
86
92
  import {
87
93
  ConnectAccountsStep,
88
94
  ConnectKalshiModal,
@@ -90,8 +96,9 @@ import {
90
96
  GeoBlockBanner,
91
97
  HowItWorksStep,
92
98
  OnboardingModal,
93
- ProfileSetupStep
94
- } from "./chunk-XR6C3MZX.mjs";
99
+ ProfileSetupStep,
100
+ SharedKycModal
101
+ } from "./chunk-H7L4HDXS.mjs";
95
102
  import {
96
103
  AGG_DEFAULT_URL,
97
104
  AGG_DOCS_URL,
@@ -213,7 +220,7 @@ import {
213
220
  useOptionalToast,
214
221
  useToast,
215
222
  venueLogoNames
216
- } from "./chunk-UQ7XJIAZ.mjs";
223
+ } from "./chunk-NYL6A6AD.mjs";
217
224
 
218
225
  // src/notifications/agg-toast-provider.tsx
219
226
  import { jsx } from "react/jsx-runtime";
@@ -247,6 +254,7 @@ import {
247
254
  useAggAuthContext,
248
255
  useAppConfig,
249
256
  useLabels,
257
+ useResolvedExecutionMode,
250
258
  useSdkUiConfig
251
259
  } from "@agg-build/hooks";
252
260
  import { Venue } from "@agg-build/sdk";
@@ -394,7 +402,8 @@ var UnauthenticatedConnectView = ({
394
402
  onEmailSubmit,
395
403
  onMethodSelect,
396
404
  socialMethods,
397
- walletMethods
405
+ walletMethods,
406
+ isPaperMode = false
398
407
  }) => {
399
408
  var _a, _b, _c, _d, _e;
400
409
  const labels = useLabels();
@@ -406,7 +415,22 @@ var UnauthenticatedConnectView = ({
406
415
  __spreadProps(__spreadValues({
407
416
  variant: "primary",
408
417
  size: "large",
409
- className: classNames == null ? void 0 : classNames.connectButton,
418
+ className: cn(
419
+ // Figma's PAPER mobile header (4772:34181) sizes this at 79x28 with
420
+ // 16px padding and 14/20 text — tighter than the `large` preset's
421
+ // 40/24/16, which is kept from md up. Paper-only: the frame was
422
+ // drawn for the paper header, and applying it in live mode would
423
+ // resize the sign-in button in every existing partner app.
424
+ //
425
+ // Whether live should adopt these sizes too is a design-system
426
+ // question, not a paper one — decide it in its own change.
427
+ //
428
+ // The `!` suffixes are needed because `cn` is a plain join, so the
429
+ // preset's own utilities would otherwise win on stylesheet order.
430
+ isPaperMode && "h-7! px-4! text-agg-sm! leading-agg-5!",
431
+ isPaperMode && "md:h-10! md:px-6! md:text-agg-base! md:leading-agg-6!",
432
+ classNames == null ? void 0 : classNames.connectButton
433
+ ),
410
434
  onClick: () => onChooserOpenChange(true),
411
435
  disabled: disabled || !hasConfiguredMethods,
412
436
  "aria-label": labels.auth.connect()
@@ -611,6 +635,7 @@ var AuthConnectButtonView = ({
611
635
  var _a;
612
636
  const labels = useLabels();
613
637
  const { disabledVenues, isLoading: isAppConfigLoading } = useAppConfig();
638
+ const { isPaperMode } = useResolvedExecutionMode();
614
639
  const isKalshiAvailable = getVenueAvailabilityState({
615
640
  venueId: Venue.kalshi,
616
641
  disabledVenues,
@@ -640,7 +665,7 @@ var AuthConnectButtonView = ({
640
665
  classNames == null ? void 0 : classNames.profileMenuActionItem
641
666
  );
642
667
  if (!isAuthenticated) {
643
- return /* @__PURE__ */ jsx3(
668
+ const unauthenticatedView = /* @__PURE__ */ jsx3(
644
669
  UnauthenticatedConnectView,
645
670
  {
646
671
  activeMethodId,
@@ -660,13 +685,20 @@ var AuthConnectButtonView = ({
660
685
  onEmailSubmit,
661
686
  onMethodSelect,
662
687
  socialMethods,
663
- walletMethods
688
+ walletMethods,
689
+ isPaperMode
664
690
  }
665
691
  );
692
+ if (!isPaperMode) return unauthenticatedView;
693
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
694
+ /* @__PURE__ */ jsx3(PaperTradingBadge, { placement: "signedOut", isAuthenticated }),
695
+ unauthenticatedView
696
+ ] });
666
697
  }
667
698
  return /* @__PURE__ */ jsx3("div", { className: cn(connectButtonContainerClassName, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ jsxs("div", { className: cn(connectedButtonsRowClassName, classNames == null ? void 0 : classNames.connectedRow), children: [
668
699
  /* @__PURE__ */ jsxs("div", { className: cn(connectedBalanceChipClassName, classNames == null ? void 0 : classNames.balanceChip), children: [
669
- /* @__PURE__ */ jsx3("div", { className: "hidden lg:inline-flex", children: /* @__PURE__ */ jsx3(
700
+ /* @__PURE__ */ jsx3(PaperTradingBadge, { placement: "chip", isAuthenticated }),
701
+ /* @__PURE__ */ jsx3("div", { className: cn(isPaperMode ? "hidden" : "hidden lg:inline-flex"), children: /* @__PURE__ */ jsx3(
670
702
  ConditionalWrapper,
671
703
  {
672
704
  condition: isDepositBlocked,
@@ -743,7 +775,7 @@ var AuthConnectButtonView = ({
743
775
  /* @__PURE__ */ jsx3("span", { className: "h-3.5 w-3.5 shrink-0 [&_svg]:h-full [&_svg]:w-full", children: /* @__PURE__ */ jsx3(Icon, { name: "wallet-filled", size: "small", className: "text-agg-muted-foreground" }) }),
744
776
  /* @__PURE__ */ jsx3("p", { className: cn("agg-type-label text-agg-foreground", classNames == null ? void 0 : classNames.balanceText), children: isBalanceLoading ? /* @__PURE__ */ jsx3(LoadingIcon, { size: "small" }) : formatUsd(totalBalance) })
745
777
  ] }),
746
- isKalshiAvailable ? /* @__PURE__ */ jsxs(
778
+ isKalshiAvailable && !isPaperMode ? /* @__PURE__ */ jsxs(
747
779
  "div",
748
780
  {
749
781
  className: "flex items-center gap-2",
@@ -880,7 +912,7 @@ var AuthConnectButtonView = ({
880
912
  ] }),
881
913
  /* @__PURE__ */ jsx3("p", { className: "text-agg-lg font-agg-bold leading-agg-7 text-agg-foreground text-left", children: isBalanceLoading ? /* @__PURE__ */ jsx3(LoadingIcon, { size: "small" }) : formatUsd(positionsBalance) })
882
914
  ] }),
883
- isKalshiAvailable ? /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-2", children: [
915
+ isKalshiAvailable && !isPaperMode ? /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-2", children: [
884
916
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
885
917
  /* @__PURE__ */ jsx3(VenueLogo, { venue: Venue.kalshi, size: "small", className: "size-4" }),
886
918
  /* @__PURE__ */ jsx3("span", { className: "truncate text-agg-sm leading-agg-5 text-agg-foreground", children: labels.userProfile.balance.kalshiBalance })
@@ -910,7 +942,7 @@ var AuthConnectButtonView = ({
910
942
  ]
911
943
  }
912
944
  ),
913
- isDepositBlocked ? /* @__PURE__ */ jsx3(
945
+ isPaperMode ? null : isDepositBlocked ? /* @__PURE__ */ jsx3(
914
946
  DropdownMenu.Item,
915
947
  {
916
948
  className: cn(dropdownMenuItemClassName, "opacity-50 cursor-not-allowed!"),
@@ -941,7 +973,7 @@ var AuthConnectButtonView = ({
941
973
  ]
942
974
  }
943
975
  ),
944
- /* @__PURE__ */ jsxs(
976
+ isPaperMode ? null : /* @__PURE__ */ jsxs(
945
977
  DropdownMenu.Item,
946
978
  {
947
979
  className: dropdownMenuItemClassName,
@@ -1065,7 +1097,10 @@ export {
1065
1097
  Orderbook,
1066
1098
  OrderbookWithStates,
1067
1099
  PaperModeIcon,
1100
+ PaperOnboardingModal,
1068
1101
  PaperPlaneIcon,
1102
+ PaperTradingBadge,
1103
+ PaperTradingOnboarding,
1069
1104
  PencilIcon,
1070
1105
  PlaceOrder,
1071
1106
  PlaceOrderExecutionGroups,
@@ -1088,6 +1123,7 @@ export {
1088
1123
  Settlement,
1089
1124
  SettlementDetails,
1090
1125
  SettlementSummary,
1126
+ SharedKycModal,
1091
1127
  ShieldTrustIcon,
1092
1128
  Skeleton,
1093
1129
  SolanaIcon,
@@ -1127,6 +1163,7 @@ export {
1127
1163
  cn,
1128
1164
  collectEligibleVenueOutcomeIds,
1129
1165
  collectEligibleVenueOutcomes,
1166
+ createAggClientSharedKycInitiator,
1130
1167
  defaultSettlementSectionLabel,
1131
1168
  defaultTradingDisclaimer,
1132
1169
  formatAmountDisplay,
@@ -1173,6 +1210,8 @@ export {
1173
1210
  useHomePageModals,
1174
1211
  useOptionalToast,
1175
1212
  useResolvedMarketClaim,
1213
+ useSharedKycFlow,
1176
1214
  useToast,
1177
- venueLogoNames
1215
+ venueLogoNames,
1216
+ venueRequiresSharedKyc
1178
1217
  };