@agg-market/ui 6.0.0 → 8.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.
Files changed (89) hide show
  1. package/README.md +17 -2
  2. package/dist/{chunk-G6YKGVQR.mjs → chunk-JE4MV5RL.mjs} +18 -60
  3. package/dist/{chunk-2ICOSP7N.mjs → chunk-KRCRD4AJ.mjs} +11 -14
  4. package/dist/{chunk-5ZKPBMRK.mjs → chunk-SBLIHCN2.mjs} +21 -24
  5. package/dist/{chunk-LMOJKJOY.mjs → chunk-TLFRGJ5B.mjs} +334 -217
  6. package/dist/chunk-WKY3IN52.mjs +4907 -0
  7. package/dist/events.js +3364 -2660
  8. package/dist/events.mjs +2 -5
  9. package/dist/index.js +2693 -1764
  10. package/dist/index.mjs +610 -38
  11. package/dist/modals.js +1356 -815
  12. package/dist/modals.mjs +2 -4
  13. package/dist/pages.js +3023 -2248
  14. package/dist/pages.mjs +4 -7
  15. package/dist/primitives.js +1072 -355
  16. package/dist/primitives.mjs +38 -30
  17. package/dist/styles.css +1 -1
  18. package/dist/tailwind.css +1 -1
  19. package/dist/trading.js +1153 -558
  20. package/dist/trading.mjs +2 -4
  21. package/dist/types/auth/connect-button-view/connect-button-view.constants.d.mts +31 -0
  22. package/dist/types/auth/connect-button-view/connect-button-view.constants.d.ts +31 -0
  23. package/dist/types/auth/connect-button-view/connect-button-view.types.d.mts +83 -0
  24. package/dist/types/auth/connect-button-view/connect-button-view.types.d.ts +83 -0
  25. package/dist/types/auth/connect-button-view/index.d.mts +7 -0
  26. package/dist/types/auth/connect-button-view/index.d.ts +7 -0
  27. package/dist/types/auth/index.d.mts +1 -1
  28. package/dist/types/auth/index.d.ts +1 -1
  29. package/dist/types/index.d.mts +1 -1
  30. package/dist/types/index.d.ts +1 -1
  31. package/dist/types/primitives/chart/chart-type-switch.d.mts +10 -0
  32. package/dist/types/primitives/chart/chart-type-switch.d.ts +10 -0
  33. package/dist/types/primitives/chart/index.d.mts +7 -1
  34. package/dist/types/primitives/chart/index.d.ts +7 -1
  35. package/dist/types/primitives/icon/index.d.mts +9 -1
  36. package/dist/types/primitives/icon/index.d.ts +9 -1
  37. package/dist/types/primitives/icon/registry.d.mts +32 -0
  38. package/dist/types/primitives/icon/registry.d.ts +32 -0
  39. package/dist/types/primitives/icon/svg/apple.d.mts +5 -0
  40. package/dist/types/primitives/icon/svg/apple.d.ts +5 -0
  41. package/dist/types/primitives/icon/svg/chart-candlestick.d.mts +5 -0
  42. package/dist/types/primitives/icon/svg/chart-candlestick.d.ts +5 -0
  43. package/dist/types/primitives/icon/svg/chart-line.d.mts +5 -0
  44. package/dist/types/primitives/icon/svg/chart-line.d.ts +5 -0
  45. package/dist/types/primitives/icon/svg/error-filled.d.mts +5 -0
  46. package/dist/types/primitives/icon/svg/error-filled.d.ts +5 -0
  47. package/dist/types/primitives/icon/svg/ethereum.d.mts +5 -0
  48. package/dist/types/primitives/icon/svg/ethereum.d.ts +5 -0
  49. package/dist/types/primitives/icon/svg/google.d.mts +5 -0
  50. package/dist/types/primitives/icon/svg/google.d.ts +5 -0
  51. package/dist/types/primitives/icon/svg/image.d.mts +5 -0
  52. package/dist/types/primitives/icon/svg/image.d.ts +5 -0
  53. package/dist/types/primitives/icon/svg/solana.d.mts +5 -0
  54. package/dist/types/primitives/icon/svg/solana.d.ts +5 -0
  55. package/dist/types/primitives/index.d.mts +2 -0
  56. package/dist/types/primitives/index.d.ts +2 -0
  57. package/dist/types/primitives/inline-alert/index.d.mts +16 -0
  58. package/dist/types/primitives/inline-alert/index.d.ts +16 -0
  59. package/dist/types/primitives/remote-image/index.d.mts +6 -0
  60. package/dist/types/primitives/remote-image/index.d.ts +6 -0
  61. package/dist/types/primitives/remote-image/remote-image.constants.d.mts +4 -0
  62. package/dist/types/primitives/remote-image/remote-image.constants.d.ts +4 -0
  63. package/dist/types/primitives/remote-image/remote-image.types.d.mts +16 -0
  64. package/dist/types/primitives/remote-image/remote-image.types.d.ts +16 -0
  65. package/dist/types/primitives/venue-logo/svg/logo-limitless.d.mts +5 -0
  66. package/dist/types/primitives/venue-logo/svg/logo-limitless.d.ts +5 -0
  67. package/dist/types/primitives/venue-logo/venue-logo.types.d.mts +1 -1
  68. package/dist/types/primitives/venue-logo/venue-logo.types.d.ts +1 -1
  69. package/dist/types/trading/types.d.mts +26 -26
  70. package/dist/types/trading/types.d.ts +26 -26
  71. package/package.json +3 -15
  72. package/dist/auth.d.mts +0 -1
  73. package/dist/auth.d.ts +0 -1
  74. package/dist/auth.js +0 -2290
  75. package/dist/auth.mjs +0 -8
  76. package/dist/chunk-ADGL6RFX.mjs +0 -214
  77. package/dist/chunk-CN7GI2RJ.mjs +0 -585
  78. package/dist/chunk-HI4EEDN5.mjs +0 -1880
  79. package/dist/chunk-INRG3D4M.mjs +0 -450
  80. package/dist/chunk-JE3Z52FD.mjs +0 -345
  81. package/dist/chunk-MHCHR65A.mjs +0 -165
  82. package/dist/chunk-PASXFYKQ.mjs +0 -81
  83. package/dist/chunk-UBBOLLOS.mjs +0 -999
  84. package/dist/types/auth/connect-button/connect-button.constants.d.mts +0 -10
  85. package/dist/types/auth/connect-button/connect-button.constants.d.ts +0 -10
  86. package/dist/types/auth/connect-button/connect-button.types.d.mts +0 -33
  87. package/dist/types/auth/connect-button/connect-button.types.d.ts +0 -33
  88. package/dist/types/auth/connect-button/index.d.mts +0 -7
  89. package/dist/types/auth/connect-button/index.d.ts +0 -7
