@coinbase/create-cdp-app 0.0.27 → 0.0.29

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.
@@ -0,0 +1,58 @@
1
+ import React, { createContext, useContext, useState } from "react";
2
+ import { ThemeContextType, ThemeColors } from "../types";
3
+
4
+ const lightTheme: ThemeColors = {
5
+ background: "#eaeaea",
6
+ cardBackground: "#ffffff",
7
+ text: "#111111",
8
+ textSecondary: "#757575",
9
+ accent: "#008080",
10
+ border: "#dcdcdc",
11
+ inputBackground: "#ffffff",
12
+ errorBackground: "rgba(255, 0, 0, 0.1)",
13
+ successBackground: "rgba(0, 128, 128, 0.1)",
14
+ warningBackground: "rgba(255, 193, 7, 0.1)",
15
+ };
16
+
17
+ const darkTheme: ThemeColors = {
18
+ background: "#121212",
19
+ cardBackground: "#1e1e1e",
20
+ text: "#ffffff",
21
+ textSecondary: "#b3b3b3",
22
+ accent: "#00a6a6",
23
+ border: "#333333",
24
+ inputBackground: "#2c2c2c",
25
+ errorBackground: "rgba(255, 99, 99, 0.2)",
26
+ successBackground: "rgba(0, 150, 150, 0.2)",
27
+ warningBackground: "rgba(255, 213, 79, 0.2)",
28
+ };
29
+
30
+ const ThemeContext = createContext<ThemeContextType | undefined>(undefined);
31
+
32
+ export const useTheme = () => {
33
+ const context = useContext(ThemeContext);
34
+ if (!context) {
35
+ throw new Error("useTheme must be used within a ThemeProvider");
36
+ }
37
+ return context;
38
+ };
39
+
40
+ interface ThemeProviderProps {
41
+ children: React.ReactNode;
42
+ }
43
+
44
+ export const ThemeProvider: React.FC<ThemeProviderProps> = ({ children }) => {
45
+ const [isDarkMode, setIsDarkMode] = useState(false);
46
+
47
+ const toggleDarkMode = () => {
48
+ setIsDarkMode(!isDarkMode);
49
+ };
50
+
51
+ const colors = isDarkMode ? darkTheme : lightTheme;
52
+
53
+ return (
54
+ <ThemeContext.Provider value={{ isDarkMode, toggleDarkMode, colors }}>
55
+ {children}
56
+ </ThemeContext.Provider>
57
+ );
58
+ };
@@ -0,0 +1,48 @@
1
+ export interface ThemeColors {
2
+ background: string;
3
+ cardBackground: string;
4
+ text: string;
5
+ textSecondary: string;
6
+ accent: string;
7
+ border: string;
8
+ inputBackground: string;
9
+ errorBackground: string;
10
+ successBackground: string;
11
+ warningBackground: string;
12
+ }
13
+
14
+ export interface ThemeContextType {
15
+ isDarkMode: boolean;
16
+ toggleDarkMode: () => void;
17
+ colors: ThemeColors;
18
+ }
19
+
20
+ export type AuthMethod = "email" | "sms";
21
+
22
+ export interface SignInModalProps {
23
+ visible: boolean;
24
+ onClose: () => void;
25
+ authMethod: AuthMethod;
26
+ onAuthMethodToggle: () => void;
27
+ email: string;
28
+ setEmail: (email: string) => void;
29
+ phoneNumber: string;
30
+ setPhoneNumber: (phoneNumber: string) => void;
31
+ otp: string;
32
+ setOtp: (otp: string) => void;
33
+ flowId: string;
34
+ isLoading: boolean;
35
+ onSignIn: () => void;
36
+ onVerifyOTP: () => void;
37
+ slideAnim: any;
38
+ }
39
+
40
+ export interface WelcomeScreenProps {
41
+ onSignInPress: () => void;
42
+ }
43
+
44
+ export interface DarkModeToggleProps {
45
+ style?: any;
46
+ iconStyle?: any;
47
+ showText?: boolean;
48
+ }