@draftbit/core 46.5.2-13b65f.2 → 46.5.2-5f6e91.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/lib/commonjs/components/Button.js +15 -27
- package/lib/commonjs/components/CardBlock.js +13 -4
- package/lib/commonjs/components/CardContainerRating.js +13 -4
- package/lib/commonjs/components/CardContainerShortImage.js +15 -4
- package/lib/commonjs/components/Carousel.js +30 -8
- package/lib/commonjs/components/Checkbox/Checkbox.js +3 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +23 -6
- package/lib/commonjs/components/CircleImage.js +15 -1
- package/lib/commonjs/components/CircularProgress.js +26 -8
- package/lib/commonjs/components/DatePicker/DatePicker.js +4 -0
- package/lib/commonjs/components/DatePicker/DatePickerComponent.js +6 -0
- package/lib/commonjs/components/DeprecatedButton.js +151 -0
- package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -2
- package/lib/commonjs/components/DeprecatedFAB.js +2 -1
- package/lib/commonjs/components/Elevation.js +14 -2
- package/lib/commonjs/components/FieldSearchBarFull.js +1 -2
- package/lib/commonjs/components/FormRow.js +16 -2
- package/lib/commonjs/components/IconButton.js +19 -4
- package/lib/commonjs/components/Image.js +17 -2
- package/lib/commonjs/components/Layout.js +40 -19
- package/lib/commonjs/components/Picker/Picker.js +13 -7
- package/lib/commonjs/components/Picker/PickerComponent.android.js +20 -3
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +38 -13
- package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
- package/lib/commonjs/components/Portal/PortalHost.js +44 -15
- package/lib/commonjs/components/ProgressBar.js +37 -7
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +23 -5
- package/lib/commonjs/components/Slider.js +21 -4
- package/lib/commonjs/components/Surface.js +14 -2
- package/lib/commonjs/components/Switch.js +19 -10
- package/lib/commonjs/components/Text.js +50 -4
- package/lib/commonjs/components/Touchable.js +27 -28
- package/lib/commonjs/components/Touchable.web.js +9 -0
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/hooks.js +1 -2
- package/lib/commonjs/mappings/Button.js +10 -13
- package/lib/commonjs/mappings/Touchable.js +20 -0
- package/lib/commonjs/styles/overlay.js +1 -3
- package/lib/module/components/AnimatedCircularProgress.js +13 -1
- package/lib/module/components/Button.js +9 -21
- package/lib/module/components/CardContainer.js +14 -4
- package/lib/module/components/Checkbox/Checkbox.js +3 -2
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +24 -5
- package/lib/module/components/Checkbox/CheckboxRow.js +24 -6
- package/lib/module/components/Checkbox/context.js +1 -1
- package/lib/module/components/CircleImage.js +16 -1
- package/lib/module/components/DatePicker/DatePicker.js +4 -0
- package/lib/module/components/DatePicker/DatePickerComponent.js +6 -0
- package/lib/module/components/DeprecatedButton.js +141 -0
- package/lib/module/components/DeprecatedCardWrapper.js +2 -2
- package/lib/module/components/DeprecatedFAB.js +25 -4
- package/lib/module/components/Divider.js +18 -1
- package/lib/module/components/Elevation.js +14 -2
- package/lib/module/components/IconButton.js +21 -4
- package/lib/module/components/Layout.js +42 -21
- package/lib/module/components/Picker/Picker.js +4 -3
- package/lib/module/components/Picker/PickerComponent.ios.js +1 -1
- package/lib/module/components/Picker/PickerComponent.web.js +21 -3
- package/lib/module/components/Portal/PortalHost.js +45 -15
- package/lib/module/components/Portal/PortalManager.js +33 -7
- package/lib/module/components/ProgressBar.js +39 -7
- package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +10 -1
- package/lib/module/components/RadioButton/RadioButtonRow.js +24 -5
- package/lib/module/components/ScreenContainer.js +21 -4
- package/lib/module/components/Slider.js +21 -4
- package/lib/module/components/StepIndicator.js +58 -18
- package/lib/module/components/Surface.js +15 -1
- package/lib/module/components/TextField.js +78 -28
- package/lib/module/components/ToggleButton.js +16 -2
- package/lib/module/components/Touchable.js +10 -25
- package/lib/module/components/Touchable.web.js +2 -0
- package/lib/module/constants.js +1 -2
- package/lib/module/hooks.js +1 -2
- package/lib/module/index.js +1 -3
- package/lib/module/mappings/Button.js +11 -14
- package/lib/module/mappings/FieldSearchBarFull.js +4 -1
- package/lib/module/mappings/StarRating.js +7 -2
- package/lib/module/mappings/Touchable.js +13 -0
- package/lib/module/styles/overlay.js +1 -3
- package/lib/typescript/src/components/Button.d.ts +0 -2
- package/lib/typescript/src/components/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -2
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +2 -0
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts +2 -0
- package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedButton.d.ts +54 -0
- package/lib/typescript/src/components/DeprecatedButton.d.ts.map +1 -0
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
- package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -1
- package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.d.ts +2 -9
- package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.web.d.ts +3 -0
- package/lib/typescript/src/components/Touchable.web.d.ts.map +1 -0
- package/lib/typescript/src/mappings/Button.d.ts +4 -113
- package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Touchable.d.ts +22 -0
- package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/Button.js +11 -18
- package/src/components/Button.tsx +11 -45
- package/src/components/Checkbox/Checkbox.js +3 -2
- package/src/components/Checkbox/Checkbox.tsx +7 -5
- package/src/components/DatePicker/DatePicker.js +2 -2
- package/src/components/DatePicker/DatePicker.tsx +6 -0
- package/src/components/DatePicker/DatePickerComponent.js +3 -3
- package/src/components/DatePicker/DatePickerComponent.tsx +6 -0
- package/src/components/DatePicker/DatePickerComponentType.ts +2 -0
- package/src/components/DeprecatedButton.js +95 -0
- package/src/components/DeprecatedButton.tsx +214 -0
- package/src/components/DeprecatedCardWrapper.js +2 -2
- package/src/components/DeprecatedCardWrapper.tsx +4 -3
- package/src/components/DeprecatedFAB.js +3 -2
- package/src/components/DeprecatedFAB.tsx +5 -5
- package/src/components/Picker/Picker.js +4 -3
- package/src/components/Picker/Picker.tsx +4 -4
- package/src/components/Picker/PickerComponent.ios.js +1 -1
- package/src/components/Picker/PickerComponent.ios.tsx +1 -1
- package/src/components/Touchable.js +11 -16
- package/src/components/Touchable.tsx +11 -42
- package/src/components/Touchable.web.js +2 -0
- package/src/components/Touchable.web.tsx +3 -0
- package/src/mappings/Button.js +10 -13
- package/src/mappings/Button.ts +10 -13
- package/src/mappings/Touchable.js +17 -0
- package/src/mappings/Touchable.ts +23 -0
- package/lib/commonjs/components/Pressable.js +0 -48
- package/lib/commonjs/mappings/Pressable.js +0 -34
- package/lib/module/components/Pressable.js +0 -40
- package/lib/module/mappings/Pressable.js +0 -27
- package/lib/typescript/src/components/Pressable.d.ts +0 -18
- package/lib/typescript/src/components/Pressable.d.ts.map +0 -1
- package/lib/typescript/src/mappings/Pressable.d.ts +0 -76
- package/lib/typescript/src/mappings/Pressable.d.ts.map +0 -1
- package/src/components/Pressable.js +0 -17
- package/src/components/Pressable.tsx +0 -67
- package/src/mappings/Pressable.js +0 -34
- package/src/mappings/Pressable.ts +0 -42
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { ActivityIndicator, View, Text, StyleSheet } from "react-native";
|
|
4
|
+
import color from "color";
|
|
5
|
+
import Config from "./Config";
|
|
6
|
+
import Touchable from "./Touchable";
|
|
7
|
+
import Elevation from "./Elevation";
|
|
8
|
+
import { withTheme } from "../theming";
|
|
9
|
+
const Button = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
Icon,
|
|
12
|
+
icon,
|
|
13
|
+
disabled = false,
|
|
14
|
+
type = "solid",
|
|
15
|
+
loading = false,
|
|
16
|
+
labelColor,
|
|
17
|
+
color: colorOverride,
|
|
18
|
+
children,
|
|
19
|
+
onPress,
|
|
20
|
+
elevation = 0,
|
|
21
|
+
style,
|
|
22
|
+
theme: {
|
|
23
|
+
colors,
|
|
24
|
+
disabledOpacity,
|
|
25
|
+
roundness,
|
|
26
|
+
typography
|
|
27
|
+
},
|
|
28
|
+
...rest
|
|
29
|
+
} = _ref;
|
|
30
|
+
let backgroundColor, borderColor, textColor, borderWidth;
|
|
31
|
+
const buttonColor = colorOverride || colors.primary;
|
|
32
|
+
if (type === "solid") {
|
|
33
|
+
backgroundColor = buttonColor;
|
|
34
|
+
if (disabled) {
|
|
35
|
+
textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();
|
|
36
|
+
} else {
|
|
37
|
+
textColor = labelColor || colors.surface;
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
backgroundColor = "transparent";
|
|
41
|
+
if (disabled) {
|
|
42
|
+
textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
43
|
+
} else {
|
|
44
|
+
textColor = labelColor || buttonColor;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (type === "outline") {
|
|
48
|
+
if (disabled) {
|
|
49
|
+
borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
50
|
+
} else {
|
|
51
|
+
borderColor = buttonColor;
|
|
52
|
+
}
|
|
53
|
+
borderWidth = StyleSheet.hairlineWidth;
|
|
54
|
+
} else {
|
|
55
|
+
borderColor = "transparent";
|
|
56
|
+
borderWidth = 0;
|
|
57
|
+
}
|
|
58
|
+
const buttonStyle = {
|
|
59
|
+
backgroundColor,
|
|
60
|
+
borderColor,
|
|
61
|
+
borderWidth,
|
|
62
|
+
borderRadius: roundness
|
|
63
|
+
};
|
|
64
|
+
const textStyle = {
|
|
65
|
+
textAlign: "center",
|
|
66
|
+
color: textColor,
|
|
67
|
+
marginVertical: 16,
|
|
68
|
+
marginHorizontal: 16
|
|
69
|
+
};
|
|
70
|
+
const iconStyle = [styles.icon, {
|
|
71
|
+
marginLeft: 16,
|
|
72
|
+
marginRight: -8,
|
|
73
|
+
width: Config.buttonIconSize
|
|
74
|
+
}];
|
|
75
|
+
const {
|
|
76
|
+
margin,
|
|
77
|
+
marginEnd,
|
|
78
|
+
marginTop,
|
|
79
|
+
marginLeft,
|
|
80
|
+
marginRight,
|
|
81
|
+
marginBottom,
|
|
82
|
+
marginHorizontal,
|
|
83
|
+
marginVertical,
|
|
84
|
+
...innerStyles
|
|
85
|
+
} = StyleSheet.flatten(style || {});
|
|
86
|
+
const margins = {
|
|
87
|
+
margin,
|
|
88
|
+
marginEnd,
|
|
89
|
+
marginTop,
|
|
90
|
+
marginLeft,
|
|
91
|
+
marginRight,
|
|
92
|
+
marginBottom,
|
|
93
|
+
marginHorizontal,
|
|
94
|
+
marginVertical
|
|
95
|
+
};
|
|
96
|
+
return /*#__PURE__*/React.createElement(Elevation, {
|
|
97
|
+
style: {
|
|
98
|
+
elevation,
|
|
99
|
+
alignSelf: "stretch",
|
|
100
|
+
...margins
|
|
101
|
+
}
|
|
102
|
+
}, /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
|
|
103
|
+
onPress: onPress,
|
|
104
|
+
accessibilityState: {
|
|
105
|
+
disabled
|
|
106
|
+
},
|
|
107
|
+
accessibilityRole: "button",
|
|
108
|
+
disabled: disabled || loading,
|
|
109
|
+
style: [styles.button, buttonStyle, innerStyles]
|
|
110
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
111
|
+
style: styles.content
|
|
112
|
+
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
113
|
+
style: iconStyle
|
|
114
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
115
|
+
name: icon,
|
|
116
|
+
size: Config.buttonIconSize,
|
|
117
|
+
color: textColor
|
|
118
|
+
})) : null, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
119
|
+
size: "small",
|
|
120
|
+
color: textColor,
|
|
121
|
+
style: iconStyle
|
|
122
|
+
}) : null, /*#__PURE__*/React.createElement(Text, {
|
|
123
|
+
numberOfLines: 1,
|
|
124
|
+
style: [textStyle, typography.button]
|
|
125
|
+
}, children))));
|
|
126
|
+
};
|
|
127
|
+
const styles = StyleSheet.create({
|
|
128
|
+
button: {
|
|
129
|
+
minWidth: 64,
|
|
130
|
+
borderStyle: "solid"
|
|
131
|
+
},
|
|
132
|
+
content: {
|
|
133
|
+
flexDirection: "row",
|
|
134
|
+
alignItems: "center",
|
|
135
|
+
justifyContent: "center"
|
|
136
|
+
},
|
|
137
|
+
icon: {
|
|
138
|
+
width: Config.buttonIconSize
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
export default withTheme(Button);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { withTheme } from "../theming";
|
|
4
|
-
import
|
|
4
|
+
import Touchable from "./Touchable";
|
|
5
5
|
const getWidth = numColumns => {
|
|
6
6
|
switch (numColumns) {
|
|
7
7
|
case 1:
|
|
@@ -21,7 +21,7 @@ const Card = _ref => {
|
|
|
21
21
|
...rest
|
|
22
22
|
} = _ref;
|
|
23
23
|
const width = getWidth(numColumns);
|
|
24
|
-
return /*#__PURE__*/React.createElement(
|
|
24
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({
|
|
25
25
|
disabled: !onPress,
|
|
26
26
|
onPress: onPress,
|
|
27
27
|
style: [style, {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import * as React from "react";
|
|
3
|
-
import { ActivityIndicator, View, StyleSheet
|
|
2
|
+
import { ActivityIndicator, View, StyleSheet } from "react-native";
|
|
4
3
|
import color from "color";
|
|
5
4
|
import Config from "./Config";
|
|
6
5
|
import Text from "./Text";
|
|
6
|
+
import Touchable from "./Touchable";
|
|
7
7
|
import Elevation from "./Elevation";
|
|
8
8
|
import { withTheme } from "../theming";
|
|
9
9
|
const FAB = _ref => {
|
|
@@ -97,7 +97,8 @@ const FAB = _ref => {
|
|
|
97
97
|
style: [{
|
|
98
98
|
elevation
|
|
99
99
|
}, style]
|
|
100
|
-
}, /*#__PURE__*/React.createElement(
|
|
100
|
+
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
101
|
+
...rest,
|
|
101
102
|
onPress: onPress,
|
|
102
103
|
accessibilityState: {
|
|
103
104
|
disabled
|
|
@@ -105,7 +106,7 @@ const FAB = _ref => {
|
|
|
105
106
|
accessibilityRole: "button",
|
|
106
107
|
disabled: disabled || loading,
|
|
107
108
|
style: buttonStyles
|
|
108
|
-
}
|
|
109
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
109
110
|
style: styles.content
|
|
110
111
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
111
112
|
style: iconStyle
|
|
@@ -144,4 +145,24 @@ const styles = StyleSheet.create({
|
|
|
144
145
|
borderRadius: 0
|
|
145
146
|
}
|
|
146
147
|
});
|
|
148
|
+
export default withTheme(FAB);le: "solid"
|
|
149
|
+
},
|
|
150
|
+
content: {
|
|
151
|
+
flexDirection: "row",
|
|
152
|
+
alignItems: "center",
|
|
153
|
+
justifyContent: "center"
|
|
154
|
+
},
|
|
155
|
+
icon: {
|
|
156
|
+
alignItems: "center",
|
|
157
|
+
justifyContent: "center",
|
|
158
|
+
width: Config.buttonIconSize
|
|
159
|
+
},
|
|
160
|
+
fixed: {
|
|
161
|
+
left: 0,
|
|
162
|
+
right: 0,
|
|
163
|
+
bottom: 0,
|
|
164
|
+
height: 64,
|
|
165
|
+
borderRadius: 0
|
|
166
|
+
}
|
|
167
|
+
});
|
|
147
168
|
export default withTheme(FAB);
|
|
@@ -1,7 +1,24 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { StyleSheet, View } from "react-native";
|
|
4
3
|
import { withTheme } from "../theming";
|
|
4
|
+
const Divider = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
style,
|
|
7
|
+
color,
|
|
8
|
+
theme: {
|
|
9
|
+
colors
|
|
10
|
+
},
|
|
11
|
+
...rest
|
|
12
|
+
} = _ref;
|
|
13
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
14
|
+
style: [{
|
|
15
|
+
backgroundColor: color || colors.divider,
|
|
16
|
+
height: StyleSheet.hairlineWidth
|
|
17
|
+
}, style],
|
|
18
|
+
...rest
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export default withTheme(Divider);ing";
|
|
5
22
|
const Divider = _ref => {
|
|
6
23
|
let {
|
|
7
24
|
style,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { Animated, StyleSheet, View } from "react-native";
|
|
4
3
|
import shadow from "../styles/shadow";
|
|
@@ -19,7 +18,20 @@ const Elevation = _ref => {
|
|
|
19
18
|
colors
|
|
20
19
|
} = theme;
|
|
21
20
|
const borderRadius = radius;
|
|
22
|
-
return /*#__PURE__*/React.createElement(Animated.View,
|
|
21
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
22
|
+
...rest,
|
|
23
|
+
style: [{
|
|
24
|
+
borderRadius,
|
|
25
|
+
backgroundColor: colors.surface
|
|
26
|
+
}, elevation ? shadow(elevation) : null, style]
|
|
27
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
28
|
+
style: {
|
|
29
|
+
overflow: "hidden",
|
|
30
|
+
borderRadius
|
|
31
|
+
}
|
|
32
|
+
}, children));
|
|
33
|
+
};
|
|
34
|
+
export default withTheme(Elevation);React.createElement(Animated.View, _extends({}, rest, {
|
|
23
35
|
style: [{
|
|
24
36
|
borderRadius,
|
|
25
37
|
backgroundColor: colors.surface
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { View, StyleSheet, ActivityIndicator, Pressable, Platform } from "react-native";
|
|
4
3
|
import { withTheme } from "../theming";
|
|
@@ -16,7 +15,7 @@ const IconButton = _ref => {
|
|
|
16
15
|
...props
|
|
17
16
|
} = _ref;
|
|
18
17
|
const iconColor = customColor || theme.colors.primary;
|
|
19
|
-
return /*#__PURE__*/React.createElement(Pressable,
|
|
18
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
20
19
|
onPress: onPress,
|
|
21
20
|
disabled: disabled || loading,
|
|
22
21
|
style: _ref2 => {
|
|
@@ -30,8 +29,9 @@ const IconButton = _ref => {
|
|
|
30
29
|
alignItems: "center",
|
|
31
30
|
justifyContent: "center"
|
|
32
31
|
}, style];
|
|
33
|
-
}
|
|
34
|
-
|
|
32
|
+
},
|
|
33
|
+
...props
|
|
34
|
+
}, /*#__PURE__*/React.createElement(View, null, icon && !loading ? /*#__PURE__*/React.createElement(Icon, {
|
|
35
35
|
name: icon,
|
|
36
36
|
size: size - 2,
|
|
37
37
|
color: iconColor
|
|
@@ -52,4 +52,21 @@ const styles = StyleSheet.create({
|
|
|
52
52
|
})
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
+
export default withTheme(IconButton);ement(ActivityIndicator, {
|
|
56
|
+
size: "small",
|
|
57
|
+
color: iconColor
|
|
58
|
+
}) : null));
|
|
59
|
+
};
|
|
60
|
+
const styles = StyleSheet.create({
|
|
61
|
+
container: {
|
|
62
|
+
alignItems: "center",
|
|
63
|
+
justifyContent: "center",
|
|
64
|
+
...Platform.select({
|
|
65
|
+
web: {
|
|
66
|
+
cursor: "pointer",
|
|
67
|
+
userSelect: "none"
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
});
|
|
55
72
|
export default withTheme(IconButton);
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { View } from "react-native";
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
|
|
6
3
|
export function Center(_ref) {
|
|
7
4
|
let {
|
|
8
5
|
width = 240,
|
|
@@ -12,15 +9,16 @@ export function Center(_ref) {
|
|
|
12
9
|
style,
|
|
13
10
|
...rest
|
|
14
11
|
} = _ref;
|
|
15
|
-
return /*#__PURE__*/React.createElement(View,
|
|
12
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
16
13
|
style: [{
|
|
17
14
|
justifyContent: "center",
|
|
18
15
|
alignItems: "center",
|
|
19
16
|
width,
|
|
20
17
|
height,
|
|
21
18
|
backgroundColor: bgColor
|
|
22
|
-
}, style]
|
|
23
|
-
|
|
19
|
+
}, style],
|
|
20
|
+
...rest
|
|
21
|
+
}, children);
|
|
24
22
|
}
|
|
25
23
|
export function Circle(_ref2) {
|
|
26
24
|
let {
|
|
@@ -31,7 +29,7 @@ export function Circle(_ref2) {
|
|
|
31
29
|
...rest
|
|
32
30
|
} = _ref2;
|
|
33
31
|
const borderRadius = 1000;
|
|
34
|
-
return /*#__PURE__*/React.createElement(Center,
|
|
32
|
+
return /*#__PURE__*/React.createElement(Center, {
|
|
35
33
|
width: size,
|
|
36
34
|
height: size,
|
|
37
35
|
bgColor: bgColor,
|
|
@@ -39,8 +37,9 @@ export function Circle(_ref2) {
|
|
|
39
37
|
backgroundColor: bgColor,
|
|
40
38
|
borderRadius,
|
|
41
39
|
overflow: "hidden"
|
|
42
|
-
}]
|
|
43
|
-
|
|
40
|
+
}],
|
|
41
|
+
...rest
|
|
42
|
+
}, children);
|
|
44
43
|
}
|
|
45
44
|
export function Square(_ref3) {
|
|
46
45
|
let {
|
|
@@ -50,12 +49,13 @@ export function Square(_ref3) {
|
|
|
50
49
|
style,
|
|
51
50
|
...rest
|
|
52
51
|
} = _ref3;
|
|
53
|
-
return /*#__PURE__*/React.createElement(Center,
|
|
52
|
+
return /*#__PURE__*/React.createElement(Center, {
|
|
54
53
|
style: style,
|
|
55
54
|
width: size,
|
|
56
55
|
height: size,
|
|
57
|
-
bgColor: bgColor
|
|
58
|
-
|
|
56
|
+
bgColor: bgColor,
|
|
57
|
+
...rest
|
|
58
|
+
}, children);
|
|
59
59
|
}
|
|
60
60
|
export function Row(_ref4) {
|
|
61
61
|
let {
|
|
@@ -65,15 +65,14 @@ export function Row(_ref4) {
|
|
|
65
65
|
style,
|
|
66
66
|
...rest
|
|
67
67
|
} = _ref4;
|
|
68
|
-
return /*#__PURE__*/React.createElement(View,
|
|
69
|
-
style: [style,
|
|
70
|
-
// style goes first b/c we can't override these
|
|
71
|
-
{
|
|
68
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
69
|
+
style: [style, {
|
|
72
70
|
alignItems,
|
|
73
71
|
flexDirection: "row",
|
|
74
72
|
justifyContent: justifyContent
|
|
75
|
-
}]
|
|
76
|
-
|
|
73
|
+
}],
|
|
74
|
+
...rest
|
|
75
|
+
}, children);
|
|
77
76
|
}
|
|
78
77
|
export function Spacer(_ref5) {
|
|
79
78
|
let {
|
|
@@ -85,14 +84,36 @@ export function Spacer(_ref5) {
|
|
|
85
84
|
style,
|
|
86
85
|
...rest
|
|
87
86
|
} = _ref5;
|
|
88
|
-
return /*#__PURE__*/React.createElement(View,
|
|
87
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
89
88
|
style: [style, {
|
|
90
89
|
paddingRight: right,
|
|
91
90
|
paddingTop: top,
|
|
92
91
|
paddingLeft: left,
|
|
93
92
|
paddingBottom: bottom
|
|
94
|
-
}]
|
|
95
|
-
|
|
93
|
+
}],
|
|
94
|
+
...rest
|
|
95
|
+
}, children);
|
|
96
|
+
}
|
|
97
|
+
export function Stack(_ref6) {
|
|
98
|
+
let {
|
|
99
|
+
children,
|
|
100
|
+
justifyContent = "flex-start",
|
|
101
|
+
alignItems = "flex-start",
|
|
102
|
+
style,
|
|
103
|
+
...rest
|
|
104
|
+
} = _ref6;
|
|
105
|
+
return (
|
|
106
|
+
/*#__PURE__*/
|
|
107
|
+
// style must go first since we don't want justifyContent, alignItems overridden
|
|
108
|
+
React.createElement(View, {
|
|
109
|
+
style: [style, {
|
|
110
|
+
justifyContent,
|
|
111
|
+
alignItems
|
|
112
|
+
}],
|
|
113
|
+
...rest
|
|
114
|
+
}, children)
|
|
115
|
+
);
|
|
116
|
+
}hildren);
|
|
96
117
|
}
|
|
97
118
|
export function Stack(_ref6) {
|
|
98
119
|
let {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { View, StyleSheet, Text, Platform, Dimensions
|
|
2
|
+
import { View, StyleSheet, Text, Platform, Dimensions } from "react-native";
|
|
3
3
|
import { omit, pickBy, identity, isObject } from "lodash";
|
|
4
4
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
5
5
|
import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
6
6
|
import { withTheme } from "../../theming";
|
|
7
7
|
import Portal from "../Portal/Portal";
|
|
8
|
-
import
|
|
8
|
+
import Button from "../DeprecatedButton";
|
|
9
|
+
import Touchable from "../Touchable";
|
|
9
10
|
import { extractStyles, extractBorderAndMarginStyles, borderStyleNames, marginStyleNames } from "../../utilities";
|
|
10
11
|
function normalizeOptions(options) {
|
|
11
12
|
if (options.length === 0) {
|
|
@@ -197,7 +198,7 @@ const Picker = _ref => {
|
|
|
197
198
|
/* marginsContainer */
|
|
198
199
|
React.createElement(View, {
|
|
199
200
|
style: [styles.marginsContainer, marginStyles]
|
|
200
|
-
}, /*#__PURE__*/React.createElement(
|
|
201
|
+
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
201
202
|
disabled: disabled,
|
|
202
203
|
onPress: togglePickerVisible,
|
|
203
204
|
style: styles.touchableContainer
|
|
@@ -6,7 +6,7 @@ import omit from "lodash.omit";
|
|
|
6
6
|
import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
7
7
|
import { withTheme } from "../../theming";
|
|
8
8
|
import Portal from "../Portal/Portal";
|
|
9
|
-
import
|
|
9
|
+
import Button from "../DeprecatedButton";
|
|
10
10
|
import TextField from "../TextField";
|
|
11
11
|
import Touchable from "../Touchable";
|
|
12
12
|
import { extractStyles } from "../../utilities";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { View, StyleSheet } from "react-native";
|
|
4
3
|
import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
@@ -8,7 +7,6 @@ import { extractStyles } from "../../utilities";
|
|
|
8
7
|
import TextField from "../TextField";
|
|
9
8
|
import Touchable from "../Touchable";
|
|
10
9
|
const Picker = _ref => {
|
|
11
|
-
var _options$find$label, _options$find;
|
|
12
10
|
let {
|
|
13
11
|
style,
|
|
14
12
|
options,
|
|
@@ -18,6 +16,7 @@ const Picker = _ref => {
|
|
|
18
16
|
onValueChange: onValueChangeOverride = () => {},
|
|
19
17
|
...props
|
|
20
18
|
} = _ref;
|
|
19
|
+
var _a, _b;
|
|
21
20
|
const {
|
|
22
21
|
viewStyles: {
|
|
23
22
|
borderRadius,
|
|
@@ -62,7 +61,7 @@ const Picker = _ref => {
|
|
|
62
61
|
};
|
|
63
62
|
|
|
64
63
|
const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
65
|
-
const selectedLabel = selectedValue && ((
|
|
64
|
+
const selectedLabel = selectedValue && ((_b = (_a = options.find(o => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
|
|
66
65
|
return /*#__PURE__*/React.createElement(Touchable, {
|
|
67
66
|
disabled: disabled,
|
|
68
67
|
onPress: toggleFocus,
|
|
@@ -85,6 +84,25 @@ const Picker = _ref => {
|
|
|
85
84
|
label: o.label,
|
|
86
85
|
value: o.value,
|
|
87
86
|
key: o.value
|
|
87
|
+
}))), /*#__PURE__*/React.createElement(View, {
|
|
88
|
+
pointerEvents: "none"
|
|
89
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
90
|
+
...props,
|
|
91
|
+
value: selectedLabel,
|
|
92
|
+
placeholder: placeholder,
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
ref: textField,
|
|
95
|
+
disabled: disabled,
|
|
96
|
+
// @ts-expect-error
|
|
97
|
+
style: stylesWithoutMargin
|
|
98
|
+
}))));
|
|
99
|
+
};
|
|
100
|
+
const styles = StyleSheet.create({
|
|
101
|
+
container: {
|
|
102
|
+
alignSelf: "stretch"
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
export default withTheme(Picker);y: o.value
|
|
88
106
|
}))), /*#__PURE__*/React.createElement(View, {
|
|
89
107
|
pointerEvents: "none"
|
|
90
108
|
}, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
1
|
import * as React from "react";
|
|
5
2
|
import { View, StyleSheet } from "react-native";
|
|
6
3
|
import PortalManager from "./PortalManager";
|
|
7
4
|
export const PortalContext = /*#__PURE__*/React.createContext(null);
|
|
8
|
-
|
|
9
5
|
/**
|
|
10
6
|
* Portal host renders all of its children `Portal` elements.
|
|
11
7
|
* For example, you can wrap a screen in `Portal.Host` to render items above the screen.
|
|
@@ -33,10 +29,10 @@ export const PortalContext = /*#__PURE__*/React.createContext(null);
|
|
|
33
29
|
export default class PortalHost extends React.Component {
|
|
34
30
|
constructor() {
|
|
35
31
|
super(...arguments);
|
|
36
|
-
|
|
32
|
+
this.setManager = manager => {
|
|
37
33
|
this.manager = manager;
|
|
38
|
-
}
|
|
39
|
-
|
|
34
|
+
};
|
|
35
|
+
this.mount = children => {
|
|
40
36
|
const key = this.nextKey++;
|
|
41
37
|
if (this.manager) {
|
|
42
38
|
this.manager.mount(key, children);
|
|
@@ -48,8 +44,8 @@ export default class PortalHost extends React.Component {
|
|
|
48
44
|
});
|
|
49
45
|
}
|
|
50
46
|
return key;
|
|
51
|
-
}
|
|
52
|
-
|
|
47
|
+
};
|
|
48
|
+
this.update = (key, children) => {
|
|
53
49
|
if (this.manager) {
|
|
54
50
|
this.manager.update(key, children);
|
|
55
51
|
} else {
|
|
@@ -66,8 +62,8 @@ export default class PortalHost extends React.Component {
|
|
|
66
62
|
this.queue.push(op);
|
|
67
63
|
}
|
|
68
64
|
}
|
|
69
|
-
}
|
|
70
|
-
|
|
65
|
+
};
|
|
66
|
+
this.unmount = key => {
|
|
71
67
|
if (this.manager) {
|
|
72
68
|
this.manager.unmount(key);
|
|
73
69
|
} else {
|
|
@@ -76,10 +72,9 @@ export default class PortalHost extends React.Component {
|
|
|
76
72
|
key
|
|
77
73
|
});
|
|
78
74
|
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
_defineProperty(this, "manager", void 0);
|
|
75
|
+
};
|
|
76
|
+
this.nextKey = 0;
|
|
77
|
+
this.queue = [];
|
|
83
78
|
}
|
|
84
79
|
componentDidMount() {
|
|
85
80
|
const manager = this.manager;
|
|
@@ -117,6 +112,41 @@ export default class PortalHost extends React.Component {
|
|
|
117
112
|
}));
|
|
118
113
|
}
|
|
119
114
|
}
|
|
115
|
+
PortalHost.displayName = "Portal.Host";
|
|
116
|
+
const styles = StyleSheet.create({
|
|
117
|
+
container: {
|
|
118
|
+
flex: 1
|
|
119
|
+
}
|
|
120
|
+
}); switch (action.type) {
|
|
121
|
+
case "mount":
|
|
122
|
+
manager.mount(action.key, action.children);
|
|
123
|
+
break;
|
|
124
|
+
case "update":
|
|
125
|
+
manager.update(action.key, action.children);
|
|
126
|
+
break;
|
|
127
|
+
case "unmount":
|
|
128
|
+
manager.unmount(action.key);
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
render() {
|
|
135
|
+
return /*#__PURE__*/React.createElement(PortalContext.Provider, {
|
|
136
|
+
value: {
|
|
137
|
+
mount: this.mount,
|
|
138
|
+
update: this.update,
|
|
139
|
+
unmount: this.unmount
|
|
140
|
+
}
|
|
141
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
142
|
+
style: styles.container,
|
|
143
|
+
collapsable: false,
|
|
144
|
+
pointerEvents: "box-none"
|
|
145
|
+
}, this.props.children), /*#__PURE__*/React.createElement(PortalManager, {
|
|
146
|
+
ref: this.setManager
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
120
150
|
_defineProperty(PortalHost, "displayName", "Portal.Host");
|
|
121
151
|
const styles = StyleSheet.create({
|
|
122
152
|
container: {
|