@coinbase/cdp-react 0.0.23 → 0.0.25
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.
- package/README.md +2 -2
- package/dist/assets/AmountInput.css +1 -1
- package/dist/assets/AuthButton.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/ButtonBase.css +1 -0
- package/dist/assets/CoinbaseFooter.css +1 -0
- package/dist/assets/ExchangeAmountInput.css +1 -1
- package/dist/assets/Fund.css +1 -0
- package/dist/assets/FundAmountInput.css +1 -0
- package/dist/assets/FundErrorScreen.css +1 -0
- package/dist/assets/FundForm.css +1 -0
- package/dist/assets/FundModal.css +1 -0
- package/dist/assets/FundPaymentMethods.css +1 -0
- package/dist/assets/FundPresetAmountInputs.css +1 -0
- package/dist/assets/FundTitle.css +1 -0
- package/dist/assets/FundTransactionStatus.css +1 -0
- package/dist/assets/Input.css +1 -1
- package/dist/assets/Modal.css +1 -1
- package/dist/assets/Select.css +1 -0
- package/dist/assets/ThemeProvider.css +1 -1
- package/dist/components/Fund/FundForm.d.ts +18 -0
- package/dist/components/Fund/FundForm.js +156 -0
- package/dist/components/Fund/FundProvider.d.ts +6 -0
- package/dist/components/Fund/FundProvider.js +128 -0
- package/dist/components/Fund/FundTitle.d.ts +5 -0
- package/dist/components/Fund/FundTitle.js +17 -0
- package/dist/components/Fund/components/FundAmountInput.d.ts +5 -0
- package/dist/components/Fund/components/FundAmountInput.js +58 -0
- package/dist/components/Fund/components/FundErrorScreen.d.ts +6 -0
- package/dist/components/Fund/components/FundErrorScreen.js +118 -0
- package/dist/components/Fund/components/FundPaymentMethods.d.ts +6 -0
- package/dist/components/Fund/components/FundPaymentMethods.js +55 -0
- package/dist/components/Fund/components/FundPresetAmountInputs.d.ts +6 -0
- package/dist/components/Fund/components/FundPresetAmountInputs.js +41 -0
- package/dist/components/Fund/components/FundTransactionStatus.d.ts +8 -0
- package/dist/components/Fund/components/FundTransactionStatus.js +106 -0
- package/dist/components/Fund/hooks/useBuyUrl.d.ts +14 -0
- package/dist/components/Fund/hooks/useBuyUrl.js +65 -0
- package/dist/components/Fund/hooks/useEmitLifecycleStatus.d.ts +5 -0
- package/dist/components/Fund/hooks/useEmitLifecycleStatus.js +14 -0
- package/dist/components/Fund/hooks/useExchangeRate.d.ts +11 -0
- package/dist/components/Fund/hooks/useExchangeRate.js +62 -0
- package/dist/components/Fund/hooks/usePaymentMethods.d.ts +11 -0
- package/dist/components/Fund/hooks/usePaymentMethods.js +112 -0
- package/dist/components/Fund/hooks/usePopupMonitor.d.ts +3 -0
- package/dist/components/Fund/hooks/usePopupMonitor.js +17 -0
- package/dist/components/Fund/hooks/useSetupOnrampEventListeners.d.ts +1 -0
- package/dist/components/Fund/hooks/useSetupOnrampEventListeners.js +56 -0
- package/dist/components/Fund/index.d.ts +10 -0
- package/dist/components/Fund/index.js +30 -0
- package/dist/components/Fund/types.d.ts +218 -0
- package/dist/components/Fund/types.js +1 -0
- package/dist/components/Fund/useFundReducer.d.ts +9 -0
- package/dist/components/Fund/useFundReducer.js +104 -0
- package/dist/components/Fund/utils/buildPaymentMethods.d.ts +5 -0
- package/dist/components/Fund/utils/buildPaymentMethods.js +57 -0
- package/dist/components/Fund/utils/setupOnrampEventListeners.d.ts +9 -0
- package/dist/components/Fund/utils/setupOnrampEventListeners.js +19 -0
- package/dist/components/Fund/utils/subscribeToWindowMessage.d.ts +14 -0
- package/dist/components/Fund/utils/subscribeToWindowMessage.js +24 -0
- package/dist/components/FundModal/index.d.ts +9 -0
- package/dist/components/FundModal/index.js +92 -0
- package/dist/components/SignIn/SignInFooter.d.ts +1 -1
- package/dist/components/SignIn/SignInFooter.js +4 -15
- package/dist/components/forms/ExchangeAmountInput/index.js +93 -65
- package/dist/components/forms/ExchangeAmountInput/types.d.ts +2 -1
- package/dist/components/forms/ExchangeAmountInput/useExchangeAmountInput.js +42 -38
- package/dist/components/forms/Input/index.d.ts +6 -2
- package/dist/components/forms/Input/index.js +27 -12
- package/dist/components/forms/PhoneNumberInput/index.d.ts +2 -2
- package/dist/components/forms/Select/index.d.ts +21 -0
- package/dist/components/forms/Select/index.js +74 -0
- package/dist/components/ui/Button/index.d.ts +4 -5
- package/dist/components/ui/Button/index.js +35 -56
- package/dist/components/ui/ButtonBase/index.d.ts +8 -0
- package/dist/components/ui/ButtonBase/index.js +45 -0
- package/dist/components/ui/CoinbaseFooter/index.d.ts +2 -0
- package/dist/components/ui/CoinbaseFooter/index.js +19 -0
- package/dist/components/ui/LoadingSkeleton/index.d.ts +3 -2
- package/dist/components/ui/LoadingSkeleton/index.js +9 -15
- package/dist/components/ui/LoadingSpinner/index.d.ts +9 -2
- package/dist/components/ui/LoadingSpinner/index.js +39 -17
- package/dist/icons/IconAppleLogo.d.ts +2 -0
- package/dist/icons/IconAppleLogo.js +10 -0
- package/dist/icons/IconCheck.d.ts +2 -0
- package/dist/icons/IconCheck.js +14 -0
- package/dist/icons/IconChevronDown.d.ts +2 -0
- package/dist/icons/IconChevronDown.js +14 -0
- package/dist/icons/IconCoinbaseMark.d.ts +2 -0
- package/dist/icons/IconCoinbaseMark.js +13 -0
- package/dist/icons/IconCreditCard.d.ts +2 -0
- package/dist/icons/IconCreditCard.js +10 -0
- package/dist/icons/IconExclamationTriangle.d.ts +2 -0
- package/dist/icons/IconExclamationTriangle.js +14 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.js +20 -14
- package/dist/index.d.ts +2 -0
- package/dist/index.js +86 -69
- package/dist/theme/theme.d.ts +120 -2
- package/dist/theme/tokens.d.ts +346 -0
- package/dist/theme/tokens.js +76 -8
- package/dist/utils/formatFiat.d.ts +1 -0
- package/dist/utils/formatFiat.js +13 -0
- package/dist/utils/openPopup.d.ts +7 -0
- package/dist/utils/openPopup.js +15 -0
- package/package.json +7 -6
- package/dist/assets/SignInFooter.css +0 -1
package/dist/index.js
CHANGED
|
@@ -1,77 +1,94 @@
|
|
|
1
1
|
import { AUTH_METHODS as e, CDPReactProvider as t, useAppConfig as n } from "./components/CDPReactProvider/index.js";
|
|
2
2
|
import { AuthButton as p } from "./components/AuthButton/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
3
|
+
import { unstable_Fund as f, unstable_FundFooter as s } from "./components/Fund/index.js";
|
|
4
|
+
import { unstable_FundModal as i } from "./components/FundModal/index.js";
|
|
5
|
+
import { SendTransactionButton as c } from "./components/SendTransactionButton/index.js";
|
|
6
|
+
import { SignIn as I } from "./components/SignIn/index.js";
|
|
7
|
+
import { useSignInReducer as g } from "./components/SignIn/useSignInReducer.js";
|
|
8
|
+
import { SignOutButton as S } from "./components/SignOutButton/index.js";
|
|
9
|
+
import { SignInModal as C } from "./components/SignInModal/index.js";
|
|
10
|
+
import { ThemeProvider as b, useTheme as k } from "./components/ThemeProvider/index.js";
|
|
11
|
+
import { cssVariables as B } from "./theme/cssVariables.js";
|
|
12
|
+
import { theme as _ } from "./theme/theme.js";
|
|
13
|
+
import { colors as v, colorsBase as w, colorsComponents as D, colorsSemantic as P, font as O, tokens as U } from "./theme/tokens.js";
|
|
14
|
+
import { flattenTokensObject as H, themeToCssVariables as L } from "./theme/utils.js";
|
|
15
|
+
import { IconArrowLeft as j } from "./icons/IconArrowLeft.js";
|
|
16
|
+
import { IconArrowsUpDown as X } from "./icons/IconArrowsUpDown.js";
|
|
17
|
+
import { IconCheck as y } from "./icons/IconCheck.js";
|
|
18
|
+
import { IconCheckCircle as G } from "./icons/IconCheckCircle.js";
|
|
19
|
+
import { IconChevronDown as K } from "./icons/IconChevronDown.js";
|
|
20
|
+
import { IconEnvelope as W } from "./icons/IconEnvelope.js";
|
|
21
|
+
import { IconExclamationCircle as Z } from "./icons/IconExclamationCircle.js";
|
|
22
|
+
import { IconExclamationTriangle as oo } from "./icons/IconExclamationTriangle.js";
|
|
23
|
+
import { IconLock as eo } from "./icons/IconLock.js";
|
|
24
|
+
import { IconPhone as no } from "./icons/IconPhone.js";
|
|
25
|
+
import { IconXMark as po } from "./icons/IconXMark.js";
|
|
26
|
+
import { clamp as fo } from "./utils/clamp.js";
|
|
27
|
+
import { getMessageFromUnknownError as ao } from "./utils/getMessageFromUnknownError.js";
|
|
28
|
+
import { isApiError as uo } from "./utils/isApiError.js";
|
|
29
|
+
import { isEmailInvalid as lo } from "./utils/isEmailInvalid.js";
|
|
30
|
+
import { parseValuesFromPhoneNumber as go } from "./utils/parseValuesFromPhoneNumber.js";
|
|
31
|
+
import { FundForm as So } from "./components/Fund/FundForm.js";
|
|
32
|
+
import { FundTitle as Co } from "./components/Fund/FundTitle.js";
|
|
33
|
+
import { useFundContext as bo } from "./components/Fund/FundProvider.js";
|
|
34
|
+
import { SignInAuthMethodButtons as Ao } from "./components/SignIn/SignInAuthMethodButtons.js";
|
|
35
|
+
import { SignInBackButton as Eo } from "./components/SignIn/SignInBackButton.js";
|
|
36
|
+
import { SignInDescription as Mo } from "./components/SignIn/SignInDescription.js";
|
|
37
|
+
import { SignInFooter as wo } from "./components/SignIn/SignInFooter.js";
|
|
38
|
+
import { SignInForm as Po } from "./components/SignIn/SignInForm.js";
|
|
39
|
+
import { SignInImage as Uo } from "./components/SignIn/SignInImage.js";
|
|
40
|
+
import { SignInTitle as Ho } from "./components/SignIn/SignInTitle.js";
|
|
41
|
+
import { useSignInContext as Ro } from "./components/SignIn/SignInProvider.js";
|
|
34
42
|
export {
|
|
35
43
|
e as AUTH_METHODS,
|
|
36
44
|
p as AuthButton,
|
|
37
45
|
t as CDPReactProvider,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
46
|
+
j as IconArrowLeft,
|
|
47
|
+
X as IconArrowsUpDown,
|
|
48
|
+
y as IconCheck,
|
|
49
|
+
G as IconCheckCircle,
|
|
50
|
+
K as IconChevronDown,
|
|
51
|
+
W as IconEnvelope,
|
|
52
|
+
Z as IconExclamationCircle,
|
|
53
|
+
oo as IconExclamationTriangle,
|
|
54
|
+
eo as IconLock,
|
|
55
|
+
no as IconPhone,
|
|
56
|
+
po as IconXMark,
|
|
57
|
+
c as SendTransactionButton,
|
|
58
|
+
I as SignIn,
|
|
59
|
+
Ao as SignInAuthMethodButtons,
|
|
60
|
+
Eo as SignInBackButton,
|
|
61
|
+
Mo as SignInDescription,
|
|
62
|
+
wo as SignInFooter,
|
|
63
|
+
Po as SignInForm,
|
|
64
|
+
Uo as SignInImage,
|
|
65
|
+
C as SignInModal,
|
|
66
|
+
Ho as SignInTitle,
|
|
67
|
+
S as SignOutButton,
|
|
68
|
+
b as ThemeProvider,
|
|
69
|
+
fo as clamp,
|
|
70
|
+
v as colors,
|
|
71
|
+
w as colorsBase,
|
|
72
|
+
D as colorsComponents,
|
|
73
|
+
P as colorsSemantic,
|
|
74
|
+
B as cssVariables,
|
|
75
|
+
H as flattenTokensObject,
|
|
76
|
+
O as font,
|
|
77
|
+
ao as getMessageFromUnknownError,
|
|
78
|
+
uo as isApiError,
|
|
79
|
+
lo as isEmailInvalid,
|
|
80
|
+
go as parseValuesFromPhoneNumber,
|
|
81
|
+
_ as theme,
|
|
82
|
+
L as themeToCssVariables,
|
|
83
|
+
U as tokens,
|
|
84
|
+
f as unstable_Fund,
|
|
85
|
+
s as unstable_FundFooter,
|
|
86
|
+
So as unstable_FundForm,
|
|
87
|
+
i as unstable_FundModal,
|
|
88
|
+
Co as unstable_FundTitle,
|
|
89
|
+
bo as unstable_useFundContext,
|
|
73
90
|
n as useAppConfig,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
91
|
+
Ro as useSignInContext,
|
|
92
|
+
g as useSignInReducer,
|
|
93
|
+
k as useTheme
|
|
77
94
|
};
|
package/dist/theme/theme.d.ts
CHANGED
|
@@ -154,6 +154,116 @@ export declare const theme: Flattened<{
|
|
|
154
154
|
};
|
|
155
155
|
};
|
|
156
156
|
};
|
|
157
|
+
readonly select: {
|
|
158
|
+
readonly label: {
|
|
159
|
+
readonly default: {
|
|
160
|
+
readonly value: "{colors.fg.default}";
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
readonly trigger: {
|
|
164
|
+
readonly bg: {
|
|
165
|
+
readonly default: {
|
|
166
|
+
readonly value: "{colors.bg.default}";
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
readonly border: {
|
|
170
|
+
readonly default: {
|
|
171
|
+
readonly value: "{colors.line.heavy}";
|
|
172
|
+
};
|
|
173
|
+
readonly focus: {
|
|
174
|
+
readonly value: "{colors.line.primary}";
|
|
175
|
+
};
|
|
176
|
+
readonly error: {
|
|
177
|
+
readonly value: "{colors.line.negative}";
|
|
178
|
+
};
|
|
179
|
+
readonly success: {
|
|
180
|
+
readonly value: "{colors.line.positive}";
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
readonly placeholder: {
|
|
184
|
+
readonly default: {
|
|
185
|
+
readonly value: "{colors.fg.muted}";
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
readonly text: {
|
|
189
|
+
readonly default: {
|
|
190
|
+
readonly value: "{colors.fg.default}";
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
readonly errorText: {
|
|
194
|
+
readonly default: {
|
|
195
|
+
readonly value: "{colors.fg.negative}";
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
readonly successText: {
|
|
199
|
+
readonly default: {
|
|
200
|
+
readonly value: "{colors.fg.positive}";
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
readonly list: {
|
|
205
|
+
readonly bg: {
|
|
206
|
+
readonly default: {
|
|
207
|
+
readonly value: "{colors.bg.default}";
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
readonly border: {
|
|
211
|
+
readonly default: {
|
|
212
|
+
readonly value: "{colors.line.heavy}";
|
|
213
|
+
};
|
|
214
|
+
readonly focus: {
|
|
215
|
+
readonly value: "{colors.line.primary}";
|
|
216
|
+
};
|
|
217
|
+
readonly error: {
|
|
218
|
+
readonly value: "{colors.line.negative}";
|
|
219
|
+
};
|
|
220
|
+
readonly success: {
|
|
221
|
+
readonly value: "{colors.line.positive}";
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
readonly item: {
|
|
225
|
+
readonly bg: {
|
|
226
|
+
readonly default: {
|
|
227
|
+
readonly value: "{colors.bg.default}";
|
|
228
|
+
};
|
|
229
|
+
readonly highlight: {
|
|
230
|
+
readonly value: "{colors.bg.secondary}";
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
readonly text: {
|
|
234
|
+
readonly default: {
|
|
235
|
+
readonly value: "{colors.fg.default}";
|
|
236
|
+
};
|
|
237
|
+
readonly muted: {
|
|
238
|
+
readonly value: "{colors.fg.muted}";
|
|
239
|
+
};
|
|
240
|
+
readonly onHighlight: {
|
|
241
|
+
readonly value: "{colors.fg.default}";
|
|
242
|
+
};
|
|
243
|
+
readonly mutedOnHighlight: {
|
|
244
|
+
readonly value: "{colors.fg.muted}";
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
readonly code: {
|
|
251
|
+
readonly bg: {
|
|
252
|
+
readonly default: {
|
|
253
|
+
readonly value: "{colors.bg.alternate}";
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
readonly border: {
|
|
257
|
+
readonly default: {
|
|
258
|
+
readonly value: "{colors.line.heavy}";
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
readonly text: {
|
|
262
|
+
readonly default: {
|
|
263
|
+
readonly value: "{colors.fg.default}";
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
};
|
|
157
267
|
readonly bg: {
|
|
158
268
|
readonly default: {
|
|
159
269
|
readonly value: "#ffffff";
|
|
@@ -204,6 +314,9 @@ export declare const theme: Flattened<{
|
|
|
204
314
|
readonly negative: {
|
|
205
315
|
readonly value: "#cf202f";
|
|
206
316
|
};
|
|
317
|
+
readonly warning: {
|
|
318
|
+
readonly value: "#ed702f";
|
|
319
|
+
};
|
|
207
320
|
};
|
|
208
321
|
readonly line: {
|
|
209
322
|
readonly default: {
|
|
@@ -225,6 +338,9 @@ export declare const theme: Flattened<{
|
|
|
225
338
|
};
|
|
226
339
|
font: {
|
|
227
340
|
readonly family: {
|
|
341
|
+
readonly mono: {
|
|
342
|
+
readonly value: "\"DM Mono\", monospace";
|
|
343
|
+
};
|
|
228
344
|
readonly sans: {
|
|
229
345
|
readonly value: "\"DM Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
|
|
230
346
|
};
|
|
@@ -247,5 +363,7 @@ export type FontTokens = Flattened<{
|
|
|
247
363
|
}>;
|
|
248
364
|
export type ColorTokens = SemanticColors | ComponentColors;
|
|
249
365
|
export type Theme = ColorTokens & FontTokens;
|
|
250
|
-
export type ButtonVariant = "primary" | "secondary" | "linkPrimary" | "linkSecondary" | "transparentPrimary" | "transparentSecondary";
|
|
251
|
-
export type
|
|
366
|
+
export type ButtonVariant = "primary" | "secondary" | "linkPrimary" | "linkSecondary" | "transparentPrimary" | "transparentSecondary" | "control";
|
|
367
|
+
export type Size = "lg" | "md" | "sm" | "xs";
|
|
368
|
+
export type ButtonSize = Size | "none";
|
|
369
|
+
export type InputSize = Size;
|