@funkit/connect 11.7.0 → 12.1.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 (141) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/{chunk-67BKQQNG.js → chunk-2RND3WWH.js} +1 -1
  3. package/dist/{chunk-L67HP4HQ.js → chunk-53FF4ZHH.js} +1 -1
  4. package/dist/{chunk-4YEAUICE.js → chunk-DH3DS4FX.js} +1 -0
  5. package/dist/clients/{chunk-SG4ZS447.js → chunk-27VBRE7W.js} +79 -15
  6. package/dist/clients/{chunk-OASVWVSV.js → chunk-A5JW3UI6.js} +1 -1
  7. package/dist/clients/chunk-DNVDK7JQ.js +335 -0
  8. package/dist/clients/{chunk-FGUMPXTO.js → chunk-DYV3LRSE.js} +1 -1
  9. package/dist/clients/{chunk-44USAVWK.js → chunk-ECGTOMZQ.js} +2 -2
  10. package/dist/clients/{chunk-IYCZWLAF.js → chunk-IAIRECDV.js} +8 -37
  11. package/dist/clients/{chunk-I4B5AKZC.js → chunk-R6UAC2TB.js} +1 -1
  12. package/dist/clients/chunk-RQALGV5U.js +335 -0
  13. package/dist/clients/{chunk-Y7WLUPTX.js → chunk-VE6QD5IM.js} +67 -16
  14. package/dist/clients/fanatics.css +4686 -4659
  15. package/dist/clients/fanatics.js +7 -9
  16. package/dist/clients/internal/nado/withdrawalCallback.js +3 -3
  17. package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
  18. package/dist/clients/internal/nado/withdrawalForm.css +4704 -4677
  19. package/dist/clients/internal/nado/withdrawalForm.js +38 -13
  20. package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
  21. package/dist/clients/lighter.css +4704 -4677
  22. package/dist/clients/lighter.js +50 -30
  23. package/dist/clients/mallard.js +4 -4
  24. package/dist/clients/nado.js +3 -3
  25. package/dist/clients/polymarket/createPolymarketDepositConfig.d.ts +28 -19
  26. package/dist/clients/polymarket/createPolymarketDepositConfig.js +5 -4
  27. package/dist/clients/polymarket/index.d.ts +0 -1
  28. package/dist/clients/polymarket/index.js +4 -17
  29. package/dist/clients/polymarket/polymarket.d.ts +12 -27
  30. package/dist/clients/polymarket/polymarket.js +1 -1
  31. package/dist/components/AsyncImage/useAsyncImage.d.ts +2 -0
  32. package/dist/components/Box/Box.d.ts +15 -15
  33. package/dist/components/Dialog/Dialog.d.ts +8 -1
  34. package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +4 -1
  35. package/dist/components/FunTransactionSummary/PaymentFeesSummary.track.d.ts +12 -0
  36. package/dist/components/ModalHeaderTabs/ModalHeaderTabs.d.ts +23 -0
  37. package/dist/consts/polymarket.d.ts +14 -0
  38. package/dist/css/sprinkles.css.d.ts +17 -15
  39. package/dist/domains/polymarketPerps.d.ts +14 -0
  40. package/dist/hooks/queries/useFops.d.ts +3 -1
  41. package/dist/hooks/queries/useWithdrawalQuote.d.ts +7 -0
  42. package/dist/hooks/statsig/index.d.ts +1 -0
  43. package/dist/hooks/statsig/useExperimentV2.d.ts +8 -0
  44. package/dist/hooks/track/CheckoutModalEvent.d.ts +1 -0
  45. package/dist/hooks/track/analytics/events.d.ts +67 -0
  46. package/dist/hooks/track/analytics/mappers.d.ts +4 -1
  47. package/dist/hooks/track/analytics/quote.d.ts +3 -1
  48. package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +27 -3
  49. package/dist/hooks/track/useTrack.d.ts +1 -1
  50. package/dist/hooks/track/user.d.ts +8 -0
  51. package/dist/hooks/useCheckoutTransferInit.d.ts +3 -1
  52. package/dist/hooks/useFittedText.d.ts +19 -0
  53. package/dist/hooks/usePolymarketAccountBalances.d.ts +13 -25
  54. package/dist/hooks/useUpdateActiveFunkitCheckout.d.ts +10 -0
  55. package/dist/index.css +4704 -4677
  56. package/dist/index.js +5078 -3730
  57. package/dist/modals/CheckoutModal/CheckoutModalPrefetchedHooks.d.ts +2 -1
  58. package/dist/modals/CheckoutModal/InputAmount/InputAmount.d.ts +1 -1
  59. package/dist/modals/CheckoutModal/InputAmount/state.d.ts +10 -0
  60. package/dist/modals/CheckoutModal/InputAmount/useAmountInput.d.ts +1 -0
  61. package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +6 -1
  62. package/dist/modals/PolymarketPerpsTransfer/DirectionSwapButton.d.ts +1 -11
  63. package/dist/modals/PolymarketPerpsTransfer/PerpsHeaderTabs.d.ts +29 -0
  64. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferAmountInput.css.d.ts +9 -0
  65. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferAmountInput.d.ts +15 -0
  66. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferBody.d.ts +12 -0
  67. package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsPrefetch.d.ts +7 -0
  68. package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsTransferScreen.d.ts +16 -2
  69. package/dist/modals/PolymarketPerpsTransfer/TransferAccountsCard.d.ts +12 -0
  70. package/dist/modals/PolymarketPerpsTransfer/TransferActionButton.d.ts +8 -1
  71. package/dist/modals/PolymarketPerpsTransfer/TransferPercentOptions.d.ts +13 -0
  72. package/dist/modals/PolymarketPerpsTransfer/usePerpsHeaderTabsState.d.ts +28 -0
  73. package/dist/modals/PolymarketPerpsTransfer/usePerpsTransferForm.d.ts +31 -5
  74. package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +6 -0
  75. package/dist/modals/WithdrawalModal/RecipientAddress.d.ts +0 -5
  76. package/dist/modals/WithdrawalModal/useTrackWithdrawalEvents.d.ts +8 -1
  77. package/dist/modals/WithdrawalModal/useTrackWithdrawalQuoteEvents.d.ts +16 -0
  78. package/dist/modals/WithdrawalModal/useWithdrawalChainPreference.d.ts +17 -0
  79. package/dist/modals/WithdrawalModal/withdrawalHooks.d.ts +2 -1
  80. package/dist/providers/FunkitCheckoutContext/index.d.ts +13 -1
  81. package/dist/providers/FunkitCheckoutContext/types.d.ts +30 -3
  82. package/dist/providers/FunkitConfigContext.d.ts +1 -1
  83. package/dist/providers/FunkitStatsigProvider.d.ts +2 -7
  84. package/dist/providers/FunkitStatsigWhnProvider.d.ts +17 -0
  85. package/dist/providers/FunkitThemeProvider.d.ts +3 -0
  86. package/dist/providers/GeneralWalletProvider.d.ts +1 -0
  87. package/dist/shadow-css.js +1 -1
  88. package/dist/themes/baseTheme.js +1 -1
  89. package/dist/themes/darkTheme.js +2 -2
  90. package/dist/themes/lightTheme.js +2 -2
  91. package/dist/utils/statsig/client.d.ts +4 -0
  92. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  93. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  94. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  95. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  96. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  97. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  98. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  99. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  100. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  101. package/dist/wallets/walletConnectors/index.js +46 -46
  102. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  103. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  104. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  105. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  106. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  107. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  108. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  109. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  110. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  111. package/package.json +5 -5
  112. package/dist/clients/chunk-AXLGZ5XX.js +0 -1325
  113. package/dist/clients/chunk-DSZHYQPX.js +0 -31
  114. package/dist/clients/chunk-HZP4DXIZ.js +0 -231
  115. package/dist/clients/chunk-LUHEVXPD.js +0 -109
  116. package/dist/clients/chunk-NM2NAKI3.js +0 -1195
  117. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +0 -17545
  118. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.d.ts +0 -30
  119. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +0 -20
  120. package/dist/clients/polymarket/index.css +0 -17545
  121. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferRows.d.ts +0 -10
  122. package/dist/modals/PolymarketPerpsTransfer/TransferAmountRow.css.d.ts +0 -13
  123. package/dist/modals/PolymarketPerpsTransfer/TransferAmountRow.d.ts +0 -27
  124. package/dist/wallets/walletConnectors/{chunk-W2LCLDPX.js → chunk-2VP2F6EK.js} +3 -3
  125. package/dist/wallets/walletConnectors/{chunk-IULPZP2Q.js → chunk-4T6ZSRJF.js} +3 -3
  126. package/dist/wallets/walletConnectors/{chunk-WAHGI5L7.js → chunk-6BW3HLBG.js} +3 -3
  127. package/dist/wallets/walletConnectors/{chunk-YO2K4MBH.js → chunk-CCQV2ZET.js} +3 -3
  128. package/dist/wallets/walletConnectors/{chunk-TKB2OY6G.js → chunk-CPI4TD43.js} +3 -3
  129. package/dist/wallets/walletConnectors/{chunk-OX37G4YT.js → chunk-F5XEEVG6.js} +3 -3
  130. package/dist/wallets/walletConnectors/{chunk-JPN6TWIT.js → chunk-HNRB7KJU.js} +3 -3
  131. package/dist/wallets/walletConnectors/{chunk-WKNQMP4A.js → chunk-HTHAK6XB.js} +3 -3
  132. package/dist/wallets/walletConnectors/{chunk-GUQM4QSL.js → chunk-MIQTHJ6X.js} +3 -3
  133. package/dist/wallets/walletConnectors/{chunk-4NV5BYRP.js → chunk-RB3HR4R2.js} +3 -3
  134. package/dist/wallets/walletConnectors/{chunk-SWFF3TWJ.js → chunk-RVOY537T.js} +3 -3
  135. package/dist/wallets/walletConnectors/{chunk-KI5Y2BBF.js → chunk-STVVP43G.js} +3 -3
  136. package/dist/wallets/walletConnectors/{chunk-OEEGYENV.js → chunk-UK7C2JXW.js} +3 -3
  137. package/dist/wallets/walletConnectors/{chunk-YQFGVZGR.js → chunk-VAPGUPHO.js} +3 -3
  138. package/dist/wallets/walletConnectors/{chunk-XCNHV3HS.js → chunk-VTM6EECM.js} +3 -3
  139. package/dist/wallets/walletConnectors/{chunk-NR2OGDHQ.js → chunk-X6CGV36L.js} +3 -3
  140. package/dist/wallets/walletConnectors/{chunk-AVDUNQUW.js → chunk-YEZM4CK4.js} +3 -3
  141. package/dist/wallets/walletConnectors/{chunk-KCRO2AGO.js → chunk-ZNX4EMPB.js} +3 -3
