@coinbase/cdp-react 0.0.11 → 0.0.13

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 (46) hide show
  1. package/README.md +4 -4
  2. package/dist/assets/Button.css +1 -1
  3. package/dist/assets/Error.css +1 -1
  4. package/dist/assets/Field.css +1 -1
  5. package/dist/assets/Input.css +1 -1
  6. package/dist/assets/LoadingSkeleton.css +1 -1
  7. package/dist/assets/LoadingSpinner.css +1 -1
  8. package/dist/assets/OTP.css +1 -1
  9. package/dist/assets/SignIn.css +1 -1
  10. package/dist/assets/SignInDescription.css +1 -0
  11. package/dist/assets/SignInForm.css +1 -0
  12. package/dist/assets/SignInImage.css +1 -0
  13. package/dist/assets/SignInModal.css +1 -1
  14. package/dist/assets/SignInTitle.css +1 -0
  15. package/dist/assets/SignOutButton.css +1 -1
  16. package/dist/assets/VisuallyHidden.css +1 -1
  17. package/dist/components/AuthButton/index.d.ts +7 -1
  18. package/dist/components/AuthButton/index.js +51 -31
  19. package/dist/components/Button/index.js +38 -22
  20. package/dist/components/Field/index.js +11 -11
  21. package/dist/components/LoadingSpinner/index.js +7 -7
  22. package/dist/components/OTP/index.js +26 -25
  23. package/dist/components/SignIn/SignInDescription.js +20 -18
  24. package/dist/components/SignIn/SignInForm.js +111 -100
  25. package/dist/components/SignIn/SignInImage.js +13 -11
  26. package/dist/components/SignIn/SignInTitle.js +12 -11
  27. package/dist/components/SignIn/index.js +22 -21
  28. package/dist/components/SignInModal/index.js +30 -30
  29. package/dist/components/SignOutButton/index.js +8 -8
  30. package/dist/components/ThemeProvider/index.d.ts +1 -3
  31. package/dist/components/ThemeProvider/index.js +7 -7
  32. package/dist/components/VisuallyHidden/index.js +4 -4
  33. package/dist/icons/IconCoinbaseWordmark.js +5 -5
  34. package/dist/index.js +45 -39
  35. package/dist/theme/cssVariables.d.ts +5 -0
  36. package/dist/theme/cssVariables.js +10 -0
  37. package/dist/theme/index.d.ts +1 -0
  38. package/dist/theme/index.js +14 -8
  39. package/dist/theme/theme.d.ts +237 -33
  40. package/dist/theme/theme.js +3 -3
  41. package/dist/theme/tokens.d.ts +679 -45
  42. package/dist/theme/tokens.js +142 -43
  43. package/dist/theme/utils.d.ts +14 -2
  44. package/dist/theme/utils.js +23 -14
  45. package/package.json +9 -5
  46. package/dist/chunks/SignIn.module.Dl3CqKQ_.js +0 -20
package/dist/index.js CHANGED
@@ -1,48 +1,54 @@
1
1
  import { CDPReactProvider as e, useAppConfig as t } from "./components/CDPReactProvider/index.js";
2
2
  import { AuthButton as m } from "./components/AuthButton/index.js";
3
- import { SignIn as f } from "./components/SignIn/index.js";
3
+ import { SignIn as i } from "./components/SignIn/index.js";
4
4
  import { useSignInReducer as x } from "./components/SignIn/useSignInReducer.js";
