@draftbit/core 46.2.3 → 46.2.4-00bad7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Accordion/AccordionItem.js +5 -25
- package/lib/commonjs/components/Carousel.js +34 -10
- package/lib/commonjs/components/DeprecatedButton.js +4 -22
- package/lib/commonjs/components/TabView/TabView.js +102 -0
- package/lib/commonjs/components/TabView/TabViewItem.js +26 -0
- package/lib/commonjs/components/TabView/index.js +23 -0
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/mappings/TabView.js +79 -0
- package/lib/module/components/Banner.js +24 -4
- package/lib/module/components/CardContainer.js +15 -5
- package/lib/module/components/Divider.js +20 -2
- package/lib/module/components/FAB.js +23 -5
- package/lib/module/components/Portal/PortalHost.js +26 -15
- package/lib/module/components/RadioButton/RadioButton.js +15 -2
- package/lib/module/components/RadioButton/RadioButtonGroup.js +17 -3
- package/lib/module/components/ScreenContainer.js +22 -5
- package/lib/module/components/TabView/TabView.js +87 -0
- package/lib/module/components/TabView/TabViewItem.js +18 -0
- package/lib/module/components/TabView/index.js +2 -0
- package/lib/module/components/ToggleButton.js +17 -3
- package/lib/module/constants.js +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/mappings/TabView.js +70 -0
- package/lib/typescript/src/components/TabView/TabView.d.ts +19 -0
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +10 -0
- package/lib/typescript/src/components/TabView/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/mappings/TabView.d.ts +111 -0
- package/package.json +4 -2
- package/src/components/TabView/TabView.js +34 -0
- package/src/components/TabView/TabView.tsx +97 -0
- package/src/components/TabView/TabViewItem.js +5 -0
- package/src/components/TabView/TabViewItem.tsx +21 -0
- package/src/components/TabView/index.js +2 -0
- package/src/components/TabView/index.ts +2 -0
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/TabView.js +73 -0
- package/src/mappings/TabView.ts +80 -0
|
@@ -21,6 +21,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
24
|
+
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); }
|
|
25
|
+
|
|
24
26
|
const AccordionItem = _ref => {
|
|
25
27
|
let {
|
|
26
28
|
Icon,
|
|
@@ -35,10 +37,9 @@ const AccordionItem = _ref => {
|
|
|
35
37
|
textStyles,
|
|
36
38
|
viewStyles
|
|
37
39
|
} = (0, _utilities.extractStyles)(style);
|
|
38
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
39
|
-
style: [styles.container, viewStyles]
|
|
40
|
-
|
|
41
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
40
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
|
|
41
|
+
style: [styles.container, viewStyles]
|
|
42
|
+
}, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
42
43
|
style: styles.row
|
|
43
44
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
44
45
|
name: icon,
|
|
@@ -73,25 +74,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
73
74
|
|
|
74
75
|
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
75
76
|
|
|
76
|
-
exports.default = _default;StyleSheet.create({
|
|
77
|
-
container: {
|
|
78
|
-
padding: 8
|
|
79
|
-
},
|
|
80
|
-
row: {
|
|
81
|
-
flexDirection: "row",
|
|
82
|
-
alignItems: "center",
|
|
83
|
-
paddingLeft: 8
|
|
84
|
-
},
|
|
85
|
-
item: {
|
|
86
|
-
marginVertical: 6,
|
|
87
|
-
paddingLeft: 8
|
|
88
|
-
},
|
|
89
|
-
content: {
|
|
90
|
-
flex: 1,
|
|
91
|
-
justifyContent: "center"
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
96
|
-
|
|
97
77
|
exports.default = _default;
|
|
@@ -19,8 +19,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
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; }
|
|
21
21
|
|
|
22
|
-
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); }
|
|
23
|
-
|
|
24
22
|
const screenWidth = _reactNative.Dimensions.get("window").width;
|
|
25
23
|
|
|
26
24
|
function Pager(_ref) {
|
|
@@ -50,8 +48,6 @@ function Pager(_ref) {
|
|
|
50
48
|
}
|
|
51
49
|
|
|
52
50
|
function Carousel(_ref2) {
|
|
53
|
-
var _data$length;
|
|
54
|
-
|
|
55
51
|
let {
|
|
56
52
|
data,
|
|
57
53
|
children,
|
|
@@ -59,9 +55,12 @@ function Carousel(_ref2) {
|
|
|
59
55
|
style,
|
|
60
56
|
...rest
|
|
61
57
|
} = _ref2;
|
|
58
|
+
|
|
59
|
+
var _a;
|
|
60
|
+
|
|
62
61
|
const [index, setIndex] = React.useState(0);
|
|
63
62
|
const length = React.Children.count(children);
|
|
64
|
-
const itemsLength = ((
|
|
63
|
+
const itemsLength = ((_a = data === null || data === void 0 ? void 0 : data.length) !== null && _a !== void 0 ? _a : 0) + length;
|
|
65
64
|
const slides = Array.isArray(data) ? data : [];
|
|
66
65
|
|
|
67
66
|
const {
|
|
@@ -71,9 +70,10 @@ function Carousel(_ref2) {
|
|
|
71
70
|
|
|
72
71
|
const slideWidth = width || screenWidth;
|
|
73
72
|
const slideHeight = height || 250;
|
|
74
|
-
return /*#__PURE__*/React.createElement(_reactNative.View,
|
|
75
|
-
style: [styles.container, style]
|
|
76
|
-
|
|
73
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
74
|
+
style: [styles.container, style],
|
|
75
|
+
...rest
|
|
76
|
+
}, /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
|
|
77
77
|
pagingEnabled: true,
|
|
78
78
|
horizontal: true,
|
|
79
79
|
decelerationRate: "fast",
|
|
@@ -101,9 +101,9 @@ function Carousel(_ref2) {
|
|
|
101
101
|
}]
|
|
102
102
|
});
|
|
103
103
|
}) : null, React.Children.map(children, child => {
|
|
104
|
-
var
|
|
104
|
+
var _a;
|
|
105
105
|
|
|
106
|
-
const s = (child === null || child === void 0 ? void 0 :
|
|
106
|
+
const s = ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.style) || {};
|
|
107
107
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
108
108
|
style: {
|
|
109
109
|
width: slideWidth
|
|
@@ -144,4 +144,28 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
144
144
|
|
|
145
145
|
var _default = (0, _theming.withTheme)(Carousel);
|
|
146
146
|
|
|
147
|
+
exports.default = _default;e({
|
|
148
|
+
container: {
|
|
149
|
+
backgroundColor: "#eee"
|
|
150
|
+
},
|
|
151
|
+
pager: {
|
|
152
|
+
position: "absolute",
|
|
153
|
+
bottom: 12,
|
|
154
|
+
left: 0,
|
|
155
|
+
right: 0,
|
|
156
|
+
flexDirection: "row",
|
|
157
|
+
justifyContent: "center",
|
|
158
|
+
alignItems: "center"
|
|
159
|
+
},
|
|
160
|
+
bullet: {
|
|
161
|
+
marginHorizontal: 2,
|
|
162
|
+
width: 10,
|
|
163
|
+
height: 10,
|
|
164
|
+
borderRadius: 20,
|
|
165
|
+
backgroundColor: "#000"
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
var _default = (0, _theming.withTheme)(Carousel);
|
|
170
|
+
|
|
147
171
|
exports.default = _default;
|
|
@@ -25,6 +25,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
25
|
|
|
26
26
|
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; }
|
|
27
27
|
|
|
28
|
+
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); }
|
|
29
|
+
|
|
28
30
|
const Button = _ref => {
|
|
29
31
|
let {
|
|
30
32
|
Icon,
|
|
@@ -126,7 +128,7 @@ const Button = _ref => {
|
|
|
126
128
|
alignSelf: "stretch",
|
|
127
129
|
...margins
|
|
128
130
|
}
|
|
129
|
-
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
131
|
+
}, /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
|
|
130
132
|
onPress: onPress,
|
|
131
133
|
accessibilityState: {
|
|
132
134
|
disabled
|
|
@@ -134,7 +136,7 @@ const Button = _ref => {
|
|
|
134
136
|
accessibilityRole: "button",
|
|
135
137
|
disabled: disabled || loading,
|
|
136
138
|
style: [styles.button, buttonStyle, innerStyles]
|
|
137
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
139
|
+
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
138
140
|
style: styles.content
|
|
139
141
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
140
142
|
style: iconStyle
|
|
@@ -169,24 +171,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
169
171
|
|
|
170
172
|
var _default = (0, _theming.withTheme)(Button);
|
|
171
173
|
|
|
172
|
-
exports.default = _default;));
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
const styles = _reactNative.StyleSheet.create({
|
|
176
|
-
button: {
|
|
177
|
-
minWidth: 64,
|
|
178
|
-
borderStyle: "solid"
|
|
179
|
-
},
|
|
180
|
-
content: {
|
|
181
|
-
flexDirection: "row",
|
|
182
|
-
alignItems: "center",
|
|
183
|
-
justifyContent: "center"
|
|
184
|
-
},
|
|
185
|
-
icon: {
|
|
186
|
-
width: _Config.default.buttonIconSize
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
var _default = (0, _theming.withTheme)(Button);
|
|
191
|
-
|
|
192
174
|
exports.default = _default;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNativeTabView = require("react-native-tab-view");
|
|
11
|
+
|
|
12
|
+
var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
|
|
13
|
+
|
|
14
|
+
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); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
const TabViewComponent = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
Icon,
|
|
25
|
+
tabBarPosition,
|
|
26
|
+
keyboardDismissMode,
|
|
27
|
+
swipeEnabled,
|
|
28
|
+
scrollEnabled,
|
|
29
|
+
activeColor,
|
|
30
|
+
inactiveColor,
|
|
31
|
+
pressColor,
|
|
32
|
+
indicatorColor,
|
|
33
|
+
style,
|
|
34
|
+
children
|
|
35
|
+
} = _ref;
|
|
36
|
+
const [index, setIndex] = React.useState(0);
|
|
37
|
+
const [routes, setRoutes] = React.useState([]);
|
|
38
|
+
const [tabScenes, setTabScenes] = React.useState({});
|
|
39
|
+
React.useEffect(() => {
|
|
40
|
+
const newRoutes = [];
|
|
41
|
+
const scenes = {};
|
|
42
|
+
React.Children.toArray(children).filter(child => child.type === _TabViewItem.default).forEach(child => {
|
|
43
|
+
var _child$props;
|
|
44
|
+
|
|
45
|
+
if (child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.id) {
|
|
46
|
+
var _child$props2, _child$props3;
|
|
47
|
+
|
|
48
|
+
newRoutes.push({
|
|
49
|
+
key: child === null || child === void 0 ? void 0 : (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.id,
|
|
50
|
+
...(child === null || child === void 0 ? void 0 : child.props)
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
scenes[child === null || child === void 0 ? void 0 : (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.id] = () => child;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
setRoutes(newRoutes);
|
|
57
|
+
setTabScenes(scenes);
|
|
58
|
+
}, [children]);
|
|
59
|
+
|
|
60
|
+
const indexChangeHandler = i => setIndex(i);
|
|
61
|
+
|
|
62
|
+
const renderTabBar = props => {
|
|
63
|
+
console.log(props);
|
|
64
|
+
return /*#__PURE__*/React.createElement(_reactNativeTabView.TabBar, _extends({}, props, {
|
|
65
|
+
activeColor: activeColor,
|
|
66
|
+
inactiveColor: inactiveColor,
|
|
67
|
+
pressColor: pressColor,
|
|
68
|
+
scrollEnabled: scrollEnabled,
|
|
69
|
+
indicatorStyle: {
|
|
70
|
+
backgroundColor: indicatorColor
|
|
71
|
+
},
|
|
72
|
+
renderIcon: _ref2 => {
|
|
73
|
+
let {
|
|
74
|
+
route,
|
|
75
|
+
color
|
|
76
|
+
} = _ref2;
|
|
77
|
+
return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
78
|
+
name: route.icon,
|
|
79
|
+
color: color,
|
|
80
|
+
size: 36
|
|
81
|
+
}) : null;
|
|
82
|
+
},
|
|
83
|
+
style: style
|
|
84
|
+
}));
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return /*#__PURE__*/React.createElement(_reactNativeTabView.TabView, {
|
|
88
|
+
navigationState: {
|
|
89
|
+
index,
|
|
90
|
+
routes
|
|
91
|
+
},
|
|
92
|
+
renderScene: (0, _reactNativeTabView.SceneMap)(tabScenes),
|
|
93
|
+
renderTabBar: renderTabBar,
|
|
94
|
+
onIndexChange: indexChangeHandler,
|
|
95
|
+
tabBarPosition: tabBarPosition,
|
|
96
|
+
keyboardDismissMode: keyboardDismissMode,
|
|
97
|
+
swipeEnabled: swipeEnabled
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
var _default = TabViewComponent;
|
|
102
|
+
exports.default = _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
const TabViewItem = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
title,
|
|
11
|
+
id,
|
|
12
|
+
icon,
|
|
13
|
+
children,
|
|
14
|
+
accessibilityLabel
|
|
15
|
+
} = _ref;
|
|
16
|
+
console.log({
|
|
17
|
+
title,
|
|
18
|
+
id,
|
|
19
|
+
icon,
|
|
20
|
+
accessibilityLabel
|
|
21
|
+
});
|
|
22
|
+
return children;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var _default = TabViewItem;
|
|
26
|
+
exports.default = _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "TabView", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _TabView.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "TabViewItem", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _TabViewItem.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _TabView = _interopRequireDefault(require("./TabView"));
|
|
20
|
+
|
|
21
|
+
var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
|
|
22
|
+
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/commonjs/index.js
CHANGED
|
@@ -363,6 +363,18 @@ Object.defineProperty(exports, "SwitchRow", {
|
|
|
363
363
|
return _Switch.SwitchRow;
|
|
364
364
|
}
|
|
365
365
|
});
|
|
366
|
+
Object.defineProperty(exports, "TabView", {
|
|
367
|
+
enumerable: true,
|
|
368
|
+
get: function () {
|
|
369
|
+
return _TabView.TabView;
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
Object.defineProperty(exports, "TabViewItem", {
|
|
373
|
+
enumerable: true,
|
|
374
|
+
get: function () {
|
|
375
|
+
return _TabView.TabViewItem;
|
|
376
|
+
}
|
|
377
|
+
});
|
|
366
378
|
Object.defineProperty(exports, "TextField", {
|
|
367
379
|
enumerable: true,
|
|
368
380
|
get: function () {
|
|
@@ -464,6 +476,8 @@ var _ActionSheet = require("./components/ActionSheet");
|
|
|
464
476
|
|
|
465
477
|
var _Swiper = require("./components/Swiper");
|
|
466
478
|
|
|
479
|
+
var _TabView = require("./components/TabView");
|
|
480
|
+
|
|
467
481
|
var _Layout = require("./components/Layout");
|
|
468
482
|
|
|
469
483
|
var _index = require("./components/RadioButton/index");
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SEED_DATA = void 0;
|
|
7
|
+
|
|
8
|
+
var _types = require("@draftbit/types");
|
|
9
|
+
|
|
10
|
+
const SEED_DATA = [{
|
|
11
|
+
name: "TabView",
|
|
12
|
+
tag: "TabView",
|
|
13
|
+
category: _types.COMPONENT_TYPES.container,
|
|
14
|
+
layout: {},
|
|
15
|
+
props: {
|
|
16
|
+
tabBarPosition: (0, _types.createTextEnumProp)({
|
|
17
|
+
label: "Tab Bar Position",
|
|
18
|
+
description: "Tab Bar Position",
|
|
19
|
+
options: ["top", "bottom"],
|
|
20
|
+
defaultValue: "top"
|
|
21
|
+
}),
|
|
22
|
+
keyboardDismissMode: (0, _types.createTextEnumProp)({
|
|
23
|
+
label: "Keyboard Dismiss Mode",
|
|
24
|
+
description: "Keyboard Dismiss Mode",
|
|
25
|
+
options: ["auto", "on-drag", "none"],
|
|
26
|
+
defaultValue: "auto"
|
|
27
|
+
}),
|
|
28
|
+
swipeEnabled: (0, _types.createBoolProp)({
|
|
29
|
+
label: "Swipe Enabled",
|
|
30
|
+
description: "Swipe Enabled",
|
|
31
|
+
defaultValue: true
|
|
32
|
+
}),
|
|
33
|
+
scrollEnabled: (0, _types.createBoolProp)({
|
|
34
|
+
label: "Scroll Enabled",
|
|
35
|
+
description: "Scroll Enabled",
|
|
36
|
+
defaultValue: true
|
|
37
|
+
}),
|
|
38
|
+
activeColor: (0, _types.createColorProp)({
|
|
39
|
+
label: "Active Color",
|
|
40
|
+
description: "Active Color",
|
|
41
|
+
defaultValue: "primary"
|
|
42
|
+
}),
|
|
43
|
+
inactiveColor: (0, _types.createColorProp)({
|
|
44
|
+
label: "Inactive Color",
|
|
45
|
+
description: "Inactive Color",
|
|
46
|
+
defaultValue: null
|
|
47
|
+
}),
|
|
48
|
+
pressColor: (0, _types.createColorProp)({
|
|
49
|
+
label: "Press Color",
|
|
50
|
+
description: "Press Color",
|
|
51
|
+
defaultValue: null
|
|
52
|
+
}),
|
|
53
|
+
indicatorColor: (0, _types.createColorProp)({
|
|
54
|
+
label: "Indicator Color",
|
|
55
|
+
description: "Indicator Color",
|
|
56
|
+
defaultValue: null
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
name: "TabViewItem",
|
|
61
|
+
tag: "TabViewItem",
|
|
62
|
+
category: _types.COMPONENT_TYPES.container,
|
|
63
|
+
layout: {},
|
|
64
|
+
props: {
|
|
65
|
+
title: (0, _types.createTextProp)({
|
|
66
|
+
label: "Title",
|
|
67
|
+
description: "Tab Title"
|
|
68
|
+
}),
|
|
69
|
+
id: (0, _types.createTextProp)({
|
|
70
|
+
label: "Id",
|
|
71
|
+
description: "Tab Id"
|
|
72
|
+
}),
|
|
73
|
+
accessibilityLabel: (0, _types.createTextProp)({
|
|
74
|
+
label: "Accessibility Label",
|
|
75
|
+
description: "Accessibility Label"
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
}];
|
|
79
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -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 { Button, Text, View, StyleSheet, Animated } from "react-native";
|
|
5
3
|
import Surface from "./Surface";
|
|
@@ -74,9 +72,9 @@ const Banner = _ref => {
|
|
|
74
72
|
|
|
75
73
|
const height = Animated.multiply(position, layout.height);
|
|
76
74
|
const translateY = Animated.multiply(Animated.add(position, -1), layout.height);
|
|
77
|
-
return /*#__PURE__*/React.createElement(Surface,
|
|
75
|
+
return /*#__PURE__*/React.createElement(Surface, { ...rest,
|
|
78
76
|
style: [styles.container, shadow(ELEVATION), style]
|
|
79
|
-
}
|
|
77
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
80
78
|
style: [styles.wrapper, contentStyle]
|
|
81
79
|
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
82
80
|
style: {
|
|
@@ -155,4 +153,26 @@ const styles = StyleSheet.create({
|
|
|
155
153
|
margin: 8
|
|
156
154
|
}
|
|
157
155
|
});
|
|
156
|
+
export default withTheme(Banner);00%"
|
|
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
|
+
});
|
|
158
178
|
export default withTheme(Banner);
|
|
@@ -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 React from "react";
|
|
4
2
|
import { View, Text } from "react-native";
|
|
5
3
|
import color from "color";
|
|
@@ -51,11 +49,12 @@ const CardContainer = _ref => {
|
|
|
51
49
|
break;
|
|
52
50
|
}
|
|
53
51
|
|
|
54
|
-
return /*#__PURE__*/React.createElement(Card,
|
|
52
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
55
53
|
style: style,
|
|
56
54
|
onPress: onPress,
|
|
57
|
-
numColumns: numColumns
|
|
58
|
-
|
|
55
|
+
numColumns: numColumns,
|
|
56
|
+
...rest
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Elevation, {
|
|
59
58
|
style: {
|
|
60
59
|
elevation,
|
|
61
60
|
borderRadius: roundness
|
|
@@ -125,4 +124,15 @@ const CardContainer = _ref => {
|
|
|
125
124
|
})) : null)));
|
|
126
125
|
};
|
|
127
126
|
|
|
127
|
+
export default withTheme(CardContainer);ONTAINER_PADDING,
|
|
128
|
+
borderRadius: ICON_CONTAINER_SIZE,
|
|
129
|
+
backgroundColor: color(colors.strong).alpha(Config.cardIconBackgroundOpacity).rgb().string()
|
|
130
|
+
}
|
|
131
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
132
|
+
name: icon,
|
|
133
|
+
size: Config.cardIconSize,
|
|
134
|
+
color: colors.surface
|
|
135
|
+
})) : null)));
|
|
136
|
+
};
|
|
137
|
+
|
|
128
138
|
export default withTheme(CardContainer);
|
|
@@ -1,9 +1,27 @@
|
|
|
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 { StyleSheet, View } from "react-native";
|
|
5
3
|
import { withTheme } from "../theming";
|
|
6
4
|
|
|
5
|
+
const Divider = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
style,
|
|
8
|
+
color,
|
|
9
|
+
theme: {
|
|
10
|
+
colors
|
|
11
|
+
},
|
|
12
|
+
...rest
|
|
13
|
+
} = _ref;
|
|
14
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
15
|
+
style: [{
|
|
16
|
+
backgroundColor: color || colors.divider,
|
|
17
|
+
height: StyleSheet.hairlineWidth
|
|
18
|
+
}, style],
|
|
19
|
+
...rest
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default withTheme(Divider);ng";
|
|
24
|
+
|
|
7
25
|
const Divider = _ref => {
|
|
8
26
|
let {
|
|
9
27
|
style,
|
|
@@ -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",
|