@@ -1,1325 +0,0 @@
1
- "use client";
2
- import {
3
- Box,
4
- Text,
5
- themeVars
6
- } from "./chunk-LUHEVXPD.js";
7
-
8
- // src/components/FunTooltip/FunTooltip.tsx
9
- import * as Tooltip from "@radix-ui/react-tooltip";
10
- import React, {
11
- createContext,
12
- useContext,
13
- useState
14
- } from "react";
15
- var TooltipAnchorRefContext = createContext(null);
16
-
17
- // src/components/FunInput/FunInput.tsx
18
- import React5, {
19
- forwardRef,
20
- useEffect as useEffect2,
21
- useState as useState3
22
- } from "react";
23
- import clsx from "clsx";
24
-
25
- // src/providers/FunkitThemeProvider.tsx
26
- import React2, { createContext as createContext2, useContext as useContext2, useEffect, useState as useState2 } from "react";
27
-
28
- // src/themes/baseTheme.ts
29
- var systemFontStack = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';
30
- var fontStacks = {
31
- rounded: `SFRounded, ui-rounded, "SF Pro Rounded", ${systemFontStack}`,
32
- system: systemFontStack,
33
- fun: `SF Pro, ${systemFontStack}`
34
- };
35
- var radiusScales = {
36
- large: {
37
- actionButton: "12px",
38
- actionButtonInner: "10px",
39
- connectButton: "12px",
40
- modal: "24px",
41
- modalMobile: "28px",
42
- modalActionButton: "24px",
43
- modalActionButtonMobile: "28px",
44
- summaryBox: "12px",
45
- youPayYouReceive: "24px",
46
- inputAmountSwitcher: "24px",
47
- qrCode: "12px",
48
- tooltip: "4px",
49
- skeleton: "4px",
50
- dropdown: "12px",
51
- dropdownItem: "4px",
52
- dropdownList: "12px",
53
- modalTopbarIcon: "9999px",
54
- withdrawalInput: "12px",
55
- useConnected: "8px"
56
- },
57
- medium: {
58
- actionButton: "10px",
59
- actionButtonInner: "8px",
60
- connectButton: "10px",
61
- modal: "16px",
62
- modalMobile: "18px",
63
- modalActionButton: "16px",
64
- modalActionButtonMobile: "18px",
65
- summaryBox: "10px",
66
- youPayYouReceive: "24px",
67
- inputAmountSwitcher: "24px",
68
- qrCode: "10px",
69
- tooltip: "4px",
70
- skeleton: "4px",
71
- dropdown: "10px",
72
- dropdownItem: "4px",
73
- dropdownList: "10px",
74
- modalTopbarIcon: "9999px",
75
- withdrawalInput: "10px",
76
- useConnected: "8px"
77
- },
78
- none: {
79
- actionButton: "0px",
80
- actionButtonInner: "0px",
81
- connectButton: "0px",
82
- modal: "0px",
83
- modalMobile: "0px",
84
- modalActionButton: "0px",
85
- modalActionButtonMobile: "0px",
86
- summaryBox: "0px",
87
- youPayYouReceive: "0px",
88
- inputAmountSwitcher: "0px",
89
- qrCode: "0px",
90
- tooltip: "0px",
91
- skeleton: "0px",
92
- dropdown: "0px",
93
- dropdownItem: "0px",
94
- dropdownList: "0px",
95
- modalTopbarIcon: "0px",
96
- withdrawalInput: "0px",
97
- useConnected: "0px"
98
- },
99
- small: {
100
- actionButton: "8px",
101
- actionButtonInner: "6px",
102
- connectButton: "8px",
103
- modal: "8px",
104
- modalMobile: "8px",
105
- modalActionButton: "8px",
106
- modalActionButtonMobile: "8px",
107
- summaryBox: "8px",
108
- youPayYouReceive: "24px",
109
- inputAmountSwitcher: "24px",
110
- qrCode: "8px",
111
- tooltip: "4px",
112
- skeleton: "4px",
113
- dropdown: "8px",
114
- dropdownItem: "4px",
115
- dropdownList: "8px",
116
- modalTopbarIcon: "9999px",
117
- withdrawalInput: "8px",
118
- useConnected: "8px"
119
- }
120
- };
121
- var blurs = {
122
- large: {
123
- modalOverlay: "blur(20px)"
124
- },
125
- none: {
126
- modalOverlay: "blur(0px)"
127
- },
128
- small: {
129
- modalOverlay: "blur(8px)"
130
- },
131
- tiny: {
132
- modalOverlay: "blur(4px)"
133
- }
134
- };
135
- var DEFAULT_FONT_WEIGHTS = {
136
- regular: "400",
137
- medium: "500",
138
- // 510 in figma, but chrome no longer supports 510 - lowered to 500
139
- semibold: "600",
140
- // 590 in figma, but chrome no longer supports 590 - raised to 600
141
- bold: "700",
142
- heavy: "800"
143
- };
144
- var DEFAULT_FONT_SIZES = {
145
- "10": { fontSize: "10px", lineHeight: "15px" },
146
- "12": { fontSize: "12px", lineHeight: "14px" },
147
- "13": { fontSize: "13px", lineHeight: "18px" },
148
- "14": { fontSize: "14px", lineHeight: "18px" },
149
- "16": { fontSize: "16px", lineHeight: "20px" },
150
- "18": { fontSize: "18px", lineHeight: "24px" },
151
- "20": { fontSize: "20px", lineHeight: "20px" },
152
- "21": { fontSize: "21px", lineHeight: "21px" },
153
- "40": { fontSize: "40px", lineHeight: "48px" },
154
- "57": { fontSize: "57px", lineHeight: "68px" }
155
- };
156
- var FONT_SIZINGS = {
157
- regular: DEFAULT_FONT_SIZES,
158
- small: {
159
- "8": { fontSize: "8px", lineHeight: "16px" },
160
- "10": { fontSize: "8px", lineHeight: "16px" },
161
- "12": { fontSize: "10px", lineHeight: "16px" },
162
- "13": { fontSize: "10px", lineHeight: "16px" },
163
- "14": { fontSize: "12px", lineHeight: "16px" },
164
- "16": { fontSize: "14px", lineHeight: "18px" },
165
- "18": { fontSize: "14px", lineHeight: "20px" },
166
- "20": { fontSize: "18px", lineHeight: "20px" },
167
- "21": { fontSize: "19px", lineHeight: "19px" },
168
- "23": { fontSize: "20px", lineHeight: "28px" },
169
- "40": { fontSize: "34px", lineHeight: "40px" },
170
- "57": { fontSize: "50px", lineHeight: "60px" }
171
- }
172
- };
173
- var nestedModalZIndexes = {
174
- coinbase: 2147483647,
175
- walletConnect: 99999999999999,
176
- privy: 999999
177
- };
178
- var DEFAULT_MODAL_Z_INDEX = Math.min(...Object.values(nestedModalZIndexes)) - 2;
179
- var baseTheme = ({
180
- borderRadius = "large",
181
- fontStack = "fun",
182
- fontSizing = "regular",
183
- customFontFamily,
184
- customFontWeights = DEFAULT_FONT_WEIGHTS,
185
- customFontSizings = FONT_SIZINGS[fontSizing],
186
- customBorderWidths,
187
- customBorderRadiuses = radiusScales[borderRadius],
188
- customDimensions,
189
- customOpacities,
190
- customSpacings,
191
- customTextTransforms,
192
- overlayBlur = "small",
193
- modalZIndex = DEFAULT_MODAL_Z_INDEX
194
- }) => ({
195
- modalZIndex: String(modalZIndex),
196
- blurs: {
197
- modalOverlay: blurs[overlayBlur].modalOverlay
198
- },
199
- dimensions: {
200
- connectExchangeIconSize: "48px",
201
- cryptoCashToggleIconSize: "20px",
202
- dollarValueSkeletonHeight: "60px",
203
- dollarValueSkeletonWidth: "160px",
204
- inputAmountQuickOptionButtonHeight: "36px",
205
- inputAmountMinHeight: "76px",
206
- modalBottomBarButtonHeight: "34px",
207
- modalTopBarHeight: "56px",
208
- modalTopbarIconSize: "16px",
209
- modalTopbarIconWrapperSize: "32px",
210
- paymentAmountSkeletonBlockHeight: "14px",
211
- paymentAmountSkeletonBlockWidth: "93px",
212
- paymentAmountSkeletonCircleSize: "15px",
213
- paymentMethodItemIconSize: "20px",
214
- selectAssetItemIconSize: "24px",
215
- sourceListGap: "4px",
216
- txBreakdownSkeletonWidth: "72px",
217
- txSummaryLineSkeletonHeight: "14px",
218
- txSummaryLineSkeletonWidth: "54px",
219
- ...customDimensions,
220
- modalBottomBarCloseButtonHeight: customDimensions?.modalBottomBarCloseButtonHeight ?? customDimensions?.modalBottomBarButtonHeight ?? "34px"
221
- },
222
- fonts: typeof customFontFamily === "string" ? {
223
- amountValue: customFontFamily,
224
- body: customFontFamily,
225
- buttonTextPrimary: customFontFamily,
226
- buttonTextSecondary: customFontFamily,
227
- buttonTextTertiary: customFontFamily,
228
- dropdownGroupHeader: customFontFamily,
229
- header: customFontFamily,
230
- inputAmount: customFontFamily,
231
- modalTopbarTitle: customFontFamily,
232
- txStatusDescription: customFontFamily,
233
- txStatusTitle: customFontFamily
234
- } : {
235
- amountValue: fontStacks[fontStack],
236
- body: fontStacks[fontStack],
237
- buttonTextPrimary: fontStacks[fontStack],
238
- buttonTextSecondary: fontStacks[fontStack],
239
- buttonTextTertiary: fontStacks[fontStack],
240
- dropdownGroupHeader: fontStacks[fontStack],
241
- header: fontStacks[fontStack],
242
- inputAmount: fontStacks[fontStack],
243
- modalTopbarTitle: fontStacks[fontStack],
244
- txStatusDescription: fontStacks[fontStack],
245
- txStatusTitle: fontStacks[fontStack],
246
- ...customFontFamily
247
- },
248
- fontWeight: {
249
- ...DEFAULT_FONT_WEIGHTS,
250
- cryptoCashToggle: DEFAULT_FONT_WEIGHTS.medium,
251
- dropdownGroupHeader: DEFAULT_FONT_WEIGHTS.medium,
252
- inputAmount: DEFAULT_FONT_WEIGHTS.medium,
253
- inputLabel: DEFAULT_FONT_WEIGHTS.medium,
254
- inputValue: DEFAULT_FONT_WEIGHTS.medium,
255
- modalTopbarTitle: DEFAULT_FONT_WEIGHTS.medium,
256
- modalBottomBarButtonText: DEFAULT_FONT_WEIGHTS.medium,
257
- paymentMethodItemSubtitle: DEFAULT_FONT_WEIGHTS.regular,
258
- paymentMethodItemTitle: DEFAULT_FONT_WEIGHTS.medium,
259
- selectAssetItemSubtitle: DEFAULT_FONT_WEIGHTS.regular,
260
- selectAssetItemTitle: DEFAULT_FONT_WEIGHTS.medium,
261
- sourceListSectionLabelFontWeight: DEFAULT_FONT_WEIGHTS.medium,
262
- txBreakdown: DEFAULT_FONT_WEIGHTS.regular,
263
- txStatusDescription: DEFAULT_FONT_WEIGHTS.regular,
264
- txStatusTitle: DEFAULT_FONT_WEIGHTS.medium,
265
- txSummaryLabel: DEFAULT_FONT_WEIGHTS.medium,
266
- txSummaryValue: DEFAULT_FONT_WEIGHTS.medium,
267
- formOfPaymentsListSectionLabelFontWeight: DEFAULT_FONT_WEIGHTS.medium,
268
- withdrawalYouWillReceiveLabel: DEFAULT_FONT_WEIGHTS.regular,
269
- withdrawalYouWillReceiveValueCrypto: DEFAULT_FONT_WEIGHTS.medium,
270
- withdrawalYouWillReceiveValueUsd: DEFAULT_FONT_WEIGHTS.regular,
271
- ...customFontWeights
272
- },
273
- fontSize: {
274
- ...FONT_SIZINGS[fontSizing],
275
- body: FONT_SIZINGS[fontSizing][14],
276
- cryptoCashToggle: FONT_SIZINGS[fontSizing][12],
277
- "header-14": { fontSize: "14px", lineHeight: "14px" },
278
- "header-36": { fontSize: "36px", lineHeight: "36px" },
279
- buttonTextPrimary: FONT_SIZINGS[fontSizing][12],
280
- buttonTextSecondary: FONT_SIZINGS[fontSizing][10],
281
- buttonTextTertiary: FONT_SIZINGS[fontSizing][12],
282
- dollarValue: FONT_SIZINGS[fontSizing][40],
283
- dropdownGroupHeader: FONT_SIZINGS[fontSizing][12],
284
- inputAmount: FONT_SIZINGS[fontSizing][57],
285
- inputLabel: customFontSizings[12] ?? FONT_SIZINGS[fontSizing][12],
286
- inputValue: customFontSizings[13] ?? FONT_SIZINGS[fontSizing][13],
287
- modalTopbarSubtitle: FONT_SIZINGS[fontSizing][10],
288
- modalTopbarTitle: FONT_SIZINGS[fontSizing][13],
289
- modalBottomBarButtonText: FONT_SIZINGS[fontSizing][12],
290
- paymentMethodItemSubtitle: FONT_SIZINGS[fontSizing][12],
291
- paymentMethodItemTitle: FONT_SIZINGS[fontSizing][12],
292
- selectAssetItemSubtitle: FONT_SIZINGS[fontSizing][10],
293
- selectAssetItemTitle: FONT_SIZINGS[fontSizing][13],
294
- txBreakdown: FONT_SIZINGS[fontSizing][12],
295
- txStatusDescription: FONT_SIZINGS[fontSizing][13],
296
- txStatusTitle: FONT_SIZINGS[fontSizing][13],
297
- txSummaryLabel: FONT_SIZINGS[fontSizing][12],
298
- txSummaryValue: FONT_SIZINGS[fontSizing][12],
299
- withdrawalYouWillReceive: customFontSizings[12] ?? FONT_SIZINGS[fontSizing][12],
300
- youPayYouReceivePrimaryFontSize: FONT_SIZINGS[fontSizing][12],
301
- youPayYouReceiveSecondaryFontSize: FONT_SIZINGS[fontSizing][10],
302
- depositAddressFontSize: FONT_SIZINGS[fontSizing][10],
303
- funFeatureListItemFontSize: FONT_SIZINGS[fontSizing][12],
304
- dropdownItemFontSize: FONT_SIZINGS[fontSizing][12],
305
- sourceListSectionLabelFontSize: FONT_SIZINGS[fontSizing][12],
306
- formOfPaymentsListSectionLabelFontSize: FONT_SIZINGS[fontSizing][12],
307
- quickOptionFontSize: FONT_SIZINGS[fontSizing][14],
308
- useConnectedFontSize: FONT_SIZINGS[fontSizing][12],
309
- paymentFeeSummaryTooltip: FONT_SIZINGS[fontSizing][10],
310
- tooltipContent: FONT_SIZINGS[fontSizing][10],
311
- ...customFontSizings
312
- },
313
- radii: {
314
- actionButton: radiusScales[borderRadius].actionButton,
315
- actionButtonInner: radiusScales[borderRadius].actionButtonInner,
316
- connectButton: radiusScales[borderRadius].connectButton,
317
- menuButton: radiusScales[borderRadius].connectButton,
318
- modal: radiusScales[borderRadius].modal,
319
- modalMobile: radiusScales[borderRadius].modalMobile,
320
- modalActionButton: radiusScales[borderRadius].modalActionButton,
321
- modalActionButtonMobile: radiusScales[borderRadius].modalActionButtonMobile,
322
- summaryBox: radiusScales[borderRadius].summaryBox,
323
- youPayYouReceive: radiusScales[borderRadius].youPayYouReceive,
324
- inputAmountSwitcher: radiusScales[borderRadius].inputAmountSwitcher,
325
- qrCode: radiusScales[borderRadius].qrCode,
326
- skeleton: radiusScales[borderRadius].skeleton,
327
- tooltip: radiusScales[borderRadius].tooltip,
328
- dropdown: radiusScales[borderRadius].dropdown,
329
- dropdownItem: radiusScales[borderRadius].dropdownItem,
330
- dropdownList: customBorderRadiuses?.dropdownList ?? customBorderRadiuses?.dropdown ?? radiusScales[borderRadius].dropdown,
331
- modalTopbarIcon: radiusScales[borderRadius].modalTopbarIcon,
332
- withdrawalInput: radiusScales[borderRadius].withdrawalInput,
333
- useConnected: radiusScales[borderRadius].useConnected,
334
- ...customBorderRadiuses
335
- },
336
- borderWidths: {
337
- activeOptionBorderWidth: "1px",
338
- buttonTertiaryBorderWidth: "0px",
339
- cryptoCashToggleContainerBorderWidth: "0px",
340
- cryptoCashToggleActiveTabBorderWidth: "1px",
341
- cryptoCashToggleInactiveTabBorderWidth: "1px",
342
- txSummaryBoxBorderWidth: "1px",
343
- ...customBorderWidths
344
- },
345
- opacities: {
346
- buttonPrimaryDisabled: "1",
347
- ...customOpacities
348
- },
349
- spacing: {
350
- confirmationStepMarginTop: "6px",
351
- confirmationStepVerticalGap: "18px",
352
- cryptoCashToggleContainerPadding: "3px",
353
- cryptoCashToggleMarginBottom: "16px",
354
- cryptoCashToggleMarginTop: "24px",
355
- cryptoCashToggleTabPaddingY: "6px",
356
- dropdownItemIconGap: "4px",
357
- dropdownItemPaddingX: "4px",
358
- dropdownItemPaddingY: "6px",
359
- dropdownCompactPaddingX: "6px",
360
- dropdownCompactPaddingY: "6px",
361
- dropdownPaddingX: "12px",
362
- dropdownPaddingY: "12px",
363
- modalBaseHorizontalPadding: "6px",
364
- modalBottomBarButtonPaddingY: "0px",
365
- modalBottomHorizontalPadding: "12px",
366
- modalPaddingBottomUpper: "16px",
367
- modalPaddingBottomLower: "16px",
368
- modalTopBarVerticalTextSpacing: "0px",
369
- selectAssetItemPaddingX: "12px",
370
- selectAssetItemPaddingY: "8px",
371
- selectAssetItemTextGap: "0px",
372
- selectBrokerageItemPaddingX: "12px",
373
- selectBrokerageItemPaddingY: "11px",
374
- selectBrokerageListGap: "0px",
375
- walletConnectorListGap: "10px",
376
- txBreakdownMarginY: "18px",
377
- txBreakdownPaddingX: "12px",
378
- txSummaryBoxPaddingX: "12px",
379
- txSummaryBoxPaddingY: "12px",
380
- txSummaryLineItemPadding: "0px",
381
- txSummaryDividerMarginX: "12px",
382
- txSummaryDividerMarginY: "12px",
383
- verticalSectionGap: "18px",
384
- withdrawalModalPaddingTop: "12px",
385
- youPayYouReceivePaddingLeft: "12px",
386
- youPayYouReceivePaddingRight: "16px",
387
- youPayYouReceivePaddingY: "8px",
388
- inputPaddingX: "12px",
389
- inputPaddingY: "12px",
390
- dropdownActiveItemRegularSizePaddingY: "8px",
391
- assetListDefaultGap: "4px",
392
- dropdownGroupDividerMarginY: "8px",
393
- ...customSpacings
394
- },
395
- textTransforms: {
396
- inputAmountQuickOptionButton: "none",
397
- txStatusTitle: "none",
398
- ...customTextTransforms
399
- }
400
- });
401
-
402
- // src/themes/darkTheme.ts
403
- var accentColors = {
404
- blue: { accentColor: "#3898FF", accentColorForeground: "#FFF" },
405
- green: { accentColor: "#66CC00", accentColorForeground: "#000" },
406
- orange: { accentColor: "#F6851B", accentColorForeground: "#000" },
407
- pink: { accentColor: "#FF7AB8", accentColorForeground: "#000" },
408
- purple: { accentColor: "#7A70FF", accentColorForeground: "#FFF" },
409
- red: { accentColor: "#F34126", accentColorForeground: "#FFF" },
410
- white: { accentColor: "#FFF", accentColorForeground: "#000" }
411
- };
412
- var defaultAccentColor = accentColors.white;
413
- var darkTheme = ({
414
- accentColor = defaultAccentColor.accentColor,
415
- accentColorForeground = defaultAccentColor.accentColorForeground,
416
- customColors,
417
- customShadows,
418
- ...baseThemeOptions
419
- // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: just a bunch of ?? defaults
420
- } = {}) => ({
421
- ...baseTheme(baseThemeOptions),
422
- colors: {
423
- accentColor,
424
- accentColorForeground,
425
- actionButtonBorder: "rgba(255, 255, 255, 0.04)",
426
- connectButtonBackground: "#000",
427
- connectButtonBackgroundError: "#C60000",
428
- connectButtonText: "#FFF",
429
- connectButtonTextError: "#FFF",
430
- connectionIndicator: "#30E000",
431
- error: accentColors.red.accentColor,
432
- errorBackground: "#F2E6E4",
433
- errorBorder: "rgba(243, 65, 38, 0.2)",
434
- generalBorder: "#292929",
435
- // strokeColor in figma
436
- generalBorderDim: "rgba(255, 255, 255, 0.04)",
437
- menuItemBackground: "rgba(255, 255, 255, 0.03)",
438
- selectedOptionBorder: "rgba(224, 232, 255, 0.1)",
439
- focusedOptionBorder: "#8C8C8C",
440
- standby: "#F6851B",
441
- success: "#66CC00",
442
- delayedStatusIcon: customColors?.secondaryText ?? "#8C8C8C",
443
- // backward compatibility
444
- chainIconBorder: "#fff",
445
- // FUNKIT COLORS
446
- // modal backgrounds
447
- modalBackdrop: "rgba(0, 0, 0, 0.2)",
448
- modalBackground: "#000000",
449
- modalBorder: "#292929",
450
- modalTopbarIcon: "#FFF",
451
- modalTopbarIconBackground: customColors?.modalTopbarIconBackground ?? "transparent",
452
- modalTopbarIconBackgroundHover: customColors?.modalTopbarIconBackgroundHover ?? customColors?.buttonIconBackgroundHover ?? "#333333",
453
- modalTopbarIconBackgroundPressed: customColors?.modalTopbarIconBackgroundPressed ?? customColors?.buttonIconBackgroundPressed ?? "#333333",
454
- modalTopbarIconStroke: customColors?.modalTopbarIconStroke ?? customColors?.buttonIconStroke ?? "rgba(255, 255, 255, 0.35)",
455
- offBackground: "#1F1F1F",
456
- offBackgroundInverse: "#F2F2F2",
457
- hoverState: "#333333",
458
- lightStroke: "#333333",
459
- mediumStroke: "#333333",
460
- heavyStroke: "rgba(117, 117, 117, 0.40)",
461
- strokeColor: "#333333",
462
- secondaryBackground: "#333333",
463
- //Text
464
- primaryText: "#FFF",
465
- secondaryText: "#8C8C8C",
466
- tertiaryText: "rgba(255, 255, 255, 0.35)",
467
- textSelection: "rgba(255, 255, 255, 0.10)",
468
- selectedDropdownItemText: customColors?.primaryText ?? "#FFF",
469
- copyButtonBackgroundBase: customColors?.offBackground ?? "#1F1F1F",
470
- copyButtonBackgroundHover: customColors?.hoverState ?? "#333333",
471
- copyButtonBackgroundActive: customColors?.inputBorderHover ?? "#525252",
472
- useConnectedBackgroundBase: customColors?.mediumStroke ?? "#333333",
473
- useConnectedBackgroundHover: customColors?.mediumStroke ?? "#333333",
474
- copyButtonBorderBase: customColors?.mediumStroke ?? "#333333",
475
- copyButtonBorderHover: customColors?.mediumStroke ?? "#333333",
476
- funFeatureListBackgroundBase: customColors?.offBackground ?? "#1F1F1F",
477
- funFeatureListBackgroundHover: customColors?.hoverState ?? "#333333",
478
- funFeatureListBorderColor: "transparent",
479
- funFeatureListBorderColorHover: "transparent",
480
- selectedDropdownItemBackground: "transparent",
481
- alwaysVisibleLabelBackgroundHover: "transparent",
482
- // input
483
- inputLabel: customColors?.primaryText ?? "#FFF",
484
- inputBackground: customColors?.inputBackground ?? "#000000",
485
- inputBackgroundHover: customColors?.offBackground ?? "#1F1F1F",
486
- inputBorderBase: "#333333",
487
- inputBorderHover: "#525252",
488
- // tab
489
- activeTabBorderColor: "#333333",
490
- activeTabBackground: "#333333",
491
- inactiveTabBorderColor: "transparent",
492
- inactiveTabBackgroundBase: "transparent",
493
- inactiveTabBackgroundHover: "transparent",
494
- inactiveTabBackgroundActive: "transparent",
495
- activeTabText: customColors?.primaryText ?? "#FFF",
496
- inactiveTabTextBase: customColors?.secondaryText ?? "#8C8C8C",
497
- inactiveTabHover: customColors?.primaryText ?? "#FFF",
498
- // button
499
- actionColor: "#FFF",
500
- actionColorHover: "rgba(255, 255, 255, 0.8)",
501
- actionColorDisabled: "rgba(255, 255, 255, 0.65)",
502
- buttonPrimary: accentColor,
503
- buttonDisabled: "rgba(255, 255, 255, 0.20)",
504
- buttonTextPrimary: "#000000",
505
- buttonTextHover: "#000000",
506
- buttonTextDisabled: "#000000",
507
- buttonWarning: accentColors.red.accentColor,
508
- buttonSuccess: "#2EA200",
509
- transparent: "transparent",
510
- buttonBackgroundTertiary: "#333333",
511
- buttonBackgroundHoverTertiary: "#333333",
512
- buttonBackgroundDisabledTertiary: "transparent",
513
- buttonTextTertiary: "#FFF",
514
- buttonTextDisabledTertiary: "rgba(255, 255, 255, 0.65)",
515
- buttonBackground: "#FFF",
516
- buttonBackgroundHover: "#f2f2f2",
517
- buttonBackgroundPressed: "#FFF",
518
- buttonBackgroundDisabled: "rgba(255, 255, 255, 0.65)",
519
- buttonTextSecondaryDisabled: "rgba(255, 255, 255, 0.65)",
520
- buttonTextSecondary: "#FFFFFF",
521
- buttonIconBackgroundHover: "#333333",
522
- buttonIconBackgroundPressed: "#333333",
523
- buttonIconStroke: "rgba(255, 255, 255, 0.35)",
524
- buttonBorderTertiary: "transparent",
525
- buttonBorderFocusedTertiary: "rgba(255, 255, 255, 0.35)",
526
- buttonFocusedOutline: "none",
527
- buttonBorderGradient: "none",
528
- buttonHoverBorderGradient: "none",
529
- buttonDisabledBorderGradient: "none",
530
- // TODO: Make common colors when refactoring the design system
531
- inputAmountQuickOptionBaseBackground: "#1F1F1F",
532
- inputAmountQuickOptionHoverBackground: "#333333",
533
- inputAmountQuickOptionActiveBackground: "#333333",
534
- inputAmountQuickOptionDisabledBackground: "#333333",
535
- inputAmountQuickOptionBaseBorder: "#f2f2f2",
536
- inputAmountQuickOptionHoverBorder: "rgba(255, 255, 255, 0.35)",
537
- inputAmountQuickOptionActiveBorder: "rgba(255, 255, 255, 0.35)",
538
- inputAmountQuickOptionFocusedBorder: "rgba(255, 255, 255, 0.35)",
539
- inputAmountFiatDecimalsColor: customColors?.inputAmountFiatDecimalsColor ?? "none",
540
- youPayYouReceiveBackground: "#000000",
541
- // modalBackground
542
- youPayYouReceiveBorder: "#333333",
543
- // mediumStroke
544
- youPayYouReceivePrimaryText: "#FFF",
545
- // primaryText
546
- youPayYouReceiveSecondaryText: "#8C8C8C",
547
- // secondaryText
548
- withdrawalYouWillReceiveLabel: customColors?.withdrawalYouWillReceiveLabel ?? customColors?.primaryText ?? "#FFF",
549
- withdrawalYouWillReceiveValueCrypto: customColors?.withdrawalYouWillReceiveValueCrypto ?? customColors?.primaryText ?? "#FFF",
550
- withdrawalYouWillReceiveValueUsd: customColors?.withdrawalYouWillReceiveValueUsd ?? customColors?.secondaryText ?? "#8C8C8C",
551
- // badges
552
- badgeBackgroundSuccess: "rgba(124, 242, 136, 0.1)",
553
- badgeBorderSuccess: "rgba(124, 242, 136, 0.2)",
554
- badgeTextSuccess: "rgb(124, 242, 136)",
555
- newBadgeBackground: "linear-gradient(180deg, rgba(57, 76, 56, 0.55) 0%, rgba(61, 81, 65, 0.55) 100%)",
556
- newBadgeBorder: "rgba(122, 221, 122, 0.3)",
557
- newBadgeText: "#A4FF9A",
558
- approvedBadgeBackground: "linear-gradient(180deg, rgba(236, 255, 234, 0.20) 0%, rgba(228, 255, 233, 0.20) 100%)",
559
- approvedBadgeBorder: "rgba(109, 216, 109, 0.08)",
560
- approvedBadgeText: "#8FFFA9",
561
- failedBadgeBackground: "rgba(255, 61, 61, 0.18)",
562
- failedBadgeBorder: "rgba(255, 255, 255, 0.10)",
563
- failedBadgeText: "#F88877",
564
- announceGradientFrom: "#AAAAAA",
565
- announceGradientTo: "#BEBEBE",
566
- fiatPendingGradientFrom: "#AAAAAA",
567
- fiatPendingGradientTo: "#BEBEBE",
568
- fiatSuccessBackgroundFill: "rgba(102, 204, 0, 0.30)",
569
- fiatFailedBackgroundFill: "rgba(255, 61, 61, 0.30)",
570
- fiatStatusIconBorder: "rgba(255, 255, 255, 0.06)",
571
- fiatAccountIconFill: "#002F5E",
572
- fiatAccountGradientFrom: "#3A82FE",
573
- fiatAccountGradientTo: "#73A7FF",
574
- modalHeaderDivider: "#333333",
575
- // lightStroke
576
- modalFooterDivider: "#333333",
577
- // lightStroke
578
- spinnerBackground: customColors?.mediumStroke ?? "rgba(0, 0, 0, 0.3)",
579
- // 30% buttonTextPrimary
580
- spinnerIndicator: customColors?.primaryText ?? "#000",
581
- // 100% buttonTextPrimary
582
- spinnerBackgroundVerifyAccount: "rgba(0, 0, 0, 0.3)",
583
- // 30% buttonTextPrimary
584
- spinnerIndicatorVerifyAccount: customColors?.primaryText ?? "#000",
585
- // 100% buttonTextPrimary
586
- // Override colors
587
- ...customColors || {},
588
- // option Boxes
589
- optionBoxBackground: customColors?.optionBoxBackground ?? customColors?.modalBackground ?? "#000",
590
- // keeps gradient in SourcePaymentMethodItem if optionBoxBackground differs from modal background
591
- optionBoxBorderedBackground: customColors?.optionBoxBorderedBackground ?? customColors?.optionBoxBackground ?? customColors?.modalBackground ?? "#000",
592
- optionBoxBackgroundUninteractive: customColors?.optionBoxBackgroundUninteractive ?? "transparent",
593
- optionBoxBorderBase: customColors?.optionBoxBorderBase ?? customColors?.mediumStroke ?? "#333333",
594
- optionBoxBorderHover: customColors?.optionBoxBorderHover ?? customColors?.mediumStroke ?? "#333333",
595
- optionBoxDefaultModeNotActiveBorderBase: customColors?.optionBoxDefaultModeNotActiveBorderBase ?? "transparent",
596
- optionBoxDefaultModeNotActiveBorderHover: customColors?.optionBoxDefaultModeNotActiveBorderHover ?? "transparent",
597
- dropdownActiveItemBackgroundBase: customColors?.dropdownActiveItemBackgroundBase ?? customColors?.modalBackground ?? "#000000",
598
- openDropdownBackgroundColor: customColors?.openDropdownBackgroundColor ?? customColors?.optionBoxBackground ?? customColors?.modalBackground ?? "#000",
599
- dropdownActiveItemBackgroundHover: customColors?.dropdownActiveItemBackgroundHover ?? customColors?.offBackground ?? "#1F1F1F",
600
- dropdownActiveItemBackgroundDisabled: customColors?.dropdownActiveItemBackgroundDisabled ?? "transparent",
601
- dropdownActiveItemBorderBase: customColors?.dropdownActiveItemBorderBase ?? customColors?.mediumStroke ?? "#333333",
602
- dropdownActiveItemBorderHover: customColors?.dropdownActiveItemBorderHover ?? customColors?.mediumStroke ?? "#333333",
603
- dropdownGroupHeader: customColors?.dropdownGroupHeader ?? customColors?.primaryText ?? "#FFF",
604
- // primaryText
605
- txSummaryBoxBackground: customColors?.txSummaryBoxBackground ?? customColors?.modalBackground ?? "#000",
606
- txSummaryBoxBorder: customColors?.txSummaryBoxBorder ?? customColors?.lightStroke ?? "#333333",
607
- modalBackgroundCheckoutComplete: customColors?.modalBackgroundCheckoutComplete ?? customColors?.modalBackground ?? "#000",
608
- counterRingColor: customColors?.counterRingColor ?? accentColor,
609
- cryptoCashToggleContainerBorderColor: customColors?.cryptoCashToggleContainerBorderColor ?? "transparent",
610
- cryptoCashToggleBackground: customColors?.cryptoCashToggleBackground ?? "transparent",
611
- qrCodeBackground: customColors?.qrCodeBackground ?? customColors?.modalBackground ?? "#000000",
612
- qrCodeForeground: customColors?.qrCodeForeground ?? customColors?.primaryText ?? "#FFFFFF"
613
- },
614
- shadows: {
615
- connectButton: "0px 4px 12px rgba(0, 0, 0, 0.1)",
616
- dialog: "0px 8px 32px rgba(0, 0, 0, 0.32)",
617
- selectedOption: "0px 2px 6px rgba(0, 0, 0, 0.24)",
618
- selectedWallet: "0px 2px 6px rgba(0, 0, 0, 0.24)",
619
- dropdown: "0px 0px 0px 1px rgba(255, 255, 255, 0.16), 0px 2px 6px rgba(0, 0, 0, 0.03), 0px 4px 42px rgba(0, 0, 0, 0.06)",
620
- notification: "0px 0px 0px 1px rgba(255, 255, 255, 0.20), 0px 2px 6px 0px rgba(0, 0, 0, 0.05), 0px 4px 42px 0px rgba(0, 0, 0, 0.06)",
621
- qrCode: "0px 0px 0px 1px rgba(255, 255, 255, 0.16)",
622
- buttonShadow: "none",
623
- buttonShadowTertiary: "none",
624
- buttonHoverShadow: "none",
625
- buttonHoverShadowTertiary: "none",
626
- buttonFocusedShadow: "0px 0px 0px 2px rgba(255, 255, 255, 0.25)",
627
- buttonFocusedShadowTertiary: "0px 0px 0px 2px rgba(255, 255, 255, 0.25)",
628
- buttonDisabledShadow: "none",
629
- buttonDisabledShadowTertiary: "none",
630
- buttonInnerShadow: "none",
631
- buttonInnerShadowTertiary: customShadows?.buttonInnerShadow ?? "none",
632
- buttonFocusedInnerShadow: "none",
633
- buttonFocusedInnerShadowTertiary: customShadows?.buttonFocusedInnerShadow ?? "none",
634
- buttonHoverInnerShadow: "none",
635
- buttonHoverInnerShadowTertiary: customShadows?.buttonHoverInnerShadow ?? "none",
636
- buttonDisabledInnerShadow: "none",
637
- buttonDisabledInnerShadowTertiary: customShadows?.buttonDisabledInnerShadow ?? "none",
638
- selectedDropdownItem: "none",
639
- // Override shadows
640
- ...customShadows || {}
641
- },
642
- moonpayTheme: "dark"
643
- });
644
- darkTheme.accentColors = accentColors;
645
-
646
- // src/themes/lightTheme.ts
647
- var accentColors2 = {
648
- blue: { accentColor: "#31A3F8", accentColorForeground: "#31A3F859" },
649
- green: { accentColor: "#66CC00", accentColorForeground: "#FFF" },
650
- orange: { accentColor: "#F6851B", accentColorForeground: "#FFF" },
651
- pink: { accentColor: "#FF5CA0", accentColorForeground: "#FFF" },
652
- purple: { accentColor: "#5F5AFA", accentColorForeground: "#FFF" },
653
- red: { accentColor: "#F34126", accentColorForeground: "#FFF" },
654
- white: { accentColor: "#000000", accentColorForeground: "#FFF" }
655
- };
656
- var defaultAccentColor2 = accentColors2.white;
657
- var lightTheme = ({
658
- accentColor = defaultAccentColor2.accentColor,
659
- accentColorForeground = defaultAccentColor2.accentColorForeground,
660
- customColors,
661
- customShadows,
662
- ...baseThemeOptions
663
- // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: just a bunch of ?? defaults
664
- } = {}) => ({
665
- ...baseTheme(baseThemeOptions),
666
- colors: {
667
- accentColor,
668
- accentColorForeground,
669
- actionButtonBorder: "rgba(0, 0, 0, 0.04)",
670
- connectButtonBackground: "#FFF",
671
- connectButtonBackgroundError: "#C60000",
672
- connectButtonText: "#25292E",
673
- connectButtonTextError: "#FFF",
674
- connectionIndicator: "#30E000",
675
- error: accentColors2.red.accentColor,
676
- errorBackground: "#F2E6E4",
677
- errorBorder: "rgba(243, 65, 38, 0.2)",
678
- generalBorder: "#F7F7F7",
679
- // strokeColor in figma
680
- generalBorderDim: "rgba(0, 0, 0, 0.03)",
681
- menuItemBackground: "#FCFCFC",
682
- selectedOptionBorder: "#F7F7F7",
683
- focusedOptionBorder: "#737373",
684
- standby: "#F6851B",
685
- success: "#66CC00",
686
- delayedStatusIcon: customColors?.secondaryText ?? "#737373",
687
- // backward compatibility
688
- chainIconBorder: "#fff",
689
- // FUNKIT COLORS
690
- // modal backgrounds
691
- modalBackdrop: "rgba(0, 0, 0, 0.2)",
692
- modalTopbarIcon: "#000",
693
- modalTopbarIconBackground: customColors?.modalTopbarIconBackground ?? "transparent",
694
- modalTopbarIconBackgroundHover: customColors?.modalTopbarIconBackgroundHover ?? customColors?.buttonIconBackgroundHover ?? "#F7F7F7",
695
- modalTopbarIconBackgroundPressed: customColors?.modalTopbarIconBackgroundPressed ?? customColors?.buttonIconBackgroundPressed ?? "#F0F0F0",
696
- modalTopbarIconStroke: customColors?.modalTopbarIconStroke ?? customColors?.buttonIconStroke ?? "rgba(0, 0, 0, 0.35)",
697
- modalBackground: "#FFF",
698
- modalBorder: "#F7F7F7",
699
- offBackground: "#F7F7F7",
700
- offBackgroundInverse: "#333333",
701
- hoverState: "#F0F0F0",
702
- lightStroke: "#F7F7F7",
703
- mediumStroke: "#F0F0F0",
704
- heavyStroke: "#E5E5E5",
705
- strokeColor: "#E8E8E8",
706
- secondaryBackground: "#F7F7F7",
707
- //Text
708
- primaryText: "#000",
709
- secondaryText: "#737373",
710
- tertiaryText: "rgba(0, 0, 0, 0.35)",
711
- textSelection: "rgba(0, 0, 0, 0.10)",
712
- selectedDropdownItemText: customColors?.primaryText ?? "#000",
713
- copyButtonBackgroundBase: customColors?.offBackground ?? "#F7F7F7",
714
- copyButtonBackgroundHover: customColors?.hoverState ?? "#F0F0F0",
715
- copyButtonBackgroundActive: customColors?.inputBorderHover ?? "#E5E5E5",
716
- useConnectedBackgroundBase: customColors?.mediumStroke ?? "#F0F0F0",
717
- useConnectedBackgroundHover: customColors?.mediumStroke ?? "#F0F0F0",
718
- copyButtonBorderBase: customColors?.mediumStroke ?? "#F0F0F0",
719
- copyButtonBorderHover: customColors?.mediumStroke ?? "#F0F0F0",
720
- funFeatureListBackgroundBase: customColors?.offBackground ?? "#F7F7F7",
721
- funFeatureListBackgroundHover: customColors?.hoverState ?? "#F0F0F0",
722
- funFeatureListBorderColor: "transparent",
723
- funFeatureListBorderColorHover: "transparent",
724
- selectedDropdownItemBackground: "transparent",
725
- alwaysVisibleLabelBackgroundHover: "transparent",
726
- // input
727
- inputLabel: customColors?.primaryText ?? "#000",
728
- inputBackground: "#FFFFFF",
729
- inputBackgroundHover: customColors?.offBackground ?? "#F7F7F7",
730
- inputBorderBase: "#F0F0F0",
731
- inputBorderHover: "#E5E5E5",
732
- // tab
733
- activeTabBorderColor: "#F7F7F7",
734
- activeTabBackground: "#F7F7F7",
735
- inactiveTabBorderColor: "transparent",
736
- inactiveTabBackgroundBase: "transparent",
737
- inactiveTabBackgroundHover: "transparent",
738
- inactiveTabBackgroundActive: "transparent",
739
- activeTabText: customColors?.primaryText ?? "#000",
740
- inactiveTabTextBase: customColors?.secondaryText ?? "#737373",
741
- inactiveTabHover: customColors?.primaryText ?? "#000",
742
- // button
743
- actionColor: "#000",
744
- actionColorHover: "rgba(0, 0, 0, 0.7)",
745
- actionColorDisabled: "rgba(0, 0, 0, 0.50)",
746
- buttonPrimary: accentColor,
747
- buttonDisabled: "#31A3F826",
748
- buttonWarning: accentColors2.red.accentColor,
749
- buttonSuccess: "#2EA200",
750
- buttonTextPrimary: "#FFFFFF",
751
- buttonTextHover: "#FFF",
752
- buttonTextDisabled: "#FFF",
753
- transparent: "transparent",
754
- buttonBackgroundTertiary: "#F7F7F7",
755
- buttonBackgroundHoverTertiary: "#F0F0F0",
756
- buttonBackgroundDisabledTertiary: "transparent",
757
- buttonTextTertiary: "#000",
758
- buttonTextDisabledTertiary: "rgba(0, 0, 0, 0.5)",
759
- buttonBackground: "#000",
760
- buttonBackgroundHover: "#333333",
761
- buttonBackgroundPressed: "#000",
762
- buttonBackgroundDisabled: "rgba(0, 0, 0, 0.5)",
763
- buttonTextSecondaryDisabled: "rgba(0, 0, 0, 0.5)",
764
- buttonTextSecondary: "#000000",
765
- buttonIconBackgroundHover: "#F7F7F7",
766
- buttonIconBackgroundPressed: "#F0F0F0",
767
- buttonIconStroke: "rgba(0, 0, 0, 0.35)",
768
- buttonBorderTertiary: "transparent",
769
- buttonBorderFocusedTertiary: "rgba(0, 0, 0, 0.35)",
770
- buttonFocusedOutline: "none",
771
- buttonBorderGradient: "none",
772
- buttonHoverBorderGradient: "none",
773
- buttonDisabledBorderGradient: "none",
774
- // TODO: Make common colors when refactoring the design system
775
- inputAmountQuickOptionBaseBackground: "#F7F7F7",
776
- inputAmountQuickOptionHoverBackground: "#F0F0F0",
777
- inputAmountQuickOptionActiveBackground: "#F0F0F0",
778
- inputAmountQuickOptionDisabledBackground: "#F7F7F7",
779
- inputAmountQuickOptionBaseBorder: "#F7F7F7",
780
- inputAmountQuickOptionHoverBorder: "rgba(0, 0, 0, 0.35)",
781
- inputAmountQuickOptionActiveBorder: "rgba(0, 0, 0, 0.35)",
782
- inputAmountQuickOptionFocusedBorder: "rgba(0, 0, 0, 0.35)",
783
- inputAmountFiatDecimalsColor: customColors?.inputAmountFiatDecimalsColor ?? "none",
784
- youPayYouReceiveBackground: "#FFF",
785
- // modalBackground
786
- youPayYouReceiveBorder: "#F0F0F0",
787
- // mediumStroke
788
- youPayYouReceivePrimaryText: "#000",
789
- // primaryText
790
- youPayYouReceiveSecondaryText: "#737373",
791
- // secondaryText
792
- withdrawalYouWillReceiveLabel: customColors?.withdrawalYouWillReceiveLabel ?? customColors?.primaryText ?? "#000",
793
- withdrawalYouWillReceiveValueCrypto: customColors?.withdrawalYouWillReceiveValueCrypto ?? customColors?.primaryText ?? "#000",
794
- withdrawalYouWillReceiveValueUsd: customColors?.withdrawalYouWillReceiveValueUsd ?? customColors?.secondaryText ?? "#737373",
795
- // badges
796
- badgeBackgroundSuccess: "rgba(124, 242, 136, 0.1)",
797
- badgeBorderSuccess: "rgba(124, 242, 136, 0.2)",
798
- badgeTextSuccess: "rgb(124, 242, 136)",
799
- newBadgeBackground: "linear-gradient(180deg, #ECFFEA 0%, #E4FFE9 100%)",
800
- newBadgeBorder: "rgba(122, 221, 122, 0.5)",
801
- newBadgeText: "#028320",
802
- approvedBadgeBackground: "linear-gradient(180deg, #ECFFEA 0%, #E4FFE9 100%)",
803
- approvedBadgeBorder: "rgba(109, 216, 109, 0.5)",
804
- approvedBadgeText: "#028320",
805
- failedBadgeBackground: "rgba(255, 61, 61, 0.08)",
806
- failedBadgeBorder: "rgba(0, 0, 0, 0.03)",
807
- failedBadgeText: "#C2341E",
808
- announceGradientFrom: "#595959",
809
- announceGradientTo: "#9C9C9C",
810
- fiatPendingGradientFrom: "#454545",
811
- fiatPendingGradientTo: "#747474",
812
- fiatSuccessBackgroundFill: "rgba(102, 204, 0, 0.16)",
813
- fiatFailedBackgroundFill: "rgba(255, 61, 61, 0.12)",
814
- fiatStatusIconBorder: "rgba(0, 0, 0, 0.03)",
815
- fiatAccountIconFill: "#E7F3FE",
816
- fiatAccountGradientFrom: "#055DF5",
817
- fiatAccountGradientTo: "#4C8DFD",
818
- modalHeaderDivider: "#F7F7F7",
819
- // lightStroke
820
- modalFooterDivider: "#F7F7F7",
821
- // lightStroke
822
- spinnerBackground: customColors?.mediumStroke ?? "rgba(255, 255, 255, 0.3)",
823
- // 30% buttonTextPrimary
824
- spinnerIndicator: customColors?.primaryText ?? "#FFF",
825
- // 100% buttonTextPrimary
826
- spinnerBackgroundVerifyAccount: "rgba(255, 255, 255, 0.3)",
827
- // 30% buttonTextPrimary
828
- spinnerIndicatorVerifyAccount: customColors?.primaryText ?? "#FFF",
829
- // 100% buttonTextPrimary
830
- // Override colors
831
- ...customColors || {},
832
- // option Boxes
833
- optionBoxBackground: customColors?.optionBoxBackground ?? customColors?.modalBackground ?? "#FFF",
834
- // keeps gradient in SourcePaymentMethodItem if optionBoxBackground differs from modal background
835
- optionBoxBorderedBackground: customColors?.optionBoxBorderedBackground ?? customColors?.optionBoxBackground ?? customColors?.modalBackground ?? "#FFF",
836
- optionBoxBackgroundUninteractive: customColors?.optionBoxBackgroundUninteractive ?? "transparent",
837
- optionBoxBorderBase: customColors?.optionBoxBorderBase ?? customColors?.mediumStroke ?? "#F0F0F0",
838
- optionBoxBorderHover: customColors?.optionBoxBorderHover ?? customColors?.mediumStroke ?? "#F0F0F0",
839
- optionBoxDefaultModeNotActiveBorderBase: customColors?.optionBoxDefaultModeNotActiveBorderBase ?? "transparent",
840
- optionBoxDefaultModeNotActiveBorderHover: customColors?.optionBoxDefaultModeNotActiveBorderHover ?? "transparent",
841
- dropdownActiveItemBackgroundBase: customColors?.dropdownActiveItemBackgroundBase ?? customColors?.modalBackground ?? "#FFF",
842
- openDropdownBackgroundColor: customColors?.openDropdownBackgroundColor ?? customColors?.optionBoxBackground ?? customColors?.modalBackground ?? "#FFF",
843
- dropdownActiveItemBackgroundHover: customColors?.dropdownActiveItemBackgroundHover ?? customColors?.offBackground ?? "#F7F7F7",
844
- dropdownActiveItemBackgroundDisabled: customColors?.dropdownActiveItemBackgroundDisabled ?? "transparent",
845
- dropdownActiveItemBorderBase: customColors?.dropdownActiveItemBorderBase ?? customColors?.mediumStroke ?? "#F0F0F0",
846
- dropdownActiveItemBorderHover: customColors?.dropdownActiveItemBorderHover ?? customColors?.mediumStroke ?? "#F0F0F0",
847
- dropdownGroupHeader: customColors?.dropdownGroupHeader ?? customColors?.primaryText ?? "#000",
848
- // primaryText
849
- txSummaryBoxBackground: customColors?.txSummaryBoxBackground ?? customColors?.modalBackground ?? "#FFF",
850
- txSummaryBoxBorder: customColors?.txSummaryBoxBorder ?? customColors?.lightStroke ?? "#F7F7F7",
851
- modalBackgroundCheckoutComplete: customColors?.modalBackgroundCheckoutComplete ?? customColors?.modalBackground ?? "#FFF",
852
- counterRingColor: customColors?.counterRingColor ?? accentColor,
853
- cryptoCashToggleContainerBorderColor: customColors?.cryptoCashToggleContainerBorderColor ?? "transparent",
854
- cryptoCashToggleBackground: customColors?.cryptoCashToggleBackground ?? "transparent",
855
- qrCodeBackground: customColors?.qrCodeBackground ?? customColors?.modalBackground ?? "#FFF",
856
- qrCodeForeground: customColors?.qrCodeForeground ?? customColors?.primaryText ?? "#000"
857
- },
858
- shadows: {
859
- connectButton: "0px 4px 12px rgba(0, 0, 0, 0.1)",
860
- dialog: "0px 8px 32px rgba(0, 0, 0, 0.32)",
861
- selectedOption: "0px 2px 6px rgba(0, 0, 0, 0.24)",
862
- selectedWallet: "0px 2px 6px rgba(0, 0, 0, 0.12)",
863
- dropdown: "0px 0px 0px 1px rgba(0, 0, 0, 0.05), 0px 2px 6px 0px rgba(0, 0, 0, 0.03), 0px 4px 42px 0px rgba(0, 0, 0, 0.06)",
864
- notification: "0px 0px 0px 1px rgba(0, 0, 0, 0.06), 0px 2px 6px 0px rgba(0, 0, 0, 0.05), 0px 4px 42px 0px rgba(0, 0, 0, 0.06)",
865
- qrCode: "0px 0px 0px 1px rgba(0, 0, 0, 0.10), 0px 1px 4px 0px rgba(0, 0, 0, 0.04), 0px 4px 24px 0px rgba(8, 7, 7, 0.10)",
866
- buttonShadow: "none",
867
- buttonShadowTertiary: customShadows?.buttonShadow ?? "none",
868
- buttonFocusedShadow: "0px 0px 0px 2px rgba(0, 0, 0, 0.25)",
869
- buttonFocusedShadowTertiary: "0px 0px 0px 2px rgba(0, 0, 0, 0.25)",
870
- buttonHoverShadow: "none",
871
- buttonHoverShadowTertiary: "none",
872
- buttonDisabledShadow: "none",
873
- buttonDisabledShadowTertiary: customShadows?.buttonDisabledShadow ?? "none",
874
- buttonInnerShadow: "none",
875
- buttonInnerShadowTertiary: customShadows?.buttonInnerShadow ?? "none",
876
- buttonFocusedInnerShadow: "none",
877
- buttonFocusedInnerShadowTertiary: customShadows?.buttonFocusedInnerShadow ?? "none",
878
- buttonHoverInnerShadow: "none",
879
- buttonHoverInnerShadowTertiary: customShadows?.buttonHoverInnerShadow ?? "none",
880
- buttonDisabledInnerShadow: "none",
881
- buttonDisabledInnerShadowTertiary: customShadows?.buttonDisabledInnerShadow ?? "none",
882
- selectedDropdownItem: "none",
883
- // Override shadows
884
- ...customShadows || {}
885
- },
886
- moonpayTheme: "light"
887
- });
888
- lightTheme.accentColors = accentColors2;
889
-
890
- // src/providers/FunkitThemeProvider.tsx
891
- var DEFAULT_THEME_SET = {
892
- lightTheme: lightTheme(),
893
- darkTheme: darkTheme()
894
- };
895
- var DEFAULT_THEME = DEFAULT_THEME_SET.darkTheme;
896
- var ThemeIdContext = createContext2(void 0);
897
- var ThemeContext = createContext2({
898
- activeTheme: DEFAULT_THEME,
899
- lightTheme: void 0,
900
- darkTheme: void 0,
901
- setTheme: () => {
902
- return;
903
- },
904
- toggleTheme: () => {
905
- return;
906
- },
907
- themeColorScheme: void 0
908
- });
909
- var useActiveTheme = () => {
910
- const {
911
- activeTheme,
912
- setTheme,
913
- lightTheme: lightTheme2,
914
- darkTheme: darkTheme2,
915
- toggleTheme,
916
- themeColorScheme
917
- } = useContext2(ThemeContext);
918
- return {
919
- activeTheme,
920
- /** Overrides the currently active `theme` with disregard to the `theme` provided to the `FunkitProvider`, ie. `toggleTheme` will switch to the `theme` provided to the `FunkitProvider`, not the theme set by `setTheme` */
921
- setTheme,
922
- /** Returns the `light` theme as long as a themeSet was passed to the `FunkitProvider`, if only a single theme object was passed it will be returned as `lightTheme` and `darkTheme` making them the same */
923
- lightTheme: lightTheme2,
924
- /** Returns the `dark` theme as long as a themeSet was passed to the `FunkitProvider`, if only a single theme object was passed it will be returned as `darkTheme` and `lightTheme` making them the same */
925
- darkTheme: darkTheme2,
926
- /** Toggles between `light` and `dark` themes as long as they were passed to the `FunkitProvider`, if only a single theme object was passed toggling will be disabled */
927
- toggleTheme,
928
- /** Returns an indication whether a `light` or a `dark` theme should be currently active, has meaning only if a themeSet was passed to the `FunkitProvider`, if only a single theme object was passed it reflects the system color scheme */
929
- themeColorScheme
930
- };
931
- };
932
-
933
- // src/components/FunSkeletonLoader/FunSkeletonBlock.tsx
934
- import React3 from "react";
935
-
936
- // src/components/FunSkeletonLoader/FunSkeletonLoader.css.ts
937
- var animateSkeletonClass = "dj0x602 _1rsrm2f15a";
938
-
939
- // src/components/FunSkeletonLoader/FunSkeletonBlock.tsx
940
- function FunSkeletonBlock({
941
- borderRadius = "skeleton",
942
- fontSize,
943
- height,
944
- width = "full",
945
- ...props
946
- }) {
947
- const { activeTheme } = useActiveTheme();
948
- const cssHeight = height ? activeTheme.dimensions[height] || (height.endsWith("px") ? height : `${height}px`) : activeTheme.fontSize[fontSize].lineHeight;
949
- return /* @__PURE__ */ React3.createElement(
950
- Box,
951
- {
952
- borderRadius,
953
- className: animateSkeletonClass,
954
- width,
955
- ...props,
956
- style: { height: cssHeight, ...props.style }
957
- }
958
- );
959
- }
960
-
961
- // src/components/Icons/SearchIcon.tsx
962
- import React4 from "react";
963
- var SearchIcon = () => {
964
- return /* @__PURE__ */ React4.createElement(
965
- "svg",
966
- {
967
- width: "15",
968
- height: "15",
969
- viewBox: "0 0 15 15",
970
- fill: "none",
971
- xmlns: "http://www.w3.org/2000/svg"
972
- },
973
- /* @__PURE__ */ React4.createElement(
974
- "path",
975
- {
976
- d: "M6.45041 12.9008C5.17464 12.9008 3.92752 12.5225 2.86676 11.8138C1.80599 11.105 0.979229 10.0975 0.491012 8.91887C0.00279446 7.74023 -0.124946 6.44321 0.123947 5.19199C0.37284 3.94074 0.987179 2.79139 1.88928 1.88928C2.79139 0.987179 3.94074 0.37284 5.19199 0.123947C6.44321 -0.124946 7.74023 0.00279446 8.91887 0.491012C10.0975 0.979229 11.105 1.80599 11.8138 2.86676C12.5225 3.92752 12.9008 5.17464 12.9008 6.45041C12.9008 7.29744 12.7339 8.13625 12.4098 8.91887C12.0856 9.70148 11.6105 10.4126 11.0115 11.0115C10.4126 11.6105 9.70148 12.0856 8.91887 12.4098C8.13625 12.7339 7.29744 12.9008 6.45041 12.9008ZM6.45041 1.29351C5.43386 1.29351 4.44014 1.59496 3.59491 2.15972C2.74968 2.72448 2.0909 3.52721 1.70189 4.46637C1.31287 5.40554 1.21108 6.43893 1.4094 7.43596C1.60772 8.43299 2.09724 9.34881 2.81604 10.0676C3.53486 10.7864 4.45067 11.276 5.44769 11.4743C6.44467 11.6726 7.47811 11.5708 8.41731 11.1818C9.35643 10.7927 10.1592 10.134 10.724 9.28876C11.2887 8.44352 11.5902 7.44984 11.5902 6.43328C11.5902 5.07012 11.0487 3.7628 10.0847 2.79891C9.12086 1.83502 7.81356 1.29351 6.45041 1.29351Z",
977
- fill: "currentColor"
978
- }
979
- ),
980
- /* @__PURE__ */ React4.createElement(
981
- "path",
982
- {
983
- d: "M14.3567 15C14.2723 15.0003 14.1886 14.9839 14.1107 14.9515C14.0327 14.9192 13.962 14.8716 13.9027 14.8115L10.3648 11.2737C10.2513 11.1519 10.1896 10.9907 10.1925 10.8243C10.1954 10.6578 10.2629 10.4991 10.3806 10.3813C10.4983 10.2636 10.6571 10.1962 10.8236 10.1933C10.99 10.1904 11.151 10.2521 11.2729 10.3656L14.8107 13.9035C14.931 14.024 14.9986 14.1872 14.9986 14.3575C14.9986 14.5277 14.931 14.691 14.8107 14.8115C14.7515 14.8716 14.6807 14.9192 14.6027 14.9515C14.5248 14.9839 14.4411 15.0003 14.3567 15Z",
984
- fill: "currentColor"
985
- }
986
- )
987
- );
988
- };
989
-
990
- // src/components/FunInput/FunInput.css.ts
991
- var baseWrapperStyles = "zue0i60";
992
- var baseWrapperStylesNoTransition = "zue0i61";
993
- var inputClass = "zue0i64 _1rsrm2f2qy _1rsrm2fri _1rsrm2ftj _1rsrm2fvl _1rsrm2fpi";
994
- var inputClassDisabled = "zue0i68 _1rsrm2f2ua _1rsrm2fri _1rsrm2ftj _1rsrm2fvl _1rsrm2fpi";
995
- var inputClassDisabledNoTransition = "zue0i6a _1rsrm2f2ua _1rsrm2fri _1rsrm2ftj _1rsrm2fvl _1rsrm2fpi";
996
- var inputClassError = "zue0i6c _1rsrm2f2qy _1rsrm2fri _1rsrm2ftj _1rsrm2fvl _1rsrm2fpi";
997
- var inputClassErrorNoTransition = "zue0i6f _1rsrm2f2qy _1rsrm2fri _1rsrm2ftj _1rsrm2fvl _1rsrm2fpi";
998
- var inputClassNoTransition = "zue0i66 _1rsrm2f2qy _1rsrm2fri _1rsrm2ftj _1rsrm2fvl _1rsrm2fpi";
999
- var numberInputResetStyle = "zue0i62";
1000
-
1001
- // src/components/FunInput/FunInput.tsx
1002
- var DEFAULT_ICON_FONT_SIZE = "57px";
1003
- var FunInput = forwardRef(function FunInputWithRef({
1004
- prefix,
1005
- suffix,
1006
- prefixIcon,
1007
- placeholder,
1008
- value,
1009
- label,
1010
- onChange,
1011
- onKeyDown,
1012
- onKeySubmit,
1013
- onPaste,
1014
- onMouseDown,
1015
- onFocus: userOnFocus,
1016
- onBlur: userOnBlur,
1017
- adornmentColor = "secondaryText",
1018
- fontFamily = "body",
1019
- textWeight = "inputLabel",
1020
- inputStyle = {},
1021
- inputClassName,
1022
- inputProps = { type: "text" },
1023
- error,
1024
- alwaysFocused,
1025
- overrideBorderWidth,
1026
- overrideBackground,
1027
- ignoreFontSize,
1028
- borderRadius = "connectButton",
1029
- isLoading = false,
1030
- allowMultiline = false,
1031
- ignoreBaseTransitions = false,
1032
- decimalsColor,
1033
- decimalSeparator,
1034
- testId
1035
- }, ref) {
1036
- const { activeTheme } = useActiveTheme();
1037
- const [focused, setFocused] = useState3(false);
1038
- const onFocus = () => {
1039
- setFocused(true);
1040
- userOnFocus?.();
1041
- };
1042
- const onBlur = () => {
1043
- setFocused(false);
1044
- userOnBlur?.();
1045
- };
1046
- const isFocused = alwaysFocused || focused;
1047
- const isValidDecimalColor = !!decimalsColor && activeTheme.colors?.[decimalsColor] !== "none";
1048
- const getBorderColor = () => {
1049
- if (error) {
1050
- return { base: "error" };
1051
- }
1052
- if (inputProps.disabled) {
1053
- return { base: "inputBorderBase" };
1054
- }
1055
- if (isFocused) {
1056
- return { base: "secondaryText" };
1057
- }
1058
- return {
1059
- base: "inputBorderBase",
1060
- hover: "inputBorderHover"
1061
- };
1062
- };
1063
- const textareaRef = React5.useRef(null);
1064
- useEffect2(() => {
1065
- if (allowMultiline) {
1066
- adjustTextareaHeight(textareaRef.current);
1067
- }
1068
- }, [allowMultiline, value]);
1069
- const { integerPart, decimalPart, shouldColorDecimals } = React5.useMemo(() => {
1070
- if (!isValidDecimalColor || !value || !decimalSeparator) {
1071
- return { integerPart: "", decimalPart: "", shouldColorDecimals: false };
1072
- }
1073
- const stringValue = String(value);
1074
- const parts = stringValue.split(decimalSeparator);
1075
- return {
1076
- integerPart: parts[0] || "",
1077
- decimalPart: parts[1] !== void 0 ? `${decimalSeparator}${parts[1]}` : "",
1078
- shouldColorDecimals: parts[1] !== void 0
1079
- };
1080
- }, [value, isValidDecimalColor, decimalSeparator]);
1081
- const renderInputOrTextarea = () => {
1082
- const commonProps = {
1083
- // ref,
1084
- value,
1085
- placeholder,
1086
- onChange,
1087
- onKeyDown: (e) => {
1088
- e.stopPropagation();
1089
- onKeyDown?.(e);
1090
- if (e.key === "Enter") {
1091
- onKeySubmit?.();
1092
- }
1093
- },
1094
- onPaste,
1095
- onMouseDown,
1096
- onFocus,
1097
- onBlur,
1098
- onWheel: (e) => {
1099
- e.currentTarget.blur();
1100
- },
1101
- className: clsx(
1102
- error ? ignoreBaseTransitions ? inputClassErrorNoTransition : inputClassError : inputProps.disabled ? ignoreBaseTransitions ? inputClassDisabledNoTransition : inputClassDisabled : ignoreBaseTransitions ? inputClassNoTransition : inputClass,
1103
- numberInputResetStyle,
1104
- inputClassName
1105
- ),
1106
- ...inputProps,
1107
- // If decimals are colored, the actual input element is hidden
1108
- // but keep the caret visible via caretColor
1109
- style: {
1110
- ...inputStyle,
1111
- color: shouldColorDecimals ? "transparent" : void 0,
1112
- caretColor: isValidDecimalColor ? themeVars.colors.primaryText : void 0
1113
- },
1114
- "data-auto-focus": inputProps.autoFocus,
1115
- "data-testid": testId ? `rk-${testId.replace(/^rk-/, "")}` : void 0
1116
- };
1117
- const handleTextareaOnChange = (e) => {
1118
- adjustTextareaHeight(textareaRef.current);
1119
- if (onChange) {
1120
- onChange(e);
1121
- }
1122
- };
1123
- const handleTextAreaOnPaste = (e) => {
1124
- adjustTextareaHeight(textareaRef.current);
1125
- if (onPaste) {
1126
- onPaste(e);
1127
- }
1128
- };
1129
- const inputElement = allowMultiline ? /* @__PURE__ */ React5.createElement(
1130
- "textarea",
1131
- {
1132
- ...commonProps,
1133
- ref: (el) => {
1134
- textareaRef.current = el;
1135
- if (typeof ref === "function") {
1136
- ref(el);
1137
- } else if (ref && typeof ref === "object" && "current" in ref) {
1138
- ref.current = el;
1139
- }
1140
- },
1141
- rows: 1,
1142
- style: {
1143
- ...commonProps.style,
1144
- resize: "none",
1145
- boxSizing: "border-box"
1146
- },
1147
- onChange: handleTextareaOnChange,
1148
- onPaste: handleTextAreaOnPaste
1149
- }
1150
- ) : /* @__PURE__ */ React5.createElement(
1151
- "input",
1152
- {
1153
- ...commonProps,
1154
- ref: (el) => {
1155
- if (typeof ref === "function") {
1156
- ref(el);
1157
- } else if (ref && typeof ref === "object" && "current" in ref) {
1158
- ref.current = el;
1159
- }
1160
- },
1161
- type: inputProps?.type || "text"
1162
- }
1163
- );
1164
- if (shouldColorDecimals) {
1165
- return /* @__PURE__ */ React5.createElement(Box, { style: { position: "relative", display: "flex", flex: 1 } }, /* @__PURE__ */ React5.createElement(
1166
- Box,
1167
- {
1168
- color: "primaryText",
1169
- style: {
1170
- position: "absolute",
1171
- left: 0,
1172
- top: 0,
1173
- pointerEvents: "none",
1174
- fontFamily: "inherit",
1175
- fontSize: "inherit",
1176
- fontWeight: "inherit",
1177
- lineHeight: "inherit",
1178
- whiteSpace: "nowrap",
1179
- display: "flex",
1180
- alignItems: "center",
1181
- height: "100%"
1182
- }
1183
- },
1184
- /* @__PURE__ */ React5.createElement("span", { style: { color: "inherit" } }, integerPart),
1185
- /* @__PURE__ */ React5.createElement(DecimalSpan, { decimalsColor }, decimalPart)
1186
- ), inputElement);
1187
- }
1188
- return inputElement;
1189
- };
1190
- return /* @__PURE__ */ React5.createElement(
1191
- Box,
1192
- {
1193
- color: "primaryText",
1194
- display: "flex",
1195
- flexDirection: "column",
1196
- fontSize: "inherit",
1197
- gap: "8",
1198
- width: "full"
1199
- },
1200
- label && /* @__PURE__ */ React5.createElement(Text, { size: "inputLabel", weight: textWeight }, label),
1201
- isLoading ? /* @__PURE__ */ React5.createElement(FunSkeletonBlock, { height: "44" }) : /* @__PURE__ */ React5.createElement(
1202
- Box,
1203
- {
1204
- borderRadius,
1205
- fontFamily,
1206
- minWidth: "full",
1207
- display: "flex",
1208
- alignItems: allowMultiline ? "flex-start" : "center",
1209
- color: adornmentColor,
1210
- borderColor: getBorderColor(),
1211
- borderWidth: overrideBorderWidth ?? "1",
1212
- borderStyle: "solid",
1213
- fontSize: ignoreFontSize ? "inherit" : "inputValue",
1214
- fontWeight: "inputValue",
1215
- className: ignoreBaseTransitions ? baseWrapperStylesNoTransition : baseWrapperStyles,
1216
- background: overrideBackground || {
1217
- base: "inputBackground",
1218
- hover: "inputBackgroundHover"
1219
- }
1220
- },
1221
- prefix && /* @__PURE__ */ React5.createElement(
1222
- Box,
1223
- {
1224
- display: "flex",
1225
- alignItems: "center",
1226
- paddingLeft: "12",
1227
- height: "max"
1228
- },
1229
- prefix
1230
- ),
1231
- prefixIcon === "SearchIcon" && /* @__PURE__ */ React5.createElement(
1232
- Box,
1233
- {
1234
- display: "flex",
1235
- paddingLeft: "12",
1236
- height: "max",
1237
- alignItems: "center",
1238
- color: isFocused ? "primaryText" : "secondaryText"
1239
- },
1240
- /* @__PURE__ */ React5.createElement(SearchIcon, null)
1241
- ),
1242
- prefixIcon === "$" && /* @__PURE__ */ React5.createElement(Box, { display: "flex", alignItems: "center", paddingLeft: "32" }, /* @__PURE__ */ React5.createElement(
1243
- DollarTextIcon,
1244
- {
1245
- fontSize: inputStyle.fontSize || DEFAULT_ICON_FONT_SIZE
1246
- }
1247
- )),
1248
- renderInputOrTextarea(),
1249
- suffix && /* @__PURE__ */ React5.createElement(
1250
- Box,
1251
- {
1252
- paddingLeft: "4",
1253
- paddingRight: "10",
1254
- ...allowMultiline ? {
1255
- style: {
1256
- paddingTop: `calc(${themeVars.spacing.inputPaddingY} - 3px)`
1257
- }
1258
- } : {}
1259
- },
1260
- suffix
1261
- )
1262
- ),
1263
- error && typeof error === "string" && /* @__PURE__ */ React5.createElement(Text, { color: "error", size: "10" }, error)
1264
- );
1265
- });
1266
- var adjustTextareaHeight = (textarea) => {
1267
- if (textarea) {
1268
- textarea.style.height = "auto";
1269
- textarea.style.height = `${textarea.scrollHeight}px`;
1270
- }
1271
- };
1272
- var DollarTextIcon = ({ fontSize }) => /* @__PURE__ */ React5.createElement(
1273
- Text,
1274
- {
1275
- style: {
1276
- paddingBottom: 2,
1277
- fontSize,
1278
- fontWeight: 800
1279
- }
1280
- },
1281
- "$"
1282
- );
1283
- var DecimalSpan = ({
1284
- decimalsColor,
1285
- children
1286
- }) => /* @__PURE__ */ React5.createElement(
1287
- Box,
1288
- {
1289
- color: decimalsColor,
1290
- style: { fontFamily: "inherit", fontSize: "inherit" }
1291
- },
1292
- children
1293
- );
1294
-
1295
- // src/providers/provideFunkitConnectChains.ts
1296
- import { chainMetadataById } from "@funkit/chains";
1297
- var groupChainsById = (chains) => {
1298
- const chainsById = {};
1299
- for (const chainItem of chains) {
1300
- chainsById[chainItem.id] = chainItem;
1301
- }
1302
- return chainsById;
1303
- };
1304
-
1305
- // src/providers/FunkitConnectChainContext.tsx
1306
- import React6, {
1307
- createContext as createContext3,
1308
- useContext as useContext3,
1309
- useMemo
1310
- } from "react";
1311
- var FunkitConnectChainContext = createContext3(
1312
- {
1313
- chains: []
1314
- }
1315
- );
1316
- var useFunkitConnectChains = () => useContext3(FunkitConnectChainContext).chains;
1317
- var useFunkitConnectChainsById = () => groupChainsById(useFunkitConnectChains());
1318
-
1319
- export {
1320
- chainMetadataById,
1321
- useFunkitConnectChainsById,
1322
- TooltipAnchorRefContext,
1323
- FunSkeletonBlock,
1324
- FunInput
1325
- };