@coinbase/cdp-react 0.0.37 → 0.0.38

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/dist/index.js CHANGED
@@ -1,94 +1,99 @@
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
3
  import { Fund as x, FundFooter as i } from "./components/Fund/index.js";
4
- import { FundModal as s } from "./components/FundModal/index.js";
5
- import { SendTransactionButton as I } from "./components/SendTransactionButton/index.js";
4
+ import { FundModal as c } from "./components/FundModal/index.js";
5
+ import { SendTransactionButton as u } from "./components/SendTransactionButton/index.js";
6
6
  import { SignIn as l } from "./components/SignIn/index.js";
7
- import { useSignInReducer as S } from "./components/SignIn/useSignInReducer.js";
8
- import { SignOutButton as h } from "./components/SignOutButton/index.js";
9
- import { SignInModal as C } from "./components/SignInModal/index.js";
10
- import { ThemeProvider as k, useTheme as A } from "./components/ThemeProvider/index.js";
11
- import { cssVariables as E } from "./theme/cssVariables.js";
12
- import { theme as v } from "./theme/theme.js";
13
- import { colors as D, colorsBase as P, colorsComponents as b, colorsSemantic as O, font as U, tokens as V } from "./theme/tokens.js";
14
- import { flattenTokensObject as L, themeToCssVariables as R } from "./theme/utils.js";
15
- import { IconArrowLeft as N } from "./icons/IconArrowLeft.js";
16
- import { IconArrowsUpDown as _ } 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 xo } from "./utils/clamp.js";
27
- import { getMessageFromUnknownError as co } from "./utils/getMessageFromUnknownError.js";
28
- import { isApiError as ao } from "./utils/isApiError.js";
29
- import { isEmailInvalid as uo } from "./utils/isEmailInvalid.js";
30
- import { parseValuesFromPhoneNumber as go } from "./utils/parseValuesFromPhoneNumber.js";
31
- import { FundForm as ho } from "./components/Fund/FundForm.js";
32
- import { FundTitle as Co } from "./components/Fund/FundTitle.js";
33
- import { useFundContext as ko } from "./components/Fund/FundProvider.js";
34
- import { SignInAuthMethodButtons as Bo } from "./components/SignIn/SignInAuthMethodButtons.js";
35
- import { SignInBackButton as Mo } from "./components/SignIn/SignInBackButton.js";
36
- import { SignInDescription as wo } from "./components/SignIn/SignInDescription.js";
37
- import { SignInFooter as Po } from "./components/SignIn/SignInFooter.js";
38
- import { SignInForm as Oo } from "./components/SignIn/SignInForm.js";
39
- import { SignInImage as Vo } from "./components/SignIn/SignInImage.js";
40
- import { SignInTitle as Lo } from "./components/SignIn/SignInTitle.js";
41
- import { useSignInContext as jo } from "./components/SignIn/SignInProvider.js";
7
+ import { useSignInReducer as g } from "./components/SignIn/useSignInReducer.js";
8
+ import { SignOutButton as C } from "./components/SignOutButton/index.js";
9
+ import { SignInModal as F } from "./components/SignInModal/index.js";
10
+ import { ThemeProvider as k, useTheme as b } from "./components/ThemeProvider/index.js";
11
+ import { cssVariables as B } from "./theme/cssVariables.js";
12
+ import { theme as M } from "./theme/theme.js";
13
+ import { borderRadius as w, borderRadiusComponents as D, borderRadiusSemantic as P, colors as R, colorsBase as O, colorsComponents as U, colorsSemantic as V, font as H, fontComponents as L, fontSemantic as j, tokens as N } from "./theme/tokens.js";
14
+ import { flattenTokensObject as _, themeToCssVariables as q } from "./theme/utils.js";
15
+ import { IconArrowLeft as z } from "./icons/IconArrowLeft.js";
16
+ import { IconArrowsUpDown as J } from "./icons/IconArrowsUpDown.js";
17
+ import { IconCheck as Q } from "./icons/IconCheck.js";
18
+ import { IconCheckCircle as Y } from "./icons/IconCheckCircle.js";
19
+ import { IconChevronDown as $ } from "./icons/IconChevronDown.js";
20
+ import { IconEnvelope as ro } from "./icons/IconEnvelope.js";
21
+ import { IconExclamationCircle as to } from "./icons/IconExclamationCircle.js";
22
+ import { IconExclamationTriangle as mo } from "./icons/IconExclamationTriangle.js";
23
+ import { IconLock as fo } from "./icons/IconLock.js";
24
+ import { IconPhone as io } from "./icons/IconPhone.js";
25
+ import { IconXMark as co } from "./icons/IconXMark.js";
26
+ import { clamp as uo } from "./utils/clamp.js";
27
+ import { getMessageFromUnknownError as lo } from "./utils/getMessageFromUnknownError.js";
28
+ import { isApiError as So } from "./utils/isApiError.js";
29
+ import { isEmailInvalid as ho } from "./utils/isEmailInvalid.js";
30
+ import { parseValuesFromPhoneNumber as To } from "./utils/parseValuesFromPhoneNumber.js";
31
+ import { FundForm as bo } from "./components/Fund/FundForm.js";
32
+ import { FundTitle as Bo } from "./components/Fund/FundTitle.js";
33
+ import { useFundContext as Mo } from "./components/Fund/FundProvider.js";
34
+ import { SignInAuthMethodButtons as wo } from "./components/SignIn/SignInAuthMethodButtons.js";
35
+ import { SignInBackButton as Po } from "./components/SignIn/SignInBackButton.js";
36
+ import { SignInDescription as Oo } from "./components/SignIn/SignInDescription.js";
37
+ import { SignInFooter as Vo } from "./components/SignIn/SignInFooter.js";
38
+ import { SignInForm as Lo } from "./components/SignIn/SignInForm.js";
39
+ import { SignInImage as No } from "./components/SignIn/SignInImage.js";
40
+ import { SignInTitle as _o } from "./components/SignIn/SignInTitle.js";
41
+ import { useSignInContext as yo } from "./components/SignIn/SignInProvider.js";
42
42
  export {
43
43
  e as AUTH_METHODS,
44
44
  p as AuthButton,
45
45
  t as CDPReactProvider,
46
46
  x as Fund,
47
47
  i as FundFooter,
48
- ho as FundForm,
49
- s as FundModal,
50
- Co as FundTitle,
51
- N as IconArrowLeft,
52
- _ as IconArrowsUpDown,
53
- y as IconCheck,
54
- G as IconCheckCircle,
55
- K as IconChevronDown,
56
- W as IconEnvelope,
57
- Z as IconExclamationCircle,
58
- oo as IconExclamationTriangle,
59
- eo as IconLock,
60
- no as IconPhone,
61
- po as IconXMark,
62
- I as SendTransactionButton,
48
+ bo as FundForm,
49
+ c as FundModal,
50
+ Bo as FundTitle,
51
+ z as IconArrowLeft,
52
+ J as IconArrowsUpDown,
53
+ Q as IconCheck,
54
+ Y as IconCheckCircle,
55
+ $ as IconChevronDown,
56
+ ro as IconEnvelope,
57
+ to as IconExclamationCircle,
58
+ mo as IconExclamationTriangle,
59
+ fo as IconLock,
60
+ io as IconPhone,
61
+ co as IconXMark,
62
+ u as SendTransactionButton,
63
63
  l as SignIn,
64
- Bo as SignInAuthMethodButtons,
65
- Mo as SignInBackButton,
66
- wo as SignInDescription,
67
- Po as SignInFooter,
68
- Oo as SignInForm,
69
- Vo as SignInImage,
70
- C as SignInModal,
71
- Lo as SignInTitle,
72
- h as SignOutButton,
64
+ wo as SignInAuthMethodButtons,
65
+ Po as SignInBackButton,
66
+ Oo as SignInDescription,
67
+ Vo as SignInFooter,
68
+ Lo as SignInForm,
69
+ No as SignInImage,
70
+ F as SignInModal,
71
+ _o as SignInTitle,
72
+ C as SignOutButton,
73
73
  k as ThemeProvider,
74
- xo as clamp,
75
- D as colors,
76
- P as colorsBase,
77
- b as colorsComponents,
78
- O as colorsSemantic,
79
- E as cssVariables,
80
- L as flattenTokensObject,
81
- U as font,
82
- co as getMessageFromUnknownError,
83
- ao as isApiError,
84
- uo as isEmailInvalid,
85
- go as parseValuesFromPhoneNumber,
86
- v as theme,
87
- R as themeToCssVariables,
88
- V as tokens,
74
+ w as borderRadius,
75
+ D as borderRadiusComponents,
76
+ P as borderRadiusSemantic,
77
+ uo as clamp,
78
+ R as colors,
79
+ O as colorsBase,
80
+ U as colorsComponents,
81
+ V as colorsSemantic,
82
+ B as cssVariables,
83
+ _ as flattenTokensObject,
84
+ H as font,
85
+ L as fontComponents,
86
+ j as fontSemantic,
87
+ lo as getMessageFromUnknownError,
88
+ So as isApiError,
89
+ ho as isEmailInvalid,
90
+ To as parseValuesFromPhoneNumber,
91
+ M as theme,
92
+ q as themeToCssVariables,
93
+ N as tokens,
89
94
  n as useAppConfig,
90
- ko as useFundContext,
91
- jo as useSignInContext,
92
- S as useSignInReducer,
93
- A as useTheme
95
+ Mo as useFundContext,
96
+ yo as useSignInContext,
97
+ g as useSignInReducer,
98
+ b as useTheme
94
99
  };
