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.
Files changed (148) hide show
  1. package/.eslintrc.js +5 -0
  2. package/CHANGELOG.md +15 -0
  3. package/README.md +37 -0
  4. package/assets/check-icon.png +0 -0
  5. package/assets/check-icon@2x.png +0 -0
  6. package/assets/check-icon@3x.png +0 -0
  7. package/assets/chevron-right-icon.png +0 -0
  8. package/assets/chevron-right-icon@2x.png +0 -0
  9. package/assets/chevron-right-icon@3x.png +0 -0
  10. package/assets/home-filled-active-icon.png +0 -0
  11. package/assets/home-filled-active-icon@2x.png +0 -0
  12. package/assets/home-filled-active-icon@3x.png +0 -0
  13. package/assets/home-filled-inactive-icon.png +0 -0
  14. package/assets/home-filled-inactive-icon@2x.png +0 -0
  15. package/assets/home-filled-inactive-icon@3x.png +0 -0
  16. package/assets/info-icon.png +0 -0
  17. package/assets/info-icon@2x.png +0 -0
  18. package/assets/info-icon@3x.png +0 -0
  19. package/assets/logo-icon.png +0 -0
  20. package/assets/logo-icon@2x.png +0 -0
  21. package/assets/logo-icon@3x.png +0 -0
  22. package/assets/question-mark-icon.png +0 -0
  23. package/assets/question-mark-icon@2x.png +0 -0
  24. package/assets/question-mark-icon@3x.png +0 -0
  25. package/assets/refresh-icon.png +0 -0
  26. package/assets/refresh-icon@2x.png +0 -0
  27. package/assets/refresh-icon@3x.png +0 -0
  28. package/assets/settings-filled-active-icon.png +0 -0
  29. package/assets/settings-filled-active-icon@2x.png +0 -0
  30. package/assets/settings-filled-active-icon@3x.png +0 -0
  31. package/assets/settings-filled-inactive-icon.png +0 -0
  32. package/assets/settings-filled-inactive-icon@2x.png +0 -0
  33. package/assets/settings-filled-inactive-icon@3x.png +0 -0
  34. package/assets/shake-device-icon.png +0 -0
  35. package/assets/shake-device-icon@2x.png +0 -0
  36. package/assets/shake-device-icon@3x.png +0 -0
  37. package/assets/show-menu-at-launch-icon.png +0 -0
  38. package/assets/show-menu-at-launch-icon@2x.png +0 -0
  39. package/assets/show-menu-at-launch-icon@3x.png +0 -0
  40. package/assets/terminal-icon.png +0 -0
  41. package/assets/terminal-icon@2x.png +0 -0
  42. package/assets/terminal-icon@3x.png +0 -0
  43. package/assets/three-finger-long-press-icon.png +0 -0
  44. package/assets/three-finger-long-press-icon@2x.png +0 -0
  45. package/assets/three-finger-long-press-icon@3x.png +0 -0
  46. package/assets/toolbar-overlay-icon.png +0 -0
  47. package/assets/toolbar-overlay-icon@2x.png +0 -0
  48. package/assets/toolbar-overlay-icon@3x.png +0 -0
  49. package/assets/user-icon.png +0 -0
  50. package/assets/user-icon@2x.png +0 -0
  51. package/assets/user-icon@3x.png +0 -0
  52. package/assets/x-icon.png +0 -0
  53. package/assets/x-icon@2x.png +0 -0
  54. package/assets/x-icon@3x.png +0 -0
  55. package/build/Button.d.ts +52 -0
  56. package/build/Button.js +154 -0
  57. package/build/Button.js.map +1 -0
  58. package/build/Image.d.ts +7 -0
  59. package/build/Image.js +37 -0
  60. package/build/Image.js.map +1 -0
  61. package/build/Text.d.ts +31 -0
  62. package/build/Text.js +66 -0
  63. package/build/Text.js.map +1 -0
  64. package/build/View.d.ts +61 -0
  65. package/build/View.js +172 -0
  66. package/build/View.js.map +1 -0
  67. package/build/icons/CheckIcon.d.ts +3 -0
  68. package/build/icons/CheckIcon.js +7 -0
  69. package/build/icons/CheckIcon.js.map +1 -0
  70. package/build/icons/ChevronRightIcon.d.ts +3 -0
  71. package/build/icons/ChevronRightIcon.js +7 -0
  72. package/build/icons/ChevronRightIcon.js.map +1 -0
  73. package/build/icons/ExpoLogoIcon.d.ts +3 -0
  74. package/build/icons/ExpoLogoIcon.js +7 -0
  75. package/build/icons/ExpoLogoIcon.js.map +1 -0
  76. package/build/icons/HomeFilledIcon.d.ts +7 -0
  77. package/build/icons/HomeFilledIcon.js +9 -0
  78. package/build/icons/HomeFilledIcon.js.map +1 -0
  79. package/build/icons/InfoIcon.d.ts +3 -0
  80. package/build/icons/InfoIcon.js +7 -0
  81. package/build/icons/InfoIcon.js.map +1 -0
  82. package/build/icons/QuestionMarkIcon.d.ts +3 -0
  83. package/build/icons/QuestionMarkIcon.js +7 -0
  84. package/build/icons/QuestionMarkIcon.js.map +1 -0
  85. package/build/icons/RefreshIcon.d.ts +3 -0
  86. package/build/icons/RefreshIcon.js +7 -0
  87. package/build/icons/RefreshIcon.js.map +1 -0
  88. package/build/icons/SettingsFilledIcon.d.ts +7 -0
  89. package/build/icons/SettingsFilledIcon.js +9 -0
  90. package/build/icons/SettingsFilledIcon.js.map +1 -0
  91. package/build/icons/ShakeDeviceIcon.d.ts +3 -0
  92. package/build/icons/ShakeDeviceIcon.js +7 -0
  93. package/build/icons/ShakeDeviceIcon.js.map +1 -0
  94. package/build/icons/ShowMenuIcon.d.ts +3 -0
  95. package/build/icons/ShowMenuIcon.js +7 -0
  96. package/build/icons/ShowMenuIcon.js.map +1 -0
  97. package/build/icons/TerminalIcon.d.ts +3 -0
  98. package/build/icons/TerminalIcon.js +7 -0
  99. package/build/icons/TerminalIcon.js.map +1 -0
  100. package/build/icons/ThreeFingerPressIcon.d.ts +3 -0
  101. package/build/icons/ThreeFingerPressIcon.js +7 -0
  102. package/build/icons/ThreeFingerPressIcon.js.map +1 -0
  103. package/build/icons/ToolbarOverlayIcon.d.ts +3 -0
  104. package/build/icons/ToolbarOverlayIcon.js +7 -0
  105. package/build/icons/ToolbarOverlayIcon.js.map +1 -0
  106. package/build/icons/UserIcon.d.ts +3 -0
  107. package/build/icons/UserIcon.js +7 -0
  108. package/build/icons/UserIcon.js.map +1 -0
  109. package/build/icons/XIcon.d.ts +3 -0
  110. package/build/icons/XIcon.js +7 -0
  111. package/build/icons/XIcon.js.map +1 -0
  112. package/build/icons/index.d.ts +15 -0
  113. package/build/icons/index.js +16 -0
  114. package/build/icons/index.js.map +1 -0
  115. package/build/index.d.ts +7 -0
  116. package/build/index.js +8 -0
  117. package/build/index.js.map +1 -0
  118. package/build/theme.d.ts +345 -0
  119. package/build/theme.js +191 -0
  120. package/build/theme.js.map +1 -0
  121. package/build/useExpoTheme.d.ts +4 -0
  122. package/build/useExpoTheme.js +10 -0
  123. package/build/useExpoTheme.js.map +1 -0
  124. package/package.json +40 -0
  125. package/src/Button.tsx +199 -0
  126. package/src/Image.tsx +42 -0
  127. package/src/Text.tsx +78 -0
  128. package/src/View.tsx +202 -0
  129. package/src/icons/CheckIcon.tsx +9 -0
  130. package/src/icons/ChevronRightIcon.tsx +9 -0
  131. package/src/icons/ExpoLogoIcon.tsx +9 -0
  132. package/src/icons/HomeFilledIcon.tsx +15 -0
  133. package/src/icons/InfoIcon.tsx +9 -0
  134. package/src/icons/QuestionMarkIcon.tsx +9 -0
  135. package/src/icons/RefreshIcon.tsx +9 -0
  136. package/src/icons/SettingsFilledIcon.tsx +15 -0
  137. package/src/icons/ShakeDeviceIcon.tsx +9 -0
  138. package/src/icons/ShowMenuIcon.tsx +9 -0
  139. package/src/icons/TerminalIcon.tsx +9 -0
  140. package/src/icons/ThreeFingerPressIcon.tsx +9 -0
  141. package/src/icons/ToolbarOverlayIcon.tsx +9 -0
  142. package/src/icons/UserIcon.tsx +9 -0
  143. package/src/icons/XIcon.tsx +9 -0
  144. package/src/icons/index.ts +15 -0
  145. package/src/index.ts +7 -0
  146. package/src/theme.ts +225 -0
  147. package/src/useExpoTheme.ts +14 -0
  148. 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
@@ -0,0 +1,7 @@
1
+ export * from './icons';
2
+ export * from './Button';
3
+ export * from './Image';
4
+ export * from './Text';
5
+ export * from './theme';
6
+ export * from './View';
7
+ export * from './useExpoTheme';
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
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ // @generated by expo-module-scripts
2
+ {
3
+ "extends": "expo-module-scripts/tsconfig.base",
4
+ "compilerOptions": {
5
+ "outDir": "./build"
6
+ },
7
+ "include": ["./src"],
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*"]
9
+ }