package/dist/index.mjs CHANGED
@@ -1,35 +1,15 @@
1
- import {
2
- HelloWorld,
3
- NumberValue,
4
- Search
5
- } from "./chunk-JE3Z52FD.mjs";
6
- import {
7
- ConnectButton
8
- } from "./chunk-INRG3D4M.mjs";
9
- import {
10
- LoadingIcon
11
- } from "./chunk-PASXFYKQ.mjs";
12
1
  import "./chunk-KZOQW6NT.mjs";
13
2
  import {
14
3
  EventMarketPage,
15
4
  HomePage,
16
5
  UserProfilePage
17
- } from "./chunk-2ICOSP7N.mjs";
6
+ } from "./chunk-KRCRD4AJ.mjs";
18
7
  import {
19
8
  EventList,
20
9
  EventListItem,
21
10
  EventListItemDetails,
22
11
  MarketDetails
23
- } from "./chunk-LMOJKJOY.mjs";
24
- import {
25
- Badge,
26
- LineChart,
27
- StateMessage,
28
- SwitchButton,
29
- Typography,
30
- badgeSizes,
31
- typographyVariants
32
- } from "./chunk-CN7GI2RJ.mjs";
12
+ } from "./chunk-TLFRGJ5B.mjs";
33
13
  import {
34
14
  ConnectAccountsStep,
35
15
  ConnectKalshiModal,
@@ -40,10 +20,7 @@ import {
40
20
  ProfileModal,
41
21
  ProfileSetupStep,
42
22
  WithdrawModal
43
- } from "./chunk-5ZKPBMRK.mjs";
44
- import {
45
- Modal
46
- } from "./chunk-ADGL6RFX.mjs";
23
+ } from "./chunk-SBLIHCN2.mjs";
47
24
  import {
48
25
  placeOrderMetricSchema,
49
26
  placeOrderOutcomeSchema,
@@ -75,24 +52,20 @@ import {
75
52
  getTradingSlippageLabel,
76
53
  getTradingValueLabel,
77
54
  getTradingVenueLabel
78
- } from "./chunk-G6YKGVQR.mjs";
79
- import {
80
- Card,
81
- Skeleton,
82
- Tabs,
83
- skeletonViews
84
- } from "./chunk-UBBOLLOS.mjs";
85
- import {
86
- Select
87
- } from "./chunk-MHCHR65A.mjs";
55
+ } from "./chunk-JE4MV5RL.mjs";
88
56
  import {
89
57
  AGG_ROOT_CLASS_NAME,
58
+ AppleIcon,
90
59
  ArrowTrendUpIcon,
91
60
  ArrowsToDotIcon,
61
+ Badge,
92
62
  BankIcon,
93
63
  BestPricesIcon,
94
64
  BoltIcon,
95
65
  Button,
66
+ Card,
67
+ ChartCandlestickIcon,
68
+ ChartLineIcon,
96
69
  CheckCircleIcon,
97
70
  ChevronDownIcon,
98
71
  ChevronLeftIcon,
@@ -106,26 +79,48 @@ import {
106
79
  DocumentIcon,
107
80
  DotsHorizontalIcon,
108
81
  DownloadIcon,
82
+ ErrorFilledIcon,
83
+ EthereumIcon,
109
84
  ExternalLinkIcon,
85
+ GoogleIcon,
86
+ HelloWorld,
110
87
  Icon,
88
+ ImageIcon,
111
89
  InfoIcon,
90
+ InlineAlert,
91
+ LineChart,
112
92
  LinkAccountsIcon,
93
+ LoadingIcon,
94
+ Modal,
95
+ NumberValue,
113
96
  PencilIcon,
114
97
  PlaySquareIcon,
115
98
  ProfileIcon,
99
+ RemoteImage,
116
100
  RevenueAltIcon,
101
+ Search,
117
102
  SearchIcon,
103
+ Select,
118
104
  ShieldTrustIcon,
105
+ Skeleton,
106
+ SolanaIcon,
107
+ StateMessage,
119
108
  StayInControlIcon,
109
+ SwitchButton,
110
+ Tabs,
120
111
  TriangleDownIcon,
121
112
  TriangleUpFilledIcon,
122
113
  TriangleUpIcon,
114
+ Typography,
123
115
  UploadIcon,
124
116
  VenueLogo,
125
117
  WalletAvatarIcon,
126
118
  WalletIcon,
127
119
  WarningFilledIcon,
128
120
  WarningIcon,
121
+ __spreadProps,
122
+ __spreadValues,
123
+ badgeSizes,
129
124
  cn,
130
125
  formatAmountDisplay,
131
126
  formatCompactUsd,
@@ -136,19 +131,590 @@ import {
136
131
  isTruthy,
137
132
  isValidDateValue,
138
133
  shortenAddress,
134
+ skeletonViews,
139
135
  toDate,
136
+ typographyVariants,
140
137
  venueLogoNames
141
- } from "./chunk-HI4EEDN5.mjs";
138
+ } from "./chunk-WKY3IN52.mjs";
139
+
140
+ // src/auth/connect-button-view/index.tsx
141
+ import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
142
+ import { useLabels, useSdkUiConfig } from "@agg-market/hooks";
143
+
144
+ // src/auth/connect-button-view/connect-button-view.constants.ts
145
+ var connectButtonContainerClassName = cn(
146
+ "inline-flex flex-col items-start gap-2 font-agg-sans"
147
+ );
148
+ var authNoticeClassName = cn("text-agg-xs leading-agg-4 text-agg-muted-foreground");
149
+ var authErrorClassName = cn("text-agg-sm leading-agg-5 text-red-500");
150
+ var authModalContainerClassName = cn("max-w-[400px] rounded-[24px]");
151
+ var authModalBodyClassName = cn("px-8 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-6");
152
+ var authSectionClassName = cn("flex w-full flex-col gap-5");
153
+ var authSectionHeadingClassName = cn(
154
+ "text-center text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground"
155
+ );
156
+ var authMethodsListClassName = cn("flex w-full flex-col gap-6 pt-2");
157
+ var authInputFormClassName = cn("flex w-full flex-col gap-3");
158
+ var authInputFieldClassName = cn(
159
+ "h-10 w-full rounded-[4px] border border-agg-separator bg-agg-secondary px-4 text-agg-base leading-agg-6 text-agg-foreground outline-none",
160
+ "placeholder:text-agg-muted-foreground focus:border-agg-separator focus-visible:ring-2 focus-visible:ring-agg-primary-hover focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary",
161
+ "disabled:cursor-not-allowed disabled:text-agg-muted-foreground"
162
+ );
163
+ var authPrimaryActionClassName = cn("h-10 w-full");
164
+ var authMethodGridClassName = cn(
165
+ "grid w-full gap-3 [grid-template-columns:repeat(auto-fit,minmax(0,1fr))]",
166
+ "[&>*]:w-full [&>*]:mx-auto"
167
+ );
168
+ var authWalletMethodGridClassName = cn("flex w-full flex-col gap-2");
169
+ var authSocialButtonClassName = cn(
170
+ "cursor-pointer! hover:cursor-pointer hover:bg-agg-secondary-hover",
171
+ "flex h-[60px] items-center justify-center rounded-xl border border-agg-separator bg-agg-secondary text-agg-foreground",
172
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary-hover focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary",
173
+ "disabled:cursor-not-allowed disabled:text-agg-muted-foreground"
174
+ );
175
+ var authWalletButtonClassName = cn(
176
+ "cursor-pointer! hover:cursor-pointer hover:bg-agg-secondary-hover",
177
+ "flex h-12 items-center justify-center gap-2 rounded-agg-full border border-agg-separator bg-agg-secondary px-4 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground",
178
+ "hover:bg-agg-secondary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary-hover focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary",
179
+ "disabled:cursor-not-allowed disabled:text-agg-muted-foreground"
180
+ );
181
+ var authWalletIconGroupClassName = cn("flex items-center justify-center -space-x-2");
182
+ var authHelperTextClassName = cn(
183
+ "text-center text-agg-xs leading-agg-4 text-agg-muted-foreground"
184
+ );
185
+ var authHelperLinkClassName = cn("underline underline-offset-2 decoration-current");
186
+ var authDividerClassName = cn("flex w-full items-center gap-3");
187
+ var authDividerLineClassName = cn("h-px flex-1 bg-agg-separator");
188
+ var authDividerLabelClassName = cn(
189
+ "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground"
190
+ );
191
+ var authLegalTextClassName = cn(
192
+ "text-center text-agg-xs leading-agg-4 text-agg-muted-foreground"
193
+ );
194
+ var connectedButtonsRowClassName = cn("inline-flex h-10 items-center gap-2");
195
+ var connectedBalanceChipClassName = cn(
196
+ "inline-flex h-10 items-center gap-3 rounded-agg-full border border-agg-separator bg-agg-secondary pl-1 pr-12 font-agg-sans"
197
+ );
198
+ var connectedProfileChipClassName = cn(
199
+ "-ml-12",
200
+ "inline-flex h-10 items-center gap-3 rounded-agg-full border border-agg-separator bg-agg-secondary pl-2 pr-3 font-agg-sans",
201
+ "cursor-pointer hover:bg-agg-secondary-hover",
202
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary-hover focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary"
203
+ );
204
+ var profileMenuContentClassName = cn(
205
+ "z-50 w-64 overflow-hidden rounded-agg-xl font-agg-sans",
206
+ "border border-agg-separator bg-agg-secondary",
207
+ "shadow-agg-popover"
208
+ );
209
+ var profileMenuSectionClassName = cn("flex w-full flex-col gap-5 px-5 py-5");
210
+ var profileMenuSeparatorClassName = cn("h-px w-full bg-agg-separator");
211
+ var profileMenuActionItemClassName = cn(
212
+ "flex w-full items-center gap-3 px-5 py-4 font-agg-sans text-agg-sm leading-agg-5 text-agg-foreground",
213
+ "outline-none",
214
+ "hover:bg-agg-secondary-hover focus:bg-agg-secondary-hover"
215
+ );
216
+ var avatarRootClassName = cn(
217
+ "inline-flex size-6 shrink-0 items-center justify-center rounded-agg-full bg-agg-separator"
218
+ );
219
+ var avatarIconClassName = cn("h-[66%] w-[66%] text-agg-muted-foreground");
220
+
221
+ // src/auth/connect-button-view/index.tsx
222
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
223
+ var WalletAvatar = ({ className }) => {
224
+ return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn(avatarRootClassName, className), children: /* @__PURE__ */ jsx(Icon, { className: avatarIconClassName, name: "wallet-avatar" }) });
225
+ };
226
+ var venueLogoNameSet = /* @__PURE__ */ new Set([
227
+ "kalshi",
228
+ "opinion",
229
+ "polymarket",
230
+ "probable"
231
+ ]);
232
+ var toVenueLogoName = (value) => {
233
+ if (!venueLogoNameSet.has(value))
234
+ return null;
235
+ return value;
236
+ };
237
+ var AuthMethodActionButton = ({
238
+ activeMethodId,
239
+ className,
240
+ disabled,
241
+ method,
242
+ onSelect,
243
+ renderLabel = true
244
+ }) => {
245
+ var _a;
246
+ const labels = useLabels();
247
+ const isMethodLoading = activeMethodId === method.id;
248
+ const isMethodDisabled = disabled || !method.isAvailable || activeMethodId !== null && !isMethodLoading;
249
+ return /* @__PURE__ */ jsxs(
250
+ "button",
251
+ {
252
+ type: "button",
253
+ className,
254
+ disabled: isMethodDisabled,
255
+ "aria-busy": isMethodLoading || void 0,
256
+ "aria-label": labels.auth.signInWithMethod(method.label),
257
+ onClick: () => onSelect(method.id),
258
+ children: [
259
+ isMethodLoading ? /* @__PURE__ */ jsx(LoadingIcon, { size: "small" }) : /* @__PURE__ */ jsx(
260
+ Icon,
261
+ {
262
+ name: (_a = method.iconName) != null ? _a : "profile",
263
+ size: "medium",
264
+ className: renderLabel ? void 0 : "h-6 w-6 text-agg-foreground",
265
+ title: renderLabel ? void 0 : method.label
266
+ }
267
+ ),
268
+ renderLabel ? /* @__PURE__ */ jsx("span", { children: labels.auth.connect(method.label) }) : null
269
+ ]
270
+ }
271
+ );
272
+ };
273
+ var UnauthenticatedConnectView = ({
274
+ activeMethodId,
275
+ buttonProps,
276
+ classNames,
277
+ disabled,
278
+ emailMethod,
279
+ emailError,
280
+ emailValue,
281
+ errorMessage,
282
+ isBusy,
283
+ isChooserOpen,
284
+ notice,
285
+ onChooserOpenChange,
286
+ onEmailChange,
287
+ onEmailSubmit,
288
+ onMethodSelect,
289
+ socialMethods,
290
+ walletMethods
291
+ }) => {
292
+ var _a, _b, _c, _d, _e;
293
+ const labels = useLabels();
294
+ const hasConfiguredMethods = emailMethod !== null || socialMethods.length > 0 || walletMethods.length > 0;
295
+ const showWalletDivider = walletMethods.length > 0 && (emailMethod !== null || socialMethods.length > 0);
296
+ return /* @__PURE__ */ jsxs("div", { className: cn(connectButtonContainerClassName, classNames == null ? void 0 : classNames.root), children: [
297
+ /* @__PURE__ */ jsx(
298
+ Button,
299
+ __spreadProps(__spreadValues({
300
+ variant: "primary",
301
+ size: "large",
302
+ className: classNames == null ? void 0 : classNames.connectButton,
303
+ onClick: () => onChooserOpenChange(true),
304
+ disabled: disabled || !hasConfiguredMethods,
305
+ "aria-label": labels.auth.connect()
306
+ }, buttonProps), {
307
+ children: labels.auth.connect()
308
+ })
309
+ ),
310
+ notice ? /* @__PURE__ */ jsx("p", { className: cn(authNoticeClassName, classNames == null ? void 0 : classNames.authNotice), children: notice }) : null,
311
+ /* @__PURE__ */ jsx(Modal, { open: isChooserOpen, onOpenChange: onChooserOpenChange, children: /* @__PURE__ */ jsxs(
312
+ Modal.Container,
313
+ {
314
+ maxWidth: "400px",
315
+ classNames: {
316
+ container: cn(authModalContainerClassName, classNames == null ? void 0 : classNames.authModalContent)
317
+ },
318
+ "aria-label": labels.auth.signIn,
319
+ children: [
320
+ /* @__PURE__ */ jsx(
321
+ Modal.Header,
322
+ {
323
+ title: labels.auth.signIn,
324
+ hideBorder: true,
325
+ classNames: {
326
+ container: "px-8 py-6",
327
+ title: "text-agg-2xl leading-agg-8",
328
+ titleContainer: "max-w-none"
329
+ }
330
+ }
331
+ ),
332
+ /* @__PURE__ */ jsx(Modal.Body, { classNames: { root: authModalBodyClassName }, children: /* @__PURE__ */ jsxs("div", { className: authMethodsListClassName, children: [
333
+ emailMethod ? /* @__PURE__ */ jsxs(
334
+ "form",
335
+ {
336
+ className: authSectionClassName,
337
+ onSubmit: (event) => {
338
+ event.preventDefault();
339
+ onEmailSubmit();
340
+ },
341
+ children: [
342
+ /* @__PURE__ */ jsxs("div", { className: authInputFormClassName, children: [
343
+ /* @__PURE__ */ jsx(
344
+ "input",
345
+ {
346
+ id: "agg-auth-email",
347
+ type: "email",
348
+ value: emailValue,
349
+ onChange: (event) => onEmailChange(event.target.value),
350
+ placeholder: (_b = (_a = emailMethod.input) == null ? void 0 : _a.placeholder) != null ? _b : labels.auth.emailAddress,
351
+ className: cn(authInputFieldClassName, classNames == null ? void 0 : classNames.authFormField),
352
+ autoFocus: true,
353
+ "aria-label": labels.auth.emailAddress,
354
+ disabled: disabled || isBusy || !emailMethod.isAvailable
355
+ }
356
+ ),
357
+ /* @__PURE__ */ jsx(
358
+ Button,
359
+ {
360
+ type: "submit",
361
+ variant: "secondary",
362
+ size: "large",
363
+ className: authPrimaryActionClassName,
364
+ isLoading: activeMethodId === emailMethod.id,
365
+ disabled: disabled || isBusy || !emailMethod.isAvailable,
366
+ children: (_d = (_c = emailMethod.input) == null ? void 0 : _c.submitLabel) != null ? _d : labels.auth.continue
367
+ }
368
+ )
369
+ ] }),
370
+ emailMethod.isAvailable && ((_e = emailMethod.input) == null ? void 0 : _e.helperText) ? /* @__PURE__ */ jsx("p", { className: cn(authNoticeClassName, classNames == null ? void 0 : classNames.authNotice), children: emailMethod.input.helperText }) : null,
371
+ !emailMethod.isAvailable ? /* @__PURE__ */ jsx(
372
+ InlineAlert,
373
+ {
374
+ tone: "warning",
375
+ variant: "surface",
376
+ message: labels.auth.emailUnavailable,
377
+ className: classNames == null ? void 0 : classNames.authError
378
+ }
379
+ ) : null,
380
+ emailError ? /* @__PURE__ */ jsx(
381
+ InlineAlert,
382
+ {
383
+ tone: "error",
384
+ title: labels.common.errorPrefix,
385
+ message: emailError,
386
+ className: classNames == null ? void 0 : classNames.authError
387
+ }
388
+ ) : null
389
+ ]
390
+ }
391
+ ) : null,
392
+ socialMethods.length > 0 ? /* @__PURE__ */ jsxs("div", { className: authSectionClassName, children: [
393
+ /* @__PURE__ */ jsx("div", { className: cn(authMethodGridClassName, classNames == null ? void 0 : classNames.authMethodGrid), children: socialMethods.map((method) => /* @__PURE__ */ jsx(
394
+ AuthMethodActionButton,
395
+ {
396
+ activeMethodId,
397
+ className: cn(authSocialButtonClassName, classNames == null ? void 0 : classNames.authMethodButton),
398
+ disabled: disabled || isBusy,
399
+ method,
400
+ onSelect: onMethodSelect,
401
+ renderLabel: false
402
+ },
403
+ method.id
404
+ )) }),
405
+ /* @__PURE__ */ jsxs("p", { className: authHelperTextClassName, children: [
406
+ labels.auth.socialWalletNotice,
407
+ " ",
408
+ /* @__PURE__ */ jsx("span", { className: cn(authHelperLinkClassName, classNames == null ? void 0 : classNames.authHelperLink), children: labels.auth.learnMore })
409
+ ] })
410
+ ] }) : null,
411
+ showWalletDivider ? /* @__PURE__ */ jsxs("div", { className: authDividerClassName, children: [
412
+ /* @__PURE__ */ jsx("div", { className: authDividerLineClassName }),
413
+ /* @__PURE__ */ jsx("span", { className: authDividerLabelClassName, children: labels.auth.dividerOr }),
414
+ /* @__PURE__ */ jsx("div", { className: authDividerLineClassName })
415
+ ] }) : null,
416
+ walletMethods.length > 0 ? /* @__PURE__ */ jsx("div", { className: authSectionClassName, children: /* @__PURE__ */ jsx("div", { className: cn(authWalletMethodGridClassName, classNames == null ? void 0 : classNames.authMethodGrid), children: walletMethods.map((method) => /* @__PURE__ */ jsx(
417
+ AuthMethodActionButton,
418
+ {
419
+ activeMethodId,
420
+ className: cn(authWalletButtonClassName, classNames == null ? void 0 : classNames.authMethodButton),
421
+ disabled: disabled || isBusy,
422
+ method,
423
+ onSelect: onMethodSelect
424
+ },
425
+ method.id
426
+ )) }) }) : null,
427
+ /* @__PURE__ */ jsxs("p", { className: authLegalTextClassName, children: [
428
+ labels.auth.legalNoticePrefix,
429
+ " ",
430
+ /* @__PURE__ */ jsx("span", { className: cn(authHelperLinkClassName, classNames == null ? void 0 : classNames.authHelperLink), children: labels.auth.terms }),
431
+ " ",
432
+ labels.auth.legalNoticeSeparator,
433
+ " ",
434
+ /* @__PURE__ */ jsx("span", { className: cn(authHelperLinkClassName, classNames == null ? void 0 : classNames.authHelperLink), children: labels.auth.privacyPolicy }),
435
+ "."
436
+ ] }),
437
+ errorMessage ? /* @__PURE__ */ jsx(
438
+ InlineAlert,
439
+ {
440
+ tone: "error",
441
+ title: labels.common.errorPrefix,
442
+ message: errorMessage,
443
+ className: classNames == null ? void 0 : classNames.authError
444
+ }
445
+ ) : null
446
+ ] }) })
447
+ ]
448
+ }
449
+ ) })
450
+ ] });
451
+ };
452
+ var AuthConnectButtonView = ({
453
+ activeMethodId,
454
+ addressLabel,
455
+ balanceRows,
456
+ buttonProps,
457
+ classNames,
458
+ disabled,
459
+ emailMethod,
460
+ emailError,
461
+ emailValue,
462
+ errorMessage,
463
+ isAuthenticated,
464
+ isBalanceLoading,
465
+ isBusy,
466
+ isChooserOpen,
467
+ isProfileMenuOpen,
468
+ notice,
469
+ onChooserOpenChange,
470
+ onDepositClick,
471
+ onDisconnectClick,
472
+ onEmailChange,
473
+ onEmailSubmit,
474
+ onMethodSelect,
475
+ onProfileClick,
476
+ onProfileMenuOpenChange,
477
+ socialMethods,
478
+ onViewAllBalancesClick,
479
+ onWithdrawClick,
480
+ profileLabel,
481
+ totalBalance,
482
+ walletMethods
483
+ }) => {
484
+ const labels = useLabels();
485
+ const { enableAnimations, rootClassName } = useSdkUiConfig();
486
+ const resolvedProfileLabel = profileLabel || labels.auth.myProfile;
487
+ const dropdownMenuItemClassName = cn(
488
+ "cursor-pointer",
489
+ profileMenuActionItemClassName,
490
+ enableAnimations ? "transition-colors" : null,
491
+ disabled ? "pointer-events-none opacity-50" : null,
492
+ classNames == null ? void 0 : classNames.profileMenuActionItem
493
+ );
494
+ if (!isAuthenticated) {
495
+ return /* @__PURE__ */ jsx(
496
+ UnauthenticatedConnectView,
497
+ {
498
+ activeMethodId,
499
+ buttonProps,
500
+ classNames,
501
+ disabled,
502
+ emailMethod,
503
+ emailError,
504
+ emailValue,
505
+ errorMessage,
506
+ isBusy,
507
+ isChooserOpen,
508
+ notice,
509
+ onChooserOpenChange,
510
+ onEmailChange,
511
+ onEmailSubmit,
512
+ onMethodSelect,
513
+ socialMethods,
514
+ walletMethods
515
+ }
516
+ );
517
+ }
518
+ return /* @__PURE__ */ jsx("div", { className: cn(connectButtonContainerClassName, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ jsxs("div", { className: cn(connectedButtonsRowClassName, classNames == null ? void 0 : classNames.connectedRow), children: [
519
+ /* @__PURE__ */ jsxs("div", { className: cn(connectedBalanceChipClassName, classNames == null ? void 0 : classNames.balanceChip), children: [
520
+ /* @__PURE__ */ jsx(
521
+ Button,
522
+ {
523
+ variant: "primary",
524
+ size: "small",
525
+ className: cn("h-6 px-3 text-agg-xs leading-agg-4", classNames == null ? void 0 : classNames.depositButton),
526
+ onClick: onDepositClick,
527
+ disabled,
528
+ "aria-label": labels.auth.deposit,
529
+ children: labels.auth.deposit
530
+ }
531
+ ),
532
+ /* @__PURE__ */ jsx("p", { className: cn("agg-type-label text-agg-foreground", classNames == null ? void 0 : classNames.balanceText), children: isBalanceLoading ? /* @__PURE__ */ jsx(LoadingIcon, { size: "small" }) : formatUsd(totalBalance) })
533
+ ] }),
534
+ /* @__PURE__ */ jsxs(DropdownMenu.Root, { open: isProfileMenuOpen, onOpenChange: onProfileMenuOpenChange, children: [
535
+ /* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
536
+ "button",
537
+ {
538
+ type: "button",
539
+ className: cn(
540
+ connectedProfileChipClassName,
541
+ enableAnimations ? "transition-colors" : null,
542
+ classNames == null ? void 0 : classNames.profileTrigger
543
+ ),
544
+ disabled,
545
+ "aria-label": labels.auth.walletMenuFor(resolvedProfileLabel),
546
+ children: [
547
+ /* @__PURE__ */ jsx(WalletAvatar, {}),
548
+ /* @__PURE__ */ jsx(
549
+ "span",
550
+ {
551
+ className: cn(
552
+ "agg-type-body-strong text-agg-foreground",
553
+ classNames == null ? void 0 : classNames.profileTriggerLabel
554
+ ),
555
+ children: resolvedProfileLabel
556
+ }
557
+ ),
558
+ /* @__PURE__ */ jsx(
559
+ Icon,
560
+ {
561
+ name: isProfileMenuOpen ? "chevron-up" : "chevron-down",
562
+ size: "small",
563
+ className: "h-3.5 w-3.5 text-agg-foreground",
564
+ "aria-hidden": "true"
565
+ }
566
+ )
567
+ ]
568
+ }
569
+ ) }),
570
+ /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsxs(
571
+ DropdownMenu.Content,
572
+ {
573
+ className: cn(
574
+ AGG_ROOT_CLASS_NAME,
575
+ rootClassName,
576
+ profileMenuContentClassName,
577
+ classNames == null ? void 0 : classNames.profileMenuContent
578
+ ),
579
+ "data-agg-animations": enableAnimations ? "true" : "false",
580
+ sideOffset: 4,
581
+ align: "end",
582
+ children: [
583
+ /* @__PURE__ */ jsx(
584
+ "button",
585
+ {
586
+ type: "button",
587
+ className: cn(
588
+ profileMenuSectionClassName,
589
+ "cursor-pointer",
590
+ classNames == null ? void 0 : classNames.profileMenuSection
591
+ ),
592
+ onClick: onProfileClick,
593
+ disabled,
594
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
595
+ /* @__PURE__ */ jsx(WalletAvatar, { className: "size-11" }),
596
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-0.5", children: [
597
+ /* @__PURE__ */ jsx("p", { className: "text-agg-lg font-agg-bold leading-agg-7 text-agg-foreground", children: resolvedProfileLabel }),
598
+ addressLabel ? /* @__PURE__ */ jsx("p", { className: "text-agg-sm font-agg-normal leading-agg-5 text-agg-muted-foreground", children: addressLabel }) : null
599
+ ] })
600
+ ] })
601
+ }
602
+ ),
603
+ /* @__PURE__ */ jsx(
604
+ "div",
605
+ {
606
+ className: cn(profileMenuSeparatorClassName, classNames == null ? void 0 : classNames.profileMenuSeparator)
607
+ }
608
+ ),
609
+ /* @__PURE__ */ jsx("div", { className: cn(profileMenuSectionClassName, classNames == null ? void 0 : classNames.profileMenuSection), children: isBalanceLoading ? /* @__PURE__ */ jsxs("p", { className: "flex flex-col gap-2 items-center justify-center text-agg-sm font-agg-normal leading-agg-5 text-agg-muted-foreground", children: [
610
+ /* @__PURE__ */ jsx(LoadingIcon, {}),
611
+ labels.auth.loadingBalances
612
+ ] }) : balanceRows.length === 0 ? /* @__PURE__ */ jsxs("p", { className: "flex flex-col gap-2 items-center justify-center text-agg-sm font-agg-normal leading-agg-5 text-agg-muted-foreground", children: [
613
+ /* @__PURE__ */ jsx(Icon, { name: "warning", className: "text-agg-primary" }),
614
+ labels.auth.noBalances
615
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
616
+ /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-between", children: [
617
+ /* @__PURE__ */ jsx("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 tracking-agg-normal text-agg-muted-foreground", children: labels.auth.balances }),
618
+ /* @__PURE__ */ jsx(
619
+ Button,
620
+ {
621
+ variant: "tertiary",
622
+ size: "small",
623
+ className: "h-6 px-3 text-agg-xs leading-agg-4",
624
+ onClick: onViewAllBalancesClick,
625
+ children: labels.auth.viewAll
626
+ }
627
+ )
628
+ ] }),
629
+ balanceRows.map((row) => {
630
+ var _a;
631
+ const venueLogoName = toVenueLogoName(row.venueKey);
632
+ return /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-between", children: [
633
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
634
+ venueLogoName ? /* @__PURE__ */ jsx(VenueLogo, { venue: venueLogoName, size: "small" }) : null,
635
+ /* @__PURE__ */ jsx("p", { className: "text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground", children: (_a = labels.venues[row.venueKey]) != null ? _a : row.venueKey })
636
+ ] }),
637
+ /* @__PURE__ */ jsx("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: formatUsd(row.balance) })
638
+ ] }, row.key);
639
+ })
640
+ ] }) }),
641
+ /* @__PURE__ */ jsx(
642
+ "div",
643
+ {
644
+ className: cn(profileMenuSeparatorClassName, classNames == null ? void 0 : classNames.profileMenuSeparator)
645
+ }
646
+ ),
647
+ /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col py-2", children: [
648
+ /* @__PURE__ */ jsxs(
649
+ DropdownMenu.Item,
650
+ {
651
+ className: dropdownMenuItemClassName,
652
+ onSelect: onProfileClick,
653
+ disabled,
654
+ children: [
655
+ /* @__PURE__ */ jsx(Icon, { name: "profile", size: "small", className: "text-agg-foreground" }),
656
+ /* @__PURE__ */ jsx("span", { children: labels.auth.myProfile })
657
+ ]
658
+ }
659
+ ),
660
+ /* @__PURE__ */ jsxs(
661
+ DropdownMenu.Item,
662
+ {
663
+ className: dropdownMenuItemClassName,
664
+ onSelect: onDepositClick,
665
+ disabled,
666
+ children: [
667
+ /* @__PURE__ */ jsx(Icon, { name: "download", size: "small", className: "text-agg-foreground" }),
668
+ /* @__PURE__ */ jsx("span", { children: labels.auth.deposit })
669
+ ]
670
+ }
671
+ ),
672
+ /* @__PURE__ */ jsxs(
673
+ DropdownMenu.Item,
674
+ {
675
+ className: dropdownMenuItemClassName,
676
+ onSelect: onWithdrawClick,
677
+ disabled,
678
+ children: [
679
+ /* @__PURE__ */ jsx(Icon, { name: "upload", size: "small", className: "text-agg-foreground" }),
680
+ /* @__PURE__ */ jsx("span", { children: labels.auth.withdraw })
681
+ ]
682
+ }
683
+ ),
684
+ /* @__PURE__ */ jsxs(
685
+ DropdownMenu.Item,
686
+ {
687
+ className: dropdownMenuItemClassName,
688
+ onSelect: onDisconnectClick,
689
+ disabled,
690
+ children: [
691
+ /* @__PURE__ */ jsx(Icon, { name: "disconnect", size: "small", className: "text-agg-foreground" }),
692
+ /* @__PURE__ */ jsx("span", { children: labels.auth.disconnect })
693
+ ]
694
+ }
695
+ )
696
+ ] })
697
+ ]
698
+ }
699
+ ) })
700
+ ] })
701
+ ] }) });
702
+ };
703
+ AuthConnectButtonView.displayName = "AuthConnectButtonView";
142
704
  export {
143
705
  AGG_ROOT_CLASS_NAME,
706
+ AppleIcon,
144
707
  ArrowTrendUpIcon,
145
708
  ArrowsToDotIcon,
709
+ AuthConnectButtonView,
146
710
  Badge,
147
711
  BankIcon,
148
712
  BestPricesIcon,
149
713
  BoltIcon,
150
714
  Button,
151
715
  Card,
716
+ ChartCandlestickIcon,
717
+ ChartLineIcon,
152
718
  CheckCircleIcon,
153
719
  ChevronDownIcon,
154
720
  ChevronLeftIcon,
@@ -156,7 +722,6 @@ export {
156
722
  ChevronUpIcon,
157
723
  CloseIcon,
158
724
  ConnectAccountsStep,
159
- ConnectButton,
160
725
  ConnectKalshiModal,
161
726
  ConnectOnchainModal,
162
727
  CopyIcon,
@@ -167,16 +732,21 @@ export {
167
732
  DocumentIcon,
168
733
  DotsHorizontalIcon,
169
734
  DownloadIcon,
735
+ ErrorFilledIcon,
736
+ EthereumIcon,
170
737
  EventList,
171
738
  EventListItem,
172
739
  EventListItemDetails,
173
740
  EventMarketPage,
174
741
  ExternalLinkIcon,
742
+ GoogleIcon,
175
743
  HelloWorld,
176
744
  HomePage,
177
745
  HowItWorksStep,
178
746
  Icon,
747
+ ImageIcon,
179
748
  InfoIcon,
749
+ InlineAlert,
180
750
  LineChart,
181
751
  LinkAccountsIcon,
182
752
  LoadingIcon,
@@ -190,6 +760,7 @@ export {
190
760
  ProfileIcon,
191
761
  ProfileModal,
192
762
  ProfileSetupStep,
763
+ RemoteImage,
193
764
  RevenueAltIcon,
194
765
  Search,
195
766
  SearchIcon,
@@ -197,6 +768,7 @@ export {
197
768
  Settlement,
198
769
  ShieldTrustIcon,
199
770
  Skeleton,
771
+ SolanaIcon,
200
772
  StateMessage,
201
773
  StayInControlIcon,
202
774
  SwitchButton,