@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.
Files changed (107) hide show
  1. package/README.md +2 -2
  2. package/dist/assets/AmountInput.css +1 -1
  3. package/dist/assets/AuthButton.css +1 -1
  4. package/dist/assets/Button.css +1 -1
  5. package/dist/assets/ButtonBase.css +1 -0
  6. package/dist/assets/CoinbaseFooter.css +1 -0
  7. package/dist/assets/ExchangeAmountInput.css +1 -1
  8. package/dist/assets/Fund.css +1 -0
  9. package/dist/assets/FundAmountInput.css +1 -0
  10. package/dist/assets/FundErrorScreen.css +1 -0
  11. package/dist/assets/FundForm.css +1 -0
  12. package/dist/assets/FundModal.css +1 -0
  13. package/dist/assets/FundPaymentMethods.css +1 -0
  14. package/dist/assets/FundPresetAmountInputs.css +1 -0
  15. package/dist/assets/FundTitle.css +1 -0
  16. package/dist/assets/FundTransactionStatus.css +1 -0
  17. package/dist/assets/Input.css +1 -1
  18. package/dist/assets/Modal.css +1 -1
  19. package/dist/assets/Select.css +1 -0
  20. package/dist/assets/ThemeProvider.css +1 -1
  21. package/dist/components/Fund/FundForm.d.ts +18 -0
  22. package/dist/components/Fund/FundForm.js +156 -0
  23. package/dist/components/Fund/FundProvider.d.ts +6 -0
  24. package/dist/components/Fund/FundProvider.js +128 -0
  25. package/dist/components/Fund/FundTitle.d.ts +5 -0
  26. package/dist/components/Fund/FundTitle.js +17 -0
  27. package/dist/components/Fund/components/FundAmountInput.d.ts +5 -0
  28. package/dist/components/Fund/components/FundAmountInput.js +58 -0
  29. package/dist/components/Fund/components/FundErrorScreen.d.ts +6 -0
  30. package/dist/components/Fund/components/FundErrorScreen.js +118 -0
  31. package/dist/components/Fund/components/FundPaymentMethods.d.ts +6 -0
  32. package/dist/components/Fund/components/FundPaymentMethods.js +55 -0
  33. package/dist/components/Fund/components/FundPresetAmountInputs.d.ts +6 -0
  34. package/dist/components/Fund/components/FundPresetAmountInputs.js +41 -0
  35. package/dist/components/Fund/components/FundTransactionStatus.d.ts +8 -0
  36. package/dist/components/Fund/components/FundTransactionStatus.js +106 -0
  37. package/dist/components/Fund/hooks/useBuyUrl.d.ts +14 -0
  38. package/dist/components/Fund/hooks/useBuyUrl.js +65 -0
  39. package/dist/components/Fund/hooks/useEmitLifecycleStatus.d.ts +5 -0
  40. package/dist/components/Fund/hooks/useEmitLifecycleStatus.js +14 -0
  41. package/dist/components/Fund/hooks/useExchangeRate.d.ts +11 -0
  42. package/dist/components/Fund/hooks/useExchangeRate.js +62 -0
  43. package/dist/components/Fund/hooks/usePaymentMethods.d.ts +11 -0
  44. package/dist/components/Fund/hooks/usePaymentMethods.js +112 -0
  45. package/dist/components/Fund/hooks/usePopupMonitor.d.ts +3 -0
  46. package/dist/components/Fund/hooks/usePopupMonitor.js +17 -0
  47. package/dist/components/Fund/hooks/useSetupOnrampEventListeners.d.ts +1 -0
  48. package/dist/components/Fund/hooks/useSetupOnrampEventListeners.js +56 -0
  49. package/dist/components/Fund/index.d.ts +10 -0
  50. package/dist/components/Fund/index.js +30 -0
  51. package/dist/components/Fund/types.d.ts +218 -0
  52. package/dist/components/Fund/types.js +1 -0
  53. package/dist/components/Fund/useFundReducer.d.ts +9 -0
  54. package/dist/components/Fund/useFundReducer.js +104 -0
  55. package/dist/components/Fund/utils/buildPaymentMethods.d.ts +5 -0
  56. package/dist/components/Fund/utils/buildPaymentMethods.js +57 -0
  57. package/dist/components/Fund/utils/setupOnrampEventListeners.d.ts +9 -0
  58. package/dist/components/Fund/utils/setupOnrampEventListeners.js +19 -0
  59. package/dist/components/Fund/utils/subscribeToWindowMessage.d.ts +14 -0
  60. package/dist/components/Fund/utils/subscribeToWindowMessage.js +24 -0
  61. package/dist/components/FundModal/index.d.ts +9 -0
  62. package/dist/components/FundModal/index.js +92 -0
  63. package/dist/components/SignIn/SignInFooter.d.ts +1 -1
  64. package/dist/components/SignIn/SignInFooter.js +4 -15
  65. package/dist/components/forms/ExchangeAmountInput/index.js +93 -65
  66. package/dist/components/forms/ExchangeAmountInput/types.d.ts +2 -1
  67. package/dist/components/forms/ExchangeAmountInput/useExchangeAmountInput.js +42 -38
  68. package/dist/components/forms/Input/index.d.ts +6 -2
  69. package/dist/components/forms/Input/index.js +27 -12
  70. package/dist/components/forms/PhoneNumberInput/index.d.ts +2 -2
  71. package/dist/components/forms/Select/index.d.ts +21 -0
  72. package/dist/components/forms/Select/index.js +74 -0
  73. package/dist/components/ui/Button/index.d.ts +4 -5
  74. package/dist/components/ui/Button/index.js +35 -56
  75. package/dist/components/ui/ButtonBase/index.d.ts +8 -0
  76. package/dist/components/ui/ButtonBase/index.js +45 -0
  77. package/dist/components/ui/CoinbaseFooter/index.d.ts +2 -0
  78. package/dist/components/ui/CoinbaseFooter/index.js +19 -0
  79. package/dist/components/ui/LoadingSkeleton/index.d.ts +3 -2
  80. package/dist/components/ui/LoadingSkeleton/index.js +9 -15
  81. package/dist/components/ui/LoadingSpinner/index.d.ts +9 -2
  82. package/dist/components/ui/LoadingSpinner/index.js +39 -17
  83. package/dist/icons/IconAppleLogo.d.ts +2 -0
  84. package/dist/icons/IconAppleLogo.js +10 -0
  85. package/dist/icons/IconCheck.d.ts +2 -0
  86. package/dist/icons/IconCheck.js +14 -0
  87. package/dist/icons/IconChevronDown.d.ts +2 -0
  88. package/dist/icons/IconChevronDown.js +14 -0
  89. package/dist/icons/IconCoinbaseMark.d.ts +2 -0
  90. package/dist/icons/IconCoinbaseMark.js +13 -0
  91. package/dist/icons/IconCreditCard.d.ts +2 -0
  92. package/dist/icons/IconCreditCard.js +10 -0
  93. package/dist/icons/IconExclamationTriangle.d.ts +2 -0
  94. package/dist/icons/IconExclamationTriangle.js +14 -0
  95. package/dist/icons/index.d.ts +3 -0
  96. package/dist/icons/index.js +20 -14
  97. package/dist/index.d.ts +2 -0
  98. package/dist/index.js +86 -69
  99. package/dist/theme/theme.d.ts +120 -2
  100. package/dist/theme/tokens.d.ts +346 -0
  101. package/dist/theme/tokens.js +76 -8
  102. package/dist/utils/formatFiat.d.ts +1 -0
  103. package/dist/utils/formatFiat.js +13 -0
  104. package/dist/utils/openPopup.d.ts +7 -0
  105. package/dist/utils/openPopup.js +15 -0
  106. package/package.json +7 -6
  107. 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 { SendTransactionButton as x } from "./components/SendTransactionButton/index.js";
