@draftbit/core 46.10.3-177666.2 → 46.10.3-17bcb4.2
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/AvatarEdit.js +15 -4
- package/lib/commonjs/components/Banner.js +23 -4
- package/lib/commonjs/components/Checkbox/Checkbox.js +3 -4
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
- package/lib/commonjs/components/CircularProgress.js +26 -8
- package/lib/commonjs/components/DeprecatedButton.js +20 -3
- package/lib/commonjs/components/DeprecatedCardWrapper.js +54 -0
- package/lib/commonjs/components/DeprecatedFAB.js +157 -0
- package/lib/commonjs/components/Elevation.js +14 -2
- package/lib/commonjs/components/FormRow.js +16 -2
- package/lib/commonjs/components/IconButton.js +19 -4
- package/lib/commonjs/components/Layout.js +40 -19
- package/lib/commonjs/components/NumberInput.js +12 -3
- package/lib/commonjs/components/Picker/Picker.js +9 -6
- package/lib/commonjs/components/Picker/PickerComponent.web.js +20 -3
- package/lib/commonjs/components/Portal/Portal.js +27 -3
- package/lib/commonjs/components/Portal/PortalHost.js +44 -15
- package/lib/commonjs/components/Pressable.js +15 -2
- package/lib/commonjs/components/ProgressIndicator.js +55 -0
- package/lib/commonjs/components/RadioButton/RadioButton.js +13 -2
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +15 -2
- package/lib/commonjs/components/RadioButton/context.js +1 -1
- package/lib/commonjs/components/ResizeMode.js +5 -0
- package/lib/commonjs/components/ScreenContainer.js +24 -6
- package/lib/commonjs/components/Slider.js +21 -4
- package/lib/commonjs/components/StarRating.js +23 -4
- package/lib/commonjs/components/StepIndicator.js +57 -18
- package/lib/commonjs/components/Surface.js +14 -2
- package/lib/commonjs/components/Switch.js +19 -10
- package/lib/commonjs/components/ToggleButton.js +15 -2
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/hooks.js +1 -2
- package/lib/commonjs/mappings/CardBlock.js +126 -0
- package/lib/commonjs/mappings/CardContainer.js +108 -0
- package/lib/commonjs/mappings/CardContainerRating.js +130 -0
- package/lib/commonjs/mappings/CardContainerShortImage.js +124 -0
- package/lib/commonjs/mappings/CardInline.js +59 -0
- package/lib/commonjs/mappings/HeaderLarge.js +34 -0
- package/lib/commonjs/mappings/HeaderMedium.js +60 -0
- package/lib/commonjs/mappings/HeaderOverline.js +60 -0
- package/lib/commonjs/mappings/ProgressIndicator.js +188 -0
- package/lib/commonjs/styles/overlay.js +1 -3
- package/lib/module/components/Accordion/AccordionItem.js +4 -25
- package/lib/module/components/AnimatedCircularProgress.js +13 -1
- package/lib/module/components/AvatarEdit.js +15 -4
- package/lib/module/components/Banner.js +25 -4
- package/lib/module/components/Button.js +33 -10
- package/lib/module/components/Checkbox/CheckboxGroup.js +16 -2
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +24 -5
- package/lib/module/components/Checkbox/CheckboxRow.js +24 -6
- package/lib/module/components/DatePicker/DatePicker.js +27 -13
- package/lib/module/components/DeprecatedCardWrapper.js +32 -0
- package/lib/module/components/DeprecatedFAB.js +167 -0
- package/lib/module/components/Divider.js +18 -1
- package/lib/module/components/Layout.js +42 -21
- package/lib/module/components/Picker/PickerComponent.android.js +21 -3
- package/lib/module/components/Portal/PortalConsumer.js +22 -7
- package/lib/module/components/ProgressIndicator.js +45 -0
- package/lib/module/components/RadioButton/RadioButton.js +13 -1
- package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +10 -1
- package/lib/module/components/RadioButton/context.js +1 -1
- package/lib/module/components/ResizeMode.js +1 -0
- package/lib/module/components/StepIndicator.js +58 -18
- package/lib/module/components/Surface.js +15 -1
- package/lib/module/components/Switch.js +21 -10
- package/lib/module/components/TabView/TabView.js +17 -7
- package/lib/module/components/TabView/TabViewItem.js +4 -3
- package/lib/module/components/Table/Table.js +6 -5
- package/lib/module/components/TextField.js +78 -28
- package/lib/module/components/ToggleButton.js +16 -2
- package/lib/module/constants.js +1 -0
- package/lib/module/mappings/CardBlock.js +119 -0
- package/lib/module/mappings/CardContainer.js +101 -0
- package/lib/module/mappings/CardContainerRating.js +123 -0
- package/lib/module/mappings/CardContainerShortImage.js +117 -0
- package/lib/module/mappings/CardInline.js +52 -0
- package/lib/module/mappings/HeaderLarge.js +27 -0
- package/lib/module/mappings/HeaderMedium.js +53 -0
- package/lib/module/mappings/HeaderOverline.js +53 -0
- package/lib/module/mappings/ProgressIndicator.js +181 -0
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts +15 -0
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +1 -0
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +56 -0
- package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -0
- package/lib/typescript/src/components/ProgressIndicator.d.ts +24 -0
- package/lib/typescript/src/components/ProgressIndicator.d.ts.map +1 -0
- package/lib/typescript/src/components/ResizeMode.d.ts +2 -0
- package/lib/typescript/src/components/ResizeMode.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardBlock.d.ts +289 -0
- package/lib/typescript/src/mappings/CardBlock.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardContainer.d.ts +102 -0
- package/lib/typescript/src/mappings/CardContainer.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardContainerRating.d.ts +108 -0
- package/lib/typescript/src/mappings/CardContainerRating.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardContainerShortImage.d.ts +139 -0
- package/lib/typescript/src/mappings/CardContainerShortImage.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardInline.d.ts +62 -0
- package/lib/typescript/src/mappings/CardInline.d.ts.map +1 -0
- package/lib/typescript/src/mappings/HeaderLarge.d.ts +34 -0
- package/lib/typescript/src/mappings/HeaderLarge.d.ts.map +1 -0
- package/lib/typescript/src/mappings/HeaderMedium.d.ts +53 -0
- package/lib/typescript/src/mappings/HeaderMedium.d.ts.map +1 -0
- package/lib/typescript/src/mappings/HeaderOverline.d.ts +53 -0
- package/lib/typescript/src/mappings/HeaderOverline.d.ts.map +1 -0
- package/lib/typescript/src/mappings/ProgressIndicator.d.ts +181 -0
- package/lib/typescript/src/mappings/ProgressIndicator.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/DeprecatedCardWrapper.js +18 -0
- package/src/components/DeprecatedCardWrapper.tsx +46 -0
- package/src/components/DeprecatedFAB.js +114 -0
- package/src/components/DeprecatedFAB.tsx +231 -0
- package/src/components/ProgressIndicator.js +27 -0
- package/src/components/ProgressIndicator.tsx +71 -0
- package/src/components/ResizeMode.js +1 -0
- package/src/components/ResizeMode.ts +7 -0
- package/src/mappings/CardBlock.js +123 -0
- package/src/mappings/CardBlock.ts +136 -0
- package/src/mappings/CardContainer.js +104 -0
- package/src/mappings/CardContainer.ts +116 -0
- package/src/mappings/CardContainerRating.js +126 -0
- package/src/mappings/CardContainerRating.ts +137 -0
- package/src/mappings/CardContainerShortImage.js +120 -0
- package/src/mappings/CardContainerShortImage.ts +130 -0
- package/src/mappings/CardInline.js +52 -0
- package/src/mappings/CardInline.ts +61 -0
- package/src/mappings/HeaderLarge.js +29 -0
- package/src/mappings/HeaderLarge.ts +38 -0
- package/src/mappings/HeaderMedium.js +55 -0
- package/src/mappings/HeaderMedium.ts +63 -0
- package/src/mappings/HeaderOverline.js +55 -0
- package/src/mappings/HeaderOverline.ts +63 -0
- package/src/mappings/ProgressIndicator.js +181 -0
- package/src/mappings/ProgressIndicator.ts +190 -0
|
@@ -1,3 +1,4 @@
|
|
|
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); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { Pressable, StyleSheet, View } from "react-native";
|
|
3
4
|
import Text from "../Text";
|
|
@@ -17,10 +18,9 @@ const AccordionItem = _ref => {
|
|
|
17
18
|
textStyles,
|
|
18
19
|
viewStyles
|
|
19
20
|
} = extractStyles(style);
|
|
20
|
-
return /*#__PURE__*/React.createElement(Pressable, {
|
|
21
|
-
style: [styles.container, viewStyles]
|
|
22
|
-
|
|
23
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
21
|
+
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
22
|
+
style: [styles.container, viewStyles]
|
|
23
|
+
}, rest), /*#__PURE__*/React.createElement(View, {
|
|
24
24
|
style: styles.row
|
|
25
25
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
26
26
|
name: icon,
|
|
@@ -51,25 +51,4 @@ const styles = StyleSheet.create({
|
|
|
51
51
|
justifyContent: "center"
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
export default withTheme(AccordionItem);xtStyles
|
|
55
|
-
}, label))));
|
|
56
|
-
};
|
|
57
|
-
const styles = StyleSheet.create({
|
|
58
|
-
container: {
|
|
59
|
-
padding: 8
|
|
60
|
-
},
|
|
61
|
-
row: {
|
|
62
|
-
flexDirection: "row",
|
|
63
|
-
alignItems: "center",
|
|
64
|
-
paddingLeft: 8
|
|
65
|
-
},
|
|
66
|
-
item: {
|
|
67
|
-
marginVertical: 6,
|
|
68
|
-
paddingLeft: 8
|
|
69
|
-
},
|
|
70
|
-
content: {
|
|
71
|
-
flex: 1,
|
|
72
|
-
justifyContent: "center"
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
54
|
export default withTheme(AccordionItem);
|
|
@@ -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, Easing } from "react-native";
|
|
4
3
|
import CircularProgress from "./CircularProgress";
|
|
@@ -46,6 +45,19 @@ const AnimatedCircularProgress = _ref => {
|
|
|
46
45
|
React.useEffect(() => {
|
|
47
46
|
animate();
|
|
48
47
|
}, [fill, animate]);
|
|
48
|
+
return /*#__PURE__*/React.createElement(AnimatedProgress, {
|
|
49
|
+
...other,
|
|
50
|
+
style: other.style,
|
|
51
|
+
childrenContainerStyle: other.childrenContainerStyle,
|
|
52
|
+
fill: fillAnimation,
|
|
53
|
+
tintColor: animateColor()
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
export default AnimatedCircularProgress;imation;
|
|
57
|
+
};
|
|
58
|
+
React.useEffect(() => {
|
|
59
|
+
animate();
|
|
60
|
+
}, [fill, animate]);
|
|
49
61
|
return /*#__PURE__*/React.createElement(AnimatedProgress, _extends({}, other, {
|
|
50
62
|
style: other.style,
|
|
51
63
|
childrenContainerStyle: other.childrenContainerStyle,
|
|
@@ -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 } from "react-native";
|
|
4
3
|
import Touchable from "./Touchable";
|
|
@@ -23,9 +22,10 @@ const AvatarEdit = _ref => {
|
|
|
23
22
|
width: size,
|
|
24
23
|
height: size
|
|
25
24
|
};
|
|
26
|
-
return /*#__PURE__*/React.createElement(View,
|
|
27
|
-
style: [style, dimensions]
|
|
28
|
-
|
|
25
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
26
|
+
style: [style, dimensions],
|
|
27
|
+
...rest
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
29
29
|
onPress: onPress
|
|
30
30
|
}, /*#__PURE__*/React.createElement(CircleImage, {
|
|
31
31
|
source: image,
|
|
@@ -46,4 +46,15 @@ const AvatarEdit = _ref => {
|
|
|
46
46
|
size: size * (3 / 16)
|
|
47
47
|
}))));
|
|
48
48
|
};
|
|
49
|
+
export default withTheme(AvatarEdit);yles.editBorderColor,
|
|
50
|
+
backgroundColor: colorStyles.editBackgroundColor,
|
|
51
|
+
borderRadius: size * (3 / 16),
|
|
52
|
+
padding: size * (3 / 32)
|
|
53
|
+
}
|
|
54
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
55
|
+
name: "MaterialIcons/edit",
|
|
56
|
+
color: colorStyles.editIconColor,
|
|
57
|
+
size: size * (3 / 16)
|
|
58
|
+
}))));
|
|
59
|
+
};
|
|
49
60
|
export default withTheme(AvatarEdit);
|
|
@@ -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 { Button, Text, View, StyleSheet, Animated } from "react-native";
|
|
4
3
|
import Surface from "./Surface";
|
|
@@ -61,7 +60,6 @@ const Banner = _ref => {
|
|
|
61
60
|
measured: true
|
|
62
61
|
});
|
|
63
62
|
};
|
|
64
|
-
|
|
65
63
|
// The banner animation has 2 parts:
|
|
66
64
|
// 1. Blank spacer element which animates its height to move the content
|
|
67
65
|
// 2. Actual banner which animates its translateY
|
|
@@ -71,9 +69,10 @@ const Banner = _ref => {
|
|
|
71
69
|
// However we can't animated banner's height directly as it'll also resize the content inside
|
|
72
70
|
const height = Animated.multiply(position, layout.height);
|
|
73
71
|
const translateY = Animated.multiply(Animated.add(position, -1), layout.height);
|
|
74
|
-
return /*#__PURE__*/React.createElement(Surface,
|
|
72
|
+
return /*#__PURE__*/React.createElement(Surface, {
|
|
73
|
+
...rest,
|
|
75
74
|
style: [styles.container, shadow(ELEVATION), style]
|
|
76
|
-
}
|
|
75
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
77
76
|
style: [styles.wrapper, contentStyle]
|
|
78
77
|
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
79
78
|
style: {
|
|
@@ -154,4 +153,26 @@ const styles = StyleSheet.create({
|
|
|
154
153
|
margin: 8
|
|
155
154
|
}
|
|
156
155
|
});
|
|
156
|
+
export default withTheme(Banner);
|
|
157
|
+
},
|
|
158
|
+
content: {
|
|
159
|
+
flexDirection: "row",
|
|
160
|
+
justifyContent: "flex-start",
|
|
161
|
+
marginHorizontal: 8,
|
|
162
|
+
marginTop: 16,
|
|
163
|
+
marginBottom: 0
|
|
164
|
+
},
|
|
165
|
+
icon: {
|
|
166
|
+
margin: 8
|
|
167
|
+
},
|
|
168
|
+
message: {
|
|
169
|
+
flex: 1,
|
|
170
|
+
margin: 8
|
|
171
|
+
},
|
|
172
|
+
actions: {
|
|
173
|
+
flexDirection: "row",
|
|
174
|
+
justifyContent: "flex-end",
|
|
175
|
+
margin: 8
|
|
176
|
+
}
|
|
177
|
+
});
|
|
157
178
|
export default withTheme(Banner);
|
|
@@ -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 { Text, Pressable, Platform, StyleSheet, ActivityIndicator } from "react-native";
|
|
4
3
|
import { withTheme } from "../theming";
|
|
@@ -53,7 +52,7 @@ function Base(_ref) {
|
|
|
53
52
|
if (textAlign === "right") {
|
|
54
53
|
buttonStyles.justifyContent = "flex-end";
|
|
55
54
|
}
|
|
56
|
-
return /*#__PURE__*/React.createElement(Pressable,
|
|
55
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
57
56
|
disabled: disabled || loading,
|
|
58
57
|
style: _ref2 => {
|
|
59
58
|
let {
|
|
@@ -62,8 +61,9 @@ function Base(_ref) {
|
|
|
62
61
|
return [styles.base, {
|
|
63
62
|
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
64
63
|
}, buttonStyles];
|
|
65
|
-
}
|
|
66
|
-
|
|
64
|
+
},
|
|
65
|
+
...props
|
|
66
|
+
}, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
67
67
|
size: "small",
|
|
68
68
|
color: color,
|
|
69
69
|
style: styles.loading
|
|
@@ -82,13 +82,14 @@ const Solid = _ref3 => {
|
|
|
82
82
|
theme,
|
|
83
83
|
...props
|
|
84
84
|
} = _ref3;
|
|
85
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
85
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
86
86
|
style: [{
|
|
87
87
|
color: "#FFF",
|
|
88
88
|
borderRadius: theme.roundness,
|
|
89
89
|
backgroundColor: theme.colors.primary
|
|
90
|
-
}, style]
|
|
91
|
-
|
|
90
|
+
}, style],
|
|
91
|
+
...props
|
|
92
|
+
});
|
|
92
93
|
};
|
|
93
94
|
const ButtonSolid = withTheme(Solid);
|
|
94
95
|
export { ButtonSolid };
|
|
@@ -100,13 +101,14 @@ const Outline = _ref4 => {
|
|
|
100
101
|
theme,
|
|
101
102
|
...props
|
|
102
103
|
} = _ref4;
|
|
103
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
104
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
104
105
|
style: [styles.outline, {
|
|
105
106
|
borderRadius: theme.roundness,
|
|
106
107
|
borderColor: theme.colors.primary,
|
|
107
108
|
color: theme.colors.primary
|
|
108
|
-
}, style]
|
|
109
|
-
|
|
109
|
+
}, style],
|
|
110
|
+
...props
|
|
111
|
+
});
|
|
110
112
|
};
|
|
111
113
|
const ButtonOutline = withTheme(Outline);
|
|
112
114
|
export { ButtonOutline };
|
|
@@ -153,4 +155,25 @@ const styles = StyleSheet.create({
|
|
|
153
155
|
}
|
|
154
156
|
})
|
|
155
157
|
}
|
|
158
|
+
});or: "transparent",
|
|
159
|
+
padding: 0,
|
|
160
|
+
minHeight: undefined
|
|
161
|
+
},
|
|
162
|
+
loading: {
|
|
163
|
+
marginRight: 6
|
|
164
|
+
},
|
|
165
|
+
icon: {
|
|
166
|
+
...Platform.select({
|
|
167
|
+
web: {
|
|
168
|
+
marginTop: 1,
|
|
169
|
+
marginRight: 4,
|
|
170
|
+
alignSelf: "center"
|
|
171
|
+
},
|
|
172
|
+
default: {
|
|
173
|
+
marginBottom: 2,
|
|
174
|
+
marginRight: 4,
|
|
175
|
+
alignSelf: "center"
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
}
|
|
156
179
|
});
|
|
@@ -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 } from "react-native";
|
|
4
3
|
import { checkboxGroupContext, Direction } from "./context";
|
|
@@ -23,7 +22,22 @@ const CheckboxGroup = _ref => {
|
|
|
23
22
|
alignItems: "center"
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
|
-
return /*#__PURE__*/React.createElement(View,
|
|
25
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
26
|
+
style: [{
|
|
27
|
+
minHeight: 40
|
|
28
|
+
}, style],
|
|
29
|
+
...rest
|
|
30
|
+
}, /*#__PURE__*/React.createElement(Provider, {
|
|
31
|
+
value: {
|
|
32
|
+
values,
|
|
33
|
+
onValueChange,
|
|
34
|
+
direction
|
|
35
|
+
}
|
|
36
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
37
|
+
style: _containerStyle
|
|
38
|
+
}, children)));
|
|
39
|
+
};
|
|
40
|
+
export default CheckboxGroup;PURE__*/React.createElement(View, _extends({
|
|
27
41
|
style: [{
|
|
28
42
|
minHeight: 40
|
|
29
43
|
}, 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 { StyleSheet, View, Platform, Pressable } from "react-native";
|
|
4
3
|
import Checkbox from "./Checkbox";
|
|
@@ -6,7 +5,7 @@ import Text from "../Text";
|
|
|
6
5
|
import { useCheckboxGroupContext } from "./context";
|
|
7
6
|
import { Direction as GroupDirection } from "./context";
|
|
8
7
|
import { extractStyles } from "../../utilities";
|
|
9
|
-
export
|
|
8
|
+
export var Direction;
|
|
10
9
|
(function (Direction) {
|
|
11
10
|
Direction["Row"] = "row";
|
|
12
11
|
Direction["RowReverse"] = "row-reverse";
|
|
@@ -63,13 +62,14 @@ const CheckboxGroupRow = _ref => {
|
|
|
63
62
|
textStyles,
|
|
64
63
|
viewStyles
|
|
65
64
|
} = extractStyles(style);
|
|
66
|
-
return /*#__PURE__*/React.createElement(Pressable,
|
|
65
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
67
66
|
onPress: handlePress,
|
|
68
67
|
style: [styles.mainParent, {
|
|
69
68
|
flexDirection: direction
|
|
70
69
|
}, viewStyles],
|
|
71
|
-
disabled: disabled
|
|
72
|
-
|
|
70
|
+
disabled: disabled,
|
|
71
|
+
...rest
|
|
72
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
73
73
|
style: [styles.label, {
|
|
74
74
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
75
75
|
}, labelContainerStyle]
|
|
@@ -107,4 +107,23 @@ const styles = StyleSheet.create({
|
|
|
107
107
|
flex: 3
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
|
+
export default CheckboxGroupRow;reate({
|
|
111
|
+
mainParent: {
|
|
112
|
+
alignItems: "center",
|
|
113
|
+
justifyContent: "space-around",
|
|
114
|
+
paddingStart: 20,
|
|
115
|
+
minHeight: 50,
|
|
116
|
+
paddingEnd: 20,
|
|
117
|
+
display: "flex",
|
|
118
|
+
...Platform.select({
|
|
119
|
+
web: {
|
|
120
|
+
cursor: "pointer",
|
|
121
|
+
userSelect: "none"
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
},
|
|
125
|
+
label: {
|
|
126
|
+
flex: 3
|
|
127
|
+
}
|
|
128
|
+
});
|
|
110
129
|
export default CheckboxGroupRow;
|
|
@@ -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 { StyleSheet, View, Platform, Pressable } from "react-native";
|
|
4
3
|
import { isString } from "lodash";
|
|
@@ -6,7 +5,7 @@ import { extractStyles } from "../../utilities";
|
|
|
6
5
|
import { usePrevious } from "../../hooks";
|
|
7
6
|
import Text from "../Text";
|
|
8
7
|
import Checkbox from "./Checkbox";
|
|
9
|
-
export
|
|
8
|
+
export var Direction;
|
|
10
9
|
(function (Direction) {
|
|
11
10
|
Direction["Row"] = "row";
|
|
12
11
|
Direction["RowReverse"] = "row-reverse";
|
|
@@ -48,7 +47,6 @@ const CheckboxRow = _ref => {
|
|
|
48
47
|
setInternalValue(status);
|
|
49
48
|
}
|
|
50
49
|
}, [status]);
|
|
51
|
-
|
|
52
50
|
// This special logic is to handle weird APIs like Airtable that return
|
|
53
51
|
// true or undefined for a boolean
|
|
54
52
|
const previousDefaultValue = usePrevious(defaultValue);
|
|
@@ -72,13 +70,14 @@ const CheckboxRow = _ref => {
|
|
|
72
70
|
textStyles,
|
|
73
71
|
viewStyles
|
|
74
72
|
} = extractStyles(style);
|
|
75
|
-
return /*#__PURE__*/React.createElement(Pressable,
|
|
73
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
76
74
|
onPress: handlePress,
|
|
77
75
|
style: [viewStyles, styles.mainParent, {
|
|
78
76
|
flexDirection: direction
|
|
79
77
|
}],
|
|
80
|
-
disabled: disabled
|
|
81
|
-
|
|
78
|
+
disabled: disabled,
|
|
79
|
+
...rest
|
|
80
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
82
81
|
style: [styles.label, {
|
|
83
82
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
84
83
|
}, labelContainerStyle]
|
|
@@ -114,4 +113,23 @@ const styles = StyleSheet.create({
|
|
|
114
113
|
flex: 3
|
|
115
114
|
}
|
|
116
115
|
});
|
|
116
|
+
export default CheckboxRow;heet.create({
|
|
117
|
+
mainParent: {
|
|
118
|
+
alignItems: "center",
|
|
119
|
+
justifyContent: "space-around",
|
|
120
|
+
paddingStart: 20,
|
|
121
|
+
minHeight: 50,
|
|
122
|
+
paddingEnd: 20,
|
|
123
|
+
display: "flex",
|
|
124
|
+
...Platform.select({
|
|
125
|
+
web: {
|
|
126
|
+
cursor: "pointer",
|
|
127
|
+
userSelect: "none"
|
|
128
|
+
}
|
|
129
|
+
})
|
|
130
|
+
},
|
|
131
|
+
label: {
|
|
132
|
+
flex: 3
|
|
133
|
+
}
|
|
134
|
+
});
|
|
117
135
|
export default CheckboxRow;
|
|
@@ -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, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput, Keyboard } from "react-native";
|
|
4
3
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
@@ -83,24 +82,20 @@ const DatePicker = _ref => {
|
|
|
83
82
|
focused ? _handleBlur() : _handleFocus();
|
|
84
83
|
};
|
|
85
84
|
const insets = useSafeAreaInsets();
|
|
86
|
-
|
|
87
85
|
// const _restoreLabel = () =>
|
|
88
86
|
// Animated.timing(labeled, {
|
|
89
87
|
// toValue: 1,
|
|
90
88
|
// duration: FOCUS_ANIMATION_DURATION,
|
|
91
89
|
// useNativeDriver: true,
|
|
92
90
|
// }).start();
|
|
93
|
-
|
|
94
91
|
// const _minmizeLabel = () =>
|
|
95
92
|
// Animated.timing(labeled, {
|
|
96
93
|
// toValue: 0,
|
|
97
94
|
// duration: BLUR_ANIMATION_DURATION,
|
|
98
95
|
// useNativeDriver: true,
|
|
99
96
|
// }).start();
|
|
100
|
-
|
|
101
97
|
// const _showPlaceholder = () =>
|
|
102
98
|
// setTimeout(() => setPlaceholder1(placeholder || ""), 50);
|
|
103
|
-
|
|
104
99
|
const _hidePlaceholder = () => {
|
|
105
100
|
setPlaceholder1("");
|
|
106
101
|
};
|
|
@@ -255,9 +250,7 @@ const DatePicker = _ref => {
|
|
|
255
250
|
const inputStyles = [styles.input, inputStyle, type === "solid" ? {
|
|
256
251
|
marginHorizontal: 12
|
|
257
252
|
} : {}];
|
|
258
|
-
|
|
259
253
|
// const render = (props) => <NativeTextInput {...props} />;
|
|
260
|
-
|
|
261
254
|
return /*#__PURE__*/React.createElement(View, {
|
|
262
255
|
style: [styles.container, style]
|
|
263
256
|
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
@@ -267,9 +260,10 @@ const DatePicker = _ref => {
|
|
|
267
260
|
pointerEvents: "none"
|
|
268
261
|
}, /*#__PURE__*/React.createElement(View, {
|
|
269
262
|
style: [styles.container, style]
|
|
270
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon,
|
|
263
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
264
|
+
...leftIconProps,
|
|
271
265
|
style: leftIconStyle
|
|
272
|
-
})
|
|
266
|
+
}) : null, /*#__PURE__*/React.createElement(View, {
|
|
273
267
|
style: [containerStyle, style ? {
|
|
274
268
|
height: style.height
|
|
275
269
|
} : {}, viewStyles]
|
|
@@ -318,12 +312,13 @@ const DatePicker = _ref => {
|
|
|
318
312
|
opacity: hasActiveOutline ? labeled : 1
|
|
319
313
|
}],
|
|
320
314
|
numberOfLines: 1
|
|
321
|
-
}, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon,
|
|
315
|
+
}, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
316
|
+
...leftIconProps,
|
|
322
317
|
style: {
|
|
323
318
|
...leftIconStyle,
|
|
324
319
|
marginLeft: type === "solid" ? 16 : 0
|
|
325
320
|
}
|
|
326
|
-
})
|
|
321
|
+
}) : null, /*#__PURE__*/React.createElement(NativeTextInput, {
|
|
327
322
|
value: formatDate(),
|
|
328
323
|
placeholder: label ? placeholder1 : placeholder,
|
|
329
324
|
editable: !disabled,
|
|
@@ -332,8 +327,9 @@ const DatePicker = _ref => {
|
|
|
332
327
|
onFocus: _handleFocus,
|
|
333
328
|
onBlur: _handleBlur,
|
|
334
329
|
underlineColorAndroid: "transparent",
|
|
335
|
-
style: [inputStyles, textStyles]
|
|
336
|
-
|
|
330
|
+
style: [inputStyles, textStyles],
|
|
331
|
+
...props
|
|
332
|
+
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
337
333
|
name: rightIconName,
|
|
338
334
|
size: ICON_SIZE,
|
|
339
335
|
color: colors.light,
|
|
@@ -404,4 +400,22 @@ const styles = StyleSheet.create({
|
|
|
404
400
|
alignSelf: "flex-end"
|
|
405
401
|
}
|
|
406
402
|
});
|
|
403
|
+
export default withTheme(DatePicker);yContent: "center",
|
|
404
|
+
textAlignVertical: "center",
|
|
405
|
+
margin: 0,
|
|
406
|
+
textAlign: I18nManager.isRTL ? "right" : "left"
|
|
407
|
+
},
|
|
408
|
+
placeholder: {
|
|
409
|
+
position: "absolute",
|
|
410
|
+
left: 0
|
|
411
|
+
},
|
|
412
|
+
pickerContainer: {
|
|
413
|
+
flexDirection: "column",
|
|
414
|
+
width: "100%",
|
|
415
|
+
zIndex: 100
|
|
416
|
+
},
|
|
417
|
+
closeButton: {
|
|
418
|
+
alignSelf: "flex-end"
|
|
419
|
+
}
|
|
420
|
+
});
|
|
407
421
|
export default withTheme(DatePicker);
|
|
@@ -0,0 +1,32 @@
|
|
|
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 React from "react";
|
|
3
|
+
import { withTheme } from "../theming";
|
|
4
|
+
import Touchable from "./Touchable";
|
|
5
|
+
const getWidth = numColumns => {
|
|
6
|
+
switch (numColumns) {
|
|
7
|
+
case 1:
|
|
8
|
+
return "33%";
|
|
9
|
+
case 2:
|
|
10
|
+
return "50%";
|
|
11
|
+
default:
|
|
12
|
+
return "100%";
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const Card = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
numColumns = 3,
|
|
18
|
+
children,
|
|
19
|
+
onPress,
|
|
20
|
+
style,
|
|
21
|
+
...rest
|
|
22
|
+
} = _ref;
|
|
23
|
+
const width = getWidth(numColumns);
|
|
24
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({
|
|
25
|
+
disabled: !onPress,
|
|
26
|
+
onPress: onPress,
|
|
27
|
+
style: [style, {
|
|
28
|
+
width
|
|
29
|
+
}]
|
|
30
|
+
}, rest), children);
|
|
31
|
+
};
|
|
32
|
+
export default withTheme(Card);
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ActivityIndicator, View, StyleSheet, Pressable } from "react-native";
|
|
3
|
+
import color from "color";
|
|
4
|
+
import Config from "./Config";
|
|
5
|
+
import Text from "./Text";
|
|
6
|
+
import Elevation from "./Elevation";
|
|
7
|
+
import { withTheme } from "../theming";
|
|
8
|
+
const FAB = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
Icon,
|
|
11
|
+
icon,
|
|
12
|
+
disabled = false,
|
|
13
|
+
type = "solid",
|
|
14
|
+
loading = false,
|
|
15
|
+
color: colorOverride,
|
|
16
|
+
label,
|
|
17
|
+
onPress,
|
|
18
|
+
elevation = 0,
|
|
19
|
+
style,
|
|
20
|
+
theme: {
|
|
21
|
+
colors,
|
|
22
|
+
disabledOpacity,
|
|
23
|
+
roundness,
|
|
24
|
+
typography
|
|
25
|
+
},
|
|
26
|
+
...rest
|
|
27
|
+
} = _ref;
|
|
28
|
+
let backgroundColor, borderColor, textColor, borderWidth;
|
|
29
|
+
const buttonColor = colorOverride || colors.primary;
|
|
30
|
+
if (type === "standard" || type === "extended" || type === "fixed") {
|
|
31
|
+
backgroundColor = buttonColor;
|
|
32
|
+
if (disabled) {
|
|
33
|
+
textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();
|
|
34
|
+
} else {
|
|
35
|
+
textColor = colors.surface;
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
backgroundColor = "transparent";
|
|
39
|
+
if (disabled) {
|
|
40
|
+
textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
41
|
+
} else {
|
|
42
|
+
textColor = buttonColor;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (type === "outline") {
|
|
46
|
+
if (disabled) {
|
|
47
|
+
borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
48
|
+
} else {
|
|
49
|
+
borderColor = buttonColor;
|
|
50
|
+
}
|
|
51
|
+
borderWidth = StyleSheet.hairlineWidth;
|
|
52
|
+
} else {
|
|
53
|
+
borderColor = "transparent";
|
|
54
|
+
borderWidth = 0;
|
|
55
|
+
}
|
|
56
|
+
const buttonStyle = {
|
|
57
|
+
backgroundColor,
|
|
58
|
+
borderColor,
|
|
59
|
+
borderWidth,
|
|
60
|
+
borderRadius: roundness,
|
|
61
|
+
alignItems: "center",
|
|
62
|
+
justifyContent: "center"
|
|
63
|
+
};
|
|
64
|
+
const buttonStyles = [styles.button, buttonStyle];
|
|
65
|
+
const contentStyle = [styles.content];
|
|
66
|
+
const textStyle = {
|
|
67
|
+
textAlign: "center",
|
|
68
|
+
color: textColor
|
|
69
|
+
};
|
|
70
|
+
const iconStyle = [styles.icon, {
|
|
71
|
+
width: Config.buttonIconSize
|
|
72
|
+
}];
|
|
73
|
+
if (type === "standard" || type === "outline") {
|
|
74
|
+
buttonStyle.width = Config.FABSize;
|
|
75
|
+
buttonStyle.height = Config.FABSize;
|
|
76
|
+
buttonStyle.borderRadius = Config.FABBorderRadius;
|
|
77
|
+
contentStyle.push({
|
|
78
|
+
width: Config.FABSize,
|
|
79
|
+
height: Config.FABSize
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (type === "extended" || type === "fixed") {
|
|
83
|
+
iconStyle.push({
|
|
84
|
+
marginLeft: 16,
|
|
85
|
+
marginRight: -8
|
|
86
|
+
});
|
|
87
|
+
textStyle.margin = 16;
|
|
88
|
+
}
|
|
89
|
+
if (type === "fixed") {
|
|
90
|
+
buttonStyles.push({
|
|
91
|
+
height: Config.FABFixedHeight,
|
|
92
|
+
alignSelf: "stretch"
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return /*#__PURE__*/React.createElement(Elevation, {
|
|
96
|
+
style: [{
|
|
97
|
+
elevation
|
|
98
|
+
}, style]
|
|
99
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
100
|
+
...rest,
|
|
101
|
+
onPress: onPress,
|
|
102
|
+
accessibilityState: {
|
|
103
|
+
disabled
|
|
104
|
+
},
|
|
105
|
+
accessibilityRole: "button",
|
|
106
|
+
disabled: disabled || loading,
|
|
107
|
+
style: buttonStyles
|
|
108
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
109
|
+
style: styles.content
|
|
110
|
+
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
111
|
+
style: iconStyle
|
|
112
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
113
|
+
name: icon,
|
|
114
|
+
size: Config.buttonIconSize,
|
|
115
|
+
color: textColor
|
|
116
|
+
})) : null, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
117
|
+
size: "small",
|
|
118
|
+
color: textColor,
|
|
119
|
+
style: iconStyle
|
|
120
|
+
}) : null, label ? /*#__PURE__*/React.createElement(Text, {
|
|
121
|
+
numberOfLines: 1,
|
|
122
|
+
style: [textStyle, typography.button]
|
|
123
|
+
}, label) : null)));
|
|
124
|
+
};
|
|
125
|
+
const styles = StyleSheet.create({
|
|
126
|
+
button: {
|
|
127
|
+
borderStyle: "solid"
|
|
128
|
+
},
|
|
129
|
+
content: {
|
|
130
|
+
flexDirection: "row",
|
|
131
|
+
alignItems: "center",
|
|
132
|
+
justifyContent: "center"
|
|
133
|
+
},
|
|
134
|
+
icon: {
|
|
135
|
+
alignItems: "center",
|
|
136
|
+
justifyContent: "center",
|
|
137
|
+
width: Config.buttonIconSize
|
|
138
|
+
},
|
|
139
|
+
fixed: {
|
|
140
|
+
left: 0,
|
|
141
|
+
right: 0,
|
|
142
|
+
bottom: 0,
|
|
143
|
+
height: 64,
|
|
144
|
+
borderRadius: 0
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
export default withTheme(FAB);le: "solid"
|
|
148
|
+
},
|
|
149
|
+
content: {
|
|
150
|
+
flexDirection: "row",
|
|
151
|
+
alignItems: "center",
|
|
152
|
+
justifyContent: "center"
|
|
153
|
+
},
|
|
154
|
+
icon: {
|
|
155
|
+
alignItems: "center",
|
|
156
|
+
justifyContent: "center",
|
|
157
|
+
width: Config.buttonIconSize
|
|
158
|
+
},
|
|
159
|
+
fixed: {
|
|
160
|
+
left: 0,
|
|
161
|
+
right: 0,
|
|
162
|
+
bottom: 0,
|
|
163
|
+
height: 64,
|
|
164
|
+
borderRadius: 0
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
export default withTheme(FAB);
|