react-native-boxes 1.4.64 → 1.4.66

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-boxes",
3
- "version": "1.4.64",
3
+ "version": "1.4.66",
4
4
  "description": "A react native library for rapid development of UI using boxes",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,34 +1,34 @@
1
- import { StatusBar } from 'expo-status-bar';
2
- import { StyleSheet, Text, View } from 'react-native';
3
- import { DemoScreen, Theme, ThemeContext } from 'react-native-boxes'
4
- import { SafeAreaProvider } from 'react-native-safe-area-context';
5
-
6
- export default function App() {
7
- const theme = new Theme()
8
-
9
- loadAsync({
10
- 'Regular': require('./assets/fonts/Regular.ttf'),
11
- 'Bold': require('./assets/fonts/Bold.ttf'),
12
- 'Styled': require('./assets/fonts/Styled.ttf'),
13
- })
14
- return (
15
- <ThemeContext.Provider value={theme}>
16
- <SafeAreaProvider>
17
- <DemoScreen />
18
- </SafeAreaProvider>
19
- </ThemeContext.Provider>
20
- );
21
- }
22
-
23
- const styles = StyleSheet.create({
24
- container: {
25
- flex: 1,
26
- backgroundColor: '#fff',
27
- alignItems: 'center',
28
- justifyContent: 'center',
29
- },
30
- });
31
- function loadAsync(arg0: { Regular: any; Bold: any; Styled: any; }) {
32
- throw new Error('Function not implemented.');
33
- }
34
-
1
+ import { StatusBar } from 'expo-status-bar';
2
+ import { StyleSheet, Text, View } from 'react-native';
3
+ import { DemoScreen, Theme, ThemeContext } from 'react-native-boxes'
4
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
5
+
6
+ export default function App() {
7
+ const theme = new Theme()
8
+
9
+ loadAsync({
10
+ 'Regular': require('./assets/fonts/Regular.ttf'),
11
+ 'Bold': require('./assets/fonts/Bold.ttf'),
12
+ 'Styled': require('./assets/fonts/Styled.ttf'),
13
+ })
14
+ return (
15
+ <ThemeContext.Provider value={theme}>
16
+ <SafeAreaProvider>
17
+ <DemoScreen />
18
+ </SafeAreaProvider>
19
+ </ThemeContext.Provider>
20
+ );
21
+ }
22
+
23
+ const styles = StyleSheet.create({
24
+ container: {
25
+ flex: 1,
26
+ backgroundColor: '#fff',
27
+ alignItems: 'center',
28
+ justifyContent: 'center',
29
+ },
30
+ });
31
+ function loadAsync(arg0: { Regular: any; Bold: any; Styled: any; }) {
32
+ throw new Error('Function not implemented.');
33
+ }
34
+
@@ -1,30 +1,30 @@
1
- {
2
- "expo": {
3
- "name": "sample-app",
4
- "slug": "sample-app",
5
- "version": "1.0.0",
6
- "orientation": "portrait",
7
- "icon": "./assets/icon.png",
8
- "userInterfaceStyle": "light",
9
- "splash": {
10
- "image": "./assets/splash.png",
11
- "resizeMode": "contain",
12
- "backgroundColor": "#ffffff"
13
- },
14
- "assetBundlePatterns": [
15
- "**/*"
16
- ],
17
- "ios": {
18
- "supportsTablet": true
19
- },
20
- "android": {
21
- "adaptiveIcon": {
22
- "foregroundImage": "./assets/adaptive-icon.png",
23
- "backgroundColor": "#ffffff"
24
- }
25
- },
26
- "web": {
27
- "favicon": "./assets/favicon.png"
28
- }
29
- }
30
- }
1
+ {
2
+ "expo": {
3
+ "name": "sample-app",
4
+ "slug": "sample-app",
5
+ "version": "1.0.0",
6
+ "orientation": "portrait",
7
+ "icon": "./assets/icon.png",
8
+ "userInterfaceStyle": "light",
9
+ "splash": {
10
+ "image": "./assets/splash.png",
11
+ "resizeMode": "contain",
12
+ "backgroundColor": "#ffffff"
13
+ },
14
+ "assetBundlePatterns": [
15
+ "**/*"
16
+ ],
17
+ "ios": {
18
+ "supportsTablet": true
19
+ },
20
+ "android": {
21
+ "adaptiveIcon": {
22
+ "foregroundImage": "./assets/adaptive-icon.png",
23
+ "backgroundColor": "#ffffff"
24
+ }
25
+ },
26
+ "web": {
27
+ "favicon": "./assets/favicon.png"
28
+ }
29
+ }
30
+ }
@@ -1,30 +1,30 @@
1
- {
2
- "name": "sample-app",
3
- "version": "1.0.0",
4
- "main": "node_modules/expo/AppEntry.js",
5
- "scripts": {
6
- "start": "expo start",
7
- "android": "expo start --android",
8
- "ios": "expo start --ios",
9
- "web": "expo start --web"
10
- },
11
- "dependencies": {
12
- "@expo/metro-runtime": "~3.1.3",
13
- "@expo/vector-icons": "^13.0.0",
14
- "expo": "~50.0.14",
15
- "expo-status-bar": "~1.11.1",
16
- "react": "18.2.0",
17
- "react-dom": "18.2.0",
18
- "react-native": "0.73.6",
19
- "react-native-boxes": "^1.4.61",
20
- "react-native-gesture-handler": "^2.22.1",
21
- "react-native-safe-area-context": "^4.9.0",
22
- "react-native-web": "~0.19.6"
23
- },
24
- "devDependencies": {
25
- "@babel/core": "^7.20.0",
26
- "@types/react": "~18.2.45",
27
- "typescript": "^5.1.3"
28
- },
29
- "private": true
30
- }
1
+ {
2
+ "name": "sample-app",
3
+ "version": "1.0.0",
4
+ "main": "node_modules/expo/AppEntry.js",
5
+ "scripts": {
6
+ "start": "expo start",
7
+ "android": "expo start --android",
8
+ "ios": "expo start --ios",
9
+ "web": "expo start --web"
10
+ },
11
+ "dependencies": {
12
+ "@expo/metro-runtime": "~3.1.3",
13
+ "@expo/vector-icons": "^13.0.0",
14
+ "expo": "~50.0.14",
15
+ "expo-status-bar": "~1.11.1",
16
+ "react": "18.2.0",
17
+ "react-dom": "18.2.0",
18
+ "react-native": "0.73.6",
19
+ "react-native-boxes": "^1.4.61",
20
+ "react-native-gesture-handler": "^2.22.1",
21
+ "react-native-safe-area-context": "^4.9.0",
22
+ "react-native-web": "~0.19.6"
23
+ },
24
+ "devDependencies": {
25
+ "@babel/core": "^7.20.0",
26
+ "@types/react": "~18.2.45",
27
+ "typescript": "^5.1.3"
28
+ },
29
+ "private": true
30
+ }
@@ -1,6 +1,6 @@
1
- {
2
- "extends": "expo/tsconfig.base",
3
- "compilerOptions": {
4
- "strict": true
5
- }
6
- }
1
+ {
2
+ "extends": "expo/tsconfig.base",
3
+ "compilerOptions": {
4
+ "strict": true
5
+ }
6
+ }
package/src/Bar.tsx CHANGED
@@ -261,4 +261,35 @@ export function DividerView(props: DividerProps) {
261
261
  }} />
