@coinbase/cdp-react 0.0.24 → 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 (88) 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/ExchangeAmountInput.css +1 -1
  5. package/dist/assets/Fund.css +1 -0
  6. package/dist/assets/FundAmountInput.css +1 -0
  7. package/dist/assets/FundErrorScreen.css +1 -0
  8. package/dist/assets/FundForm.css +1 -0
  9. package/dist/assets/FundModal.css +1 -0
  10. package/dist/assets/FundPaymentMethods.css +1 -0
  11. package/dist/assets/FundPresetAmountInputs.css +1 -0
  12. package/dist/assets/FundTitle.css +1 -0
  13. package/dist/assets/FundTransactionStatus.css +1 -0
  14. package/dist/assets/Input.css +1 -1
  15. package/dist/assets/Modal.css +1 -1
  16. package/dist/assets/ThemeProvider.css +1 -1
  17. package/dist/components/Fund/FundForm.d.ts +18 -0
  18. package/dist/components/Fund/FundForm.js +156 -0
  19. package/dist/components/Fund/FundProvider.d.ts +6 -0
  20. package/dist/components/Fund/FundProvider.js +128 -0
  21. package/dist/components/Fund/FundTitle.d.ts +5 -0
  22. package/dist/components/Fund/FundTitle.js +17 -0
  23. package/dist/components/Fund/components/FundAmountInput.d.ts +5 -0
  24. package/dist/components/Fund/components/FundAmountInput.js +58 -0
  25. package/dist/components/Fund/components/FundErrorScreen.d.ts +6 -0
  26. package/dist/components/Fund/components/FundErrorScreen.js +118 -0
  27. package/dist/components/Fund/components/FundPaymentMethods.d.ts +6 -0
  28. package/dist/components/Fund/components/FundPaymentMethods.js +55 -0
  29. package/dist/components/Fund/components/FundPresetAmountInputs.d.ts +6 -0
  30. package/dist/components/Fund/components/FundPresetAmountInputs.js +41 -0
  31. package/dist/components/Fund/components/FundTransactionStatus.d.ts +8 -0
  32. package/dist/components/Fund/components/FundTransactionStatus.js +106 -0
  33. package/dist/components/Fund/hooks/useBuyUrl.d.ts +14 -0
  34. package/dist/components/Fund/hooks/useBuyUrl.js +65 -0
  35. package/dist/components/Fund/hooks/useEmitLifecycleStatus.d.ts +5 -0
  36. package/dist/components/Fund/hooks/useEmitLifecycleStatus.js +14 -0
  37. package/dist/components/Fund/hooks/useExchangeRate.d.ts +11 -0
  38. package/dist/components/Fund/hooks/useExchangeRate.js +62 -0
  39. package/dist/components/Fund/hooks/usePaymentMethods.d.ts +11 -0
  40. package/dist/components/Fund/hooks/usePaymentMethods.js +112 -0
  41. package/dist/components/Fund/hooks/usePopupMonitor.d.ts +3 -0
  42. package/dist/components/Fund/hooks/usePopupMonitor.js +17 -0
  43. package/dist/components/Fund/hooks/useSetupOnrampEventListeners.d.ts +1 -0
  44. package/dist/components/Fund/hooks/useSetupOnrampEventListeners.js +56 -0
  45. package/dist/components/Fund/index.d.ts +10 -0
  46. package/dist/components/Fund/index.js +30 -0
  47. package/dist/components/Fund/types.d.ts +218 -0
  48. package/dist/components/Fund/types.js +1 -0
  49. package/dist/components/Fund/useFundReducer.d.ts +9 -0
  50. package/dist/components/Fund/useFundReducer.js +104 -0
  51. package/dist/components/Fund/utils/buildPaymentMethods.d.ts +5 -0
  52. package/dist/components/Fund/utils/buildPaymentMethods.js +57 -0
  53. package/dist/components/Fund/utils/setupOnrampEventListeners.d.ts +9 -0
  54. package/dist/components/Fund/utils/setupOnrampEventListeners.js +19 -0
  55. package/dist/components/Fund/utils/subscribeToWindowMessage.d.ts +14 -0
  56. package/dist/components/Fund/utils/subscribeToWindowMessage.js +24 -0
  57. package/dist/components/FundModal/index.d.ts +9 -0
  58. package/dist/components/FundModal/index.js +92 -0
  59. package/dist/components/forms/ExchangeAmountInput/index.js +93 -65
  60. package/dist/components/forms/ExchangeAmountInput/types.d.ts +2 -1
  61. package/dist/components/forms/ExchangeAmountInput/useExchangeAmountInput.js +42 -38
  62. package/dist/components/forms/Input/index.d.ts +6 -2
  63. package/dist/components/forms/Input/index.js +27 -12
  64. package/dist/components/forms/PhoneNumberInput/index.d.ts +2 -2
  65. package/dist/components/ui/Button/index.js +7 -7
  66. package/dist/components/ui/ButtonBase/index.js +19 -19
  67. package/dist/components/ui/LoadingSpinner/index.d.ts +9 -2
  68. package/dist/components/ui/LoadingSpinner/index.js +39 -17
  69. package/dist/icons/IconAppleLogo.d.ts +2 -0
  70. package/dist/icons/IconAppleLogo.js +10 -0
  71. package/dist/icons/IconCoinbaseMark.d.ts +2 -0
  72. package/dist/icons/IconCoinbaseMark.js +13 -0
  73. package/dist/icons/IconCreditCard.d.ts +2 -0
  74. package/dist/icons/IconCreditCard.js +10 -0
  75. package/dist/icons/IconExclamationTriangle.d.ts +2 -0
  76. package/dist/icons/IconExclamationTriangle.js +14 -0
  77. package/dist/icons/index.d.ts +1 -0
  78. package/dist/icons/index.js +18 -16
  79. package/dist/index.d.ts +2 -0
  80. package/dist/index.js +86 -73
  81. package/dist/theme/theme.d.ts +23 -0
  82. package/dist/theme/tokens.d.ts +67 -0
  83. package/dist/theme/tokens.js +19 -2
  84. package/dist/utils/formatFiat.d.ts +1 -0
  85. package/dist/utils/formatFiat.js +13 -0
  86. package/dist/utils/openPopup.d.ts +7 -0
  87. package/dist/utils/openPopup.js +15 -0
  88. package/package.json +6 -6
