Skip to content

Commit 2f023e3

Browse files
committed
Merge branch 'master' into release
2 parents a33d300 + 3f36c7a commit 2f023e3

File tree

113 files changed

+2014
-1475
lines changed

Some content is hidden

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

113 files changed

+2014
-1475
lines changed

.github/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exemptLabels:
1717
- "typescript"
1818

1919
# Set to true to ignore issues in a project (defaults to false)
20-
exemptProjects: false
20+
exemptProjects: true
2121

2222
# Set to true to ignore issues in a milestone (defaults to false)
2323
exemptMilestones: false

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,6 @@ index.ios.js
247247
*.ts
248248
*.tsx
249249
# include the .d.ts files
250-
!*.d.ts
250+
!*.d.ts
251+
252+
!testkit/*.ts

demo/src/data/products.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,46 @@ const products = [
118118
quantity: 8
119119
},
120120
mediaUrl: 'https://static.wixstatic.com/media/84770f_c611ded729fd4461a1bb57134d4e9dd2.png_128'
121+
},
122+
{
123+
name: 'I\'m a Product',
124+
formattedPrice: '$19.99',
125+
inventory: {
126+
trackingMethod: 'status',
127+
status: 'In Stock',
128+
quantity: 3
129+
},
130+
mediaUrl: 'https://images.pexels.com/photos/3612182/pexels-photo-3612182.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=150'
131+
},
132+
{
133+
name: 'I\'m a Product',
134+
formattedPrice: '$19.99',
135+
inventory: {
136+
trackingMethod: 'status',
137+
status: 'In Stock',
138+
quantity: 22
139+
},
140+
mediaUrl: 'https://images.pexels.com/photos/4841529/pexels-photo-4841529.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=150'
141+
},
142+
{
143+
name: 'I\'m a Product',
144+
formattedPrice: '$19.99',
145+
inventory: {
146+
trackingMethod: 'status',
147+
status: 'In Stock',
148+
quantity: 10
149+
},
150+
mediaUrl: 'https://images.pexels.com/photos/4173450/pexels-photo-4173450.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=150'
151+
},
152+
{
153+
name: 'I\'m a Product',
154+
formattedPrice: '$19.99',
155+
inventory: {
156+
trackingMethod: 'status',
157+
status: 'In Stock',
158+
quantity: 10
159+
},
160+
mediaUrl: 'https://images.pexels.com/photos/10513273/pexels-photo-10513273.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=150'
121161
}
122162
];
123163

demo/src/screens/ExampleScreenPresenter.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface RadioGroupOptions {
2424

2525
export function renderHeader(title: string, others: TextProps) {
2626
return (
27-
<Text text30 grey10 {...others}>
27+
<Text text30 $textDefault {...others}>
2828
{title}
2929
</Text>
3030
);
@@ -35,7 +35,7 @@ export function renderBooleanOption(title: string, key: string) {
3535
const value = this.state[key];
3636
return (
3737
<View row centerV spread marginB-s4 key={key}>
38-
<Text flex>{title}</Text>
38+
<Text $textDefault flex>{title}</Text>
3939
<Switch
4040
useCustomTheme
4141
key={key}
@@ -51,7 +51,7 @@ export function renderBooleanOption(title: string, key: string) {
5151
export function renderBooleanGroup(title: string, options: string[]) {
5252
return (
5353
<View marginB-s2>
54-
<Text text70M marginB-s2>
54+
<Text text70M $textDefault marginB-s2>
5555
{title}
5656
</Text>
5757
<View row style={styles.rowWrap}>
@@ -69,7 +69,7 @@ export function renderBooleanGroup(title: string, options: string[]) {
6969
// @ts-ignore
7070
onValueChange={value => this.setState({[key]: value})}
7171
/>
72-
<Text text70 marginR-s3 marginB-s2>
72+
<Text text70 marginR-s3 $textDefault marginB-s2>
7373
{key}
7474
</Text>
7575
</View>
@@ -89,7 +89,7 @@ export function renderRadioGroup(title: string,
8989
return (
9090
<View marginB-s2>
9191
{!_.isUndefined(title) && (
92-
<Text text70M marginB-s2>
92+
<Text text70M $textDefault marginB-s2>
9393
{title}
9494
</Text>
9595
)}
@@ -125,7 +125,7 @@ export function renderColorOption(title: string,
125125
const value = this.state[key];
126126
return (
127127
<View marginV-s2>
128-
<Text text70M>{title}</Text>
128+
<Text text70M $textDefault>{title}</Text>
129129
<ColorPalette
130130
value={value}
131131
colors={colors}
@@ -143,7 +143,7 @@ export function renderSliderOption(title: string,
143143
const value = this.state[key] || initial;
144144
return (
145145
<View marginV-s2>
146-
<Text marginB-s1 text70M>
146+
<Text marginB-s1 text70M $textDefault>
147147
{title}
148148
</Text>
149149
<View row centerV>
@@ -157,7 +157,7 @@ export function renderSliderOption(title: string,
157157
// @ts-ignore
158158
onValueChange={value => this.setState({[key]: value})}
159159
/>
160-
<Text marginL-s4 text70 style={styles.text}>
160+
<Text marginL-s4 text70 $textDefault style={styles.text}>
161161
{sliderText}
162162
{value}
163163
</Text>
@@ -173,7 +173,7 @@ export function renderMultipleSegmentOptions(title: string, key: string, options
173173

174174
return (
175175
<View row centerV spread marginB-s4 key={key}>
176-
{!!title && <Text marginR-s2>{title}</Text>}
176+
{!!title && <Text $textDefault marginR-s2>{title}</Text>}
177177
<SegmentedControl
178178
initialIndex={index}
179179
segments={options}

demo/src/screens/MenuStructure.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ export const navigationData = {
112112
screen: 'unicorn.components.FaderScreen'
113113
},
114114
{title: 'Wizard', tags: 'wizard', screen: 'unicorn.components.WizardScreen'},
115+
{title: 'GridList', tags: 'grid list', screen: 'unicorn.components.GridListScreen'},
116+
{title: 'SortableGridList', tags: 'sort grid list drag', screen: 'unicorn.components.SortableGridListScreen'},
115117
{title: 'GridView', tags: 'grid view', screen: 'unicorn.components.GridViewScreen'}
116118
]
117119
},

demo/src/screens/componentScreens/AvatarsScreen.tsx

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import _ from 'lodash';
22
import React, {Component} from 'react';
3-
import {ScrollView, View, Text, StyleSheet, Alert} from 'react-native';
4-
import {Avatar, AvatarHelper, Colors, Typography} from 'react-native-ui-lib'; //eslint-disable-line
3+
import {ScrollView, StyleSheet, Alert} from 'react-native';
4+
import {Avatar, AvatarHelper, View, Text, Colors, Typography} from 'react-native-ui-lib'; //eslint-disable-line
55

66

77
const star = require('../../assets/icons/star.png');
8-
const onlineColor = Colors.green30;
8+
const onlineColor = Colors.$backgroundSuccessHeavy;
99
const examples = [
1010
{title: 'Custom Background', backgroundColor: Colors.violet60},
1111
{title: 'Empty Avatar with ribbon', ribbonLabel: 'New'},
1212
{
1313
title: 'Initials with Color',
1414
label: 'AD',
15-
backgroundColor: Colors.yellow60,
16-
labelColor: Colors.orange20,
15+
backgroundColor: Colors.$backgroundWarning,
16+
labelColor: Colors.$textMajor,
1717
ribbonLabel: 'New',
1818
ribbonStyle: {backgroundColor: Colors.purple30}
1919
},
@@ -24,7 +24,7 @@ const examples = [
2424
uri:
2525
'https://lh3.googleusercontent.com/-cw77lUnOvmI/AAAAAAAAAAI/AAAAAAAAAAA/WMNck32dKbc/s181-c/104220521160525129167.jpg'
2626
},
27-
badgeProps: {size: 10, backgroundColor: Colors.yellow30},
27+
badgeProps: {size: 10, backgroundColor: Colors.$backgroundWarningHeavy},
2828
badgePosition: 'BOTTOM_RIGHT'
2929
},
3030

@@ -35,7 +35,7 @@ const examples = [
3535
uri:
3636
'https://lh3.googleusercontent.com/-CMM0GmT5tiI/AAAAAAAAAAI/AAAAAAAAAAA/-o9gKbC6FVo/s181-c/111308920004613908895.jpg'
3737
},
38-
badgeProps: {size: 10, backgroundColor: Colors.grey50},
38+
badgeProps: {size: 10, backgroundColor: Colors.$backgroundDisabled},
3939
badgePosition: 'BOTTOM_LEFT'
4040
},
4141
{
@@ -65,8 +65,8 @@ const examples = [
6565
icon: star,
6666
size: 14,
6767
borderWidth: 1.5,
68-
borderColor: Colors.white,
69-
iconStyle: {backgroundColor: Colors.yellow20}
68+
borderColor: Colors.$outlineLight,
69+
iconStyle: {backgroundColor: Colors.$backgroundWarningHeavy}
7070
}
7171
},
7272
{
@@ -79,7 +79,7 @@ const examples = [
7979
{
8080
title: 'Invalid Gravatar (see logs)',
8181
label: '🤦',
82-
backgroundColor: Colors.grey60,
82+
backgroundColor: Colors.$backgroundNeutralMedium,
8383
source: {uri: 'https://www.gravatar.com/avatar/00000000000000000000000000000000?d=404'},
8484
onImageLoadStart: () => console.log('AvatarScreen: Invalid avatar load STARTED...'), // eslint-disable-line
8585
onImageLoadEnd: () => console.log('AvatarScreen: Invalid avatar load ENDED'), // eslint-disable-line
@@ -88,26 +88,26 @@ const examples = [
8888
{
8989
title: 'Monitored Avatar (see logs)',
9090
label: '?!',
91-
backgroundColor: Colors.blue20,
91+
backgroundColor: Colors.$backgroundGeneralHeavy,
9292
source: {uri: 'https://static.altomusic.com/media/catalog/product/M/A/MAJ100SBK_0.jpg'},
9393
onImageLoadStart: () => console.log('AvatarScreen: Monitored avatar load STARTED...'), // eslint-disable-line
9494
onImageLoadEnd: () => console.log('AvatarScreen: Monitored avatar load ENDED') // eslint-disable-line
9595
},
9696
{
9797
title: 'Empty Gravatar',
98-
backgroundColor: Colors.red60,
98+
backgroundColor: Colors.$backgroundDanger,
9999
source: {uri: 'https://www.gravatar.com/avatar/2497473d558a37020c558bf26e380a7c?d=blank'}
100100
},
101101
{
102102
title: 'With custom badge label',
103103
label: 'LD',
104-
backgroundColor: Colors.red60,
104+
backgroundColor: Colors.$backgroundDanger,
105105
badgePosition: 'BOTTOM_RIGHT',
106106
badgeProps: {
107107
label: '+2',
108108
size: 24,
109109
borderWidth: 1.5,
110-
borderColor: Colors.white
110+
borderColor: Colors.$outlineLight
111111
}
112112
}
113113
];
@@ -130,7 +130,7 @@ export default class AvatarsScreen extends Component {
130130
<ScrollView contentContainerStyle={styles.container}>
131131
{_.map(examples, (example, i) => (
132132
<View key={i} style={styles.section}>
133-
<Text style={{...Typography.text80}}>{example.title}</Text>
133+
<Text $textDefault style={{...Typography.text80}}>{example.title}</Text>
134134
<Avatar containerStyle={{marginVertical: 5}} {...example} onPress={() => this.onAvatarPress(example)}/>
135135
</View>
136136
))}
@@ -141,7 +141,8 @@ export default class AvatarsScreen extends Component {
141141

142142
const styles = StyleSheet.create({
143143
container: {
144-
padding: 25
144+
padding: 25,
145+
backgroundColor: Colors.$backgroundDefault
145146
},
146147
section: {
147148
flexDirection: 'row',

0 commit comments

Comments
 (0)