@coinbase/cdp-react 0.0.11 → 0.0.12

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 (45) 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 +112 -101
  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 +29 -29
  29. package/dist/components/SignOutButton/index.js +7 -7
  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/index.js +45 -39
  34. package/dist/theme/cssVariables.d.ts +5 -0
  35. package/dist/theme/cssVariables.js +10 -0
  36. package/dist/theme/index.d.ts +1 -0
  37. package/dist/theme/index.js +14 -8
  38. package/dist/theme/theme.d.ts +237 -33
  39. package/dist/theme/theme.js +3 -3
  40. package/dist/theme/tokens.d.ts +679 -45
  41. package/dist/theme/tokens.js +142 -43
  42. package/dist/theme/utils.d.ts +14 -2
  43. package/dist/theme/utils.js +23 -14
  44. package/package.json +9 -5
  45. package/dist/chunks/SignIn.module.Dl3CqKQ_.js +0 -20
@@ -1,113 +1,123 @@
1
- import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
- import { useSignInWithEmail as U, useVerifyEmailOTP as A } from "@coinbase/cdp-hooks";
3
- import { Form as R, FormSubmit as C } from "@radix-ui/react-form";
4
- import { useState as I, useEffect as T, useRef as F } from "react";
5
- import { Button as O } from "../Button/index.js";
6
- import { Field as B } from "../Field/index.js";
7
- import { OTP as x } from "../OTP/index.js";
8
- import { ServerError as b } from "../ServerError/index.js";
9
- import { IconCoinbaseWordmark as V } from "../../icons/IconCoinbaseWordmark.js";
1
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
+ import { useSignInWithEmail as N, useVerifyEmailOTP as U } from "@coinbase/cdp-hooks";
3
+ import { Form as P, FormSubmit as R } from "@radix-ui/react-form";
4
+ import { useState as v, useEffect as y, useRef as A } from "react";
5
+ import { Button as C } from "../Button/index.js";
6
+ import { Field as V } from "../Field/index.js";
7
+ import { withValidityState as B } from "../Input/index.js";
8
+ import { LoadingSpinner as x } from "../LoadingSpinner/index.js";
9
+ import { OTP as q } from "../OTP/index.js";
10
+ import { ServerError as O } from "../ServerError/index.js";
11
+ import { VisuallyHidden as k } from "../VisuallyHidden/index.js";
12
+ import { IconCoinbaseWordmark as D } from "../../icons/IconCoinbaseWordmark.js";
10
13
  import { IconLock as W } from "../../icons/IconLock.js";