@@ -0,0 +1,14 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import "react";
3
+ import { SvgIcon as l } from "./SvgIcon.js";
4
+ const n = (e) => /* @__PURE__ */ o(l, { viewBox: "0 0 16 16", width: "16", height: "16", fill: "currentColor", ...e, children: /* @__PURE__ */ o(
5
+ "path",
6
+ {
7
+ fillRule: "evenodd",
8
+ d: "M6.701 2.25c.577-1 2.02-1 2.598 0l5.196 9a1.5 1.5 0 0 1-1.299 2.25H2.804a1.5 1.5 0 0 1-1.3-2.25l5.197-9ZM8 4a.75.75 0 0 1 .75.75v3a.75.75 0 1 1-1.5 0v-3A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
9
+ clipRule: "evenodd"
10
+ }
11
+ ) });
12
+ export {
13
+ n as IconExclamationTriangle
14
+ };
@@ -5,6 +5,7 @@ export * from './IconCheckCircle';
5
5
  export * from './IconChevronDown';
6
6
  export * from './IconEnvelope';
7
7
  export * from './IconExclamationCircle';
8
+ export * from './IconExclamationTriangle';
8
9
  export * from './IconLock';
9
10
  export * from './IconPhone';
10
11
  export * from './IconXMark';
@@ -1,22 +1,24 @@
1
1
  import { IconArrowLeft as e } from "./IconArrowLeft.js";
