unicorn-demo-app 6.18.2 → 6.19.0

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.18.2",
3
+ "version": "6.19.0",
4
4
  "main": "src/index.js",
5
5
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
6
6
  "license": "MIT",
@@ -1,5 +1,6 @@
1
1
  const products = [
2
2
  {
3
+ id: 'a',
3
4
  name: 'I\'m a Product',
4
5
  formattedPrice: '$19.99',
5
6
  inventory: {
@@ -10,6 +11,7 @@ const products = [
10
11
  mediaUrl: 'https://images.pexels.com/photos/248412/pexels-photo-248412.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=200'
11
12
  },
12
13
  {
14
+ id: 'b',
13
15
  name: 'I\'m a Product',
14
16
  formattedPrice: '$19.99',
15
17
  inventory: {
@@ -20,6 +22,7 @@ const products = [
20
22
  mediaUrl: 'https://images.pexels.com/photos/3737604/pexels-photo-3737604.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=200'
21
23
  },
22
24
  {
25
+ id: 'c',
23
26
  name: 'I\'m a Product',
24
27
  formattedPrice: '$19.99',
25
28
  inventory: {
@@ -30,6 +33,7 @@ const products = [
30
33
  mediaUrl: 'https://images.pexels.com/photos/3685538/pexels-photo-3685538.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=200'
31
34
  },
32
35
  {
36
+ id: 'd',
33
37
  name: 'I\'m a Product',
34
38
  formattedPrice: '$19.99',
35
39
  inventory: {
@@ -40,6 +44,7 @@ const products = [
40
44
  mediaUrl: 'https://images.pexels.com/photos/4202467/pexels-photo-4202467.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=200'
41
45
  },
42
46
  {
47
+ id: 'e',
43
48
  name: 'I\'m a Product',
44
49
  formattedPrice: '$19.99',
45
50
  inventory: {
@@ -50,6 +55,7 @@ const products = [
50
55
  mediaUrl: 'https://static.wixstatic.com/media/cda177_f9de629d8c97416f82b398725bd49918.jpg_128'
51
56
  },
52
57
  {
58
+ id: 'f',
53
59
  name: 'I\'m a Product',
54
60
  formattedPrice: '$19.99',
55
61
  inventory: {
@@ -60,6 +66,7 @@ const products = [
60
66
  mediaUrl: 'https://static.wixstatic.com/media/cda177_1782572f1dfc49d397e830918d912568.jpg_128'
61
67
  },
62
68
  {
69
+ id: 'g',
63
70
  name: 'I\'m a Product',
64
71
  formattedPrice: '$19.99',
65
72
  inventory: {
@@ -70,6 +77,7 @@ const products = [
70
77
  mediaUrl: 'https://static.wixstatic.com/media/cda177_03906910d07749199b09e443ce9fed6c.jpg_128'
71
78
  },
72
79
  {
80
+ id: 'h',
73
81
  name: 'I\'m a Product',
74
82
  formattedPrice: '$19.99',
75
83
  inventory: {
@@ -80,6 +88,7 @@ const products = [
80
88
  mediaUrl: 'https://static.wixstatic.com/media/cda177_9d3e5b8fc70e4d2997806ece35e7de54.jpg_128'
81
89
  },
82
90
  {
91
+ id: 'i',
83
92
  name: 'I\'m a Product',
84
93
  formattedPrice: '$19.99',
85
94
  inventory: {
@@ -90,6 +99,7 @@ const products = [
90
99
  mediaUrl: 'https://static.wixstatic.com/media/cda177_db24e0568cdc4a82be0a8559fb123b55.jpg_128'
91
100
  },
92
101
  {
102
+ id: 'j',
93
103
  name: 'I\'m a Product',
94
104
  formattedPrice: '$19.99',
95
105
  inventory: {
@@ -100,6 +110,7 @@ const products = [
100
110
  mediaUrl: 'https://static.wixstatic.com/media/cda177_085a5f9575ba4b208f6091b26cbda4c4.jpg_128'
101
111
  },
102
112
  {
113
+ id: 'k',
103
114
  name: 'I\'m a Product',
104
115
  formattedPrice: '$19.99',
105
116
  inventory: {
@@ -110,6 +121,7 @@ const products = [
110
121
  mediaUrl: 'https://static.wixstatic.com/media/cda177_82d66fece3e54a7aa10d49bda4d98259.jpg_128'
111
122
  },
112
123
  {
124
+ id: 'l',
113
125
  name: 'I\'m a Product',
114
126
  formattedPrice: '$19.99',
115
127
  inventory: {
@@ -120,6 +132,7 @@ const products = [
120
132
  mediaUrl: 'https://static.wixstatic.com/media/84770f_c611ded729fd4461a1bb57134d4e9dd2.png_128'
121
133
  },
122
134
  {
135
+ id: 'm',
123
136
  name: 'I\'m a Product',
124
137
  formattedPrice: '$19.99',
125
138
  inventory: {
@@ -130,6 +143,7 @@ const products = [
130
143
  mediaUrl: 'https://images.pexels.com/photos/3612182/pexels-photo-3612182.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=150'
131
144
  },
132
145
  {
146
+ id: 'n',
133
147
  name: 'I\'m a Product',
134
148
  formattedPrice: '$19.99',
135
149
  inventory: {
@@ -140,6 +154,7 @@ const products = [
140
154
  mediaUrl: 'https://images.pexels.com/photos/4841529/pexels-photo-4841529.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=150'
141
155
  },
142
156
  {
157
+ id: 'o',
143
158
  name: 'I\'m a Product',
144
159
  formattedPrice: '$19.99',
145
160
  inventory: {
@@ -150,6 +165,7 @@ const products = [
150
165
  mediaUrl: 'https://images.pexels.com/photos/4173450/pexels-photo-4173450.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=150'
151
166
  },
152
167
  {
168
+ id: 'p',
153
169
  name: 'I\'m a Product',
154
170
  formattedPrice: '$19.99',
155
171
  inventory: {
@@ -12,7 +12,7 @@ const examples = [
12
12
  {
13
13
  title: 'Initials with Color',
14
14
  label: 'AD',
15
- backgroundColor: Colors.$backgroundWarning,
15
+ backgroundColor: Colors.$backgroundWarningLight,
16
16
  labelColor: Colors.$textMajor,
17
17
  ribbonLabel: 'New',
18
18
  ribbonStyle: {backgroundColor: Colors.purple30}
@@ -95,13 +95,13 @@ const examples = [
95
95
  },
96
96
  {
97
97
  title: 'Empty Gravatar',
98
- backgroundColor: Colors.$backgroundDanger,
98
+ backgroundColor: Colors.$backgroundDangerLight,
99
99
  source: {uri: 'https://www.gravatar.com/avatar/2497473d558a37020c558bf26e380a7c?d=blank'}
100
100
  },
101
101
  {
102
102
  title: 'With custom badge label',
103
103
  label: 'LD',
104
- backgroundColor: Colors.$backgroundDanger,
104
+ backgroundColor: Colors.$backgroundDangerLight,
105
105
  badgePosition: 'BOTTOM_RIGHT',
106
106
  badgeProps: {
107
107
  label: '+2',
@@ -103,7 +103,7 @@ export default class ButtonsScreen extends Component {
103
103
  <Button
104
104
  label={'Dark Label'}
105
105
  $textDanger
106
- backgroundColor={Colors.$backgroundDanger}
106
+ backgroundColor={Colors.$backgroundDangerLight}
107
107
  style={{marginBottom: ButtonSpace}}
108
108
  />
109
109
  <Button label={'With Shadow'} enableShadow style={{marginBottom: ButtonSpace}}/>
@@ -275,12 +275,12 @@ export default class ButtonsScreen extends Component {
275
275
  <Button
276
276
  fullWidth
277
277
  size="medium"
278
- bg-$backgroundDanger
278
+ bg-$backgroundDangerLight
279
279
  $textDefault
280
280
  label="Medium Size Full Width"
281
281
  marginB-10
282
282
  />
283
- <Button fullWidth size="small" bg-$backgroundSuccess $textSuccess label="Small Size Full Width"/>
283
+ <Button fullWidth size="small" bg-$backgroundSuccessLight $textSuccess label="Small Size Full Width"/>
284
284
  </View>
285
285
  </ScrollView>
286
286
  </View>
@@ -55,20 +55,20 @@ export default class ColorSwatchScreen extends Component {
55
55
  const {color, color1, color2, selected} = this.state;
56
56
 
57
57
  return (
58
- <ScrollView style={{backgroundColor: Colors.$backgroundNeutralLight}}>
58
+ <ScrollView>
59
59
  <View flex center useSafeArea>
60
- <Text margin-5 text60 grey10>
60
+ <Text margin-5 text60>
61
61
  Single ColorSwatch
62
62
  </Text>
63
63
  <View row>
64
64
  <ColorSwatch selected={selected} onPress={this.onPress}/>
65
65
  <View>
66
- <ColorSwatch selected color={Colors.$backgroundMajor}/>
66
+ <ColorSwatch selected color={Colors.$backgroundMajorLight}/>
67
67
  <Text>Disabled</Text>
68
68
  </View>
69
69
  </View>
70
70
 
71
- <Text marginT-20 text60 grey10>
71
+ <Text marginT-20 text60>
72
72
  ColorPalette
73
73
  </Text>
74
74
  <Text marginB-10 text70 style={{color}}>
@@ -76,12 +76,12 @@ export default class ColorSwatchScreen extends Component {
76
76
  </Text>
77
77
  <ColorPalette value={color} onValueChange={this.onValueChange} colors={this.colors}/>
78
78
 
79
- <Text margin-10 text60 grey10>
79
+ <Text margin-10 text60>
80
80
  Scrollable
81
81
  </Text>
82
82
  <ColorPalette value={color1} onValueChange={this.onValueChange1} colors={this.mainColors}/>
83
83
 
84
- <Text margin-10 text60 grey10>
84
+ <Text margin-10 text60>
85
85
  Pagination
86
86
  </Text>
87
87
  <ColorPalette
@@ -135,9 +135,10 @@ export default class PickerScreen extends Component {
135
135
  </Picker>
136
136
 
137
137
  <Picker
138
- title="Native Picker"
138
+ title="Wheel Picker"
139
139
  placeholder="Pick a Language"
140
- useNativePicker
140
+ // useNativePicker
141
+ useWheelPicker
141
142
  value={this.state.nativePickerValue}
142
143
  onChange={nativePickerValue => this.setState({nativePickerValue})}
143
144
  rightIconSource={dropdown}
@@ -15,7 +15,7 @@ import {
15
15
  import _ from 'lodash';
16
16
  import products from '../../data/products';
17
17
 
18
- const productsWithIds = products.map((product, index) => ({...product, id: index.toString()}));
18
+ const productsWithIds = products.map((product) => ({...product}));
19
19
  type Item = typeof productsWithIds[0];
20
20
 
21
21
  class SortableGridListScreen extends Component {
@@ -120,7 +120,7 @@ class SortableGridListScreen extends Component {
120
120
 
121
121
  const styles = StyleSheet.create({
122
122
  list: {
123
- padding: Spacings.s5
123
+ paddingTop: Spacings.s5
124
124
  },
125
125
  itemImage: {
126
126
  width: '100%',
@@ -174,7 +174,7 @@ class TabControllerScreen extends Component<{}, State> {
174
174
  // iconColor={'green'}
175
175
  // selectedIconColor={'blue'}
176
176
  enableShadow
177
- activeBackgroundColor={Colors.$backgroundPrimaryLight}
177
+ activeBackgroundColor={Colors.$backgroundPrimaryMedium}
178
178
  centerSelected={centerSelected}
179
179
  >
180
180
  {/* {this.renderTabItems()} */}
@@ -107,7 +107,7 @@ export default class ToastsScreen extends Component {
107
107
  swipeable={isSwipeable}
108
108
  onDismiss={this.toggleVisibility}
109
109
  autoDismiss={3500}
110
- // backgroundColor={Colors.$backgroundSuccess}
110
+ // backgroundColor={Colors.$backgroundSuccessLight}
111
111
  // icon={Assets.icons.demo.add}
112
112
  // iconColor={Colors.$backgroundSuccessHeavy}
113
113
  // style={{borderWidth: 1, borderColor: Colors.$outlineDisabled}}
@@ -44,6 +44,9 @@ const colors: Item[] = [
44
44
  {value: Colors.yellow50, label: 'Yellow50'},
45
45
  {value: Colors.yellow70, label: 'Yellow70'}
46
46
  ];
47
+ const TOAST_DIRECTIONS = [PanView.directions.LEFT, PanView.directions.DOWN, PanView.directions.RIGHT];
48
+ const DIALOG_DIRECTIONS = [PanView.directions.DOWN];
49
+ const TOAST_THRESHOLD = {y: 10};
47
50
 
48
51
  class PanViewScreen extends Component {
49
52
  state = {
@@ -78,10 +81,9 @@ class PanViewScreen extends Component {
78
81
  visible
79
82
  >
80
83
  <PanView
81
- directions={[PanView.directions.DOWN]}
84
+ directions={DIALOG_DIRECTIONS}
82
85
  dismissible
83
86
  animateToOrigin
84
- // threshold={{y: 10}}
85
87
  containerStyle={styles.panView}
86
88
  onDismiss={this.onDialogDismissed}
87
89
  >
@@ -111,11 +113,11 @@ class PanViewScreen extends Component {
111
113
  renderToast = () => {
112
114
  return (
113
115
  <PanView
114
- directions={[PanView.directions.LEFT, PanView.directions.DOWN, PanView.directions.RIGHT]}
116
+ directions={TOAST_DIRECTIONS}
115
117
  dismissible
116
118
  animateToOrigin
117
119
  directionLock
118
- threshold={{y: 10}}
120
+ threshold={TOAST_THRESHOLD}
119
121
  containerStyle={styles.panView}
120
122
  onDismiss={this.onToastDismissed}
121
123
  >
@@ -146,7 +148,7 @@ class PanViewScreen extends Component {
146
148
  const {showToast, showDialog} = this.state;
147
149
  const Container = showDialog ? View : GestureHandlerRootView;
148
150
  return (
149
- <Container style={[styles.root, styles.gestureHandler]}>
151
+ <Container style={styles.root}>
150
152
  <View marginL-page height={50} centerV>
151
153
  <Text text50>New Pan View</Text>
152
154
  </View>
@@ -171,11 +173,9 @@ export default PanViewScreen;
171
173
 
172
174
  const styles = StyleSheet.create({
173
175
  root: {
176
+ flex: 1,
174
177
  backgroundColor: Colors.grey80
175
178
  },
176
- gestureHandler: {
177
- flex: 1
178
- },
179
179
  panView: {
180
180
  flex: 1,
181
181
  position: 'absolute',