@expo-forge/forge-ui 0.0.47

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,140 @@
1
+ // ForgeUI type augmentation — ships with the @expo-forge/forge-ui npm package.
2
+ // Loaded automatically by TypeScript when forge-ui is in your devDependencies
3
+ // and listed under compilerOptions.types in tsconfig.json.
4
+ //
5
+ // Adds `className?: string` to React Native component prop types so
6
+ // TypeScript accepts <View className="..." /> without errors.
7
+
8
+ import "react-native";
9
+ import * as React from "react";
10
+ import * as JSX from "react/jsx-runtime";
11
+
12
+ declare module "react-native" {
13
+ interface ViewProps {
14
+ className?: string;
15
+ }
16
+ interface TextProps {
17
+ className?: string;
18
+ }
19
+ interface ImageProps {
20
+ className?: string;
21
+ }
22
+ interface TextInputProps {
23
+ className?: string;
24
+ }
25
+ interface TouchableOpacityProps {
26
+ className?: string;
27
+ }
28
+ interface TouchableHighlightProps {
29
+ className?: string;
30
+ }
31
+ interface PressableProps {
32
+ className?: string;
33
+ }
34
+ // ModalProps is already declared in react-native types, do not redeclare.
35
+ interface SafeAreaViewProps {
36
+ className?: string;
37
+ }
38
+ interface KeyboardAvoidingViewProps {
39
+ className?: string;
40
+ }
41
+ interface ActivityIndicatorProps {
42
+ className?: string;
43
+ }
44
+ interface SwitchProps {
45
+ className?: string;
46
+ }
47
+ }
48
+
49
+ // ── @expo-forge/forge-ui/theme ───────────────────────────────────────────────
50
+
51
+ export type ForgeTheme = "light" | "dark";
52
+
53
+ export interface ThemeProviderProps {
54
+ children: React.ReactNode;
55
+ /** Override the system color scheme with a fixed value. */
56
+ theme?: ForgeTheme;
57
+ }
58
+
59
+ /**
60
+ * Wrap your app with `<ThemeProvider>` so components using `dark:` classes
61
+ * re-render when the device color scheme changes.
62
+ */
63
+ export declare function ThemeProvider(props: ThemeProviderProps): JSX.Element;
64
+
65
+ /**
66
+ * Returns the current theme (`"light"` | `"dark"`).
67
+ * Requires `<ThemeProvider>` to be in the component tree for reactive updates.
68
+ */
69
+ export declare function useForgeTheme(): ForgeTheme;
70
+
71
+ /**
72
+ * Returns the current theme and a toggle function.
73
+ * Requires `<ThemeProvider>` to be in the component tree for reactive updates.
74
+ */
75
+ export declare function useTheme(): {
76
+ theme: ForgeTheme;
77
+ toggleTheme: () => void;
78
+ };
79
+
80
+ export interface ForgeColors {
81
+ slate: string[];
82
+ gray: string[];
83
+ zinc: string[];
84
+ neutral: string[];
85
+ stone: string[];
86
+ red: string[];
87
+ orange: string[];
88
+ amber: string[];
89
+ yellow: string[];
90
+ lime: string[];
91
+ green: string[];
92
+ emerald: string[];
93
+ teal: string[];
94
+ cyan: string[];
95
+ sky: string[];
96
+ blue: string[];
97
+ indigo: string[];
98
+ violet: string[];
99
+ purple: string[];
100
+ fuchsia: string[];
101
+ pink: string[];
102
+ rose: string[];
103
+ brown: string[];
104
+ tan: string[];
105
+ sand: string[];
106
+ chocolate: string[];
107
+ sienna: string[];
108
+ mint: string[];
109
+ sage: string[];
110
+ olive: string[];
111
+ moss: string[];
112
+ forest: string[];
113
+ navy: string[];
114
+ cobalt: string[];
115
+ royal: string[];
116
+ cerulean: string[];
117
+ crimson: string[];
118
+ ruby: string[];
119
+ wine: string[];
120
+ burgundy: string[];
121
+ maroon: string[];
122
+ gold: string[];
123
+ bronze: string[];
124
+ copper: string[];
125
+ lavender: string[];
126
+ lilac: string[];
127
+ mauve: string[];
128
+ orchid: string[];
129
+ coral: string[];
130
+ salmon: string[];
131
+ peach: string[];
132
+ turquoise: string[];
133
+ aqua: string[];
134
+ }
135
+
136
+ /**
137
+ * Returns Forge color palettes (11 shades each, 0-10).
138
+ * Use in native components: `const colors = useColors(); <View style={{ backgroundColor: colors.blue[5] }} />`
139
+ */
140
+ export declare function useColors(): ForgeColors;
@@ -0,0 +1,93 @@
1
+ import * as React from "react";
2
+ import * as JSX from "react/jsx-runtime";
3
+
4
+ export type ForgeTheme = "light" | "dark";
5
+
6
+ export interface ThemeProviderProps {
7
+ children: React.ReactNode;
8
+ /** Override the system color scheme with a fixed value. */
9
+ theme?: ForgeTheme;
10
+ }
11
+
12
+ /**
13
+ * Wrap your app with `<ThemeProvider>` so components using `dark:` classes
14
+ * re-render when the device color scheme changes.
15
+ */
16
+ export declare function ThemeProvider(props: ThemeProviderProps): JSX.Element;
17
+
18
+ /**
19
+ * Returns the current theme (`"light"` | `"dark"`).
20
+ * Requires `<ThemeProvider>` to be in the component tree for reactive updates.
21
+ */
22
+ export declare function useForgeTheme(): ForgeTheme;
23
+
24
+ /**
25
+ * Returns the current theme and a toggle function.
26
+ * Requires `<ThemeProvider>` to be in the component tree for reactive updates.
27
+ */
28
+ export declare function useTheme(): {
29
+ theme: ForgeTheme;
30
+ toggleTheme: () => void;
31
+ };
32
+
33
+ export interface ForgeColors {
34
+ slate: string[];
35
+ gray: string[];
36
+ zinc: string[];
37
+ neutral: string[];
38
+ stone: string[];
39
+ red: string[];
40
+ orange: string[];
41
+ amber: string[];
42
+ yellow: string[];
43
+ lime: string[];
44
+ green: string[];
45
+ emerald: string[];
46
+ teal: string[];
47
+ cyan: string[];
48
+ sky: string[];
49
+ blue: string[];
50
+ indigo: string[];
51
+ violet: string[];
52
+ purple: string[];
53
+ fuchsia: string[];
54
+ pink: string[];
55
+ rose: string[];
56
+ brown: string[];
57
+ tan: string[];
58
+ sand: string[];
59
+ chocolate: string[];
60
+ sienna: string[];
61
+ mint: string[];
62
+ sage: string[];
63
+ olive: string[];
64
+ moss: string[];
65
+ forest: string[];
66
+ navy: string[];
67
+ cobalt: string[];
68
+ royal: string[];
69
+ cerulean: string[];
70
+ crimson: string[];
71
+ ruby: string[];
72
+ wine: string[];
73
+ burgundy: string[];
74
+ maroon: string[];
75
+ gold: string[];
76
+ bronze: string[];
77
+ copper: string[];
78
+ lavender: string[];
79
+ lilac: string[];
80
+ mauve: string[];
81
+ orchid: string[];
82
+ coral: string[];
83
+ salmon: string[];
84
+ peach: string[];
85
+ turquoise: string[];
86
+ aqua: string[];
87
+ }
88
+
89
+ /**
90
+ * Returns Forge color palettes (11 shades each, 0-10).
91
+ * Use in native components: `const colors = useColors(); <View style={{ backgroundColor: colors.blue[5] }} />`
92
+ */
93
+ export declare function useColors(): ForgeColors;