@coinbase/cdp-react 0.0.17 → 0.0.19

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 (135) hide show
  1. package/dist/assets/Button.css +1 -1
  2. package/dist/assets/EmailForm.css +1 -0
  3. package/dist/assets/Error.css +1 -1
  4. package/dist/assets/Field.css +1 -1
  5. package/dist/assets/FlowEmailOTP.css +1 -0
  6. package/dist/assets/FlowPhoneNumberOTP.css +1 -0
  7. package/dist/assets/Input.css +1 -1
  8. package/dist/assets/Label.css +1 -0
  9. package/dist/assets/OTP.css +1 -1
  10. package/dist/assets/OTPForm.css +1 -0
  11. package/dist/assets/PhoneNumberForm.css +1 -0
  12. package/dist/assets/PhoneNumberInput.css +1 -0
  13. package/dist/assets/SignIn.css +1 -1
  14. package/dist/assets/SignInAuthMethodButtons.css +1 -0
  15. package/dist/assets/SignInBackButton.css +1 -0
  16. package/dist/assets/SignInCredentials.css +1 -0
  17. package/dist/assets/SignInDescription.css +1 -1
  18. package/dist/assets/SignInFooter.css +1 -0
  19. package/dist/assets/SignInForm.css +1 -1
  20. package/dist/assets/SignInImage.css +1 -1
  21. package/dist/assets/SignInModal.css +1 -1
  22. package/dist/assets/SignInTitle.css +1 -1
  23. package/dist/assets/SuccessMessage.css +1 -0
  24. package/dist/assets/SwitchFadeTransition.css +1 -0
  25. package/dist/assets/SwitchSlideTransition.css +1 -0
  26. package/dist/assets/SwitchTransition.css +1 -0
  27. package/dist/assets/ThemeProvider.css +1 -1
  28. package/dist/chunks/index.BzllgVaP.js +12 -0
  29. package/dist/components/AuthButton/index.js +2 -2
  30. package/dist/components/Button/index.d.ts +2 -1
  31. package/dist/components/Button/index.js +47 -22
  32. package/dist/components/CDPReactProvider/index.d.ts +3 -0
  33. package/dist/components/CDPReactProvider/index.js +20 -13
  34. package/dist/components/EmailForm/index.d.ts +11 -0
  35. package/dist/components/EmailForm/index.js +56 -0
  36. package/dist/components/Error/index.d.ts +2 -2
  37. package/dist/components/Error/index.js +11 -11
  38. package/dist/components/Field/index.d.ts +2 -1
  39. package/dist/components/Field/index.js +20 -18
  40. package/dist/components/FlowEmailOTP/index.d.ts +18 -0
  41. package/dist/components/FlowEmailOTP/index.js +70 -0
  42. package/dist/components/FlowPhoneNumberOTP/index.d.ts +18 -0
  43. package/dist/components/FlowPhoneNumberOTP/index.js +75 -0
  44. package/dist/components/Label/index.d.ts +7 -0
  45. package/dist/components/Label/index.js +13 -0
  46. package/dist/components/OTP/index.d.ts +3 -0
  47. package/dist/components/OTP/index.js +48 -33
  48. package/dist/components/OTPForm/index.d.ts +16 -0
  49. package/dist/components/OTPForm/index.js +76 -0
  50. package/dist/components/PhoneNumberForm/index.d.ts +14 -0
  51. package/dist/components/PhoneNumberForm/index.js +68 -0
  52. package/dist/components/PhoneNumberInput/PhoneNumberMetadata.d.ts +2 -0
  53. package/dist/components/PhoneNumberInput/PhoneNumberMetadata.js +5 -0
  54. package/dist/components/PhoneNumberInput/index.d.ts +10 -0
  55. package/dist/components/PhoneNumberInput/index.js +76 -0
  56. package/dist/components/PhoneNumberInput/maskOverride.d.ts +8 -0
  57. package/dist/components/PhoneNumberInput/maskOverride.js +61 -0
  58. package/dist/components/PhoneNumberInput/usePhoneNumberFormatter.d.ts +7 -0
  59. package/dist/components/PhoneNumberInput/usePhoneNumberFormatter.js +52 -0
  60. package/dist/components/SendTransactionButton/index.js +1 -1
  61. package/dist/components/ServerError/index.js +4 -4
  62. package/dist/components/SignIn/SignInAuthMethodButtons.d.ts +13 -0
  63. package/dist/components/SignIn/SignInAuthMethodButtons.js +57 -0
  64. package/dist/components/SignIn/SignInBackButton.d.ts +9 -0
  65. package/dist/components/SignIn/SignInBackButton.js +38 -0
  66. package/dist/components/SignIn/SignInCredentials.d.ts +2 -0
  67. package/dist/components/SignIn/SignInCredentials.js +8 -0
  68. package/dist/components/SignIn/SignInDescription.d.ts +4 -3
  69. package/dist/components/SignIn/SignInDescription.js +16 -23
  70. package/dist/components/SignIn/SignInFooter.d.ts +2 -0
  71. package/dist/components/SignIn/SignInFooter.js +18 -0
  72. package/dist/components/SignIn/SignInForm.d.ts +12 -4
  73. package/dist/components/SignIn/SignInForm.js +25 -196
  74. package/dist/components/SignIn/SignInImage.d.ts +2 -2
  75. package/dist/components/SignIn/SignInImage.js +11 -14
  76. package/dist/components/SignIn/SignInProvider.d.ts +1 -1
  77. package/dist/components/SignIn/SignInProvider.js +24 -16
  78. package/dist/components/SignIn/SignInTitle.d.ts +4 -3
  79. package/dist/components/SignIn/SignInTitle.js +18 -13
  80. package/dist/components/SignIn/flows/SignInWithEmail.d.ts +5 -0
  81. package/dist/components/SignIn/flows/SignInWithEmail.js +71 -0
  82. package/dist/components/SignIn/flows/SignInWithSms.d.ts +5 -0
  83. package/dist/components/SignIn/flows/SignInWithSms.js +2994 -0
  84. package/dist/components/SignIn/hooks/useEmailForm.d.ts +13 -0
  85. package/dist/components/SignIn/hooks/useEmailForm.js +42 -0
  86. package/dist/components/SignIn/hooks/useOTPForm.d.ts +16 -0
  87. package/dist/components/SignIn/hooks/useOTPForm.js +59 -0
  88. package/dist/components/SignIn/hooks/usePhoneNumberForm.d.ts +13 -0
  89. package/dist/components/SignIn/hooks/usePhoneNumberForm.js +42 -0
  90. package/dist/components/SignIn/index.d.ts +5 -2
  91. package/dist/components/SignIn/index.js +42 -24
  92. package/dist/components/SignIn/types.d.ts +106 -0
  93. package/dist/components/SignIn/types.js +3 -0
  94. package/dist/components/SignIn/useSignInReducer.d.ts +1 -57
  95. package/dist/components/SignIn/useSignInReducer.js +62 -20
  96. package/dist/components/SignInModal/index.d.ts +2 -2
  97. package/dist/components/SignInModal/index.js +62 -43
  98. package/dist/components/SignOutButton/index.js +1 -1
  99. package/dist/components/SuccessMessage/index.d.ts +7 -0
  100. package/dist/components/SuccessMessage/index.js +16 -0
  101. package/dist/components/SwitchFadeTransition/index.d.ts +5 -0
  102. package/dist/components/SwitchFadeTransition/index.js +24 -0
  103. package/dist/components/SwitchSlideTransition/index.d.ts +7 -0
  104. package/dist/components/SwitchSlideTransition/index.js +27 -0
  105. package/dist/components/SwitchTransition/index.d.ts +25 -0
  106. package/dist/components/SwitchTransition/index.js +155 -0
  107. package/dist/data/countries.d.ts +12 -0
  108. package/dist/data/countries.js +25 -0
  109. package/dist/data/countryNames.d.ts +1 -0
  110. package/dist/data/countryNames.js +6 -0
  111. package/dist/hooks/usePhoneNumberValidators.d.ts +14 -0
  112. package/dist/hooks/usePhoneNumberValidators.js +36 -0
  113. package/dist/hooks/useTimer.d.ts +5 -0
  114. package/dist/hooks/useTimer.js +24 -0
  115. package/dist/icons/IconArrowLeft.d.ts +2 -0
  116. package/dist/icons/IconArrowLeft.js +14 -0
  117. package/dist/icons/IconCheckCircle.js +2 -3
  118. package/dist/icons/IconCoinbaseWordmark.js +5 -5
  119. package/dist/icons/IconEnvelope.d.ts +2 -0
  120. package/dist/icons/IconEnvelope.js +7 -0
  121. package/dist/icons/IconExclamationCircle.js +3 -4
  122. package/dist/icons/IconPhone.d.ts +2 -0
  123. package/dist/icons/IconPhone.js +7 -0
  124. package/dist/icons/IconXMark.js +6 -5
  125. package/dist/icons/index.d.ts +3 -0
  126. package/dist/icons/index.js +14 -8
  127. package/dist/index.js +66 -53
  128. package/dist/theme/theme.d.ts +11 -2
  129. package/dist/theme/tokens.d.ts +30 -6
  130. package/dist/theme/tokens.js +7 -3
  131. package/dist/utils/parseValuesFromPhoneNumber.d.ts +6 -0
  132. package/dist/utils/parseValuesFromPhoneNumber.js +16 -0
  133. package/dist/utils/validatePhoneNumber.d.ts +1 -0
  134. package/dist/utils/validatePhoneNumber.js +1 -0
  135. package/package.json +11 -7
