@baby-journey/rn-segmented-progress-bar 0.1.0 → 0.1.1
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/.editorconfig +15 -0
- package/.gitattributes +3 -0
- package/.gitignore +70 -0
- package/.nvmrc +1 -0
- package/.watchmanconfig +1 -0
- package/.yarnrc +3 -0
- package/CODE_OF_CONDUCT.md +133 -0
- package/CONTRIBUTING.md +116 -0
- package/README.md +83 -4
- package/babel.config.js +3 -0
- package/baby-journey-rn-segmented-progress-bar-v0.1.0.tgz +0 -0
- package/docs/CODE_OF_CONDUCT.md +44 -0
- package/docs/CONTRIBUTING.md +95 -0
- package/docs/pull_request_template.md +28 -0
- package/example/.expo/README.md +8 -0
- package/example/.expo/devices.json +3 -0
- package/example/App.js +1 -0
- package/example/app.json +33 -0
- package/example/assets/adaptive-icon.png +0 -0
- package/example/assets/favicon.png +0 -0
- package/example/assets/icon.png +0 -0
- package/example/assets/splash.png +0 -0
- package/example/babel.config.js +22 -0
- package/example/metro.config.js +38 -0
- package/example/package.json +26 -0
- package/example/src/App.tsx +41 -0
- package/example/tsconfig.json +6 -0
- package/example/webpack.config.js +25 -0
- package/example/yarn.lock +10555 -0
- package/lefthook.yml +16 -0
- package/lib/commonjs/helpers/index.js +4 -4
- package/lib/commonjs/helpers/index.js.map +1 -1
- package/lib/commonjs/index.js +29 -35
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/helpers/index.js +4 -4
- package/lib/module/helpers/index.js.map +1 -1
- package/lib/module/index.js +29 -35
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/helpers/index.d.ts +1 -1
- package/lib/typescript/helpers/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +7 -10
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +8 -2
- package/scripts/bootstrap.js +29 -0
- package/src/__tests__/helper/index.test.js +92 -0
- package/src/__tests__/index.test.js +28 -0
- package/src/helpers/index.ts +4 -5
- package/src/index.tsx +45 -54
- package/tsconfig.build.json +5 -0
- package/tsconfig.json +28 -0
- package/yarn.lock +9933 -0
package/example/app.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"expo": {
|
|
3
|
+
"name": "example",
|
|
4
|
+
"slug": "example",
|
|
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
|
+
"updates": {
|
|
15
|
+
"fallbackToCacheTimeout": 0
|
|
16
|
+
},
|
|
17
|
+
"assetBundlePatterns": [
|
|
18
|
+
"**/*"
|
|
19
|
+
],
|
|
20
|
+
"ios": {
|
|
21
|
+
"supportsTablet": true
|
|
22
|
+
},
|
|
23
|
+
"android": {
|
|
24
|
+
"adaptiveIcon": {
|
|
25
|
+
"foregroundImage": "./assets/adaptive-icon.png",
|
|
26
|
+
"backgroundColor": "#FFFFFF"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"web": {
|
|
30
|
+
"favicon": "./assets/favicon.png"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const pak = require('../package.json');
|
|
3
|
+
|
|
4
|
+
module.exports = function (api) {
|
|
5
|
+
api.cache(true);
|
|
6
|
+
|
|
7
|
+
return {
|
|
8
|
+
presets: ['babel-preset-expo'],
|
|
9
|
+
plugins: [
|
|
10
|
+
[
|
|
11
|
+
'module-resolver',
|
|
12
|
+
{
|
|
13
|
+
extensions: ['.tsx', '.ts', '.js', '.json'],
|
|
14
|
+
alias: {
|
|
15
|
+
// For development, we want to alias the library to the source
|
|
16
|
+
[pak.name]: path.join(__dirname, '..', pak.source),
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const escape = require('escape-string-regexp');
|
|
3
|
+
const { getDefaultConfig } = require('@expo/metro-config');
|
|
4
|
+
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
|
5
|
+
const pak = require('../package.json');
|
|
6
|
+
|
|
7
|
+
const root = path.resolve(__dirname, '..');
|
|
8
|
+
|
|
9
|
+
const modules = Object.keys({
|
|
10
|
+
...pak.peerDependencies,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const defaultConfig = getDefaultConfig(__dirname);
|
|
14
|
+
|
|
15
|
+
module.exports = {
|
|
16
|
+
...defaultConfig,
|
|
17
|
+
|
|
18
|
+
projectRoot: __dirname,
|
|
19
|
+
watchFolders: [root],
|
|
20
|
+
|
|
21
|
+
// We need to make sure that only one version is loaded for peerDependencies
|
|
22
|
+
// So we block them at the root, and alias them to the versions in example's node_modules
|
|
23
|
+
resolver: {
|
|
24
|
+
...defaultConfig.resolver,
|
|
25
|
+
|
|
26
|
+
blacklistRE: exclusionList(
|
|
27
|
+
modules.map(
|
|
28
|
+
(m) =>
|
|
29
|
+
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
|
|
30
|
+
)
|
|
31
|
+
),
|
|
32
|
+
|
|
33
|
+
extraNodeModules: modules.reduce((acc, name) => {
|
|
34
|
+
acc[name] = path.join(__dirname, 'node_modules', name);
|
|
35
|
+
return acc;
|
|
36
|
+
}, {}),
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "example",
|
|
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": "~47.0.12",
|
|
13
|
+
"expo-status-bar": "~1.4.2",
|
|
14
|
+
"react": "18.1.0",
|
|
15
|
+
"react-native": "0.70.5",
|
|
16
|
+
"react-dom": "18.1.0",
|
|
17
|
+
"react-native-web": "~0.18.9"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@babel/core": "^7.12.9",
|
|
21
|
+
"babel-plugin-module-resolver": "^4.1.0",
|
|
22
|
+
"@expo/webpack-config": "^0.17.2",
|
|
23
|
+
"babel-loader": "^8.1.0"
|
|
24
|
+
},
|
|
25
|
+
"private": true
|
|
26
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import RNSegmentedProgressBar, {
|
|
5
|
+
RunAnimationHandler,
|
|
6
|
+
} from '@baby-journey/rn-segmented-progress-bar';
|
|
7
|
+
|
|
8
|
+
export default function App() {
|
|
9
|
+
const circularProgressRef = React.useRef<RunAnimationHandler>(null);
|
|
10
|
+
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
circularProgressRef?.current?.run({
|
|
13
|
+
progress: 75,
|
|
14
|
+
});
|
|
15
|
+
}, []);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<View style={styles.container}>
|
|
19
|
+
<RNSegmentedProgressBar
|
|
20
|
+
ref={circularProgressRef}
|
|
21
|
+
radius={114}
|
|
22
|
+
strokeWidth={14}
|
|
23
|
+
segmentsGap={30}
|
|
24
|
+
segments={4}
|
|
25
|
+
/>
|
|
26
|
+
</View>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const styles = StyleSheet.create({
|
|
31
|
+
container: {
|
|
32
|
+
flex: 1,
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
},
|
|
36
|
+
box: {
|
|
37
|
+
width: 60,
|
|
38
|
+
height: 60,
|
|
39
|
+
marginVertical: 20,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
|
|
3
|
+
const { resolver } = require('./metro.config');
|
|
4
|
+
|
|
5
|
+
const root = path.resolve(__dirname, '..');
|
|
6
|
+
const node_modules = path.join(__dirname, 'node_modules');
|
|
7
|
+
|
|
8
|
+
module.exports = async function (env, argv) {
|
|
9
|
+
const config = await createExpoWebpackConfigAsync(env, argv);
|
|
10
|
+
|
|
11
|
+
config.module.rules.push({
|
|
12
|
+
test: /\.(js|jsx|ts|tsx)$/,
|
|
13
|
+
include: path.resolve(root, 'src'),
|
|
14
|
+
use: 'babel-loader',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// We need to make sure that only one version is loaded for peerDependencies
|
|
18
|
+
// So we alias them to the versions in example's node_modules
|
|
19
|
+
Object.assign(config.resolve.alias, {
|
|
20
|
+
...resolver.extraNodeModules,
|
|
21
|
+
'react-native-web': path.join(node_modules, 'react-native-web'),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return config;
|
|
25
|
+
};
|