5
- import { SignOutButton as I } from "./components/SignOutButton/index.js";
6
- import { SignInModal as a } from "./components/SignInModal/index.js";
7
- import { ThemeProvider as l, useTheme as u } from "./components/ThemeProvider/index.js";
8
- import { flattenedTheme as C } from "./theme/theme.js";
9
- import { colors as h, tokens as T } from "./theme/tokens.js";
10
- import { flattenTokensObject as v, themeToCssVariables as A } from "./theme/utils.js";
11
- import { IconCheckCircle as P } from "./icons/IconCheckCircle.js";
12
- import { IconExclamationCircle as B } from "./icons/IconExclamationCircle.js";
13
- import { IconLock as M } from "./icons/IconLock.js";
14
- import { IconXMark as R } from "./icons/IconXMark.js";
15
- import { isEmailInvalid as F } from "./utils/isEmailInvalid.js";
16
- import { isApiError as V } from "./utils/isApiError.js";
17
- import { SignInDescription as q } from "./components/SignIn/SignInDescription.js";
18
- import { SignInForm as y } from "./components/SignIn/SignInForm.js";
19
- import { SignInImage as G } from "./components/SignIn/SignInImage.js";
20
- import { SignInTitle as J } from "./components/SignIn/SignInTitle.js";
21
- import { useSignInContext as N } from "./components/SignIn/SignInProvider.js";
5
+ import { SignOutButton as c } from "./components/SignOutButton/index.js";
6
+ import { SignInModal as l } from "./components/SignInModal/index.js";
7
+ import { ThemeProvider as g, useTheme as S } from "./components/ThemeProvider/index.js";
8
+ import { cssVariables as C } from "./theme/cssVariables.js";
9
+ import { theme as d } from "./theme/theme.js";
10
+ import { colors as T, colorsBase as b, colorsComponents as v, colorsSemantic as A, font as B, tokens as E } from "./theme/tokens.js";
11
+ import { flattenTokensObject as D, themeToCssVariables as M } from "./theme/utils.js";
12
+ import { IconCheckCircle as R } from "./icons/IconCheckCircle.js";
13
+ import { IconExclamationCircle as j } from "./icons/IconExclamationCircle.js";
14
+ import { IconLock as L } from "./icons/IconLock.js";
15
+ import { IconXMark as q } from "./icons/IconXMark.js";
16
+ import { isEmailInvalid as y } from "./utils/isEmailInvalid.js";
17
+ import { isApiError as G } from "./utils/isApiError.js";
18
+ import { SignInDescription as J } from "./components/SignIn/SignInDescription.js";
19
+ import { SignInForm as N } from "./components/SignIn/SignInForm.js";
20
+ import { SignInImage as U } from "./components/SignIn/SignInImage.js";
21
+ import { SignInTitle as Y } from "./components/SignIn/SignInTitle.js";
22
+ import { useSignInContext as _ } from "./components/SignIn/SignInProvider.js";
22
23
  export {
23
24
  m as AuthButton,
24
25
  e as CDPReactProvider,
25
- P as IconCheckCircle,
26
- B as IconExclamationCircle,
27
- M as IconLock,
28
- R as IconXMark,
29
- f as SignIn,
30
- q as SignInDescription,
31
- y as SignInForm,
32
- G as SignInImage,
33
- a as SignInModal,
34
- J as SignInTitle,
35
- I as SignOutButton,
36
- l as ThemeProvider,
37
- h as colors,
38
- v as flattenTokensObject,
39
- C as flattenedTheme,
40
- V as isApiError,
41
- F as isEmailInvalid,
42
- A as themeToCssVariables,
43
- T as tokens,
26
+ R as IconCheckCircle,
27
+ j as IconExclamationCircle,
28
+ L as IconLock,
29
+ q as IconXMark,
30
+ i as SignIn,
31
+ J as SignInDescription,
32
+ N as SignInForm,
33
+ U as SignInImage,
34
+ l as SignInModal,
35
+ Y as SignInTitle,
36
+ c as SignOutButton,
37
+ g as ThemeProvider,
38
+ T as colors,
39
+ b as colorsBase,
40
+ v as colorsComponents,
41
+ A as colorsSemantic,
42
+ C as cssVariables,
43
+ D as flattenTokensObject,
44
+ B as font,
45
+ G as isApiError,
46
+ y as isEmailInvalid,
47
+ d as theme,
48
+ M as themeToCssVariables,
49
+ E as tokens,
44
50
  t as useAppConfig,
45
- N as useSignInContext,
51
+ _ as useSignInContext,
46
52
  x as useSignInReducer,
47
- u as useTheme
53
+ S as useTheme
48
54
  };
@@ -0,0 +1,5 @@
1
+ export declare const cssVariables: import('./utils').CDPWebCSSVariables;
2
+ declare const _default: {
3
+ customProperties: import('./utils').CDPWebCSSVariables;
4
+ };
5
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { theme as s } from "./theme.js";
2
+ import { themeToCssVariables as e } from "./utils.js";
3
+ import "./tokens.js";
4
+ const o = e(s), m = {
5
+ customProperties: o
6
+ };
7
+ export {
8
+ o as cssVariables,
9
+ m as default
10
+ };
@@ -1,3 +1,4 @@
1
+ export { cssVariables } from './cssVariables';
1
2
  export * from './theme';
2
3
  export * from './tokens';
3
4
  export * from './utils';
