@draftbit/core 46.2.4-dedb7a.0 → 46.2.4-fab8f2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Config.js +1 -0
- package/lib/commonjs/components/DeprecatedButton.js +4 -22
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +11 -2
- package/lib/commonjs/components/SVG/SVG.js +33 -0
- package/lib/commonjs/components/SVG/SVG.web.js +30 -0
- package/lib/commonjs/components/TextField.js +2 -1
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/mappings/Image.js +2 -2
- package/lib/commonjs/mappings/MapView.js +1 -0
- package/lib/commonjs/mappings/SVG.js +24 -0
- package/lib/commonjs/mappings/TextField.js +4 -0
- package/lib/module/components/Config.js +1 -0
- package/lib/module/components/SVG/SVG.js +19 -0
- package/lib/module/components/SVG/SVG.web.js +17 -0
- package/lib/module/components/TextField.js +2 -1
- package/lib/module/index.js +1 -0
- package/lib/module/mappings/Image.js +2 -2
- package/lib/module/mappings/MapView.js +1 -0
- package/lib/module/mappings/SVG.js +15 -0
- package/lib/module/mappings/TextField.js +4 -0
- package/lib/typescript/src/components/Config.d.ts +1 -0
- package/lib/typescript/src/components/SVG/SVG.d.ts +8 -0
- package/lib/typescript/src/components/SVG/SVG.web.d.ts +8 -0
- package/lib/typescript/src/components/TextField.d.ts +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/mappings/MapView.d.ts +1 -0
- package/lib/typescript/src/mappings/SVG.d.ts +23 -0
- package/lib/typescript/src/mappings/TextField.d.ts +10 -0
- package/package.json +4 -3
- package/src/components/Config.js +1 -0
- package/src/components/Config.ts +1 -0
- package/src/components/SVG/SVG.js +8 -0
- package/src/components/SVG/SVG.tsx +21 -0
- package/src/components/SVG/SVG.web.js +6 -0
- package/src/components/SVG/SVG.web.tsx +16 -0
- package/src/components/TextField.js +2 -2
- package/src/components/TextField.tsx +3 -1
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/Image.js +2 -2
- package/src/mappings/Image.ts +2 -2
- package/src/mappings/MapView.js +1 -0
- package/src/mappings/MapView.ts +1 -0
- package/src/mappings/SVG.js +20 -0
- package/src/mappings/SVG.ts +25 -0
- package/src/mappings/TextField.js +4 -0
- package/src/mappings/TextField.ts +4 -0
|
@@ -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;
|
|
@@ -17,8 +17,6 @@ var _RadioButtonGroup = _interopRequireDefault(require("./RadioButtonGroup"));
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
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
20
|
const RadioButtonFieldGroup = _ref => {
|
|
23
21
|
let {
|
|
24
22
|
label,
|
|
@@ -35,6 +33,17 @@ const RadioButtonFieldGroup = _ref => {
|
|
|
35
33
|
fontSize: theme.typography.headline4.fontSize,
|
|
36
34
|
color: theme.typography.headline4.color
|
|
37
35
|
}, labelStyle]
|
|
36
|
+
}, label), /*#__PURE__*/_react.default.createElement(_RadioButtonGroup.default, {
|
|
37
|
+
theme: theme,
|
|
38
|
+
...rest
|
|
39
|
+
}, children));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var _default = (0, _theming.withTheme)(RadioButtonFieldGroup);
|
|
43
|
+
|
|
44
|
+
exports.default = _default; fontSize: theme.typography.headline4.fontSize,
|
|
45
|
+
color: theme.typography.headline4.color
|
|
46
|
+
}, labelStyle]
|
|
38
47
|
}, label), /*#__PURE__*/_react.default.createElement(_RadioButtonGroup.default, _extends({
|
|
39
48
|
theme: theme
|
|
40
49
|
}, rest), children));
|
|
@@ -0,0 +1,33 @@
|
|
|
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 _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _reactNativeSvg = require("react-native-svg");
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
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
|
+
|
|
18
|
+
const SVG = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
source = "https://static.draftbit.com/images/placeholder-image.svg",
|
|
21
|
+
style
|
|
22
|
+
} = _ref;
|
|
23
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
24
|
+
style: style
|
|
25
|
+
}, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgUri, {
|
|
26
|
+
width: "100%",
|
|
27
|
+
height: "100%",
|
|
28
|
+
uri: source
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var _default = SVG;
|
|
33
|
+
exports.default = _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 _reactNative = require("react-native");
|
|
11
|
+
|
|
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
|
+
|
|
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
|
+
|
|
16
|
+
const SVG = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
source = "https://static.draftbit.com/images/placeholder-image.svg",
|
|
19
|
+
style
|
|
20
|
+
} = _ref;
|
|
21
|
+
return /*#__PURE__*/React.createElement(_reactNative.Image, {
|
|
22
|
+
style: style,
|
|
23
|
+
source: {
|
|
24
|
+
uri: source
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var _default = SVG;
|
|
30
|
+
exports.default = _default;
|
|
@@ -193,6 +193,7 @@ class TextField extends React.Component {
|
|
|
193
193
|
rightIconName,
|
|
194
194
|
assistiveText,
|
|
195
195
|
underlineColor: underlineColorProp,
|
|
196
|
+
activeBorderColor: activeBorderColorProp,
|
|
196
197
|
multiline = false,
|
|
197
198
|
numberOfLines = 4,
|
|
198
199
|
style,
|
|
@@ -220,7 +221,7 @@ class TextField extends React.Component {
|
|
|
220
221
|
underlineColor = "transparent";
|
|
221
222
|
backgroundColor = colors.divider;
|
|
222
223
|
} else {
|
|
223
|
-
activeColor = error ? colors.error :
|
|
224
|
+
activeColor = error ? colors.error : activeBorderColorProp;
|
|
224
225
|
placeholderColor = borderColor = colors.light;
|
|
225
226
|
underlineColor = underlineColorProp;
|
|
226
227
|
backgroundColor = colors.background;
|
package/lib/commonjs/index.js
CHANGED
|
@@ -291,6 +291,12 @@ Object.defineProperty(exports, "RowHeadlineImageIcon", {
|
|
|
291
291
|
return _RowHeadlineImageIcon.default;
|
|
292
292
|
}
|
|
293
293
|
});
|
|
294
|
+
Object.defineProperty(exports, "SVG", {
|
|
295
|
+
enumerable: true,
|
|
296
|
+
get: function () {
|
|
297
|
+
return _SVG.default;
|
|
298
|
+
}
|
|
299
|
+
});
|
|
294
300
|
Object.defineProperty(exports, "ScreenContainer", {
|
|
295
301
|
enumerable: true,
|
|
296
302
|
get: function () {
|
|
@@ -442,6 +448,8 @@ var _IconButton = _interopRequireDefault(require("./components/IconButton"));
|
|
|
442
448
|
|
|
443
449
|
var _Image = _interopRequireDefault(require("./components/Image"));
|
|
444
450
|
|
|
451
|
+
var _SVG = _interopRequireDefault(require("./components/SVG/SVG"));
|
|
452
|
+
|
|
445
453
|
var _NumberInput = _interopRequireDefault(require("./components/NumberInput"));
|
|
446
454
|
|
|
447
455
|
var _ScreenContainer = _interopRequireDefault(require("./components/ScreenContainer"));
|
|
@@ -14,8 +14,8 @@ const SEED_DATA = {
|
|
|
14
14
|
category: _types.COMPONENT_TYPES.media,
|
|
15
15
|
stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
16
16
|
layout: {
|
|
17
|
-
width:
|
|
18
|
-
height:
|
|
17
|
+
width: 100,
|
|
18
|
+
height: 100
|
|
19
19
|
},
|
|
20
20
|
props: {
|
|
21
21
|
source: (0, _types.createImageProp)(),
|
|
@@ -0,0 +1,24 @@
|
|
|
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: "SVG",
|
|
12
|
+
tag: "SVG",
|
|
13
|
+
description: "An SVG component",
|
|
14
|
+
category: _types.COMPONENT_TYPES.media,
|
|
15
|
+
layout: {
|
|
16
|
+
width: 100,
|
|
17
|
+
height: 100
|
|
18
|
+
},
|
|
19
|
+
stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
20
|
+
props: {
|
|
21
|
+
source: (0, _types.createSvgProp)()
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -288,6 +288,10 @@ const SEED_DATA = [{
|
|
|
288
288
|
label: "Underline Color",
|
|
289
289
|
defaultValue: "light"
|
|
290
290
|
}),
|
|
291
|
+
activeBorderColor: (0, _types.createColorProp)({
|
|
292
|
+
label: "Active Border Color",
|
|
293
|
+
defaultValue: "primary"
|
|
294
|
+
}),
|
|
291
295
|
secureTextEntry: {
|
|
292
296
|
group: _types.GROUPS.basic,
|
|
293
297
|
label: "Password field",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { SvgUri } from "react-native-svg";
|
|
4
|
+
|
|
5
|
+
const SVG = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
source = "https://static.draftbit.com/images/placeholder-image.svg",
|
|
8
|
+
style
|
|
9
|
+
} = _ref;
|
|
10
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
11
|
+
style: style
|
|
12
|
+
}, /*#__PURE__*/React.createElement(SvgUri, {
|
|
13
|
+
width: "100%",
|
|
14
|
+
height: "100%",
|
|
15
|
+
uri: source
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default SVG;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Image } from "react-native";
|
|
3
|
+
|
|
4
|
+
const SVG = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
source = "https://static.draftbit.com/images/placeholder-image.svg",
|
|
7
|
+
style
|
|
8
|
+
} = _ref;
|
|
9
|
+
return /*#__PURE__*/React.createElement(Image, {
|
|
10
|
+
style: style,
|
|
11
|
+
source: {
|
|
12
|
+
uri: source
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default SVG;
|
|
@@ -177,6 +177,7 @@ class TextField extends React.Component {
|
|
|
177
177
|
rightIconName,
|
|
178
178
|
assistiveText,
|
|
179
179
|
underlineColor: underlineColorProp,
|
|
180
|
+
activeBorderColor: activeBorderColorProp,
|
|
180
181
|
multiline = false,
|
|
181
182
|
numberOfLines = 4,
|
|
182
183
|
style,
|
|
@@ -204,7 +205,7 @@ class TextField extends React.Component {
|
|
|
204
205
|
underlineColor = "transparent";
|
|
205
206
|
backgroundColor = colors.divider;
|
|
206
207
|
} else {
|
|
207
|
-
activeColor = error ? colors.error :
|
|
208
|
+
activeColor = error ? colors.error : activeBorderColorProp;
|
|
208
209
|
placeholderColor = borderColor = colors.light;
|
|
209
210
|
underlineColor = underlineColorProp;
|
|
210
211
|
backgroundColor = colors.background;
|
package/lib/module/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export { default as FAB } from "./components/FAB";
|
|
|
17
17
|
export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
|
|
18
18
|
export { default as IconButton } from "./components/IconButton";
|
|
19
19
|
export { default as Image } from "./components/Image";
|
|
20
|
+
export { default as SVG } from "./components/SVG/SVG";
|
|
20
21
|
export { default as NumberInput } from "./components/NumberInput";
|
|
21
22
|
export { default as ScreenContainer } from "./components/ScreenContainer";
|
|
22
23
|
export { default as StarRating } from "./components/StarRating";
|
|
@@ -6,8 +6,8 @@ export const SEED_DATA = {
|
|
|
6
6
|
category: COMPONENT_TYPES.media,
|
|
7
7
|
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Position, StylesPanelSections.Effects],
|
|
8
8
|
layout: {
|
|
9
|
-
width:
|
|
10
|
-
height:
|
|
9
|
+
width: 100,
|
|
10
|
+
height: 100
|
|
11
11
|
},
|
|
12
12
|
props: {
|
|
13
13
|
source: createImageProp(),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createSvgProp, StylesPanelSections } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "SVG",
|
|
4
|
+
tag: "SVG",
|
|
5
|
+
description: "An SVG component",
|
|
6
|
+
category: COMPONENT_TYPES.media,
|
|
7
|
+
layout: {
|
|
8
|
+
width: 100,
|
|
9
|
+
height: 100
|
|
10
|
+
},
|
|
11
|
+
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Position, StylesPanelSections.Effects],
|
|
12
|
+
props: {
|
|
13
|
+
source: createSvgProp()
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -280,6 +280,10 @@ export const SEED_DATA = [{
|
|
|
280
280
|
label: "Underline Color",
|
|
281
281
|
defaultValue: "light"
|
|
282
282
|
}),
|
|
283
|
+
activeBorderColor: createColorProp({
|
|
284
|
+
label: "Active Border Color",
|
|
285
|
+
defaultValue: "primary"
|
|
286
|
+
}),
|
|
283
287
|
secureTextEntry: {
|
|
284
288
|
group: GROUPS.basic,
|
|
285
289
|
label: "Password field",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
declare type SvgComponentProps = {
|
|
4
|
+
source: string;
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
};
|
|
7
|
+
declare const SVG: React.FC<React.PropsWithChildren<SvgComponentProps>>;
|
|
8
|
+
export default SVG;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleProp, ImageStyle } from "react-native";
|
|
3
|
+
declare type SvgComponentProps = {
|
|
4
|
+
source: string;
|
|
5
|
+
style?: StyleProp<ImageStyle>;
|
|
6
|
+
};
|
|
7
|
+
declare const SVG: React.FC<React.PropsWithChildren<SvgComponentProps>>;
|
|
8
|
+
export default SVG;
|
|
@@ -17,6 +17,7 @@ export { default as FAB } from "./components/FAB";
|
|
|
17
17
|
export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
|
|
18
18
|
export { default as IconButton } from "./components/IconButton";
|
|
19
19
|
export { default as Image } from "./components/Image";
|
|
20
|
+
export { default as SVG } from "./components/SVG/SVG";
|
|
20
21
|
export { default as NumberInput } from "./components/NumberInput";
|
|
21
22
|
export { default as ScreenContainer } from "./components/ScreenContainer";
|
|
22
23
|
export { default as StarRating } from "./components/StarRating";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const SEED_DATA: {
|
|
2
|
+
name: string;
|
|
3
|
+
tag: string;
|
|
4
|
+
description: string;
|
|
5
|
+
category: string;
|
|
6
|
+
layout: {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
stylesPanelSections: string[];
|
|
11
|
+
props: {
|
|
12
|
+
source: {
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
group: string;
|
|
16
|
+
formType: string;
|
|
17
|
+
propType: string;
|
|
18
|
+
defaultValue: string;
|
|
19
|
+
editable: boolean;
|
|
20
|
+
required: boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -28,6 +28,16 @@ export declare const SEED_DATA: ({
|
|
|
28
28
|
formType: string;
|
|
29
29
|
propType: string;
|
|
30
30
|
};
|
|
31
|
+
activeBorderColor: {
|
|
32
|
+
group: string;
|
|
33
|
+
label: string;
|
|
34
|
+
description: string;
|
|
35
|
+
editable: boolean;
|
|
36
|
+
required: boolean;
|
|
37
|
+
defaultValue: null;
|
|
38
|
+
formType: string;
|
|
39
|
+
propType: string;
|
|
40
|
+
};
|
|
31
41
|
secureTextEntry: {
|
|
32
42
|
group: string;
|
|
33
43
|
label: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.2.4-
|
|
3
|
+
"version": "46.2.4-fab8f2.5+fab8f218",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.2.
|
|
44
|
+
"@draftbit/types": "^46.2.4-fab8f2.5+fab8f218",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"lodash.omit": "^4.5.0",
|
|
54
54
|
"lodash.tonumber": "^4.0.3",
|
|
55
55
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
56
|
+
"react-native-svg": "^12.3.0",
|
|
56
57
|
"react-native-typography": "^1.4.1",
|
|
57
58
|
"react-native-web-swiper": "^2.2.3"
|
|
58
59
|
},
|
|
@@ -79,5 +80,5 @@
|
|
|
79
80
|
]
|
|
80
81
|
]
|
|
81
82
|
},
|
|
82
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "fab8f2182966b8a29fce75336ba899e86364c2cb"
|
|
83
84
|
}
|
package/src/components/Config.js
CHANGED
|
@@ -42,6 +42,7 @@ export default {
|
|
|
42
42
|
cardIconElevation: 1,
|
|
43
43
|
placeholderImageURL: "https://static.draftbit.com/images/placeholder-image" + getExtension(),
|
|
44
44
|
getPlaceholderImageUrl: (size) => buildImageUrl({ width: size.width, height: size.height }, "image-placeholder_1"),
|
|
45
|
+
placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
|
|
45
46
|
squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
|
|
46
47
|
FABSize: 40,
|
|
47
48
|
FABBorderRadius: 20,
|
package/src/components/Config.ts
CHANGED
|
@@ -60,6 +60,7 @@ export default {
|
|
|
60
60
|
{ width: size.width, height: size.height },
|
|
61
61
|
"image-placeholder_1"
|
|
62
62
|
),
|
|
63
|
+
placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
|
|
63
64
|
squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
|
|
64
65
|
FABSize: 40,
|
|
65
66
|
FABBorderRadius: 20,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { SvgUri } from "react-native-svg";
|
|
4
|
+
const SVG = ({ source = "https://static.draftbit.com/images/placeholder-image.svg", style, }) => {
|
|
5
|
+
return (React.createElement(View, { style: style },
|
|
6
|
+
React.createElement(SvgUri, { width: "100%", height: "100%", uri: source })));
|
|
7
|
+
};
|
|
8
|
+
export default SVG;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import { SvgUri } from "react-native-svg";
|
|
4
|
+
|
|
5
|
+
type SvgComponentProps = {
|
|
6
|
+
source: string;
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const SVG: React.FC<React.PropsWithChildren<SvgComponentProps>> = ({
|
|
11
|
+
source = "https://static.draftbit.com/images/placeholder-image.svg",
|
|
12
|
+
style,
|
|
13
|
+
}) => {
|
|
14
|
+
return (
|
|
15
|
+
<View style={style}>
|
|
16
|
+
<SvgUri width="100%" height="100%" uri={source} />
|
|
17
|
+
</View>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default SVG;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Image } from "react-native";
|
|
3
|
+
const SVG = ({ source = "https://static.draftbit.com/images/placeholder-image.svg", style, }) => {
|
|
4
|
+
return React.createElement(Image, { style: style, source: { uri: source } });
|
|
5
|
+
};
|
|
6
|
+
export default SVG;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Image, StyleProp, ImageStyle } from "react-native";
|
|
3
|
+
|
|
4
|
+
type SvgComponentProps = {
|
|
5
|
+
source: string;
|
|
6
|
+
style?: StyleProp<ImageStyle>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const SVG: React.FC<React.PropsWithChildren<SvgComponentProps>> = ({
|
|
10
|
+
source = "https://static.draftbit.com/images/placeholder-image.svg",
|
|
11
|
+
style,
|
|
12
|
+
}) => {
|
|
13
|
+
return <Image style={style} source={{ uri: source }} />;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default SVG;
|
|
@@ -136,7 +136,7 @@ class TextField extends React.Component {
|
|
|
136
136
|
return this._root && this._root.blur();
|
|
137
137
|
}
|
|
138
138
|
render() {
|
|
139
|
-
const { Icon, type = "underline", disabled = false, label, error = false, leftIconName, leftIconMode, rightIconName, assistiveText, underlineColor: underlineColorProp, multiline = false, numberOfLines = 4, style, theme: { colors, typography, roundness, disabledOpacity }, render = (props) => React.createElement(NativeTextInput, { ...props }), ...rest } = this.props;
|
|
139
|
+
const { Icon, type = "underline", disabled = false, label, error = false, leftIconName, leftIconMode, rightIconName, assistiveText, underlineColor: underlineColorProp, activeBorderColor: activeBorderColorProp, multiline = false, numberOfLines = 4, style, theme: { colors, typography, roundness, disabledOpacity }, render = (props) => React.createElement(NativeTextInput, { ...props }), ...rest } = this.props;
|
|
140
140
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
141
141
|
const OUTLINE_MINIMIZED_LABEL_Y_OFFSET = -(16 * 0.5 + 4);
|
|
142
142
|
const MAXIMIZED_LABEL_FONT_SIZE = typography.subtitle1.fontSize;
|
|
@@ -152,7 +152,7 @@ class TextField extends React.Component {
|
|
|
152
152
|
backgroundColor = colors.divider;
|
|
153
153
|
}
|
|
154
154
|
else {
|
|
155
|
-
activeColor = error ? colors.error :
|
|
155
|
+
activeColor = error ? colors.error : activeBorderColorProp;
|
|
156
156
|
placeholderColor = borderColor = colors.light;
|
|
157
157
|
underlineColor = underlineColorProp;
|
|
158
158
|
backgroundColor = colors.background;
|
|
@@ -42,6 +42,7 @@ export type Props = {
|
|
|
42
42
|
multiline?: boolean;
|
|
43
43
|
numberOfLines: number;
|
|
44
44
|
underlineColor?: string;
|
|
45
|
+
activeBorderColor?: string;
|
|
45
46
|
style?: StyleProp<ViewStyle> & { height?: number };
|
|
46
47
|
theme: Theme;
|
|
47
48
|
render?: (
|
|
@@ -237,6 +238,7 @@ class TextField extends React.Component<Props, State> {
|
|
|
237
238
|
rightIconName,
|
|
238
239
|
assistiveText,
|
|
239
240
|
underlineColor: underlineColorProp,
|
|
241
|
+
activeBorderColor: activeBorderColorProp,
|
|
240
242
|
multiline = false,
|
|
241
243
|
numberOfLines = 4,
|
|
242
244
|
style,
|
|
@@ -269,7 +271,7 @@ class TextField extends React.Component<Props, State> {
|
|
|
269
271
|
underlineColor = "transparent";
|
|
270
272
|
backgroundColor = colors.divider;
|
|
271
273
|
} else {
|
|
272
|
-
activeColor = error ? colors.error :
|
|
274
|
+
activeColor = error ? colors.error : activeBorderColorProp;
|
|
273
275
|
placeholderColor = borderColor = colors.light;
|
|
274
276
|
underlineColor = underlineColorProp;
|
|
275
277
|
backgroundColor = colors.background;
|
package/src/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export { default as FAB } from "./components/FAB";
|
|
|
17
17
|
export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
|
|
18
18
|
export { default as IconButton } from "./components/IconButton";
|
|
19
19
|
export { default as Image } from "./components/Image";
|
|
20
|
+
export { default as SVG } from "./components/SVG/SVG";
|
|
20
21
|
export { default as NumberInput } from "./components/NumberInput";
|
|
21
22
|
export { default as ScreenContainer } from "./components/ScreenContainer";
|
|
22
23
|
export { default as StarRating } from "./components/StarRating";
|
package/src/index.tsx
CHANGED
|
@@ -18,6 +18,7 @@ export { default as FAB } from "./components/FAB";
|
|
|
18
18
|
export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
|
|
19
19
|
export { default as IconButton } from "./components/IconButton";
|
|
20
20
|
export { default as Image } from "./components/Image";
|
|
21
|
+
export { default as SVG } from "./components/SVG/SVG";
|
|
21
22
|
export { default as NumberInput } from "./components/NumberInput";
|
|
22
23
|
export { default as ScreenContainer } from "./components/ScreenContainer";
|
|
23
24
|
export { default as StarRating } from "./components/StarRating";
|
package/src/mappings/Image.js
CHANGED
package/src/mappings/Image.ts
CHANGED
package/src/mappings/MapView.js
CHANGED
package/src/mappings/MapView.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createSvgProp, StylesPanelSections, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "SVG",
|
|
4
|
+
tag: "SVG",
|
|
5
|
+
description: "An SVG component",
|
|
6
|
+
category: COMPONENT_TYPES.media,
|
|
7
|
+
layout: {
|
|
8
|
+
width: 100,
|
|
9
|
+
height: 100,
|
|
10
|
+
},
|
|
11
|
+
stylesPanelSections: [
|
|
12
|
+
StylesPanelSections.Size,
|
|
13
|
+
StylesPanelSections.Margins,
|
|
14
|
+
StylesPanelSections.Position,
|
|
15
|
+
StylesPanelSections.Effects,
|
|
16
|
+
],
|
|
17
|
+
props: {
|
|
18
|
+
source: createSvgProp(),
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createSvgProp,
|
|
4
|
+
StylesPanelSections,
|
|
5
|
+
} from "@draftbit/types";
|
|
6
|
+
|
|
7
|
+
export const SEED_DATA = {
|
|
8
|
+
name: "SVG",
|
|
9
|
+
tag: "SVG",
|
|
10
|
+
description: "An SVG component",
|
|
11
|
+
category: COMPONENT_TYPES.media,
|
|
12
|
+
layout: {
|
|
13
|
+
width: 100,
|
|
14
|
+
height: 100,
|
|
15
|
+
},
|
|
16
|
+
stylesPanelSections: [
|
|
17
|
+
StylesPanelSections.Size,
|
|
18
|
+
StylesPanelSections.Margins,
|
|
19
|
+
StylesPanelSections.Position,
|
|
20
|
+
StylesPanelSections.Effects,
|
|
21
|
+
],
|
|
22
|
+
props: {
|
|
23
|
+
source: createSvgProp(),
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -309,6 +309,10 @@ export const SEED_DATA = [
|
|
|
309
309
|
label: "Underline Color",
|
|
310
310
|
defaultValue: "light",
|
|
311
311
|
}),
|
|
312
|
+
activeBorderColor: createColorProp({
|
|
313
|
+
label: "Active Border Color",
|
|
314
|
+
defaultValue: "primary",
|
|
315
|
+
}),
|
|
312
316
|
secureTextEntry: {
|
|
313
317
|
group: GROUPS.basic,
|
|
314
318
|
label: "Password field",
|
|
@@ -331,6 +331,10 @@ export const SEED_DATA = [
|
|
|
331
331
|
label: "Underline Color",
|
|
332
332
|
defaultValue: "light",
|
|
333
333
|
}),
|
|
334
|
+
activeBorderColor: createColorProp({
|
|
335
|
+
label: "Active Border Color",
|
|
336
|
+
defaultValue: "primary",
|
|
337
|
+
}),
|
|
334
338
|
secureTextEntry: {
|
|
335
339
|
group: GROUPS.basic,
|
|
336
340
|
label: "Password field",
|