@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.
- package/README.md +2 -2
- package/dist/assets/AmountInput.css +1 -1
- package/dist/assets/AuthButton.css +1 -1
- package/dist/assets/ExchangeAmountInput.css +1 -1
- package/dist/assets/Fund.css +1 -0
- package/dist/assets/FundAmountInput.css +1 -0
- package/dist/assets/FundErrorScreen.css +1 -0
- package/dist/assets/FundForm.css +1 -0
- package/dist/assets/FundModal.css +1 -0
- package/dist/assets/FundPaymentMethods.css +1 -0
- package/dist/assets/FundPresetAmountInputs.css +1 -0
- package/dist/assets/FundTitle.css +1 -0
- package/dist/assets/FundTransactionStatus.css +1 -0
- package/dist/assets/Input.css +1 -1
- package/dist/assets/Modal.css +1 -1
- package/dist/assets/ThemeProvider.css +1 -1
- package/dist/components/Fund/FundForm.d.ts +18 -0
- package/dist/components/Fund/FundForm.js +156 -0
- package/dist/components/Fund/FundProvider.d.ts +6 -0
- package/dist/components/Fund/FundProvider.js +128 -0
- package/dist/components/Fund/FundTitle.d.ts +5 -0
- package/dist/components/Fund/FundTitle.js +17 -0
- package/dist/components/Fund/components/FundAmountInput.d.ts +5 -0
- package/dist/components/Fund/components/FundAmountInput.js +58 -0
- package/dist/components/Fund/components/FundErrorScreen.d.ts +6 -0
- package/dist/components/Fund/components/FundErrorScreen.js +118 -0
- package/dist/components/Fund/components/FundPaymentMethods.d.ts +6 -0
- package/dist/components/Fund/components/FundPaymentMethods.js +55 -0
- package/dist/components/Fund/components/FundPresetAmountInputs.d.ts +6 -0
- package/dist/components/Fund/components/FundPresetAmountInputs.js +41 -0
- package/dist/components/Fund/components/FundTransactionStatus.d.ts +8 -0
- package/dist/components/Fund/components/FundTransactionStatus.js +106 -0
- package/dist/components/Fund/hooks/useBuyUrl.d.ts +14 -0
- package/dist/components/Fund/hooks/useBuyUrl.js +65 -0
- package/dist/components/Fund/hooks/useEmitLifecycleStatus.d.ts +5 -0
- package/dist/components/Fund/hooks/useEmitLifecycleStatus.js +14 -0
- package/dist/components/Fund/hooks/useExchangeRate.d.ts +11 -0
- package/dist/components/Fund/hooks/useExchangeRate.js +62 -0
- package/dist/components/Fund/hooks/usePaymentMethods.d.ts +11 -0
- package/dist/components/Fund/hooks/usePaymentMethods.js +112 -0
- package/dist/components/Fund/hooks/usePopupMonitor.d.ts +3 -0
- package/dist/components/Fund/hooks/usePopupMonitor.js +17 -0
- package/dist/components/Fund/hooks/useSetupOnrampEventListeners.d.ts +1 -0
- package/dist/components/Fund/hooks/useSetupOnrampEventListeners.js +56 -0
- package/dist/components/Fund/index.d.ts +10 -0
- package/dist/components/Fund/index.js +30 -0
- package/dist/components/Fund/types.d.ts +218 -0
- package/dist/components/Fund/types.js +1 -0
- package/dist/components/Fund/useFundReducer.d.ts +9 -0
- package/dist/components/Fund/useFundReducer.js +104 -0
- package/dist/components/Fund/utils/buildPaymentMethods.d.ts +5 -0
- package/dist/components/Fund/utils/buildPaymentMethods.js +57 -0
- package/dist/components/Fund/utils/setupOnrampEventListeners.d.ts +9 -0
- package/dist/components/Fund/utils/setupOnrampEventListeners.js +19 -0
- package/dist/components/Fund/utils/subscribeToWindowMessage.d.ts +14 -0
- package/dist/components/Fund/utils/subscribeToWindowMessage.js +24 -0
- package/dist/components/FundModal/index.d.ts +9 -0
- package/dist/components/FundModal/index.js +92 -0
- package/dist/components/forms/ExchangeAmountInput/index.js +93 -65
- package/dist/components/forms/ExchangeAmountInput/types.d.ts +2 -1
- package/dist/components/forms/ExchangeAmountInput/useExchangeAmountInput.js +42 -38
- package/dist/components/forms/Input/index.d.ts +6 -2
- package/dist/components/forms/Input/index.js +27 -12
- package/dist/components/forms/PhoneNumberInput/index.d.ts +2 -2
- package/dist/components/ui/Button/index.js +7 -7
- package/dist/components/ui/ButtonBase/index.js +19 -19
- package/dist/components/ui/LoadingSpinner/index.d.ts +9 -2
- package/dist/components/ui/LoadingSpinner/index.js +39 -17
- package/dist/icons/IconAppleLogo.d.ts +2 -0
- package/dist/icons/IconAppleLogo.js +10 -0
- package/dist/icons/IconCoinbaseMark.d.ts +2 -0
- package/dist/icons/IconCoinbaseMark.js +13 -0
- package/dist/icons/IconCreditCard.d.ts +2 -0
- package/dist/icons/IconCreditCard.js +10 -0
- package/dist/icons/IconExclamationTriangle.d.ts +2 -0
- package/dist/icons/IconExclamationTriangle.js +14 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +18 -16
- package/dist/index.d.ts +2 -0
- package/dist/index.js +86 -73
- package/dist/theme/theme.d.ts +23 -0
- package/dist/theme/tokens.d.ts +67 -0
- package/dist/theme/tokens.js +19 -2
- package/dist/utils/formatFiat.d.ts +1 -0
- package/dist/utils/formatFiat.js +13 -0
- package/dist/utils/openPopup.d.ts +7 -0
- package/dist/utils/openPopup.js +15 -0
- 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
|
+
};
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/icons/index.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { IconArrowLeft as e } from "./IconArrowLeft.js";
|
|
2
|
-
import { IconArrowsUpDown as
|
|
3
|
-
import { IconCheck as
|
|
4
|
-
import { IconCheckCircle as
|
|
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
|
|
7
|
-
import { IconExclamationCircle as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
c as IconArrowsUpDown,
|
|
15
|
+
m as IconCheck,
|
|
16
|
+
x as IconCheckCircle,
|
|
16
17
|
I as IconChevronDown,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
c as
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
v as
|
|
65
|
-
w as
|
|
66
|
-
D as
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
Ro as useSignInContext,
|
|
92
|
+
g as useSignInReducer,
|
|
93
|
+
k as useTheme
|
|
81
94
|
};
|
package/dist/theme/theme.d.ts
CHANGED
|
@@ -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
|
};
|
package/dist/theme/tokens.d.ts
CHANGED
|
@@ -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
|
};
|
package/dist/theme/tokens.js
CHANGED
|
@@ -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,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.
|
|
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.
|
|
18
|
-
"@coinbase/cdp-hooks": "^0.0.
|
|
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.
|
|
49
|
-
"@coinbase/cdp-hooks": "^0.0.
|
|
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": "
|
|
57
|
+
"limit": "100 KB"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"name": "single-component",
|