@@ -0,0 +1,2 @@
1
+ import { SVGProps } from 'react';
2
+ export declare const IconPhone: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import "react";
3
+ import { SvgIcon as L } from "./SvgIcon.js";
4
+ const e = (r) => /* @__PURE__ */ o(L, { width: "20", height: "20", viewBox: "1 1 20 18", fill: "currentColor", ...r, children: /* @__PURE__ */ o("path", { d: "M1.1491 -0.00488281H8.45971L9.66658 6.37031L4.99795 10.1828C6.38698 12.6261 8.42293 14.6527 10.8728 16.0291L14.6205 11.4246L20.9883 12.6341V19.8006L19.7231 19.9414L19.7044 19.9428C19.2823 19.9737 18.8499 19.9951 18.4114 19.9951C8.78359 19.9951 0.988281 12.1853 0.988281 2.55472C0.988281 2.00318 1.00905 1.45404 1.06228 0.899562L1.1491 -0.00488281ZM12.7308 16.9147C14.4886 17.6119 16.4051 17.9951 18.4114 17.9951C18.6019 17.9951 18.794 17.9904 18.9883 17.982V14.2899L15.4189 13.612L12.7308 16.9147ZM4.10333 8.33119L7.48023 5.57357L6.8028 1.99512H2.99675C2.99096 2.17961 2.98828 2.36593 2.98828 2.55472C2.98828 4.59716 3.38415 6.54689 4.10333 8.33119Z" }) });
5
+ export {
6
+ e as IconPhone
7
+ };
@@ -1,11 +1,12 @@
1
- import { jsx as r } from "react/jsx-runtime";
1
+ import { jsx as o } from "react/jsx-runtime";
2
2
  import "react";
