Skip to content

Commit 1ad7232

Browse files
committed
Merge branch 'master' into release
2 parents a5997af + 54f4907 commit 1ad7232

File tree

133 files changed

+1523
-541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+1523
-541
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ steps:
1313
- "npm run test"
1414
- "npm run build"
1515
- "[[ $BUILDKITE_PULL_REQUEST == 'false' ]] && npm run bkRelease && npm run demo || true"
16+
timeout_in_minutes: 15

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ buck-out/
4343
\.buckd/
4444
*.keystore
4545

46+
lib/
47+
.vscode
48+
4649
# fastlane
4750
#
4851
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ dependencies {
9191
}
9292
implementation project(':react-native-navigation')
9393
implementation project(':react-native-ui-lib')
94-
implementation 'com.facebook.fresco:fresco:2.0.0'
95-
implementation 'com.facebook.fresco:animated-gif:2.0.0'
94+
implementation 'com.facebook.fresco:fresco:2.5.0'
95+
implementation 'com.facebook.fresco:animated-gif:2.5.0'
9696

9797
if (enableHermes) {
9898
def hermesPath = "../../node_modules/hermes-engine/android/";

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
compileSdkVersion = 30
88
targetSdkVersion = 30
99
ndkVersion = "20.1.5948944"
10-
RNNKotlinVersion = "1.3.61" // Or any version above 1.3.x
10+
RNNKotlinVersion = "1.6.0"
1111
}
1212
repositories {
1313
mavenLocal()

demo/src/screens/componentScreens/DateTimePickerScreen.js renamed to demo/src/screens/componentScreens/DateTimePickerScreen.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ import {ScrollView} from 'react-native';
33
import {DateTimePicker, Text, TouchableOpacity, Colors} from 'react-native-ui-lib'; // eslint-disable-line
44

55
export default class DateTimePickerScreen extends Component {
6-
7-
getCustomInputValue = value => {
6+
getCustomInputValue = (value: string) => {
87
if (!value) {
98
return 'Default';
109
}
11-
return value.includes(new Date().getFullYear() + 1) ? 'Next Year' : value;
10+
return value.includes((new Date().getFullYear() + 1).toString()) ? 'Next Year' : value;
1211
};
1312

14-
renderCustomInput = (props, toggle) => {
13+
renderCustomInput = (props: {value: string}, toggle: (shouldToggle: boolean) => void) => {
1514
const {value} = props;
1615
return (
1716
<TouchableOpacity
@@ -23,7 +22,9 @@ export default class DateTimePickerScreen extends Component {
2322
}}
2423
>
2524
<Text>Valid from</Text>
26-
<Text absR color={Colors.primary} text80BO>{this.getCustomInputValue(value)}</Text>
25+
<Text absR color={Colors.primary} text80BO>
26+
{this.getCustomInputValue(value)}
27+
</Text>
2728
</TouchableOpacity>
2829
);
2930
};
@@ -33,6 +34,7 @@ export default class DateTimePickerScreen extends Component {
3334
<ScrollView style={{padding: 14}}>
3435
<Text text40>Date Time Picker</Text>
3536
<DateTimePicker
37+
// @ts-expect-error
3638
containerStyle={{marginVertical: 20}}
3739
title={'Date'}
3840
placeholder={'Select a date'}

demo/src/screens/componentScreens/ImageScreen.tsx

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const BROKEN_URL = 'file:///Desktop/website/img/cupcake.jpg';
99
const DEFAULT_SIZE = 100;
1010

1111
const file = Assets.svgs.demo.logo;
12+
const uri = {uri: 'http://thenewcode.com/assets/images/thumbnails/homer-simpson.svg'};
13+
const uriWithCss = {uri: 'http://thenewcode.com/assets/svg/accessibility.svg'};
1214
const xml = `
1315
<svg width="32" height="32" viewBox="0 0 32 32">
1416
<path
@@ -38,6 +40,13 @@ enum SizeType {
3840
Percentage = '50%'
3941
}
4042

43+
enum SvgType {
44+
File = 'file',
45+
Uri = 'uri',
46+
UriWithCss = 'use_with_css',
47+
Xml = 'xml'
48+
}
49+
4150
interface State {
4251
cover: boolean;
4352
showOverlayContent: boolean;
@@ -46,7 +55,7 @@ interface State {
4655
margin: number;
4756
showErrorImage: boolean;
4857
showSvg: boolean;
49-
isFile: boolean;
58+
svgType: SvgType;
5059
sizeType: SizeType;
5160
}
5261

@@ -59,10 +68,25 @@ class ImageScreen extends Component<{}, State> {
5968
margin: 0,
6069
showErrorImage: false,
6170
showSvg: false,
62-
isFile: false,
71+
svgType: SvgType.File,
6372
sizeType: SizeType.None
6473
};
6574

75+
getSvgSource() {
76+
const {svgType} = this.state;
77+
switch (svgType) {
78+
case SvgType.File:
79+
return file;
80+
case SvgType.Uri:
81+
return uri;
82+
case SvgType.UriWithCss:
83+
return uriWithCss;
84+
case SvgType.Xml:
85+
default:
86+
return xml;
87+
}
88+
}
89+
6690
renderOverlayContent() {
6791
const {cover, overlayType, showOverlayContent} = this.state;
6892
if (showOverlayContent) {
@@ -105,14 +129,15 @@ class ImageScreen extends Component<{}, State> {
105129
}
106130

107131
renderSvgImage() {
108-
const {isFile, sizeType} = this.state;
132+
const {sizeType} = this.state;
109133
const size: any = Number(sizeType) || sizeType;
134+
const source = this.getSvgSource();
110135
return (
111136
<>
112137
{size ? (
113-
<Image source={isFile ? file : xml} width={size} height={size}/>
138+
<Image source={source} width={size} height={size}/>
114139
) : (
115-
<Image source={isFile ? file : xml}/>
140+
<Image source={source}/>
116141
)}
117142
</>
118143
);
@@ -134,10 +159,9 @@ class ImageScreen extends Component<{}, State> {
134159
}
135160

136161
renderSvgOptions() {
137-
const {isFile} = this.state;
138162
return (
139163
<>
140-
{renderBooleanOption.call(this, isFile ? 'Load from file' : 'Use xml const', 'isFile')}
164+
{renderRadioGroup.call(this, 'SVG Type', 'svgType', SvgType, {isRow: true})}
141165
{renderRadioGroup.call(this, 'Size Type', 'sizeType', SizeType, {isRow: true})}
142166
</>
143167
);

demo/src/screens/incubatorScreens/IncubatorDialogScreen.tsx

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, {Component} from 'react';
2-
import {StyleSheet} from 'react-native';
2+
import {StyleSheet, ModalProps} from 'react-native';
33
import {FlatList} from 'react-native-gesture-handler';
4-
import {View, Text, Card, Button, Incubator, Colors, BorderRadiuses} from 'react-native-ui-lib'; //eslint-disable-line
4+
import {View, Text, Card, Button, Incubator, Colors, BorderRadiuses, Constants} from 'react-native-ui-lib'; //eslint-disable-line
55

66
interface Item {
77
value: string;
@@ -33,10 +33,11 @@ const colors: Item[] = [
3333

3434
export default class IncubatorDialogScreen extends Component {
3535
state = {visible: false};
36+
modalProps: ModalProps = {supportedOrientations: ['portrait', 'landscape']};
3637

3738
renderVerticalItem = ({item}: {item: Item}) => {
3839
return (
39-
<Text text50 margin-20 color={item.value}>
40+
<Text text50 margin-20 color={item.value} onPress={this.closeDialog}>
4041
{item.label}
4142
</Text>
4243
);
@@ -54,6 +55,10 @@ export default class IncubatorDialogScreen extends Component {
5455
this.setState({visible: false});
5556
};
5657

58+
onDismiss = () => {
59+
this.setState({visible: false});
60+
};
61+
5762
render() {
5863
const {visible} = this.state;
5964

@@ -65,7 +70,14 @@ export default class IncubatorDialogScreen extends Component {
6570
<View flex center>
6671
<Button marginV-20 label="Open Dialog" onPress={this.openDialog}/>
6772
</View>
68-
<Incubator.Dialog visible={visible} onDismiss={this.closeDialog} bottom containerStyle={styles.dialogContainer}>
73+
<Incubator.Dialog
74+
useSafeArea
75+
visible={visible}
76+
onDismiss={this.onDismiss}
77+
bottom
78+
centerH
79+
modalProps={this.modalProps}
80+
>
6981
<View style={styles.dialog}>
7082
<Text text60 margin-s2>
7183
Title (swipe here)
@@ -86,14 +98,11 @@ export default class IncubatorDialogScreen extends Component {
8698
}
8799

88100
const styles = StyleSheet.create({
89-
dialogContainer: {
90-
bottom: 20,
91-
alignSelf: 'center'
92-
},
93101
dialog: {
102+
marginBottom: 20,
94103
backgroundColor: Colors.white,
95-
width: 200,
96-
height: 300,
104+
maxHeight: Constants.screenHeight * 0.8,
105+
width: 300,
97106
borderRadius: BorderRadiuses.br20
98107
},
99108
verticalScroll: {

docs/foundation/modifiers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ The last type of modifiers is for styling your components
112112
```
113113

114114

115-
! all styling modifiers are based on our [`Colors` & `Typography` presets](/react-native-ui-lib/foundation/style).
115+
! all styling modifiers are based on our [`Colors` & `Typography` presets](/docs/foundation/style).
116116
You can load your own presets and use them as modifiers.
117117

118118

119119

120-
Check out [this example](/react-native-ui-lib/getting-started/usage) where we use most of these props.
120+
Check out [this example](/docs/getting-started/usage) where we use most of these props.

docs/getting-started/setup.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ import {KeyboardTrackingView, KeyboardAwareInsetsView, KeyboardRegistry, Keyboar
2424

2525
## Install UILib
2626

27-
First, run `npm install react-native-ui-lib`
27+
- Run `npm install react-native-ui-lib`
28+
- Install mandatory [peer dependencies](#peer-dependencies), `npm i react-native-reanimated react-native-gesture-handler`
29+
- Install ios pods, `cd ios && pod install`
2830

2931
If you plan on using specific components, see **UILib Packages** above.
3032
*For some packages you might still need to install one of the peer dependencies*
@@ -62,10 +64,9 @@ Some of the components are using the native dependencies listed below - those ar
6264

6365
## Demo App
6466

65-
Our demo app is located [here](https://github.com/wix/react-native-ui-lib/tree/master/demo). To run it:
66-
67-
- Clone the repo
68-
- Install dependencies: `npm install`
69-
- (for iOS) `cd ios && pod install && cd ..`
70-
- Start the packager: `npm start`
71-
- Build the app: `npm run ios` or `npm run android` (or from Xcode or Android Studio).
67+
- Clone the project `git clone [email protected]:wix/react-native-ui-lib.git`
68+
- `cd react-native-ui-lib`
69+
- Install dependencies `npm install`
70+
- (for iOS) `cd ios && pod install`
71+
- Start the packager `npm start`
72+
- Build the app `npm run ios` or `npm run android` (or from Xcode or Android Studio).

docuilib/docusaurus.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
77
module.exports = {
88
title: 'RNUILib',
99
tagline: 'React Native UI Lib',
10-
url: 'https://github.com/wix/react-native-ui-lib',
11-
baseUrl: '/',
10+
url: 'https://wix.github.io',
11+
baseUrl: '/react-native-ui-lib/',
1212
onBrokenLinks: 'throw',
1313
onBrokenMarkdownLinks: 'warn',
1414
favicon: 'img/favicon.ico',
1515
organizationName: 'wix', // Usually your GitHub org/user name.
1616
projectName: 'react-native-ui-lib', // Usually your repo name.
17+
trailingSlash: false,
1718
customFields: {
1819
expoSnackLink: 'https://snack.expo.io/@ethanshar/rnuilib_snack?platform=ios&supportedPlatforms=ios,android',
19-
stars: '3.8'
20+
stars: '3.9'
2021
},
2122
plugins: ['docusaurus-plugin-sass'],
2223
presets: [

docuilib/src/components/ComponentsSection.module.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66
flex-direction: column;
77
align-items: center;
88
width: 100%;
9-
9+
padding-left: 40px;
10+
padding-right: 40px;
11+
1012
.componentsInner {
1113
text-align: center;
1214
display: flex;
1315
flex-direction: column;
1416
align-items: center;
1517
width: 100%;
18+
padding: 0;
1619

1720
p {
1821
@include desktop {

docuilib/src/components/FeatureSection.module.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
padding-bottom: 100px;
88
width: 100%;
99
text-align: center;
10+
padding-left: 40px;
11+
padding-right: 40px;
1012

1113
.cards {
1214
display: flex;

docuilib/src/components/MainSection.module.scss

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
.main {
44
position: relative;
5-
height: 75vh;
65
width: 100%;
76
display: flex;
87
justify-content: center;
8+
margin-bottom: 40px;
99

1010
@include desktop {
1111
height: 100vh;
@@ -22,16 +22,16 @@
2222
}
2323

2424
.mainContent {
25-
position: absolute;
2625
z-index: 1;
2726
display: flex;
2827
flex-direction: column;
2928
align-items: flex-start;
3029
top: 15vh;
3130
text-align: center;
32-
padding: 0 40px;
31+
padding: 40px;
3332

3433
@include desktop() {
34+
position: absolute;
3535
padding: 0;
3636
top: 15vw;
3737
left: 7vw;
@@ -40,9 +40,15 @@
4040
}
4141

4242
> p {
43-
font-size: 3em;
43+
font-size: 2.5em;
4444
font-weight: 600;
4545
margin: 0;
46+
line-height: 1.2;
47+
48+
@include desktop {
49+
font-size: 3em;
50+
line-height: 1.5;
51+
}
4652

4753
> .libName {
4854
color: $primary;
@@ -55,8 +61,10 @@
5561
border: 1px solid;
5662
border-radius: 2px;
5763
align-self: center;
58-
64+
margin-top: 20px;
65+
5966
@include desktop {
67+
margin-top: 0;
6068
align-self: flex-start;
6169
}
6270

docuilib/src/components/MainSection.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import GoldStarSvg from '@site/static/img/goldStar.svg';
88

99
export default () => {
1010
const {siteConfig} = useDocusaurusContext();
11-
console.warn('ethan - siteConfig', siteConfig.customFields.stars)
1211

1312
return (
1413
<div className={styles.main}>

0 commit comments

Comments
 (0)