2
- import { IconArrowsUpDown as n } from "./IconArrowsUpDown.js";
3
- import { IconCheck as t } from "./IconCheck.js";
4
- import { IconCheckCircle as m } from "./IconCheckCircle.js";
2
+ import { IconArrowsUpDown as c } from "./IconArrowsUpDown.js";
3
+ import { IconCheck as m } from "./IconCheck.js";
4
+ import { IconCheckCircle as x } from "./IconCheckCircle.js";
5
5
  import { IconChevronDown as I } from "./IconChevronDown.js";
6
- import { IconEnvelope as h } from "./IconEnvelope.js";
7
- import { IconExclamationCircle as l } from "./IconExclamationCircle.js";
8
- import { IconLock as a } from "./IconLock.js";
9
- import { IconPhone as v } from "./IconPhone.js";
10
- import { IconXMark as D } from "./IconXMark.js";
6
+ import { IconEnvelope as l } from "./IconEnvelope.js";
7
+ import { IconExclamationCircle as C } from "./IconExclamationCircle.js";
8
+ import { IconExclamationTriangle as k } from "./IconExclamationTriangle.js";
9
+ import { IconLock as E } from "./IconLock.js";
10
+ import { IconPhone as A } from "./IconPhone.js";
11
+ import { IconXMark as L } from "./IconXMark.js";
11
12
  export {
12
13
  e as IconArrowLeft,
13
- n as IconArrowsUpDown,
14
- t as IconCheck,
15
- m as IconCheckCircle,
14
+ c as IconArrowsUpDown,
15
+ m as IconCheck,
16
+ x as IconCheckCircle,
16
17
  I as IconChevronDown,
17
- h as IconEnvelope,
18
- l as IconExclamationCircle,
19
- a as IconLock,
20
- v as IconPhone,
21
- D as IconXMark
18
+ l as IconEnvelope,
19
+ C as IconExclamationCircle,
20
+ k as IconExclamationTriangle,
21
+ E as IconLock,
22
+ A as IconPhone,
23
+ L as IconXMark
22
24
  };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export * from './components/CDPReactProvider';
2
2
  export * from './components/AuthButton';
3
+ export * from './components/Fund';
4
+ export * from './components/FundModal';
3
5
  export * from './components/SendTransactionButton';
4
6
  export * from './components/SignIn';
5
7
  export * from './components/SignOutButton';
package/dist/index.js CHANGED
@@ -1,81 +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 c } from "./components/SignIn/index.js";
5
- import { useSignInReducer as I } 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 T } from "./theme/cssVariables.js";
10
- import { theme as A } from "./theme/theme.js";
11
- import { colors as E, colorsBase as v, colorsComponents as w, colorsSemantic as D, font as M, tokens as P } 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 { IconCheck as j } from "./icons/IconCheck.js";
16
- import { IconCheckCircle as X } from "./icons/IconCheckCircle.js";
17
- import { IconChevronDown as q } from "./icons/IconChevronDown.js";
18
- import { IconEnvelope as z } from "./icons/IconEnvelope.js";
19
- import { IconExclamationCircle as J } from "./icons/IconExclamationCircle.js";
20
- import { IconLock as Q } from "./icons/IconLock.js";
21
- import { IconPhone as Y } from "./icons/IconPhone.js";
22
- import { IconXMark as $ } from "./icons/IconXMark.js";
23
- import { clamp as ro } from "./utils/clamp.js";
24
- import { getMessageFromUnknownError as to } from "./utils/getMessageFromUnknownError.js";
25
- import { isApiError as mo } from "./utils/isApiError.js";
26
- import { isEmailInvalid as fo } from "./utils/isEmailInvalid.js";
27
- import { parseValuesFromPhoneNumber as io } from "./utils/parseValuesFromPhoneNumber.js";
28
- import { SignInAuthMethodButtons as so } from "./components/SignIn/SignInAuthMethodButtons.js";
29
- import { SignInBackButton as ao } from "./components/SignIn/SignInBackButton.js";
30
- import { SignInDescription as go } from "./components/SignIn/SignInDescription.js";
31
- import { SignInFooter as So } from "./components/SignIn/SignInFooter.js";
32
- import { SignInForm as Co } from "./components/SignIn/SignInForm.js";
33
- import { SignInImage as To } from "./components/SignIn/SignInImage.js";
34
- import { SignInTitle as Bo } from "./components/SignIn/SignInTitle.js";
35
- import { useSignInContext as vo } 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";
36
42
  export {
37
43
  e as AUTH_METHODS,
38
44
  p as AuthButton,
39
45
  t as CDPReactProvider,
40
- V as IconArrowLeft,
41
- L as IconArrowsUpDown,
42
- j as IconCheck,
43
- X as IconCheckCircle,
44
- q as IconChevronDown,
45
- z as IconEnvelope,
46
- J as IconExclamationCircle,
47
- Q as IconLock,
48
- Y as IconPhone,
49
- $ as IconXMark,
50
- x as SendTransactionButton,
51
- c as SignIn,
52
- so as SignInAuthMethodButtons,
53
- ao as SignInBackButton,
54
- go as SignInDescription,
55
- So as SignInFooter,
56
- Co as SignInForm,
57
- To as SignInImage,
58
- u as SignInModal,
59
- Bo as SignInTitle,
60
- l as SignOutButton,
61
- h as ThemeProvider,
62
- ro as clamp,
63
- E as colors,
64
- v as colorsBase,
65
- w as colorsComponents,
66
- D as colorsSemantic,
67
- T as cssVariables,
68
- F as flattenTokensObject,
69
- M as font,
70
- to as getMessageFromUnknownError,
71
- mo as isApiError,
72
- fo as isEmailInvalid,
73
- io as parseValuesFromPhoneNumber,
74
- A as theme,
75
- O as themeToCssVariables,
76
- P 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,
77
90
  n as useAppConfig,
78
- vo as useSignInContext,
79
- I as useSignInReducer,
80
- C as useTheme
91
+ Ro as useSignInContext,
92
+ g as useSignInReducer,
93
+ k as useTheme
81
94
  };
@@ -247,6 +247,23 @@ export declare const theme: Flattened<{
247
247
  };
248
248
  };