@@ -1,10 +1,16 @@
1
- import { flattenedTheme as t } from "./theme.js";
2
- import { colors as s, tokens as f } from "./tokens.js";
3
- import { flattenTokensObject as a, themeToCssVariables as l } from "./utils.js";
1
+ import { cssVariables as r } from "./cssVariables.js";
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";
4
5
  export {
5
- s as colors,
6
- a as flattenTokensObject,
7
- t as flattenedTheme,
8
- l as themeToCssVariables,
9
- f as tokens
6
+ a as colors,
7
+ c as colorsBase,
8
+ l as colorsComponents,
9
+ n as colorsSemantic,
10
+ r as cssVariables,
11
+ b as flattenTokensObject,
12
+ f as font,
13
+ t as theme,
14
+ i as themeToCssVariables,
15
+ p as tokens
10
16
  };
@@ -1,38 +1,242 @@
1
- export declare const flattenedTheme: import('./utils').Flattened<{
1
+ import { colorsSemantic, colorsComponents, font } from './tokens';
2
+ import { Flattened } from './utils';
3
+ export declare const theme: Flattened<{
2
4
  colors: {
3
- error: string;
4
- success: string;
5
- background: string;
6
- backgroundOverlay: string;
7
- backgroundSkeleton: string;
8
- text: string;
9
- textSecondary: string;
10
- primary: string;
11
- primaryText: string;
12
- primaryHoverBackground: string;
13
- primaryHoverText: string;
14
- primaryFocusRing: string;
15
- secondary: string;
16
- secondaryText: string;
17
- secondaryHoverBackground: string;
18
- secondaryHoverText: string;
19
- secondaryFocusRing: string;
20
- linkText: string;
21
- linkHover: string;
22
- linkSecondaryText: string;
23
- linkSecondaryHover: string;
24
- border: string;
25
- inputBackground: string;
26
- inputBorder: string;
27
- inputFocusBorder: string;
28
- inputLabel: string;
29
- inputPlaceholder: string;
30
- inputText: string;
5
+ readonly page: {
6
+ readonly bg: {
7
+ readonly default: {
8
+ readonly value: "{colors.bg.default}";
9
+ };
10
+ };
11
+ readonly border: {
12
+ readonly default: {
13
+ readonly value: "{colors.line.default}";
14
+ };
15
+ };
16
+ readonly text: {
17
+ readonly default: {
18
+ readonly value: "{colors.fg.default}";
19
+ };
20
+ readonly muted: {
21
+ readonly value: "{colors.fg.muted}";
22
+ };
23
+ };
24
+ };
25
+ readonly cta: {
26
+ readonly primary: {
27
+ readonly bg: {
28
+ readonly default: {
29
+ readonly value: "{colors.bg.primary}";
30
+ };
31
+ readonly hover: {
32
+ readonly value: "{colors.bg.primary}";
33
+ readonly modify: {
34
+ readonly type: "alpha";
35
+ readonly value: "0.9";
36
+ };
37
+ };
38
+ };
39
+ readonly border: {
40
+ readonly focus: {
41
+ readonly value: "{colors.line.primary}";
42
+ };
43
+ };
44
+ readonly text: {
45
+ readonly default: {
46
+ readonly value: "{colors.fg.onPrimary}";
47
+ };
48
+ readonly hover: {
49
+ readonly value: "{colors.fg.onPrimary}";
50
+ };
51
+ };
52
+ };
53
+ readonly secondary: {
54
+ readonly bg: {
55
+ readonly default: {
56
+ readonly value: "{colors.bg.secondary}";
57
+ };
58
+ readonly hover: {
59
+ readonly value: "{colors.bg.secondary}";
60
+ readonly modify: {
61
+ readonly type: "alpha";
62
+ readonly value: "0.9";
63
+ };
64
+ };
65
+ };
66
+ readonly border: {
67
+ readonly focus: {
68
+ readonly value: "{colors.line.primary}";
69
+ };
70
+ };
71
+ readonly text: {
72
+ readonly default: {
73
+ readonly value: "{colors.fg.onSecondary}";
74
+ };
75
+ readonly hover: {
76
+ readonly value: "{colors.fg.onSecondary}";
77
+ };
78
+ };
79
+ };
80
+ };
81
+ readonly link: {
82
+ readonly primary: {
83
+ readonly text: {
84
+ readonly default: {
85
+ readonly value: "{colors.fg.primary}";
86
+ };
87
+ readonly hover: {
88
+ readonly value: "{colors.fg.primary}";
89
+ readonly modify: {
90
+ readonly type: "alpha";
91
+ readonly value: "0.9";
92
+ };
93
+ };
94
+ };
95
+ };
96
+ readonly secondary: {
97
+ readonly text: {
98
+ readonly default: {
99
+ readonly value: "{colors.fg.default}";
100
+ };
101
+ readonly hover: {
102
+ readonly value: "{colors.fg.default}";
103
+ readonly modify: {
104
+ readonly type: "alpha";
105
+ readonly value: "0.9";
106
+ };
107
+ };
108
+ };
109
+ };
110
+ };
111
+ readonly input: {
112
+ readonly bg: {
113
+ readonly default: {
114
+ readonly value: "{colors.bg.default}";
115
+ };
116
+ };
117
+ readonly border: {
118
+ readonly default: {
119
+ readonly value: "{colors.line.heavy}";
120
+ };
121
+ readonly focus: {
122
+ readonly value: "{colors.line.primary}";
123
+ };
124
+ readonly error: {
125
+ readonly value: "{colors.line.negative}";
126
+ };
127
+ };
128
+ readonly label: {
129
+ readonly default: {
130
+ readonly value: "{colors.fg.default}";
131
+ };
132
+ };
133
+ readonly placeholder: {
134
+ readonly default: {
135
+ readonly value: "{colors.fg.muted}";
136
+ };
137
+ };
138
+ readonly text: {
139
+ readonly default: {
140
+ readonly value: "{colors.fg.default}";
141
+ };
142
+ };
143
+ readonly errorText: {
144
+ readonly default: {
145
+ readonly value: "{colors.fg.negative}";
146
+ };
147
+ };
148
+ };
149
+ readonly bg: {
150
+ readonly default: {
151
+ readonly value: "#ffffff";
152
+ };
153
+ readonly alternate: {
154
+ readonly value: "#eef0f3";
155
+ };
156
+ readonly overlay: {
157
+ readonly value: "{colors.bg.alternate}";
158
+ readonly modify: {
159
+ readonly type: "alpha";
160
+ readonly value: 0.33;
161
+ };
162
+ };
163
+ readonly skeleton: {
164
+ readonly value: "{colors.fg.default}";
165
+ readonly modify: {
166
+ readonly type: "alpha";
167
+ readonly value: 0.1;
168
+ };
169
+ };
170
+ readonly primary: {
171
+ readonly value: "#0052ff";
172
+ };
173
+ readonly secondary: {
174
+ readonly value: "#eef0f3";
175
+ };
176
+ };
177
+ readonly fg: {
178
+ readonly default: {
179
+ readonly value: "#0a0b0d";
180
+ };
181
+ readonly muted: {
182
+ readonly value: "#5b616e";
183
+ };
184
+ readonly primary: {
185
+ readonly value: "#0052ff";
186
+ };
187
+ readonly onPrimary: {
188
+ readonly value: "#ffffff";
189
+ };
190
+ readonly onSecondary: {
191
+ readonly value: "#0a0b0d";
192
+ };
193
+ readonly positive: {
194
+ readonly value: "#008531";
195
+ };
196
+ readonly negative: {
197
+ readonly value: "#cf202f";
198
+ };
199
+ };
200
+ readonly line: {
201
+ readonly default: {
202
+ readonly value: "#dcdfe4";
203
+ };
204
+ readonly heavy: {
205
+ readonly value: "#9397a0";
206
+ };
207
+ readonly primary: {
208
+ readonly value: "{colors.fg.primary}";
209
+ };
210
+ readonly positive: {
211
+ readonly value: "{colors.fg.positive}";
212
+ };
213
+ readonly negative: {
214
+ readonly value: "{colors.fg.negative}";
215
+ };
216
+ };
31
217
  };
32
- fontFamily: {
33
- sans: string;
218
+ font: {
219
+ readonly family: {
220
+ readonly sans: {
221
+ readonly value: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
222
+ };
223
+ };
224
+ readonly size: {
225
+ readonly base: {
226
+ readonly value: 16;
227
+ };
228
+ };
34
229
  };
35
- fontSizeBase: number;
36
230
  }>;
37
- export type Theme = typeof flattenedTheme;
231
+ export type SemanticColors = Flattened<{
232
+ colors: typeof colorsSemantic;
233
+ }>;
234
+ export type ComponentColors = Flattened<{
235
+ colors: typeof colorsComponents;
236
+ }>;
237
+ export type FontTokens = Flattened<{
238
+ font: typeof font;
239
+ }>;
240
+ export type ColorTokens = SemanticColors | ComponentColors;
241
+ export type Theme = ColorTokens & FontTokens;
38
242
  export type ButtonVariant = "primary" | "secondary" | "transparentPrimary" | "transparentSecondary";
@@ -1,6 +1,6 @@
1
1
  import { tokens as t } from "./tokens.js";
2
- import { flattenTokensObject as e } from "./utils.js";
3
- const n = e(t);
2
+ import { flattenTokensObject as o } from "./utils.js";
3
+ const r = o(t);
4
4
  export {
5
- n as flattenedTheme
5
+ r as theme
6
6
  };