@funkit/connect 11.6.0 → 11.7.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 (34) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/clients/{chunk-UPB4JKJG.js → chunk-44USAVWK.js} +12 -7
  3. package/dist/clients/{chunk-FNB7OPJI.js → chunk-AXLGZ5XX.js} +10 -1
  4. package/dist/clients/{chunk-ZQZDPRWC.js → chunk-FGUMPXTO.js} +1 -1
  5. package/dist/clients/{chunk-DUBZPIDN.js → chunk-I4B5AKZC.js} +1 -1
  6. package/dist/clients/{chunk-SX3CX34W.js → chunk-NM2NAKI3.js} +106 -88
  7. package/dist/clients/{chunk-LYZLETOM.js → chunk-OASVWVSV.js} +1 -1
  8. package/dist/clients/{chunk-WNZ6QV5Q.js → chunk-SG4ZS447.js} +16 -0
  9. package/dist/clients/fanatics.js +2 -2
  10. package/dist/clients/internal/nado/withdrawalCallback.js +3 -3
  11. package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
  12. package/dist/clients/internal/nado/withdrawalForm.js +3 -3
  13. package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
  14. package/dist/clients/lighter.js +4 -4
  15. package/dist/clients/mallard.js +2 -2
  16. package/dist/clients/nado.js +3 -3
  17. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +5 -5
  18. package/dist/clients/polymarket/index.js +5 -5
  19. package/dist/hooks/track/analytics/checkout.d.ts +10 -0
  20. package/dist/hooks/track/analytics/events.d.ts +2 -1
  21. package/dist/hooks/track/analytics/resolveExecutionProgressContext.d.ts +2 -1
  22. package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +0 -16
  23. package/dist/hooks/useTextMeasurer.d.ts +1 -1
  24. package/dist/index.js +3359 -3014
  25. package/dist/modals/WithdrawalModal/RecipientAddress.d.ts +5 -0
  26. package/dist/providers/FunkitCheckoutContext/types.d.ts +14 -17
  27. package/dist/providers/FunkitShadowHostProvider.d.ts +31 -0
  28. package/dist/providers/FunkitThemeStyle.d.ts +12 -0
  29. package/dist/shadow/loadShadowCss.d.ts +9 -0
  30. package/dist/shadow/useMountShadowHost.d.ts +18 -0
  31. package/dist/shadow/useShadowCss.d.ts +6 -0
  32. package/dist/shadow-css.js +1 -1
  33. package/dist/wallets/walletConnectors/index.js +4 -4
  34. package/package.json +4 -4
