25.0.0 • Published 2 days ago

backpack-react-native v25.0.0

Weekly downloads
31
License
Apache-2.0
Repository
github
Last release
2 days ago

Backpack Design System for React Native

Backpack is a collection of design resources, reusable components and guidelines for creating Skyscanner's products.

Android Actions Build Status iOS Actions Build Status

Quick links

Usage

Installation

npm install backpack-react-native --save

From source

Our Android code is written in Kotlin, so in order to compile it from source you need to have org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" in the classpath.

Add the following your root build.gradle file:

buildscript {
  ext.kotlin_version = '1.5.21'
  dependencies {
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  }
}

If you have defined project-wide properties in your root build.gradle, this library will detect the presence of the following properties:

  ext {
      compileSdkVersion   = 30
      targetSdkVersion    = 30
      minSdkVersion       = 26
  }
  1. Define the backpack-react-native project in your settings.gradle file:

      include ':backpack-react-native'
      project(':backpack-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/backpack-react-native/android')
  2. Add bpk-appearance as a dependency in your app/module build.gradle file:

        dependencies {
          implementation project(':backpack-react-native')
        }

    Pre compiled

    Alternatively, the pre compiled version is available on Skyscanner's internal Artifactory.

        dependencies {
          implementation 'net.skyscanner.backpack:bpk-appearance:<version>'
        }

From source

Add the following dependencies to your Podfile using the path to the NPM package as follows:

  pod 'BackpackReactNative', path: '../node_modules/backpack-react-native/ios/BackpackReactNative'
  pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'

Third party libs

This package depends on react-native-maps and its native components need to be integrated manually by following their instructions.

Configuration

  1. Add the native packages to the getPackages function in your MainActiviy.

    override fun getPackages(): List<ReactPackage> {
      return Arrays.asList(
            MainReactPackage(),
            ...
            MapsPackage(),
            LinearGradientPackage(),
            CalendarPackage(),
            DialogPackage(),
            BpkSnackbarPackage())
    }
  2. Append |uiMode to the android:configChanges prop of <activity> in AndroidManifest.xml. Example:

    <activity
        android:name=".MainActivity"
        android:exported="true"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode">

    This ensures the RN code will react to system-wide changes to the current appearance.

    Icons

    This method has the advantage of fonts being copied from this module at build time so that the fonts and JS are always in sync, making upgrades painless.

    Edit android/app/build.gradle ( NOT android/build.gradle ) and add the following:

    apply from: "node_modules/backpack-react-native/bpk-component-icon/fonts.gradle"

Icons

The most reliable way to install the file on iOS is manually, three simple steps are required: 1. update the Info.plist file by adding

  ```
  <key>UIAppFonts</key>
    <array>
      <string>BpkIcon.ttf</string>
    </array>
  ```
  if the entry `UIAppFonts` is already there, just add `<string>BpkIcon.ttf</string>` inside the `<array>` like so
  ```
  <array>
      ... existing entries
      <string>BpkIcon.ttf</string>
    </array>
  ```
  1. In the Build Phases of your project, in the section Copy Bundle Resources add a reference to the BpkIcon.ttf file path like /path/to/node_modules/@skyscanner/bpk-svgs/dist/font/BpkIcon.ttf

  2. Rebuild the app

Contributing

To contribute please see contributing.md.

List of packages

25.0.0

2 days ago

24.3.2

24 days ago

24.3.1

24 days ago

24.3.0

25 days ago

24.0.0

11 months ago

23.0.0

1 year ago

22.0.0

1 year ago

21.2.0

1 year ago

21.0.0

2 years ago

21.1.1

1 year ago

21.1.0

2 years ago

20.1.0

2 years ago

20.0.2

2 years ago

20.0.1

2 years ago

20.0.0

2 years ago

19.0.0

2 years ago

18.0.0

2 years ago

18.1.0

2 years ago

17.0.0

3 years ago

16.1.0

3 years ago

16.0.0-beta.0

3 years ago

16.0.0

3 years ago

15.0.0

3 years ago

15.0.0-beta.3

3 years ago

14.1.1

3 years ago

14.1.2

3 years ago

14.1.3-alpha.2

3 years ago

14.1.3-alpha.3

3 years ago

15.0.0-beta.1

3 years ago

15.0.0-beta.0

3 years ago

14.1.3-alpha.0

3 years ago

14.1.3-alpha.1

3 years ago

14.1.0

3 years ago

14.0.0

3 years ago

13.0.2

3 years ago

13.0.1

3 years ago

14.0.1-alpha.0

3 years ago

15.0.0-alpha.0

3 years ago

14.0.0-alpha.0

3 years ago

13.0.0

3 years ago

12.0.0

3 years ago

11.0.1

3 years ago

11.0.0

3 years ago

10.0.0

3 years ago

9.0.1

3 years ago

9.0.0

3 years ago

8.0.0

3 years ago

7.0.0

3 years ago

6.4.0

4 years ago

6.3.4

4 years ago

6.3.3

4 years ago

6.3.2

4 years ago

6.3.1

4 years ago

6.3.0

4 years ago

6.2.1

4 years ago

6.2.0

4 years ago

6.1.0

4 years ago

6.0.2

4 years ago

6.0.1

4 years ago

6.0.0

4 years ago

5.0.4

4 years ago

5.0.3

4 years ago

5.0.2

4 years ago

5.0.1

4 years ago

5.0.0

4 years ago

4.1.0

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.4.0

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.2.0

4 years ago

3.1.0

4 years ago

3.0.0

4 years ago

2.5.0

4 years ago

2.4.1

4 years ago

2.4.0

4 years ago

2.3.0

4 years ago

2.2.0

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.0

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago