@draftbit/core 47.1.1-cbba04.2 → 47.1.1-ee131b.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/Button.js +2 -2
- package/lib/commonjs/components/IconButton.js +4 -2
- package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
- package/lib/commonjs/components/Pressable.js +2 -2
- package/lib/commonjs/components/Touchable.js +2 -2
- package/lib/commonjs/mappings/Button.js +2 -2
- package/lib/commonjs/mappings/FlashList.js +3 -3
- package/lib/commonjs/mappings/FlatList.js +2 -2
- package/lib/commonjs/mappings/IconButton.js +4 -6
- package/lib/commonjs/mappings/MapView.js +3 -1
- package/lib/commonjs/mappings/ScrollView.js +1 -1
- package/lib/commonjs/mappings/Touchable.js +9 -2
- package/lib/module/components/Banner.js +4 -25
- package/lib/module/components/Button.js +2 -2
- package/lib/module/components/Checkbox/context.js +1 -1
- package/lib/module/components/DeprecatedButton.js +3 -21
- package/lib/module/components/DeprecatedCardWrapper.js +1 -18
- package/lib/module/components/IconButton.js +4 -2
- package/lib/module/components/Layout.js +21 -42
- package/lib/module/components/Pressable.js +4 -17
- package/lib/module/components/ProgressBar.js +7 -39
- package/lib/module/components/StarRating.js +4 -24
- package/lib/module/components/StepIndicator.js +18 -58
- package/lib/module/components/Touchable.js +2 -2
- package/lib/module/mappings/Button.js +2 -2
- package/lib/module/mappings/FlashList.js +3 -3
- package/lib/module/mappings/FlatList.js +2 -2
- package/lib/module/mappings/IconButton.js +5 -7
- package/lib/module/mappings/MapView.js +3 -1
- package/lib/module/mappings/ScrollView.js +1 -1
- package/lib/module/mappings/Touchable.js +10 -3
- package/lib/typescript/src/components/IconButton.d.ts +2 -0
- package/lib/typescript/src/components/IconButton.d.ts.map +1 -1
- package/lib/typescript/src/components/Pressable.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/mappings/IconButton.d.ts +20 -10
- package/lib/typescript/src/mappings/IconButton.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapView.d.ts +2 -0
- package/lib/typescript/src/mappings/MapView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Touchable.d.ts +20 -0
- package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/Button.js +1 -1
- package/src/components/Button.tsx +2 -2
- package/src/components/IconButton.js +2 -2
- package/src/components/IconButton.tsx +6 -2
- package/src/components/Pressable.js +1 -1
- package/src/components/Pressable.tsx +2 -2
- package/src/components/Touchable.js +1 -1
- package/src/components/Touchable.tsx +2 -2
- package/src/mappings/Button.js +2 -2
- package/src/mappings/Button.ts +2 -2
- package/src/mappings/FlashList.js +3 -3
- package/src/mappings/FlashList.ts +3 -3
- package/src/mappings/FlatList.js +2 -2
- package/src/mappings/FlatList.ts +2 -2
- package/src/mappings/IconButton.js +5 -7
- package/src/mappings/IconButton.ts +5 -7
- package/src/mappings/MapView.js +2 -0
- package/src/mappings/MapView.ts +2 -0
- package/src/mappings/ScrollView.js +1 -1
- package/src/mappings/ScrollView.ts +1 -1
- package/src/mappings/Touchable.js +10 -3
- package/src/mappings/Touchable.ts +12 -2
|
@@ -1,3 +1,4 @@
|
|
|
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); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { View, StyleSheet, Pressable } from "react-native";
|
|
3
4
|
import { withTheme } from "../theming";
|
|
@@ -31,10 +32,9 @@ const StarRating = _ref => {
|
|
|
31
32
|
!!onPress && onPress(r);
|
|
32
33
|
}, [onPress]);
|
|
33
34
|
const ratingRounded = Math.round(localRating * 2) / 2;
|
|
34
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
35
|
-
style: [styles.container, style]
|
|
36
|
-
|
|
37
|
-
}, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(View, {
|
|
35
|
+
return /*#__PURE__*/React.createElement(View, _extends({
|
|
36
|
+
style: [styles.container, style]
|
|
37
|
+
}, rest), [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(View, {
|
|
38
38
|
key: i,
|
|
39
39
|
style: {
|
|
40
40
|
display: "flex"
|
|
@@ -74,24 +74,4 @@ const styles = StyleSheet.create({
|
|
|
74
74
|
width: "50%"
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
|
-
export default withTheme(StarRating);ntainer: {
|
|
78
|
-
flexDirection: "row",
|
|
79
|
-
alignItems: "center"
|
|
80
|
-
},
|
|
81
|
-
touchContainer: {
|
|
82
|
-
display: "flex",
|
|
83
|
-
flexDirection: "row",
|
|
84
|
-
position: "absolute",
|
|
85
|
-
top: 0,
|
|
86
|
-
right: 0,
|
|
87
|
-
left: 0,
|
|
88
|
-
bottom: 0,
|
|
89
|
-
zIndex: 1
|
|
90
|
-
},
|
|
91
|
-
pressable: {
|
|
92
|
-
flex: 1,
|
|
93
|
-
height: "100%",
|
|
94
|
-
width: "50%"
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
77
|
export default withTheme(StarRating);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1
4
|
// @ts-nocheck
|
|
2
5
|
import React, { Component } from "react";
|
|
3
6
|
import { View, Text, StyleSheet, Animated, TouchableWithoutFeedback } from "react-native";
|
|
@@ -9,7 +12,7 @@ const STEP_STATUS = {
|
|
|
9
12
|
export default class StepIndicator extends Component {
|
|
10
13
|
constructor(props) {
|
|
11
14
|
super(props);
|
|
12
|
-
this
|
|
15
|
+
_defineProperty(this, "renderProgressBarBackground", () => {
|
|
13
16
|
const {
|
|
14
17
|
stepCount,
|
|
15
18
|
direction
|
|
@@ -52,8 +55,8 @@ export default class StepIndicator extends Component {
|
|
|
52
55
|
},
|
|
53
56
|
style: progressBarBackgroundStyle
|
|
54
57
|
});
|
|
55
|
-
};
|
|
56
|
-
this
|
|
58
|
+
});
|
|
59
|
+
_defineProperty(this, "renderProgressBar", () => {
|
|
57
60
|
const {
|
|
58
61
|
stepCount,
|
|
59
62
|
direction
|
|
@@ -83,8 +86,8 @@ export default class StepIndicator extends Component {
|
|
|
83
86
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
84
87
|
style: progressBarStyle
|
|
85
88
|
});
|
|
86
|
-
};
|
|
87
|
-
this
|
|
89
|
+
});
|
|
90
|
+
_defineProperty(this, "renderStepIndicator", () => {
|
|
88
91
|
let steps = [];
|
|
89
92
|
const {
|
|
90
93
|
stepCount,
|
|
@@ -115,8 +118,8 @@ export default class StepIndicator extends Component {
|
|
|
115
118
|
height: this.state.customStyles.currentStepIndicatorSize
|
|
116
119
|
}]
|
|
117
120
|
}, steps);
|
|
118
|
-
};
|
|
119
|
-
this
|
|
121
|
+
});
|
|
122
|
+
_defineProperty(this, "renderStepLabels", () => {
|
|
120
123
|
const {
|
|
121
124
|
labels,
|
|
122
125
|
direction,
|
|
@@ -158,8 +161,8 @@ export default class StepIndicator extends Component {
|
|
|
158
161
|
alignItems: this.state.customStyles.labelAlign
|
|
159
162
|
}]
|
|
160
163
|
}, labelViews);
|
|
161
|
-
};
|
|
162
|
-
this
|
|
164
|
+
});
|
|
165
|
+
_defineProperty(this, "renderStep", position => {
|
|
163
166
|
const {
|
|
164
167
|
renderStepIndicator
|
|
165
168
|
} = this.props;
|
|
@@ -226,8 +229,8 @@ export default class StepIndicator extends Component {
|
|
|
226
229
|
}) : /*#__PURE__*/React.createElement(Text, {
|
|
227
230
|
style: indicatorLabelStyle
|
|
228
231
|
}, "".concat(position + 1)));
|
|
229
|
-
};
|
|
230
|
-
this
|
|
232
|
+
});
|
|
233
|
+
_defineProperty(this, "getStepStatus", stepPosition => {
|
|
231
234
|
const {
|
|
232
235
|
currentPosition
|
|
233
236
|
} = this.props;
|
|
@@ -238,8 +241,8 @@ export default class StepIndicator extends Component {
|
|
|
238
241
|
} else {
|
|
239
242
|
return STEP_STATUS.UNFINISHED;
|
|
240
243
|
}
|
|
241
|
-
};
|
|
242
|
-
this
|
|
244
|
+
});
|
|
245
|
+
_defineProperty(this, "onCurrentPositionChanged", position => {
|
|
243
246
|
let {
|
|
244
247
|
stepCount
|
|
245
248
|
} = this.props;
|
|
@@ -259,7 +262,7 @@ export default class StepIndicator extends Component {
|
|
|
259
262
|
toValue: this.state.customStyles.currentStepIndicatorSize / 2,
|
|
260
263
|
duration: 100
|
|
261
264
|
})])]).start();
|
|
262
|
-
};
|
|
265
|
+
});
|
|
263
266
|
const defaultStyles = {
|
|
264
267
|
stepIndicatorSize: 30,
|
|
265
268
|
currentStepIndicatorSize: 40,
|
|
@@ -325,6 +328,7 @@ export default class StepIndicator extends Component {
|
|
|
325
328
|
// ),
|
|
326
329
|
// }));
|
|
327
330
|
// }
|
|
331
|
+
|
|
328
332
|
if (prevProps.currentPosition !== this.props.currentPosition) {
|
|
329
333
|
this.onCurrentPositionChanged(this.props.currentPosition);
|
|
330
334
|
}
|
|
@@ -365,50 +369,6 @@ const styles = StyleSheet.create({
|
|
|
365
369
|
justifyContent: "center"
|
|
366
370
|
}
|
|
367
371
|
});
|
|
368
|
-
StepIndicator.defaultProps = {
|
|
369
|
-
currentPosition: 0,
|
|
370
|
-
stepCount: 5,
|
|
371
|
-
customStyles: {},
|
|
372
|
-
direction: "horizontal"
|
|
373
|
-
};rrentPositionChanged(this.props.currentPosition);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
const styles = StyleSheet.create({
|
|
378
|
-
container: {
|
|
379
|
-
backgroundColor: "transparent"
|
|
380
|
-
},
|
|
381
|
-
stepIndicatorContainer: {
|
|
382
|
-
flexDirection: "row",
|
|
383
|
-
alignItems: "center",
|
|
384
|
-
justifyContent: "space-around",
|
|
385
|
-
backgroundColor: "transparent"
|
|
386
|
-
},
|
|
387
|
-
stepLabelsContainer: {
|
|
388
|
-
justifyContent: "space-around"
|
|
389
|
-
},
|
|
390
|
-
step: {
|
|
391
|
-
alignItems: "center",
|
|
392
|
-
justifyContent: "center",
|
|
393
|
-
zIndex: 2
|
|
394
|
-
},
|
|
395
|
-
stepContainer: {
|
|
396
|
-
flex: 1,
|
|
397
|
-
flexDirection: "row",
|
|
398
|
-
alignItems: "center",
|
|
399
|
-
justifyContent: "center"
|
|
400
|
-
},
|
|
401
|
-
stepLabel: {
|
|
402
|
-
fontSize: 12,
|
|
403
|
-
textAlign: "center",
|
|
404
|
-
fontWeight: "500"
|
|
405
|
-
},
|
|
406
|
-
stepLabelItem: {
|
|
407
|
-
flex: 1,
|
|
408
|
-
alignItems: "center",
|
|
409
|
-
justifyContent: "center"
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
372
|
StepIndicator.defaultProps = {
|
|
413
373
|
currentPosition: 0,
|
|
414
374
|
stepCount: 5,
|
|
@@ -17,7 +17,7 @@ const SEED_DATA_PROPS = {
|
|
|
17
17
|
activeOpacity: createStaticNumberProp({
|
|
18
18
|
label: "Active Opacity",
|
|
19
19
|
description: "Opacity of the button when active.",
|
|
20
|
-
defaultValue:
|
|
20
|
+
defaultValue: null,
|
|
21
21
|
min: 0,
|
|
22
22
|
max: 1,
|
|
23
23
|
step: 0.01,
|
|
@@ -27,7 +27,7 @@ const SEED_DATA_PROPS = {
|
|
|
27
27
|
disabledOpacity: createStaticNumberProp({
|
|
28
28
|
label: "Disabled Opacity",
|
|
29
29
|
description: "Opacity of the button when disabled.",
|
|
30
|
-
defaultValue:
|
|
30
|
+
defaultValue: null,
|
|
31
31
|
min: 0,
|
|
32
32
|
max: 1,
|
|
33
33
|
step: 0.01,
|
|
@@ -40,8 +40,8 @@ export const SEED_DATA = [{
|
|
|
40
40
|
}),
|
|
41
41
|
showsHorizontalScrollIndicator: createStaticBoolProp({
|
|
42
42
|
label: "Show Horizontal Scroll Indicator",
|
|
43
|
-
description: "When true, shows a horizontal scroll indicator. The default value is
|
|
44
|
-
defaultValue:
|
|
43
|
+
description: "When true, shows a horizontal scroll indicator. The default value is true.",
|
|
44
|
+
defaultValue: true
|
|
45
45
|
}),
|
|
46
46
|
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
47
47
|
label: "Show Vertical Scroll Indicator",
|
|
@@ -99,7 +99,7 @@ export const SEED_DATA = [{
|
|
|
99
99
|
showsHorizontalScrollIndicator: createStaticBoolProp({
|
|
100
100
|
label: "Show Horizontal Scroll Indicator",
|
|
101
101
|
description: "When true, shows a horizontal scroll indicator. The default value is true.",
|
|
102
|
-
defaultValue:
|
|
102
|
+
defaultValue: true
|
|
103
103
|
}),
|
|
104
104
|
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
105
105
|
label: "Show Vertical Scroll Indicator",
|
|
@@ -39,8 +39,8 @@ export const SEED_DATA = {
|
|
|
39
39
|
}),
|
|
40
40
|
showsHorizontalScrollIndicator: createStaticBoolProp({
|
|
41
41
|
label: "Show Horizontal Scroll Indicator",
|
|
42
|
-
description: "When true, shows a horizontal scroll indicator. The default value is
|
|
43
|
-
defaultValue:
|
|
42
|
+
description: "When true, shows a horizontal scroll indicator. The default value is true.",
|
|
43
|
+
defaultValue: true
|
|
44
44
|
}),
|
|
45
45
|
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
46
46
|
label: "Show Vertical Scroll Indicator",
|
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, GROUPS, createIconProp, createColorProp, createNumberProp,
|
|
1
|
+
import { COMPONENT_TYPES, GROUPS, createIconProp, createColorProp, createNumberProp, createActionProp, Triggers, StylesPanelSections, createDisabledProp } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Icon Button",
|
|
4
4
|
tag: "IconButton",
|
|
5
5
|
category: COMPONENT_TYPES.button,
|
|
6
6
|
layout: {},
|
|
7
|
-
triggers: [Triggers.OnPress],
|
|
7
|
+
triggers: [Triggers.OnPress, Triggers.OnLongPress],
|
|
8
8
|
stylesPanelSections: [StylesPanelSections.Margins, StylesPanelSections.Effects, StylesPanelSections.Position],
|
|
9
9
|
props: {
|
|
10
10
|
onPress: createActionProp(),
|
|
11
|
+
onLongPress: createActionProp(),
|
|
12
|
+
disabled: createDisabledProp(),
|
|
11
13
|
icon: createIconProp(),
|
|
12
14
|
color: createColorProp({
|
|
13
15
|
label: "Color",
|
|
14
16
|
group: GROUPS.basic
|
|
15
17
|
}),
|
|
16
|
-
disabled: createBoolProp({
|
|
17
|
-
label: "Disabled",
|
|
18
|
-
group: GROUPS.basic
|
|
19
|
-
}),
|
|
20
18
|
size: createNumberProp({
|
|
21
19
|
group: GROUPS.basic,
|
|
22
20
|
label: "Size",
|
|
23
21
|
description: "Width and height of your icon",
|
|
24
22
|
defaultValue: 32,
|
|
25
23
|
min: 16,
|
|
26
|
-
max:
|
|
24
|
+
max: 256,
|
|
27
25
|
step: 1,
|
|
28
26
|
precision: 0
|
|
29
27
|
})
|
|
@@ -17,7 +17,7 @@ export const SEED_DATA = {
|
|
|
17
17
|
showsHorizontalScrollIndicator: createStaticBoolProp({
|
|
18
18
|
label: "Show Horizontal Scroll Indicator",
|
|
19
19
|
description: "When true, shows a horizontal scroll indicator. The default value is true.",
|
|
20
|
-
defaultValue:
|
|
20
|
+
defaultValue: true
|
|
21
21
|
}),
|
|
22
22
|
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
23
23
|
label: "Show Vertical Scroll Indicator",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections, createDisabledProp, GROUPS, createStaticBoolProp } from "@draftbit/types";
|
|
2
2
|
const SEED_DATA_PROPS = {
|
|
3
3
|
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Borders],
|
|
4
4
|
layout: {},
|
|
@@ -6,10 +6,11 @@ const SEED_DATA_PROPS = {
|
|
|
6
6
|
props: {
|
|
7
7
|
onPress: createActionProp(),
|
|
8
8
|
onLongPress: createActionProp(),
|
|
9
|
+
disabled: createDisabledProp(),
|
|
9
10
|
activeOpacity: createStaticNumberProp({
|
|
10
11
|
label: "Active Opacity",
|
|
11
12
|
description: "The opacity when the button is pressed.",
|
|
12
|
-
defaultValue:
|
|
13
|
+
defaultValue: null,
|
|
13
14
|
min: 0,
|
|
14
15
|
max: 1,
|
|
15
16
|
step: 0.01,
|
|
@@ -19,7 +20,7 @@ const SEED_DATA_PROPS = {
|
|
|
19
20
|
disabledOpacity: createStaticNumberProp({
|
|
20
21
|
label: "Disabled Opacity",
|
|
21
22
|
description: "The opacity when the button is disabled.",
|
|
22
|
-
defaultValue:
|
|
23
|
+
defaultValue: null,
|
|
23
24
|
min: 0,
|
|
24
25
|
max: 1,
|
|
25
26
|
step: 0.01,
|
|
@@ -35,6 +36,12 @@ const SEED_DATA_PROPS = {
|
|
|
35
36
|
label: "Hit Slop",
|
|
36
37
|
description: "Sets additional distance outside of element in which a press can be detected.",
|
|
37
38
|
required: false
|
|
39
|
+
}),
|
|
40
|
+
android_disableSound: createStaticBoolProp({
|
|
41
|
+
label: "Disable Sound",
|
|
42
|
+
description: "Disable the Android sound effect.",
|
|
43
|
+
defaultValue: null,
|
|
44
|
+
group: GROUPS.android
|
|
38
45
|
})
|
|
39
46
|
}
|
|
40
47
|
};
|
|
@@ -11,6 +11,8 @@ declare type Props = {
|
|
|
11
11
|
onPress: () => void;
|
|
12
12
|
theme: Theme;
|
|
13
13
|
style?: StyleProp<ViewStyle>;
|
|
14
|
+
activeOpacity?: number;
|
|
15
|
+
disabledOpacity?: number;
|
|
14
16
|
} & PressableProps & IconSlot;
|
|
15
17
|
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<Props>, "theme"> & {
|
|
16
18
|
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/components/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,SAAS,EACT,SAAS,EAET,cAAc,EAEf,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,aAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/components/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,SAAS,EACT,SAAS,EAET,cAAc,EAEf,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,aAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,GAChB,QAAQ,CAAC;;;;AA4DX,wBAAqC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../src/components/Pressable.tsx"],"names":[],"mappings":";AACA,OAAO,EAEL,cAAc,EACd,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../src/components/Pressable.tsx"],"names":[],"mappings":";AACA,OAAO,EAEL,cAAc,EACd,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAmB,EACnB,eAAqB,EACrB,cAAc,EACd,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,eAoBP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/components/Touchable.tsx"],"names":[],"mappings":";AACA,OAAO,EAAa,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/components/Touchable.tsx"],"names":[],"mappings":";AACA,OAAO,EAAa,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAmB,EACnB,eAAqB,EACrB,cAAc,EACd,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,eAoBP"}
|
|
@@ -16,35 +16,45 @@ export declare const SEED_DATA: {
|
|
|
16
16
|
defaultValue: null;
|
|
17
17
|
group: string;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
onLongPress: {
|
|
20
20
|
label: string;
|
|
21
21
|
description: string;
|
|
22
|
+
editable: boolean;
|
|
23
|
+
required: boolean;
|
|
22
24
|
formType: string;
|
|
23
25
|
propType: string;
|
|
24
|
-
defaultValue:
|
|
25
|
-
required: boolean;
|
|
26
|
-
editable: boolean;
|
|
26
|
+
defaultValue: null;
|
|
27
27
|
group: string;
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
group: string;
|
|
29
|
+
disabled: {
|
|
31
30
|
label: string;
|
|
32
31
|
description: string;
|
|
32
|
+
group: string;
|
|
33
33
|
editable: boolean;
|
|
34
34
|
required: boolean;
|
|
35
|
-
defaultValue: null;
|
|
36
35
|
formType: string;
|
|
37
36
|
propType: string;
|
|
37
|
+
defaultValue: null;
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
icon: {
|
|
40
40
|
label: string;
|
|
41
41
|
description: string;
|
|
42
42
|
formType: string;
|
|
43
43
|
propType: string;
|
|
44
|
-
defaultValue:
|
|
45
|
-
editable: boolean;
|
|
44
|
+
defaultValue: string;
|
|
46
45
|
required: boolean;
|
|
46
|
+
editable: boolean;
|
|
47
|
+
group: string;
|
|
48
|
+
};
|
|
49
|
+
color: {
|
|
47
50
|
group: string;
|
|
51
|
+
label: string;
|
|
52
|
+
description: string;
|
|
53
|
+
editable: boolean;
|
|
54
|
+
required: boolean;
|
|
55
|
+
defaultValue: null;
|
|
56
|
+
formType: string;
|
|
57
|
+
propType: string;
|
|
48
58
|
};
|
|
49
59
|
size: {
|
|
50
60
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/mappings/IconButton.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/mappings/IconButton.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapView.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapView.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6IrB,CAAC"}
|
|
@@ -23,6 +23,16 @@ export declare const SEED_DATA: {
|
|
|
23
23
|
defaultValue: null;
|
|
24
24
|
group: string;
|
|
25
25
|
};
|
|
26
|
+
disabled: {
|
|
27
|
+
label: string;
|
|
28
|
+
description: string;
|
|
29
|
+
group: string;
|
|
30
|
+
editable: boolean;
|
|
31
|
+
required: boolean;
|
|
32
|
+
formType: string;
|
|
33
|
+
propType: string;
|
|
34
|
+
defaultValue: null;
|
|
35
|
+
};
|
|
26
36
|
activeOpacity: {
|
|
27
37
|
label: string;
|
|
28
38
|
description: string;
|
|
@@ -67,6 +77,16 @@ export declare const SEED_DATA: {
|
|
|
67
77
|
required: boolean;
|
|
68
78
|
step: number;
|
|
69
79
|
};
|
|
80
|
+
android_disableSound: {
|
|
81
|
+
label: string;
|
|
82
|
+
description: string;
|
|
83
|
+
formType: string;
|
|
84
|
+
propType: string;
|
|
85
|
+
defaultValue: boolean;
|
|
86
|
+
editable: boolean;
|
|
87
|
+
required: boolean;
|
|
88
|
+
group: string;
|
|
89
|
+
};
|
|
70
90
|
};
|
|
71
91
|
name: string;
|
|
72
92
|
tag: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Touchable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Touchable.ts"],"names":[],"mappings":"AAgEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAerB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "47.1.1-
|
|
3
|
+
"version": "47.1.1-ee131b.2+ee131ba",
|
|
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": "^47.1.1-
|
|
44
|
+
"@draftbit/types": "^47.1.1-ee131b.2+ee131ba",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.4",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
]
|
|
92
92
|
]
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "ee131ba21962c50c2de0844e3685dae57ed6880a"
|
|
95
95
|
}
|
package/src/components/Button.js
CHANGED
|
@@ -7,7 +7,7 @@ const CONSTANTS = {
|
|
|
7
7
|
padding: 8,
|
|
8
8
|
icon: 24,
|
|
9
9
|
};
|
|
10
|
-
function Base({ Icon, icon, title, loading, disabled, style, activeOpacity, disabledOpacity, ...props }) {
|
|
10
|
+
function Base({ Icon, icon, title, loading, disabled, style, activeOpacity = 0.8, disabledOpacity = 0.8, ...props }) {
|
|
11
11
|
const { color, fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textTransform, textAlign, textDecorationLine, textDecorationColor, textDecorationStyle, ...buttonStyles } = StyleSheet.flatten(style || {});
|
|
12
12
|
const titleStyles = {
|
|
13
13
|
color,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { View, StyleSheet, ActivityIndicator, Pressable, Platform, } from "react-native";
|
|
3
3
|
import { withTheme } from "../theming";
|
|
4
|
-
const IconButton = ({ Icon, icon, color: customColor, size = 32, disabled
|
|
4
|
+
const IconButton = ({ Icon, icon, color: customColor, size = 32, disabled, loading = false, onPress, theme, style, activeOpacity = 0.8, disabledOpacity = 0.8, ...props }) => {
|
|
5
5
|
const iconColor = customColor || theme.colors.primary;
|
|
6
6
|
return (React.createElement(Pressable, { onPress: onPress, disabled: disabled || loading, style: ({ pressed }) => {
|
|
7
7
|
return [
|
|
8
8
|
styles.container,
|
|
9
9
|
{
|
|
10
|
-
opacity: pressed
|
|
10
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1,
|
|
11
11
|
width: size,
|
|
12
12
|
height: size,
|
|
13
13
|
alignItems: "center",
|
|
@@ -22,6 +22,8 @@ type Props = {
|
|
|
22
22
|
onPress: () => void;
|
|
23
23
|
theme: Theme;
|
|
24
24
|
style?: StyleProp<ViewStyle>;
|
|
25
|
+
activeOpacity?: number;
|
|
26
|
+
disabledOpacity?: number;
|
|
25
27
|
} & PressableProps &
|
|
26
28
|
IconSlot;
|
|
27
29
|
|
|
@@ -30,11 +32,13 @@ const IconButton: React.FC<React.PropsWithChildren<Props>> = ({
|
|
|
30
32
|
icon,
|
|
31
33
|
color: customColor,
|
|
32
34
|
size = 32,
|
|
33
|
-
disabled
|
|
35
|
+
disabled,
|
|
34
36
|
loading = false,
|
|
35
37
|
onPress,
|
|
36
38
|
theme,
|
|
37
39
|
style,
|
|
40
|
+
activeOpacity = 0.8,
|
|
41
|
+
disabledOpacity = 0.8,
|
|
38
42
|
...props
|
|
39
43
|
}) => {
|
|
40
44
|
const iconColor = customColor || theme.colors.primary;
|
|
@@ -47,7 +51,7 @@ const IconButton: React.FC<React.PropsWithChildren<Props>> = ({
|
|
|
47
51
|
return [
|
|
48
52
|
styles.container,
|
|
49
53
|
{
|
|
50
|
-
opacity: pressed
|
|
54
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1,
|
|
51
55
|
width: size,
|
|
52
56
|
height: size,
|
|
53
57
|
alignItems: "center",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Pressable as NativePressable, } from "react-native";
|
|
3
|
-
export default function Pressable({ children, disabled, onPress, activeOpacity, disabledOpacity, delayLongPress, hitSlop, style, ...props }) {
|
|
3
|
+
export default function Pressable({ children, disabled, onPress, activeOpacity = 0.8, disabledOpacity = 0.8, delayLongPress, hitSlop, style, ...props }) {
|
|
4
4
|
return (React.createElement(NativePressable, { onPress: onPress, disabled: disabled, delayLongPress: delayLongPress ? delayLongPress : 500, hitSlop: hitSlop ? hitSlop : 8, style: ({ pressed }) => {
|
|
5
5
|
return [
|
|
6
6
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Pressable } from "react-native";
|
|
3
|
-
export default function Touchable({ children, disabled, onPress, activeOpacity, disabledOpacity, delayLongPress, hitSlop, style, ...props }) {
|
|
3
|
+
export default function Touchable({ children, disabled, onPress, activeOpacity = 0.8, disabledOpacity = 0.8, delayLongPress, hitSlop, style, ...props }) {
|
|
4
4
|
return (React.createElement(Pressable, { disabled: disabled, onPress: onPress, delayLongPress: delayLongPress ? delayLongPress : 500, hitSlop: hitSlop ? hitSlop : 8, style: ({ pressed }) => {
|
|
5
5
|
return [
|
|
6
6
|
{
|
package/src/mappings/Button.js
CHANGED
|
@@ -17,7 +17,7 @@ const SEED_DATA_PROPS = {
|
|
|
17
17
|
activeOpacity: createStaticNumberProp({
|
|
18
18
|
label: "Active Opacity",
|
|
19
19
|
description: "Opacity of the button when active.",
|
|
20
|
-
defaultValue:
|
|
20
|
+
defaultValue: null,
|
|
21
21
|
min: 0,
|
|
22
22
|
max: 1,
|
|
23
23
|
step: 0.01,
|
|
@@ -27,7 +27,7 @@ const SEED_DATA_PROPS = {
|
|
|
27
27
|
disabledOpacity: createStaticNumberProp({
|
|
28
28
|
label: "Disabled Opacity",
|
|
29
29
|
description: "Opacity of the button when disabled.",
|
|
30
|
-
defaultValue:
|
|
30
|
+
defaultValue: null,
|
|
31
31
|
min: 0,
|
|
32
32
|
max: 1,
|
|
33
33
|
step: 0.01,
|