@@ -3,7 +3,7 @@ import {
3
3
  FunInput,
4
4
  FunSkeletonBlock,
5
5
  TooltipAnchorRefContext
6
- } from "./chunk-FNB7OPJI.js";
6
+ } from "./chunk-AXLGZ5XX.js";
7
7
  import {
8
8
  Box,
9
9
  Text,
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-LUHEVXPD.js";
12
12
  import {
13
13
  useFunkitTranslation
14
- } from "./chunk-LYZLETOM.js";
14
+ } from "./chunk-OASVWVSV.js";
15
15
  import {
16
16
  POLYMARKET_PERPS_ROUTING_ID,
17
17
  POLYMARKET_PREDICTIONS_ROUTING_ID
@@ -25,17 +25,17 @@ import {
25
25
  } from "./chunk-AHYOV7AV.js";
26
26
 
27
27
  // src/clients/polymarket/PolymarketDepositAccountDropdown.tsx
28
- import React12 from "react";
28
+ import React13 from "react";
29
29
  import { getAddress } from "viem";
30
30
  import { polygon } from "viem/chains";
31
31
 
32
32
  // src/components/Dropdown/AccountSelectDropdown.tsx
33
- import React11, { useEffect as useEffect4 } from "react";
33
+ import React12, { useEffect as useEffect4 } from "react";
34
34
 
35
35
  // src/components/Dropdown/BaseDropdown.tsx
36
36
  import { isMobile } from "@funkit/utils";
37
37
  import * as DropdownMenu2 from "@radix-ui/react-dropdown-menu";
38
- import React10, { useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState3 } from "react";
38
+ import React11, { useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState3 } from "react";
39
39
 
40
40
  // src/hooks/useScrollDivider.ts
41
41
  import { useCallback, useEffect, useState } from "react";
@@ -98,15 +98,31 @@ var useScrollDivider = () => {
98
98
  // src/providers/FunkitProvider.tsx
99
99
  import { LogLevel, initializeRelayClient } from "@funkit/fun-relay";
100
100
  import { QueryClientProvider } from "@tanstack/react-query";
101
- import React8, {
102
- createContext,
103
- useContext,
101
+ import React9, {
102
+ createContext as createContext2,
103
+ useContext as useContext2,
104
104
  useEffect as useEffect2,
105
105
  useMemo,
106
106
  useRef,
107
107
  useState as useState2
108
108
  } from "react";
109
109
 
110
+ // src/providers/FunkitShadowHostProvider.tsx
111
+ import React, { createContext, useContext } from "react";
112
+ import { createPortal } from "react-dom";
113
+ var ShadowContainerContext = createContext(null);
114
+ function useShadowContainer() {
115
+ const container = useContext(ShadowContainerContext);
116
+ if (container) {
117
+ return container;
118
+ }
119
+ return typeof document === "undefined" ? null : document.body;
120
+ }
121
+ function useRootNode() {
122
+ const container = useContext(ShadowContainerContext);
123
+ return container ? container.getRootNode() : document;
124
+ }
125
+
110
126
  // src/utils/tokenMath.ts
111
127
  import { formatCurrencyAndStringify } from "@funkit/utils";
112
128
  import * as dnum from "dnum";
@@ -120,11 +136,11 @@ function formatUsdFlooredToCent(balanceUsd) {
120
136
  }
121
137
 
122
138
  // src/components/Icons/CheckIcon.tsx
123
- import React from "react";
139
+ import React2 from "react";
124
140
  var CheckIcon = ({
125
141
  size = 16,
126
142
  className
127
- }) => /* @__PURE__ */ React.createElement(
143
+ }) => /* @__PURE__ */ React2.createElement(
128
144
  "svg",
129
145
  {
130
146
  width: size,
@@ -134,7 +150,7 @@ var CheckIcon = ({
134
150
  xmlns: "http://www.w3.org/2000/svg",
135
151
  className
136
152
  },
137
- /* @__PURE__ */ React.createElement(
153
+ /* @__PURE__ */ React2.createElement(
138
154
  "path",
139
155
  {
140
156
  d: "M12.4919 4.88281L6.25757 11.1172L3.50781 8",
@@ -150,7 +166,7 @@ var CheckIcon = ({
150
166
  // src/components/Dropdown/BaseDropdownItem.tsx
151
167
  import { noop } from "@funkit/utils";
152
168
  import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
153
- import React2 from "react";
169
+ import React3 from "react";
154
170
  import clsx from "clsx";
155
171
 
156
172
  // src/components/Dropdown/BaseDropdownItem.css.ts
@@ -172,14 +188,14 @@ function BaseDropdownItem({
172
188
  horizontalPadding = "dropdownItemPaddingX",
173
189
  verticalPadding = "dropdownItemPaddingY"
174
190
  }) {
175
- return /* @__PURE__ */ React2.createElement(
191
+ return /* @__PURE__ */ React3.createElement(
176
192
  DropdownMenu.Item,
177
193
  {
178
194
  disabled: isDisabled,
179
195
  onSelect: () => onClick(id),
180
196
  asChild: true
181
197
  },
182
- /* @__PURE__ */ React2.createElement(
198
+ /* @__PURE__ */ React3.createElement(
183
199
  Box,
184
200
  {
185
201
  width: "full",
@@ -195,7 +211,7 @@ function BaseDropdownItem({
195
211
  boxShadow: isSelected ? "selectedDropdownItem" : void 0,
196
212
  borderRadius
197
213
  },
198
- /* @__PURE__ */ React2.createElement(
214
+ /* @__PURE__ */ React3.createElement(
199
215
  Box,
200
216
  {
201
217
  display: "flex",
@@ -203,8 +219,8 @@ function BaseDropdownItem({
203
219
  justifyContent: "flex-start",
204
220
  gap: horizontalIconGap
205
221
  },
206
- iconComponent && /* @__PURE__ */ React2.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "center" }, iconComponent),
207
- /* @__PURE__ */ React2.createElement(Box, { display: "flex", flexDirection: "column", justifyContent: "center" }, /* @__PURE__ */ React2.createElement(
222
+ iconComponent && /* @__PURE__ */ React3.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "center" }, iconComponent),
223
+ /* @__PURE__ */ React3.createElement(Box, { display: "flex", flexDirection: "column", justifyContent: "center" }, /* @__PURE__ */ React3.createElement(
208
224
  Text,
209
225
  {
210
226
  size: "dropdownItemFontSize",
@@ -212,9 +228,9 @@ function BaseDropdownItem({
212
228
  color: isSelected ? "selectedDropdownItemText" : void 0
213
229
  },
214
230
  label
215
- ), description != null && /* @__PURE__ */ React2.createElement(Text, { size: "12", color: "secondaryText" }, description))
231
+ ), description != null && /* @__PURE__ */ React3.createElement(Text, { size: "12", color: "secondaryText" }, description))
216
232
  ),
217
- /* @__PURE__ */ React2.createElement(
233
+ /* @__PURE__ */ React3.createElement(
218
234
  Box,
219
235
  {
220
236
  display: "flex",
@@ -223,7 +239,7 @@ function BaseDropdownItem({
223
239
  gap: "16"
224
240
  },
225
241
  tagComponent,
226
- /* @__PURE__ */ React2.createElement(
242
+ /* @__PURE__ */ React3.createElement(
227
243
  Box,
228
244
  {
229
245
  width: "16",
@@ -232,7 +248,7 @@ function BaseDropdownItem({
232
248
  justifyContent: "center",
233
249
  color: isSelected ? "selectedDropdownItemText" : "transparent"
234
250
  },
235
- /* @__PURE__ */ React2.createElement(CheckIcon, null)
251
+ /* @__PURE__ */ React3.createElement(CheckIcon, null)
236
252
  )
237
253
  )
238
254
  )
@@ -249,7 +265,7 @@ var scrollableDropdownStyles = "_1nns6ys3";
249
265
 
250
266
  // src/components/Icons/CaretDownIcon.tsx
251
267
  import clsx2 from "clsx";
252
- import React3 from "react";
268
+ import React4 from "react";
253
269
 
254
270
  // src/components/Icons/CaretDownIcon.css.ts
255
271
  var caretClosed = "_1gjdf1i3";
@@ -257,7 +273,7 @@ var caretOpened = "_1gjdf1i2";
257
273
 
258
274
  // src/components/Icons/CaretDownIcon.tsx
259
275
  var CaretDownIcon = () => {
260
- return /* @__PURE__ */ React3.createElement(
276
+ return /* @__PURE__ */ React4.createElement(
261
277
  "svg",
262
278
  {
263
279
  width: "8",
@@ -266,7 +282,7 @@ var CaretDownIcon = () => {
266
282
  fill: "none",
267
283
  xmlns: "http://www.w3.org/2000/svg"
268
284
  },
269
- /* @__PURE__ */ React3.createElement(
285
+ /* @__PURE__ */ React4.createElement(
270
286
  "path",
271
287
  {
272
288
  d: "M3.45163 2.92973L0.879121 0.393174C0.654314 0.188182 0.317464 0.217886 0.126753 0.459527C-0.0639587 0.701168 -0.036324 1.06324 0.188483 1.26824L3.60944 4.64138C3.65478 4.68988 3.70789 4.72919 3.76623 4.7574C3.83874 4.79249 3.91764 4.80968 3.99714 4.80771C4.07647 4.80576 4.15489 4.78486 4.22578 4.74655C4.23264 4.74283 4.23943 4.73894 4.24614 4.7349C4.28505 4.71152 4.32107 4.68295 4.35332 4.64987L7.82907 1.18704C8.04528 0.97163 8.0581 0.608604 7.8577 0.376205C7.6573 0.143806 7.31956 0.130027 7.10335 0.345432L4.51922 2.91996C4.51922 2.94623 4 3.43025 4 3.43025L3.45163 2.92973Z",
@@ -284,7 +300,7 @@ var AnimatedCaretDownIcon = ({
284
300
  expanded !== void 0 && (expanded ? caretOpened : caretClosed)
285
301
  );
286
302
  if (compact) {
287
- return /* @__PURE__ */ React3.createElement(
303
+ return /* @__PURE__ */ React4.createElement(
288
304
  Box,
289
305
  {
290
306
  color,
@@ -295,10 +311,10 @@ var AnimatedCaretDownIcon = ({
295
311
  justifyContent: "center",
296
312
  className: animationClassName
297
313
  },
298
- /* @__PURE__ */ React3.createElement(CaretDownIcon, null)
314
+ /* @__PURE__ */ React4.createElement(CaretDownIcon, null)
299
315
  );
300
316
  }
301
- return /* @__PURE__ */ React3.createElement(
317
+ return /* @__PURE__ */ React4.createElement(
302
318
  Box,
303
319
  {
304
320
  color,
@@ -309,7 +325,7 @@ var AnimatedCaretDownIcon = ({
309
325
  justifyContent: "center",
310
326
  className: animationClassName
311
327
  },
312
- /* @__PURE__ */ React3.createElement(
328
+ /* @__PURE__ */ React4.createElement(
313
329
  Box,
314
330
  {
315
331
  width: "8",
@@ -318,7 +334,7 @@ var AnimatedCaretDownIcon = ({
318
334
  alignItems: "center",
319
335
  justifyContent: "center"
320
336
  },
321
- /* @__PURE__ */ React3.createElement(CaretDownIcon, null)
337
+ /* @__PURE__ */ React4.createElement(CaretDownIcon, null)
322
338
  )
323
339
  );
324
340
  };
@@ -386,16 +402,16 @@ function usePolymarketAccountBalances(accounts, options) {
386
402
  }
387
403
 
388
404
  // src/components/FunNoResults/FunNoResults.tsx
389
- import React6 from "react";
405
+ import React7 from "react";
390
406
 
391
407
  // src/components/Icons/CoinsIcon.tsx
392
- import React4 from "react";
408
+ import React5 from "react";
393
409
  var CoinsIcon = ({
394
410
  size = 48,
395
411
  bgColor = "#141C41",
396
412
  iconColor = "#878A98"
397
413
  }) => {
398
- return /* @__PURE__ */ React4.createElement(
414
+ return /* @__PURE__ */ React5.createElement(
399
415
  "svg",
400
416
  {
401
417
  width: size,
@@ -404,14 +420,14 @@ var CoinsIcon = ({
404
420
  fill: "none",
405
421
  xmlns: "http://www.w3.org/2000/svg"
406
422
  },
407
- /* @__PURE__ */ React4.createElement("g", { clipPath: "url(#clip0_30657_22302)" }, /* @__PURE__ */ React4.createElement(
423
+ /* @__PURE__ */ React5.createElement("g", { clipPath: "url(#clip0_30657_22302)" }, /* @__PURE__ */ React5.createElement(
408
424
  "path",
409
425
  {
410
426
  d: "M24 1C36.9787 1 47.5 11.5213 47.5 24.5C47.5 37.4787 36.9787 48 24 48C11.0213 48 0.5 37.4787 0.5 24.5C0.5 11.5213 11.0213 1 24 1Z",
411
427
  fill: bgColor,
412
428
  stroke: bgColor
413
429
  }
414
- ), /* @__PURE__ */ React4.createElement("g", { clipPath: "url(#clip1_30657_22302)" }, /* @__PURE__ */ React4.createElement(
430
+ ), /* @__PURE__ */ React5.createElement("g", { clipPath: "url(#clip1_30657_22302)" }, /* @__PURE__ */ React5.createElement(
415
431
  "path",
416
432
  {
417
433
  d: "M25 17C25 18.1046 22.5376 19 19.5 19C16.4624 19 14 18.1046 14 17M25 17C25 15.8954 22.5376 15 19.5 15C16.4624 15 14 15.8954 14 17M25 17V18.5M14 17V29C14 30.1046 16.4624 31 19.5 31M19.5 23C19.3315 23 19.1647 22.9972 19 22.9918C16.1967 22.9 14 22.0433 14 21M19.5 27C16.4624 27 14 26.1046 14 25M34 23.5C34 24.6046 31.5376 25.5 28.5 25.5C25.4624 25.5 23 24.6046 23 23.5M34 23.5C34 22.3954 31.5376 21.5 28.5 21.5C25.4624 21.5 23 22.3954 23 23.5M34 23.5V31C34 32.1046 31.5376 33 28.5 33C25.4624 33 23 32.1046 23 31V23.5M34 27.25C34 28.3546 31.5376 29.25 28.5 29.25C25.4624 29.25 23 28.3546 23 27.25",
@@ -421,7 +437,7 @@ var CoinsIcon = ({
421
437
  strokeLinejoin: "round"
422
438
  }
423
439
  ))),
424
- /* @__PURE__ */ React4.createElement("defs", null, /* @__PURE__ */ React4.createElement("clipPath", { id: "clip0_30657_22302" }, /* @__PURE__ */ React4.createElement(
440
+ /* @__PURE__ */ React5.createElement("defs", null, /* @__PURE__ */ React5.createElement("clipPath", { id: "clip0_30657_22302" }, /* @__PURE__ */ React5.createElement(
425
441
  "rect",
426
442
  {
427
443
  width: "48",
@@ -429,7 +445,7 @@ var CoinsIcon = ({
429
445
  fill: "white",
430
446
  transform: "translate(0 0.5)"
431
447
  }
432
- )), /* @__PURE__ */ React4.createElement("clipPath", { id: "clip1_30657_22302" }, /* @__PURE__ */ React4.createElement(
448
+ )), /* @__PURE__ */ React5.createElement("clipPath", { id: "clip1_30657_22302" }, /* @__PURE__ */ React5.createElement(
433
449
  "rect",
434
450
  {
435
451
  width: "24",
@@ -442,9 +458,9 @@ var CoinsIcon = ({
442
458
  };
443
459
 
444
460
  // src/components/Icons/SearchSkeletonIcon.tsx
445
- import React5 from "react";
461
+ import React6 from "react";
446
462
  var SearchSkeletonIcon = () => {
447
- return /* @__PURE__ */ React5.createElement(
463
+ return /* @__PURE__ */ React6.createElement(
448
464
  "svg",
449
465
  {
450
466
  width: "122",
@@ -453,7 +469,7 @@ var SearchSkeletonIcon = () => {
453
469
  fill: "none",
454
470
  xmlns: "http://www.w3.org/2000/svg"
455
471
  },
456
- /* @__PURE__ */ React5.createElement("g", { clipPath: "url(#clip0_7590_15835)" }, /* @__PURE__ */ React5.createElement(
472
+ /* @__PURE__ */ React6.createElement("g", { clipPath: "url(#clip0_7590_15835)" }, /* @__PURE__ */ React6.createElement(
457
473
  "path",
458
474
  {
459
475
  fillRule: "evenodd",
@@ -461,26 +477,26 @@ var SearchSkeletonIcon = () => {
461
477
  d: "M99.5636 34.0159C92.9099 34.0159 87.5159 39.4099 87.5159 46.0636C87.5159 52.7174 92.9099 58.1114 99.5636 58.1114C106.217 58.1114 111.611 52.7174 111.611 46.0636C111.611 39.4099 106.217 34.0159 99.5636 34.0159ZM83.5 46.0636C83.5 37.1919 90.6919 30 99.5636 30C108.435 30 115.627 37.1919 115.627 46.0636C115.627 49.7758 114.368 53.1938 112.254 55.9139L120.912 64.5722C121.696 65.3564 121.696 66.6277 120.912 67.4119C120.128 68.196 118.856 68.196 118.072 67.4119L109.414 58.7536C106.694 60.8681 103.276 62.1273 99.5636 62.1273C90.6919 62.1273 83.5 54.9353 83.5 46.0636Z",
462
478
  fill: "currentColor"
463
479
  }
464
- ), /* @__PURE__ */ React5.createElement(
480
+ ), /* @__PURE__ */ React6.createElement(
465
481
  "path",
466
482
  {
467
483
  d: "M117.5 8H4.5C2.29086 8 0.5 9.79086 0.5 12V20C0.5 22.2091 2.29086 24 4.5 24H117.5C119.709 24 121.5 22.2091 121.5 20V12C121.5 9.79086 119.709 8 117.5 8Z",
468
484
  fill: "currentColor"
469
485
  }
470
- ), /* @__PURE__ */ React5.createElement(
486
+ ), /* @__PURE__ */ React6.createElement(
471
487
  "path",
472
488
  {
473
489
  d: "M71.5 30H4.5C2.29086 30 0.5 31.7909 0.5 34V42C0.5 44.2091 2.29086 46 4.5 46H71.5C73.7091 46 75.5 44.2091 75.5 42V34C75.5 31.7909 73.7091 30 71.5 30Z",
474
490
  fill: "currentColor"
475
491
  }
476
- ), /* @__PURE__ */ React5.createElement(
492
+ ), /* @__PURE__ */ React6.createElement(
477
493
  "path",
478
494
  {
479
495
  d: "M71.5 52H4.5C2.29086 52 0.5 53.7909 0.5 56V64C0.5 66.2091 2.29086 68 4.5 68H71.5C73.7091 68 75.5 66.2091 75.5 64V56C75.5 53.7909 73.7091 52 71.5 52Z",
480
496
  fill: "currentColor"
481
497
  }
482
498
  )),
483
- /* @__PURE__ */ React5.createElement("defs", null, /* @__PURE__ */ React5.createElement("clipPath", { id: "clip0_7590_15835" }, /* @__PURE__ */ React5.createElement(
499
+ /* @__PURE__ */ React6.createElement("defs", null, /* @__PURE__ */ React6.createElement("clipPath", { id: "clip0_7590_15835" }, /* @__PURE__ */ React6.createElement(
484
500
  "rect",
485
501
  {
486
502
  width: "121",
@@ -499,7 +515,7 @@ var FunNoResults = ({
499
515
  variant = "default",
500
516
  actionButton
501
517
  }) => {
502
- return /* @__PURE__ */ React6.createElement(
518
+ return /* @__PURE__ */ React7.createElement(
503
519
  Box,
504
520
  {
505
521
  display: "flex",
@@ -510,14 +526,14 @@ var FunNoResults = ({
510
526
  color: "secondaryText",
511
527
  style: { flex: 1 }
512
528
  },
513
- variant === "default" && /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(SearchSkeletonIcon, null), /* @__PURE__ */ React6.createElement(Text, { color: "secondaryText", size: "10" }, text)),
514
- variant === "actionable" && /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(
529
+ variant === "default" && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(SearchSkeletonIcon, null), /* @__PURE__ */ React7.createElement(Text, { color: "secondaryText", size: "10" }, text)),
530
+ variant === "actionable" && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(
515
531
  CoinsIcon,
516
532
  {
517
533
  bgColor: themeVars.colors.offBackground,
518
534
  iconColor: themeVars.colors.actionColor
519
535
  }
520
- ), /* @__PURE__ */ React6.createElement(
536
+ ), /* @__PURE__ */ React7.createElement(
521
537
  Box,
522
538
  {
523
539
  display: "flex",
@@ -525,7 +541,7 @@ var FunNoResults = ({
525
541
  alignItems: "center",
526
542
  gap: "12"
527
543
  },
528
- /* @__PURE__ */ React6.createElement(
544
+ /* @__PURE__ */ React7.createElement(
529
545
  Box,
530
546
  {
531
547
  display: "flex",
@@ -534,18 +550,18 @@ var FunNoResults = ({
534
550
  textAlign: "center",
535
551
  gap: "8"
536
552
  },
537
- title && /* @__PURE__ */ React6.createElement(Text, { size: "14", color: "primaryText" }, title),
538
- /* @__PURE__ */ React6.createElement(Text, { color: "secondaryText", size: "12" }, text)
553
+ title && /* @__PURE__ */ React7.createElement(Text, { size: "14", color: "primaryText" }, title),
554
+ /* @__PURE__ */ React7.createElement(Text, { color: "secondaryText", size: "12" }, text)
539
555
  ),
540
- actionButton && /* @__PURE__ */ React6.createElement(Box, null, actionButton)
556
+ actionButton && /* @__PURE__ */ React7.createElement(Box, null, actionButton)
541
557
  ))
542
558
  );
543
559
  };
544
560
 
545
561
  // src/components/Icons/SwitchIcon.tsx
546
- import React7 from "react";
562
+ import React8 from "react";
547
563
  var SwitchIcon = () => {
548
- return /* @__PURE__ */ React7.createElement(
564
+ return /* @__PURE__ */ React8.createElement(
549
565
  "svg",
550
566
  {
551
567
  width: "15",
@@ -554,7 +570,7 @@ var SwitchIcon = () => {
554
570
  fill: "none",
555
571
  xmlns: "http://www.w3.org/2000/svg"
556
572
  },
557
- /* @__PURE__ */ React7.createElement(
573
+ /* @__PURE__ */ React8.createElement(
558
574
  "path",
559
575
  {
560
576
  fillRule: "evenodd",
@@ -569,14 +585,14 @@ var SwitchIcon = () => {
569
585
  // src/providers/FunkitProvider.tsx
570
586
  var attr = "data-rk";
571
587
  var createThemeRootProps = (id) => ({ [attr]: id || "" });
572
- var ThemeRootContext = createContext({
588
+ var ThemeRootContext = createContext2({
573
589
  id: void 0,
574
590
  element: null
575
591
  });
576
- var useThemeRootProps = () => createThemeRootProps(useContext(ThemeRootContext).id);
592
+ var useThemeRootProps = () => createThemeRootProps(useContext2(ThemeRootContext).id);
577
593
 
578
594
  // src/components/Dropdown/BaseActiveDropdownItem.tsx
579
- import React9 from "react";
595
+ import React10 from "react";
580
596
 
581
597
  // src/components/Dropdown/BaseActiveDropdownItem.css.ts
582
598
  var baseStyles = "_1dewiqw0";
@@ -598,7 +614,7 @@ function BaseActiveDropdownItem({
598
614
  labelStyle,
599
615
  compactIcon = false
600
616
  }) {
601
- return /* @__PURE__ */ React9.createElement(
617
+ return /* @__PURE__ */ React10.createElement(
602
618
  Box,
603
619
  {
604
620
  display: "flex",
@@ -622,7 +638,7 @@ function BaseActiveDropdownItem({
622
638
  paddingX: size === "compact" ? "4" : size === "large" ? "8" : "dropdownPaddingX",
623
639
  className: baseStyles
624
640
  },
625
- /* @__PURE__ */ React9.createElement(
641
+ /* @__PURE__ */ React10.createElement(
626
642
  Box,
627
643
  {
628
644
  display: "flex",
@@ -631,8 +647,8 @@ function BaseActiveDropdownItem({
631
647
  gap: horizontalIconGap,
632
648
  style: size === "compact" ? void 0 : { flex: "1 0 auto" }
633
649
  },
634
- alwaysVisibleLabel && /* @__PURE__ */ React9.createElement(Box, { style: { flex: 1 } }, /* @__PURE__ */ React9.createElement(Text, { color: "secondaryText", size: "12" }, alwaysVisibleLabel)),
635
- /* @__PURE__ */ React9.createElement(
650
+ alwaysVisibleLabel && /* @__PURE__ */ React10.createElement(Box, { style: { flex: 1 } }, /* @__PURE__ */ React10.createElement(Text, { color: "secondaryText", size: "12" }, alwaysVisibleLabel)),
651
+ /* @__PURE__ */ React10.createElement(
636
652
  Box,
637
653
  {
638
654
  display: "flex",
@@ -645,7 +661,7 @@ function BaseActiveDropdownItem({
645
661
  },
646
662
  ...alwaysVisibleLabel ? {} : { style: { flex: 1 } }
647
663
  },
648
- /* @__PURE__ */ React9.createElement(
664
+ /* @__PURE__ */ React10.createElement(
649
665
  Box,
650
666
  {
651
667
  display: "flex",
@@ -655,7 +671,7 @@ function BaseActiveDropdownItem({
655
671
  ...alwaysVisibleLabel ? { style: { flexDirection: "row-reverse" } } : {}
656
672
  },
657
673
  tagPosition === "start" && tagComponent,
658
- /* @__PURE__ */ React9.createElement(Box, { display: "flex", alignItems: "center", gap: horizontalIconGap }, iconComponent && /* @__PURE__ */ React9.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "center" }, iconComponent), /* @__PURE__ */ React9.createElement(
674
+ /* @__PURE__ */ React10.createElement(Box, { display: "flex", alignItems: "center", gap: horizontalIconGap }, iconComponent && /* @__PURE__ */ React10.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "center" }, iconComponent), /* @__PURE__ */ React10.createElement(
659
675
  Text,
660
676
  {
661
677
  color,
@@ -666,7 +682,7 @@ function BaseActiveDropdownItem({
666
682
  label
667
683
  ))
668
684
  ),
669
- /* @__PURE__ */ React9.createElement(Box, { display: "flex", alignItems: "center", gap: "5" }, tagPosition === "end" && tagComponent, /* @__PURE__ */ React9.createElement(
685
+ /* @__PURE__ */ React10.createElement(Box, { display: "flex", alignItems: "center", gap: "5" }, tagPosition === "end" && tagComponent, /* @__PURE__ */ React10.createElement(
670
686
  AnimatedCaretDownIcon,
671
687
  {
672
688
  expanded: isOpened,
@@ -797,6 +813,8 @@ function BaseDropdown({
797
813
  }) {
798
814
  const { t } = useFunkitTranslation();
799
815
  const themeRootProps = useThemeRootProps();
816
+ const shadowContainer = useShadowContainer();
817
+ const rootNode = useRootNode();
800
818
  const isMobileDevice = isMobile();
801
819
  const [isOpened, setIsOpened] = useState3(false);
802
820
  const [searchInput, setSearchInput] = useState3("");
@@ -844,7 +862,7 @@ function BaseDropdown({
844
862
  );
845
863
  if (selectedOptionIndex !== -1) {
846
864
  requestAnimationFrame(() => {
847
- const selectedOptionElement = document.getElementById(
865
+ const selectedOptionElement = rootNode.getElementById(
848
866
  `${selectedOption.value}-dropdown-item`
849
867
  );
850
868
  selectedOptionElement?.scrollIntoView({
@@ -857,22 +875,22 @@ function BaseDropdown({
857
875
  } else if (!isOpened) {
858
876
  prevIsOpenedRef.current = false;
859
877
  }
860
- }, [isOpened, selectedOption, organizedOptions]);
878
+ }, [isOpened, selectedOption, organizedOptions, rootNode]);
861
879
  const dropdownSide = alwaysOpenToTop || openToTopOnMobile && isMobileDevice ? "top" : "bottom";
862
- return /* @__PURE__ */ React10.createElement(Box, { display: "flex", flexDirection: "column", gap: "4", testId }, label && /* @__PURE__ */ React10.createElement(Text, { size: "12", color: "secondaryText" }, label), /* @__PURE__ */ React10.createElement(
880
+ return /* @__PURE__ */ React11.createElement(Box, { display: "flex", flexDirection: "column", gap: "4", testId }, label && /* @__PURE__ */ React11.createElement(Text, { size: "12", color: "secondaryText" }, label), /* @__PURE__ */ React11.createElement(
863
881
  DropdownMenu2.Root,
864
882
  {
865
883
  open: isOpened,
866
884
  onOpenChange: handleOpenChange,
867
885
  modal: false
868
886
  },
869
- /* @__PURE__ */ React10.createElement(
887
+ /* @__PURE__ */ React11.createElement(
870
888
  Box,
871
889
  {
872
890
  position: "relative",
873
891
  display: size === "compact" ? "flex" : void 0
874
892
  },
875
- isLoading ? /* @__PURE__ */ React10.createElement(FunSkeletonBlock, { height: activeDropdownItemSize[size] }) : /* @__PURE__ */ React10.createElement(DropdownMenu2.Trigger, { asChild: true }, /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement(
893
+ isLoading ? /* @__PURE__ */ React11.createElement(FunSkeletonBlock, { height: activeDropdownItemSize[size] }) : /* @__PURE__ */ React11.createElement(DropdownMenu2.Trigger, { asChild: true }, /* @__PURE__ */ React11.createElement("div", null, /* @__PURE__ */ React11.createElement(
876
894
  BaseActiveDropdownItem_default,
877
895
  {
878
896
  color: !selectedOption && !activeItemProps?.label && !!placeholder ? "secondaryText" : "primaryText",
@@ -883,7 +901,7 @@ function BaseDropdown({
883
901
  label: activeItemProps?.label ?? selectedOption?.label ?? placeholder ?? ""
884
902
  }
885
903
  ))),
886
- /* @__PURE__ */ React10.createElement(DropdownMenu2.Portal, null, /* @__PURE__ */ React10.createElement(
904
+ /* @__PURE__ */ React11.createElement(DropdownMenu2.Portal, { container: shadowContainer ?? void 0 }, /* @__PURE__ */ React11.createElement(
887
905
  DropdownMenu2.Content,
888
906
  {
889
907
  ...themeRootProps,
@@ -899,7 +917,7 @@ function BaseDropdown({
899
917
  },
900
918
  onCloseAutoFocus: (e) => e.preventDefault()
901
919
  },
902
- /* @__PURE__ */ React10.createElement(TooltipAnchorRefContext.Provider, { value: portalThemeRef }, /* @__PURE__ */ React10.createElement(
920
+ /* @__PURE__ */ React11.createElement(TooltipAnchorRefContext.Provider, { value: portalThemeRef }, /* @__PURE__ */ React11.createElement(
903
921
  Box,
904
922
  {
905
923
  background: openDropdownBackgroundColor,
@@ -912,14 +930,14 @@ function BaseDropdown({
912
930
  "data-fade-top": maxDropdownHeight && hasTopDivider ? "true" : "false",
913
931
  "data-fade-bottom": maxDropdownHeight && !isAtBottom ? "true" : "false"
914
932
  },
915
- /* @__PURE__ */ React10.createElement(
933
+ /* @__PURE__ */ React11.createElement(
916
934
  Box,
917
935
  {
918
936
  className: maxDropdownHeight ? scrollableDropdownStyles : void 0,
919
937
  ref: maxDropdownHeight ? scrollRef : void 0,
920
938
  style: { maxHeight: maxDropdownHeight }
921
939
  },
922
- /* @__PURE__ */ React10.createElement(Box, { display: "flex", flexDirection: "column" }, searchableOptions && /* @__PURE__ */ React10.createElement(Box, { paddingTop: "8", paddingX: "8" }, /* @__PURE__ */ React10.createElement(
940
+ /* @__PURE__ */ React11.createElement(Box, { display: "flex", flexDirection: "column" }, searchableOptions && /* @__PURE__ */ React11.createElement(Box, { paddingTop: "8", paddingX: "8" }, /* @__PURE__ */ React11.createElement(
923
941
  FunInput,
924
942
  {
925
943
  placeholder: searchPlaceholder ?? t("common.searchTokens"),
@@ -927,7 +945,7 @@ function BaseDropdown({
927
945
  onChange: handleSearch,
928
946
  prefixIcon: "SearchIcon"
929
947
  }
930
- )), organizedOptions.length === 0 ? /* @__PURE__ */ React10.createElement(FunNoResults, { text: t("common.noResultsFound") }) : /* @__PURE__ */ React10.createElement(
948
+ )), organizedOptions.length === 0 ? /* @__PURE__ */ React11.createElement(FunNoResults, { text: t("common.noResultsFound") }) : /* @__PURE__ */ React11.createElement(
931
949
  Box,
932
950
  {
933
951
  as: "ul",
@@ -940,25 +958,25 @@ function BaseDropdown({
940
958
  key: groupKey,
941
959
  label: groupLabel,
942
960
  options: optionsInGroup
943
- }, groupIndex) => /* @__PURE__ */ React10.createElement(React10.Fragment, { key: groupKey }, groupIndex > 0 && /* @__PURE__ */ React10.createElement(
961
+ }, groupIndex) => /* @__PURE__ */ React11.createElement(React11.Fragment, { key: groupKey }, groupIndex > 0 && /* @__PURE__ */ React11.createElement(
944
962
  Box,
945
963
  {
946
964
  height: "1",
947
965
  background: "lightStroke",
948
966
  marginY: "dropdownGroupDividerMarginY"
949
967
  }
950
- ), groupLabel && /* @__PURE__ */ React10.createElement(
968
+ ), groupLabel && /* @__PURE__ */ React11.createElement(
951
969
  Box,
952
970
  {
953
971
  paddingX: size === "compact" ? "dropdownCompactPaddingX" : "dropdownPaddingX"
954
972
  },
955
- /* @__PURE__ */ React10.createElement(
973
+ /* @__PURE__ */ React11.createElement(
956
974
  Box,
957
975
  {
958
976
  paddingX: "dropdownItemPaddingX",
959
977
  paddingY: "dropdownItemPaddingY"
960
978
  },
961
- /* @__PURE__ */ React10.createElement(
979
+ /* @__PURE__ */ React11.createElement(
962
980
  Text,
963
981
  {
964
982
  color: "dropdownGroupHeader",
@@ -971,13 +989,13 @@ function BaseDropdown({
971
989
  )
972
990
  ), optionsInGroup.map((singleOption) => {
973
991
  const isSelected = singleOption.value === selectedOption?.value;
974
- return /* @__PURE__ */ React10.createElement(
992
+ return /* @__PURE__ */ React11.createElement(
975
993
  Box,
976
994
  {
977
995
  key: singleOption.value,
978
996
  paddingX: size === "compact" ? "dropdownCompactPaddingX" : "dropdownPaddingX"
979
997
  },
980
- /* @__PURE__ */ React10.createElement(
998
+ /* @__PURE__ */ React11.createElement(
981
999
  Box,
982
1000
  {
983
1001
  id: `${singleOption.value}-dropdown-item`,
@@ -1003,14 +1021,14 @@ function BaseDropdown({
1003
1021
  )
1004
1022
  ))
1005
1023
  )),
1006
- preloadIconUrls && /* @__PURE__ */ React10.createElement(
1024
+ preloadIconUrls && /* @__PURE__ */ React11.createElement(
1007
1025
  Box,
1008
1026
  {
1009
1027
  display: "none",
1010
1028
  "aria-hidden": true,
1011
1029
  style: { position: "absolute", top: "-100%", left: "-100%" }
1012
1030
  },
1013
- preloadIconUrls.map((url, index) => /* @__PURE__ */ React10.createElement("img", { key: `${url}-${index}`, src: url, alt: "" }))
1031
+ preloadIconUrls.map((url, index) => /* @__PURE__ */ React11.createElement("img", { key: `${url}-${index}`, src: url, alt: "" }))
1014
1032
  )
1015
1033
  )
1016
1034
  ));
@@ -1055,7 +1073,7 @@ function AccountSelectDropdown({
1055
1073
  },
1056
1074
  { key: ACTION_GROUP, label: "", values: [action.id] }
1057
1075
  ] : void 0;
1058
- return /* @__PURE__ */ React11.createElement(
1076
+ return /* @__PURE__ */ React12.createElement(
1059
1077
  BaseDropdown_default,
1060
1078
  {
1061
1079
  testId,
@@ -1068,21 +1086,21 @@ function AccountSelectDropdown({
1068
1086
  activeItemProps: { alwaysVisibleLabel: prefixLabel },
1069
1087
  renderDropdownOption: (option, isSelected) => {
1070
1088
  if (action && option.value === action.id) {
1071
- return /* @__PURE__ */ React11.createElement(
1089
+ return /* @__PURE__ */ React12.createElement(
1072
1090
  BaseDropdownItem_default,
1073
1091
  {
1074
1092
  id: option.value,
1075
1093
  label: option.label,
1076
1094
  iconComponent: action.icon && // Render the icon in the theme's primary text colour
1077
1095
  // (the icon uses `currentColor`), matching the label.
1078
- /* @__PURE__ */ React11.createElement(Box, { display: "flex", color: "primaryText" }, action.icon),
1096
+ /* @__PURE__ */ React12.createElement(Box, { display: "flex", color: "primaryText" }, action.icon),
1079
1097
  horizontalIconGap: "8",
1080
1098
  onClick: action.onSelect
1081
1099
  }
1082
1100
  );
1083
1101
  }
1084
1102
  const account = accounts.find((item) => item.value === option.value);
1085
- return /* @__PURE__ */ React11.createElement(
1103
+ return /* @__PURE__ */ React12.createElement(
1086
1104
  BaseDropdownItem_default,
1087
1105
  {
1088
1106
  id: option.value,
@@ -1133,7 +1151,7 @@ function PolymarketDepositAccountDropdown({
1133
1151
  )
1134
1152
  );
1135
1153
  };
1136
- return /* @__PURE__ */ React12.createElement(
1154
+ return /* @__PURE__ */ React13.createElement(
1137
1155
  AccountSelectDropdown,
1138
1156
  {
1139
1157
  prefixLabel: t("perpsTransfer.depositTo"),
@@ -1155,7 +1173,7 @@ function PolymarketDepositAccountDropdown({
1155
1173
  action: {
1156
1174
  id: "transfer-between-accounts",
1157
1175
  label: t("perpsTransfer.transferBetweenAccounts"),
1158
- icon: /* @__PURE__ */ React12.createElement(SwitchIcon, null),
1176
+ icon: /* @__PURE__ */ React13.createElement(SwitchIcon, null),
1159
1177
  // Navigation is absent on the loading skeleton; the action only fires
1160
1178
  // on the interactive screen. The transfer step reads balances from the
1161
1179
  // same shared cache, so none need to be threaded through here.