262
262
  </Center>
263
263
  )
264
+ }
265
+
266
+
267
+ export type ProgressBarViewProps = ViewProps & {
268
+ progress: number
269
+ progressColor?: String
270
+ pendingColor?: String
271
+ }
272
+ export function ProgressBarView(props: ProgressBarViewProps) {
273
+ const { progress } = props
274
+ const theme = useContext(ThemeContext)
275
+ return (
276
+ <View style={[{
277
+ marginTop: theme.dimens.space.md,
278
+ flexDirection: 'row',
279
+ height: theme.dimens.icon.sm / 3,
280
+ width: '100%',
281
+ backgroundColor: '#d3d3d3',
282
+ borderRadius: 5,
283
+ overflow: 'hidden',
284
+ }, props.style]}>
285
+ <View style={{
286
+ width: `${progress}%`,
287
+ backgroundColor: `${props.progressColor || theme.colors.accentLight}`,
288
+ }} />
289
+ <View style={{
290
+ width: `${100 - progress}%`,
291
+ backgroundColor: `${props.pendingColor || theme.colors.background}`,
292
+ }} />
293
+ </View>
294
+ );
264
295
  }
package/src/Button.tsx CHANGED
@@ -283,8 +283,8 @@ export function LoadingButton(props: TextProps & TouchableHighlightProps
283
283
  useEffect(() => {
284
284
  if (props.loading != _loading) {
285
285
  LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
286
- _setIsLoading(props.loading)
287
286
  }
287
+ _setIsLoading(props.loading)
288
288
  }, [props.loading]);
289
289
  let loaderColor = theme.colors.invert.text
290
290
  let loaderSize = theme.dimens.icon.md