@draftbit/core 46.2.4-8c832d.5 → 46.2.4-8ee341.5
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/BottomSheet/BottomSheet.native.js +68 -0
- package/lib/commonjs/components/BottomSheet/BottomSheet.web.js +97 -0
- package/lib/commonjs/components/BottomSheet/index.js +15 -0
- package/lib/commonjs/components/BottomSheet/types.js +5 -0
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +24 -6
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/CircularProgress.js +15 -7
- package/lib/commonjs/components/Config.js +1 -1
- package/lib/commonjs/components/SVG.js +5 -4
- package/lib/commonjs/components/Slider.js +24 -5
- package/lib/commonjs/components/StarRating.js +0 -1
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/mappings/BottomSheet.js +22 -0
- package/lib/commonjs/mappings/SVG.js +1 -3
- package/lib/module/components/BottomSheet/BottomSheet.native.js +50 -0
- package/lib/module/components/BottomSheet/BottomSheet.web.js +82 -0
- package/lib/module/components/BottomSheet/index.js +2 -0
- package/lib/module/components/BottomSheet/types.js +1 -0
- package/lib/module/components/Button.js +32 -11
- package/lib/module/components/CircleImage.js +17 -2
- package/lib/module/components/Config.js +1 -1
- package/lib/module/components/FAB.js +23 -5
- package/lib/module/components/Image.js +18 -3
- package/lib/module/components/Layout.js +43 -21
- package/lib/module/components/SVG.js +5 -4
- package/lib/module/components/StarRating.js +0 -1
- package/lib/module/components/Switch.js +23 -10
- package/lib/module/index.js +1 -0
- package/lib/module/mappings/BottomSheet.js +13 -0
- package/lib/module/mappings/SVG.js +2 -4
- package/lib/typescript/src/components/BottomSheet/BottomSheet.native.d.ts +4 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheet.web.d.ts +4 -0
- package/lib/typescript/src/components/BottomSheet/index.d.ts +1 -0
- package/lib/typescript/src/components/BottomSheet/types.d.ts +8 -0
- package/lib/typescript/src/components/SVG.d.ts +2 -2
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/mappings/SVG.d.ts +0 -2
- package/package.json +3 -3
- package/src/components/BottomSheet/BottomSheet.native.js +37 -0
- package/src/components/BottomSheet/BottomSheet.native.tsx +60 -0
- package/src/components/BottomSheet/BottomSheet.web.js +56 -0
- package/src/components/BottomSheet/BottomSheet.web.tsx +90 -0
- package/src/components/BottomSheet/index.js +2 -0
- package/src/components/BottomSheet/index.tsx +2 -0
- package/src/components/BottomSheet/types.js +1 -0
- package/src/components/BottomSheet/types.tsx +8 -0
- package/src/components/Config.js +1 -1
- package/src/components/Config.ts +1 -1
- package/src/components/SVG.js +5 -4
- package/src/components/SVG.tsx +7 -7
- package/src/components/StarRating.js +0 -1
- package/src/components/StarRating.tsx +0 -1
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/BottomSheet.js +25 -0
- package/src/mappings/SVG.js +2 -9
- package/src/mappings/SVG.ts +2 -13
|
@@ -1,5 +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
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
2
|
import { Text, Pressable, Platform, StyleSheet, ActivityIndicator } from "react-native";
|
|
5
3
|
import { withTheme } from "../theming";
|
|
@@ -57,7 +55,7 @@ function Base(_ref) {
|
|
|
57
55
|
buttonStyles.justifyContent = "flex-end";
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
return /*#__PURE__*/React.createElement(Pressable,
|
|
58
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
61
59
|
onPress: onPress,
|
|
62
60
|
disabled: disabled || loading,
|
|
63
61
|
style: _ref2 => {
|
|
@@ -67,8 +65,9 @@ function Base(_ref) {
|
|
|
67
65
|
return [styles.base, {
|
|
68
66
|
opacity: pressed || disabled ? 0.75 : 1
|
|
69
67
|
}, buttonStyles];
|
|
70
|
-
}
|
|
71
|
-
|
|
68
|
+
},
|
|
69
|
+
...props
|
|
70
|
+
}, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
72
71
|
size: "small",
|
|
73
72
|
color: color,
|
|
74
73
|
style: styles.loading
|
|
@@ -88,13 +87,14 @@ const Solid = _ref3 => {
|
|
|
88
87
|
theme,
|
|
89
88
|
...props
|
|
90
89
|
} = _ref3;
|
|
91
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
90
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
92
91
|
style: [{
|
|
93
92
|
color: "#FFF",
|
|
94
93
|
borderRadius: theme.roundness,
|
|
95
94
|
backgroundColor: theme.colors.primary
|
|
96
|
-
}, style]
|
|
97
|
-
|
|
95
|
+
}, style],
|
|
96
|
+
...props
|
|
97
|
+
});
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
const ButtonSolid = withTheme(Solid);
|
|
@@ -106,13 +106,14 @@ const Outline = _ref4 => {
|
|
|
106
106
|
theme,
|
|
107
107
|
...props
|
|
108
108
|
} = _ref4;
|
|
109
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
109
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
110
110
|
style: [styles.outline, {
|
|
111
111
|
borderRadius: theme.roundness,
|
|
112
112
|
borderColor: theme.colors.primary,
|
|
113
113
|
color: theme.colors.primary
|
|
114
|
-
}, style]
|
|
115
|
-
|
|
114
|
+
}, style],
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
116
117
|
};
|
|
117
118
|
|
|
118
119
|
const ButtonOutline = withTheme(Outline);
|
|
@@ -159,4 +160,24 @@ const styles = StyleSheet.create({
|
|
|
159
160
|
}
|
|
160
161
|
})
|
|
161
162
|
}
|
|
163
|
+
});ndColor: "transparent",
|
|
164
|
+
padding: 0,
|
|
165
|
+
minHeight: undefined
|
|
166
|
+
},
|
|
167
|
+
loading: {
|
|
168
|
+
marginRight: 6
|
|
169
|
+
},
|
|
170
|
+
icon: { ...Platform.select({
|
|
171
|
+
web: {
|
|
172
|
+
marginTop: 1,
|
|
173
|
+
marginRight: 4,
|
|
174
|
+
alignSelf: "center"
|
|
175
|
+
},
|
|
176
|
+
default: {
|
|
177
|
+
marginBottom: 2,
|
|
178
|
+
marginRight: 4,
|
|
179
|
+
alignSelf: "center"
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
}
|
|
162
183
|
});
|
|
@@ -1,5 +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
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
2
|
import { Image } from "react-native";
|
|
5
3
|
import Config from "./Config";
|
|
@@ -12,6 +10,23 @@ const CircleImage = _ref => {
|
|
|
12
10
|
...props
|
|
13
11
|
} = _ref;
|
|
14
12
|
const borderRadius = size / 2;
|
|
13
|
+
return /*#__PURE__*/React.createElement(Image, {
|
|
14
|
+
style: [{
|
|
15
|
+
width: size,
|
|
16
|
+
height: size,
|
|
17
|
+
borderRadius
|
|
18
|
+
}, style],
|
|
19
|
+
source: typeof source === "string" ? {
|
|
20
|
+
uri: source
|
|
21
|
+
} : source,
|
|
22
|
+
resizeMode: "cover",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default CircleImage;props
|
|
28
|
+
} = _ref;
|
|
29
|
+
const borderRadius = size / 2;
|
|
15
30
|
return /*#__PURE__*/React.createElement(Image, _extends({
|
|
16
31
|
style: [{
|
|
17
32
|
width: size,
|
|
@@ -54,7 +54,7 @@ export default {
|
|
|
54
54
|
width: size.width,
|
|
55
55
|
height: size.height
|
|
56
56
|
}, "image-placeholder_1"),
|
|
57
|
-
placeholderSvgURL: "https://static.draftbit.com/images/placeholder-
|
|
57
|
+
placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
|
|
58
58
|
squareImageUrl: buildImageUrl({
|
|
59
59
|
width: 100,
|
|
60
60
|
height: 100
|
|
@@ -1,5 +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
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
2
|
import { View, StyleSheet, Pressable, ActivityIndicator, Platform } from "react-native";
|
|
5
3
|
import { withTheme } from "../theming";
|
|
@@ -27,7 +25,7 @@ const FAB = _ref => {
|
|
|
27
25
|
borderRadius: size / 2,
|
|
28
26
|
overflow: "hidden"
|
|
29
27
|
}, style]
|
|
30
|
-
}, /*#__PURE__*/React.createElement(Pressable,
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
31
29
|
onPress: onPress,
|
|
32
30
|
disabled: loading || disabled,
|
|
33
31
|
android_ripple: {
|
|
@@ -45,8 +43,9 @@ const FAB = _ref => {
|
|
|
45
43
|
borderRadius: size / 2,
|
|
46
44
|
backgroundColor
|
|
47
45
|
}];
|
|
48
|
-
}
|
|
49
|
-
|
|
46
|
+
},
|
|
47
|
+
...props
|
|
48
|
+
}, /*#__PURE__*/React.createElement(View, null, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
50
49
|
style: size > 50 ? {
|
|
51
50
|
marginTop: 2,
|
|
52
51
|
marginLeft: 2
|
|
@@ -60,6 +59,25 @@ const FAB = _ref => {
|
|
|
60
59
|
}))));
|
|
61
60
|
};
|
|
62
61
|
|
|
62
|
+
const styles = StyleSheet.create({
|
|
63
|
+
button: {
|
|
64
|
+
backgroundColor: "#5a45ff",
|
|
65
|
+
justifyContent: "center",
|
|
66
|
+
alignItems: "center",
|
|
67
|
+
...Platform.select({
|
|
68
|
+
web: {
|
|
69
|
+
cursor: "pointer",
|
|
70
|
+
userSelect: "none"
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
export default withTheme(FAB); name: iconName,
|
|
76
|
+
size: size,
|
|
77
|
+
color: color
|
|
78
|
+
}))));
|
|
79
|
+
};
|
|
80
|
+
|
|
63
81
|
const styles = StyleSheet.create({
|
|
64
82
|
button: {
|
|
65
83
|
backgroundColor: "#5a45ff",
|
|
@@ -1,5 +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
|
-
|
|
3
1
|
/* README: Internal Image component used for stuff like Card. DO NOT EXPORT! */
|
|
4
2
|
import React from "react";
|
|
5
3
|
import { Image as NativeImage, StyleSheet } from "react-native";
|
|
@@ -64,7 +62,24 @@ const Image = _ref2 => {
|
|
|
64
62
|
height,
|
|
65
63
|
aspectRatio
|
|
66
64
|
}]
|
|
67
|
-
}, /*#__PURE__*/React.createElement(NativeImage,
|
|
65
|
+
}, /*#__PURE__*/React.createElement(NativeImage, { ...props,
|
|
66
|
+
source: imageSource,
|
|
67
|
+
resizeMode: resizeMode,
|
|
68
|
+
style: [style, {
|
|
69
|
+
height: "100%",
|
|
70
|
+
width: "100%"
|
|
71
|
+
}]
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return /*#__PURE__*/React.createElement(NativeImage, { ...props,
|
|
76
|
+
source: source,
|
|
77
|
+
resizeMode: resizeMode,
|
|
78
|
+
style: style
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export default Image;ent(NativeImage, _extends({}, props, {
|
|
68
83
|
source: imageSource,
|
|
69
84
|
resizeMode: resizeMode,
|
|
70
85
|
style: [style, {
|
|
@@ -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
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
|
-
import { View } from "react-native";
|
|
5
|
-
|
|
2
|
+
import { View } from "react-native";
|
|
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,14 +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
|
-
{
|
|
68
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
69
|
+
style: [style, {
|
|
71
70
|
alignItems,
|
|
72
71
|
flexDirection: "row",
|
|
73
72
|
justifyContent: justifyContent
|
|
74
|
-
}]
|
|
75
|
-
|
|
73
|
+
}],
|
|
74
|
+
...rest
|
|
75
|
+
}, children);
|
|
76
76
|
}
|
|
77
77
|
export function Spacer(_ref5) {
|
|
78
78
|
let {
|
|
@@ -84,14 +84,36 @@ export function Spacer(_ref5) {
|
|
|
84
84
|
style,
|
|
85
85
|
...rest
|
|
86
86
|
} = _ref5;
|
|
87
|
-
return /*#__PURE__*/React.createElement(View,
|
|
87
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
88
88
|
style: [style, {
|
|
89
89
|
paddingRight: right,
|
|
90
90
|
paddingTop: top,
|
|
91
91
|
paddingLeft: left,
|
|
92
92
|
paddingBottom: bottom
|
|
93
|
-
}]
|
|
94
|
-
|
|
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
|
+
}dren);
|
|
95
117
|
}
|
|
96
118
|
export function Stack(_ref6) {
|
|
97
119
|
let {
|
|
@@ -5,25 +5,26 @@ import Config from "./Config";
|
|
|
5
5
|
|
|
6
6
|
const SVG = _ref => {
|
|
7
7
|
let {
|
|
8
|
-
source
|
|
8
|
+
source,
|
|
9
9
|
style
|
|
10
10
|
} = _ref;
|
|
11
|
+
let svgSource = source === null || source === undefined ? Config.placeholderSvgURL : source;
|
|
11
12
|
return /*#__PURE__*/React.createElement(React.Fragment, null, Platform.OS === "ios" && /*#__PURE__*/React.createElement(View, {
|
|
12
13
|
style: style
|
|
13
14
|
}, /*#__PURE__*/React.createElement(SvgUri, {
|
|
14
15
|
width: "100%",
|
|
15
16
|
height: "100%",
|
|
16
|
-
uri:
|
|
17
|
+
uri: svgSource
|
|
17
18
|
})), Platform.OS === "android" && /*#__PURE__*/React.createElement(View, {
|
|
18
19
|
style: style
|
|
19
20
|
}, /*#__PURE__*/React.createElement(SvgUri, {
|
|
20
21
|
width: "100%",
|
|
21
22
|
height: "100%",
|
|
22
|
-
uri:
|
|
23
|
+
uri: svgSource
|
|
23
24
|
})), Platform.OS === "web" && /*#__PURE__*/React.createElement(Image, {
|
|
24
25
|
style: style,
|
|
25
26
|
source: {
|
|
26
|
-
uri:
|
|
27
|
+
uri: svgSource
|
|
27
28
|
}
|
|
28
29
|
}));
|
|
29
30
|
};
|
|
@@ -1,5 +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
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
2
|
import { Switch as NativeSwitch } from "react-native";
|
|
5
3
|
import { withTheme } from "../theming";
|
|
@@ -39,23 +37,24 @@ function Switch(_ref) {
|
|
|
39
37
|
setChecked(Boolean(defaultValue));
|
|
40
38
|
}
|
|
41
39
|
}, [defaultValue, previousDefaultValue]);
|
|
42
|
-
return /*#__PURE__*/React.createElement(NativeSwitch,
|
|
40
|
+
return /*#__PURE__*/React.createElement(NativeSwitch, {
|
|
43
41
|
value: checked,
|
|
44
42
|
disabled: disabled,
|
|
45
43
|
trackColor: {
|
|
46
44
|
false: inactiveTrackThemeColor,
|
|
47
45
|
true: activeTrackThemeColor
|
|
48
46
|
},
|
|
49
|
-
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor
|
|
50
|
-
|
|
47
|
+
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor,
|
|
48
|
+
// @ts-ignore react-native-web only
|
|
51
49
|
activeThumbColor: activeThumbThemeColor,
|
|
52
50
|
ios_backgroundColor: inactiveTrackThemeColor,
|
|
53
51
|
style: style,
|
|
54
52
|
onValueChange: bool => {
|
|
55
53
|
setChecked(bool);
|
|
56
54
|
onValueChange && onValueChange(bool);
|
|
57
|
-
}
|
|
58
|
-
|
|
55
|
+
},
|
|
56
|
+
...rest
|
|
57
|
+
});
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
function Row(_ref2) {
|
|
@@ -85,7 +84,7 @@ function Row(_ref2) {
|
|
|
85
84
|
setChecked(defaultValue);
|
|
86
85
|
}
|
|
87
86
|
}, [defaultValue]);
|
|
88
|
-
return /*#__PURE__*/React.createElement(FormRow,
|
|
87
|
+
return /*#__PURE__*/React.createElement(FormRow, {
|
|
89
88
|
disabled: disabled,
|
|
90
89
|
onPress: () => {
|
|
91
90
|
setChecked(!checked);
|
|
@@ -93,8 +92,9 @@ function Row(_ref2) {
|
|
|
93
92
|
},
|
|
94
93
|
label: label,
|
|
95
94
|
direction: direction,
|
|
96
|
-
style: style
|
|
97
|
-
|
|
95
|
+
style: style,
|
|
96
|
+
...rest
|
|
97
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
98
98
|
theme: theme,
|
|
99
99
|
value: checked,
|
|
100
100
|
disabled: disabled,
|
|
@@ -106,6 +106,19 @@ function Row(_ref2) {
|
|
|
106
106
|
}));
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
const SwitchRow = withTheme(Row);
|
|
110
|
+
export { SwitchRow };
|
|
111
|
+
export default withTheme(Switch);me,
|
|
112
|
+
value: checked,
|
|
113
|
+
disabled: disabled,
|
|
114
|
+
onValueChange: onValueChange,
|
|
115
|
+
activeTrackColor: activeTrackColor,
|
|
116
|
+
inactiveTrackColor: inactiveTrackColor,
|
|
117
|
+
activeThumbColor: activeThumbColor,
|
|
118
|
+
inactiveThumbColor: inactiveThumbColor
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
|
|
109
122
|
const SwitchRow = withTheme(Row);
|
|
110
123
|
export { SwitchRow };
|
|
111
124
|
export default withTheme(Switch);
|
package/lib/module/index.js
CHANGED
|
@@ -29,6 +29,7 @@ export { default as Touchable } from "./components/Touchable";
|
|
|
29
29
|
export { AccordionGroup, AccordionItem } from "./components/Accordion";
|
|
30
30
|
export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/ActionSheet";
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
|
+
export { BottomSheet } from "./components/BottomSheet";
|
|
32
33
|
export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
|
|
33
34
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
|
|
34
35
|
/* Deprecated: Fix or Delete! */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createNumberProp, StylesPanelSections } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Bottom Sheet",
|
|
4
|
+
tag: "BotttomSheet",
|
|
5
|
+
category: COMPONENT_TYPES.container,
|
|
6
|
+
stylesPanelSections: [StylesPanelSections.Background, StylesPanelSections.Borders, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Effects],
|
|
7
|
+
props: {
|
|
8
|
+
step: createNumberProp({
|
|
9
|
+
label: "Step",
|
|
10
|
+
description: "Step can be -1, 0, 1, or 2."
|
|
11
|
+
})
|
|
12
|
+
}
|
|
13
|
+
};
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { COMPONENT_TYPES,
|
|
1
|
+
import { COMPONENT_TYPES, createSvgProp } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "SVG",
|
|
4
4
|
tag: "SVG",
|
|
5
5
|
description: "An SVG component",
|
|
6
|
-
packageName: "@draftbit/core",
|
|
7
6
|
category: COMPONENT_TYPES.media,
|
|
8
7
|
layout: {
|
|
9
8
|
width: 100,
|
|
10
9
|
height: 100
|
|
11
10
|
},
|
|
12
|
-
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Position, StylesPanelSections.Effects],
|
|
13
11
|
props: {
|
|
14
|
-
source:
|
|
12
|
+
source: createSvgProp()
|
|
15
13
|
}
|
|
16
14
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BottomSheet } from "./BottomSheet";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { StyleProp, ImageStyle } from "react-native";
|
|
3
3
|
declare type SVGComponentProps = {
|
|
4
4
|
source: string;
|
|
5
5
|
style?: StyleProp<ImageStyle>;
|
|
6
6
|
};
|
|
7
|
-
declare const SVG:
|
|
7
|
+
declare const SVG: ({ source, style }: SVGComponentProps) => JSX.Element;
|
|
8
8
|
export default SVG;
|
|
@@ -29,6 +29,7 @@ export { default as Touchable } from "./components/Touchable";
|
|
|
29
29
|
export { AccordionGroup, AccordionItem } from "./components/Accordion";
|
|
30
30
|
export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
|
+
export { BottomSheet } from "./components/BottomSheet";
|
|
32
33
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
34
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
35
|
export { default as Button } from "./components/DeprecatedButton";
|
|
@@ -2,13 +2,11 @@ export declare const SEED_DATA: {
|
|
|
2
2
|
name: string;
|
|
3
3
|
tag: string;
|
|
4
4
|
description: string;
|
|
5
|
-
packageName: string;
|
|
6
5
|
category: string;
|
|
7
6
|
layout: {
|
|
8
7
|
width: number;
|
|
9
8
|
height: number;
|
|
10
9
|
};
|
|
11
|
-
stylesPanelSections: string[];
|
|
12
10
|
props: {
|
|
13
11
|
source: {
|
|
14
12
|
label: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.2.4-
|
|
3
|
+
"version": "46.2.4-8ee341.5+8ee341bb",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.2.4
|
|
44
|
+
"@draftbit/types": "^46.2.4",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
]
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "8ee341bba70b8281e39312081a26cbd6559838f6"
|
|
84
84
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { useCallback, useMemo, useRef } from "react";
|
|
2
|
+
import { View, StyleSheet } from "react-native";
|
|
3
|
+
import BottomSheet, { BottomSheetView } from "@gorhom/bottom-sheet";
|
|
4
|
+
import { extractStyles } from "../../utilities";
|
|
5
|
+
const BottomSheetComponent = ({ style, children, step, }) => {
|
|
6
|
+
const bottomSheetRef = useRef(null);
|
|
7
|
+
const { viewStyles } = extractStyles(style);
|
|
8
|
+
// variables
|
|
9
|
+
const snapPoints = useMemo(() => ["25%", "50%", "90%"], []);
|
|
10
|
+
// callbacks
|
|
11
|
+
const handleSheetChanges = useCallback((index) => {
|
|
12
|
+
console.log("handleSheetChanges", index);
|
|
13
|
+
}, []);
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
var _a;
|
|
16
|
+
if (step === -1) {
|
|
17
|
+
(_a = bottomSheetRef === null || bottomSheetRef === void 0 ? void 0 : bottomSheetRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
18
|
+
}
|
|
19
|
+
}, [step]);
|
|
20
|
+
return (React.createElement(View, { style: [
|
|
21
|
+
containerStyle.container,
|
|
22
|
+
viewStyles,
|
|
23
|
+
{ backgroundColor: step !== -1 ? "grey" : "transparent" },
|
|
24
|
+
] },
|
|
25
|
+
React.createElement(BottomSheet, { ref: bottomSheetRef, index: step, snapPoints: snapPoints, onChange: handleSheetChanges },
|
|
26
|
+
React.createElement(BottomSheetView, null, children))));
|
|
27
|
+
};
|
|
28
|
+
export default BottomSheetComponent;
|
|
29
|
+
const containerStyle = StyleSheet.create({
|
|
30
|
+
container: {
|
|
31
|
+
flex: 1,
|
|
32
|
+
},
|
|
33
|
+
contentContainer: {
|
|
34
|
+
flex: 1,
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
},
|
|
37
|
+
});
|