249
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
+ };
250
267
  readonly bg: {
251
268
  readonly default: {
252
269
  readonly value: "#ffffff";
@@ -297,6 +314,9 @@ export declare const theme: Flattened<{
297
314
  readonly negative: {
298
315
  readonly value: "#cf202f";
299
316
  };
317
+ readonly warning: {
318
+ readonly value: "#ed702f";
319
+ };
300
320
  };
301
321
  readonly line: {
302
322
  readonly default: {
@@ -318,6 +338,9 @@ export declare const theme: Flattened<{
318
338
  };
319
339
  font: {
320
340
  readonly family: {
341
+ readonly mono: {
342
+ readonly value: "\"DM Mono\", monospace";
343
+ };
321
344
  readonly sans: {
322
345
  readonly value: "\"DM Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
323
346
  };
@@ -11,6 +11,7 @@ export declare const colorsBase: {
11
11
  readonly gray900: "#1a1d21";
12
12
  readonly red500: "#cf202f";
13
13
  readonly green500: "#098551";
14
+ readonly amber500: "#ed702f";
14
15
  };
15
16
  export declare const colorsSemantic: {
16
17
  readonly bg: {
@@ -63,6 +64,9 @@ export declare const colorsSemantic: {
63
64
  readonly negative: {
64
65
  readonly value: "#cf202f";
65
66
  };
67
+ readonly warning: {
68
+ readonly value: "#ed702f";
69
+ };
66
70
  };
67
71
  readonly line: {
68
72
  readonly default: {
@@ -328,6 +332,23 @@ export declare const colorsComponents: {
328
332
  };
329
333
  };
330
334
  };
335
+ readonly code: {
336
+ readonly bg: {
337
+ readonly default: {
338
+ readonly value: "{colors.bg.alternate}";
339
+ };
340
+ };
341
+ readonly border: {
342
+ readonly default: {
343
+ readonly value: "{colors.line.heavy}";
344
+ };
345
+ };
346
+ readonly text: {
347
+ readonly default: {
348
+ readonly value: "{colors.fg.default}";
349
+ };
350
+ };
351
+ };
331
352
  };
332
353
  export declare const colors: {
333
354
  readonly page: {
@@ -575,6 +596,23 @@ export declare const colors: {
575
596
  };
576
597
  };
577
598
  };
599
+ readonly code: {
600
+ readonly bg: {
601
+ readonly default: {
602
+ readonly value: "{colors.bg.alternate}";
603
+ };
604
+ };
605
+ readonly border: {
606
+ readonly default: {
607
+ readonly value: "{colors.line.heavy}";
608
+ };
609
+ };
610
+ readonly text: {
611
+ readonly default: {
612
+ readonly value: "{colors.fg.default}";
613
+ };
614
+ };
615
+ };
578
616
  readonly bg: {
579
617
  readonly default: {
580
618
  readonly value: "#ffffff";
@@ -625,6 +663,9 @@ export declare const colors: {
625
663
  readonly negative: {
626
664
  readonly value: "#cf202f";
627
665
  };
666
+ readonly warning: {
667
+ readonly value: "#ed702f";
668
+ };
628
669
  };
629
670
  readonly line: {
630
671
  readonly default: {
@@ -646,6 +687,9 @@ export declare const colors: {
646
687
  };
647
688
  export declare const font: {
648
689
  readonly family: {
690
+ readonly mono: {
691
+ readonly value: "\"DM Mono\", monospace";
692
+ };
649
693
  readonly sans: {
650
694
  readonly value: "\"DM Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
651
695
  };
@@ -903,6 +947,23 @@ export declare const tokens: {
903
947
  };
904
948
  };
905
949
  };
950
+ readonly code: {
951
+ readonly bg: {
952
+ readonly default: {
953
+ readonly value: "{colors.bg.alternate}";
954
+ };
955
+ };
956
+ readonly border: {
957
+ readonly default: {
958
+ readonly value: "{colors.line.heavy}";
959
+ };
960
+ };
961
+ readonly text: {
962
+ readonly default: {
963
+ readonly value: "{colors.fg.default}";
964
+ };
965
+ };
966
+ };
906
967
  readonly bg: {
907
968
  readonly default: {
908
969
  readonly value: "#ffffff";
@@ -953,6 +1014,9 @@ export declare const tokens: {
953
1014
  readonly negative: {
954
1015
  readonly value: "#cf202f";
955
1016
  };
1017
+ readonly warning: {
1018
+ readonly value: "#ed702f";
1019
+ };
956
1020
  };
957
1021
  readonly line: {
958
1022
  readonly default: {
@@ -974,6 +1038,9 @@ export declare const tokens: {
974
1038
  };
975
1039
  font: {
976
1040
  readonly family: {
1041
+ readonly mono: {
1042
+ readonly value: "\"DM Mono\", monospace";
1043
+ };
977
1044
  readonly sans: {
978
1045
  readonly value: "\"DM Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
979
1046
  };
@@ -13,7 +13,8 @@ const e = {
13
13
  gray900: "#1a1d21",
14
14
  // contextual
15
15
  red500: "#cf202f",
16
- green500: "#098551"
16
+ green500: "#098551",
17
+ amber500: "#ed702f"
17
18
  }, l = {
18
19
  bg: {
19
20
  default: { value: e.white },
@@ -42,8 +43,10 @@ const e = {
42
43
  // text on secondary color
43
44
  positive: { value: e.green500 },
44
45
  // positive color text
45
- negative: { value: e.red500 }
46
+ negative: { value: e.red500 },
46
47
  // negative color text
48
+ warning: { value: e.amber500 }
49
+ // warning color text
47
50
  },
48
51
  line: {
49
52
  default: { value: e.gray200 },
@@ -191,12 +194,26 @@ const e = {
191
194
  }
192
195
  }
193
196
  }
197
+ },
198
+ code: {
199
+ bg: {
200
+ default: { value: "{colors.bg.alternate}" }
201
+ },
202
+ border: {
203
+ default: { value: "{colors.line.heavy}" }
204
+ },
205
+ text: {
206
+ default: { value: "{colors.fg.default}" }
207
+ }
194
208
  }
195
209
  }, o = {
196
210
  ...l,
197
211
  ...a
198
212
  }, r = {
199
213
  family: {
214
+ mono: {
215
+ value: '"DM Mono", monospace'
216
+ },
200
217
  sans: {
201
218
  value: '"DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
202
219
  }
@@ -0,0 +1 @@
1
+ export declare const formatFiat: (value: number, currency?: string, decimalPlaces?: number, locale?: string) => string;
@@ -0,0 +1,13 @@
1
+ import { DEFAULT_LOCALE as n } from "../data/locale.js";
2
+ const F = (t, i = "USD", r = 2, m = n) => {
3
+ const o = Math.floor(t) === t;
4
+ return new Intl.NumberFormat(m, {
5
+ style: "currency",
6
+ currency: i,
7
+ minimumFractionDigits: o ? 0 : r,
8
+ maximumFractionDigits: o ? 0 : r
9
+ }).format(t);
10
+ };
11
+ export {
12
+ F as formatFiat
13
+ };
@@ -0,0 +1,7 @@
1
+ export type OpenPopupParams = {
2
+ url: string;
3
+ height: number;
4
+ width: number;
5
+ target?: string;
6
+ };
7
+ export declare const openPopup: ({ url, target, height, width }: OpenPopupParams) => Window | null;
@@ -0,0 +1,15 @@
1
+ const l = ({ url: d, target: r, height: e, width: n }) => {
2
+ const o = window.screenLeft !== void 0 ? window.screenLeft : window.screenX, t = window.screenTop !== void 0 ? window.screenTop : window.screenY, s = o >= 0 && o < window.screen.width && t >= 0 && t < window.screen.height;
3
+ let i, w;
4
+ if (s)
5
+ i = Math.round((window.screen.width - n) / 2), w = Math.round((window.screen.height - e) / 2);
6
+ else {
7
+ const h = window.outerWidth || window.innerWidth || document.documentElement.clientWidth || window.screen.width, u = window.outerHeight || window.innerHeight || document.documentElement.clientHeight || window.screen.height;
8
+ i = Math.round(o + (h - n) / 2), w = Math.round(t + (u - e) / 2);
9
+ }
10
+ const c = `width=${n},height=${e},resizable,scrollbars=yes,status=1,left=${i},top=${w}`;
11
+ return window.open(d, r, c);
12
+ };
13
+ export {
14
+ l as openPopup
15
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-react",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@internationalized/number": "3.6.4",
@@ -14,8 +14,8 @@
14
14
  },
15
15
  "peerDependencies": {
16
16
  "react": ">=18.2.0",
17
- "@coinbase/cdp-core": "^0.0.24",
18
- "@coinbase/cdp-hooks": "^0.0.24"
17
+ "@coinbase/cdp-core": "^0.0.25",
18
+ "@coinbase/cdp-hooks": "^0.0.25"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@size-limit/preset-big-lib": "^11.2.0",
@@ -45,8 +45,8 @@
45
45
  "vite": "^7.0.4",
46
46
  "vite-plugin-dts": "^4.5.4",
47
47
  "vite-plugin-lib-inject-css": "^2.2.2",
48
- "@coinbase/cdp-core": "^0.0.24",
49
- "@coinbase/cdp-hooks": "^0.0.24"
48
+ "@coinbase/cdp-core": "^0.0.25",
49
+ "@coinbase/cdp-hooks": "^0.0.25"
50
50
  },
51
51
  "size-limit": [
52
52
  {
@@ -54,7 +54,7 @@
54
54
  "path": "./dist/index.js",
55
55
  "import": "*",
56
56
  "running": false,
57
- "limit": "70 KB"
57
+ "limit": "100 KB"
58
58
  },
59
59
  {
60
60
  "name": "single-component",