11
- import { isApiError as P } from "../../utils/isApiError.js";
12
- import { isEmailInvalid as k } from "../../utils/isEmailInvalid.js";
13
- import { s } from "../../chunks/SignIn.module.Dl3CqKQ_.js";
14
- import { useSignInContext as g } from "./SignInProvider.js";
15
- import { withValidityState as D } from "../Input/index.js";
16
- import { LoadingSpinner as $ } from "../LoadingSpinner/index.js";
17
- import { VisuallyHidden as j } from "../VisuallyHidden/index.js";
18
- const q = ({ submit: u }) => {
19
- const { state: n, dispatch: d } = g(), e = () => d({ type: "CLEAR_ERROR" }), f = (p) => (p.preventDefault(), u(n.email));
20
- return /* @__PURE__ */ o(
21
- R,
14
+ import { isApiError as T } from "../../utils/isApiError.js";
15
+ import { isEmailInvalid as $ } from "../../utils/isEmailInvalid.js";
16
+ import { useSignInContext as E } from "./SignInProvider.js";
17
+ import '../../assets/SignInForm.css';const j = "SignInForm-module__form___8Mc3V", J = "SignInForm-module__footer___6Lo9w", Z = "SignInForm-module__hr___fOcy4", G = "SignInForm-module__icon___qkJnq", n = {
18
+ form: j,
19
+ "form-footer": "SignInForm-module__form-footer___PqM2J",
20
+ "server-state-wrapper": "SignInForm-module__server-state-wrapper___QVsXy",
21
+ "loading-spinner": "SignInForm-module__loading-spinner___W6gZo",
22
+ "server-error": "SignInForm-module__server-error___dD9VE",
23
+ "reset-timer": "SignInForm-module__reset-timer___Ms2YZ",
24
+ footer: J,
25
+ "coinbase-icon": "SignInForm-module__coinbase-icon___vGv7u",
26
+ hr: Z,
27
+ icon: G
28
+ }, H = ({ submit: u }) => {
29
+ const { state: s, dispatch: d } = E(), e = () => d({ type: "CLEAR_ERROR" }), _ = (p) => (p.preventDefault(), u(s.email));
30
+ return /* @__PURE__ */ i(
31
+ P,
22
32
  {
23
- className: s.form,
33
+ className: n.form,
24
34
  onClearServerErrors: e,
25
- onSubmit: f,
35
+ onSubmit: _,
26
36
  children: [
27
- /* @__PURE__ */ t(
28
- B,
37
+ /* @__PURE__ */ o(
38
+ V,
29
39
  {
30
40
  label: "Email address",
31
41
  name: "email",
32
42
  validators: [
33
43
  ["valueMissing", "Email is required"],
34
44
  ["typeMismatch", "Use a valid email address"],
35
- [k, "Use a valid email address"]
45
+ [$, "Use a valid email address"]
36
46
  ],
37
- children: D({
47
+ children: B({
38
48
  type: "email",
39
49
  placeholder: "name@example.com",
40
50
  required: !0,
41
- value: n.email,
51
+ value: s.email,
42
52
  onChange: (p) => {
43
53
  d({ type: "SET_EMAIL", payload: { email: p.target.value } });
44
54
  }
45
55
  })
46
56
  }
47
57
  ),
48
- n.error && /* @__PURE__ */ t(b, { error: n.error, className: s.serverError }),
49
- /* @__PURE__ */ t(C, { asChild: !0, children: /* @__PURE__ */ t(O, { type: "submit", isPending: n.isPending, children: "Continue with email" }) })
58
+ s.error && /* @__PURE__ */ o(O, { error: s.error, className: n["server-error"] }),
59
+ /* @__PURE__ */ o(R, { asChild: !0, children: /* @__PURE__ */ o(C, { type: "submit", isPending: s.isPending, children: "Continue with email" }) })
50
60
  ]
51
61
  }
52
62
  );
53
- }, H = ({
63
+ }, Q = ({
54
64
  reset: u,
55
- resetCountdown: n,
65
+ resetCountdown: s,
56
66
  submit: d
57
67
  }) => {
58
- const { state: e, dispatch: f } = g(), p = () => f({ type: "CLEAR_ERROR" }), c = F([]), h = (m) => (m.preventDefault(), d(e.otp)), E = () => {
59
- u(), c.current[0]?.focus();
68
+ const { state: e, dispatch: _ } = E(), p = () => _({ type: "CLEAR_ERROR" }), l = A([]), f = (c) => (c.preventDefault(), d(e.otp)), h = () => {
69
+ u(), l.current[0]?.focus();
60
70
  };
61
- return T(() => {
62
- e.step === "otp" && c.current[0]?.focus();
63
- }, [e.step]), /* @__PURE__ */ o(
64
- R,
71
+ return y(() => {
72
+ e.step === "otp" && l.current[0]?.focus();
73
+ }, [e.step]), /* @__PURE__ */ i(
74
+ P,
65
75
  {
66
- className: `${s.form}`,
76
+ className: `${n.form}`,
67
77
  onClearServerErrors: p,
68
- onSubmit: h,
78
+ onSubmit: f,
69
79
  children: [
70
- /* @__PURE__ */ t(
71
- x,
80
+ /* @__PURE__ */ o(
81
+ q,
72
82
  {
73
- ref: c,
83
+ ref: l,
74
84
  name: "otp",
75
85
  "aria-label": "Six-digit Verification Code",
76
86
  passwordLength: 6,
77
87
  value: e.otp,
78
- onChange: (m) => m.preventDefault(),
79
- onValueChange: (m) => {
80
- f({ type: "SET_OTP", payload: { otp: m } });
88
+ onChange: (c) => c.preventDefault(),
89
+ onValueChange: (c) => {
90
+ _({ type: "SET_OTP", payload: { otp: c } });
81
91
  },
82
92
  autoSubmit: !0
83
93
  }
84
94
  ),
85
- /* @__PURE__ */ o("div", { className: s.formFooter, children: [
86
- (e.isPending && !e.canResetOTP || e.error) && /* @__PURE__ */ o("div", { className: s.serverStateWrapper, children: [
87
- e.isPending && !e.canResetOTP && /* @__PURE__ */ t($, { className: s.loadingSpinner }),
88
- e.error && /* @__PURE__ */ t(b, { error: e.error, className: s.serverError })
95
+ /* @__PURE__ */ i("div", { className: n["form-footer"], children: [
96
+ (e.isPending && !e.canResetOTP || e.error) && /* @__PURE__ */ i("div", { className: n["server-state-wrapper"], children: [
97
+ e.isPending && !e.canResetOTP && /* @__PURE__ */ o(x, { className: n["loading-spinner"] }),
98
+ e.error && /* @__PURE__ */ o(O, { error: e.error, className: n["server-error"] })
89
99
  ] }),
90
- /* @__PURE__ */ o("div", { children: [
91
- e.canResetOTP && /* @__PURE__ */ t(C, { asChild: !0, children: /* @__PURE__ */ t(
92
- O,
100
+ /* @__PURE__ */ i("div", { children: [
101
+ e.canResetOTP && /* @__PURE__ */ o(R, { asChild: !0, children: /* @__PURE__ */ o(
102
+ C,
93
103
  {
94
104
  type: "button",
95
- onClick: E,
105
+ onClick: h,
96
106
  isPending: e.isPending,
97
107
  variant: "transparentPrimary",
98
108
  children: "Resend code"
99
109
  }
100
110
  ) }),
101
- !e.canResetOTP && /* @__PURE__ */ t("div", { className: s.resetTimer, children: /* @__PURE__ */ o("p", { children: [
111
+ !e.canResetOTP && /* @__PURE__ */ o("div", { className: n["reset-timer"], children: /* @__PURE__ */ i("p", { children: [
102
112
  "Resend code in ",
103
- /* @__PURE__ */ o("span", { "aria-hidden": "true", children: [
104
- n,
113
+ /* @__PURE__ */ i("span", { "aria-hidden": "true", children: [
114
+ s,
105
115
  "s"
106
116
  ] }),
107
- /* @__PURE__ */ o(j, { children: [
108
- n,
117
+ /* @__PURE__ */ i(k, { children: [
118
+ s,
109
119
  " ",
110
- n === 1 ? "second" : "seconds"
120
+ s === 1 ? "second" : "seconds"
111
121
  ] })
112
122
  ] }) })
113
123
  ] })
@@ -115,71 +125,72 @@ const q = ({ submit: u }) => {
115
125
  ]
116
126
  }
117
127
  );
118
- }, ce = ({
128
+ }, pe = ({
119
129
  as: u = "div",
120
- className: n = "",
130
+ className: s = "",
121
131
  onSuccess: d,
122
132
  ...e
123
133
  }) => {
124
- const c = "An error occurred while signing in. Please try again.", [h, E] = I(0), [m, y] = I(!1), _ = U(), L = A(), { state: i, dispatch: l } = g(), N = (a) => {
125
- E(a), y(!0);
134
+ const l = "An error occurred while signing in. Please try again.", [f, h] = v(0), [c, S] = v(!1), b = N(), F = U(), { state: a, dispatch: m } = E(), w = (t) => {
135
+ h(t), S(!0);
126
136
  };
127
- T(() => {
128
- if (!m)
137
+ y(() => {
138
+ if (!c)
129
139
  return;
130
- const a = setInterval(() => {
131
- E((r) => r > 1 ? r - 1 : (y(!1), 0));
140
+ const t = setInterval(() => {
141
+ h((r) => r > 1 ? r - 1 : (S(!1), 0));
132
142
  }, 1e3);
133
- return () => clearInterval(a);
134
- }, [m]), T(() => {
135
- h === 0 && i.step === "otp" && !i.canResetOTP && l({ type: "ALLOW_RESET_OTP" });
136
- }, [h, i.step, i.canResetOTP, l]);
137
- const v = async (a) => {
138
- if (!i.isPending) {
139
- l({ type: "SUBMIT_EMAIL", payload: { email: a } });
143
+ return () => clearInterval(t);
144
+ }, [c]), y(() => {
145
+ f === 0 && a.step === "otp" && !a.canResetOTP && m({ type: "ALLOW_RESET_OTP" });
146
+ }, [f, a.step, a.canResetOTP, m]);
147
+ const I = async (t) => {
148
+ if (!a.isPending) {
149
+ m({ type: "SUBMIT_EMAIL", payload: { email: t } });
140
150
  try {
141
- const { flowId: r } = await _({
142
- email: a
151
+ const { flowId: r } = await b({
152
+ email: t
143
153
  });
144
- l({ type: "SUBMIT_EMAIL_SUCCESS", payload: { flowId: r } }), N(60);
154
+ m({ type: "SUBMIT_EMAIL_SUCCESS", payload: { flowId: r } }), w(60);
145
155
  } catch (r) {
146
- const S = P(r) ? r : r instanceof Error && r.message || c;
147
- l({ type: "SUBMIT_EMAIL_FAILURE", payload: { error: S } }), console.error(r);
156
+ const g = T(r) ? r : r instanceof Error && r.message || l;
157
+ m({ type: "SUBMIT_EMAIL_FAILURE", payload: { error: g } }), console.error(r);
148
158
  }
149
159
  }
150
- }, w = async (a) => {
151
- if (!i.isPending) {
152
- if (a.length !== 6) {
153
- l({ type: "SET_OTP", payload: { otp: a } });
160
+ }, L = async (t) => {
161
+ if (!a.isPending) {
162
+ if (t.length !== 6) {
163
+ m({ type: "SET_OTP", payload: { otp: t } });
154
164
  return;
155
165
  }
156
- l({ type: "SUBMIT_OTP", payload: { otp: a } });
166
+ m({ type: "SUBMIT_OTP", payload: { otp: t } });
157
167
  try {
158
- await L({
159
- flowId: i.flowId,
160
- otp: a
161
- }), l({ type: "SUBMIT_OTP_SUCCESS", payload: { otp: a } }), d?.();
168
+ await F({
169
+ flowId: a.flowId,
170
+ otp: t
171
+ }), m({ type: "SUBMIT_OTP_SUCCESS", payload: { otp: t } }), d?.();
162
172
  } catch (r) {
163
- const S = P(r) ? r : r instanceof Error && r.message || c;
164
- l({ type: "SUBMIT_OTP_FAILURE", payload: { error: S } }), console.error(r);
173
+ const g = T(r) ? r : r instanceof Error && r.message || l;
174
+ m({ type: "SUBMIT_OTP_FAILURE", payload: { error: g } }), console.error(r);
165
175
  }
166
176
  }
167
177
  }, M = () => {
168
- l({ type: "RESET_OTP" }), y(!1), v(i.email);
178
+ m({ type: "RESET_OTP" }), S(!1), I(a.email);
169
179
  };
170
- return /* @__PURE__ */ o(u, { className: `${s.form} ${n}`, ...e, children: [
171
- i.step === "email" && /* @__PURE__ */ t(q, { submit: v }),
172
- i.step === "otp" && /* @__PURE__ */ t(H, { submit: w, reset: M, resetCountdown: h }),
173
- /* @__PURE__ */ t("hr", { className: s.hr }),
174
- /* @__PURE__ */ o("div", { className: s.footer, children: [
175
- /* @__PURE__ */ t(W, { className: s.icon }),
176
- /* @__PURE__ */ o("p", { children: [
177
- "Secured by ",
178
- /* @__PURE__ */ t(V, { className: s.coinbaseIcon, "aria-label": "Coinbase" })
180
+ return /* @__PURE__ */ i(u, { className: `${n.form} ${s}`, ...e, children: [
181
+ a.step === "email" && /* @__PURE__ */ o(H, { submit: I }),
182
+ a.step === "otp" && /* @__PURE__ */ o(Q, { submit: L, reset: M, resetCountdown: f }),
183
+ /* @__PURE__ */ o("hr", { className: n.hr }),
184
+ /* @__PURE__ */ i("div", { className: n.footer, children: [
185
+ /* @__PURE__ */ o(W, { className: n.icon }),
186
+ /* @__PURE__ */ i("p", { children: [
187
+ "Secured by",
188
+ " ",
189
+ /* @__PURE__ */ o(D, { className: n["coinbase-icon"], "aria-label": "Coinbase" })
179
190
  ] })
180
191
  ] })
181
192
  ] });
182
193
  };
183
194
  export {
184
- ce as SignInForm
195
+ pe as SignInForm
185
196
  };
@@ -1,21 +1,23 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { useAppConfig as u } from "../CDPReactProvider/index.js";
2
+ import { useAppConfig as p } from "../CDPReactProvider/index.js";
3
3
  import { IconCheckCircle as a } from "../../icons/IconCheckCircle.js";
4
- import { s as c } from "../../chunks/SignIn.module.Dl3CqKQ_.js";
5
- import { useSignInContext as f } from "./SignInProvider.js";
6
- const i = (o) => /^https?:\/\//.test(o), x = ({ className: o = "", alt: l, src: s }) => {
7
- const { state: m } = f(), { step: r } = m, t = u(), g = t.logoUrl && i(t.logoUrl) ? t.logoUrl : void 0, n = s && i(s) ? s : g, p = l || t.name;
8
- return r !== "success" && n ? /* @__PURE__ */ e(
4
+ import { useSignInContext as _ } from "./SignInProvider.js";
5
+ import '../../assets/SignInImage.css';const f = "SignInImage-module__logo___rlzt-", i = {
6
+ logo: f,
7
+ "success-icon": "SignInImage-module__success-icon___avUF9"
8
+ }, l = (o) => /^https?:\/\//.test(o), S = ({ className: o = "", alt: r, src: t }) => {
9
+ const { state: g } = _(), { step: n } = g, s = p(), m = s.logoUrl && l(s.logoUrl) ? s.logoUrl : void 0, c = t && l(t) ? t : m, u = r || s.name;
10
+ return n !== "success" && c ? /* @__PURE__ */ e(
9
11
  "img",
10
12
  {
11
- src: n,
12
- alt: p || "",
13
- className: `${c.logo} ${o}`,
13
+ src: c,
14
+ alt: u || "",
15
+ className: `${i.logo} ${o}`,
14
16
  width: 64,
15
17
  height: 64
16
18
  }
17
- ) : r === "success" ? /* @__PURE__ */ e(a, { className: `${c.successIcon} ${o}` }) : null;
19
+ ) : n === "success" ? /* @__PURE__ */ e(a, { className: `${i["success-icon"]} ${o}` }) : null;
18
20
  };
19
21
  export {
20
- x as SignInImage
22
+ S as SignInImage
21
23
  };
@@ -1,16 +1,17 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as r } from "react/jsx-runtime";
2
2
  import { useMemo as c } from "react";
3
- import { s as m } from "../../chunks/SignIn.module.Dl3CqKQ_.js";
4
- import { useSignInContext as p } from "./SignInProvider.js";
5
- const d = ({
6
- as: e = "h2",
7
- children: s,
8
- className: r = "",
9
- ...n
3
+ import { useSignInContext as a } from "./SignInProvider.js";
4
+ import '../../assets/SignInTitle.css';const u = "SignInTitle-module__heading___QJ071", m = {
5
+ heading: u
6
+ }, p = ({
7
+ as: t = "h2",
8
+ children: n,
9
+ className: s = "",
10
+ ...i
10
11
  }) => {
11
- const { state: t } = p(), i = c(() => t.step === "success" ? "Success" : t.step === "otp" ? "Enter verification code" : "Sign in", [t.step]);
12
- return /* @__PURE__ */ o(e, { className: `${m.heading} ${r}`, ...n, children: s || i });
12
+ const { state: e } = a(), o = c(() => e.step === "success" ? "Success" : e.step === "otp" ? "Enter verification code" : "Sign in", [e.step]);
13
+ return /* @__PURE__ */ r(t, { className: `${m.heading} ${s}`, ...i, children: n || o });
13
14
  };
14
15
  export {
15
- d as SignInTitle
16
+ p as SignInTitle
16
17
  };
@@ -1,28 +1,29 @@
1
- import { jsx as n, jsxs as i, Fragment as s } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as r, Fragment as s } from "react/jsx-runtime";
2
2
  import "react";
3
- import { s as g } from "../../chunks/SignIn.module.Dl3CqKQ_.js";
4
- import { SignInDescription as p } from "./SignInDescription.js";
5
- import { SignInForm as I } from "./SignInForm.js";
6
- import { SignInImage as c } from "./SignInImage.js";
7
- import { SignInProvider as f, useSignInContext as S } from "./SignInProvider.js";
8
- import { SignInTitle as a } from "./SignInTitle.js";
9
- const l = ({ className: t = "", children: o, onSuccess: m }) => {
10
- const { state: e } = S(), r = typeof o == "function" ? o(e) : o;
11
- return /* @__PURE__ */ i("div", { className: `${g.signIn} ${t}`, children: [
12
- r,
13
- !r && /* @__PURE__ */ i(s, { children: [
14
- /* @__PURE__ */ n(c, {}),
15
- /* @__PURE__ */ n(a, {}),
3
+ import { SignInDescription as g } from "./SignInDescription.js";
4
+ import { SignInForm as c } from "./SignInForm.js";
5
+ import { SignInImage as p } from "./SignInImage.js";
6
+ import { SignInProvider as I, useSignInContext as S } from "./SignInProvider.js";
7
+ import { SignInTitle as f } from "./SignInTitle.js";
8
+ import '../../assets/SignIn.css';const a = {
9
+ "sign-in": "SignIn-module__sign-in___cYpee"
10
+ }, l = ({ className: i = "", children: t, onSuccess: e }) => {
11
+ const { state: m } = S(), o = typeof t == "function" ? t(m) : t;
12
+ return /* @__PURE__ */ r("div", { className: `${a["sign-in"]} ${i}`, children: [
13
+ o,
14
+ !o && /* @__PURE__ */ r(s, { children: [
16
15
  /* @__PURE__ */ n(p, {}),
17
- /* @__PURE__ */ n(I, { onSuccess: m })
16
+ /* @__PURE__ */ n(f, {}),
17
+ /* @__PURE__ */ n(g, {}),
18
+ /* @__PURE__ */ n(c, { onSuccess: e })
18
19
  ] })
19
20
  ] });
20
- }, $ = (t) => /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n(l, { ...t }) });
21
+ }, C = (i) => /* @__PURE__ */ n(I, { children: /* @__PURE__ */ n(l, { ...i }) });
21
22
  export {
22
- $ as SignIn,
23
- p as SignInDescription,
24
- I as SignInForm,
25
- c as SignInImage,
26
- a as SignInTitle,
23
+ C as SignIn,
24
+ g as SignInDescription,
25
+ c as SignInForm,
26
+ p as SignInImage,
27
+ f as SignInTitle,
27
28
  S as useSignInContext
28
29
  };
@@ -1,50 +1,50 @@
1
- import { jsxs as o, jsx as n } from "react/jsx-runtime";
2
- import { Dialog as g, DialogTrigger as c, DialogPortal as m, DialogOverlay as _, DialogContent as d, DialogClose as I, DialogTitle as p, DialogDescription as u } from "@radix-ui/react-dialog";
1
+ import { jsxs as o, jsx as i } from "react/jsx-runtime";
2
+ import { Dialog as t, DialogTrigger as g, DialogPortal as _, DialogOverlay as d, DialogContent as c, DialogClose as p, DialogTitle as u, DialogDescription as I } from "@radix-ui/react-dialog";
3
3
  import "react";
4
4
  import { IconXMark as h } from "../../icons/IconXMark.js";
5
5
  import { Button as r } from "../Button/index.js";
6
6
  import { SignIn as S } from "../SignIn/index.js";
7
- import { useTheme as D } from "../ThemeProvider/index.js";
7
+ import { useTheme as f } from "../ThemeProvider/index.js";
8
8
  import { SignInImage as M } from "../SignIn/SignInImage.js";
9
- import { SignInTitle as f } from "../SignIn/SignInTitle.js";
9
+ import { SignInTitle as D } from "../SignIn/SignInTitle.js";
10
10
  import { SignInDescription as v } from "../SignIn/SignInDescription.js";
11
11
  import { SignInForm as N } from "../SignIn/SignInForm.js";
12
- import '../../assets/SignInModal.css';const y = "SignInModal-module__trigger___IcJ8x", T = "SignInModal-module__modal___PErrT", C = "SignInModal-module__signIn___hQuJk", x = "SignInModal-module__signInForm___6-UdI", B = "SignInModal-module__signInTitle___AF-XA", F = "SignInModal-module__signInDescription___SZjXu", W = "SignInModal-module__signInImage___hMBda", j = "SignInModal-module__closeWrapper___cx8Zq", X = "SignInModal-module__closeButton___yf-ZW", Z = "SignInModal-module__overlay___-0rmi", b = "SignInModal-module__spacer___x-lRH", i = {
12
+ import '../../assets/SignInModal.css';const y = "SignInModal-module__trigger___IcJ8x", C = "SignInModal-module__modal___PErrT", x = "SignInModal-module__overlay___-0rmi", b = "SignInModal-module__spacer___x-lRH", n = {
13
13
  trigger: y,
14
- modal: T,
15
- signIn: C,
16
- signInForm: x,
17
- signInTitle: B,
18
- signInDescription: F,
19
- signInImage: W,
20
- closeWrapper: j,
21
- closeButton: X,
22
- overlay: Z,
14
+ modal: C,
15
+ "sign-in": "SignInModal-module__sign-in___n05-5",
16
+ "sign-in-form": "SignInModal-module__sign-in-form___Jzx1-",
17
+ "sign-in-title": "SignInModal-module__sign-in-title___cju2s",
18
+ "sign-in-description": "SignInModal-module__sign-in-description___-Oi9q",
19
+ "sign-in-image": "SignInModal-module__sign-in-image___DGg7B",
20
+ "close-wrapper": "SignInModal-module__close-wrapper___zuxDu",
21
+ "close-button": "SignInModal-module__close-button___k1I5Q",
22
+ overlay: x,
23
23
  spacer: b
24
- }, V = ({ children: l, open: s, setIsOpen: a, onSuccess: e }) => {
25
- const { cssVariables: t } = D();
26
- return /* @__PURE__ */ o(g, { open: s, onOpenChange: a, children: [
27
- /* @__PURE__ */ n(c, { asChild: !0, children: l || /* @__PURE__ */ n(r, { variant: "primary", className: i.trigger, children: "Sign In" }) }),
28
- /* @__PURE__ */ n(m, { children: /* @__PURE__ */ o(_, { className: i.overlay, style: t, children: [
29
- /* @__PURE__ */ n("div", { className: i.spacer }),
30
- /* @__PURE__ */ n(d, { className: i.modal, children: /* @__PURE__ */ o(S, { onSuccess: e, className: i.signIn, children: [
31
- /* @__PURE__ */ n("div", { className: i.closeWrapper, children: /* @__PURE__ */ n(I, { asChild: !0, children: /* @__PURE__ */ n(
24
+ }, F = ({ children: l, open: a, setIsOpen: s, onSuccess: e }) => {
25
+ const { cssVariables: m } = f();
26
+ return /* @__PURE__ */ o(t, { open: a, onOpenChange: s, children: [
27
+ /* @__PURE__ */ i(g, { asChild: !0, children: l || /* @__PURE__ */ i(r, { variant: "primary", className: n.trigger, children: "Sign In" }) }),
28
+ /* @__PURE__ */ i(_, { children: /* @__PURE__ */ o(d, { className: n.overlay, style: m, children: [
29
+ /* @__PURE__ */ i("div", { className: n.spacer }),
30
+ /* @__PURE__ */ i(c, { className: n.modal, children: /* @__PURE__ */ o(S, { onSuccess: e, className: n["sign-in"], children: [
31
+ /* @__PURE__ */ i("div", { className: n["close-wrapper"], children: /* @__PURE__ */ i(p, { asChild: !0, children: /* @__PURE__ */ i(
32
32
  r,
33
33
  {
34
34
  "aria-label": "Close",
35
35
  variant: "transparentSecondary",
36
- className: `${i.closeButton}`,
37
- children: /* @__PURE__ */ n(h, {})
36
+ className: `${n["close-button"]}`,
37
+ children: /* @__PURE__ */ i(h, {})
38
38
  }
39
39
  ) }) }),
40
- /* @__PURE__ */ n("div", { className: i.signInImage, children: /* @__PURE__ */ n(M, {}) }),
41
- /* @__PURE__ */ n("div", { className: i.signInTitle, children: /* @__PURE__ */ n(p, { asChild: !0, children: /* @__PURE__ */ n(f, {}) }) }),
42
- /* @__PURE__ */ n(u, { asChild: !0, children: /* @__PURE__ */ n(v, { className: i.signInDescription }) }),
43
- /* @__PURE__ */ n(N, { className: i.signInForm, onSuccess: e })
40
+ /* @__PURE__ */ i("div", { className: n["sign-in-image"], children: /* @__PURE__ */ i(M, {}) }),
41
+ /* @__PURE__ */ i("div", { className: n["sign-in-title"], children: /* @__PURE__ */ i(u, { asChild: !0, children: /* @__PURE__ */ i(D, {}) }) }),
42
+ /* @__PURE__ */ i(I, { asChild: !0, children: /* @__PURE__ */ i(v, { className: n["sign-in-description"] }) }),
43
+ /* @__PURE__ */ i(N, { className: n["sign-in-form"], onSuccess: e })
44
44
  ] }) })
45
45
  ] }) })
46
46
  ] });
47
47
  };
48
48
  export {
49
- V as SignInModal
49
+ F as SignInModal
50
50
  };
@@ -3,14 +3,14 @@ import { useSignOut as r } from "@coinbase/cdp-hooks";
3
3
  import "react";
4
4
  import { Button as m } from "../Button/index.js";
5
5
  import "../../theme/theme.js";
6
- import '../../assets/SignOutButton.css';const g = "SignOutButton-module__signOutButton___WNhmy", c = {
7
- signOutButton: g
8
- }, l = ({ children: t, variant: n = "primary", onSuccess: o }) => {
9
- const u = r(), i = async () => {
10
- await u(), o?.();
6
+ import '../../assets/SignOutButton.css';const e = {
7
+ "sign-out-button": "SignOutButton-module__sign-out-button___qiybe"
8
+ }, O = ({ children: t, variant: o = "primary", onSuccess: n }) => {
9
+ const i = r(), u = async () => {
10
+ await i(), n?.();
11
11
  };
12
- return /* @__PURE__ */ s(m, { variant: n, className: c.signOutButton, onClick: i, children: t || "Sign out" });
12
+ return /* @__PURE__ */ s(m, { variant: o, className: e["sign-out-button"], onClick: u, children: t || "Sign out" });
13
13
  };
14
14
  export {
15
- l as SignOutButton
15
+ O as SignOutButton
16
16
  };
@@ -5,9 +5,7 @@ export type ThemeProviderProps = {
5
5
  children: ReactNode;
6
6
  className?: string;
7
7
  style?: CSSProperties;
8
- theme?: Partial<{
9
- [K in keyof Theme]: Theme[K];
10
- }>;
8
+ theme?: Partial<Theme>;
11
9
  };
12
10
  export interface ThemeContextValue {
13
11
  theme: Theme;
@@ -1,10 +1,10 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
- import { createContext as h, useMemo as s, useContext as u } from "react";
3
- import { flattenedTheme as n } from "../../theme/theme.js";
2
+ import { createContext as p, useMemo as s, useContext as u } from "react";
3
+ import { theme as n } from "../../theme/theme.js";
4
4
  import { themeToCssVariables as l } from "../../theme/utils.js";
5
- import '../../assets/ThemeProvider.css';const d = "ThemeProvider-module__wrapper___aXwhZ", w = {
6
- wrapper: d
7
- }, a = h(void 0), _ = ({
5
+ import '../../assets/ThemeProvider.css';const w = "ThemeProvider-module__wrapper___aXwhZ", d = {
6
+ wrapper: w
7
+ }, a = p(void 0), _ = ({
8
8
  children: e,
9
9
  className: c = "",
10
10
  style: i,
@@ -13,14 +13,14 @@ import '../../assets/ThemeProvider.css';const d = "ThemeProvider-module__wrapper
13
13
  const t = s(
14
14
  () => o ? { ...n, ...o } : n,
15
15
  [o]
16
- ), r = s(() => l(t), [t]), p = s(
16
+ ), r = s(() => l(t), [t]), h = s(
17
17
  () => ({
18
18
  theme: t,
19
19
  cssVariables: r
20
20
  }),
21
21
  [t, r]
22
22
  );
23
- return /* @__PURE__ */ m(a.Provider, { value: p, children: /* @__PURE__ */ m("div", { className: `${w.wrapper} ${c}`, style: { ...i, ...r }, children: e }) });
23
+ return /* @__PURE__ */ m(a.Provider, { value: h, children: /* @__PURE__ */ m("div", { className: `${d.wrapper} ${c}`, style: { ...i, ...r }, children: e }) });
24
24
  }, C = () => {
25
25
  const e = u(a);
26
26
  if (!e)
@@ -1,8 +1,8 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import "react";
3
- import '../../assets/VisuallyHidden.css';const d = "VisuallyHidden-module__visuallyHidden___KiAzg", n = {
4
- visuallyHidden: d
5
- }, u = ({ as: s = "span", children: l }) => l ? /* @__PURE__ */ i(s, { className: n.visuallyHidden, children: l }) : null;
3
+ import '../../assets/VisuallyHidden.css';const d = {
4
+ "visually-hidden": "VisuallyHidden-module__visually-hidden___qdUPg"
5
+ }, a = ({ as: s = "span", children: l }) => l ? /* @__PURE__ */ i(s, { className: d["visually-hidden"], children: l }) : null;
6
6
  export {
7
- u as VisuallyHidden
7
+ a as VisuallyHidden
8
8
  };