4
- import { SignIn as s } from "./components/SignIn/index.js";
5
- import { useSignInReducer as a } from "./components/SignIn/useSignInReducer.js";
6
- import { SignOutButton as l } from "./components/SignOutButton/index.js";
7
- import { SignInModal as u } from "./components/SignInModal/index.js";
8
- import { ThemeProvider as h, useTheme as C } from "./components/ThemeProvider/index.js";
9
- import { cssVariables as d } from "./theme/cssVariables.js";
10
- import { theme as A } from "./theme/theme.js";
11
- import { colors as E, colorsBase as M, colorsComponents as P, colorsSemantic as b, font as v, tokens as w } from "./theme/tokens.js";
12
- import { flattenTokensObject as F, themeToCssVariables as O } from "./theme/utils.js";
13
- import { IconArrowLeft as V } from "./icons/IconArrowLeft.js";
14
- import { IconArrowsUpDown as L } from "./icons/IconArrowsUpDown.js";
15
- import { IconCheckCircle as j } from "./icons/IconCheckCircle.js";
16
- import { IconEnvelope as X } from "./icons/IconEnvelope.js";
17
- import { IconExclamationCircle as q } from "./icons/IconExclamationCircle.js";
18
- import { IconLock as z } from "./icons/IconLock.js";
19
- import { IconPhone as J } from "./icons/IconPhone.js";
20
- import { IconXMark as Q } from "./icons/IconXMark.js";
21
- import { clamp as Y } from "./utils/clamp.js";
22
- import { getMessageFromUnknownError as $ } from "./utils/getMessageFromUnknownError.js";
23
- import { isApiError as ro } from "./utils/isApiError.js";
24
- import { isEmailInvalid as to } from "./utils/isEmailInvalid.js";
25
- import { parseValuesFromPhoneNumber as mo } from "./utils/parseValuesFromPhoneNumber.js";
26
- import { SignInAuthMethodButtons as fo } from "./components/SignIn/SignInAuthMethodButtons.js";
27
- import { SignInBackButton as io } from "./components/SignIn/SignInBackButton.js";
28
- import { SignInDescription as co } from "./components/SignIn/SignInDescription.js";
29
- import { SignInFooter as Io } from "./components/SignIn/SignInFooter.js";
30
- import { SignInForm as go } from "./components/SignIn/SignInForm.js";
31
- import { SignInImage as So } from "./components/SignIn/SignInImage.js";
32
- import { SignInTitle as Co } from "./components/SignIn/SignInTitle.js";
33
- import { useSignInContext as ko } from "./components/SignIn/SignInProvider.js";
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
- V as IconArrowLeft,
39
- L as IconArrowsUpDown,
40
- j as IconCheckCircle,
41
- X as IconEnvelope,
42
- q as IconExclamationCircle,
43
- z as IconLock,
44
- J as IconPhone,
45
- Q as IconXMark,
46
- x as SendTransactionButton,
47
- s as SignIn,
48
- fo as SignInAuthMethodButtons,
49
- io as SignInBackButton,
50
- co as SignInDescription,
51
- Io as SignInFooter,
52
- go as SignInForm,
53
- So as SignInImage,
54
- u as SignInModal,
55
- Co as SignInTitle,
56
- l as SignOutButton,
57
- h as ThemeProvider,
58
- Y as clamp,
59
- E as colors,
60
- M as colorsBase,
61
- P as colorsComponents,
62
- b as colorsSemantic,
63
- d as cssVariables,
64
- F as flattenTokensObject,
65
- v as font,
66
- $ as getMessageFromUnknownError,
67
- ro as isApiError,
68
- to as isEmailInvalid,
69
- mo as parseValuesFromPhoneNumber,
70
- A as theme,
71
- O as themeToCssVariables,
72
- w as tokens,
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
- ko as useSignInContext,
75
- a as useSignInReducer,
76
- C as useTheme
91
+ Ro as useSignInContext,
92
+ g as useSignInReducer,
93
+ k as useTheme
77
94
  };
@@ -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 ButtonSize = "lg" | "md" | "sm";
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;