@@ -1,16 +1,21 @@
1
1
  import { cssVariables as r } from "./cssVariables.js";
2
2
  import { theme as t } from "./theme.js";
3
- import { colors as a, colorsBase as c, colorsComponents as l, colorsSemantic as n, font as f, tokens as p } from "./tokens.js";
4
- import { flattenTokensObject as b, themeToCssVariables as i } from "./utils.js";
3
+ import { borderRadius as a, borderRadiusComponents as m, borderRadiusSemantic as c, colors as f, colorsBase as i, colorsComponents as l, colorsSemantic as p, font as b, fontComponents as d, fontSemantic as x, tokens as C } from "./tokens.js";
4
+ import { flattenTokensObject as R, themeToCssVariables as S } from "./utils.js";
5
5
  export {
6
- a as colors,
7
- c as colorsBase,
6
+ a as borderRadius,
7
+ m as borderRadiusComponents,
8
+ c as borderRadiusSemantic,
9
+ f as colors,
10
+ i as colorsBase,
8
11
  l as colorsComponents,
9
- n as colorsSemantic,
12
+ p as colorsSemantic,
10
13
  r as cssVariables,
11
- b as flattenTokensObject,
12
- f as font,
14
+ R as flattenTokensObject,
15
+ b as font,
16
+ d as fontComponents,
17
+ x as fontSemantic,
13
18
  t as theme,
14
- i as themeToCssVariables,
15
- p as tokens
19
+ S as themeToCssVariables,
20
+ C as tokens
16
21
  };
