@draftbit/core 47.0.1-ad0ed2.2 → 47.0.1-b3708e.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/Button.js +3 -3
- package/lib/commonjs/components/Checkbox/Checkbox.js +3 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +2 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +2 -1
- package/lib/commonjs/components/DeprecatedButton.js +27 -3
- package/lib/commonjs/components/DeprecatedFAB.js +2 -1
- package/lib/commonjs/components/Swiper/Swiper.js +2 -0
- package/lib/commonjs/components/Touchable.js +3 -8
- package/lib/commonjs/mappings/Button.js +9 -27
- package/lib/commonjs/mappings/FlashList.js +45 -2
- package/lib/commonjs/mappings/FlatList.js +12 -0
- package/lib/commonjs/mappings/Swiper.js +2 -0
- package/lib/commonjs/mappings/Touchable.js +7 -39
- package/lib/module/components/AnimatedCircularProgress.js +13 -1
- package/lib/module/components/Button.js +3 -3
- package/lib/module/components/Checkbox/Checkbox.js +3 -2
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +3 -2
- package/lib/module/components/Checkbox/CheckboxRow.js +3 -2
- package/lib/module/components/DeprecatedButton.js +28 -4
- package/lib/module/components/DeprecatedFAB.js +3 -2
- package/lib/module/components/Picker/PickerComponent.web.js +21 -3
- package/lib/module/components/Portal/PortalManager.js +33 -7
- package/lib/module/components/Swiper/Swiper.js +2 -0
- package/lib/module/components/Touchable.js +3 -8
- package/lib/module/mappings/Button.js +10 -28
- package/lib/module/mappings/FlashList.js +46 -3
- package/lib/module/mappings/FlatList.js +13 -1
- package/lib/module/mappings/Swiper.js +3 -1
- package/lib/module/mappings/Touchable.js +9 -41
- 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/Checkbox/CheckboxGroupRow.d.ts.map +1 -1
- package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedButton.d.ts +2 -2
- package/lib/typescript/src/components/DeprecatedButton.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/Swiper/Swiper.d.ts +2 -1
- package/lib/typescript/src/components/Swiper/Swiper.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.d.ts +2 -7
- package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Button.d.ts +4 -93
- package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlashList.d.ts +112 -2
- package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlatList.d.ts +42 -0
- package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Swiper.d.ts +11 -0
- package/lib/typescript/src/mappings/Swiper.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Touchable.d.ts +5 -59
- package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/Button.js +3 -3
- package/src/components/Button.tsx +4 -14
- package/src/components/Checkbox/Checkbox.js +3 -2
- package/src/components/Checkbox/Checkbox.tsx +7 -5
- package/src/components/Checkbox/CheckboxGroupRow.js +3 -2
- package/src/components/Checkbox/CheckboxGroupRow.tsx +3 -3
- package/src/components/Checkbox/CheckboxRow.js +3 -2
- package/src/components/Checkbox/CheckboxRow.tsx +3 -3
- package/src/components/DeprecatedButton.js +16 -4
- package/src/components/DeprecatedButton.tsx +31 -7
- package/src/components/DeprecatedFAB.js +3 -2
- package/src/components/DeprecatedFAB.tsx +5 -5
- package/src/components/Swiper/Swiper.js +2 -2
- package/src/components/Swiper/Swiper.tsx +3 -0
- package/src/components/Touchable.js +3 -3
- package/src/components/Touchable.tsx +4 -14
- package/src/mappings/Button.js +9 -27
- package/src/mappings/Button.ts +9 -29
- package/src/mappings/FlashList.js +77 -31
- package/src/mappings/FlashList.ts +82 -30
- package/src/mappings/FlatList.js +13 -1
- package/src/mappings/FlatList.ts +16 -0
- package/src/mappings/Swiper.js +3 -1
- package/src/mappings/Swiper.ts +4 -0
- package/src/mappings/Touchable.js +7 -42
- package/src/mappings/Touchable.ts +6 -46
- package/lib/commonjs/components/Pressable.js +0 -37
- package/lib/module/components/Pressable.js +0 -30
- package/lib/typescript/src/components/Pressable.d.ts +0 -16
- package/lib/typescript/src/components/Pressable.d.ts.map +0 -1
- package/src/components/Pressable.js +0 -12
- package/src/components/Pressable.tsx +0 -50
|
@@ -12,7 +12,6 @@ var _theming = require("../theming");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
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); }
|
|
16
15
|
const AvatarEdit = _ref => {
|
|
17
16
|
let {
|
|
18
17
|
Icon,
|
|
@@ -32,9 +31,10 @@ const AvatarEdit = _ref => {
|
|
|
32
31
|
width: size,
|
|
33
32
|
height: size
|
|
34
33
|
};
|
|
35
|
-
return /*#__PURE__*/React.createElement(_reactNative.View,
|
|
36
|
-
style: [style, dimensions]
|
|
37
|
-
|
|
34
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
35
|
+
style: [style, dimensions],
|
|
36
|
+
...rest
|
|
37
|
+
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
38
38
|
onPress: onPress
|
|
39
39
|
}, /*#__PURE__*/React.createElement(_CircleImage.default, {
|
|
40
40
|
source: image,
|
|
@@ -56,4 +56,15 @@ const AvatarEdit = _ref => {
|
|
|
56
56
|
}))));
|
|
57
57
|
};
|
|
58
58
|
var _default = (0, _theming.withTheme)(AvatarEdit);
|
|
59
|
+
exports.default = _default;r: colorStyles.editBackgroundColor,
|
|
60
|
+
borderRadius: size * (3 / 16),
|
|
61
|
+
padding: size * (3 / 32)
|
|
62
|
+
}
|
|
63
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
64
|
+
name: "MaterialIcons/edit",
|
|
65
|
+
color: colorStyles.editIconColor,
|
|
66
|
+
size: size * (3 / 16)
|
|
67
|
+
}))));
|
|
68
|
+
};
|
|
69
|
+
var _default = (0, _theming.withTheme)(AvatarEdit);
|
|
59
70
|
exports.default = _default;
|
|
@@ -21,11 +21,10 @@ function Base(_ref) {
|
|
|
21
21
|
Icon,
|
|
22
22
|
icon,
|
|
23
23
|
title,
|
|
24
|
+
onPress,
|
|
24
25
|
loading,
|
|
25
26
|
disabled,
|
|
26
27
|
style,
|
|
27
|
-
activeOpacity,
|
|
28
|
-
disabledOpacity,
|
|
29
28
|
...props
|
|
30
29
|
} = _ref;
|
|
31
30
|
const {
|
|
@@ -62,13 +61,14 @@ function Base(_ref) {
|
|
|
62
61
|
buttonStyles.justifyContent = "flex-end";
|
|
63
62
|
}
|
|
64
63
|
return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
|
|
64
|
+
onPress: onPress,
|
|
65
65
|
disabled: disabled || loading,
|
|
66
66
|
style: _ref2 => {
|
|
67
67
|
let {
|
|
68
68
|
pressed
|
|
69
69
|
} = _ref2;
|
|
70
70
|
return [styles.base, {
|
|
71
|
-
opacity: pressed
|
|
71
|
+
opacity: pressed || disabled ? 0.75 : 1
|
|
72
72
|
}, buttonStyles];
|
|
73
73
|
}
|
|
74
74
|
}, props), loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
|
|
@@ -7,7 +7,9 @@ exports.default = void 0;
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _theming = require("../../theming");
|
|
10
|
+
var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
10
11
|
var _hooks = require("../../hooks");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
15
|
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); }
|
|
@@ -58,7 +60,7 @@ const Checkbox = _ref => {
|
|
|
58
60
|
onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
|
|
59
61
|
}
|
|
60
62
|
};
|
|
61
|
-
return /*#__PURE__*/React.createElement(
|
|
63
|
+
return /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
|
|
62
64
|
onPress: handlePress,
|
|
63
65
|
disabled: disabled,
|
|
64
66
|
accessibilityState: {
|
|
@@ -9,6 +9,7 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
10
10
|
var _Text = _interopRequireDefault(require("../Text"));
|
|
11
11
|
var _context = require("./context");
|
|
12
|
+
var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
12
13
|
var _utilities = require("../../utilities");
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -72,7 +73,7 @@ const CheckboxGroupRow = _ref => {
|
|
|
72
73
|
textStyles,
|
|
73
74
|
viewStyles
|
|
74
75
|
} = (0, _utilities.extractStyles)(style);
|
|
75
|
-
return /*#__PURE__*/React.createElement(
|
|
76
|
+
return /*#__PURE__*/React.createElement(_Touchable.default, _extends({
|
|
76
77
|
onPress: handlePress,
|
|
77
78
|
style: [styles.mainParent, {
|
|
78
79
|
flexDirection: direction
|
|
@@ -10,6 +10,7 @@ var _lodash = require("lodash");
|
|
|
10
10
|
var _utilities = require("../../utilities");
|
|
11
11
|
var _hooks = require("../../hooks");
|
|
12
12
|
var _Text = _interopRequireDefault(require("../Text"));
|
|
13
|
+
var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
13
14
|
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -82,7 +83,7 @@ const CheckboxRow = _ref => {
|
|
|
82
83
|
textStyles,
|
|
83
84
|
viewStyles
|
|
84
85
|
} = (0, _utilities.extractStyles)(style);
|
|
85
|
-
return /*#__PURE__*/React.createElement(
|
|
86
|
+
return /*#__PURE__*/React.createElement(_Touchable.default, _extends({
|
|
86
87
|
onPress: handlePress,
|
|
87
88
|
style: [viewStyles, styles.mainParent, {
|
|
88
89
|
flexDirection: direction
|
|
@@ -8,6 +8,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _color = _interopRequireDefault(require("color"));
|
|
10
10
|
var _Config = _interopRequireDefault(require("./Config"));
|
|
11
|
+
var _Touchable = _interopRequireDefault(require("./Touchable"));
|
|
11
12
|
var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
12
13
|
var _theming = require("../theming");
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -26,6 +27,7 @@ const Button = _ref => {
|
|
|
26
27
|
children,
|
|
27
28
|
onPress,
|
|
28
29
|
elevation = 0,
|
|
30
|
+
style,
|
|
29
31
|
theme: {
|
|
30
32
|
colors,
|
|
31
33
|
disabledOpacity,
|
|
@@ -79,19 +81,41 @@ const Button = _ref => {
|
|
|
79
81
|
marginRight: -8,
|
|
80
82
|
width: _Config.default.buttonIconSize
|
|
81
83
|
}];
|
|
84
|
+
const {
|
|
85
|
+
margin,
|
|
86
|
+
marginEnd,
|
|
87
|
+
marginTop,
|
|
88
|
+
marginLeft,
|
|
89
|
+
marginRight,
|
|
90
|
+
marginBottom,
|
|
91
|
+
marginHorizontal,
|
|
92
|
+
marginVertical,
|
|
93
|
+
...innerStyles
|
|
94
|
+
} = _reactNative.StyleSheet.flatten(style || {});
|
|
95
|
+
const margins = {
|
|
96
|
+
margin,
|
|
97
|
+
marginEnd,
|
|
98
|
+
marginTop,
|
|
99
|
+
marginLeft,
|
|
100
|
+
marginRight,
|
|
101
|
+
marginBottom,
|
|
102
|
+
marginHorizontal,
|
|
103
|
+
marginVertical
|
|
104
|
+
};
|
|
82
105
|
return /*#__PURE__*/React.createElement(_Elevation.default, {
|
|
83
106
|
style: {
|
|
84
107
|
elevation,
|
|
85
|
-
alignSelf: "stretch"
|
|
108
|
+
alignSelf: "stretch",
|
|
109
|
+
...margins
|
|
86
110
|
}
|
|
87
|
-
}, /*#__PURE__*/React.createElement(
|
|
111
|
+
}, /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
|
|
88
112
|
onPress: onPress,
|
|
89
113
|
accessibilityState: {
|
|
90
114
|
disabled
|
|
91
115
|
},
|
|
92
116
|
accessibilityRole: "button",
|
|
93
117
|
disabled: disabled || loading,
|
|
94
|
-
style: [styles.button, buttonStyle]
|
|
118
|
+
style: [styles.button, buttonStyle, innerStyles]
|
|
95
119
|
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
96
120
|
style: styles.content
|
|
97
121
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
@@ -9,6 +9,7 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _color = _interopRequireDefault(require("color"));
|
|
10
10
|
var _Config = _interopRequireDefault(require("./Config"));
|
|
11
11
|
var _Text = _interopRequireDefault(require("./Text"));
|
|
12
|
+
var _Touchable = _interopRequireDefault(require("./Touchable"));
|
|
12
13
|
var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
13
14
|
var _theming = require("../theming");
|
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -106,7 +107,7 @@ const FAB = _ref => {
|
|
|
106
107
|
style: [{
|
|
107
108
|
elevation
|
|
108
109
|
}, style]
|
|
109
|
-
}, /*#__PURE__*/React.createElement(
|
|
110
|
+
}, /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
|
|
110
111
|
onPress: onPress,
|
|
111
112
|
accessibilityState: {
|
|
112
113
|
disabled
|
|
@@ -25,6 +25,7 @@ const Swiper = _ref => {
|
|
|
25
25
|
keyExtractor,
|
|
26
26
|
renderItem,
|
|
27
27
|
children,
|
|
28
|
+
onIndexChanged,
|
|
28
29
|
style
|
|
29
30
|
} = _ref;
|
|
30
31
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
@@ -34,6 +35,7 @@ const Swiper = _ref => {
|
|
|
34
35
|
loop: loop,
|
|
35
36
|
timeout: timeout,
|
|
36
37
|
vertical: vertical,
|
|
38
|
+
onIndexChanged: onIndexChanged,
|
|
37
39
|
controlsProps: {
|
|
38
40
|
prevTitle,
|
|
39
41
|
nextTitle,
|
|
@@ -13,24 +13,19 @@ function Touchable(_ref) {
|
|
|
13
13
|
children,
|
|
14
14
|
disabled,
|
|
15
15
|
onPress,
|
|
16
|
-
activeOpacity,
|
|
17
|
-
disabledOpacity,
|
|
18
|
-
delayLongPress,
|
|
19
|
-
hitSlop,
|
|
20
16
|
style,
|
|
21
17
|
...props
|
|
22
18
|
} = _ref;
|
|
23
19
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
|
|
24
|
-
disabled: disabled,
|
|
25
20
|
onPress: onPress,
|
|
26
|
-
|
|
27
|
-
hitSlop:
|
|
21
|
+
disabled: disabled,
|
|
22
|
+
hitSlop: 8,
|
|
28
23
|
style: _ref2 => {
|
|
29
24
|
let {
|
|
30
25
|
pressed
|
|
31
26
|
} = _ref2;
|
|
32
27
|
return [{
|
|
33
|
-
opacity: pressed
|
|
28
|
+
opacity: pressed || disabled ? 0.75 : 1
|
|
34
29
|
}, style];
|
|
35
30
|
}
|
|
36
31
|
}, props), children);
|
|
@@ -18,27 +18,12 @@ const SEED_DATA_PROPS = {
|
|
|
18
18
|
defaultValue: "Get Started"
|
|
19
19
|
}),
|
|
20
20
|
disabled: (0, _types.createDisabledProp)(),
|
|
21
|
-
loading: (0, _types.createLoadingProp)()
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
disabledOpacity: (0, _types.createStaticNumberProp)({
|
|
28
|
-
label: "Disabled Opacity",
|
|
29
|
-
description: "Opacity of the button when disabled.",
|
|
30
|
-
required: false
|
|
31
|
-
}),
|
|
32
|
-
delayLongPress: (0, _types.createStaticNumberProp)({
|
|
33
|
-
label: "Delay Long Press",
|
|
34
|
-
description: "Duration (in milliseconds) from onPressIn before onLongPress is called.",
|
|
35
|
-
required: false
|
|
36
|
-
}),
|
|
37
|
-
hitSlop: (0, _types.createStaticNumberProp)({
|
|
38
|
-
label: "Hit Slop",
|
|
39
|
-
description: "Sets additional distance outside of element in which a press can be detected",
|
|
40
|
-
required: false
|
|
41
|
-
})
|
|
21
|
+
loading: (0, _types.createLoadingProp)()
|
|
22
|
+
};
|
|
23
|
+
const LAYOUT = {
|
|
24
|
+
backgroundColor: "transparent",
|
|
25
|
+
borderRadius: 8,
|
|
26
|
+
fontFamily: "system-700"
|
|
42
27
|
};
|
|
43
28
|
const SEED_DATA = [{
|
|
44
29
|
name: "Button Outline",
|
|
@@ -46,8 +31,7 @@ const SEED_DATA = [{
|
|
|
46
31
|
category: _types.COMPONENT_TYPES.deprecated,
|
|
47
32
|
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
48
33
|
layout: {
|
|
49
|
-
|
|
50
|
-
fontFamily: "system-700",
|
|
34
|
+
...LAYOUT,
|
|
51
35
|
backgroundColor: "transparent",
|
|
52
36
|
borderWidth: 1,
|
|
53
37
|
textAlign: "center"
|
|
@@ -60,8 +44,7 @@ const SEED_DATA = [{
|
|
|
60
44
|
category: _types.COMPONENT_TYPES.deprecated,
|
|
61
45
|
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
62
46
|
layout: {
|
|
63
|
-
|
|
64
|
-
fontFamily: "system-700",
|
|
47
|
+
...LAYOUT,
|
|
65
48
|
backgroundColor: "primary",
|
|
66
49
|
textAlign: "center"
|
|
67
50
|
},
|
|
@@ -73,8 +56,7 @@ const SEED_DATA = [{
|
|
|
73
56
|
category: _types.COMPONENT_TYPES.button,
|
|
74
57
|
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
75
58
|
layout: {
|
|
76
|
-
|
|
77
|
-
fontFamily: "system-700",
|
|
59
|
+
...LAYOUT,
|
|
78
60
|
backgroundColor: "primary",
|
|
79
61
|
textAlign: "center"
|
|
80
62
|
},
|
|
@@ -5,7 +5,42 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SEED_DATA = void 0;
|
|
7
7
|
var _types = require("@draftbit/types");
|
|
8
|
-
const SEED_DATA = {
|
|
8
|
+
const SEED_DATA = [{
|
|
9
|
+
name: "Masonry List",
|
|
10
|
+
tag: "MasonryFlashList",
|
|
11
|
+
description: "Masonry Flashlist by Shopify",
|
|
12
|
+
packageName: "@shopify/flash-list",
|
|
13
|
+
category: _types.COMPONENT_TYPES.data,
|
|
14
|
+
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
15
|
+
layout: {
|
|
16
|
+
flex: 1
|
|
17
|
+
},
|
|
18
|
+
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
19
|
+
props: {
|
|
20
|
+
onRefresh: (0, _types.createActionProp)(),
|
|
21
|
+
onEndReached: (0, _types.createActionProp)(),
|
|
22
|
+
numColumns: (0, _types.createNumColumnsType)({
|
|
23
|
+
editable: true
|
|
24
|
+
}),
|
|
25
|
+
estimatedItemSize: (0, _types.createNumberProp)({
|
|
26
|
+
group: _types.GROUPS.basic,
|
|
27
|
+
label: "Est. Item Size",
|
|
28
|
+
description: "Approximate size of the items before rendering.",
|
|
29
|
+
defaultValue: 50,
|
|
30
|
+
step: 1,
|
|
31
|
+
precision: 0
|
|
32
|
+
}),
|
|
33
|
+
optimizeItemArrangement: (0, _types.createStaticBoolProp)({
|
|
34
|
+
label: "Optimize Item Arrangement",
|
|
35
|
+
description: "If enabled, MasonryFlashList will try to reduce difference in column height by modifying item order. If true, specifying overrideItemLayout is required. Default value is false."
|
|
36
|
+
}),
|
|
37
|
+
onEndReachedThreshold: (0, _types.createStaticNumberProp)({
|
|
38
|
+
label: "End Reached Threshold",
|
|
39
|
+
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
40
|
+
defaultValue: 0.5
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
9
44
|
name: "FlashList",
|
|
10
45
|
tag: "FlashList",
|
|
11
46
|
description: "Flashlist by Shopify",
|
|
@@ -15,7 +50,10 @@ const SEED_DATA = {
|
|
|
15
50
|
layout: {
|
|
16
51
|
flex: 1
|
|
17
52
|
},
|
|
53
|
+
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
18
54
|
props: {
|
|
55
|
+
onRefresh: (0, _types.createActionProp)(),
|
|
56
|
+
onEndReached: (0, _types.createActionProp)(),
|
|
19
57
|
estimatedItemSize: (0, _types.createNumberProp)({
|
|
20
58
|
group: _types.GROUPS.basic,
|
|
21
59
|
label: "Est. Item Size",
|
|
@@ -34,7 +72,12 @@ const SEED_DATA = {
|
|
|
34
72
|
}),
|
|
35
73
|
numColumns: (0, _types.createNumColumnsType)({
|
|
36
74
|
editable: true
|
|
75
|
+
}),
|
|
76
|
+
onEndReachedThreshold: (0, _types.createStaticNumberProp)({
|
|
77
|
+
label: "End Reached Threshold",
|
|
78
|
+
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
79
|
+
defaultValue: 0.5
|
|
37
80
|
})
|
|
38
81
|
}
|
|
39
|
-
};
|
|
82
|
+
}];
|
|
40
83
|
exports.SEED_DATA = SEED_DATA;
|
|
@@ -14,7 +14,10 @@ const SEED_DATA = {
|
|
|
14
14
|
layout: {
|
|
15
15
|
flex: 1
|
|
16
16
|
},
|
|
17
|
+
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
17
18
|
props: {
|
|
19
|
+
onRefresh: (0, _types.createActionProp)(),
|
|
20
|
+
onEndReached: (0, _types.createActionProp)(),
|
|
18
21
|
horizontal: (0, _types.createStaticBoolProp)({
|
|
19
22
|
label: "Horizontal",
|
|
20
23
|
description: "Render list horizontally"
|
|
@@ -25,6 +28,15 @@ const SEED_DATA = {
|
|
|
25
28
|
}),
|
|
26
29
|
numColumns: (0, _types.createNumColumnsType)({
|
|
27
30
|
editable: true
|
|
31
|
+
}),
|
|
32
|
+
initialNumToRender: (0, _types.createStaticBoolProp)({
|
|
33
|
+
label: "Initial Num To Render",
|
|
34
|
+
descriprion: "How many items to render in the initial batch"
|
|
35
|
+
}),
|
|
36
|
+
onEndReachedThreshold: (0, _types.createStaticNumberProp)({
|
|
37
|
+
label: "End Reached Threshold",
|
|
38
|
+
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
39
|
+
defaultValue: 0.5
|
|
28
40
|
})
|
|
29
41
|
}
|
|
30
42
|
};
|
|
@@ -14,7 +14,9 @@ const SEED_DATA = {
|
|
|
14
14
|
height: 300,
|
|
15
15
|
width: "100%"
|
|
16
16
|
},
|
|
17
|
+
triggers: [_types.Triggers.OnIndexChanged],
|
|
17
18
|
props: {
|
|
19
|
+
onIndexChanged: (0, _types.createActionProp)(),
|
|
18
20
|
from: (0, _types.createNumberProp)({
|
|
19
21
|
group: _types.GROUPS.basic,
|
|
20
22
|
label: "Initial Slide"
|
|
@@ -5,48 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SEED_DATA = void 0;
|
|
7
7
|
var _types = require("@draftbit/types");
|
|
8
|
-
const
|
|
8
|
+
const SEED_DATA = {
|
|
9
|
+
name: "Touchable",
|
|
10
|
+
tag: "Touchable",
|
|
11
|
+
description: "Simple button with no styles",
|
|
12
|
+
category: _types.COMPONENT_TYPES.button,
|
|
9
13
|
stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Borders],
|
|
10
14
|
layout: {},
|
|
11
|
-
triggers: [_types.Triggers.OnPress
|
|
15
|
+
triggers: [_types.Triggers.OnPress],
|
|
12
16
|
props: {
|
|
13
|
-
onPress: (0, _types.createActionProp)()
|
|
14
|
-
onLongPress: (0, _types.createActionProp)(),
|
|
15
|
-
activeOpacity: (0, _types.createNumberProp)({
|
|
16
|
-
label: "Active Opacity",
|
|
17
|
-
description: "The opacity when the button is pressed.",
|
|
18
|
-
defaultValue: 0.8,
|
|
19
|
-
group: _types.GROUPS.basic
|
|
20
|
-
}),
|
|
21
|
-
disabledOpacity: (0, _types.createNumberProp)({
|
|
22
|
-
label: "Disabled Opacity",
|
|
23
|
-
description: "The opacity when the button is disabled.",
|
|
24
|
-
defaultValue: 0.8,
|
|
25
|
-
group: _types.GROUPS.basic
|
|
26
|
-
}),
|
|
27
|
-
delayLongPress: (0, _types.createNumberProp)({
|
|
28
|
-
label: "Delay Long Press",
|
|
29
|
-
description: "Duration (in milliseconds) from onPressIn before onLongPress is called.",
|
|
30
|
-
group: _types.GROUPS.basic
|
|
31
|
-
}),
|
|
32
|
-
hitSlop: (0, _types.createNumberProp)({
|
|
33
|
-
label: "Hit Slop",
|
|
34
|
-
description: "Sets additional distance outside of element in which a press can be detected.",
|
|
35
|
-
group: _types.GROUPS.basic
|
|
36
|
-
})
|
|
17
|
+
onPress: (0, _types.createActionProp)()
|
|
37
18
|
}
|
|
38
19
|
};
|
|
39
|
-
const SEED_DATA = [{
|
|
40
|
-
name: "Touchable",
|
|
41
|
-
tag: "Touchable",
|
|
42
|
-
description: "An interactive view with no styles",
|
|
43
|
-
category: _types.COMPONENT_TYPES.deprecated,
|
|
44
|
-
...SEED_DATA_PROPS
|
|
45
|
-
}, {
|
|
46
|
-
name: "Pressable",
|
|
47
|
-
tag: "Pressable",
|
|
48
|
-
description: "An interactive view with no styles",
|
|
49
|
-
category: _types.COMPONENT_TYPES.button,
|
|
50
|
-
...SEED_DATA_PROPS
|
|
51
|
-
}];
|
|
52
20
|
exports.SEED_DATA = SEED_DATA;
|
|
@@ -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,
|
|
@@ -13,11 +13,10 @@ function Base(_ref) {
|
|
|
13
13
|
Icon,
|
|
14
14
|
icon,
|
|
15
15
|
title,
|
|
16
|
+
onPress,
|
|
16
17
|
loading,
|
|
17
18
|
disabled,
|
|
18
19
|
style,
|
|
19
|
-
activeOpacity,
|
|
20
|
-
disabledOpacity,
|
|
21
20
|
...props
|
|
22
21
|
} = _ref;
|
|
23
22
|
const {
|
|
@@ -54,13 +53,14 @@ function Base(_ref) {
|
|
|
54
53
|
buttonStyles.justifyContent = "flex-end";
|
|
55
54
|
}
|
|
56
55
|
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
56
|
+
onPress: onPress,
|
|
57
57
|
disabled: disabled || loading,
|
|
58
58
|
style: _ref2 => {
|
|
59
59
|
let {
|
|
60
60
|
pressed
|
|
61
61
|
} = _ref2;
|
|
62
62
|
return [styles.base, {
|
|
63
|
-
opacity: pressed
|
|
63
|
+
opacity: pressed || disabled ? 0.75 : 1
|
|
64
64
|
}, buttonStyles];
|
|
65
65
|
}
|
|
66
66
|
}, props), loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
@@ -1,7 +1,8 @@
|
|
|
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 * as React from "react";
|
|
3
|
-
import { View, StyleSheet
|
|
3
|
+
import { View, StyleSheet } from "react-native";
|
|
4
4
|
import { useTheme } from "../../theming";
|
|
5
|
+
import Touchable from "../Touchable";
|
|
5
6
|
import { usePrevious } from "../../hooks";
|
|
6
7
|
const Checkbox = _ref => {
|
|
7
8
|
let {
|
|
@@ -50,7 +51,7 @@ const Checkbox = _ref => {
|
|
|
50
51
|
onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
|
-
return /*#__PURE__*/React.createElement(
|
|
54
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
|
|
54
55
|
onPress: handlePress,
|
|
55
56
|
disabled: disabled,
|
|
56
57
|
accessibilityState: {
|
|
@@ -1,10 +1,11 @@
|
|
|
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 * as React from "react";
|
|
3
|
-
import { StyleSheet, View, Platform
|
|
3
|
+
import { StyleSheet, View, Platform } from "react-native";
|
|
4
4
|
import Checkbox from "./Checkbox";
|
|
5
5
|
import Text from "../Text";
|
|
6
6
|
import { useCheckboxGroupContext } from "./context";
|
|
7
7
|
import { Direction as GroupDirection } from "./context";
|
|
8
|
+
import Touchable from "../Touchable";
|
|
8
9
|
import { extractStyles } from "../../utilities";
|
|
9
10
|
export let Direction;
|
|
10
11
|
(function (Direction) {
|
|
@@ -63,7 +64,7 @@ const CheckboxGroupRow = _ref => {
|
|
|
63
64
|
textStyles,
|
|
64
65
|
viewStyles
|
|
65
66
|
} = extractStyles(style);
|
|
66
|
-
return /*#__PURE__*/React.createElement(
|
|
67
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({
|
|
67
68
|
onPress: handlePress,
|
|
68
69
|
style: [styles.mainParent, {
|
|
69
70
|
flexDirection: direction
|
|
@@ -1,10 +1,11 @@
|
|
|
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 * as React from "react";
|
|
3
|
-
import { StyleSheet, View, Platform
|
|
3
|
+
import { StyleSheet, View, Platform } from "react-native";
|
|
4
4
|
import { isString } from "lodash";
|
|
5
5
|
import { extractStyles } from "../../utilities";
|
|
6
6
|
import { usePrevious } from "../../hooks";
|
|
7
7
|
import Text from "../Text";
|
|
8
|
+
import Touchable from "../Touchable";
|
|
8
9
|
import Checkbox from "./Checkbox";
|
|
9
10
|
export let Direction;
|
|
10
11
|
(function (Direction) {
|
|
@@ -72,7 +73,7 @@ const CheckboxRow = _ref => {
|
|
|
72
73
|
textStyles,
|
|
73
74
|
viewStyles
|
|
74
75
|
} = extractStyles(style);
|
|
75
|
-
return /*#__PURE__*/React.createElement(
|
|
76
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({
|
|
76
77
|
onPress: handlePress,
|
|
77
78
|
style: [viewStyles, styles.mainParent, {
|
|
78
79
|
flexDirection: direction
|
|
@@ -1,8 +1,9 @@
|
|
|
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 * as React from "react";
|
|
3
|
-
import { ActivityIndicator, View, Text, StyleSheet
|
|
3
|
+
import { ActivityIndicator, View, Text, StyleSheet } from "react-native";
|
|
4
4
|
import color from "color";
|
|
5
5
|
import Config from "./Config";
|
|
6
|
+
import Touchable from "./Touchable";
|
|
6
7
|
import Elevation from "./Elevation";
|
|
7
8
|
import { withTheme } from "../theming";
|
|
8
9
|
const Button = _ref => {
|
|
@@ -17,6 +18,7 @@ const Button = _ref => {
|
|
|
17
18
|
children,
|
|
18
19
|
onPress,
|
|
19
20
|
elevation = 0,
|
|
21
|
+
style,
|
|
20
22
|
theme: {
|
|
21
23
|
colors,
|
|
22
24
|
disabledOpacity,
|
|
@@ -70,19 +72,41 @@ const Button = _ref => {
|
|
|
70
72
|
marginRight: -8,
|
|
71
73
|
width: Config.buttonIconSize
|
|
72
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
|
+
};
|
|
73
96
|
return /*#__PURE__*/React.createElement(Elevation, {
|
|
74
97
|
style: {
|
|
75
98
|
elevation,
|
|
76
|
-
alignSelf: "stretch"
|
|
99
|
+
alignSelf: "stretch",
|
|
100
|
+
...margins
|
|
77
101
|
}
|
|
78
|
-
}, /*#__PURE__*/React.createElement(
|
|
102
|
+
}, /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
|
|
79
103
|
onPress: onPress,
|
|
80
104
|
accessibilityState: {
|
|
81
105
|
disabled
|
|
82
106
|
},
|
|
83
107
|
accessibilityRole: "button",
|
|
84
108
|
disabled: disabled || loading,
|
|
85
|
-
style: [styles.button, buttonStyle]
|
|
109
|
+
style: [styles.button, buttonStyle, innerStyles]
|
|
86
110
|
}), /*#__PURE__*/React.createElement(View, {
|
|
87
111
|
style: styles.content
|
|
88
112
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|