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
package/src/Button.tsx
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { lightTheme, darkTheme, borderRadius, shadows, palette } from '@expo/styleguide-native';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Pressable as RNPressable, Text as RNText, Animated, useColorScheme } from 'react-native';
|
|
4
|
+
import { create } from 'react-native-primitives';
|
|
5
|
+
|
|
6
|
+
import { rounded, margin, padding, text } from './theme';
|
|
7
|
+
|
|
8
|
+
const AnimatedPressable = Animated.createAnimatedComponent(RNPressable);
|
|
9
|
+
|
|
10
|
+
const Text = create(RNText, {
|
|
11
|
+
base: {
|
|
12
|
+
fontWeight: '400',
|
|
13
|
+
color: lightTheme.text.default,
|
|
14
|
+
fontSize: 16,
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
props: {
|
|
18
|
+
accessibilityRole: 'text',
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
variants: {
|
|
22
|
+
...text,
|
|
23
|
+
|
|
24
|
+
color: {
|
|
25
|
+
primary: { color: lightTheme.button.primary.foreground },
|
|
26
|
+
secondary: { color: lightTheme.button.secondary.foreground },
|
|
27
|
+
tertiary: { color: lightTheme.button.tertiary.foreground },
|
|
28
|
+
ghost: { color: lightTheme.button.ghost.foreground },
|
|
29
|
+
transparent: { color: lightTheme.button.transparent.foreground },
|
|
30
|
+
default: { color: lightTheme.text.default },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
selectors: {
|
|
35
|
+
dark: {
|
|
36
|
+
base: {
|
|
37
|
+
color: darkTheme.text.default,
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
color: {
|
|
41
|
+
primary: { color: darkTheme.button.primary.foreground },
|
|
42
|
+
secondary: { color: darkTheme.button.secondary.foreground },
|
|
43
|
+
tertiary: { color: darkTheme.button.tertiary.foreground },
|
|
44
|
+
ghost: { color: darkTheme.button.ghost.foreground },
|
|
45
|
+
transparent: { color: darkTheme.button.transparent.foreground },
|
|
46
|
+
default: { color: darkTheme.text.default },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const Container = create(AnimatedPressable, {
|
|
53
|
+
base: {
|
|
54
|
+
overflow: 'hidden',
|
|
55
|
+
borderRadius: borderRadius.medium,
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
props: {
|
|
59
|
+
accessibilityRole: 'button',
|
|
60
|
+
android_disableSound: true,
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
variants: {
|
|
64
|
+
bg: {
|
|
65
|
+
default: { backgroundColor: lightTheme.background.default },
|
|
66
|
+
primary: { backgroundColor: lightTheme.button.primary.background },
|
|
67
|
+
secondary: { backgroundColor: lightTheme.button.secondary.background },
|
|
68
|
+
tertiary: { backgroundColor: lightTheme.button.tertiary.background },
|
|
69
|
+
ghost: { backgroundColor: lightTheme.button.ghost.background },
|
|
70
|
+
transparent: { backgroundColor: lightTheme.button.transparent.background },
|
|
71
|
+
disabled: { backgroundColor: lightTheme.status.default },
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
border: {
|
|
75
|
+
ghost: { borderColor: lightTheme.button.ghost.border, borderWidth: 1 },
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
shadow: {
|
|
79
|
+
button: shadows.button,
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
...rounded,
|
|
83
|
+
...padding,
|
|
84
|
+
...margin,
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
selectors: {
|
|
88
|
+
dark: {
|
|
89
|
+
bg: {
|
|
90
|
+
default: { backgroundColor: darkTheme.background.default },
|
|
91
|
+
primary: { backgroundColor: darkTheme.button.primary.background },
|
|
92
|
+
secondary: { backgroundColor: darkTheme.button.secondary.background },
|
|
93
|
+
tertiary: { backgroundColor: darkTheme.button.tertiary.background },
|
|
94
|
+
ghost: { backgroundColor: darkTheme.button.ghost.background },
|
|
95
|
+
transparent: { backgroundColor: darkTheme.button.transparent.background },
|
|
96
|
+
disabled: { backgroundColor: darkTheme.status.default },
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
export const Button = {
|
|
103
|
+
Container,
|
|
104
|
+
ScaleOnPressContainer,
|
|
105
|
+
Text,
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
type ScalingPressableProps = {
|
|
109
|
+
minScale?: number;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
type NoOptionals<T> = {
|
|
113
|
+
[P in keyof T]-?: T[P];
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
type ContainerProps = React.ComponentProps<typeof Container>;
|
|
117
|
+
type ContainerBackgroundColors = NoOptionals<ContainerProps>['bg'];
|
|
118
|
+
|
|
119
|
+
const lightHighlightColorMap: Record<ContainerBackgroundColors, string> = {
|
|
120
|
+
disabled: 'transparent',
|
|
121
|
+
default: lightTheme.background.secondary,
|
|
122
|
+
primary: lightTheme.background.tertiary,
|
|
123
|
+
secondary: lightTheme.background.quaternary,
|
|
124
|
+
tertiary: palette.light.gray[600],
|
|
125
|
+
ghost: lightTheme.background.tertiary,
|
|
126
|
+
transparent: lightTheme.background.secondary,
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const darkHighlightColorMap: Record<ContainerBackgroundColors, string> = {
|
|
130
|
+
disabled: 'transparent',
|
|
131
|
+
default: darkTheme.background.secondary,
|
|
132
|
+
primary: darkTheme.background.tertiary,
|
|
133
|
+
secondary: darkTheme.background.quaternary,
|
|
134
|
+
tertiary: palette.dark.gray[600],
|
|
135
|
+
ghost: darkTheme.background.tertiary,
|
|
136
|
+
transparent: darkTheme.background.secondary,
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const highlightColorMap = {
|
|
140
|
+
dark: darkHighlightColorMap,
|
|
141
|
+
light: lightHighlightColorMap,
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
function ScaleOnPressContainer({
|
|
145
|
+
minScale = 0.975,
|
|
146
|
+
...props
|
|
147
|
+
}: React.ComponentProps<typeof Container> & ScalingPressableProps) {
|
|
148
|
+
const theme = useColorScheme();
|
|
149
|
+
const animatedValue = React.useRef(new Animated.Value(0));
|
|
150
|
+
const [isPressing, setIsPressing] = React.useState(false);
|
|
151
|
+
|
|
152
|
+
const onPressIn = React.useCallback(() => {
|
|
153
|
+
setIsPressing(true);
|
|
154
|
+
|
|
155
|
+
Animated.spring(animatedValue.current, {
|
|
156
|
+
toValue: 1,
|
|
157
|
+
stiffness: 1000,
|
|
158
|
+
damping: 500,
|
|
159
|
+
mass: 3,
|
|
160
|
+
overshootClamping: true,
|
|
161
|
+
useNativeDriver: true,
|
|
162
|
+
}).start();
|
|
163
|
+
}, []);
|
|
164
|
+
|
|
165
|
+
const onPressOut = React.useCallback(() => {
|
|
166
|
+
setIsPressing(false);
|
|
167
|
+
Animated.spring(animatedValue.current, {
|
|
168
|
+
toValue: 0,
|
|
169
|
+
stiffness: 1000,
|
|
170
|
+
damping: 500,
|
|
171
|
+
mass: 3,
|
|
172
|
+
overshootClamping: true,
|
|
173
|
+
useNativeDriver: true,
|
|
174
|
+
}).start();
|
|
175
|
+
}, []);
|
|
176
|
+
|
|
177
|
+
const scale = animatedValue.current.interpolate({
|
|
178
|
+
inputRange: [0, 1],
|
|
179
|
+
outputRange: [1, minScale],
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
const scaleStyle = { transform: [{ scale }] };
|
|
183
|
+
|
|
184
|
+
let backgroundColor = 'transparent';
|
|
185
|
+
|
|
186
|
+
if (props.bg && isPressing && theme != null) {
|
|
187
|
+
backgroundColor = highlightColorMap[theme][props.bg];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const underlayStyle = {
|
|
191
|
+
backgroundColor,
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
return (
|
|
195
|
+
<Container onPressIn={onPressIn} onPressOut={onPressOut} {...props} style={[scaleStyle]}>
|
|
196
|
+
<Animated.View style={underlayStyle}>{props.children}</Animated.View>
|
|
197
|
+
</Container>
|
|
198
|
+
);
|
|
199
|
+
}
|
package/src/Image.tsx
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { borderRadius, iconSize } from '@expo/styleguide-native';
|
|
2
|
+
import { Image as RNImage } from 'react-native';
|
|
3
|
+
import { create } from 'react-native-primitives';
|
|
4
|
+
|
|
5
|
+
import { scale } from './theme';
|
|
6
|
+
|
|
7
|
+
export const Image = create(RNImage, {
|
|
8
|
+
base: {
|
|
9
|
+
resizeMode: 'cover',
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
tiny: {
|
|
15
|
+
height: scale.small,
|
|
16
|
+
width: scale.small,
|
|
17
|
+
},
|
|
18
|
+
small: {
|
|
19
|
+
height: iconSize.small,
|
|
20
|
+
width: iconSize.small,
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
large: {
|
|
24
|
+
height: iconSize.large,
|
|
25
|
+
width: iconSize.large,
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
xl: {
|
|
29
|
+
height: scale.xl,
|
|
30
|
+
width: scale.xl,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
rounded: {
|
|
35
|
+
small: { borderRadius: borderRadius.small },
|
|
36
|
+
medium: { borderRadius: borderRadius.medium },
|
|
37
|
+
large: { borderRadius: borderRadius.large },
|
|
38
|
+
huge: { borderRadius: borderRadius.huge },
|
|
39
|
+
full: { borderRadius: 99999 },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|
package/src/Text.tsx
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { lightTheme } from '@expo/styleguide-native';
|
|
2
|
+
import { Text as RNText, TextInput as RNTextInput } from 'react-native';
|
|
3
|
+
import { create } from 'react-native-primitives';
|
|
4
|
+
|
|
5
|
+
import { text, textDark } from './theme';
|
|
6
|
+
|
|
7
|
+
export const Heading = create(RNText, {
|
|
8
|
+
base: {
|
|
9
|
+
fontSize: 22,
|
|
10
|
+
lineHeight: 28,
|
|
11
|
+
fontWeight: '600',
|
|
12
|
+
color: lightTheme.text.default,
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
props: {
|
|
16
|
+
accessibilityRole: 'header',
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
variants: {
|
|
20
|
+
...text,
|
|
21
|
+
|
|
22
|
+
size: {
|
|
23
|
+
small: {
|
|
24
|
+
fontSize: 18,
|
|
25
|
+
lineHeight: 20,
|
|
26
|
+
},
|
|
27
|
+
medium: {
|
|
28
|
+
fontSize: 22,
|
|
29
|
+
lineHeight: 28,
|
|
30
|
+
},
|
|
31
|
+
large: {
|
|
32
|
+
fontSize: 28,
|
|
33
|
+
lineHeight: 32,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
selectors: {
|
|
39
|
+
dark: textDark,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const Text = create(RNText, {
|
|
44
|
+
base: {
|
|
45
|
+
fontWeight: 'normal',
|
|
46
|
+
color: lightTheme.text.default,
|
|
47
|
+
fontSize: 16,
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
props: {
|
|
51
|
+
accessibilityRole: 'text',
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
variants: {
|
|
55
|
+
...text,
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
selectors: {
|
|
59
|
+
dark: textDark,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const TextInput = create(RNTextInput, {
|
|
64
|
+
base: {
|
|
65
|
+
fontWeight: 'normal',
|
|
66
|
+
color: lightTheme.text.default,
|
|
67
|
+
fontSize: 16,
|
|
68
|
+
lineHeight: 18,
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
variants: {
|
|
72
|
+
...text,
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
selectors: {
|
|
76
|
+
dark: textDark,
|
|
77
|
+
},
|
|
78
|
+
});
|
package/src/View.tsx
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { lightTheme, darkTheme, shadows, iconSize } from '@expo/styleguide-native';
|
|
2
|
+
import { View as RNView } from 'react-native';
|
|
3
|
+
import { create } from 'react-native-primitives';
|
|
4
|
+
|
|
5
|
+
import { scale, padding, margin, rounded, bg, bgDark } from './theme';
|
|
6
|
+
|
|
7
|
+
export const View = create(RNView, {
|
|
8
|
+
variants: {
|
|
9
|
+
overflow: {
|
|
10
|
+
hidden: {
|
|
11
|
+
overflow: 'hidden',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
align: {
|
|
16
|
+
centered: {
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
flex: {
|
|
23
|
+
'1': { flex: 1 },
|
|
24
|
+
'0': { flex: 0 },
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
shrink: {
|
|
28
|
+
'1': { flexShrink: 1 },
|
|
29
|
+
'0': { flexShrink: 0 },
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
bg,
|
|
33
|
+
|
|
34
|
+
border: {
|
|
35
|
+
default: { borderColor: lightTheme.border.default, borderWidth: 1 },
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
...rounded,
|
|
39
|
+
|
|
40
|
+
shadow: {
|
|
41
|
+
micro: shadows.micro,
|
|
42
|
+
tiny: shadows.tiny,
|
|
43
|
+
small: shadows.small,
|
|
44
|
+
medium: shadows.medium,
|
|
45
|
+
button: shadows.button,
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
width: {
|
|
49
|
+
micro: { width: iconSize.micro },
|
|
50
|
+
tiny: { width: iconSize.tiny },
|
|
51
|
+
small: { width: iconSize.small },
|
|
52
|
+
medium: { width: iconSize.regular },
|
|
53
|
+
large: { width: iconSize.large },
|
|
54
|
+
xl: { width: scale.xl },
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
height: {
|
|
58
|
+
micro: { height: iconSize.micro },
|
|
59
|
+
tiny: { height: iconSize.tiny },
|
|
60
|
+
small: { height: iconSize.small },
|
|
61
|
+
medium: { height: iconSize.regular },
|
|
62
|
+
large: { height: iconSize.large },
|
|
63
|
+
xl: { height: scale.xl },
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
...padding,
|
|
67
|
+
...margin,
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
selectors: {
|
|
71
|
+
dark: {
|
|
72
|
+
bg: bgDark,
|
|
73
|
+
|
|
74
|
+
border: {
|
|
75
|
+
default: { borderColor: darkTheme.border.default, borderWidth: 1 },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
light: {
|
|
80
|
+
bg: {},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export const Row = create(RNView, {
|
|
86
|
+
base: {
|
|
87
|
+
flexDirection: 'row',
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
variants: {
|
|
91
|
+
bg,
|
|
92
|
+
|
|
93
|
+
align: {
|
|
94
|
+
center: { alignItems: 'center' },
|
|
95
|
+
start: { alignItems: 'flex-start' },
|
|
96
|
+
end: { alignItems: 'flex-end' },
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
...padding,
|
|
100
|
+
...margin,
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
selectors: {
|
|
104
|
+
dark: {
|
|
105
|
+
bg: bgDark,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const Horizontal = create(RNView, {
|
|
111
|
+
variants: {
|
|
112
|
+
size: {
|
|
113
|
+
flex: { flex: 1 },
|
|
114
|
+
micro: { width: scale.micro },
|
|
115
|
+
tiny: { width: scale.tiny },
|
|
116
|
+
small: { width: scale.small },
|
|
117
|
+
medium: { width: scale.medium },
|
|
118
|
+
large: { width: scale.large },
|
|
119
|
+
xl: { width: scale.xl },
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const Vertical = create(RNView, {
|
|
125
|
+
variants: {
|
|
126
|
+
size: {
|
|
127
|
+
flex: { flex: 1 },
|
|
128
|
+
micro: { height: scale.micro },
|
|
129
|
+
tiny: { height: scale.tiny },
|
|
130
|
+
small: { height: scale.small },
|
|
131
|
+
medium: { height: scale.medium },
|
|
132
|
+
large: { height: scale.large },
|
|
133
|
+
xl: { height: scale.xl },
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
export const Spacer = {
|
|
139
|
+
Vertical,
|
|
140
|
+
Horizontal,
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export const Divider = create(RNView, {
|
|
144
|
+
base: {
|
|
145
|
+
borderWidth: 0.5,
|
|
146
|
+
borderColor: lightTheme.border.default,
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
variants: {
|
|
150
|
+
weight: {
|
|
151
|
+
thin: { borderWidth: 0.5 },
|
|
152
|
+
normal: { borderWidth: 1 },
|
|
153
|
+
heavy: { borderWidth: 2 },
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
...margin,
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
selectors: {
|
|
160
|
+
dark: {
|
|
161
|
+
borderColor: darkTheme.border.default,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
export const StatusIndicator = create(RNView, {
|
|
167
|
+
base: {
|
|
168
|
+
backgroundColor: lightTheme.status.default,
|
|
169
|
+
borderRadius: 9999,
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
variants: {
|
|
173
|
+
status: {
|
|
174
|
+
info: { backgroundColor: lightTheme.status.info },
|
|
175
|
+
success: { backgroundColor: lightTheme.status.success },
|
|
176
|
+
warning: { backgroundColor: lightTheme.status.warning },
|
|
177
|
+
error: { backgroundColor: lightTheme.status.error },
|
|
178
|
+
default: { backgroundColor: lightTheme.status.default },
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
size: {
|
|
182
|
+
small: {
|
|
183
|
+
width: scale.small,
|
|
184
|
+
height: scale.small,
|
|
185
|
+
},
|
|
186
|
+
medium: {
|
|
187
|
+
width: scale.medium,
|
|
188
|
+
height: scale.medium,
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
selectors: {
|
|
194
|
+
dark: {
|
|
195
|
+
info: { backgroundColor: darkTheme.status.info },
|
|
196
|
+
success: { backgroundColor: darkTheme.status.success },
|
|
197
|
+
warning: { backgroundColor: darkTheme.status.warning },
|
|
198
|
+
error: { backgroundColor: darkTheme.status.error },
|
|
199
|
+
default: { backgroundColor: darkTheme.status.default },
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Image } from '../Image';
|
|
4
|
+
|
|
5
|
+
const icon = require('../../assets/chevron-right-icon.png');
|
|
6
|
+
|
|
7
|
+
export function ChevronRightIcon(props: Partial<React.ComponentProps<typeof Image>>) {
|
|
8
|
+
return <Image source={icon} {...props} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Image } from '../Image';
|
|
4
|
+
|
|
5
|
+
const activeIcon = require('../../assets/home-filled-active-icon.png');
|
|
6
|
+
const inactiveIcon = require('../../assets/home-filled-inactive-icon.png');
|
|
7
|
+
|
|
8
|
+
type TabBarIconProps = Partial<React.ComponentProps<typeof Image>> & {
|
|
9
|
+
focused?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function HomeFilledIcon(props: TabBarIconProps) {
|
|
13
|
+
const icon = props.focused ? activeIcon : inactiveIcon;
|
|
14
|
+
return <Image source={icon} {...props} />;
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Image } from '../Image';
|
|
4
|
+
|
|
5
|
+
const icon = require('../../assets/question-mark-icon.png');
|
|
6
|
+
|
|
7
|
+
export function QuestionMarkIcon(props: Partial<React.ComponentProps<typeof Image>>) {
|
|
8
|
+
return <Image source={icon} {...props} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Image } from '../Image';
|
|
4
|
+
|
|
5
|
+
const activeIcon = require('../../assets/settings-filled-active-icon.png');
|
|
6
|
+
const inactiveIcon = require('../../assets/settings-filled-inactive-icon.png');
|
|
7
|
+
|
|
8
|
+
type TabBarIconProps = Partial<React.ComponentProps<typeof Image>> & {
|
|
9
|
+
focused?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function SettingsFilledIcon(props: TabBarIconProps) {
|
|
13
|
+
const icon = props.focused ? activeIcon : inactiveIcon;
|
|
14
|
+
return <Image source={icon} {...props} />;
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Image } from '../Image';
|
|
4
|
+
|
|
5
|
+
const icon = require('../../assets/shake-device-icon.png');
|
|
6
|
+
|
|
7
|
+
export function ShakeDeviceIcon(props: Partial<React.ComponentProps<typeof Image>>) {
|
|
8
|
+
return <Image {...props} source={icon} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Image } from '../Image';
|
|
4
|
+
|
|
5
|
+
const icon = require('../../assets/show-menu-at-launch-icon.png');
|
|
6
|
+
|
|
7
|
+
export function ShowMenuIcon(props: Partial<React.ComponentProps<typeof Image>>) {
|
|
8
|
+
return <Image source={icon} {...props} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Image } from '../Image';
|
|
4
|
+
|
|
5
|
+
const icon = require('../../assets/terminal-icon.png');
|
|
6
|
+
|
|
7
|
+
export function TerminalIcon(props: Partial<React.ComponentProps<typeof Image>>) {
|
|
8
|
+
return <Image source={icon} {...props} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Image } from '../Image';
|
|
4
|
+
|
|
5
|
+
const icon = require('../../assets/three-finger-long-press-icon.png');
|
|
6
|
+
|
|
7
|
+
export function ThreeFingerPressIcon(props: Partial<React.ComponentProps<typeof Image>>) {
|
|
8
|
+
return <Image source={icon} {...props} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Image } from '../Image';
|
|
4
|
+
|
|
5
|
+
const icon = require('../../assets/toolbar-overlay-icon.png');
|
|
6
|
+
|
|
7
|
+
export function ToolbarOverlayIcon(props: Partial<React.ComponentProps<typeof Image>>) {
|
|
8
|
+
return <Image source={icon} {...props} />;
|
|
9
|
+
}
|