@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.
- package/README.md +4 -4
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Error.css +1 -1
- package/dist/assets/Field.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/LoadingSkeleton.css +1 -1
- package/dist/assets/LoadingSpinner.css +1 -1
- package/dist/assets/OTP.css +1 -1
- package/dist/assets/SignIn.css +1 -1
- package/dist/assets/SignInDescription.css +1 -0
- package/dist/assets/SignInForm.css +1 -0
- package/dist/assets/SignInImage.css +1 -0
- package/dist/assets/SignInModal.css +1 -1
- package/dist/assets/SignInTitle.css +1 -0
- package/dist/assets/SignOutButton.css +1 -1
- package/dist/assets/VisuallyHidden.css +1 -1
- package/dist/components/AuthButton/index.d.ts +7 -1
- package/dist/components/AuthButton/index.js +51 -31
- package/dist/components/Button/index.js +38 -22
- package/dist/components/Field/index.js +11 -11
- package/dist/components/LoadingSpinner/index.js +7 -7
- package/dist/components/OTP/index.js +26 -25
- package/dist/components/SignIn/SignInDescription.js +20 -18
- package/dist/components/SignIn/SignInForm.js +111 -100
- package/dist/components/SignIn/SignInImage.js +13 -11
- package/dist/components/SignIn/SignInTitle.js +12 -11
- package/dist/components/SignIn/index.js +22 -21
- package/dist/components/SignInModal/index.js +30 -30
- package/dist/components/SignOutButton/index.js +8 -8
- package/dist/components/ThemeProvider/index.d.ts +1 -3
- package/dist/components/ThemeProvider/index.js +7 -7
- package/dist/components/VisuallyHidden/index.js +4 -4
- package/dist/icons/IconCoinbaseWordmark.js +5 -5
- package/dist/index.js +45 -39
- package/dist/theme/cssVariables.d.ts +5 -0
- package/dist/theme/cssVariables.js +10 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.js +14 -8
- package/dist/theme/theme.d.ts +237 -33
- package/dist/theme/theme.js +3 -3
- package/dist/theme/tokens.d.ts +679 -45
- package/dist/theme/tokens.js +142 -43
- package/dist/theme/utils.d.ts +14 -2
- package/dist/theme/utils.js +23 -14
- package/package.json +9 -5
- package/dist/chunks/SignIn.module.Dl3CqKQ_.js +0 -20
package/dist/theme/tokens.js
CHANGED
|
@@ -14,51 +14,150 @@ const e = {
|
|
|
14
14
|
// contextual
|
|
15
15
|
red500: "#cf202f",
|
|
16
16
|
green500: "#008531"
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
secondary
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
17
|
+
}, a = {
|
|
18
|
+
bg: {
|
|
19
|
+
default: { value: e.white },
|
|
20
|
+
// background
|
|
21
|
+
alternate: { value: e.gray100 },
|
|
22
|
+
// alternate background
|
|
23
|
+
overlay: { value: "{colors.bg.alternate}", modify: { type: "alpha", value: 0.33 } },
|
|
24
|
+
// overlay background
|
|
25
|
+
skeleton: { value: "{colors.fg.default}", modify: { type: "alpha", value: 0.1 } },
|
|
26
|
+
// skeleton background
|
|
27
|
+
primary: { value: e.blue500 },
|
|
28
|
+
// primary color background
|
|
29
|
+
secondary: { value: e.gray100 }
|
|
30
|
+
// secondary color background
|
|
31
|
+
},
|
|
32
|
+
fg: {
|
|
33
|
+
default: { value: e.black },
|
|
34
|
+
// text
|
|
35
|
+
muted: { value: e.gray700 },
|
|
36
|
+
// secondary (muted) text
|
|
37
|
+
primary: { value: e.blue500 },
|
|
38
|
+
// primary color text
|
|
39
|
+
onPrimary: { value: e.white },
|
|
40
|
+
// text on primary color
|
|
41
|
+
onSecondary: { value: e.black },
|
|
42
|
+
// text on secondary color
|
|
43
|
+
positive: { value: e.green500 },
|
|
44
|
+
// positive color text
|
|
45
|
+
negative: { value: e.red500 }
|
|
46
|
+
// negative color text
|
|
47
|
+
},
|
|
48
|
+
line: {
|
|
49
|
+
default: { value: e.gray200 },
|
|
50
|
+
// line color
|
|
51
|
+
heavy: { value: e.gray500 },
|
|
52
|
+
// higher contrast line color
|
|
53
|
+
primary: { value: "{colors.fg.primary}" },
|
|
54
|
+
// primary line color
|
|
55
|
+
positive: { value: "{colors.fg.positive}" },
|
|
56
|
+
// positive line color
|
|
57
|
+
negative: { value: "{colors.fg.negative}" }
|
|
58
|
+
// negative line color
|
|
59
|
+
}
|
|
60
|
+
}, l = {
|
|
61
|
+
page: {
|
|
62
|
+
bg: {
|
|
63
|
+
default: { value: "{colors.bg.default}" }
|
|
64
|
+
},
|
|
65
|
+
border: {
|
|
66
|
+
default: { value: "{colors.line.default}" }
|
|
67
|
+
},
|
|
68
|
+
text: {
|
|
69
|
+
default: { value: "{colors.fg.default}" },
|
|
70
|
+
muted: { value: "{colors.fg.muted}" }
|
|
71
|
+
}
|
|
55
72
|
},
|
|
56
|
-
|
|
57
|
-
|
|
73
|
+
cta: {
|
|
74
|
+
primary: {
|
|
75
|
+
bg: {
|
|
76
|
+
default: { value: "{colors.bg.primary}" },
|
|
77
|
+
hover: { value: "{colors.bg.primary}", modify: { type: "alpha", value: "0.9" } }
|
|
78
|
+
},
|
|
79
|
+
border: {
|
|
80
|
+
focus: { value: "{colors.line.primary}" }
|
|
81
|
+
},
|
|
82
|
+
text: {
|
|
83
|
+
default: { value: "{colors.fg.onPrimary}" },
|
|
84
|
+
hover: { value: "{colors.fg.onPrimary}" }
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
secondary: {
|
|
88
|
+
bg: {
|
|
89
|
+
default: { value: "{colors.bg.secondary}" },
|
|
90
|
+
hover: {
|
|
91
|
+
value: "{colors.bg.secondary}",
|
|
92
|
+
modify: { type: "alpha", value: "0.9" }
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
border: {
|
|
96
|
+
focus: { value: "{colors.line.primary}" }
|
|
97
|
+
},
|
|
98
|
+
text: {
|
|
99
|
+
default: { value: "{colors.fg.onSecondary}" },
|
|
100
|
+
hover: { value: "{colors.fg.onSecondary}" }
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
link: {
|
|
105
|
+
primary: {
|
|
106
|
+
text: {
|
|
107
|
+
default: { value: "{colors.fg.primary}" },
|
|
108
|
+
hover: { value: "{colors.fg.primary}", modify: { type: "alpha", value: "0.9" } }
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
secondary: {
|
|
112
|
+
text: {
|
|
113
|
+
default: { value: "{colors.fg.default}" },
|
|
114
|
+
hover: { value: "{colors.fg.default}", modify: { type: "alpha", value: "0.9" } }
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
input: {
|
|
119
|
+
bg: {
|
|
120
|
+
default: { value: "{colors.bg.default}" }
|
|
121
|
+
},
|
|
122
|
+
border: {
|
|
123
|
+
default: { value: "{colors.line.heavy}" },
|
|
124
|
+
focus: { value: "{colors.line.primary}" },
|
|
125
|
+
error: { value: "{colors.line.negative}" }
|
|
126
|
+
},
|
|
127
|
+
label: {
|
|
128
|
+
default: { value: "{colors.fg.default}" }
|
|
129
|
+
},
|
|
130
|
+
placeholder: {
|
|
131
|
+
default: { value: "{colors.fg.muted}" }
|
|
132
|
+
},
|
|
133
|
+
text: {
|
|
134
|
+
default: { value: "{colors.fg.default}" }
|
|
135
|
+
},
|
|
136
|
+
errorText: {
|
|
137
|
+
default: { value: "{colors.fg.negative}" }
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}, o = {
|
|
141
|
+
...a,
|
|
142
|
+
...l
|
|
143
|
+
}, r = {
|
|
144
|
+
family: {
|
|
145
|
+
sans: {
|
|
146
|
+
value: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
147
|
+
}
|
|
58
148
|
},
|
|
59
|
-
|
|
149
|
+
size: {
|
|
150
|
+
base: { value: 16 }
|
|
151
|
+
}
|
|
152
|
+
}, u = {
|
|
153
|
+
colors: o,
|
|
154
|
+
font: r
|
|
60
155
|
};
|
|
61
156
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
157
|
+
o as colors,
|
|
158
|
+
e as colorsBase,
|
|
159
|
+
l as colorsComponents,
|
|
160
|
+
a as colorsSemantic,
|
|
161
|
+
r as font,
|
|
162
|
+
u as tokens
|
|
64
163
|
};
|
package/dist/theme/utils.d.ts
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
export type KebabCasePaths<T> = T extends Record<string, unknown> ? {
|
|
2
|
-
[K in keyof T]: T[K] extends
|
|
2
|
+
[K in keyof T]: T[K] extends {
|
|
3
|
+
value: unknown;
|
|
4
|
+
} ? K & string : T[K] extends Record<string, unknown> ? `${K & string}-${KebabCasePaths<T[K]> & string}` : K & string;
|
|
3
5
|
}[keyof T] : never;
|
|
4
6
|
export type Flattened<T extends Record<string, unknown>> = {
|
|
5
7
|
[K in KebabCasePaths<T>]: string;
|
|
6
8
|
};
|
|
7
|
-
export
|
|
9
|
+
export type TokenValue = {
|
|
10
|
+
value: string | number;
|
|
11
|
+
modify?: {
|
|
12
|
+
type: "alpha";
|
|
13
|
+
value: number | string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type NestedTokenObject = {
|
|
17
|
+
[key: string]: TokenValue | NestedTokenObject;
|
|
18
|
+
};
|
|
19
|
+
export declare function flattenTokensObject<T extends NestedTokenObject>(tokensObject: T, cssVarPrefix?: string): Flattened<T>;
|
|
8
20
|
export declare const themeToCssVariables: (theme: Record<string, string>) => CDPWebCSSVariables;
|
|
9
21
|
export type CDPWebCSSVariables = {
|
|
10
22
|
[key: `--cdp-web-${string}`]: string;
|
package/dist/theme/utils.js
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
function f(e) {
|
|
2
|
+
return typeof e == "object" && e !== null && "value" in e && (typeof e.value == "string" || typeof e.value == "number");
|
|
3
|
+
}
|
|
4
|
+
function p(e, t = "cdp-web") {
|
|
5
|
+
const n = {};
|
|
6
|
+
function o(u, s) {
|
|
7
|
+
for (const l in u)
|
|
8
|
+
if (Object.prototype.hasOwnProperty.call(u, l)) {
|
|
9
|
+
const c = [...s, l], r = u[l];
|
|
10
|
+
if (f(r)) {
|
|
11
|
+
const i = c.join("-");
|
|
12
|
+
n[i] = a(r, t);
|
|
13
|
+
} else typeof r == "object" && r !== null && o(r, c);
|
|
14
|
+
}
|
|
11
15
|
}
|
|
12
|
-
return
|
|
16
|
+
return o(e, []), n;
|
|
13
17
|
}
|
|
14
|
-
const a = (
|
|
18
|
+
const a = (e, t) => {
|
|
19
|
+
if (typeof e.value == "number")
|
|
20
|
+
return `${e.value}px`;
|
|
21
|
+
const n = e.value.startsWith("{") && e.value.endsWith("}") ? `var(--${t ? `${t}-` : ""}${e.value.slice(1, -1).replace(/\./g, "-")})` : e.value;
|
|
22
|
+
return e.modify?.type === "alpha" ? `color(from ${n} srgb r g b / ${e.modify.value ?? 1})` : n;
|
|
23
|
+
}, y = (e) => Object.entries(e).reduce((t, [n, o]) => (t[`--cdp-web-${n}`] = o, t), {});
|
|
15
24
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
p as flattenTokensObject,
|
|
26
|
+
y as themeToCssVariables
|
|
18
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@radix-ui/react-dialog": "^1.1.14",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
11
|
"react": ">=18.2.0",
|
|
12
|
-
"@coinbase/cdp-
|
|
13
|
-
"@coinbase/cdp-
|
|
12
|
+
"@coinbase/cdp-hooks": "^0.0.13",
|
|
13
|
+
"@coinbase/cdp-core": "^0.0.13"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@size-limit/preset-big-lib": "^11.2.0",
|
|
@@ -25,17 +25,21 @@
|
|
|
25
25
|
"@types/react": "^19.1.0",
|
|
26
26
|
"@types/react-dom": "^19.1.0",
|
|
27
27
|
"@vitejs/plugin-react": "^4.6.0",
|
|
28
|
+
"eslint-plugin-css-modules": "^2.12.0",
|
|
28
29
|
"eslint-plugin-react": "^7.37.5",
|
|
29
30
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
30
31
|
"glob": "^11.0.3",
|
|
31
32
|
"react": "^19.1.0",
|
|
32
33
|
"react-dom": "^19.1.0",
|
|
33
34
|
"size-limit": "^11.2.0",
|
|
35
|
+
"stylelint": "^16.22.0",
|
|
36
|
+
"stylelint-config-standard": "^38.0.0",
|
|
37
|
+
"stylelint-value-no-unknown-custom-properties": "^6.0.1",
|
|
34
38
|
"vite": "^7.0.4",
|
|
35
39
|
"vite-plugin-dts": "^4.5.4",
|
|
36
40
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
37
|
-
"@coinbase/cdp-core": "^0.0.
|
|
38
|
-
"@coinbase/cdp-hooks": "^0.0.
|
|
41
|
+
"@coinbase/cdp-core": "^0.0.13",
|
|
42
|
+
"@coinbase/cdp-hooks": "^0.0.13"
|
|
39
43
|
},
|
|
40
44
|
"size-limit": [
|
|
41
45
|
{
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import '../assets/SignIn.css';const n = "SignIn-module__signIn___cS7KU", _ = "SignIn-module__heading___nzF-H", o = "SignIn-module__description___6bRpF", e = "SignIn-module__medium___rfGKj", r = "SignIn-module__form___MXCq6", s = "SignIn-module__logo___9j5Y-", i = "SignIn-module__formFooter___Rasrs", c = "SignIn-module__serverStateWrapper___GML6w", t = "SignIn-module__loadingSpinner___JnMDX", m = "SignIn-module__serverError___p4Z3K", g = "SignIn-module__resetTimer___s-bUu", d = "SignIn-module__successIcon___2a7me", I = "SignIn-module__footer___3Gkbc", l = "SignIn-module__coinbaseIcon___cOnQb", u = "SignIn-module__hr___WFRgK", S = {
|
|
2
|
-
signIn: n,
|
|
3
|
-
heading: _,
|
|
4
|
-
description: o,
|
|
5
|
-
medium: e,
|
|
6
|
-
form: r,
|
|
7
|
-
logo: s,
|
|
8
|
-
formFooter: i,
|
|
9
|
-
serverStateWrapper: c,
|
|
10
|
-
loadingSpinner: t,
|
|
11
|
-
serverError: m,
|
|
12
|
-
resetTimer: g,
|
|
13
|
-
successIcon: d,
|
|
14
|
-
footer: I,
|
|
15
|
-
coinbaseIcon: l,
|
|
16
|
-
hr: u
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
S as s
|
|
20
|
-
};
|