unicorn-demo-app 7.43.0-snapshot.7095 → 7.43.0-snapshot.7143
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 +2 -2
- package/src/index.js +5 -1
- package/src/screens/MenuStructure.js +5 -0
- package/src/screens/__tests__/__snapshots__/TextFieldScreen.spec.js.snap +30 -96
- package/src/screens/componentScreens/AnimatedImageScreen.js +2 -2
- package/src/screens/componentScreens/CarouselVerticalScreen.tsx +2 -2
- package/src/screens/componentScreens/PanViewScreen.tsx +3 -3
- package/src/screens/componentScreens/SharedTransitionScreen.js +143 -0
- package/src/screens/componentScreens/SortableListScreen.tsx +1 -1
- package/src/screens/componentScreens/StackAggregatorScreen.tsx +1 -1
- package/src/screens/componentScreens/TabControllerScreen/tab3.tsx +1 -1
- package/src/screens/componentScreens/index.js +1 -0
- package/src/screens/nativeComponentScreens/HighlightOverlayViewScreen.js +1 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unicorn-demo-app",
|
|
3
|
-
"version": "7.43.0-snapshot.
|
|
3
|
+
"version": "7.43.0-snapshot.7143",
|
|
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.
|
|
26
|
+
"react-native": "^0.71.2",
|
|
27
27
|
"react-native-ui-lib": "*",
|
|
28
28
|
"semver": "^5.5.0"
|
|
29
29
|
}
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {I18nManager} from 'react-native';
|
|
1
|
+
import {UIManager, 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
|
|
5
6
|
I18nManager.allowRTL(true);
|
|
6
7
|
|
|
7
8
|
module.exports = {
|
|
@@ -98,6 +99,9 @@ module.exports = {
|
|
|
98
99
|
get SegmentedControlScreen() {
|
|
99
100
|
return require('./screens/componentScreens/SegmentedControlScreen').default;
|
|
100
101
|
},
|
|
102
|
+
get SharedTransitionScreen() {
|
|
103
|
+
return require('./screens/componentScreens/SharedTransitionScreen').default;
|
|
104
|
+
},
|
|
101
105
|
get SkeletonViewScreen() {
|
|
102
106
|
return require('./screens/componentScreens/SkeletonViewScreen').default;
|
|
103
107
|
},
|
|
@@ -39,6 +39,11 @@ 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
|
+
},
|
|
42
47
|
{title: 'Stack Aggregator', tags: 'stack aggregator', screen: 'unicorn.components.StackAggregatorScreen'},
|
|
43
48
|
{title: 'Marquee', tags: 'sliding text', screen: 'unicorn.components.MarqueeScreen'}
|
|
44
49
|
]
|
|
@@ -1522,38 +1522,16 @@ exports[`TextField Screen renders screen 1`] = `
|
|
|
1522
1522
|
numberOfLines={1}
|
|
1523
1523
|
onLayout={[Function]}
|
|
1524
1524
|
style={
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
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
|
-
]
|
|
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
|
+
}
|
|
1557
1535
|
}
|
|
1558
1536
|
testID="undefined.floatingPlaceholder"
|
|
1559
1537
|
>
|
|
@@ -2140,38 +2118,16 @@ exports[`TextField Screen renders screen 1`] = `
|
|
|
2140
2118
|
numberOfLines={1}
|
|
2141
2119
|
onLayout={[Function]}
|
|
2142
2120
|
style={
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
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
|
-
]
|
|
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
|
+
}
|
|
2175
2131
|
}
|
|
2176
2132
|
testID="undefined.floatingPlaceholder"
|
|
2177
2133
|
>
|
|
@@ -2477,38 +2433,16 @@ exports[`TextField Screen renders screen 1`] = `
|
|
|
2477
2433
|
numberOfLines={1}
|
|
2478
2434
|
onLayout={[Function]}
|
|
2479
2435
|
style={
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
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
|
-
]
|
|
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
|
+
}
|
|
2512
2446
|
}
|
|
2513
2447
|
testID="undefined.floatingPlaceholder"
|
|
2514
2448
|
>
|
|
@@ -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://
|
|
8
|
-
'https://
|
|
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'
|
|
9
9
|
];
|
|
10
10
|
|
|
11
11
|
export default class AnimatedImageScreen extends Component {
|
|
@@ -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} from 'react-native';
|
|
3
|
+
import {StyleSheet, Animated, TextStyle} 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]]}>
|
|
61
|
+
<Text key={page} h1 animated style={[styles.animatedPageCounter, animatedStyles[page]] as TextStyle}>
|
|
62
62
|
{page}
|
|
63
63
|
</Text>
|
|
64
64
|
))}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, {Component} from 'react';
|
|
2
2
|
import {StyleSheet, ScrollView} from 'react-native';
|
|
3
|
-
import {FlatList
|
|
3
|
+
import {FlatList} from 'react-native-gesture-handler';
|
|
4
4
|
import {
|
|
5
5
|
Assets,
|
|
6
6
|
View,
|
|
@@ -146,7 +146,7 @@ class PanViewScreen extends Component {
|
|
|
146
146
|
render() {
|
|
147
147
|
const {showToast, showDialog} = this.state;
|
|
148
148
|
return (
|
|
149
|
-
<
|
|
149
|
+
<View style={styles.root}>
|
|
150
150
|
<View marginL-page height={50} centerV>
|
|
151
151
|
<Text text50>New Pan View</Text>
|
|
152
152
|
</View>
|
|
@@ -162,7 +162,7 @@ class PanViewScreen extends Component {
|
|
|
162
162
|
</ScrollView>
|
|
163
163
|
{showToast && this.renderToast()}
|
|
164
164
|
{showDialog && this.renderDialog()}
|
|
165
|
-
</
|
|
165
|
+
</View>
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
168
|
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import React, {Component} from 'react';
|
|
2
|
+
import {LayoutAnimation, FlatList} from 'react-native';
|
|
3
|
+
import {Colors, View, Image, TouchableOpacity, SharedTransition, Card, Button, Text, Modal} from 'react-native-ui-lib'; //eslint-disable-line
|
|
4
|
+
|
|
5
|
+
const DATA = [
|
|
6
|
+
{
|
|
7
|
+
id: '12',
|
|
8
|
+
title: 'white pendant lamp',
|
|
9
|
+
location: 'Paris, France',
|
|
10
|
+
views: 1224,
|
|
11
|
+
image:
|
|
12
|
+
'https://images.unsplash.com/photo-1513506003901-1e6a229e2d15?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1500&q=80',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: '13',
|
|
16
|
+
title: 'black floor lamp at the corner',
|
|
17
|
+
location: 'Paris, France',
|
|
18
|
+
views: 302,
|
|
19
|
+
image:
|
|
20
|
+
'https://images.unsplash.com/photo-1494438639946-1ebd1d20bf85?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1494&q=80',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: '14',
|
|
24
|
+
title: 'gray desk lamp near white wall',
|
|
25
|
+
location: 'Paris, France',
|
|
26
|
+
views: 554,
|
|
27
|
+
image:
|
|
28
|
+
'https://images.unsplash.com/photo-1507473885765-e6ed057f782c?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=668&q=80',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: '15',
|
|
32
|
+
title: 'round white and yellow bowl illustration',
|
|
33
|
+
location: 'Paris, France',
|
|
34
|
+
views: 1999,
|
|
35
|
+
image:
|
|
36
|
+
'https://images.unsplash.com/photo-1526308430620-59f514ed2152?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1500&q=80',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: '16',
|
|
40
|
+
title: 'black and orange polka dot print textile',
|
|
41
|
+
location: 'Paris, France',
|
|
42
|
+
views: 2014,
|
|
43
|
+
image:
|
|
44
|
+
'https://images.unsplash.com/photo-1544070643-24128d1f6033?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=668&q=80',
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
export default class SharedTransitionScreen extends Component {
|
|
49
|
+
constructor(props) {
|
|
50
|
+
super(props);
|
|
51
|
+
|
|
52
|
+
this.cards = [];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
state = {
|
|
56
|
+
showDetails: false,
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
renderItem = ({item}) => {
|
|
60
|
+
return (
|
|
61
|
+
<View marginB-20 padding-20 row height={280}>
|
|
62
|
+
<Card padding-20 marginV-20 width={'60%'} style={{zIndex: 10}} spread>
|
|
63
|
+
<View>
|
|
64
|
+
<Text text70 grey10>
|
|
65
|
+
{item.title}
|
|
66
|
+
</Text>
|
|
67
|
+
<Text text80 grey30>
|
|
68
|
+
{item.location}
|
|
69
|
+
</Text>
|
|
70
|
+
</View>
|
|
71
|
+
<View>
|
|
72
|
+
<Text text70 grey30>
|
|
73
|
+
<Text text50 purple30>
|
|
74
|
+
{item.views}
|
|
75
|
+
</Text>
|
|
76
|
+
{' Views'}
|
|
77
|
+
</Text>
|
|
78
|
+
</View>
|
|
79
|
+
</Card>
|
|
80
|
+
<SharedTransition.Source
|
|
81
|
+
id={item.id}
|
|
82
|
+
data={item}
|
|
83
|
+
style={[
|
|
84
|
+
{overflow: 'hidden', position: 'absolute', right: 20, top: 20, bottom: 20, width: '45%', height: 200},
|
|
85
|
+
]}
|
|
86
|
+
>
|
|
87
|
+
{this.renderSharedElement(item)}
|
|
88
|
+
</SharedTransition.Source>
|
|
89
|
+
</View>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
renderList() {
|
|
94
|
+
return <FlatList data={DATA} renderItem={this.renderItem} keyExtractor={item => item.title} />;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
renderSharedElement(item = {}) {
|
|
98
|
+
return (
|
|
99
|
+
<View flex>
|
|
100
|
+
<Image
|
|
101
|
+
style={{width: '100%', height: '100%', borderRadius: 10}}
|
|
102
|
+
source={{
|
|
103
|
+
uri: item.image,
|
|
104
|
+
}}
|
|
105
|
+
/>
|
|
106
|
+
</View>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
renderDetails = (data = {}) => {
|
|
111
|
+
return (
|
|
112
|
+
<View flex pointerEvents="box-none" padding-20 paddingT-50>
|
|
113
|
+
<View row>
|
|
114
|
+
<SharedTransition.Target style={{width: 200, height: 280, marginLeft: -30}}>
|
|
115
|
+
{data && this.renderSharedElement(data, true)}
|
|
116
|
+
</SharedTransition.Target>
|
|
117
|
+
<View flex paddingL-20>
|
|
118
|
+
<Text text50>{data.title}</Text>
|
|
119
|
+
<Text text90 purple30 marginT-10>
|
|
120
|
+
{data.views} Views
|
|
121
|
+
</Text>
|
|
122
|
+
</View>
|
|
123
|
+
</View>
|
|
124
|
+
<View left marginT-20>
|
|
125
|
+
<Text text60>{data.location}</Text>
|
|
126
|
+
<Text>
|
|
127
|
+
when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived
|
|
128
|
+
not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged
|
|
129
|
+
</Text>
|
|
130
|
+
<Button link marginT-20 grey10 label="Learn More" size="small" />
|
|
131
|
+
</View>
|
|
132
|
+
</View>
|
|
133
|
+
);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
render() {
|
|
137
|
+
return (
|
|
138
|
+
<View flex grey80>
|
|
139
|
+
<SharedTransition.Area renderDetails={this.renderDetails}>{this.renderList()}</SharedTransition.Area>
|
|
140
|
+
</View>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -129,7 +129,7 @@ export default SortableListScreen;
|
|
|
129
129
|
const styles = StyleSheet.create({
|
|
130
130
|
itemContainer: {
|
|
131
131
|
height: 52,
|
|
132
|
-
|
|
132
|
+
borderColor: Colors.$outlineDefault,
|
|
133
133
|
borderBottomWidth: 1
|
|
134
134
|
},
|
|
135
135
|
selectedItemContainer: {
|
|
@@ -68,7 +68,7 @@ export default class StackAggregatorScreen extends Component {
|
|
|
68
68
|
containerStyle={{marginTop: 12}}
|
|
69
69
|
onItemPress={this.onItemPress}
|
|
70
70
|
collapsed={false}
|
|
71
|
-
|
|
71
|
+
contentContainerStyle={{backgroundColor: Colors.red70}}
|
|
72
72
|
// itemBorderRadius={10}
|
|
73
73
|
// buttonProps={{color: Colors.green30, labelStyle: {...Typography.text80, fontWeight: '500'}}}
|
|
74
74
|
>
|
|
@@ -62,7 +62,7 @@ class Tab2 extends Component {
|
|
|
62
62
|
<Avatar
|
|
63
63
|
size={50}
|
|
64
64
|
source={{
|
|
65
|
-
uri: 'https://
|
|
65
|
+
uri: 'https://static.pexels.com/photos/60628/flower-garden-blue-sky-hokkaido-japan-60628.jpeg'
|
|
66
66
|
}}
|
|
67
67
|
/>
|
|
68
68
|
<Text text40 marginL-20>
|
|
@@ -42,6 +42,7 @@ export function registerScreens(registrar) {
|
|
|
42
42
|
registrar('unicorn.components.SectionsWheelPickerScreen', () => require('./SectionsWheelPickerScreen').default);
|
|
43
43
|
registrar('unicorn.components.SearchInputScreen', () => require('./SearchInputScreen').default);
|
|
44
44
|
registrar('unicorn.components.SegmentedControlScreen', () => require('./SegmentedControlScreen').default);
|
|
45
|
+
registrar('unicorn.components.SharedTransitionScreen', () => require('./SharedTransitionScreen').default);
|
|
45
46
|
registrar('unicorn.components.SkeletonViewScreen', () => require('./SkeletonViewScreen').default);
|
|
46
47
|
registrar('unicorn.components.SliderScreen', () => require('./SliderScreen').default);
|
|
47
48
|
registrar('unicorn.components.SortableGridListScreen', () => require('./SortableGridListScreen').default);
|
|
@@ -16,10 +16,7 @@ export default class HighlightOverlayViewScreen extends PureComponent {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
componentDidMount() {
|
|
19
|
-
|
|
20
|
-
setTimeout(() => {
|
|
21
|
-
this.setState({showFTE: true});
|
|
22
|
-
}, 1000);
|
|
19
|
+
this.setState({showFTE: true});
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
onRefUpdated(ref) {
|