unicorn-demo-app 7.46.2 → 7.46.3-snapshot.7341

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.
Files changed (28) hide show
  1. package/package.json +2 -2
  2. package/src/index.js +6 -19
  3. package/src/screens/ExampleScreenPresenter.tsx +54 -14
  4. package/src/screens/MenuStructure.js +13 -21
  5. package/src/screens/__tests__/__snapshots__/TextFieldScreen.spec.js.snap +96 -30
  6. package/src/screens/componentScreens/ActionSheetScreen.tsx +0 -2
  7. package/src/screens/componentScreens/AnimatedImageScreen.js +2 -2
  8. package/src/screens/componentScreens/ButtonsScreen.tsx +41 -2
  9. package/src/screens/componentScreens/CarouselVerticalScreen.tsx +2 -2
  10. package/src/screens/componentScreens/DateTimePickerScreen.tsx +0 -5
  11. package/src/screens/{incubatorScreens/IncubatorDialogScreen.tsx → componentScreens/DialogScreen.tsx} +6 -6
  12. package/src/screens/{incubatorScreens → componentScreens}/PanViewScreen.tsx +4 -5
  13. package/src/screens/componentScreens/PickerScreen.tsx +4 -5
  14. package/src/screens/componentScreens/SortableListScreen.tsx +1 -1
  15. package/src/screens/componentScreens/StackAggregatorScreen.tsx +1 -1
  16. package/src/screens/componentScreens/TabControllerScreen/tab3.tsx +1 -1
  17. package/src/screens/componentScreens/WheelPickerScreen.tsx +3 -3
  18. package/src/screens/componentScreens/index.js +1 -4
  19. package/src/screens/incubatorScreens/IncubatorExpandableOverlayScreen.tsx +0 -1
  20. package/src/screens/incubatorScreens/IncubatorGradientScreen.tsx +114 -0
  21. package/src/screens/incubatorScreens/index.js +1 -2
  22. package/src/screens/nativeComponentScreens/HighlightOverlayViewScreen.js +4 -1
  23. package/src/screens/nativeComponentScreens/SafeAreaSpacerViewScreen.tsx +1 -0
  24. package/src/screens/componentScreens/DialogScreen.js +0 -343
  25. package/src/screens/componentScreens/PanDismissibleScreen.tsx +0 -112
  26. package/src/screens/componentScreens/PanListenerScreen.tsx +0 -63
  27. package/src/screens/componentScreens/PanResponderScreen.tsx +0 -99
  28. package/src/screens/componentScreens/SharedTransitionScreen.js +0 -143
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unicorn-demo-app",
3
- "version": "7.46.2",
3
+ "version": "7.46.3-snapshot.7341",
4
4
  "main": "src/index.js",
5
5
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
6
6
  "license": "MIT",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": "^18.2.0",
26
- "react-native": "^0.71.2",
26
+ "react-native": "^0.76.9",
27
27
  "react-native-ui-lib": "*",
28
28
  "semver": "^5.5.0"
29
29
  }
package/src/index.js CHANGED
@@ -1,8 +1,7 @@
1
- import {UIManager, I18nManager} from 'react-native';
1
+ import {I18nManager} from 'react-native';
2
2
  import {navigationData as menuStructure} from './screens/MenuStructure';
3
3
  import {loadDemoConfigurations} from './configurations';
4
4
 
5
- UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true); // eslint-disable-line
6
5
  I18nManager.allowRTL(true);
7
6
 
