expo-dev-client-components 1.0.0
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/.eslintrc.js +5 -0
- package/CHANGELOG.md +15 -0
- package/README.md +37 -0
- package/assets/check-icon.png +0 -0
- package/assets/check-icon@2x.png +0 -0
- package/assets/check-icon@3x.png +0 -0
- package/assets/chevron-right-icon.png +0 -0
- package/assets/chevron-right-icon@2x.png +0 -0
- package/assets/chevron-right-icon@3x.png +0 -0
- package/assets/home-filled-active-icon.png +0 -0
- package/assets/home-filled-active-icon@2x.png +0 -0
- package/assets/home-filled-active-icon@3x.png +0 -0
- package/assets/home-filled-inactive-icon.png +0 -0
- package/assets/home-filled-inactive-icon@2x.png +0 -0
- package/assets/home-filled-inactive-icon@3x.png +0 -0
- package/assets/info-icon.png +0 -0
- package/assets/info-icon@2x.png +0 -0
- package/assets/info-icon@3x.png +0 -0
- package/assets/logo-icon.png +0 -0
- package/assets/logo-icon@2x.png +0 -0
- package/assets/logo-icon@3x.png +0 -0
- package/assets/question-mark-icon.png +0 -0
- package/assets/question-mark-icon@2x.png +0 -0
- package/assets/question-mark-icon@3x.png +0 -0
- package/assets/refresh-icon.png +0 -0
- package/assets/refresh-icon@2x.png +0 -0
- package/assets/refresh-icon@3x.png +0 -0
- package/assets/settings-filled-active-icon.png +0 -0
- package/assets/settings-filled-active-icon@2x.png +0 -0
- package/assets/settings-filled-active-icon@3x.png +0 -0
- package/assets/settings-filled-inactive-icon.png +0 -0
- package/assets/settings-filled-inactive-icon@2x.png +0 -0
- package/assets/settings-filled-inactive-icon@3x.png +0 -0
- package/assets/shake-device-icon.png +0 -0
- package/assets/shake-device-icon@2x.png +0 -0
- package/assets/shake-device-icon@3x.png +0 -0
- package/assets/show-menu-at-launch-icon.png +0 -0
- package/assets/show-menu-at-launch-icon@2x.png +0 -0
- package/assets/show-menu-at-launch-icon@3x.png +0 -0
- package/assets/terminal-icon.png +0 -0
- package/assets/terminal-icon@2x.png +0 -0
- package/assets/terminal-icon@3x.png +0 -0
- package/assets/three-finger-long-press-icon.png +0 -0
- package/assets/three-finger-long-press-icon@2x.png +0 -0
- package/assets/three-finger-long-press-icon@3x.png +0 -0
- package/assets/toolbar-overlay-icon.png +0 -0
- package/assets/toolbar-overlay-icon@2x.png +0 -0
- package/assets/toolbar-overlay-icon@3x.png +0 -0
- package/assets/user-icon.png +0 -0
- package/assets/user-icon@2x.png +0 -0
- package/assets/user-icon@3x.png +0 -0
- package/assets/x-icon.png +0 -0
- package/assets/x-icon@2x.png +0 -0
- package/assets/x-icon@3x.png +0 -0
- package/build/Button.d.ts +52 -0
- package/build/Button.js +154 -0
- package/build/Button.js.map +1 -0
- package/build/Image.d.ts +7 -0
- package/build/Image.js +37 -0
- package/build/Image.js.map +1 -0
- package/build/Text.d.ts +31 -0
- package/build/Text.js +66 -0
- package/build/Text.js.map +1 -0
- package/build/View.d.ts +61 -0
- package/build/View.js +172 -0
- package/build/View.js.map +1 -0
- package/build/icons/CheckIcon.d.ts +3 -0
- package/build/icons/CheckIcon.js +7 -0
- package/build/icons/CheckIcon.js.map +1 -0
- package/build/icons/ChevronRightIcon.d.ts +3 -0
- package/build/icons/ChevronRightIcon.js +7 -0
- package/build/icons/ChevronRightIcon.js.map +1 -0
- package/build/icons/ExpoLogoIcon.d.ts +3 -0
- package/build/icons/ExpoLogoIcon.js +7 -0
- package/build/icons/ExpoLogoIcon.js.map +1 -0
- package/build/icons/HomeFilledIcon.d.ts +7 -0
- package/build/icons/HomeFilledIcon.js +9 -0
- package/build/icons/HomeFilledIcon.js.map +1 -0
- package/build/icons/InfoIcon.d.ts +3 -0
- package/build/icons/InfoIcon.js +7 -0
- package/build/icons/InfoIcon.js.map +1 -0
- package/build/icons/QuestionMarkIcon.d.ts +3 -0
- package/build/icons/QuestionMarkIcon.js +7 -0
- package/build/icons/QuestionMarkIcon.js.map +1 -0
- package/build/icons/RefreshIcon.d.ts +3 -0
- package/build/icons/RefreshIcon.js +7 -0
- package/build/icons/RefreshIcon.js.map +1 -0
- package/build/icons/SettingsFilledIcon.d.ts +7 -0
- package/build/icons/SettingsFilledIcon.js +9 -0
- package/build/icons/SettingsFilledIcon.js.map +1 -0
- package/build/icons/ShakeDeviceIcon.d.ts +3 -0
- package/build/icons/ShakeDeviceIcon.js +7 -0
- package/build/icons/ShakeDeviceIcon.js.map +1 -0
- package/build/icons/ShowMenuIcon.d.ts +3 -0
- package/build/icons/ShowMenuIcon.js +7 -0
- package/build/icons/ShowMenuIcon.js.map +1 -0
- package/build/icons/TerminalIcon.d.ts +3 -0
- package/build/icons/TerminalIcon.js +7 -0
- package/build/icons/TerminalIcon.js.map +1 -0
- package/build/icons/ThreeFingerPressIcon.d.ts +3 -0
- package/build/icons/ThreeFingerPressIcon.js +7 -0
- package/build/icons/ThreeFingerPressIcon.js.map +1 -0
- package/build/icons/ToolbarOverlayIcon.d.ts +3 -0
- package/build/icons/ToolbarOverlayIcon.js +7 -0
- package/build/icons/ToolbarOverlayIcon.js.map +1 -0
- package/build/icons/UserIcon.d.ts +3 -0
- package/build/icons/UserIcon.js +7 -0
- package/build/icons/UserIcon.js.map +1 -0
- package/build/icons/XIcon.d.ts +3 -0
- package/build/icons/XIcon.js +7 -0
- package/build/icons/XIcon.js.map +1 -0
- package/build/icons/index.d.ts +15 -0
- package/build/icons/index.js +16 -0
- package/build/icons/index.js.map +1 -0
- package/build/index.d.ts +7 -0
- package/build/index.js +8 -0
- package/build/index.js.map +1 -0
- package/build/theme.d.ts +345 -0
- package/build/theme.js +191 -0
- package/build/theme.js.map +1 -0
- package/build/useExpoTheme.d.ts +4 -0
- package/build/useExpoTheme.js +10 -0
- package/build/useExpoTheme.js.map +1 -0
- package/package.json +40 -0
- package/src/Button.tsx +199 -0
- package/src/Image.tsx +42 -0
- package/src/Text.tsx +78 -0
- package/src/View.tsx +202 -0
- package/src/icons/CheckIcon.tsx +9 -0
- package/src/icons/ChevronRightIcon.tsx +9 -0
- package/src/icons/ExpoLogoIcon.tsx +9 -0
- package/src/icons/HomeFilledIcon.tsx +15 -0
- package/src/icons/InfoIcon.tsx +9 -0
- package/src/icons/QuestionMarkIcon.tsx +9 -0
- package/src/icons/RefreshIcon.tsx +9 -0
- package/src/icons/SettingsFilledIcon.tsx +15 -0
- package/src/icons/ShakeDeviceIcon.tsx +9 -0
- package/src/icons/ShowMenuIcon.tsx +9 -0
- package/src/icons/TerminalIcon.tsx +9 -0
- package/src/icons/ThreeFingerPressIcon.tsx +9 -0
- package/src/icons/ToolbarOverlayIcon.tsx +9 -0
- package/src/icons/UserIcon.tsx +9 -0
- package/src/icons/XIcon.tsx +9 -0
- package/src/icons/index.ts +15 -0
- package/src/index.ts +7 -0
- package/src/theme.ts +225 -0
- package/src/useExpoTheme.ts +14 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './CheckIcon';
|
|
2
|
+
export * from './ChevronRightIcon';
|
|
3
|
+
export * from './ExpoLogoIcon';
|
|
4
|
+
export * from './HomeFilledIcon';
|
|
5
|
+
export * from './InfoIcon';
|
|
6
|
+
export * from './QuestionMarkIcon';
|
|
7
|
+
export * from './RefreshIcon';
|
|
8
|
+
export * from './ShakeDeviceIcon';
|
|
9
|
+
export * from './ShowMenuIcon';
|
|
10
|
+
export * from './SettingsFilledIcon';
|
|
11
|
+
export * from './TerminalIcon';
|
|
12
|
+
export * from './ThreeFingerPressIcon';
|
|
13
|
+
export * from './ToolbarOverlayIcon';
|
|
14
|
+
export * from './UserIcon';
|
|
15
|
+
export * from './XIcon';
|
package/src/index.ts
ADDED
package/src/theme.ts
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { spacing, lightTheme, darkTheme, borderRadius } from '@expo/styleguide-native';
|
|
2
|
+
import { TextStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export const scale = {
|
|
5
|
+
micro: spacing[0.5],
|
|
6
|
+
tiny: spacing[1],
|
|
7
|
+
small: spacing[3],
|
|
8
|
+
medium: spacing[4],
|
|
9
|
+
large: spacing[6],
|
|
10
|
+
xl: spacing[8],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const padding = {
|
|
14
|
+
padding: {
|
|
15
|
+
micro: { padding: scale.micro },
|
|
16
|
+
tiny: { padding: scale.tiny },
|
|
17
|
+
small: { padding: scale.small },
|
|
18
|
+
medium: { padding: scale.medium },
|
|
19
|
+
large: { padding: scale.large },
|
|
20
|
+
xl: { padding: scale.xl },
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
px: {
|
|
24
|
+
micro: { paddingHorizontal: scale.micro },
|
|
25
|
+
tiny: { paddingHorizontal: scale.tiny },
|
|
26
|
+
small: { paddingHorizontal: scale.small },
|
|
27
|
+
medium: { paddingHorizontal: scale.medium },
|
|
28
|
+
large: { paddingHorizontal: scale.large },
|
|
29
|
+
xl: { paddingHorizontal: scale.xl },
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
py: {
|
|
33
|
+
micro: { paddingVertical: scale.micro },
|
|
34
|
+
tiny: { paddingVertical: scale.tiny },
|
|
35
|
+
small: { paddingVertical: scale.small },
|
|
36
|
+
medium: { paddingVertical: scale.medium },
|
|
37
|
+
large: { paddingVertical: scale.large },
|
|
38
|
+
xl: { paddingVertical: scale.xl },
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const margin = {
|
|
43
|
+
margin: {
|
|
44
|
+
micro: { margin: scale.micro },
|
|
45
|
+
tiny: { margin: scale.tiny },
|
|
46
|
+
small: { margin: scale.small },
|
|
47
|
+
medium: { margin: scale.medium },
|
|
48
|
+
large: { margin: scale.large },
|
|
49
|
+
xl: { margin: scale.xl },
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
mx: {
|
|
53
|
+
micro: { marginHorizontal: scale.micro },
|
|
54
|
+
tiny: { marginHorizontal: scale.tiny },
|
|
55
|
+
small: { marginHorizontal: scale.small },
|
|
56
|
+
medium: { marginHorizontal: scale.medium },
|
|
57
|
+
large: { marginHorizontal: scale.large },
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
my: {
|
|
61
|
+
micro: { marginHorizontal: scale.micro },
|
|
62
|
+
tiny: { marginVertical: scale.tiny },
|
|
63
|
+
small: { marginVertical: scale.small },
|
|
64
|
+
medium: { marginVertical: scale.medium },
|
|
65
|
+
large: { marginVertical: scale.large },
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const rounded = {
|
|
70
|
+
rounded: {
|
|
71
|
+
none: { borderRadius: 0 },
|
|
72
|
+
small: { borderRadius: borderRadius.small },
|
|
73
|
+
medium: { borderRadius: borderRadius.medium },
|
|
74
|
+
large: { borderRadius: borderRadius.large },
|
|
75
|
+
full: { borderRadius: 99999 },
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
roundedTop: {
|
|
79
|
+
none: { borderTopLeftRadius: 0, borderTopRightRadius: 0 },
|
|
80
|
+
small: { borderTopLeftRadius: borderRadius.small, borderTopRightRadius: borderRadius.small },
|
|
81
|
+
medium: {
|
|
82
|
+
borderTopLeftRadius: borderRadius.medium,
|
|
83
|
+
borderTopRightRadius: borderRadius.medium,
|
|
84
|
+
},
|
|
85
|
+
large: { borderTopLeftRadius: borderRadius.large, borderTopRightRadius: borderRadius.large },
|
|
86
|
+
full: { borderTopLeftRadius: 9999, borderTopRightRadius: 9999 },
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
roundedBottom: {
|
|
90
|
+
none: { borderBottomLeftRadius: 0, borderBottomRightRadius: 0 },
|
|
91
|
+
small: {
|
|
92
|
+
borderBottomLeftRadius: borderRadius.small,
|
|
93
|
+
borderBottomRightRadius: borderRadius.small,
|
|
94
|
+
},
|
|
95
|
+
medium: {
|
|
96
|
+
borderBottomLeftRadius: borderRadius.medium,
|
|
97
|
+
borderBottomRightRadius: borderRadius.medium,
|
|
98
|
+
},
|
|
99
|
+
large: {
|
|
100
|
+
borderBottomLeftRadius: borderRadius.large,
|
|
101
|
+
borderBottomRightRadius: borderRadius.large,
|
|
102
|
+
},
|
|
103
|
+
full: { borderBottomLeftRadius: 9999, borderBottomRightRadius: 9999 },
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const text = {
|
|
108
|
+
align: {
|
|
109
|
+
center: { textAlign: 'center' as TextStyle['textAlign'] },
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
size: {
|
|
113
|
+
small: {
|
|
114
|
+
fontSize: 12,
|
|
115
|
+
lineHeight: 14,
|
|
116
|
+
},
|
|
117
|
+
medium: {
|
|
118
|
+
fontSize: 16,
|
|
119
|
+
lineHeight: 18,
|
|
120
|
+
},
|
|
121
|
+
large: {
|
|
122
|
+
fontSize: 18,
|
|
123
|
+
lineHeight: 24,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
leading: {
|
|
128
|
+
large: { lineHeight: 18 },
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
type: {
|
|
132
|
+
mono: {
|
|
133
|
+
fontFamily: 'Menlo',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
weight: {
|
|
138
|
+
thin: { fontWeight: '100' as TextStyle['fontWeight'] },
|
|
139
|
+
extralight: { fontWeight: '200' as TextStyle['fontWeight'] },
|
|
140
|
+
light: { fontWeight: '300' as TextStyle['fontWeight'] },
|
|
141
|
+
normal: { fontWeight: '400' as TextStyle['fontWeight'] },
|
|
142
|
+
medium: { fontWeight: '500' as TextStyle['fontWeight'] },
|
|
143
|
+
semibold: { fontWeight: '600' as TextStyle['fontWeight'] },
|
|
144
|
+
bold: { fontWeight: '700' as TextStyle['fontWeight'] },
|
|
145
|
+
extrabold: { fontWeight: '800' as TextStyle['fontWeight'] },
|
|
146
|
+
black: { fontWeight: '900' as TextStyle['fontWeight'] },
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
color: {
|
|
150
|
+
default: { color: lightTheme.text.default },
|
|
151
|
+
error: { color: lightTheme.text.error },
|
|
152
|
+
warning: { color: lightTheme.text.warning },
|
|
153
|
+
success: { color: lightTheme.text.success },
|
|
154
|
+
secondary: { color: lightTheme.text.secondary },
|
|
155
|
+
primary: { color: lightTheme.button.primary.background },
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export const textDark = {
|
|
160
|
+
base: {
|
|
161
|
+
color: darkTheme.text.default,
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
color: {
|
|
165
|
+
default: { color: darkTheme.text.default },
|
|
166
|
+
error: { color: darkTheme.text.error },
|
|
167
|
+
warning: { color: darkTheme.text.warning },
|
|
168
|
+
success: { color: darkTheme.text.success },
|
|
169
|
+
secondary: { color: darkTheme.text.secondary },
|
|
170
|
+
primary: { color: darkTheme.button.primary.background },
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export const bg = {
|
|
175
|
+
none: { backgroundColor: 'transparent' },
|
|
176
|
+
default: { backgroundColor: lightTheme.background.default },
|
|
177
|
+
secondary: { backgroundColor: lightTheme.background.secondary },
|
|
178
|
+
success: { backgroundColor: lightTheme.background.success },
|
|
179
|
+
warning: { backgroundColor: lightTheme.background.warning },
|
|
180
|
+
error: { backgroundColor: lightTheme.background.error },
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export const bgDark = {
|
|
184
|
+
default: { backgroundColor: darkTheme.background.default },
|
|
185
|
+
secondary: { backgroundColor: darkTheme.background.secondary },
|
|
186
|
+
success: { backgroundColor: darkTheme.background.success },
|
|
187
|
+
warning: { backgroundColor: darkTheme.background.warning },
|
|
188
|
+
error: { backgroundColor: darkTheme.background.error },
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
type NavigationTheme = {
|
|
192
|
+
dark: boolean;
|
|
193
|
+
colors: {
|
|
194
|
+
primary: string;
|
|
195
|
+
background: string;
|
|
196
|
+
card: string;
|
|
197
|
+
text: string;
|
|
198
|
+
border: string;
|
|
199
|
+
notification: string;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export const lightNavigationTheme: NavigationTheme = {
|
|
204
|
+
dark: false,
|
|
205
|
+
colors: {
|
|
206
|
+
primary: lightTheme.button.primary.background,
|
|
207
|
+
background: lightTheme.background.secondary,
|
|
208
|
+
card: lightTheme.background.default,
|
|
209
|
+
text: lightTheme.text.default,
|
|
210
|
+
border: lightTheme.border.default,
|
|
211
|
+
notification: lightTheme.highlight.accent,
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
export const darkNavigationTheme: NavigationTheme = {
|
|
216
|
+
dark: true,
|
|
217
|
+
colors: {
|
|
218
|
+
primary: darkTheme.button.primary.background,
|
|
219
|
+
background: darkTheme.background.secondary,
|
|
220
|
+
card: darkTheme.background.default,
|
|
221
|
+
text: darkTheme.text.default,
|
|
222
|
+
border: darkTheme.border.default,
|
|
223
|
+
notification: darkTheme.highlight.accent,
|
|
224
|
+
},
|
|
225
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { lightTheme, darkTheme } from '@expo/styleguide-native';
|
|
2
|
+
import { useColorScheme } from 'react-native';
|
|
3
|
+
|
|
4
|
+
type ExpoTheme = typeof lightTheme;
|
|
5
|
+
|
|
6
|
+
export function useExpoTheme(): ExpoTheme {
|
|
7
|
+
const colorScheme = useColorScheme();
|
|
8
|
+
|
|
9
|
+
if (colorScheme === 'dark') {
|
|
10
|
+
return darkTheme;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return lightTheme;
|
|
14
|
+
}
|