├── .eslintignore ├── .eslintrc.js ├── .github ├── .gitignore └── workflows │ ├── e2e.yml │ ├── publish.yml │ └── unit-test.yml ├── .gitignore ├── .npmignore ├── .nvmrc ├── .prettierrc.js ├── LICENSE ├── Makefile ├── README.md ├── RNSegmentedPicker.podspec ├── __mocks__ ├── init.ts └── react-native-animatable.ts ├── __tests__ ├── .eslintrc.js ├── 1-col-picker.spec.js ├── 2-col-picker.spec.js ├── README.md ├── config.json ├── init.js ├── native.spec.js ├── utils │ └── index.ts └── visbility.spec.js ├── babel.config.js ├── babel.rollup.config.js ├── docs └── Native iOS.md ├── examples ├── .buckconfig ├── .eslintrc ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── App.tsx ├── README.md ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── segmentedpickerdemo │ │ │ │ └── DetoxTest.java │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── segmentedpickerdemo │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios │ ├── Podfile │ ├── Podfile.lock │ ├── RNPlaceholder.swift │ ├── SegmentedPickerDemo-tvOS │ │ └── Info.plist │ ├── SegmentedPickerDemo-tvOSTests │ │ └── Info.plist │ ├── SegmentedPickerDemo.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── SegmentedPickerDemo-tvOS.xcscheme │ │ │ └── SegmentedPickerDemo.xcscheme │ ├── SegmentedPickerDemo.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── SegmentedPickerDemo │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── SegmentedPickerDemoTests │ │ ├── Info.plist │ │ └── SegmentedPickerDemoTests.m ├── metro.config.js ├── package.json ├── src │ ├── Button │ │ ├── Button.tsx │ │ └── index.ts │ ├── ExampleA │ │ ├── ExampleA.tsx │ │ └── index.ts │ ├── ExampleB │ │ ├── ExampleB.tsx │ │ └── index.ts │ ├── ExampleC │ │ ├── ExampleC.tsx │ │ └── index.ts │ ├── ExampleD │ │ ├── ExampleD.tsx │ │ └── index.ts │ ├── config │ │ ├── YellowBox.e2e.ts │ │ └── YellowBox.ts │ └── utils │ │ ├── index.ts │ │ ├── showSelections.e2e.ts │ │ └── showSelections.ts └── yarn.lock ├── ios ├── Definitions.swift ├── PickerView.swift ├── PickerViewManager.m ├── PickerViewManager.swift ├── RN-Bridging-Header.h └── RNSegmentedPicker.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── adam.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ └── adam.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── package.json ├── react-native.config.js ├── rollup.config.js ├── src ├── components │ ├── SegmentedPicker │ │ ├── SegmentedPicker.test.tsx │ │ ├── SegmentedPicker.tsx │ │ ├── SegmentedPickerPropTypes.ts │ │ ├── SegmentedPickerStyles.ts │ │ └── index.ts │ ├── SelectionMarker │ │ ├── SelectionMarker.tsx │ │ ├── SelectionMarkerStyles.ts │ │ └── index.ts │ ├── Toolbar │ │ ├── Toolbar.tsx │ │ ├── ToolbarStyles.ts │ │ └── index.ts │ └── UIPicker │ │ ├── README.md │ │ └── index.ts ├── config │ ├── constants.ts │ └── interfaces.ts ├── index.ts └── services │ ├── Cache │ ├── Cache.test.ts │ ├── Cache.ts │ └── index.ts │ ├── PromiseFactory │ ├── PromiseFactory.test.ts │ ├── PromiseFactory.ts │ └── index.ts │ └── UIPickerManager │ ├── UIPickerManager.ts │ └── index.ts ├── tsconfig.json └── yarn.lock /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | examples/android 3 | examples/ios 4 | examples/node_modules 5 | dist 6 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: [ 4 | 'airbnb-typescript', 5 | ], 6 | parser: '@typescript-eslint/parser', 7 | plugins: [ 8 | '@typescript-eslint', 9 | 'jest', 10 | ], 11 | globals: { 12 | __DEV__: false, 13 | }, 14 | rules: { 15 | 'no-console': 'error', 16 | 'max-len': [ 17 | 'error', 18 | { 19 | code: 100, 20 | tabWidth: 2, 21 | ignorePattern: 'Navigation\.registerComponent.+', 22 | ignoreUrls: true, 23 | }, 24 | ], 25 | 'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }], 26 | '@typescript-eslint/no-use-before-define': [ 27 | 'error', 28 | { 29 | functions: false, 30 | classes: true, 31 | variables: true, 32 | typedefs: true, 33 | }, 34 | ], 35 | '@typescript-eslint/no-misused-promises': 'off', 36 | 'react/destructuring-assignment': 'off', 37 | 'import/prefer-default-export': 'off', 38 | 'react/jsx-props-no-spreading': 'off', 39 | 'lines-between-class-members': 'off', 40 | 'class-methods-use-this': [ 41 | 'error', 42 | { 43 | 'exceptMethods': [ 44 | // React Methods 45 | 'render', 46 | 'componentDidMount', 47 | 'shouldComponentUpdate', 48 | 'getSnapshotBeforeUpdate', 49 | 'componentDidUpdate', 50 | 'componentWillUnmount', 51 | 'componentDidCatch', 52 | ], 53 | }, 54 | ], 55 | 'jest/consistent-test-it': 'error', 56 | 'react/static-property-placement': 0, 57 | 'no-async-promise-executor': 0, 58 | }, 59 | }; 60 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammcarth/react-native-segmented-picker/adc58855ce8ffe4da836e600287028ac50ed8259/.github/.gitignore -------------------------------------------------------------------------------- /.github/workflows/e2e.yml: -------------------------------------------------------------------------------- 1 | name: E2E Tests 2 | 3 | on: [workflow_dispatch] 4 | 5 | jobs: 6 | android-e2e: 7 | name: Android 8 | runs-on: macos-latest 9 | timeout-minutes: 25 10 | steps: 11 | - name: Clone Repository 12 | uses: actions/checkout@v2 13 | - name: Load NodeJS 12.x 14 | uses: actions/setup-node@v1 15 | with: 16 | node-version: 12.x 17 | - name: Restore Cache (node_modules) 18 | uses: actions/cache@v1 19 | id: node-modules-cache 20 | with: 21 | path: node_modules 22 | key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }} 23 | restore-keys: | 24 | ${{ runner.os }}-node_modules- 25 | - name: Yarn Install 26 | run: yarn install 27 | if: steps.node-modules-cache.outputs.cache-hit != 'true' 28 | - name: Restore Cache (./examples/node_modules) 29 | uses: actions/cache@v1 30 | id: node-modules-examples-cache 31 | with: 32 | path: examples/node_modules 33 | key: ${{ runner.os }}-node_modules-examples-${{ hashFiles('yarn.lock') }} 34 | restore-keys: | 35 | ${{ runner.os }}-node_modules-examples 36 | - name: Yarn Install (./examples) 37 | run: cd examples && yarn install 38 | if: steps.node-modules-examples-cache.outputs.cache-hit != 'true' 39 | # Runs `yarn postinstall` if the above step was skipped 40 | - name: Post Install (./examples/node_modules) (Manual) 41 | run: cd examples && yarn postinstall 42 | if: steps.node-modules-examples-cache.outputs.cache-hit == 'true' 43 | - name: Start React Native Packager (E2E Mode) 44 | run: cd examples && nohup yarn start-e2e-debug-packager & 45 | - name: Run E2E Tests 46 | uses: reactivecircus/android-emulator-runner@v2 47 | with: 48 | api-level: 29 49 | script: yarn e2e-android 50 | - name: Archive Detox Results (Failed) 51 | uses: actions/upload-artifact@v1 52 | if: failure() 53 | with: 54 | name: E2E Results (Android) 55 | path: ./__tests__/.artifacts 56 | - name: Archive Detox Results (Passed) 57 | uses: actions/upload-artifact@v1 58 | with: 59 | name: E2E Results (Android) 60 | path: ./__tests__/.artifacts 61 | 62 | ios-e2e: 63 | name: iOS 64 | runs-on: macos-latest 65 | timeout-minutes: 25 66 | env: 67 | DEVELOPER_DIR: /Applications/Xcode_11.4.1.app/Contents/Developer 68 | steps: 69 | - name: Clone Repository 70 | uses: actions/checkout@v2 71 | - name: Load NodeJS 12.x 72 | uses: actions/setup-node@v1 73 | with: 74 | node-version: 12.x 75 | - name: Restore Cache (node_modules) 76 | uses: actions/cache@v1 77 | id: node-modules-cache 78 | with: 79 | path: node_modules 80 | key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }} 81 | restore-keys: | 82 | ${{ runner.os }}-node_modules- 83 | - name: Yarn Install 84 | run: yarn install 85 | if: steps.node-modules-cache.outputs.cache-hit != 'true' 86 | - name: Restore Cache (examples/node_modules) 87 | uses: actions/cache@v1 88 | id: node-modules-examples-cache 89 | with: 90 | path: examples/node_modules 91 | key: ${{ runner.os }}-node_modules-examples-${{ hashFiles('yarn.lock') }} 92 | restore-keys: | 93 | ${{ runner.os }}-node_modules-examples 94 | - name: Yarn Install (./examples) 95 | run: cd examples && yarn install 96 | if: steps.node-modules-examples-cache.outputs.cache-hit != 'true' 97 | # Runs `yarn postinstall` if the above step was skipped 98 | - name: Post Install (./examples/node_modules) (Manual) 99 | run: cd examples && yarn postinstall 100 | if: steps.node-modules-examples-cache.outputs.cache-hit == 'true' 101 | - name: Setup iOS Build Tools 102 | run: | 103 | brew tap wix/brew && brew install applesimutils 104 | yarn detox clean-framework-cache 105 | yarn detox build-framework-cache 106 | - name: Restore Cache (ios/Pods) 107 | uses: actions/cache@v1 108 | id: ios-pods-cache 109 | with: 110 | path: examples/ios/Pods 111 | key: ${{ runner.os }}-ios-pods-${{ hashFiles('examples/ios/Podfile.lock') }} 112 | restore-keys: | 113 | ${{ runner.os }}-ios-pods- 114 | - name: Start React Native Packager (E2E Mode) 115 | run: cd examples && nohup yarn start-e2e-debug-packager & 116 | - name: Run E2E Tests 117 | run: yarn e2e-ios 118 | - name: Archive Detox Results (Failed) 119 | uses: actions/upload-artifact@v1 120 | if: failure() 121 | with: 122 | name: E2E Results (iOS) 123 | path: ./__tests__/.artifacts 124 | - name: Archive Detox Results (Passed) 125 | uses: actions/upload-artifact@v1 126 | with: 127 | name: E2E Results (iOS) 128 | path: ./__tests__/.artifacts 129 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Syntax, Unit & E2E Tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | test: 10 | name: Syntax & Unit Tests 11 | runs-on: ubuntu-latest 12 | timeout-minutes: 5 13 | steps: 14 | - name: Clone Repository 15 | uses: actions/checkout@v2 16 | - name: Load NodeJS 12.x 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: 12.x 20 | - name: Restore Cache (node_modules) 21 | uses: actions/cache@v1 22 | id: node-modules-cache 23 | with: 24 | path: node_modules 25 | key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }} 26 | restore-keys: | 27 | ${{ runner.os }}-node_modules- 28 | - name: Yarn Install 29 | run: yarn install 30 | if: steps.node-modules-cache.outputs.cache-hit != 'true' 31 | - name: Run NPM Test Suite 32 | run: yarn test 33 | 34 | tag: 35 | name: Tag Release 36 | runs-on: ubuntu-latest 37 | needs: test 38 | timeout-minutes: 2 39 | steps: 40 | - name: Clone Repository 41 | uses: actions/checkout@v2 42 | with: 43 | fetch-depth: 0 44 | - name: Determine Package Version 45 | run: | 46 | echo "::set-env name=PKG_VERSION::$(cat package.json | grep \\\"version\\\" | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')" 47 | - name: Tag Version (Git) 48 | id: tag-version 49 | run: git tag v$PKG_VERSION || echo "::set-output name=created::false" 50 | - name: Push Tag 51 | if: steps.tag-version.outputs.created != 'false' 52 | uses: ad-m/github-push-action@master 53 | with: 54 | github_token: ${{ secrets.GITHUB_TOKEN }} 55 | tags: true 56 | 57 | android-e2e: 58 | name: Android E2E Tests 59 | runs-on: macos-latest 60 | needs: [test, tag] 61 | timeout-minutes: 25 62 | steps: 63 | - name: Clone Repository 64 | uses: actions/checkout@v2 65 | - name: Load NodeJS 12.x 66 | uses: actions/setup-node@v1 67 | with: 68 | node-version: 12.x 69 | - name: Restore Cache (node_modules) 70 | uses: actions/cache@v1 71 | id: node-modules-cache 72 | with: 73 | path: node_modules 74 | key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }} 75 | restore-keys: | 76 | ${{ runner.os }}-node_modules- 77 | - name: Yarn Install 78 | run: yarn install 79 | if: steps.node-modules-cache.outputs.cache-hit != 'true' 80 | - name: Restore Cache (examples/node_modules) 81 | uses: actions/cache@v1 82 | id: node-modules-examples-cache 83 | with: 84 | path: examples/node_modules 85 | key: ${{ runner.os }}-node_modules-examples-${{ hashFiles('yarn.lock') }} 86 | restore-keys: | 87 | ${{ runner.os }}-node_modules-examples 88 | - name: Yarn Install (./examples) 89 | run: cd examples && yarn install 90 | if: steps.node-modules-examples-cache.outputs.cache-hit != 'true' 91 | # Runs `yarn postinstall` if the above step was skipped 92 | - name: Post Install (./examples/node_modules) (Manual) 93 | run: cd examples && yarn postinstall 94 | if: steps.node-modules-examples-cache.outputs.cache-hit == 'true' 95 | - name: Start React Native Packager (E2E Mode) 96 | run: cd examples && nohup yarn start-e2e-debug-packager & 97 | - name: Run E2E Tests 98 | uses: reactivecircus/android-emulator-runner@v2 99 | with: 100 | api-level: 29 101 | script: yarn e2e-android 102 | - name: Archive Detox Results (Failed) 103 | uses: actions/upload-artifact@v1 104 | if: failure() 105 | with: 106 | name: E2E Results (Android) 107 | path: ./__tests__/.artifacts 108 | - name: Archive Detox Results (Passed) 109 | uses: actions/upload-artifact@v1 110 | with: 111 | name: E2E Results (Android) 112 | path: ./__tests__/.artifacts 113 | 114 | ios-e2e: 115 | name: iOS E2E Tests 116 | runs-on: macos-latest 117 | needs: [test, tag] 118 | timeout-minutes: 25 119 | env: 120 | DEVELOPER_DIR: /Applications/Xcode_11.4.1.app/Contents/Developer 121 | steps: 122 | - name: Clone Repository 123 | uses: actions/checkout@v2 124 | - name: Load NodeJS 12.x 125 | uses: actions/setup-node@v1 126 | with: 127 | node-version: 12.x 128 | - name: Restore Cache (node_modules) 129 | uses: actions/cache@v1 130 | id: node-modules-cache 131 | with: 132 | path: node_modules 133 | key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }} 134 | restore-keys: | 135 | ${{ runner.os }}-node_modules- 136 | - name: Yarn Install 137 | run: yarn install 138 | if: steps.node-modules-cache.outputs.cache-hit != 'true' 139 | - name: Restore Cache (examples/node_modules) 140 | uses: actions/cache@v1 141 | id: node-modules-examples-cache 142 | with: 143 | path: examples/node_modules 144 | key: ${{ runner.os }}-node_modules-examples-${{ hashFiles('yarn.lock') }} 145 | restore-keys: | 146 | ${{ runner.os }}-node_modules-examples 147 | - name: Yarn Install (./examples) 148 | run: cd examples && yarn install 149 | if: steps.node-modules-examples-cache.outputs.cache-hit != 'true' 150 | # Runs `yarn postinstall` if the above step was skipped 151 | - name: Post Install (./examples/node_modules) (Manual) 152 | run: cd examples && yarn postinstall 153 | if: steps.node-modules-examples-cache.outputs.cache-hit == 'true' 154 | - name: Setup iOS Build Tools 155 | run: | 156 | brew tap wix/brew && brew install applesimutils 157 | yarn detox clean-framework-cache 158 | yarn detox build-framework-cache 159 | - name: Restore Cache (ios/Pods) 160 | uses: actions/cache@v1 161 | id: ios-pods-cache 162 | with: 163 | path: examples/ios/Pods 164 | key: ${{ runner.os }}-ios-pods-${{ hashFiles('examples/ios/Podfile.lock') }} 165 | restore-keys: | 166 | ${{ runner.os }}-ios-pods- 167 | - name: Update RNSegmentedPicker Pod (Examples Project) 168 | run: cd examples/ios && pod update RNSegmentedPicker 169 | - name: Start React Native Packager (E2E Mode) 170 | run: cd examples && nohup yarn start-e2e-debug-packager & 171 | - name: Run E2E Tests 172 | run: yarn e2e-ios 173 | - name: Archive Detox Results (Failed) 174 | uses: actions/upload-artifact@v1 175 | if: failure() 176 | with: 177 | name: E2E Results (iOS) 178 | path: ./__tests__/.artifacts 179 | - name: Archive Detox Results (Passed) 180 | uses: actions/upload-artifact@v1 181 | with: 182 | name: E2E Results (iOS) 183 | path: ./__tests__/.artifacts 184 | 185 | publish: 186 | name: Publish Package 187 | runs-on: ubuntu-latest 188 | needs: [test, tag, android-e2e, ios-e2e] 189 | timeout-minutes: 5 190 | steps: 191 | - name: Clone Repository 192 | uses: actions/checkout@v2 193 | - name: Load NodeJS 12.x 194 | uses: actions/setup-node@v1 195 | with: 196 | node-version: 12.x 197 | registry-url: 'https://registry.npmjs.org' 198 | - name: Restore Cache (node_modules) 199 | uses: actions/cache@v1 200 | id: node-modules-cache 201 | with: 202 | path: node_modules 203 | key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }} 204 | restore-keys: | 205 | ${{ runner.os }}-node_modules- 206 | - name: Yarn Install 207 | run: yarn install 208 | if: steps.node-modules-cache.outputs.cache-hit != 'true' 209 | - name: Build Package 210 | run: | 211 | yarn build 212 | npm pack 213 | echo "::set-env name=TARBALL::$(ls | grep react-native-segmented-picker*.tgz | sed -n '1 p')" 214 | - name: Submit Package Update (NPM) 215 | env: 216 | NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} 217 | run: npm publish --access public 218 | - name: Re-configure NPM Registry To GitHub Packages 219 | uses: actions/setup-node@v1 220 | with: 221 | registry-url: 'https://npm.pkg.github.com' 222 | scope: '@adammcarth' 223 | - name: Submit Package Update (GitHub Packages) 224 | env: 225 | NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 226 | run: | 227 | mv package.json npm_package.json 228 | cat npm_package.json | jq -c '.name="@adammcarth/react-native-segmented-picker"' > package.json 229 | yarn build 230 | npm publish 231 | - name: Archive Package (Tarball) 232 | uses: actions/upload-artifact@v1 233 | with: 234 | name: Upload Tarball 235 | path: ${{ env.TARBALL }} 236 | -------------------------------------------------------------------------------- /.github/workflows/unit-test.yml: -------------------------------------------------------------------------------- 1 | name: Syntax & Unit Tests 2 | 3 | on: 4 | push: 5 | branches-ignore: 6 | - master 7 | 8 | jobs: 9 | lint: 10 | name: JavaScript Syntax Lint 11 | runs-on: ubuntu-latest 12 | timeout-minutes: 5 13 | steps: 14 | - name: Clone Repository 15 | uses: actions/checkout@v2 16 | - name: Load NodeJS 12.x 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: 12.x 20 | - name: Restore Cache (node_modules) 21 | uses: actions/cache@v1 22 | id: node-modules-cache 23 | with: 24 | path: node_modules 25 | key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }} 26 | restore-keys: | 27 | ${{ runner.os }}-node_modules- 28 | - name: Yarn Install 29 | run: yarn install 30 | if: steps.node-modules-cache.outputs.cache-hit != 'true' 31 | - name: Lint Source Code 32 | run: yarn lint 33 | 34 | unit-test: 35 | name: Unit Test 36 | runs-on: ubuntu-latest 37 | timeout-minutes: 5 38 | steps: 39 | - name: Clone Repository 40 | uses: actions/checkout@v2 41 | - name: Load NodeJS 12.x 42 | uses: actions/setup-node@v1 43 | with: 44 | node-version: 12.x 45 | - name: Restore Cache (node_modules) 46 | uses: actions/cache@v1 47 | id: node-modules-cache 48 | with: 49 | path: node_modules 50 | key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }} 51 | restore-keys: | 52 | ${{ runner.os }}-node_modules- 53 | - name: Yarn Install 54 | run: yarn install 55 | if: steps.node-modules-cache.outputs.cache-hit != 'true' 56 | - name: Run Unit Tests 57 | run: yarn unit-test 58 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_STORE 2 | node_modules 3 | npm-debug.log 4 | yarn-error.log 5 | package-lock.json 6 | .npmrc 7 | dist 8 | __tests__/.artifacts 9 | nohup.out 10 | ios/RNSegmentedPicker.xcodeproj/project.xcworkspace/xcuserdata 11 | 12 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | **/* 2 | !package.json 3 | !README.md 4 | !docs/**/* 5 | !LICENSE 6 | !dist/**/* 7 | !ios/**/* 8 | !react-native.config.js 9 | !RNSegmentedPicker.podspec 10 | .DS_STORE 11 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | lts/erbium 2 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: true, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | }; 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Adam McArthur 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # This Makefile facilitates fake package installation for testing 2 | # purposes. 3 | PKG_PATH:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) 4 | 5 | define USAGE 6 | 7 | make