@draftbit/core 46.10.2 → 46.10.3-1b8e7d.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/Accordion/AccordionItem.js +23 -4
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +23 -5
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +23 -6
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/Table/Table.js +123 -0
- package/lib/commonjs/components/Table/TableCell.js +49 -0
- package/lib/commonjs/components/Table/TableCommon.js +30 -0
- package/lib/commonjs/components/Table/TableRow.js +61 -0
- package/lib/commonjs/components/Table/index.js +27 -0
- package/lib/commonjs/index.js +19 -28
- package/lib/commonjs/mappings/NativeBase/Layout.js +108 -0
- package/lib/commonjs/mappings/Table.js +140 -0
- package/lib/module/components/Table/Table.js +114 -0
- package/lib/module/components/Table/TableCell.js +41 -0
- package/lib/module/components/Table/TableCommon.js +21 -0
- package/lib/module/components/Table/TableRow.js +53 -0
- package/lib/module/components/Table/index.js +3 -0
- package/lib/module/index.js +1 -4
- package/lib/module/mappings/NativeBase/Layout.js +101 -0
- package/lib/module/mappings/Table.js +133 -0
- package/lib/typescript/src/components/Table/Table.d.ts +19 -0
- package/lib/typescript/src/components/Table/Table.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableCell.d.ts +9 -0
- package/lib/typescript/src/components/Table/TableCell.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableCommon.d.ts +20 -0
- package/lib/typescript/src/components/Table/TableCommon.d.ts.map +1 -0
- package/lib/typescript/src/components/{RowBodyIcon.d.ts → Table/TableRow.d.ts} +7 -9
- package/lib/typescript/src/components/Table/TableRow.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/index.d.ts +4 -0
- package/lib/typescript/src/components/Table/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +133 -0
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -0
- package/lib/typescript/src/mappings/Table.d.ts +337 -0
- package/lib/typescript/src/mappings/Table.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/Table/Table.js +93 -0
- package/src/components/Table/Table.tsx +176 -0
- package/src/components/Table/TableCell.js +31 -0
- package/src/components/Table/TableCell.tsx +63 -0
- package/src/components/Table/TableCommon.js +12 -0
- package/src/components/Table/TableCommon.ts +40 -0
- package/src/components/Table/TableRow.js +37 -0
- package/src/components/Table/TableRow.tsx +77 -0
- package/src/components/Table/index.js +3 -0
- package/src/components/Table/index.tsx +3 -0
- package/src/index.js +1 -4
- package/src/index.tsx +2 -4
- package/src/mappings/NativeBase/Layout.js +124 -0
- package/src/mappings/NativeBase/Layout.ts +145 -0
- package/src/mappings/Table.js +150 -0
- package/src/mappings/Table.ts +170 -0
- package/lib/commonjs/components/Container.js +0 -93
- package/lib/commonjs/components/DeprecatedFAB.js +0 -157
- package/lib/commonjs/components/Row.js +0 -73
- package/lib/commonjs/components/RowBodyIcon.js +0 -45
- package/lib/commonjs/components/RowHeadlineImageCaption.js +0 -45
- package/lib/commonjs/components/RowHeadlineImageIcon.js +0 -51
- package/lib/commonjs/mappings/Container.js +0 -37
- package/lib/module/components/Container.js +0 -83
- package/lib/module/components/DeprecatedFAB.js +0 -147
- package/lib/module/components/Row.js +0 -63
- package/lib/module/components/RowBodyIcon.js +0 -35
- package/lib/module/components/RowHeadlineImageCaption.js +0 -35
- package/lib/module/components/RowHeadlineImageIcon.js +0 -41
- package/lib/module/mappings/Container.js +0 -30
- package/lib/typescript/src/components/Container.d.ts +0 -21
- package/lib/typescript/src/components/Container.d.ts.map +0 -1
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +0 -56
- package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +0 -1
- package/lib/typescript/src/components/Row.d.ts +0 -21
- package/lib/typescript/src/components/Row.d.ts.map +0 -1
- package/lib/typescript/src/components/RowBodyIcon.d.ts.map +0 -1
- package/lib/typescript/src/components/RowHeadlineImageCaption.d.ts +0 -16
- package/lib/typescript/src/components/RowHeadlineImageCaption.d.ts.map +0 -1
- package/lib/typescript/src/components/RowHeadlineImageIcon.d.ts +0 -18
- package/lib/typescript/src/components/RowHeadlineImageIcon.d.ts.map +0 -1
- package/lib/typescript/src/mappings/Container.d.ts +0 -55
- package/lib/typescript/src/mappings/Container.d.ts.map +0 -1
- package/src/components/Container.js +0 -43
- package/src/components/Container.tsx +0 -116
- package/src/components/DeprecatedFAB.js +0 -114
- package/src/components/DeprecatedFAB.tsx +0 -231
- package/src/components/Row.js +0 -48
- package/src/components/Row.tsx +0 -108
- package/src/components/RowBodyIcon.js +0 -8
- package/src/components/RowBodyIcon.tsx +0 -47
- package/src/components/RowHeadlineImageCaption.js +0 -12
- package/src/components/RowHeadlineImageCaption.tsx +0 -49
- package/src/components/RowHeadlineImageIcon.js +0 -14
- package/src/components/RowHeadlineImageIcon.tsx +0 -61
- package/src/mappings/Container.js +0 -30
- package/src/mappings/Container.ts +0 -41
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _color = _interopRequireDefault(require("color"));
|
|
10
|
-
var _Config = _interopRequireDefault(require("./Config"));
|
|
11
|
-
var _Text = _interopRequireDefault(require("./Text"));
|
|
12
|
-
var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
13
|
-
var _theming = require("../theming");
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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); }
|
|
16
|
-
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; }
|
|
17
|
-
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); }
|
|
18
|
-
const FAB = _ref => {
|
|
19
|
-
let {
|
|
20
|
-
Icon,
|
|
21
|
-
icon,
|
|
22
|
-
disabled = false,
|
|
23
|
-
type = "solid",
|
|
24
|
-
loading = false,
|
|
25
|
-
color: colorOverride,
|
|
26
|
-
label,
|
|
27
|
-
onPress,
|
|
28
|
-
elevation = 0,
|
|
29
|
-
style,
|
|
30
|
-
theme: {
|
|
31
|
-
colors,
|
|
32
|
-
disabledOpacity,
|
|
33
|
-
roundness,
|
|
34
|
-
typography
|
|
35
|
-
},
|
|
36
|
-
...rest
|
|
37
|
-
} = _ref;
|
|
38
|
-
let backgroundColor, borderColor, textColor, borderWidth;
|
|
39
|
-
const buttonColor = colorOverride || colors.primary;
|
|
40
|
-
if (type === "standard" || type === "extended" || type === "fixed") {
|
|
41
|
-
backgroundColor = buttonColor;
|
|
42
|
-
if (disabled) {
|
|
43
|
-
textColor = (0, _color.default)(colors.surface).alpha(disabledOpacity).rgb().string();
|
|
44
|
-
} else {
|
|
45
|
-
textColor = colors.surface;
|
|
46
|
-
}
|
|
47
|
-
} else {
|
|
48
|
-
backgroundColor = "transparent";
|
|
49
|
-
if (disabled) {
|
|
50
|
-
textColor = (0, _color.default)(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
51
|
-
} else {
|
|
52
|
-
textColor = buttonColor;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (type === "outline") {
|
|
56
|
-
if (disabled) {
|
|
57
|
-
borderColor = (0, _color.default)(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
58
|
-
} else {
|
|
59
|
-
borderColor = buttonColor;
|
|
60
|
-
}
|
|
61
|
-
borderWidth = _reactNative.StyleSheet.hairlineWidth;
|
|
62
|
-
} else {
|
|
63
|
-
borderColor = "transparent";
|
|
64
|
-
borderWidth = 0;
|
|
65
|
-
}
|
|
66
|
-
const buttonStyle = {
|
|
67
|
-
backgroundColor,
|
|
68
|
-
borderColor,
|
|
69
|
-
borderWidth,
|
|
70
|
-
borderRadius: roundness,
|
|
71
|
-
alignItems: "center",
|
|
72
|
-
justifyContent: "center"
|
|
73
|
-
};
|
|
74
|
-
const buttonStyles = [styles.button, buttonStyle];
|
|
75
|
-
const contentStyle = [styles.content];
|
|
76
|
-
const textStyle = {
|
|
77
|
-
textAlign: "center",
|
|
78
|
-
color: textColor
|
|
79
|
-
};
|
|
80
|
-
const iconStyle = [styles.icon, {
|
|
81
|
-
width: _Config.default.buttonIconSize
|
|
82
|
-
}];
|
|
83
|
-
if (type === "standard" || type === "outline") {
|
|
84
|
-
buttonStyle.width = _Config.default.FABSize;
|
|
85
|
-
buttonStyle.height = _Config.default.FABSize;
|
|
86
|
-
buttonStyle.borderRadius = _Config.default.FABBorderRadius;
|
|
87
|
-
contentStyle.push({
|
|
88
|
-
width: _Config.default.FABSize,
|
|
89
|
-
height: _Config.default.FABSize
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
if (type === "extended" || type === "fixed") {
|
|
93
|
-
iconStyle.push({
|
|
94
|
-
marginLeft: 16,
|
|
95
|
-
marginRight: -8
|
|
96
|
-
});
|
|
97
|
-
textStyle.margin = 16;
|
|
98
|
-
}
|
|
99
|
-
if (type === "fixed") {
|
|
100
|
-
buttonStyles.push({
|
|
101
|
-
height: _Config.default.FABFixedHeight,
|
|
102
|
-
alignSelf: "stretch"
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
return /*#__PURE__*/React.createElement(_Elevation.default, {
|
|
106
|
-
style: [{
|
|
107
|
-
elevation
|
|
108
|
-
}, style]
|
|
109
|
-
}, /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({}, rest, {
|
|
110
|
-
onPress: onPress,
|
|
111
|
-
accessibilityState: {
|
|
112
|
-
disabled
|
|
113
|
-
},
|
|
114
|
-
accessibilityRole: "button",
|
|
115
|
-
disabled: disabled || loading,
|
|
116
|
-
style: buttonStyles
|
|
117
|
-
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
118
|
-
style: styles.content
|
|
119
|
-
}, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
120
|
-
style: iconStyle
|
|
121
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
122
|
-
name: icon,
|
|
123
|
-
size: _Config.default.buttonIconSize,
|
|
124
|
-
color: textColor
|
|
125
|
-
})) : null, loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
|
|
126
|
-
size: "small",
|
|
127
|
-
color: textColor,
|
|
128
|
-
style: iconStyle
|
|
129
|
-
}) : null, label ? /*#__PURE__*/React.createElement(_Text.default, {
|
|
130
|
-
numberOfLines: 1,
|
|
131
|
-
style: [textStyle, typography.button]
|
|
132
|
-
}, label) : null)));
|
|
133
|
-
};
|
|
134
|
-
const styles = _reactNative.StyleSheet.create({
|
|
135
|
-
button: {
|
|
136
|
-
borderStyle: "solid"
|
|
137
|
-
},
|
|
138
|
-
content: {
|
|
139
|
-
flexDirection: "row",
|
|
140
|
-
alignItems: "center",
|
|
141
|
-
justifyContent: "center"
|
|
142
|
-
},
|
|
143
|
-
icon: {
|
|
144
|
-
alignItems: "center",
|
|
145
|
-
justifyContent: "center",
|
|
146
|
-
width: _Config.default.buttonIconSize
|
|
147
|
-
},
|
|
148
|
-
fixed: {
|
|
149
|
-
left: 0,
|
|
150
|
-
right: 0,
|
|
151
|
-
bottom: 0,
|
|
152
|
-
height: 64,
|
|
153
|
-
borderRadius: 0
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
var _default = (0, _theming.withTheme)(FAB);
|
|
157
|
-
exports.default = _default;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _theming = require("../theming");
|
|
10
|
-
var _Config = _interopRequireDefault(require("./Config"));
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
const Row = _ref => {
|
|
15
|
-
let {
|
|
16
|
-
titleTypeStyle,
|
|
17
|
-
titleColor,
|
|
18
|
-
subtitleTypeStyle,
|
|
19
|
-
subtitleColor,
|
|
20
|
-
title,
|
|
21
|
-
subtitle,
|
|
22
|
-
multilineSubtitle,
|
|
23
|
-
image,
|
|
24
|
-
right,
|
|
25
|
-
style
|
|
26
|
-
} = _ref;
|
|
27
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
28
|
-
style: [styles.container, {
|
|
29
|
-
padding: 16
|
|
30
|
-
}, style]
|
|
31
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
32
|
-
style: styles.leftContainer
|
|
33
|
-
}, image && /*#__PURE__*/React.createElement(_reactNative.Image, {
|
|
34
|
-
source: typeof image === "string" ? {
|
|
35
|
-
uri: image
|
|
36
|
-
} : image,
|
|
37
|
-
style: {
|
|
38
|
-
marginRight: 12,
|
|
39
|
-
width: subtitle ? _Config.default.rowMultiLineImageSize : _Config.default.rowSingleLineImageSize,
|
|
40
|
-
height: subtitle ? _Config.default.rowMultiLineImageSize : _Config.default.rowSingleLineImageSize
|
|
41
|
-
}
|
|
42
|
-
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
43
|
-
style: styles.textContainer
|
|
44
|
-
}, /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
45
|
-
style: [titleTypeStyle, {
|
|
46
|
-
color: titleColor
|
|
47
|
-
}],
|
|
48
|
-
numberOfLines: 1
|
|
49
|
-
}, title), subtitle ? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
50
|
-
style: [subtitleTypeStyle, {
|
|
51
|
-
color: subtitleColor,
|
|
52
|
-
marginTop: 4
|
|
53
|
-
}],
|
|
54
|
-
numberOfLines: multilineSubtitle ? undefined : 1
|
|
55
|
-
}, subtitle) : null)), right && right());
|
|
56
|
-
};
|
|
57
|
-
const styles = _reactNative.StyleSheet.create({
|
|
58
|
-
leftContainer: {
|
|
59
|
-
flexDirection: "row",
|
|
60
|
-
flex: 1
|
|
61
|
-
},
|
|
62
|
-
container: {
|
|
63
|
-
flexDirection: "row",
|
|
64
|
-
justifyContent: "space-between",
|
|
65
|
-
alignItems: "center"
|
|
66
|
-
},
|
|
67
|
-
textContainer: {
|
|
68
|
-
flex: 1,
|
|
69
|
-
justifyContent: "center"
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
var _default = (0, _theming.withTheme)(Row);
|
|
73
|
-
exports.default = _default;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _theming = require("../theming");
|
|
9
|
-
var _Row = _interopRequireDefault(require("./Row"));
|
|
10
|
-
var _Config = _interopRequireDefault(require("./Config"));
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
const RowBodyIcon = _ref => {
|
|
15
|
-
let {
|
|
16
|
-
Icon,
|
|
17
|
-
title,
|
|
18
|
-
subtitle,
|
|
19
|
-
icon,
|
|
20
|
-
style,
|
|
21
|
-
theme: {
|
|
22
|
-
colors,
|
|
23
|
-
typography
|
|
24
|
-
}
|
|
25
|
-
} = _ref;
|
|
26
|
-
return /*#__PURE__*/React.createElement(_Row.default, {
|
|
27
|
-
titleTypeStyle: typography.body1,
|
|
28
|
-
titleColor: colors.medium,
|
|
29
|
-
subtitleTypeStyle: typography.subtitle2,
|
|
30
|
-
subtitleColor: colors.light,
|
|
31
|
-
title: title,
|
|
32
|
-
subtitle: subtitle,
|
|
33
|
-
right: () => /*#__PURE__*/React.createElement(Icon, {
|
|
34
|
-
name: icon,
|
|
35
|
-
size: _Config.default.rowSingleLineIconSize,
|
|
36
|
-
color: colors.light,
|
|
37
|
-
style: {
|
|
38
|
-
marginLeft: 16
|
|
39
|
-
}
|
|
40
|
-
}),
|
|
41
|
-
style: style
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
var _default = (0, _theming.withTheme)(RowBodyIcon);
|
|
45
|
-
exports.default = _default;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _theming = require("../theming");
|
|
10
|
-
var _Row = _interopRequireDefault(require("./Row"));
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
const RowHeadlineImageCaption = _ref => {
|
|
15
|
-
let {
|
|
16
|
-
title,
|
|
17
|
-
subtitle,
|
|
18
|
-
caption,
|
|
19
|
-
image,
|
|
20
|
-
style,
|
|
21
|
-
theme: {
|
|
22
|
-
colors,
|
|
23
|
-
typography
|
|
24
|
-
}
|
|
25
|
-
} = _ref;
|
|
26
|
-
return /*#__PURE__*/React.createElement(_Row.default, {
|
|
27
|
-
titleTypeStyle: typography.headline6,
|
|
28
|
-
titleColor: colors.strong,
|
|
29
|
-
subtitleTypeStyle: typography.body2,
|
|
30
|
-
subtitleColor: colors.medium,
|
|
31
|
-
title: title,
|
|
32
|
-
subtitle: subtitle,
|
|
33
|
-
image: image,
|
|
34
|
-
right: () => /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
35
|
-
style: {
|
|
36
|
-
...typography.caption,
|
|
37
|
-
color: colors.strong,
|
|
38
|
-
marginLeft: 16
|
|
39
|
-
}
|
|
40
|
-
}, caption),
|
|
41
|
-
style: style
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
var _default = (0, _theming.withTheme)(RowHeadlineImageCaption);
|
|
45
|
-
exports.default = _default;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _theming = require("../theming");
|
|
9
|
-
var _Row = _interopRequireDefault(require("./Row"));
|
|
10
|
-
var _Config = _interopRequireDefault(require("./Config"));
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
const RowHeadlineImageIcon = _ref => {
|
|
15
|
-
let {
|
|
16
|
-
Icon,
|
|
17
|
-
icon,
|
|
18
|
-
title,
|
|
19
|
-
image,
|
|
20
|
-
subtitle,
|
|
21
|
-
multilineSubtitle = false,
|
|
22
|
-
style,
|
|
23
|
-
theme: {
|
|
24
|
-
colors,
|
|
25
|
-
typography
|
|
26
|
-
}
|
|
27
|
-
} = _ref;
|
|
28
|
-
return /*#__PURE__*/React.createElement(_Row.default, {
|
|
29
|
-
titleTypeStyle: typography.headline6,
|
|
30
|
-
titleColor: colors.strong,
|
|
31
|
-
subtitleTypeStyle: typography.body2,
|
|
32
|
-
subtitleColor: colors.medium,
|
|
33
|
-
title: title,
|
|
34
|
-
subtitle: subtitle,
|
|
35
|
-
multilineSubtitle: multilineSubtitle,
|
|
36
|
-
image: image,
|
|
37
|
-
right: () => /*#__PURE__*/React.createElement(Icon, {
|
|
38
|
-
name: icon,
|
|
39
|
-
size: multilineSubtitle ? _Config.default.rowMultiLineIconSize : _Config.default.rowSingleLineIconSize,
|
|
40
|
-
color: colors.light,
|
|
41
|
-
style: {
|
|
42
|
-
marginLeft: 16,
|
|
43
|
-
alignSelf: multilineSubtitle ? "flex-start" : "center",
|
|
44
|
-
marginTop: multilineSubtitle ? 4 : 0
|
|
45
|
-
}
|
|
46
|
-
}),
|
|
47
|
-
style: style
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
var _default = (0, _theming.withTheme)(RowHeadlineImageIcon);
|
|
51
|
-
exports.default = _default;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SEED_DATA = void 0;
|
|
7
|
-
var _types = require("@draftbit/types");
|
|
8
|
-
const SEED_DATA = {
|
|
9
|
-
name: "Container",
|
|
10
|
-
tag: "Container",
|
|
11
|
-
description: "A container component with gutter padding",
|
|
12
|
-
category: _types.COMPONENT_TYPES.deprecated,
|
|
13
|
-
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
14
|
-
layout: {
|
|
15
|
-
height: 250
|
|
16
|
-
},
|
|
17
|
-
props: {
|
|
18
|
-
useThemeGutterPadding: {
|
|
19
|
-
group: _types.GROUPS.basic,
|
|
20
|
-
label: "Use gutter padding",
|
|
21
|
-
description: "When true, uses the theme gutter spacing as the container's horizontal padding",
|
|
22
|
-
formType: _types.FORM_TYPES.boolean,
|
|
23
|
-
propType: _types.PROP_TYPES.BOOLEAN,
|
|
24
|
-
defaultValue: false,
|
|
25
|
-
editable: false,
|
|
26
|
-
required: true
|
|
27
|
-
},
|
|
28
|
-
backgroundImage: (0, _types.createImageProp)({
|
|
29
|
-
label: "Background Image",
|
|
30
|
-
description: "Apply a custom background image",
|
|
31
|
-
defaultValue: null
|
|
32
|
-
}),
|
|
33
|
-
backgroundImageResizeMode: (0, _types.createResizeModeProp)(),
|
|
34
|
-
elevation: (0, _types.createElevationType)(0)
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
exports.SEED_DATA = SEED_DATA;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { View, ImageBackground, StyleSheet } from "react-native";
|
|
4
|
-
import { withTheme } from "../theming";
|
|
5
|
-
import Elevation from "./Elevation";
|
|
6
|
-
const Container = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
useThemeGutterPadding,
|
|
9
|
-
borderColor,
|
|
10
|
-
borderWidth,
|
|
11
|
-
backgroundColor,
|
|
12
|
-
backgroundImage,
|
|
13
|
-
backgroundImageResizeMode,
|
|
14
|
-
elevation,
|
|
15
|
-
style,
|
|
16
|
-
children,
|
|
17
|
-
theme,
|
|
18
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
19
|
-
...rest
|
|
20
|
-
} = _ref;
|
|
21
|
-
const {
|
|
22
|
-
flex,
|
|
23
|
-
flexGrow,
|
|
24
|
-
flexWrap,
|
|
25
|
-
flexBasis,
|
|
26
|
-
flexShrink,
|
|
27
|
-
flexDirection,
|
|
28
|
-
alignContent,
|
|
29
|
-
justifyContent,
|
|
30
|
-
alignItems,
|
|
31
|
-
padding,
|
|
32
|
-
paddingTop,
|
|
33
|
-
paddingBottom,
|
|
34
|
-
paddingLeft,
|
|
35
|
-
paddingRight,
|
|
36
|
-
paddingVertical,
|
|
37
|
-
paddingHorizontal,
|
|
38
|
-
...styleProp
|
|
39
|
-
} = StyleSheet.flatten(style) || {};
|
|
40
|
-
const containerStyle = {
|
|
41
|
-
backgroundColor,
|
|
42
|
-
borderColor,
|
|
43
|
-
borderWidth,
|
|
44
|
-
width: "100%",
|
|
45
|
-
...styleProp
|
|
46
|
-
};
|
|
47
|
-
const innerStyle = {
|
|
48
|
-
flex,
|
|
49
|
-
flexGrow,
|
|
50
|
-
flexWrap,
|
|
51
|
-
flexBasis,
|
|
52
|
-
flexShrink,
|
|
53
|
-
flexDirection,
|
|
54
|
-
alignContent,
|
|
55
|
-
justifyContent,
|
|
56
|
-
alignItems,
|
|
57
|
-
padding,
|
|
58
|
-
paddingTop,
|
|
59
|
-
paddingBottom,
|
|
60
|
-
paddingLeft,
|
|
61
|
-
paddingRight,
|
|
62
|
-
paddingVertical,
|
|
63
|
-
paddingHorizontal: paddingHorizontal || useThemeGutterPadding ? 16 : 0
|
|
64
|
-
};
|
|
65
|
-
const Wrap = elevation ? Elevation : View;
|
|
66
|
-
if (elevation) containerStyle.elevation = elevation;
|
|
67
|
-
return /*#__PURE__*/React.createElement(Wrap, _extends({
|
|
68
|
-
style: [containerStyle, style]
|
|
69
|
-
}, rest), backgroundImage ? /*#__PURE__*/React.createElement(ImageBackground, {
|
|
70
|
-
source: typeof backgroundImage === "string" ? {
|
|
71
|
-
uri: backgroundImage
|
|
72
|
-
} : backgroundImage,
|
|
73
|
-
resizeMode: backgroundImageResizeMode,
|
|
74
|
-
style: {
|
|
75
|
-
flex: 1
|
|
76
|
-
}
|
|
77
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
78
|
-
style: innerStyle
|
|
79
|
-
}, children)) : /*#__PURE__*/React.createElement(View, {
|
|
80
|
-
style: innerStyle
|
|
81
|
-
}, children));
|
|
82
|
-
};
|
|
83
|
-
export default withTheme(Container);
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { ActivityIndicator, View, StyleSheet, Pressable } from "react-native";
|
|
4
|
-
import color from "color";
|
|
5
|
-
import Config from "./Config";
|
|
6
|
-
import Text from "./Text";
|
|
7
|
-
import Elevation from "./Elevation";
|
|
8
|
-
import { withTheme } from "../theming";
|
|
9
|
-
const FAB = _ref => {
|
|
10
|
-
let {
|
|
11
|
-
Icon,
|
|
12
|
-
icon,
|
|
13
|
-
disabled = false,
|
|
14
|
-
type = "solid",
|
|
15
|
-
loading = false,
|
|
16
|
-
color: colorOverride,
|
|
17
|
-
label,
|
|
18
|
-
onPress,
|
|
19
|
-
elevation = 0,
|
|
20
|
-
style,
|
|
21
|
-
theme: {
|
|
22
|
-
colors,
|
|
23
|
-
disabledOpacity,
|
|
24
|
-
roundness,
|
|
25
|
-
typography
|
|
26
|
-
},
|
|
27
|
-
...rest
|
|
28
|
-
} = _ref;
|
|
29
|
-
let backgroundColor, borderColor, textColor, borderWidth;
|
|
30
|
-
const buttonColor = colorOverride || colors.primary;
|
|
31
|
-
if (type === "standard" || type === "extended" || type === "fixed") {
|
|
32
|
-
backgroundColor = buttonColor;
|
|
33
|
-
if (disabled) {
|
|
34
|
-
textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();
|
|
35
|
-
} else {
|
|
36
|
-
textColor = colors.surface;
|
|
37
|
-
}
|
|
38
|
-
} else {
|
|
39
|
-
backgroundColor = "transparent";
|
|
40
|
-
if (disabled) {
|
|
41
|
-
textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
42
|
-
} else {
|
|
43
|
-
textColor = buttonColor;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (type === "outline") {
|
|
47
|
-
if (disabled) {
|
|
48
|
-
borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
49
|
-
} else {
|
|
50
|
-
borderColor = buttonColor;
|
|
51
|
-
}
|
|
52
|
-
borderWidth = StyleSheet.hairlineWidth;
|
|
53
|
-
} else {
|
|
54
|
-
borderColor = "transparent";
|
|
55
|
-
borderWidth = 0;
|
|
56
|
-
}
|
|
57
|
-
const buttonStyle = {
|
|
58
|
-
backgroundColor,
|
|
59
|
-
borderColor,
|
|
60
|
-
borderWidth,
|
|
61
|
-
borderRadius: roundness,
|
|
62
|
-
alignItems: "center",
|
|
63
|
-
justifyContent: "center"
|
|
64
|
-
};
|
|
65
|
-
const buttonStyles = [styles.button, buttonStyle];
|
|
66
|
-
const contentStyle = [styles.content];
|
|
67
|
-
const textStyle = {
|
|
68
|
-
textAlign: "center",
|
|
69
|
-
color: textColor
|
|
70
|
-
};
|
|
71
|
-
const iconStyle = [styles.icon, {
|
|
72
|
-
width: Config.buttonIconSize
|
|
73
|
-
}];
|
|
74
|
-
if (type === "standard" || type === "outline") {
|
|
75
|
-
buttonStyle.width = Config.FABSize;
|
|
76
|
-
buttonStyle.height = Config.FABSize;
|
|
77
|
-
buttonStyle.borderRadius = Config.FABBorderRadius;
|
|
78
|
-
contentStyle.push({
|
|
79
|
-
width: Config.FABSize,
|
|
80
|
-
height: Config.FABSize
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
if (type === "extended" || type === "fixed") {
|
|
84
|
-
iconStyle.push({
|
|
85
|
-
marginLeft: 16,
|
|
86
|
-
marginRight: -8
|
|
87
|
-
});
|
|
88
|
-
textStyle.margin = 16;
|
|
89
|
-
}
|
|
90
|
-
if (type === "fixed") {
|
|
91
|
-
buttonStyles.push({
|
|
92
|
-
height: Config.FABFixedHeight,
|
|
93
|
-
alignSelf: "stretch"
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
return /*#__PURE__*/React.createElement(Elevation, {
|
|
97
|
-
style: [{
|
|
98
|
-
elevation
|
|
99
|
-
}, style]
|
|
100
|
-
}, /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
|
|
101
|
-
onPress: onPress,
|
|
102
|
-
accessibilityState: {
|
|
103
|
-
disabled
|
|
104
|
-
},
|
|
105
|
-
accessibilityRole: "button",
|
|
106
|
-
disabled: disabled || loading,
|
|
107
|
-
style: buttonStyles
|
|
108
|
-
}), /*#__PURE__*/React.createElement(View, {
|
|
109
|
-
style: styles.content
|
|
110
|
-
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
111
|
-
style: iconStyle
|
|
112
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
113
|
-
name: icon,
|
|
114
|
-
size: Config.buttonIconSize,
|
|
115
|
-
color: textColor
|
|
116
|
-
})) : null, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
117
|
-
size: "small",
|
|
118
|
-
color: textColor,
|
|
119
|
-
style: iconStyle
|
|
120
|
-
}) : null, label ? /*#__PURE__*/React.createElement(Text, {
|
|
121
|
-
numberOfLines: 1,
|
|
122
|
-
style: [textStyle, typography.button]
|
|
123
|
-
}, label) : null)));
|
|
124
|
-
};
|
|
125
|
-
const styles = StyleSheet.create({
|
|
126
|
-
button: {
|
|
127
|
-
borderStyle: "solid"
|
|
128
|
-
},
|
|
129
|
-
content: {
|
|
130
|
-
flexDirection: "row",
|
|
131
|
-
alignItems: "center",
|
|
132
|
-
justifyContent: "center"
|
|
133
|
-
},
|
|
134
|
-
icon: {
|
|
135
|
-
alignItems: "center",
|
|
136
|
-
justifyContent: "center",
|
|
137
|
-
width: Config.buttonIconSize
|
|
138
|
-
},
|
|
139
|
-
fixed: {
|
|
140
|
-
left: 0,
|
|
141
|
-
right: 0,
|
|
142
|
-
bottom: 0,
|
|
143
|
-
height: 64,
|
|
144
|
-
borderRadius: 0
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
export default withTheme(FAB);
|