3
- import { SvgIcon as L } from "./SvgIcon.js";
4
- const n = (o) => /* @__PURE__ */ r(L, { width: "15", height: "14", viewBox: "0 0 15 14", ...o, children: /* @__PURE__ */ r(
3
+ import { SvgIcon as e } from "./SvgIcon.js";
4
+ const n = (r) => /* @__PURE__ */ o(e, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", ...r, children: /* @__PURE__ */ o(
5
5
  "path",
6
6
  {
7
- d: "M6.85395 6.99516L0.98877 1.12998L2.12364 -0.00488281L7.98881 5.86029L13.854 -0.00488281L14.9889 1.12998L9.12368 6.99516L14.9888 12.8602L13.8539 13.9951L7.98881 8.13003L2.12372 13.9951L0.988857 12.8602L6.85395 6.99516Z",
8
- fill: "currentColor"
7
+ fillRule: "evenodd",
8
+ d: "M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",
9
+ clipRule: "evenodd"
9
10
  }
10
11
  ) });
11
12
  export {
@@ -1,4 +1,7 @@
1
+ export * from './IconArrowLeft';
1
2
  export * from './IconCheckCircle';
3
+ export * from './IconEnvelope';
2
4
  export * from './IconExclamationCircle';
3
5
  export * from './IconLock';
6
+ export * from './IconPhone';
4
7
  export * from './IconXMark';
@@ -1,10 +1,16 @@
1
- import { IconCheckCircle as c } from "./IconCheckCircle.js";
2
- import { IconExclamationCircle as m } from "./IconExclamationCircle.js";
3
- import { IconLock as t } from "./IconLock.js";
4
- import { IconXMark as f } from "./IconXMark.js";
1
+ import { IconArrowLeft as e } from "./IconArrowLeft.js";
2
+ import { IconCheckCircle as n } from "./IconCheckCircle.js";
3
+ import { IconEnvelope as f } from "./IconEnvelope.js";
4
+ import { IconExclamationCircle as p } from "./IconExclamationCircle.js";
5
+ import { IconLock as I } from "./IconLock.js";
6
+ import { IconPhone as a } from "./IconPhone.js";
7
+ import { IconXMark as k } from "./IconXMark.js";
5
8
  export {
6
- c as IconCheckCircle,
7
- m as IconExclamationCircle,
8
- t as IconLock,
9
- f as IconXMark
9
+ e as IconArrowLeft,
10
+ n as IconCheckCircle,
11
+ f as IconEnvelope,
12
+ p as IconExclamationCircle,
13
+ I as IconLock,
14
+ a as IconPhone,
15
+ k as IconXMark
10
16
  };
package/dist/index.js CHANGED
@@ -1,58 +1,71 @@
1
- import { CDPReactProvider as e, useAppConfig as t } from "./components/CDPReactProvider/index.js";
2
- import { AuthButton as m } from "./components/AuthButton/index.js";
3
- import { SendTransactionButton as f } from "./components/SendTransactionButton/index.js";
4
- import { SignIn as x } from "./components/SignIn/index.js";
5
- import { useSignInReducer as c } from "./components/SignIn/useSignInReducer.js";
6
- import { SignOutButton as l } from "./components/SignOutButton/index.js";
7
- import { SignInModal as g } from "./components/SignInModal/index.js";
8
- import { ThemeProvider as u, useTheme as C } from "./components/ThemeProvider/index.js";
9
- import { cssVariables as h } from "./theme/cssVariables.js";
10
- import { theme as T } from "./theme/theme.js";
11
- import { colors as E, colorsBase as b, colorsComponents as v, colorsSemantic as A, font as M, tokens as P } from "./theme/tokens.js";
12
- import { flattenTokensObject as F, themeToCssVariables as O } from "./theme/utils.js";
13
- import { IconCheckCircle as V } from "./icons/IconCheckCircle.js";
14
- import { IconExclamationCircle as w } from "./icons/IconExclamationCircle.js";
15
- import { IconLock as U } from "./icons/IconLock.js";
16
- import { IconXMark as q } from "./icons/IconXMark.js";
17
- import { getMessageFromUnknownError as z } from "./utils/getMessageFromUnknownError.js";
18
- import { isApiError as H } from "./utils/isApiError.js";
19
- import { isEmailInvalid as K } from "./utils/isEmailInvalid.js";
20
- import { SignInDescription as Q } from "./components/SignIn/SignInDescription.js";
21
- import { SignInForm as Y } from "./components/SignIn/SignInForm.js";
22
- import { SignInImage as _ } from "./components/SignIn/SignInImage.js";
23
- import { SignInTitle as oo } from "./components/SignIn/SignInTitle.js";
24
- import { useSignInContext as eo } from "./components/SignIn/SignInProvider.js";
1
+ import { AUTH_METHODS as e, CDPReactProvider as t, useAppConfig as n } from "./components/CDPReactProvider/index.js";
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 I } from "./components/SignIn/useSignInReducer.js";
6
+ import { SignOutButton as g } from "./components/SignOutButton/index.js";
7
+ import { SignInModal as S } 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 B } from "./theme/theme.js";
11
+ import { colors as E, colorsBase as M, colorsComponents as v, colorsSemantic as P, font as b, tokens as D } from "./theme/tokens.js";
12
+ import { flattenTokensObject as O, themeToCssVariables as w } from "./theme/utils.js";
13
+ import { IconArrowLeft as L } from "./icons/IconArrowLeft.js";
14
+ import { IconCheckCircle as U } from "./icons/IconCheckCircle.js";
15
+ import { IconEnvelope as j } from "./icons/IconEnvelope.js";
16
+ import { IconExclamationCircle as _ } from "./icons/IconExclamationCircle.js";
17
+ import { IconLock as y } from "./icons/IconLock.js";
18
+ import { IconPhone as G } from "./icons/IconPhone.js";
19
+ import { IconXMark as K } from "./icons/IconXMark.js";
20
+ import { getMessageFromUnknownError as Q } from "./utils/getMessageFromUnknownError.js";
21
+ import { isApiError as Y } from "./utils/isApiError.js";
22
+ import { isEmailInvalid as $ } from "./utils/isEmailInvalid.js";
23
+ import { SignInAuthMethodButtons as ro } from "./components/SignIn/SignInAuthMethodButtons.js";
24
+ import { SignInBackButton as to } from "./components/SignIn/SignInBackButton.js";
25
+ import { SignInDescription as mo } from "./components/SignIn/SignInDescription.js";
26
+ import { SignInFooter as fo } from "./components/SignIn/SignInFooter.js";
27
+ import { SignInForm as io } from "./components/SignIn/SignInForm.js";
28
+ import { SignInImage as co } from "./components/SignIn/SignInImage.js";
29
+ import { SignInTitle as ao } from "./components/SignIn/SignInTitle.js";
30
+ import { useSignInContext as lo } from "./components/SignIn/SignInProvider.js";
25
31
  export {
26
- m as AuthButton,
27
- e as CDPReactProvider,
28
- V as IconCheckCircle,
29
- w as IconExclamationCircle,
30
- U as IconLock,
31
- q as IconXMark,
32
- f as SendTransactionButton,
33
- x as SignIn,
34
- Q as SignInDescription,
35
- Y as SignInForm,
36
- _ as SignInImage,
37
- g as SignInModal,
38
- oo as SignInTitle,
39
- l as SignOutButton,
40
- u as ThemeProvider,
32
+ e as AUTH_METHODS,
33
+ p as AuthButton,
34
+ t as CDPReactProvider,
35
+ L as IconArrowLeft,
36
+ U as IconCheckCircle,
37
+ j as IconEnvelope,
38
+ _ as IconExclamationCircle,
39
+ y as IconLock,
40
+ G as IconPhone,
41
+ K as IconXMark,
42
+ x as SendTransactionButton,
43
+ s as SignIn,
44
+ ro as SignInAuthMethodButtons,
45
+ to as SignInBackButton,
46
+ mo as SignInDescription,
47
+ fo as SignInFooter,
48
+ io as SignInForm,
49
+ co as SignInImage,
50
+ S as SignInModal,
51
+ ao as SignInTitle,
52
+ g as SignOutButton,
53
+ h as ThemeProvider,
41
54
  E as colors,
42
- b as colorsBase,
55
+ M as colorsBase,
43
56
  v as colorsComponents,
44
- A as colorsSemantic,
45
- h as cssVariables,
46
- F as flattenTokensObject,
47
- M as font,
48
- z as getMessageFromUnknownError,
49
- H as isApiError,
50
- K as isEmailInvalid,
51
- T as theme,
52
- O as themeToCssVariables,
53
- P as tokens,
54
- t as useAppConfig,
55
- eo as useSignInContext,
56
- c as useSignInReducer,
57
+ P as colorsSemantic,
58
+ d as cssVariables,
59
+ O as flattenTokensObject,
60
+ b as font,
61
+ Q as getMessageFromUnknownError,
62
+ Y as isApiError,
63
+ $ as isEmailInvalid,
64
+ B as theme,
65
+ w as themeToCssVariables,
66
+ D as tokens,
67
+ n as useAppConfig,
68
+ lo as useSignInContext,
69
+ I as useSignInReducer,
57
70
  C as useTheme
58
71
  };
