Skip to content

Commit a81849a

Browse files
committed
Merge branch 'master' into release
2 parents caea1da + 3ad00bc commit a81849a

File tree

87 files changed

+1374
-1023
lines changed

Some content is hidden

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

87 files changed

+1374
-1023
lines changed

demo/src/screens/componentScreens/CardsScreen.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
Colors,
77
View,
88
Card,
9-
CardPropTypes,
9+
CardProps,
1010
Button,
1111
Text,
1212
Image
@@ -47,7 +47,7 @@ export default class CardsScreen extends Component<
4747
activeOpacity={1}
4848
marginR-20
4949
>
50-
<Card.Section imageSource={cardImage} imageStyle={{height: '100%'}} />
50+
<Card.Section source={cardImage} imageStyle={{height: '100%'}} />
5151
</Card>
5252
<Card
5353
height={120}
@@ -61,7 +61,7 @@ export default class CardsScreen extends Component<
6161
borderWidth: 3
6262
}}
6363
>
64-
<Card.Section imageSource={cardImage} imageStyle={{height: '100%'}} />
64+
<Card.Section source={cardImage} imageStyle={{height: '100%'}} />
6565
</Card>
6666
</View>
6767
);
@@ -122,14 +122,14 @@ export default class CardsScreen extends Component<
122122
>
123123
{isImageOnLeft && (
124124
<Card.Section
125-
imageSource={cardImage}
125+
source={cardImage}
126126
imageStyle={{width: 115, height: '100%'}}
127127
/>
128128
)}
129129
{useSection ? this.renderTextSection() : this.renderText()}
130130
{!isImageOnLeft && (
131131
<Card.Section
132-
imageSource={cardImage}
132+
source={cardImage}
133133
imageStyle={{width: 115, height: '100%'}}
134134
/>
135135
)}
@@ -147,12 +147,12 @@ export default class CardsScreen extends Component<
147147
]}
148148
style={{padding: 20}}
149149
/>
150-
<Card.Section imageSource={cardImage2} imageStyle={{height: 120}} />
150+
<Card.Section source={cardImage2} imageStyle={{height: 120}} />
151151
</Card>
152152
);
153153
};
154154