8
7
  module.exports = {
@@ -87,15 +86,6 @@ module.exports = {
87
86
  get PageControlScreen() {
88
87
  return require('./screens/componentScreens/PageControlScreen').default;
89
88
  },
90
- get PanDismissibleScreen() {
91
- return require('./screens/componentScreens/PanDismissibleScreen').default;
92
- },
93
- get PanListenerScreen() {
94
- return require('./screens/componentScreens/PanListenerScreen').default;
95
- },
96
- get PanResponderScreen() {
97
- return require('./screens/componentScreens/PanResponderScreen').default;
98
- },
99
89
  get PickerScreen() {
100
90
  return require('./screens/componentScreens/PickerScreen').default;
101
91
  },
@@ -108,9 +98,6 @@ module.exports = {
108
98
  get SegmentedControlScreen() {
109
99
  return require('./screens/componentScreens/SegmentedControlScreen').default;
110
100
  },
111
- get SharedTransitionScreen() {
112
- return require('./screens/componentScreens/SharedTransitionScreen').default;
113
- },
114
101
  get SkeletonViewScreen() {
115
102
  return require('./screens/componentScreens/SkeletonViewScreen').default;
116
103
  },
@@ -244,16 +231,13 @@ module.exports = {
244
231
  get SortableGridList() {
245
232
  return require('./screens/componentScreens/SortableGridListScreen').default;
246
233
  },
247
- // Incubator
248
234
  get PanViewScreen() {
249
- return require('./screens/incubatorScreens/PanViewScreen').default;
235
+ return require('./screens/componentScreens/PanViewScreen').default;
250
236
  },
237
+ // Incubator
251
238
  get IncubatorSlider() {
252
239
  return require('./screens/incubatorScreens/IncubatorSliderScreen').default;
253
240
  },
254
- get IncubatorDialog() {
255
- return require('./screens/incubatorScreens/IncubatorDialogScreen').default;
256
- },
257
241
  get IncubatorToast() {
258
242
  return require('./screens/incubatorScreens/IncubatorToastScreen').default;
259
243
  },
@@ -263,6 +247,9 @@ module.exports = {
263
247
  get IncubatorCalendarScreen() {
264
248
  return require('./screens/incubatorScreens/IncubatorCalendarScreen').default;
265
249
  },
250
+ get IncubatorGradient() {
251
+ return require('./screens/incubatorScreens/IncubatorGradientScreen').default;
252
+ },
266
253
  // realExamples
267
254
  get AppleMusic() {
268
255
  return require('./screens/realExamples/AppleMusic').default;
@@ -16,12 +16,22 @@ import {
16
16
  View
17
17
  } from 'react-native-ui-lib';
18
18
 
19
- interface RadioGroupOptions {
19
+ interface StateOptions {
20
+ state?: string;
21
+ setState?: React.Dispatch<React.SetStateAction<any /** no suitable solution for enum */>>;
22
+ }
23
+
24
+ interface RadioGroupBaseOptions {
20
25
  isRow?: boolean;
21
- afterValueChanged?: () => void;
22
26
  useValueAsLabel?: boolean;
23
27
  }
24
28
 
29
+ type RadioGroupOptions =
30
+ | (RadioGroupBaseOptions & {
31
+ afterValueChanged?: () => void;
32
+ })
33
+ | (RadioGroupBaseOptions & StateOptions);
34
+
25
35
  interface BooleanGroupOptions {
26
36
  spread?: boolean;
27
37
  afterValueChanged?: () => void;
@@ -29,11 +39,6 @@ interface BooleanGroupOptions {
29
39
  setState?: React.Dispatch<React.SetStateAction<boolean>>;
30
40
  }
31
41
 
32
- interface SegmentsExtraOptions {
33
- state?: string;
34
- setState?: React.Dispatch<React.SetStateAction<any /** no suitable solution for enum */>>;
35
- }
36
-
37
42
  export function renderHeader(title: string, others?: TextProps) {
38
43
  return (
39
44
  <Text text30 $textDefault {...others}>
@@ -103,9 +108,10 @@ export function renderBooleanGroup(title: string, options: string[]) {
103
108
  export function renderRadioGroup(title: string,
104
109
  key: string,
105
110
  options: object,
106
- {isRow, afterValueChanged, useValueAsLabel}: RadioGroupOptions = {}) {
107
111
  // @ts-ignore
108
- const value = this.state[key];
112
+ {isRow, afterValueChanged, useValueAsLabel, state, setState}: RadioGroupOptions = {}) {
113
+ // @ts-ignore
114
+ const value = state ?? this.state[key];
109
115
  return (
110
116
  <View marginB-s2>
111
117
  {!_.isUndefined(title) && (
@@ -118,7 +124,18 @@ export function renderRadioGroup(title: string,
118
124
  style={isRow && styles.rowWrap}
119
125
  initialValue={value}
120
126
  // @ts-ignore
121
- onValueChange={value => this.setState({[key]: value}, afterValueChanged)}
127
+ onValueChange={value => {
128
+ if (setState) {
129
+ setState(value);
130
+ if (afterValueChanged) {
131
+ // eslint-disable-next-line no-restricted-syntax
132
+ console.error('afterValueChanged is not supported together with the state option');
133
+ }
134
+ } else {
135
+ // @ts-ignore
136
+ this.setState({[key]: value}, afterValueChanged);
137
+ }
138
+ }}
122
139
  >
123
140
  {_.map(options, (value, key) => {
124
141
  return (
@@ -159,9 +176,25 @@ export function renderColorOption(title: string,
159
176
 
160
177
  export function renderSliderOption(title: string,
161
178
  key: string,
162
- {min = 0, max = 10, step = 1, initial = 0, sliderText = ''}) {
179
+ {
180
+ min = 0,
181
+ max = 10,
182
+ step = 1,
183
+ initial = 0,
184
+ sliderText = '',
185
+ state,
186
+ setState
187
+ }: {
188
+ min?: number;
189
+ max?: number;
190
+ step?: number;
191
+ initial?: number;
192
+ sliderText?: string;
193
+ state?: number;
194
+ setState?: React.Dispatch<React.SetStateAction<number>>;
195
+ }) {
163
196
  // @ts-ignore
164
- const value = this.state[key] || initial;
197
+ const value = state ?? this.state[key] ?? initial;
165
198
  return (
166
199
  <View marginV-s2>
167
200
  <Text marginB-s1 text70M $textDefault>
@@ -177,7 +210,14 @@ export function renderSliderOption(title: string,
177
210
  maximumValue={max}
178
211
  step={step}
179
212
  // @ts-ignore
180
- onValueChange={value => this.setState({[key]: value})}
213
+ onValueChange={value => {
214
+ if (setState) {
215
+ setState(value);
216
+ } else {
217
+ // @ts-ignore
218
+ this.setState({[key]: value});
219
+ }
220
+ }}
181
221
  />
182
222
  <Text marginL-s4 text70 $textDefault style={styles.text}>
183
223
  {sliderText}
@@ -191,7 +231,7 @@ export function renderSliderOption(title: string,
191
231
  export function renderMultipleSegmentOptions(title: string,
192
232
  key: string,
193
233
  options: (SegmentedControlItemProps & {value: any})[],
194
- {state, setState}: SegmentsExtraOptions = {}) {
234
+ {state, setState}: StateOptions = {}) {
195
235
  // @ts-ignore
196
236
  const value = state ?? this.state[key];
197
237
  const index = _.findIndex(options, {value});
@@ -39,11 +39,6 @@ export const navigationData = {
39
39
  {title: 'ProgressBar', tags: 'progress bar animated', screen: 'unicorn.animations.ProgressBarScreen'},
40
40
  {title: 'ScrollBar', tags: 'scroll bar gradient', screen: 'unicorn.components.ScrollBarScreen'},
41
41
  {title: 'SearchInputScreen', tags: 'search input', screen: 'unicorn.components.SearchInputScreen'},
42
- {
43
- title: 'Shared Transition',
44
- tags: 'shared transition element',
45
- screen: 'unicorn.components.SharedTransitionScreen'
46
- },
47
42
  {title: 'Stack Aggregator', tags: 'stack aggregator', screen: 'unicorn.components.StackAggregatorScreen'},
48
43
  {title: 'Marquee', tags: 'sliding text', screen: 'unicorn.components.MarqueeScreen'}
49
44
  ]
@@ -86,7 +81,7 @@ export const navigationData = {
86
81
  screens: [
87
82
  {title: 'Action Sheet', tags: 'action sheet cross-platform', screen: 'unicorn.components.ActionSheetScreen'},
88
83
  {title: 'Dialog', tags: 'dialog modal popup alert', screen: 'unicorn.components.DialogScreen'},
89
- {title: 'Feature Highlight', tags: 'feature overlay', screen: 'unicorn.components.FeatureHighlightScreen'},
84
+ {title: 'Feature Highlight', tags: 'native feature overlay', screen: 'unicorn.components.FeatureHighlightScreen'},
90
85
  {title: 'Floating Button', tags: 'floating button', screen: 'unicorn.components.FloatingButtonScreen'},
91
86
  {title: 'Hint', tags: 'hints tooltip', screen: 'unicorn.components.HintsScreen'},
92
87
  {title: 'Toast', tags: 'toast top bottom snackbar', screen: 'unicorn.components.ToastsScreen'}
@@ -122,10 +117,10 @@ export const navigationData = {
122
117
  {title: 'LoadingScreen', tags: 'loading screen', screen: 'unicorn.screens.LoadingScreen'},
123
118
  {title: 'Modal', tags: 'modal topbar screen', screen: 'unicorn.screens.ModalScreen'},
124
119
  {title: 'StateScreen', tags: 'empty state screen', screen: 'unicorn.screens.EmptyStateScreen'},
125
- {title: 'TabController', tags: 'tabbar controller native', screen: 'unicorn.components.TabControllerScreen'},
120
+ {title: 'TabController', tags: 'tabbar controller', screen: 'unicorn.components.TabControllerScreen'},
126
121
  {
127
122
  title: 'TabControllerWithStickyHeader',
128
- tags: 'tabbar controller native sticky header',
123
+ tags: 'tabbar controller sticky header',
129
124
  screen: 'unicorn.components.TabControllerWithStickyHeaderScreen'
130
125
  },
131
126
  {title: 'Timeline', tags: 'timeline', screen: 'unicorn.components.TimelineScreen'},
@@ -153,28 +148,28 @@ export const navigationData = {
153
148
  screens: [
154
149
  {
155
150
  title: 'KeyboardAwareScrollView',
156
- tags: 'KeyboardAwareScrollView',
151
+ tags: 'native KeyboardAwareScrollView',
157
152
  screen: 'unicorn.components.KeyboardAwareScrollViewScreen'
158
153
  },
159
154
  {
160
155
  title: 'Dynamic Fonts',
161
- tags: 'dynamic fonts load download',
156
+ tags: 'native dynamic fonts load download',
162
157
  screen: 'unicorn.nativeComponents.DynamicFontsScreen'
163
158
  },
164
159
  {
165
160
  title: 'Highlight Overlay',
166
- tags: 'native overlay',
161
+ tags: 'native native overlay',
167
162
  screen: 'unicorn.nativeComponents.HighlightOverlayViewScreen'
168
163
  },
169
164
  {title: 'SafeArea Spacer', tags: 'native safe area', screen: 'unicorn.nativeComponents.SafeAreaSpacerViewScreen'},
170
165
  {
171
166
  title: 'KeyboardTracking (iOS)',
172
- tags: 'KeyboardTracking',
167
+ tags: 'native KeyboardTracking',
173
168
  screen: 'unicorn.nativeComponents.KeyboardTrackingViewScreen'
174
169
  },
175
170
  {
176
171
  title: 'KeyboardAccessoryView',
177
- tags: 'KeyboardInput',
172
+ tags: 'native KeyboardInput',
178
173
  screen: 'unicorn.nativeComponents.KeyboardAccessoryViewScreen'
179
174
  }
180
175
  ]
@@ -183,16 +178,14 @@ export const navigationData = {
183
178
  title: 'Animations & Gestures',
184
179
  screens: [
185
180
  {title: 'Animated Image', tags: 'animated image', screen: 'unicorn.components.AnimatedImageScreen'},
181
+ {title: 'Card Scanner', tags: 'card scanner process', screen: 'unicorn.animations.CardScannerScreen'},
186
182
  {title: 'Haptic feedback', tags: 'haptic feedback', screen: 'unicorn.components.HapticScreen'},
183
+ {title: 'PanView', tags: 'pan swipe drag', screen: 'unicorn.components.PanViewScreen'},
187
184
  {
188
185
  title: 'ProgressiveImage',
189
186
  tags: 'progressive image cover overlay',
190
187
  screen: 'unicorn.components.ProgressiveImageScreen'
191
- },
192
- {title: 'Card Scanner', tags: 'card scanner process', screen: 'unicorn.animations.CardScannerScreen'},
193
- {title: 'Pan Dismissible', tags: 'pan swipe drag dismiss', screen: 'unicorn.components.PanDismissibleScreen'},
194
- {title: 'Pan Listener', tags: 'pan swipe drag listener', screen: 'unicorn.components.PanListenerScreen'},
195
- {title: 'Pan Responder', tags: 'pan swipe drag responder', screen: 'unicorn.components.PanResponderScreen'}
188
+ }
196
189
  ]
197
190
  },
198
191
  Incubator: {
@@ -200,15 +193,14 @@ export const navigationData = {
200
193
  screens: [
201
194
  {title: 'Calendar', tags: 'calendar', screen: 'unicorn.components.IncubatorCalendarScreen'},
202
195
  {title: 'ChipsInput', tags: 'chips input', screen: 'unicorn.components.ChipsInputScreen'},
203
- {title: 'Native TouchableOpacity', tags: 'touchable native', screen: 'unicorn.incubator.TouchableOpacityScreen'},
204
- {title: 'Dialog (New)', tags: 'dialog modal popup alert', screen: 'unicorn.incubator.IncubatorDialogScreen'},
196
+ {title: 'Native TouchableOpacity', tags: 'native touchable', screen: 'unicorn.incubator.TouchableOpacityScreen'},
205
197
  {title: 'Toast (New)', tags: 'toast', screen: 'unicorn.components.IncubatorToastScreen'},
206
198
  {
207
199
  title: 'ExpandableOverlay',
208
200
  tags: 'text field expandable input picker',
209
201
  screen: 'unicorn.components.IncubatorExpandableOverlayScreen'
210
202
  },
211
- {title: 'PanView', tags: 'pan swipe drag', screen: 'unicorn.incubator.PanViewScreen'}
203
+ {title: 'Gradient', tags: 'gradient', screen: 'unicorn.components.IncubatorGradientScreen'}
212
204
  ]
213
205
  },
214
206
  Inspirations: {
@@ -1522,16 +1522,38 @@ exports[`TextField Screen renders screen 1`] = `
1522
1522
  numberOfLines={1}
1523
1523
  onLayout={[Function]}
1524
1524
  style={
1525
- {
1526
- "backgroundColor": "transparent",
1527
- "color": "#6E7881",
1528
- "fontFamily": "System",
1529
- "fontSize": 16,
1530
- "fontWeight": "400",
1531
- "lineHeight": 24,
1532
- "opacity": 0,
1533
- "writingDirection": "ltr",
1534
- }
1525
+ [
1526
+ {
1527
+ "backgroundColor": "transparent",
1528
+ "color": "#20303C",
1529
+ "writingDirection": "ltr",
1530
+ },
1531
+ undefined,
1532
+ {
1533
+ "color": "#6E7881",
1534
+ },
1535
+ undefined,
1536
+ undefined,
1537
+ {},
1538
+ undefined,
1539
+ undefined,
1540
+ undefined,
1541
+ [
1542
+ {},
1543
+ [
1544
+ {},
1545
+ {
1546
+ "fontFamily": "System",
1547
+ "fontSize": 16,
1548
+ "fontWeight": "400",
1549
+ "lineHeight": 24,
1550
+ },
1551
+ ],
1552
+ {
1553
+ "opacity": 0,
1554
+ },
1555
+ ],
1556
+ ]
1535
1557
  }
1536
1558
  testID="undefined.floatingPlaceholder"
1537
1559
  >
@@ -2118,16 +2140,38 @@ exports[`TextField Screen renders screen 1`] = `
2118
2140
  numberOfLines={1}
2119
2141
  onLayout={[Function]}
2120
2142
  style={
2121
- {
2122
- "backgroundColor": "transparent",
2123
- "color": "#20303C",
2124
- "fontFamily": "System",
2125
- "fontSize": 16,
2126
- "fontWeight": "400",
2127
- "lineHeight": 24,
2128
- "opacity": 0,
2129
- "writingDirection": "ltr",
2130
- }
2143
+ [
2144
+ {
2145
+ "backgroundColor": "transparent",
2146
+ "color": "#20303C",
2147
+ "writingDirection": "ltr",
2148
+ },
2149
+ undefined,
2150
+ {
2151
+ "color": "#20303C",
2152
+ },
2153
+ undefined,
2154
+ undefined,
2155
+ {},
2156
+ undefined,
2157
+ undefined,
2158
+ undefined,
2159
+ [
2160
+ {},
2161
+ [
2162
+ {},
2163
+ {
2164
+ "fontFamily": "System",
2165
+ "fontSize": 16,
2166
+ "fontWeight": "400",
2167
+ "lineHeight": 24,
2168
+ },
2169
+ ],
2170
+ {
2171
+ "opacity": 0,
2172
+ },
2173
+ ],
2174
+ ]
2131
2175
  }
2132
2176
  testID="undefined.floatingPlaceholder"
2133
2177
  >
@@ -2433,16 +2477,38 @@ exports[`TextField Screen renders screen 1`] = `
2433
2477
  numberOfLines={1}
2434
2478
  onLayout={[Function]}
2435
2479
  style={
2436
- {
2437
- "backgroundColor": "transparent",
2438
- "color": "#20303C",
2439
- "fontFamily": "System",
2440
- "fontSize": 16,
2441
- "fontWeight": "400",
2442
- "lineHeight": 24,
2443
- "opacity": 0,
2444
- "writingDirection": "ltr",
2445
- }
2480
+ [
2481
+ {
2482
+ "backgroundColor": "transparent",
2483
+ "color": "#20303C",
2484
+ "writingDirection": "ltr",
2485
+ },
2486
+ undefined,
2487
+ {
2488
+ "color": "#20303C",
2489
+ },
2490
+ undefined,
2491
+ undefined,
2492
+ {},
2493
+ undefined,
2494
+ undefined,
2495
+ undefined,
2496
+ [
2497
+ {},
2498
+ [
2499
+ {},
2500
+ {
2501
+ "fontFamily": "System",
2502
+ "fontSize": 16,
2503
+ "fontWeight": "400",
2504
+ "lineHeight": 24,
2505
+ },
2506
+ ],
2507
+ {
2508
+ "opacity": 0,
2509
+ },
2510
+ ],
2511
+ ]
2446
2512
  }
2447
2513
  testID="undefined.floatingPlaceholder"
2448
2514
  >
@@ -64,7 +64,6 @@ export default class ActionSheetScreen extends Component {
64
64
  cancelButtonIndex={3}
65
65
  destructiveButtonIndex={0}
66
66
  useNativeIOS={false}
67
- migrateDialog
68
67
  options={[
69
68
  {label: 'option 1', onPress: () => this.pickOption('option 1')},
70
69
  {label: 'option 2', onPress: () => this.pickOption('option 2')},
@@ -80,7 +79,6 @@ export default class ActionSheetScreen extends Component {
80
79
  message={'Message of action sheet'}
81
80
  cancelButtonIndex={3}
82
81
  destructiveButtonIndex={0}
83
- migrateDialog
84
82
  options={[
85
83
  {label: 'option 1', onPress: () => this.pickOption('option 1'), iconSource: collectionsIcon},
86
84
  {label: 'option 2', onPress: () => this.pickOption('option 2'), iconSource: shareIcon},
@@ -4,8 +4,8 @@ import _ from 'lodash';
4
4
  import {AnimatedImage, Colors} from 'react-native-ui-lib'; //eslint-disable-line
5
5
 
6
6
  const SampleImages = [
7
- 'https://static.pexels.com/photos/50721/pencils-crayons-colourful-rainbow-50721.jpeg',
8
- 'https://static.pexels.com/photos/60628/flower-garden-blue-sky-hokkaido-japan-60628.jpeg'
7
+ 'https://images.pexels.com/photos/2529146/pexels-photo-2529146.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
8
+ 'https://images.pexels.com/photos/2529158/pexels-photo-2529158.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500'
9
9
  ];
10
10
 
11
11
  export default class AnimatedImageScreen extends Component {
@@ -1,6 +1,17 @@
1
1
  import React, {Component} from 'react';
2
- import {ScrollView, StyleSheet, Alert, Image} from 'react-native';
3
- import {Text, View, Assets, Constants, Button, Colors, Typography, ButtonProps} from 'react-native-ui-lib';
2
+ import {ScrollView, StyleSheet, Alert} from 'react-native';
3
+ import {
4
+ Text,
5
+ View,
6
+ Assets,
7
+ Constants,
8
+ Button,
9
+ Colors,
10
+ Typography,
11
+ ButtonProps,
12
+ Incubator,
13
+ Image
14
+ } from 'react-native-ui-lib';
4
15
 
5
16
  const ButtonSpace = 20;
6
17
  const plusIcon = Assets.getAssetByPath('icons.demo.plus');
@@ -267,6 +278,34 @@ export default class ButtonsScreen extends Component {
267
278
  <Button label="hyperlink button" hyperlink style={{marginBottom: ButtonSpace}}/>
268
279
 
269
280
  <Button label="Icon on right" iconSource={plusIcon} iconOnRight/>
281
+
282
+ <Text style={styles.header}>Custom Backgrounds</Text>
283
+ <Button
284
+ label="Gradient Background"
285
+ customBackground={
286
+ <Incubator.Gradient
287
+ colors={[Colors.$backgroundPrimaryHeavy, Colors.$backgroundPrimaryMedium]}
288
+ type="rectangle"
289
+ width={200}
290
+ height={50}
291
+ />
292
+ }
293
+ style={{marginBottom: ButtonSpace}}
294
+ />
295
+ <Button
296
+ label="Image Background"
297
+ customBackground={
298
+ <Image
299
+ source={{
300
+ uri: 'https://images.pexels.com/photos/748837/pexels-photo-748837.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260'
301
+ }}
302
+ style={{width: 200, height: 50}}
303
+ resizeMode="cover"
304
+ />
305
+ }
306
+ style={{marginBottom: ButtonSpace}}
307
+ $textNeutralHeavy
308
+ />
270
309
  </View>
271
310
 
272
311
  <View marginT-20>
@@ -1,6 +1,6 @@
1
1
  import {Carousel, Constants, Text, View, Colors} from 'react-native-ui-lib';
2
2
  import React, {Component} from 'react';
3
- import {StyleSheet, Animated, TextStyle} from 'react-native';
3
+ import {StyleSheet, Animated} from 'react-native';
4
4
  import _ from 'lodash';
5
5
  import {renderBooleanOption, renderSliderOption} from '../ExampleScreenPresenter';
6
6
 
@@ -58,7 +58,7 @@ class CarouselVerticalScreen extends Component<{}, State> {
58
58
  return (
59
59
  <View absT>
60
60
  {_.times(numberOfPagesShown, page => (
61
- <Text key={page} h1 animated style={[styles.animatedPageCounter, animatedStyles[page]] as TextStyle}>
61
+ <Text key={page} h1 animated style={[styles.animatedPageCounter, animatedStyles[page]]}>
62
62
  {page}
63
63
  </Text>
64
64
  ))}
@@ -62,7 +62,6 @@ export default class DateTimePickerScreen extends Component<{}, State> {
62
62
  <View padding-page>
63
63
  <Text text40>Date Time Picker</Text>
64
64
  <DateTimePicker
65
- migrateDialog
66
65
  containerStyle={{marginVertical: 20}}
67
66
  label={'Date'}
68
67
  placeholder={'Select a date'}
@@ -72,7 +71,6 @@ export default class DateTimePickerScreen extends Component<{}, State> {
72
71
  // value={new Date('October 13, 2014')}
73
72
  />
74
73
  <DateTimePicker
75
- migrateDialog
76
74
  mode={'time'}
77
75
  label={'Time'}
78
76
  placeholder={'Select time'}
@@ -83,14 +81,12 @@ export default class DateTimePickerScreen extends Component<{}, State> {
83
81
  Disabled
84
82
  </Text>
85
83
  <DateTimePicker
86
- migrateDialog
87
84
  containerStyle={{marginBottom: 20}}
88
85
  editable={false}
89
86
  label={'Date'}
90
87
  placeholder={'Select a date'}
91
88
  />
92
89
  <DateTimePicker
93
- migrateDialog
94
90
  editable={false}
95
91
  mode={'time'}
96
92
  label={'Time'}
@@ -111,7 +107,6 @@ export default class DateTimePickerScreen extends Component<{}, State> {
111
107
  </View>
112
108
  </View>
113
109
  <DateTimePicker
114
- migrateDialog
115
110
  containerStyle={{marginVertical: 20}}
116
111
  renderInput={this.renderCustomInput}
117
112
  mode={mode}
@@ -1,7 +1,7 @@
1
1
  import React, {Component} from 'react';
2
2
  import {StyleSheet} from 'react-native';
3
3
  import {FlatList} from 'react-native-gesture-handler';
4
- import {View, Text, Card, Button, Incubator, Colors, Spacings, ModalProps} from 'react-native-ui-lib';
4
+ import {View, Text, Card, Button, Dialog, DialogHeaderProps, Colors, Spacings, ModalProps} from 'react-native-ui-lib';
5
5
 
6
6
  interface Item {
7
7
  value: string;
@@ -31,10 +31,10 @@ const colors: Item[] = [
31
31
  {value: Colors.yellow70, label: 'Yellow70'}
32
32
  ];
33
33
 
34
- export default class IncubatorDialogScreen extends Component {
34
+ export default class DialogScreen extends Component {
35
35
  state = {visible: false};
36
36
  modalProps: ModalProps = {supportedOrientations: ['portrait', 'landscape']};
37
- headerProps: Incubator.DialogHeaderProps = {title: 'Title (swipe here)'};
37
+ headerProps: DialogHeaderProps = {title: 'Title (swipe here)'};
38
38
 
39
39
  renderVerticalItem = ({item}: {item: Item}) => {
40
40
  return (
@@ -67,13 +67,13 @@ export default class IncubatorDialogScreen extends Component {
67
67
  <View bg-$backgroundNeutralLight flex padding-20>
68
68
  <Card height={100} center padding-20>
69
69
  <Text $textDefault text50>
70
- IncubatorDialogScreen
70
+ DialogScreen
71
71
  </Text>
72
72
  </Card>
73
73
  <View flex center>
74
74
  <Button marginV-s5 label="Open Dialog" onPress={this.openDialog}/>
75
75
  </View>
76
- <Incubator.Dialog
76
+ <Dialog
77
77
  useSafeArea
78
78
  visible={visible}
79
79
  onDismiss={this.onDismiss}
@@ -89,7 +89,7 @@ export default class IncubatorDialogScreen extends Component {
89
89
  renderItem={this.renderVerticalItem}
90
90
  keyExtractor={this.keyExtractor}
91
91
  />
92
- </Incubator.Dialog>
92
+ </Dialog>
93
93
  </View>
94
94
  );
95
95
  }