@@ -124,6 +124,9 @@ export declare const theme: Flattened<{
124
124
  readonly error: {
125
125
  readonly value: "{colors.line.negative}";
126
126
  };
127
+ readonly success: {
128
+ readonly value: "{colors.line.positive}";
129
+ };
127
130
  };
128
131
  readonly label: {
129
132
  readonly default: {
@@ -145,6 +148,11 @@ export declare const theme: Flattened<{
145
148
  readonly value: "{colors.fg.negative}";
146
149
  };
147
150
  };
151
+ readonly successText: {
152
+ readonly default: {
153
+ readonly value: "{colors.fg.positive}";
154
+ };
155
+ };
148
156
  };
149
157
  readonly bg: {
150
158
  readonly default: {
@@ -191,7 +199,7 @@ export declare const theme: Flattened<{
191
199
  readonly value: "#0a0b0d";
192
200
  };
193
201
  readonly positive: {
194
- readonly value: "#008531";
202
+ readonly value: "#098551";
195
203
  };
196
204
  readonly negative: {
197
205
  readonly value: "#cf202f";
@@ -218,7 +226,7 @@ export declare const theme: Flattened<{
218
226
  font: {
219
227
  readonly family: {
220
228
  readonly sans: {
221
- readonly value: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
229
+ readonly value: "\"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
222
230
  };
223
231
  };
224
232
  readonly size: {
@@ -240,3 +248,4 @@ export type FontTokens = Flattened<{
240
248
  export type ColorTokens = SemanticColors | ComponentColors;
241
249
  export type Theme = ColorTokens & FontTokens;
242
250
  export type ButtonVariant = "primary" | "secondary" | "linkPrimary" | "linkSecondary" | "transparentPrimary" | "transparentSecondary";
251
+ export type ButtonSize = "lg" | "md" | "sm";
@@ -10,7 +10,7 @@ export declare const colorsBase: {
10
10
  readonly gray700: "#5b616e";
11
11
  readonly gray900: "#1a1d21";
12
12
  readonly red500: "#cf202f";
13
- readonly green500: "#008531";
13
+ readonly green500: "#098551";
14
14
  };
15
15
  export declare const colorsSemantic: {
16
16
  readonly bg: {
@@ -58,7 +58,7 @@ export declare const colorsSemantic: {
58
58
  readonly value: "#0a0b0d";
59
59
  };
60
60
  readonly positive: {
61
- readonly value: "#008531";
61
+ readonly value: "#098551";
62
62
  };
63
63
  readonly negative: {
64
64
  readonly value: "#cf202f";
@@ -205,6 +205,9 @@ export declare const colorsComponents: {
205
205
  readonly error: {
206
206
  readonly value: "{colors.line.negative}";
207
207
  };
208
+ readonly success: {
209
+ readonly value: "{colors.line.positive}";
210
+ };
208
211
  };
209
212
  readonly label: {
210
213
  readonly default: {
@@ -226,6 +229,11 @@ export declare const colorsComponents: {
226
229
  readonly value: "{colors.fg.negative}";
227
230
  };
228
231
  };
232
+ readonly successText: {
233
+ readonly default: {
234
+ readonly value: "{colors.fg.positive}";
235
+ };
236
+ };
229
237
  };
230
238
  };
231
239
  export declare const colors: {
@@ -351,6 +359,9 @@ export declare const colors: {
351
359
  readonly error: {
352
360
  readonly value: "{colors.line.negative}";
353
361
  };
362
+ readonly success: {
363
+ readonly value: "{colors.line.positive}";
364
+ };
354
365
  };
355
366
  readonly label: {
356
367
  readonly default: {
@@ -372,6 +383,11 @@ export declare const colors: {
372
383
  readonly value: "{colors.fg.negative}";
373
384
  };
374
385
  };
386
+ readonly successText: {
387
+ readonly default: {
388
+ readonly value: "{colors.fg.positive}";
389
+ };
390
+ };
375
391
  };
376
392
  readonly bg: {
377
393
  readonly default: {
@@ -418,7 +434,7 @@ export declare const colors: {
418
434
  readonly value: "#0a0b0d";
419
435
  };
420
436
  readonly positive: {
421
- readonly value: "#008531";
437
+ readonly value: "#098551";
422
438
  };
423
439
  readonly negative: {
424
440
  readonly value: "#cf202f";
@@ -445,7 +461,7 @@ export declare const colors: {
445
461
  export declare const font: {
446
462
  readonly family: {
447
463
  readonly sans: {
448
- readonly value: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
464
+ readonly value: "\"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
449
465
  };
450
466
  };
451
467
  readonly size: {
@@ -578,6 +594,9 @@ export declare const tokens: {
578
594
  readonly error: {
579
595
  readonly value: "{colors.line.negative}";
580
596
  };
597
+ readonly success: {
598
+ readonly value: "{colors.line.positive}";
599
+ };
581
600
  };
582
601
  readonly label: {
583
602
  readonly default: {
@@ -599,6 +618,11 @@ export declare const tokens: {
599
618
  readonly value: "{colors.fg.negative}";
600
619
  };
601
620
  };
621
+ readonly successText: {
622
+ readonly default: {
623
+ readonly value: "{colors.fg.positive}";
624
+ };
625
+ };
602
626
  };
603
627
  readonly bg: {
604
628
  readonly default: {
@@ -645,7 +669,7 @@ export declare const tokens: {
645
669
  readonly value: "#0a0b0d";
646
670
  };
647
671
  readonly positive: {
648
- readonly value: "#008531";
672
+ readonly value: "#098551";
649
673
  };
650
674
  readonly negative: {
651
675
  readonly value: "#cf202f";
@@ -672,7 +696,7 @@ export declare const tokens: {
672
696
  font: {
673
697
  readonly family: {
674
698
  readonly sans: {
675
- readonly value: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
699
+ readonly value: "\"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
676
700
  };
677
701
  };
678
702
  readonly size: {
@@ -13,7 +13,7 @@ const e = {
13
13
  gray900: "#1a1d21",
14
14
  // contextual
15
15
  red500: "#cf202f",
16
- green500: "#008531"
16
+ green500: "#098551"
17
17
  }, a = {
18
18
  bg: {
19
19
  default: { value: e.white },
@@ -122,7 +122,8 @@ const e = {
122
122
  border: {
123
123
  default: { value: "{colors.line.heavy}" },
124
124
  focus: { value: "{colors.line.primary}" },
125
- error: { value: "{colors.line.negative}" }
125
+ error: { value: "{colors.line.negative}" },
126
+ success: { value: "{colors.line.positive}" }
126
127
  },
127
128
  label: {
128
129
  default: { value: "{colors.fg.default}" }
@@ -135,6 +136,9 @@ const e = {
135
136
  },
136
137
  errorText: {
137
138
  default: { value: "{colors.fg.negative}" }
139
+ },
140
+ successText: {
141
+ default: { value: "{colors.fg.positive}" }
138
142
  }
139
143
  }
140
144
  }, o = {
@@ -143,7 +147,7 @@ const e = {
143
147
  }, r = {
144
148
  family: {
145
149
  sans: {
146
- value: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
150
+ value: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
147
151
  }
148
152
  },
149
153
  size: {
@@ -0,0 +1,6 @@
1
+ import { CountryCode } from 'libphonenumber-js';
2
+ export interface PhoneNumber {
3
+ value: string;
4
+ e164: string;
5
+ }
6
+ export declare const parseValuesFromPhoneNumber: (phoneNumber: string, countryCode?: CountryCode) => PhoneNumber;
@@ -0,0 +1,16 @@
1
+ import { parsePhoneNumberWithError as n } from "libphonenumber-js";
2
+ const a = (r, o) => {
3
+ const e = {
4
+ value: r,
5
+ e164: ""
6
+ };
7
+ try {
8
+ const t = n(r, o);
9
+ e.e164 = t.number;
10
+ } catch {
11
+ }
12
+ return e;
13
+ };
14
+ export {
15
+ a as parseValuesFromPhoneNumber
16
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+
package/package.json CHANGED
@@ -1,16 +1,18 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-react",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@radix-ui/react-dialog": "^1.1.14",
7
7
  "@radix-ui/react-form": "^0.1.7",
8
- "@radix-ui/react-one-time-password-field": "^0.1.7"
8
+ "@radix-ui/react-one-time-password-field": "^0.1.7",
9
+ "react-transition-state": "2.3.0",
10
+ "libphonenumber-js": "^1.12.10"
9
11
  },
10
12
  "peerDependencies": {
11
13
  "react": ">=18.2.0",
12
- "@coinbase/cdp-core": "^0.0.17",
13
- "@coinbase/cdp-hooks": "^0.0.17"
14
+ "@coinbase/cdp-core": "^0.0.19",
15
+ "@coinbase/cdp-hooks": "^0.0.19"
14
16
  },
15
17
  "devDependencies": {
16
18
  "@size-limit/preset-big-lib": "^11.2.0",
@@ -31,6 +33,7 @@
31
33
  "glob": "^11.0.3",
32
34
  "react": "^19.1.0",
33
35
  "react-dom": "^19.1.0",
36
+ "rollup-plugin-visualizer": "^6.0.3",
34
37
  "size-limit": "^11.2.0",
35
38
  "stylelint": "^16.22.0",
36
39
  "stylelint-config-standard": "^38.0.0",
@@ -38,8 +41,8 @@
38
41
  "vite": "^7.0.4",
39
42
  "vite-plugin-dts": "^4.5.4",
40
43
  "vite-plugin-lib-inject-css": "^2.2.2",
41
- "@coinbase/cdp-core": "^0.0.17",
42
- "@coinbase/cdp-hooks": "^0.0.17"
44
+ "@coinbase/cdp-core": "^0.0.19",
45
+ "@coinbase/cdp-hooks": "^0.0.19"
43
46
  },
44
47
  "size-limit": [
45
48
  {
@@ -47,7 +50,7 @@
47
50
  "path": "./dist/index.js",
48
51
  "import": "*",
49
52
  "running": false,
50
- "limit": "65 KB"
53
+ "limit": "70 KB"
51
54
  },
52
55
  {
53
56
  "name": "single-component",
@@ -105,6 +108,7 @@
105
108
  "scripts": {
106
109
  "build": "pnpm run check:types && vite build",
107
110
  "build:watch": "vite build --watch",
111
+ "analyze": "vite build --config vite-analyze.config.ts",
108
112
  "check:types": "tsc --noEmit",
109
113
  "clean": "rm -rf dist",
110
114
  "clean:all": "pnpm clean && rm -rf node_modules",