@@ -1,6 +1,69 @@
1
- import { colorsSemantic, colorsComponents, font } from './tokens';
1
+ import { borderRadiusSemantic, borderRadiusComponents, colorsSemantic, colorsComponents, fontSemantic, fontComponents } from './tokens';
2
2
  import { Flattened } from './utils';
3
3
  export declare const theme: Flattened<{
4
+ borderRadius: {
5
+ readonly cta: {
6
+ readonly value: "{borderRadius.full}";
7
+ };
8
+ readonly input: {
9
+ readonly value: "{borderRadius.sm}";
10
+ };
11
+ readonly link: {
12
+ readonly value: "{borderRadius.full}";
13
+ };
14
+ readonly modal: {
15
+ readonly value: "{borderRadius.sm}";
16
+ };
17
+ readonly select: {
18
+ readonly trigger: {
19
+ readonly value: "{borderRadius.sm}";
20
+ };
21
+ readonly list: {
22
+ readonly value: "{borderRadius.sm}";
23
+ };
24
+ };
25
+ readonly none: {
26
+ readonly value: 0;
27
+ };
28
+ readonly xs: {
29
+ readonly value: "{font.size.base}";
30
+ readonly modify: {
31
+ readonly type: "multiply";
32
+ readonly value: 0.25;
33
+ };
34
+ };
35
+ readonly sm: {
36
+ readonly value: "{font.size.base}";
37
+ readonly modify: {
38
+ readonly type: "multiply";
39
+ readonly value: 0.5;
40
+ };
41
+ };
42
+ readonly md: {
43
+ readonly value: "{font.size.base}";
44
+ readonly modify: {
45
+ readonly type: "multiply";
46
+ readonly value: 0.75;
47
+ };
48
+ };
49
+ readonly lg: {
50
+ readonly value: "{font.size.base}";
51
+ readonly modify: {
52
+ readonly type: "multiply";
53
+ readonly value: 1;
54
+ };
55
+ };
56
+ readonly xl: {
57
+ readonly value: "{font.size.base}";
58
+ readonly modify: {
59
+ readonly type: "multiply";
60
+ readonly value: 1.5;
61
+ };
62
+ };
63
+ readonly full: {
64
+ readonly value: 99999;
65
+ };
66
+ };
4
67
  colors: {
5
68
  readonly page: {
6
69
  readonly bg: {
@@ -31,14 +94,14 @@ export declare const theme: Flattened<{
31
94
  readonly hover: {
32
95
  readonly value: "{colors.bg.primary}";
33
96
  readonly modify: {
34
- readonly type: "mix";
97
+ readonly type: "color-mix";
35
98
  readonly value: readonly [readonly ["{colors.bg.contrast}", "15%"]];
36
99
  };
37
100
  };
38
101
  readonly pressed: {
39
102
  readonly value: "{colors.bg.primary}";
40
103
  readonly modify: {
41
- readonly type: "mix";
104
+ readonly type: "color-mix";
42
105
  readonly value: readonly [readonly ["{colors.bg.contrast}", "30%"]];
43
106
  };
44
107
  };
@@ -65,14 +128,14 @@ export declare const theme: Flattened<{
65
128
  readonly hover: {
66
129
  readonly value: "{colors.bg.secondary}";
67
130
  readonly modify: {
68
- readonly type: "mix";
131
+ readonly type: "color-mix";
69
132
  readonly value: readonly [readonly ["{colors.bg.contrast}", "10%"]];
70
133
  };
71
134
  };
72
135
  readonly pressed: {
73
136
  readonly value: "{colors.bg.secondary}";
74
137
  readonly modify: {
75
- readonly type: "mix";
138
+ readonly type: "color-mix";
76
139
  readonly value: readonly [readonly ["{colors.bg.contrast}", "20%"]];
77
140
  };
78
141
  };
@@ -101,14 +164,14 @@ export declare const theme: Flattened<{
101
164
  readonly hover: {
102
165
  readonly value: "{colors.fg.primary}";
103
166
  readonly modify: {
104
- readonly type: "mix";
167
+ readonly type: "color-mix";
105
168
  readonly value: readonly [readonly ["{colors.bg.contrast}", "15%"]];
106
169
  };
107
170
  };
108
171
  readonly pressed: {
109
172
  readonly value: "{colors.fg.primary}";
110
173
  readonly modify: {
111
- readonly type: "mix";
174
+ readonly type: "color-mix";
112
175
  readonly value: readonly [readonly ["{colors.bg.contrast}", "30%"]];
113
176
  };
114
177
  };
@@ -122,14 +185,14 @@ export declare const theme: Flattened<{
122
185
  readonly hover: {
123
186
  readonly value: "{colors.fg.default}";
124
187
  readonly modify: {
125
- readonly type: "mix";
188
+ readonly type: "color-mix";
126
189
  readonly value: readonly [readonly ["{colors.bg.contrast}", "10%"]];
127
190
  };
128
191
  };
129
192
  readonly pressed: {
130
193
  readonly value: "{colors.fg.default}";
131
194
  readonly modify: {
132
- readonly type: "mix";
195
+ readonly type: "color-mix";
133
196
  readonly value: readonly [readonly ["{colors.bg.contrast}", "20%"]];
134
197
  };
135
198
  };
@@ -196,14 +259,14 @@ export declare const theme: Flattened<{
196
259
  readonly hover: {
197
260
  readonly value: "{colors.bg.default}";
198
261
  readonly modify: {
199
- readonly type: "mix";
262
+ readonly type: "color-mix";
200
263
  readonly value: readonly [readonly ["{colors.bg.contrast}", "5%"]];
201
264
  };
202
265
  };
203
266
  readonly pressed: {
204
267
  readonly value: "{colors.bg.default}";
205
268
  readonly modify: {
206
- readonly type: "mix";
269
+ readonly type: "color-mix";
207
270
  readonly value: readonly [readonly ["{colors.bg.contrast}", "7%"]];
208
271
  };
209
272
  };
@@ -271,7 +334,7 @@ export declare const theme: Flattened<{
271
334
  readonly highlight: {
272
335
  readonly value: "{colors.bg.default}";
273
336
  readonly modify: {
274
- readonly type: "mix";
337
+ readonly type: "color-mix";
275
338
  readonly value: readonly [readonly ["{colors.bg.contrast}", "10%"]];
276
339
  };
277
340
  };
@@ -323,14 +386,14 @@ export declare const theme: Flattened<{
323
386
  readonly overlay: {
324
387
  readonly value: "{colors.bg.alternate}";
325
388
  readonly modify: {
326
- readonly type: "alpha";
389
+ readonly type: "color-alpha";
327
390
  readonly value: 0.33;
328
391
  };
329
392
  };
330
393
  readonly skeleton: {
331
394
  readonly value: "{colors.fg.default}";
332
395
  readonly modify: {
333
- readonly type: "alpha";
396
+ readonly type: "color-alpha";
334
397
  readonly value: 0.1;
335
398
  };
336
399
  };
@@ -387,12 +450,36 @@ export declare const theme: Flattened<{
387
450
  };
388
451
  font: {
389
452
  readonly family: {
453
+ readonly page: {
454
+ readonly value: "{font.family.body}";
455
+ };
456
+ readonly cta: {
457
+ readonly value: "{font.family.interactive}";
458
+ };
459
+ readonly link: {
460
+ readonly value: "{font.family.interactive}";
461
+ };
462
+ readonly input: {
463
+ readonly value: "{font.family.interactive}";
464
+ };
465
+ readonly select: {
466
+ readonly value: "{font.family.interactive}";
467
+ };
468
+ readonly code: {
469
+ readonly value: "{font.family.mono}";
470
+ };
390
471
  readonly mono: {
391
472
  readonly value: "\"DM Mono\", monospace";
392
473
  };
393
474
  readonly sans: {
394
475
  readonly value: "\"Rethink Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
395
476
  };
477
+ readonly body: {
478
+ readonly value: "{font.family.sans}";
479
+ };
480
+ readonly interactive: {
481
+ readonly value: "{font.family.sans}";
482
+ };
396
483
  };
397
484
  readonly size: {
398
485
  readonly base: {
@@ -407,11 +494,22 @@ export type SemanticColors = Flattened<{
407
494
  export type ComponentColors = Flattened<{
408
495
  colors: typeof colorsComponents;
409
496
  }>;
410
- export type FontTokens = Flattened<{
411
- font: typeof font;
412
- }>;
413
497
  export type ColorTokens = SemanticColors & ComponentColors;
414
- export type Theme = ColorTokens & FontTokens;
498
+ export type SemanticFonts = Flattened<{
499
+ font: typeof fontSemantic;
500
+ }>;
501
+ export type ComponentFonts = Flattened<{
502
+ font: typeof fontComponents;
503
+ }>;
504
+ export type FontTokens = SemanticFonts & ComponentFonts;
505
+ export type SemanticBorderRadius = Flattened<{
506
+ borderRadius: typeof borderRadiusSemantic;
507
+ }>;
508
+ export type ComponentBorderRadius = Flattened<{
509
+ borderRadius: typeof borderRadiusComponents;
510
+ }>;
511
+ export type BorderRadiusTokens = SemanticBorderRadius & ComponentBorderRadius;
512
+ export type Theme = ColorTokens & FontTokens & BorderRadiusTokens;
415
513
  export type ButtonVariant = "primary" | "secondary" | "linkPrimary" | "linkSecondary" | "transparentPrimary" | "transparentSecondary" | "control";
416
514
  export type Size = "lg" | "md" | "sm" | "xs";
417
515
  export type ButtonSize = Size | "none";