155-
renderCoupon = (cardProps: CardPropTypes) => {
155+
renderCoupon = (cardProps: CardProps) => {
156156
return (
157157
<Card
158158
{...cardProps}
@@ -192,7 +192,7 @@ export default class CardsScreen extends Component<
192192
);
193193
};
194194

195-
renderComplexImage = (cardProps: CardPropTypes, image: React.ReactNode) => {
195+
renderComplexImage = (cardProps: CardProps, image: React.ReactNode) => {
196196
return (
197197
<Card
198198
{...cardProps}
@@ -223,7 +223,7 @@ export default class CardsScreen extends Component<
223223
<Card.Section
224224
flex
225225
backgroundColor={Colors.blue20}
226-
imageSource={featureIcon}
226+
source={featureIcon}
227227
imageStyle={{
228228
width: 25,
229229
height: 25,
@@ -242,7 +242,7 @@ export default class CardsScreen extends Component<
242242
{'marginL-5': true},
243243
<Card.Section
244244
flex
245-
imageSource={cardImage2}
245+
source={cardImage2}
246246
imageStyle={{height: '100%'}}
247247
content={[
248248
{text: 'Special sale!', text70: true, blue10: true},
@@ -282,7 +282,7 @@ export default class CardsScreen extends Component<
282282
);
283283
};
284284

285-
renderBackgroundCard = (cardProps: CardPropTypes, body: React.ReactNode) => {
285+
renderBackgroundCard = (cardProps: CardProps, body: React.ReactNode) => {
286286
return (
287287
<Card flex center height={80} {...cardProps}>
288288
{body}
@@ -336,7 +336,7 @@ export default class CardsScreen extends Component<
336336
onPress={() => console.log('press on a card')}
337337
>
338338
<Card.Section
339-
imageSource={post.coverImage}
339+
source={post.coverImage}
340340
imageStyle={{height: 160}}
341341
/>
342342

demo/src/screens/componentScreens/ChipsInputScreen.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export default class ChipsInputScreen extends Component {
1010
this.state = {
1111
tags: [{label: 'Amit'}, {label: 'Ethan', invalid: true}],
1212
tags2: ['Chips', 'Input'],
13-
tags3: ['Non', 'Removable', 'Tags']
13+
tags3: ['Non', 'Removable', 'Tags'],
14+
tags4: ['Change', 'Typography']
1415
};
1516
}
1617

@@ -34,10 +35,18 @@ export default class ChipsInputScreen extends Component {
3435
ChipsInput
3536
</Text>
3637

37-
<ChipsInput containerStyle={{marginBottom: 25}} placeholder="Enter Tags" tags={this.state.tags2}/>
38+
<ChipsInput
39+
containerStyle={{marginBottom: 25}}
40+
placeholder="Enter Tags"
41+
tags={this.state.tags2}
42+
/>
3843

39-
<ChipsInput containerStyle={{marginBottom: 25}} placeholder="Enter Tags" tags={this.state.tags}
40-
validationErrorMessage="error validation message" />
44+
<ChipsInput
45+
containerStyle={{marginBottom: 25}}
46+
placeholder="Enter Tags"
47+
tags={this.state.tags}
48+
validationErrorMessage="error validation message"
49+
/>
4150

4251
<ChipsInput
4352
containerStyle={{marginBottom: 25}}
@@ -57,6 +66,13 @@ export default class ChipsInputScreen extends Component {
5766
onTagPress={this.onTagPress}
5867
inputStyle={{...Typography.text60, color: Colors.blue30}}
5968
/>
69+
70+
<ChipsInput
71+
text60
72+
containerStyle={{marginBottom: 25}}
73+
placeholder="Enter Tags"
74+
tags={this.state.tags4}
75+
/>
6076
</View>
6177
</ScrollView>
6278
);

demo/src/screens/componentScreens/ColorPickerScreen.js

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,24 @@ export default class ColorPickerScreen extends Component {
6060
return (
6161
<ScrollView style={styles.container} contentContainerStyle={{paddingBottom: 20}}>
6262
<View center bg-white marginV-10>
63-
<Text text60 margin-10 style={{color}}>Selected Color: {color}</Text>
63+
<Text text60 margin-10 style={{color}}>
64+
Selected Color: {color}
65+
</Text>
6466
<View center marginB-10 style={{height: 50, width: 200, backgroundColor: color}}>
65-
<Text text60 style={{color: textColor}}>{color}</Text>
67+
<Text text60 style={{color: textColor}}>
68+
{color}
69+
</Text>
6670
</View>
6771
</View>
6872
<View bg-white>
69-
<Text text60 marginL-20 marginB-4 marginT-24>Theme Color</Text>
73+
<Text text60 marginL-20 marginB-4 marginT-24>
74+
Theme Color
75+
</Text>
7076
<Text marginL-20>Choose a color for your place’s theme.</Text>
71-
<ColorPalette value={paletteValue} onValueChange={this.onPaletteValueChange} colors={colors}/>
72-
<Text marginL-20 marginT-16>Custom Colors</Text>
77+
<ColorPalette value={paletteValue} onValueChange={this.onPaletteValueChange} colors={colors} />
78+
<Text marginL-20 marginT-16>
79+
Custom Colors
80+
</Text>
7381
<ColorPicker
7482
initialColor={color}
7583
colors={customColors}
@@ -82,11 +90,19 @@ export default class ColorPickerScreen extends Component {
8290
</View>
8391

8492
<View marginV-10 bg-white>
85-
<Text center text60 marginT-10>Color Name</Text>
93+
<Text center text60 marginT-10>
94+
Color Name
95+
</Text>
8696
<View spread row margin-10 style={{backgroundColor: nearestColor}}>
87-
<Text margin-5 text70 style={{color: textColor}}>{nearestColor}</Text>
88-
<Text margin-5 text60 style={{color: textColor}}>{colorName}</Text>
89-
<Text margin-5 text70 style={{color: textColor}}>{isMapped}</Text>
97+
<Text margin-5 text70 style={{color: textColor}}>
98+
{nearestColor}
99+
</Text>
100+
<Text margin-5 text60 style={{color: textColor}}>
101+
{colorName}
102+
</Text>
103+
<Text margin-5 text70 style={{color: textColor}}>
104+
{isMapped}
105+
</Text>
90106
</View>
91107
</View>
92108
</ScrollView>

demo/src/screens/componentScreens/EmptyStateScreen.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ export default class EmptyStateScreen extends Component {
3636
title='Oppsie (with local image)'
3737
subtitle='Nothing to see here..'
3838
ctaLabel='OK'
39-
imageSource={localImageSource}
39+
source={localImageSource}
4040
/>
4141
</View>
4242
<View style={styles.pageView}>
4343
<StateScreen
4444
title='Oppsie (with remote image)'
4545
subtitle='Nothing to see here..'
4646
ctaLabel='OK'
47-
imageSource={remoteImageSource}
47+
source={remoteImageSource}
4848
/>
4949
</View>
5050
</ScrollView>

demo/src/screens/componentScreens/ExpandableSectionScreen.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const elements = [
1717
]}
1818
style={{padding: 20}}
1919
/>
20-
<Card.Section imageSource={cardImage2} imageStyle={{height: 120}} />
20+
<Card.Section source={cardImage2} imageStyle={{height: 120}} />
2121
</Card>,
2222
<Card style={{marginBottom: 10}} onPress={() => {}}>
2323
<Card.Section
@@ -27,7 +27,7 @@ const elements = [
2727
]}
2828
style={{padding: 20}}
2929
/>
30-
<Card.Section imageSource={cardImage} imageStyle={{height: 120}} />
30+
<Card.Section source={cardImage} imageStyle={{height: 120}} />
3131
</Card>,
3232
<Card style={{marginBottom: 10}} onPress={() => {}}>
3333
<Card.Section
@@ -37,7 +37,7 @@ const elements = [
3737
]}
3838
style={{padding: 20}}
3939
/>
40-
<Card.Section imageSource={cardImage2} imageStyle={{height: 120}} />
40+
<Card.Section source={cardImage2} imageStyle={{height: 120}} />
4141
</Card>
4242
];
4343

demo/src/screens/componentScreens/OverlaysScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default class OverlaysScreen extends Component {
7878
Card.Image Overlay
7979
</Text>
8080
<Card marginB-s4 padding-s2 borderRadius={4} row height={106}>
81-
<Card.Image style={styles.cardImage} imageSource={image} overlayType={Image.overlayTypes.VERTICAL}/>
81+
<Card.Image style={styles.cardImage} source={image} overlayType={Image.overlayTypes.VERTICAL}/>
8282
<View flex marginL-s2 centerV>
8383
<Text text50>{Image.overlayTypes.VERTICAL}</Text>
8484
<Text text70>Ipsum nostrud officia deserunt irure eu.</Text>

demo/src/screens/componentScreens/PickerScreen.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default class PickerScreen extends Component {
2828
itemsCount: 1,
2929
// language: {value: 'java', label: 'Java'},
3030
language: undefined,
31-
language2: undefined, // for migrated picker example
31+
language2: options[2].value, // for migrated picker example
3232
languages: [],
3333
nativePickerValue: 'java',
3434
customModalValues: [],
@@ -235,6 +235,7 @@ export default class PickerScreen extends Component {
235235
<Text text60 marginT-s5 marginB-s2>Migrated Picker</Text>
236236

237237
<Picker
238+
migrate
238239
title="Language"
239240
placeholder="Favorite Language"
240241
value={this.state.language2}
@@ -243,6 +244,7 @@ export default class PickerScreen extends Component {
243244
showSearch
244245
searchPlaceholder={'Search a language'}
245246
searchStyle={{color: Colors.blue30, placeholderTextColor: Colors.dark50}}
247+
// mode={Picker.modes.MULTI}
246248
// useNativePicker
247249
>
248250
{_.map(options, option => (
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare const useToggleValue: (initial: any, second?: any) => any[];
2+
export default useToggleValue;

generatedTypes/components/actionBar/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { ViewStyle } from 'react-native';
3-
import { ButtonPropTypes } from '../button';
3+
import { ButtonProps } from '../button';
44
/**
55
* @description: Quick actions bar, each action support Button component props
66
* @modifiers: margin, padding
@@ -19,7 +19,7 @@ export declare type ActionBarProps = {
1919
/**
2020
* actions for the action bar
2121
*/
22-
actions: ButtonPropTypes[];
22+
actions: ButtonProps[];
2323
/**
2424
* should action be equally centered
2525
*/

generatedTypes/components/avatar/index.d.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export declare enum BadgePosition {
1414
BOTTOM_RIGHT = "BOTTOM_RIGHT",
1515
BOTTOM_LEFT = "BOTTOM_LEFT"
1616
}
17-
export declare type AvatarPropTypes = {
17+
export declare type AvatarProps = {
1818
/**
1919
* Adds fade in animation when Avatar image loads
2020
*/
@@ -108,6 +108,7 @@ export declare type AvatarPropTypes = {
108108
*/
109109
testID?: string;
110110
};
111+
export declare type AvatarPropTypes = AvatarProps;
111112
/**
112113
* @description: Avatar component for displaying user profile images
113114
* @extends: TouchableOpacity
@@ -116,9 +117,9 @@ export declare type AvatarPropTypes = {
116117
* @image: https://user-images.githubusercontent.com/33805983/34480603-197d7f64-efb6-11e7-9feb-db8ba756f055.png
117118
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/AvatarsScreen.js
118119
*/
119-
declare class Avatar extends PureComponent<AvatarPropTypes> {
120+
declare class Avatar extends PureComponent<AvatarProps> {
120121
styles: ReturnType<typeof createStyles>;
121-
constructor(props: AvatarPropTypes);
122+
constructor(props: AvatarProps);
122123
static displayName: string;
123124
static modes: typeof StatusModes;
124125
static badgePosition: typeof BadgePosition;
@@ -142,7 +143,7 @@ declare class Avatar extends PureComponent<AvatarPropTypes> {
142143
renderImage(): JSX.Element | undefined;
143144
render(): JSX.Element;
144145
}
145-
declare function createStyles(props: AvatarPropTypes): {
146+
declare function createStyles(props: AvatarProps): {
146147
initialsContainerWithInset: {
147148
top: number;
148149
right: number;
@@ -160,7 +161,7 @@ declare function createStyles(props: AvatarPropTypes): {
160161
};
161162
};
162163
export { Avatar };
163-
declare const _default: React.ComponentClass<AvatarPropTypes & {
164+
declare const _default: React.ComponentClass<AvatarProps & {
164165
useCustomTheme?: boolean | undefined;
165166
}, any> & typeof Avatar;
166167
export default _default;

0 commit comments

Comments
 (0)