unicorn-demo-app 6.7.1 → 6.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unicorn-demo-app",
3
- "version": "6.7.1",
3
+ "version": "6.8.1",
4
4
  "main": "src/index.js",
5
5
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@ import {
11
11
  View,
12
12
  Text,
13
13
  TouchableOpacity,
14
- Image,
14
+ Icon,
15
15
  Button,
16
16
  TabController,
17
17
  Incubator
@@ -180,7 +180,7 @@ class MainScreen extends Component {
180
180
  filterText ? (
181
181
  <Button link iconSource={Assets.icons.demo.close} grey10 onPress={this.clearSearch}/>
182
182
  ) : (
183
- <Image source={Assets.icons.demo.search}/>
183
+ <Icon source={Assets.icons.demo.search}/>
184
184
  )
185
185
  }
186
186
  />
@@ -210,7 +210,7 @@ class MainScreen extends Component {
210
210
  <Text style={[item.deprecate && styles.entryTextDeprecated]} grey10 text50>
211
211
  {item.title}
212
212
  </Text>
213
- <Image source={chevronIcon} style={{tintColor: Colors.grey10}} supportRTL/>
213
+ <Icon source={chevronIcon} style={{tintColor: Colors.grey10}} supportRTL/>
214
214
  </TouchableOpacity>
215
215
  );
216
216
  } else {
@@ -153,11 +153,11 @@ export const navigationData = {
153
153
  Incubator: {
154
154
  title: 'Incubator (Experimental)',
155
155
  screens: [
156
- {title: '(New) ChipsInput', tags: 'chips input', screen: 'unicorn.components.IncubatorChipsInputScreen'},
156
+ {title: 'ChipsInput (New)', tags: 'chips input', screen: 'unicorn.components.IncubatorChipsInputScreen'},
157
157
  {title: 'Native TouchableOpacity', tags: 'touchable native', screen: 'unicorn.incubator.TouchableOpacityScreen'},
158
- {title: '(New) Dialog', tags: 'dialog modal popup alert', screen: 'unicorn.incubator.IncubatorDialogScreen'},
159
- {title: '(New) TextField', tags: 'text field input', screen: 'unicorn.components.IncubatorTextFieldScreen'},
160
- {title: '(New) Toast', tags: 'toast', screen: 'unicorn.components.IncubatorToastScreen'},
158
+ {title: 'Dialog (New)', tags: 'dialog modal popup alert', screen: 'unicorn.incubator.IncubatorDialogScreen'},
159
+ {title: 'TextField (New)', tags: 'text field input', screen: 'unicorn.components.IncubatorTextFieldScreen'},
160
+ {title: 'Toast (New)', tags: 'toast', screen: 'unicorn.components.IncubatorToastScreen'},
161
161
  {title: 'ExpandableOverlay', tags: 'text field expandable input picker', screen: 'unicorn.components.IncubatorExpandableOverlayScreen'},
162
162
  {title: 'WheelPicker (Incubator)', tags: 'wheel picker spinner experimental', screen: 'unicorn.incubator.WheelPickerScreen'},
163
163
  {title: 'Pan View', tags: 'pan swipe drag', screen: 'unicorn.incubator.PanViewScreen'},
@@ -1,6 +1,6 @@
1
1
  import React, {Component} from 'react';
2
2
  import {ScrollView} from 'react-native';
3
- import {View, Text, Image, Colors, Assets, OverlayTypes} from 'react-native-ui-lib';
3
+ import {View, Text, Icon, Image, Colors, Assets, OverlayTypes} from 'react-native-ui-lib';
4
4
  import {renderBooleanOption, renderRadioGroup, renderSliderOption} from '../ExampleScreenPresenter';
5
5
 
6
6
  const IMAGE_URL =
@@ -94,7 +94,7 @@ class ImageScreen extends Component<{}, State> {
94
94
  return (
95
95
  <View padding-20 flex bottom={overlayType === Image.overlayTypes.BOTTOM}>
96
96
  <View row centerV>
97
- <Image
97
+ <Icon
98
98
  style={{margin: 5, marginRight: 10}}
99
99
  source={Assets.icons.demo.camera}
100
100
  tintColor={overlayType !== 'none' ? Colors.white : undefined}
@@ -106,7 +106,7 @@ class ImageScreen extends Component<{}, State> {
106
106
  </View>
107
107
  );
108
108
  } else {
109
- return <Image style={{margin: 5}} source={Assets.icons.demo.camera}/>;
109
+ return <Icon style={{margin: 5}} source={Assets.icons.demo.camera}/>;
110
110
  }
111
111
  }
112
112
  }
@@ -1,7 +1,7 @@
1
1
  import _ from 'lodash';
2
2
  import React, {Component} from 'react';
3
- import {ScrollView, Image} from 'react-native';
4
- import {View, Colors, Dialog, Text, Picker, Avatar, Assets, PanningProvider, Typography} from 'react-native-ui-lib'; //eslint-disable-line
3
+ import {ScrollView} from 'react-native';
4
+ import {View, Colors, Icon, Dialog, Text, Picker, Avatar, Assets, PanningProvider, Typography} from 'react-native-ui-lib'; //eslint-disable-line
5
5
  import contactsData from '../../data/conversations';
6
6
  import tagIcon from '../../assets/icons/tags.png';
7
7
  import dropdown from '../../assets/icons/chevronDown.png';
@@ -172,7 +172,7 @@ export default class PickerScreen extends Component {
172
172
  renderPicker={({label}) => {
173
173
  return (
174
174
  <View row>
175
- <Image style={{marginRight: 1, height: 16, resizeMode: 'contain'}} source={tagIcon}/>
175
+ <Icon style={{marginRight: 1, height: 16, resizeMode: 'contain'}} source={tagIcon}/>
176
176
  <Text grey10 text80>
177
177
  {label} Posts
178
178
  </Text>
@@ -225,7 +225,7 @@ export default class PickerScreen extends Component {
225
225
  {item.name}
226
226
  </Text>
227
227
  </View>
228
- {props.isSelected && <Image source={Assets.icons.check}/>}
228
+ {props.isSelected && <Icon source={Assets.icons.check}/>}
229
229
  </View>
230
230
  )}
231
231
  getItemLabel={item => item.name}
@@ -1,6 +1,6 @@
1
1
  import React, {Component} from 'react';
2
2
  import {StyleSheet, ScrollView} from 'react-native';
3
- import {Colors, View, Text, Image, Slider, GradientSlider, ColorSliderGroup} from 'react-native-ui-lib';
3
+ import {Colors, View, Text, Icon, Slider, GradientSlider, ColorSliderGroup, Constants} from 'react-native-ui-lib';
4
4
 
5
5
  const INITIAL_VALUE = 0;
6
6
  const COLOR = Colors.blue30;
@@ -28,15 +28,15 @@ export default class SliderScreen extends Component<SliderScreenProps, SliderScr
28
28
 
29
29
  onSliderValueChange = (value: number) => {
30
30
  this.setState({sliderValue: value});
31
- }
31
+ };
32
32
 
33
33
  onGradientValueChange = (value: string, alpha: number) => {
34
34
  this.setState({color: value, alpha});
35
- }
35
+ };
36
36
 
37
37
  onGroupValueChange = (value: string) => {
38
38
  console.warn('onGroupValueChange: ', value);
39
- }
39
+ };
40
40
 
41
41
  render() {
42
42
  const {color, alpha, sliderValue} = this.state;
@@ -44,56 +44,61 @@ export default class SliderScreen extends Component<SliderScreenProps, SliderScr
44
44
  return (
45
45
  <ScrollView showsVerticalScrollIndicator={false}>
46
46
  <View flex padding-20>
47
- <Text titleHuge marginB-20>Sliders</Text>
48
-
49
- <View row centerV>
50
- <Image assetName={'megaphone'} style={styles.image}/>
51
- <Slider
52
- onValueChange={this.onSliderValueChange}
47
+ <Text titleHuge marginB-20>
48
+ Sliders
49
+ </Text>
50
+
51
+ <View row centerV style={Constants.isRTL && styles.ltr}>
52
+ <Icon assetName={'search'} style={styles.image}/>
53
+ <Slider
54
+ onValueChange={this.onSliderValueChange}
53
55
  value={INITIAL_VALUE}
54
- minimumValue={0}
55
- maximumValue={100}
56
- step={1}
56
+ minimumValue={0}
57
+ maximumValue={100}
58
+ step={1}
57
59
  containerStyle={styles.sliderContainer}
60
+ disableRTL
58
61
  />
59
- <Text bodySmall grey30 style={styles.text}>{sliderValue}%</Text>
62
+ <Text bodySmall grey30 style={styles.text}>
63
+ {sliderValue}%
64
+ </Text>
60
65
  </View>
61
-
66
+
62
67
  <Text marginT-30>Negatives</Text>
63
- <Slider
64
- minimumValue={-100}
65
- maximumValue={100}
66
- value={-30}
68
+ <Slider
69
+ minimumValue={-100}
70
+ maximumValue={100}
71
+ value={-30}
67
72
  minimumTrackTintColor={Colors.red30}
68
73
  thumbTintColor={Colors.red50}
69
74
  containerStyle={styles.slider}
70
75
  />
71
- <Slider
72
- minimumValue={-300}
73
- maximumValue={-100}
74
- value={-130}
76
+ <Slider
77
+ minimumValue={-300}
78
+ maximumValue={-100}
79
+ value={-130}
75
80
  minimumTrackTintColor={Colors.red30}
76
81
  thumbTintColor={Colors.red50}
77
82
  containerStyle={styles.slider}
78
83
  />
79
84
 
80
85
  <Text marginT-20>Disabled</Text>
81
- <Slider
82
- minimumValue={100}
83
- maximumValue={200}
84
- value={120}
86
+ <Slider
87
+ minimumValue={100}
88
+ maximumValue={200}
89
+ value={120}
85
90
  minimumTrackTintColor={Colors.red30}
86
91
  thumbTintColor={Colors.green30}
87
92
  containerStyle={styles.slider}
88
93
  disabled
89
94
  />
90
-
95
+
91
96
  <Text marginT-15>Custom with Steps</Text>
92
- <Slider
93
- value={50}
94
- minimumValue={0}
95
- maximumValue={100}
96
- step={25}
97
+ <Slider
98
+ value={50}
99
+ minimumValue={0}
100
+ maximumValue={100}
101
+ step={25}
97
102
  containerStyle={styles.slider}
98
103
  trackStyle={styles.track}
99
104
  thumbStyle={styles.thumb}
@@ -105,10 +110,12 @@ export default class SliderScreen extends Component<SliderScreenProps, SliderScr
105
110
 
106
111
  <Text marginT-15>Gradient Sliders</Text>
107
112
  <View row centerV>
108
- <Text text90 grey30>DEFAULT</Text>
109
- <GradientSlider
110
- color={color}
111
- containerStyle={styles.gradientSliderContainer}
113
+ <Text text90 grey30>
114
+ DEFAULT
115
+ </Text>
116
+ <GradientSlider
117
+ color={color}
118
+ containerStyle={styles.gradientSliderContainer}
112
119
  onValueChange={this.onGradientValueChange}
113
120
  />
114
121
  <View style={styles.box}>
@@ -116,25 +123,29 @@ export default class SliderScreen extends Component<SliderScreenProps, SliderScr
116
123
  </View>
117
124
  </View>
118
125
  <View row centerV>
119
- <Text text90 grey30>HUE</Text>
120
- <GradientSlider
121
- type={GradientSlider.types.HUE}
122
- color={COLOR}
123
- containerStyle={styles.gradientSliderContainer}
126
+ <Text text90 grey30>
127
+ HUE
128
+ </Text>
129
+ <GradientSlider
130
+ type={GradientSlider.types.HUE}
131
+ color={COLOR}
132
+ containerStyle={styles.gradientSliderContainer}
124
133
  onValueChange={this.onGradientValueChange}
125
134
  />
126
135
  <View style={styles.box}>
127
136
  <View style={{flex: 1, backgroundColor: color}}/>
128
137
  </View>
129
138
  </View>
130
-
131
- <Text marginT-25 marginB-20>Color Slider Group</Text>
132
- <ColorSliderGroup
133
- initialColor={color}
139
+
140
+ <Text marginT-25 marginB-20>
141
+ Color Slider Group
142
+ </Text>
143
+ <ColorSliderGroup
144
+ initialColor={color}
134
145
  sliderContainerStyle={styles.slider}
135
146
  containerStyle={styles.group}
136
147
  showLabels
137
- // onValueChange={this.onGroupValueChange}
148
+ // onValueChange={this.onGroupValueChange}
138
149
  />
139
150
  </View>
140
151
  </ScrollView>
@@ -143,6 +154,9 @@ export default class SliderScreen extends Component<SliderScreenProps, SliderScr
143
154
  }
144
155
 
145
156
  const styles = StyleSheet.create({
157
+ ltr: {
158
+ flexDirection: 'row-reverse'
159
+ },
146
160
  image: {
147
161
  tintColor: Colors.grey30
148
162
  },
@@ -165,23 +179,23 @@ const styles = StyleSheet.create({
165
179
  height: 2
166
180
  },
167
181
  thumb: {
168
- width: 26,
169
- height: 26,
170
- borderRadius: 13,
171
- borderColor: Colors.violet40,
172
- borderWidth: 1,
182
+ width: 26,
183
+ height: 26,
184
+ borderRadius: 13,
185
+ borderColor: Colors.violet40,
186
+ borderWidth: 1,
173
187
  shadowColor: Colors.white
174
188
  },
175
189
  activeThumb: {
176
- width: 40,
177
- height: 40,
190
+ width: 40,
191
+ height: 40,
178
192
  borderRadius: 20
179
193
  },
180
194
  box: {
181
- width: 20,
195
+ width: 20,
182
196
  height: 20,
183
197
  borderRadius: 4,
184
- borderWidth: 1,
198
+ borderWidth: 1,
185
199
  borderColor: Colors.grey60
186
200
  },
187
201
  group: {
@@ -1,7 +1,7 @@
1
1
  import _ from 'lodash';
2
2
  import React, {Component} from 'react';
3
3
  import {StyleSheet} from 'react-native';
4
- import {Assets, Colors, View, Button, Text, Image, TouchableOpacity, Toast} from 'react-native-ui-lib';
4
+ import {Assets, Colors, View, Button, Text, Icon, TouchableOpacity, Toast} from 'react-native-ui-lib';
5
5
 
6
6
 
7
7
  const colors = [Colors.green30, Colors.red30, Colors.violet30];
@@ -34,7 +34,7 @@ export default class ToastsScreen extends Component {
34
34
  return (
35
35
  <TouchableOpacity key={color} onPress={() => this.setState({selectedColor: color})}>
36
36
  <View center style={[styles.color, {backgroundColor}, isSelected && styles.selected]}>
37
- {color === 'none' && <Image source={plusIcon} tintColor={Colors.black}/>}
37
+ {color === 'none' && <Icon source={plusIcon} tintColor={Colors.black}/>}
38
38
  </View>
39
39
  </TouchableOpacity>
40
40
  );
@@ -11,7 +11,7 @@ import {
11
11
  Constants,
12
12
  Modal,
13
13
  BorderRadiuses,
14
- Image,
14
+ Icon,
15
15
  TouchableOpacity
16
16
  } from 'react-native-ui-lib';
17
17
  const {PanView} = Incubator;
@@ -157,7 +157,7 @@ class PanViewScreen extends Component {
157
157
  <Text text50 marginB-s2>
158
158
  Scrollable
159
159
  </Text>
160
- <Image source={Assets.icons.demo.chevronDown}/>
160
+ <Icon source={Assets.icons.demo.chevronDown}/>
161
161
  </View>
162
162
  </ScrollView>
163
163
  {showToast && this.renderToast()}
@@ -1,6 +1,6 @@
1
1
  import React, {Component} from 'react';
2
2
  import {ScrollView} from 'react-native';
3
- import {Assets, View, Text, Colors, Image, Button, Carousel, Picker} from 'react-native-ui-lib';
3
+ import {Assets, View, Text, Icon, Colors, Image, Button, Carousel, Picker} from 'react-native-ui-lib';
4
4
  import _ from 'lodash';
5
5
 
6
6
  const colorOptions: {[key: string]: {name: string; color: string}} = {
@@ -40,7 +40,7 @@ class Product extends Component {
40
40
  return (
41
41
  <ScrollView>
42
42
  <View>
43
- <Image
43
+ <Icon
44
44
  style={{position: 'absolute', top: 10, right: 10, zIndex: 100, tintColor: Colors.white}}
45
45
  source={Assets.icons.demo.share}
46
46
  />