unicorn-demo-app 6.21.2 → 6.22.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 +1 -1
- package/src/screens/MenuStructure.js +4 -0
- package/src/screens/SettingsScreen.js +19 -12
- package/src/screens/componentScreens/ActionSheetScreen.tsx +2 -0
- package/src/screens/componentScreens/ChipScreen.tsx +4 -4
- package/src/screens/componentScreens/FloatingButtonScreen.tsx +8 -5
- package/src/screens/componentScreens/PickerScreen.tsx +6 -17
- package/src/screens/componentScreens/SliderScreen.tsx +242 -122
- package/src/screens/foundationScreens/DarkModeScreen.tsx +1 -1
- package/src/screens/incubatorScreens/IncubatorExpandableOverlayScreen.tsx +2 -2
- package/src/screens/incubatorScreens/WheelPickerScreen.tsx +9 -3
package/package.json
CHANGED
|
@@ -2,29 +2,33 @@ import _ from 'lodash';
|
|
|
2
2
|
import React, {Component} from 'react';
|
|
3
3
|
import AsyncStorage from '@react-native-community/async-storage';
|
|
4
4
|
import {StyleSheet, I18nManager} from 'react-native';
|
|
5
|
-
import {Colors, View, Text, Picker,
|
|
5
|
+
import {Colors, View, Text, Picker, Incubator, Switch} from 'react-native-ui-lib'; //eslint-disable-line
|
|
6
6
|
import {navigationData} from './MenuStructure';
|
|
7
7
|
|
|
8
8
|
const none = {label: '[None]', value: ''};
|
|
9
|
-
const playgroundScreen = {label: 'Playground', value: 'unicorn.PlaygroundScreen'};
|
|
10
9
|
|
|
11
10
|
class SettingsScreen extends Component {
|
|
12
11
|
constructor(props) {
|
|
13
12
|
super(props);
|
|
14
13
|
|
|
15
14
|
const data = props.navigationData || navigationData;
|
|
16
|
-
const playground = props.playground
|
|
15
|
+
const playground = props.playground;
|
|
16
|
+
|
|
17
|
+
const screens = [
|
|
18
|
+
none,
|
|
19
|
+
..._.flow(_.values,
|
|
20
|
+
screens => _.map(screens, 'screens'),
|
|
21
|
+
_.flatten,
|
|
22
|
+
screens => _.map(screens, screen => ({label: screen.title, value: screen.screen})))(data)
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
if (playground) {
|
|
26
|
+
screens.splice(1, 0, playground);
|
|
27
|
+
}
|
|
17
28
|
|
|
18
29
|
this.state = {
|
|
19
30
|
showRefreshMessage: false,
|
|
20
|
-
screens
|
|
21
|
-
none,
|
|
22
|
-
playground,
|
|
23
|
-
..._.flow(_.values,
|
|
24
|
-
screens => _.map(screens, 'screens'),
|
|
25
|
-
_.flatten,
|
|
26
|
-
screens => _.map(screens, screen => ({label: screen.title, value: screen.screen})))(data)
|
|
27
|
-
]
|
|
31
|
+
screens
|
|
28
32
|
};
|
|
29
33
|
}
|
|
30
34
|
|
|
@@ -107,7 +111,10 @@ class SettingsScreen extends Component {
|
|
|
107
111
|
<Text text30 grey10>
|
|
108
112
|
Settings
|
|
109
113
|
</Text>
|
|
110
|
-
<Toast
|
|
114
|
+
<Incubator.Toast
|
|
115
|
+
visible={showRefreshMessage}
|
|
116
|
+
message={`Default screen set to: ${defaultScreen?.label}. Please refresh the app.`}
|
|
117
|
+
/>
|
|
111
118
|
</View>
|
|
112
119
|
);
|
|
113
120
|
}
|
|
@@ -64,6 +64,7 @@ export default class ActionSheetScreen extends Component {
|
|
|
64
64
|
cancelButtonIndex={3}
|
|
65
65
|
destructiveButtonIndex={0}
|
|
66
66
|
useNativeIOS={false}
|
|
67
|
+
migrateDialog
|
|
67
68
|
options={[
|
|
68
69
|
{label: 'option 1', onPress: () => this.pickOption('option 1')},
|
|
69
70
|
{label: 'option 2', onPress: () => this.pickOption('option 2')},
|
|
@@ -79,6 +80,7 @@ export default class ActionSheetScreen extends Component {
|
|
|
79
80
|
message={'Message of action sheet'}
|
|
80
81
|
cancelButtonIndex={3}
|
|
81
82
|
destructiveButtonIndex={0}
|
|
83
|
+
migrateDialog
|
|
82
84
|
options={[
|
|
83
85
|
{label: 'option 1', onPress: () => this.pickOption('option 1'), iconSource: collectionsIcon},
|
|
84
86
|
{label: 'option 2', onPress: () => this.pickOption('option 2'), iconSource: shareIcon},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import React, {Component} from 'react';
|
|
3
3
|
import {Alert} from 'react-native';
|
|
4
|
-
import {Chip, Colors, Spacings, Text, Typography, View,
|
|
4
|
+
import {Chip, Colors, Spacings, Text, Typography, View, Incubator, WheelPickerDialog, Image} from 'react-native-ui-lib';
|
|
5
5
|
|
|
6
6
|
const avatarImage = {
|
|
7
7
|
uri: 'https://randomuser.me/api/portraits/women/24.jpg'
|
|
@@ -72,9 +72,9 @@ export default class ChipScreen extends Component {
|
|
|
72
72
|
const {showDialog} = this.state;
|
|
73
73
|
|
|
74
74
|
return (
|
|
75
|
-
<Dialog visible={showDialog} useSafeArea bottom onDismiss={this.closeDialog}>
|
|
75
|
+
<Incubator.Dialog visible={showDialog} useSafeArea bottom onDismiss={this.closeDialog}>
|
|
76
76
|
{this.renderContent()}
|
|
77
|
-
</Dialog>
|
|
77
|
+
</Incubator.Dialog>
|
|
78
78
|
);
|
|
79
79
|
};
|
|
80
80
|
|
|
@@ -90,7 +90,7 @@ export default class ChipScreen extends Component {
|
|
|
90
90
|
render() {
|
|
91
91
|
return (
|
|
92
92
|
<View style={{padding: 20}}>
|
|
93
|
-
{this.
|
|
93
|
+
{this.renderPickerDialog()}
|
|
94
94
|
<Text marginB-20 text40 $textDefault>
|
|
95
95
|
Chip
|
|
96
96
|
</Text>
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import React, {Component} from 'react';
|
|
2
2
|
import {View, StyleSheet, Alert, ScrollView} from 'react-native';
|
|
3
|
-
import {Colors, Text, FloatingButton} from 'react-native-ui-lib';
|
|
3
|
+
import {Colors, Text, FloatingButton, FloatingButtonLayouts} from 'react-native-ui-lib';
|
|
4
4
|
import {renderBooleanOption} from '../ExampleScreenPresenter';
|
|
5
5
|
|
|
6
6
|
interface State {
|
|
7
7
|
showButton: boolean;
|
|
8
8
|
showSecondary: boolean;
|
|
9
|
+
showVertical: boolean;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export default class FloatingButtonScreen extends Component<{}, State> {
|
|
12
13
|
state = {
|
|
13
14
|
showButton: true,
|
|
14
|
-
showSecondary: true
|
|
15
|
+
showSecondary: true,
|
|
16
|
+
showVertical: true
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
notNow = () => {
|
|
@@ -25,7 +27,7 @@ export default class FloatingButtonScreen extends Component<{}, State> {
|
|
|
25
27
|
};
|
|
26
28
|
|
|
27
29
|
render() {
|
|
28
|
-
const {showSecondary} = this.state;
|
|
30
|
+
const {showSecondary, showVertical} = this.state;
|
|
29
31
|
return (
|
|
30
32
|
<View style={styles.container}>
|
|
31
33
|
<Text text60 center $textDefault marginB-s4>
|
|
@@ -33,6 +35,7 @@ export default class FloatingButtonScreen extends Component<{}, State> {
|
|
|
33
35
|
</Text>
|
|
34
36
|
{renderBooleanOption.call(this, 'Show Floating Button', 'showButton')}
|
|
35
37
|
{renderBooleanOption.call(this, 'Show Secondary Button', 'showSecondary')}
|
|
38
|
+
{renderBooleanOption.call(this, 'Button Layout Vertical', 'showVertical')}
|
|
36
39
|
|
|
37
40
|
<ScrollView showsVerticalScrollIndicator={false}>
|
|
38
41
|
<View paddingT-20>
|
|
@@ -69,11 +72,11 @@ export default class FloatingButtonScreen extends Component<{}, State> {
|
|
|
69
72
|
showSecondary
|
|
70
73
|
? {
|
|
71
74
|
label: 'Not now',
|
|
72
|
-
onPress: this.notNow
|
|
73
|
-
color: Colors.$textDangerLight
|
|
75
|
+
onPress: this.notNow
|
|
74
76
|
}
|
|
75
77
|
: undefined
|
|
76
78
|
}
|
|
79
|
+
buttonLayout={showVertical ? FloatingButtonLayouts.VERTICAL : FloatingButtonLayouts.HORIZONTAL}
|
|
77
80
|
// bottomMargin={80}
|
|
78
81
|
// hideBackgroundOverlay
|
|
79
82
|
// withoutAnimation
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import React, {Component} from 'react';
|
|
3
|
-
import {ScrollView} from 'react-native';
|
|
3
|
+
import {ScrollView} from 'react-native-gesture-handler';
|
|
4
4
|
import {
|
|
5
5
|
View,
|
|
6
6
|
Colors,
|
|
7
7
|
Icon,
|
|
8
|
-
|
|
8
|
+
Incubator,
|
|
9
9
|
Text,
|
|
10
10
|
Picker,
|
|
11
11
|
Avatar,
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
Typography,
|
|
15
15
|
PickerProps,
|
|
16
16
|
PickerMethods,
|
|
17
|
-
DialogProps,
|
|
18
17
|
Button
|
|
19
18
|
} from 'react-native-ui-lib'; //eslint-disable-line
|
|
20
19
|
import contactsData from '../../data/conversations';
|
|
@@ -61,20 +60,11 @@ export default class PickerScreen extends Component {
|
|
|
61
60
|
contact: 0
|
|
62
61
|
};
|
|
63
62
|
|
|
64
|
-
dialogHeader: DialogProps['renderPannableHeader'] = props => {
|
|
65
|
-
const {title} = props;
|
|
66
|
-
return (
|
|
67
|
-
<Text margin-15 text60 $textDefault>
|
|
68
|
-
{title}
|
|
69
|
-
</Text>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
63
|
renderDialog: PickerProps['renderCustomModal'] = modalProps => {
|
|
74
64
|
const {visible, children, toggleModal, onDone} = modalProps;
|
|
75
65
|
|
|
76
66
|
return (
|
|
77
|
-
<Dialog
|
|
67
|
+
<Incubator.Dialog
|
|
78
68
|
visible={visible}
|
|
79
69
|
onDismiss={() => {
|
|
80
70
|
onDone();
|
|
@@ -85,12 +75,11 @@ export default class PickerScreen extends Component {
|
|
|
85
75
|
bottom
|
|
86
76
|
useSafeArea
|
|
87
77
|
containerStyle={{backgroundColor: Colors.$backgroundDefault}}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
pannableHeaderProps={{title: 'Custom modal'}}
|
|
78
|
+
direction={PanningProvider.Directions.DOWN}
|
|
79
|
+
headerProps={{title: 'Custom modal'}}
|
|
91
80
|
>
|
|
92
81
|
<ScrollView>{children}</ScrollView>
|
|
93
|
-
</Dialog>
|
|
82
|
+
</Incubator.Dialog>
|
|
94
83
|
);
|
|
95
84
|
};
|
|
96
85
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, {Component} from 'react';
|
|
1
|
+
import React, {Component, Fragment} from 'react';
|
|
2
2
|
import {StyleSheet, ScrollView} from 'react-native';
|
|
3
|
-
import {Colors, View, Text, Icon, Slider, GradientSlider, ColorSliderGroup
|
|
3
|
+
import {Constants, Colors, View, Text, Button, Icon, Slider, GradientSlider, ColorSliderGroup} from 'react-native-ui-lib';
|
|
4
4
|
import {renderBooleanOption} from '../ExampleScreenPresenter';
|
|
5
5
|
|
|
6
6
|
interface SliderScreenProps {
|
|
@@ -13,10 +13,15 @@ interface SliderScreenState {
|
|
|
13
13
|
sliderValue: number;
|
|
14
14
|
sliderMinValue: number;
|
|
15
15
|
sliderMaxValue: number;
|
|
16
|
+
sliderMinValue2: number;
|
|
17
|
+
sliderMaxValue2: number;
|
|
16
18
|
forceLTR: boolean;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
const INITIAL_VALUE =
|
|
21
|
+
const INITIAL_VALUE = 20;
|
|
22
|
+
const RANGE_INITIAL_MIN = 0;
|
|
23
|
+
const RANGE_INITIAL_MAX = 100;
|
|
24
|
+
|
|
20
25
|
const COLOR = Colors.blue30;
|
|
21
26
|
|
|
22
27
|
export default class SliderScreen extends Component<SliderScreenProps, SliderScreenState> {
|
|
@@ -24,20 +29,45 @@ export default class SliderScreen extends Component<SliderScreenProps, SliderScr
|
|
|
24
29
|
alpha: 1,
|
|
25
30
|
color: COLOR,
|
|
26
31
|
sliderValue: INITIAL_VALUE,
|
|
27
|
-
sliderMinValue:
|
|
28
|
-
sliderMaxValue:
|
|
32
|
+
sliderMinValue: RANGE_INITIAL_MIN,
|
|
33
|
+
sliderMaxValue: RANGE_INITIAL_MAX,
|
|
34
|
+
sliderMinValue2: 25,
|
|
35
|
+
sliderMaxValue2: 80,
|
|
29
36
|
forceLTR: false
|
|
30
37
|
};
|
|
31
38
|
|
|
39
|
+
slider = React.createRef();
|
|
40
|
+
rangeSlider = React.createRef();
|
|
41
|
+
gradientSlider = React.createRef();
|
|
42
|
+
|
|
43
|
+
resetSlider = () => {
|
|
44
|
+
this.slider.current?.reset();
|
|
45
|
+
this.rangeSlider.current?.reset();
|
|
46
|
+
this.gradientSlider.current?.reset();
|
|
47
|
+
}
|
|
48
|
+
|
|
32
49
|
onSliderRangeChange = (values: {min: number, max: number}) => {
|
|
33
50
|
const {min, max} = values;
|
|
34
51
|
this.setState({sliderMinValue: min, sliderMaxValue: max});
|
|
35
52
|
};
|
|
36
53
|
|
|
54
|
+
onSliderRangeChange2 = (values: {min: number, max: number}) => {
|
|
55
|
+
const {min, max} = values;
|
|
56
|
+
this.setState({sliderMinValue2: min, sliderMaxValue2: max});
|
|
57
|
+
};
|
|
58
|
+
|
|
37
59
|
onSliderValueChange = (value: number) => {
|
|
38
60
|
this.setState({sliderValue: value});
|
|
39
61
|
};
|
|
40
62
|
|
|
63
|
+
onSliderReset = () => {
|
|
64
|
+
this.setState({sliderValue: INITIAL_VALUE});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
onRangeSliderReset = () => {
|
|
68
|
+
this.setState({sliderMinValue: RANGE_INITIAL_MIN, sliderMaxValue: RANGE_INITIAL_MAX});
|
|
69
|
+
}
|
|
70
|
+
|
|
41
71
|
onGradientValueChange = (value: string, alpha: number) => {
|
|
42
72
|
this.setState({color: value, alpha});
|
|
43
73
|
};
|
|
@@ -50,141 +80,231 @@ export default class SliderScreen extends Component<SliderScreenProps, SliderScr
|
|
|
50
80
|
return Constants.isRTL && this.state.forceLTR && styles.ltr;
|
|
51
81
|
}
|
|
52
82
|
|
|
53
|
-
|
|
54
|
-
const {
|
|
83
|
+
renderDefaultSliderExample() {
|
|
84
|
+
const {sliderValue, forceLTR} = this.state;
|
|
55
85
|
|
|
56
86
|
return (
|
|
57
|
-
<
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
87
|
+
<Fragment>
|
|
88
|
+
<Text $textDefault text70BO>
|
|
89
|
+
Default slider
|
|
90
|
+
</Text>
|
|
91
|
+
|
|
92
|
+
<View row centerV style={this.getReverseStyle()}>
|
|
93
|
+
<Icon assetName={'search'} style={styles.image}/>
|
|
94
|
+
<Slider
|
|
95
|
+
onValueChange={this.onSliderValueChange}
|
|
96
|
+
value={INITIAL_VALUE}
|
|
97
|
+
minimumValue={0}
|
|
98
|
+
maximumValue={100}
|
|
99
|
+
step={1}
|
|
100
|
+
containerStyle={styles.sliderContainer}
|
|
101
|
+
disableRTL={forceLTR}
|
|
102
|
+
ref={this.slider}
|
|
103
|
+
onReset={this.onSliderReset}
|
|
104
|
+
/>
|
|
105
|
+
<Text bodySmall $textNeutral style={styles.text} numberOfLines={1}>
|
|
106
|
+
${sliderValue}
|
|
61
107
|
</Text>
|
|
108
|
+
</View>
|
|
109
|
+
</Fragment>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
62
112
|
|
|
63
|
-
|
|
113
|
+
renderNegativeSliderExample() {
|
|
114
|
+
return (
|
|
115
|
+
<Fragment>
|
|
116
|
+
<Text $textDefault text70BO marginT-30>
|
|
117
|
+
Negatives
|
|
118
|
+
</Text>
|
|
119
|
+
<Slider
|
|
120
|
+
minimumValue={-100}
|
|
121
|
+
maximumValue={100}
|
|
122
|
+
value={-30}
|
|
123
|
+
minimumTrackTintColor={Colors.red30}
|
|
124
|
+
thumbTintColor={Colors.red50}
|
|
125
|
+
containerStyle={styles.slider}
|
|
126
|
+
/>
|
|
127
|
+
<Slider
|
|
128
|
+
minimumValue={-300}
|
|
129
|
+
maximumValue={-100}
|
|
130
|
+
value={-130}
|
|
131
|
+
minimumTrackTintColor={Colors.red30}
|
|
132
|
+
thumbTintColor={Colors.red50}
|
|
133
|
+
containerStyle={styles.slider}
|
|
134
|
+
/>
|
|
135
|
+
</Fragment>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
64
138
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
value={INITIAL_VALUE}
|
|
73
|
-
minimumValue={0}
|
|
74
|
-
maximumValue={100}
|
|
75
|
-
step={1}
|
|
76
|
-
containerStyle={styles.sliderContainer}
|
|
77
|
-
disableRTL={forceLTR}
|
|
78
|
-
/>
|
|
79
|
-
<Text bodySmall $textNeutral style={styles.text} numberOfLines={1}>
|
|
80
|
-
${sliderValue}
|
|
81
|
-
</Text>
|
|
82
|
-
</View>
|
|
139
|
+
renderDisabledSliderExample() {
|
|
140
|
+
return (
|
|
141
|
+
<Fragment>
|
|
142
|
+
<Text $textDefault text70BO marginT-20>
|
|
143
|
+
Disabled
|
|
144
|
+
</Text>
|
|
145
|
+
<Slider minimumValue={100} maximumValue={200} value={120} containerStyle={styles.slider} disabled/>
|
|
83
146
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
147
|
+
<Text $textDefault text70BO marginT-15>
|
|
148
|
+
Custom with Steps
|
|
149
|
+
</Text>
|
|
150
|
+
<Slider
|
|
151
|
+
value={50}
|
|
152
|
+
minimumValue={0}
|
|
153
|
+
maximumValue={100}
|
|
154
|
+
step={25}
|
|
155
|
+
containerStyle={styles.slider}
|
|
156
|
+
trackStyle={styles.track}
|
|
157
|
+
thumbStyle={styles.thumb}
|
|
158
|
+
activeThumbStyle={styles.activeThumb}
|
|
159
|
+
thumbTintColor={Colors.violet70}
|
|
160
|
+
minimumTrackTintColor={Colors.violet40}
|
|
161
|
+
maximumTrackTintColor={Colors.violet70}
|
|
162
|
+
/>
|
|
163
|
+
</Fragment>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
renderRangeSliderExample() {
|
|
168
|
+
const {sliderMinValue, sliderMaxValue, forceLTR} = this.state;
|
|
103
169
|
|
|
104
|
-
|
|
105
|
-
|
|
170
|
+
return (
|
|
171
|
+
<Fragment>
|
|
172
|
+
<Text $textDefault text70BO marginV-15>
|
|
173
|
+
Range Slider
|
|
174
|
+
</Text>
|
|
175
|
+
<View row spread style={this.getReverseStyle()}>
|
|
176
|
+
<Text bodySmall $textNeutral>
|
|
177
|
+
min. {sliderMinValue}%
|
|
106
178
|
</Text>
|
|
107
|
-
<
|
|
179
|
+
<Text bodySmall $textNeutral>
|
|
180
|
+
max. {sliderMaxValue}%
|
|
181
|
+
</Text>
|
|
182
|
+
</View>
|
|
183
|
+
<Slider
|
|
184
|
+
useRange
|
|
185
|
+
onRangeChange={this.onSliderRangeChange}
|
|
186
|
+
value={INITIAL_VALUE}
|
|
187
|
+
minimumValue={0}
|
|
188
|
+
maximumValue={100}
|
|
189
|
+
step={1}
|
|
190
|
+
disableRTL={forceLTR}
|
|
191
|
+
ref={this.rangeSlider}
|
|
192
|
+
onReset={this.onRangeSliderReset}
|
|
193
|
+
/>
|
|
194
|
+
</Fragment>
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
renderRangeSliderWithValuesExample() {
|
|
199
|
+
const {sliderMinValue2, sliderMaxValue2, forceLTR} = this.state;
|
|
108
200
|
|
|
109
|
-
|
|
110
|
-
|
|
201
|
+
return (
|
|
202
|
+
<Fragment>
|
|
203
|
+
<Text $textDefault text70BO marginV-15>
|
|
204
|
+
Range w/ initial values and no default gap
|
|
205
|
+
</Text>
|
|
206
|
+
<View row spread style={this.getReverseStyle()}>
|
|
207
|
+
<Text bodySmall $textNeutral>
|
|
208
|
+
min. {sliderMinValue2}%
|
|
111
209
|
</Text>
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
210
|
+
<Text bodySmall $textNeutral>
|
|
211
|
+
max. {sliderMaxValue2}%
|
|
212
|
+
</Text>
|
|
213
|
+
</View>
|
|
214
|
+
<Slider
|
|
215
|
+
useRange
|
|
216
|
+
useGap={false}
|
|
217
|
+
onRangeChange={this.onSliderRangeChange2}
|
|
218
|
+
value={INITIAL_VALUE}
|
|
219
|
+
minimumValue={0}
|
|
220
|
+
maximumValue={100}
|
|
221
|
+
step={1}
|
|
222
|
+
disableRTL={forceLTR}
|
|
223
|
+
initialMinimumValue={25}
|
|
224
|
+
initialMaximumValue={80}
|
|
225
|
+
/>
|
|
226
|
+
</Fragment>
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
renderGradientSlidersExample() {
|
|
231
|
+
const {color, alpha} = this.state;
|
|
125
232
|
|
|
126
|
-
|
|
127
|
-
|
|
233
|
+
return (
|
|
234
|
+
<Fragment>
|
|
235
|
+
<Text $textDefault text70BO marginT-15>
|
|
236
|
+
Gradient Sliders
|
|
237
|
+
</Text>
|
|
238
|
+
<View row centerV>
|
|
239
|
+
<Text text90 $textNeutral>
|
|
240
|
+
DEFAULT
|
|
128
241
|
</Text>
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
max. {sliderMaxValue}%
|
|
135
|
-
</Text>
|
|
136
|
-
</View>
|
|
137
|
-
<Slider
|
|
138
|
-
useRange
|
|
139
|
-
onRangeChange={this.onSliderRangeChange}
|
|
140
|
-
value={INITIAL_VALUE}
|
|
141
|
-
minimumValue={0}
|
|
142
|
-
maximumValue={100}
|
|
143
|
-
step={1}
|
|
144
|
-
disableRTL={forceLTR}
|
|
242
|
+
<GradientSlider
|
|
243
|
+
color={color}
|
|
244
|
+
containerStyle={styles.gradientSliderContainer}
|
|
245
|
+
onValueChange={this.onGradientValueChange}
|
|
246
|
+
ref={this.gradientSlider}
|
|
145
247
|
/>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
248
|
+
<View style={styles.box}>
|
|
249
|
+
<View style={{flex: 1, backgroundColor: color, opacity: alpha}}/>
|
|
250
|
+
</View>
|
|
251
|
+
</View>
|
|
252
|
+
<View row centerV>
|
|
253
|
+
<Text text90 $textNeutral>
|
|
254
|
+
HUE
|
|
149
255
|
</Text>
|
|
150
|
-
<
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
/>
|
|
159
|
-
<View style={styles.box}>
|
|
160
|
-
<View style={{flex: 1, backgroundColor: color, opacity: alpha}}/>
|
|
161
|
-
</View>
|
|
256
|
+
<GradientSlider
|
|
257
|
+
type={GradientSlider.types.HUE}
|
|
258
|
+
color={COLOR}
|
|
259
|
+
containerStyle={styles.gradientSliderContainer}
|
|
260
|
+
onValueChange={this.onGradientValueChange}
|
|
261
|
+
/>
|
|
262
|
+
<View style={styles.box}>
|
|
263
|
+
<View style={{flex: 1, backgroundColor: color}}/>
|
|
162
264
|
</View>
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
265
|
+
</View>
|
|
266
|
+
</Fragment>
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
renderColorSliderGroupExample() {
|
|
271
|
+
const {color} = this.state;
|
|
272
|
+
|
|
273
|
+
return (
|
|
274
|
+
<Fragment>
|
|
275
|
+
<Text $textDefault text70BO marginV-15>
|
|
276
|
+
Color Slider Group
|
|
277
|
+
</Text>
|
|
278
|
+
<ColorSliderGroup
|
|
279
|
+
initialColor={color}
|
|
280
|
+
sliderContainerStyle={styles.slider}
|
|
281
|
+
containerStyle={styles.group}
|
|
282
|
+
showLabels
|
|
283
|
+
// onValueChange={this.onGroupValueChange}
|
|
284
|
+
/>
|
|
285
|
+
</Fragment>
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
render() {
|
|
290
|
+
return (
|
|
291
|
+
<ScrollView showsVerticalScrollIndicator={false}>
|
|
292
|
+
<View flex padding-20>
|
|
293
|
+
<View row spread centerV marginB-10>
|
|
294
|
+
<Text text40 $textDefault marginB-20>
|
|
295
|
+
Sliders
|
|
166
296
|
</Text>
|
|
167
|
-
<
|
|
168
|
-
type={GradientSlider.types.HUE}
|
|
169
|
-
color={COLOR}
|
|
170
|
-
containerStyle={styles.gradientSliderContainer}
|
|
171
|
-
onValueChange={this.onGradientValueChange}
|
|
172
|
-
/>
|
|
173
|
-
<View style={styles.box}>
|
|
174
|
-
<View style={{flex: 1, backgroundColor: color}}/>
|
|
175
|
-
</View>
|
|
297
|
+
<Button link label="Reset" onPress={this.resetSlider}/>
|
|
176
298
|
</View>
|
|
299
|
+
{Constants.isRTL && renderBooleanOption.call(this, 'Force LTR', 'forceLTR')}
|
|
177
300
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
showLabels
|
|
186
|
-
// onValueChange={this.onGroupValueChange}
|
|
187
|
-
/>
|
|
301
|
+
{this.renderDefaultSliderExample()}
|
|
302
|
+
{this.renderNegativeSliderExample()}
|
|
303
|
+
{this.renderDisabledSliderExample()}
|
|
304
|
+
{this.renderRangeSliderExample()}
|
|
305
|
+
{this.renderRangeSliderWithValuesExample()}
|
|
306
|
+
{this.renderGradientSlidersExample()}
|
|
307
|
+
{this.renderColorSliderGroupExample()}
|
|
188
308
|
</View>
|
|
189
309
|
</ScrollView>
|
|
190
310
|
);
|
|
@@ -19,8 +19,8 @@ class DarkModeScreen extends Component {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
changeSchemeType = (index: number) => {
|
|
22
|
-
this.setState({selectedSchemeType: SCHEME_TYPES[index].value});
|
|
23
22
|
Colors.setScheme(SCHEME_TYPES[index].value);
|
|
23
|
+
this.setState({selectedSchemeType: SCHEME_TYPES[index].value});
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
render() {
|
|
@@ -40,7 +40,7 @@ export default class TextFieldScreen extends Component {
|
|
|
40
40
|
const {textFieldValueDraft} = this.state;
|
|
41
41
|
return (
|
|
42
42
|
<>
|
|
43
|
-
<View
|
|
43
|
+
<View br20 padding-s4>
|
|
44
44
|
<Incubator.TextField
|
|
45
45
|
autoFocus
|
|
46
46
|
preset={null}
|
|
@@ -68,7 +68,7 @@ export default class TextFieldScreen extends Component {
|
|
|
68
68
|
|
|
69
69
|
renderPickerContent = () => {
|
|
70
70
|
return (
|
|
71
|
-
<View bg
|
|
71
|
+
<View bg-$backgroundDefault br20 padding-s3 paddingB-60>
|
|
72
72
|
{_.map(COLOR_OPTIONS, (_color, key) => {
|
|
73
73
|
return (
|
|
74
74
|
<TouchableOpacity key={key} customValue={key} onPress={this.onPickItem}>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import React, {useCallback, useState} from 'react';
|
|
3
|
-
import {View, Text, Incubator, Colors, Typography, Button
|
|
3
|
+
import {View, Text, Incubator, Colors, Typography, Button} from 'react-native-ui-lib';
|
|
4
4
|
|
|
5
5
|
const monthItems = _.map([
|
|
6
6
|
'January',
|
|
@@ -88,9 +88,15 @@ export default () => {
|
|
|
88
88
|
<View center marginT-40>
|
|
89
89
|
<Text h3 marginB-20>Days</Text>
|
|
90
90
|
<Button size="small" label={'Pick Days'} onPress={onPickDaysPress}/>
|
|
91
|
-
<Dialog
|
|
91
|
+
<Incubator.Dialog
|
|
92
|
+
width={'90%'}
|
|
93
|
+
bottom
|
|
94
|
+
visible={showDialog}
|
|
95
|
+
onDismiss={onDialogDismissed}
|
|
96
|
+
headerProps={{showKnob: false, showDivider: false}}
|
|
97
|
+
>
|
|
92
98
|
<Incubator.WheelPicker initialValue={5} label={'Days'} items={dayItems}/>
|
|
93
|
-
</Dialog>
|
|
99
|
+
</Incubator.Dialog>
|
|
94
100
|
</View>
|
|
95
101
|
</View>
|
|
96
102
|
);
|