@draftbit/core 46.5.2-13b65f.2 → 46.5.2-5f6e91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Button.js +15 -27
- package/lib/commonjs/components/CardBlock.js +13 -4
- package/lib/commonjs/components/CardContainerRating.js +13 -4
- package/lib/commonjs/components/CardContainerShortImage.js +15 -4
- package/lib/commonjs/components/Carousel.js +30 -8
- package/lib/commonjs/components/Checkbox/Checkbox.js +3 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +23 -6
- package/lib/commonjs/components/CircleImage.js +15 -1
- package/lib/commonjs/components/CircularProgress.js +26 -8
- package/lib/commonjs/components/DatePicker/DatePicker.js +4 -0
- package/lib/commonjs/components/DatePicker/DatePickerComponent.js +6 -0
- package/lib/commonjs/components/DeprecatedButton.js +151 -0
- package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -2
- package/lib/commonjs/components/DeprecatedFAB.js +2 -1
- package/lib/commonjs/components/Elevation.js +14 -2
- package/lib/commonjs/components/FieldSearchBarFull.js +1 -2
- package/lib/commonjs/components/FormRow.js +16 -2
- package/lib/commonjs/components/IconButton.js +19 -4
- package/lib/commonjs/components/Image.js +17 -2
- package/lib/commonjs/components/Layout.js +40 -19
- package/lib/commonjs/components/Picker/Picker.js +13 -7
- package/lib/commonjs/components/Picker/PickerComponent.android.js +20 -3
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +38 -13
- package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
- package/lib/commonjs/components/Portal/PortalHost.js +44 -15
- package/lib/commonjs/components/ProgressBar.js +37 -7
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +23 -5
- package/lib/commonjs/components/Slider.js +21 -4
- package/lib/commonjs/components/Surface.js +14 -2
- package/lib/commonjs/components/Switch.js +19 -10
- package/lib/commonjs/components/Text.js +50 -4
- package/lib/commonjs/components/Touchable.js +27 -28
- package/lib/commonjs/components/Touchable.web.js +9 -0
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/hooks.js +1 -2
- package/lib/commonjs/mappings/Button.js +10 -13
- package/lib/commonjs/mappings/Touchable.js +20 -0
- package/lib/commonjs/styles/overlay.js +1 -3
- package/lib/module/components/AnimatedCircularProgress.js +13 -1
- package/lib/module/components/Button.js +9 -21
- package/lib/module/components/CardContainer.js +14 -4
- package/lib/module/components/Checkbox/Checkbox.js +3 -2
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +24 -5
- package/lib/module/components/Checkbox/CheckboxRow.js +24 -6
- package/lib/module/components/Checkbox/context.js +1 -1
- package/lib/module/components/CircleImage.js +16 -1
- package/lib/module/components/DatePicker/DatePicker.js +4 -0
- package/lib/module/components/DatePicker/DatePickerComponent.js +6 -0
- package/lib/module/components/DeprecatedButton.js +141 -0
- package/lib/module/components/DeprecatedCardWrapper.js +2 -2
- package/lib/module/components/DeprecatedFAB.js +25 -4
- package/lib/module/components/Divider.js +18 -1
- package/lib/module/components/Elevation.js +14 -2
- package/lib/module/components/IconButton.js +21 -4
- package/lib/module/components/Layout.js +42 -21
- package/lib/module/components/Picker/Picker.js +4 -3
- package/lib/module/components/Picker/PickerComponent.ios.js +1 -1
- package/lib/module/components/Picker/PickerComponent.web.js +21 -3
- package/lib/module/components/Portal/PortalHost.js +45 -15
- package/lib/module/components/Portal/PortalManager.js +33 -7
- package/lib/module/components/ProgressBar.js +39 -7
- package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +10 -1
- package/lib/module/components/RadioButton/RadioButtonRow.js +24 -5
- package/lib/module/components/ScreenContainer.js +21 -4
- package/lib/module/components/Slider.js +21 -4
- package/lib/module/components/StepIndicator.js +58 -18
- package/lib/module/components/Surface.js +15 -1
- package/lib/module/components/TextField.js +78 -28
- package/lib/module/components/ToggleButton.js +16 -2
- package/lib/module/components/Touchable.js +10 -25
- package/lib/module/components/Touchable.web.js +2 -0
- package/lib/module/constants.js +1 -2
- package/lib/module/hooks.js +1 -2
- package/lib/module/index.js +1 -3
- package/lib/module/mappings/Button.js +11 -14
- package/lib/module/mappings/FieldSearchBarFull.js +4 -1
- package/lib/module/mappings/StarRating.js +7 -2
- package/lib/module/mappings/Touchable.js +13 -0
- package/lib/module/styles/overlay.js +1 -3
- package/lib/typescript/src/components/Button.d.ts +0 -2
- package/lib/typescript/src/components/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -2
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +2 -0
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts +2 -0
- package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedButton.d.ts +54 -0
- package/lib/typescript/src/components/DeprecatedButton.d.ts.map +1 -0
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
- package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -1
- package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.d.ts +2 -9
- package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.web.d.ts +3 -0
- package/lib/typescript/src/components/Touchable.web.d.ts.map +1 -0
- package/lib/typescript/src/mappings/Button.d.ts +4 -113
- package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Touchable.d.ts +22 -0
- package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/Button.js +11 -18
- package/src/components/Button.tsx +11 -45
- package/src/components/Checkbox/Checkbox.js +3 -2
- package/src/components/Checkbox/Checkbox.tsx +7 -5
- package/src/components/DatePicker/DatePicker.js +2 -2
- package/src/components/DatePicker/DatePicker.tsx +6 -0
- package/src/components/DatePicker/DatePickerComponent.js +3 -3
- package/src/components/DatePicker/DatePickerComponent.tsx +6 -0
- package/src/components/DatePicker/DatePickerComponentType.ts +2 -0
- package/src/components/DeprecatedButton.js +95 -0
- package/src/components/DeprecatedButton.tsx +214 -0
- package/src/components/DeprecatedCardWrapper.js +2 -2
- package/src/components/DeprecatedCardWrapper.tsx +4 -3
- package/src/components/DeprecatedFAB.js +3 -2
- package/src/components/DeprecatedFAB.tsx +5 -5
- package/src/components/Picker/Picker.js +4 -3
- package/src/components/Picker/Picker.tsx +4 -4
- package/src/components/Picker/PickerComponent.ios.js +1 -1
- package/src/components/Picker/PickerComponent.ios.tsx +1 -1
- package/src/components/Touchable.js +11 -16
- package/src/components/Touchable.tsx +11 -42
- package/src/components/Touchable.web.js +2 -0
- package/src/components/Touchable.web.tsx +3 -0
- package/src/mappings/Button.js +10 -13
- package/src/mappings/Button.ts +10 -13
- package/src/mappings/Touchable.js +17 -0
- package/src/mappings/Touchable.ts +23 -0
- package/lib/commonjs/components/Pressable.js +0 -48
- package/lib/commonjs/mappings/Pressable.js +0 -34
- package/lib/module/components/Pressable.js +0 -40
- package/lib/module/mappings/Pressable.js +0 -27
- package/lib/typescript/src/components/Pressable.d.ts +0 -18
- package/lib/typescript/src/components/Pressable.d.ts.map +0 -1
- package/lib/typescript/src/mappings/Pressable.d.ts +0 -76
- package/lib/typescript/src/mappings/Pressable.d.ts.map +0 -1
- package/src/components/Pressable.js +0 -17
- package/src/components/Pressable.tsx +0 -67
- package/src/mappings/Pressable.js +0 -34
- package/src/mappings/Pressable.ts +0 -42
|
@@ -4,45 +4,44 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = Touchable;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
function
|
|
10
|
-
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; }
|
|
11
|
-
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); }
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
10
|
function Touchable(_ref) {
|
|
13
11
|
let {
|
|
14
12
|
children,
|
|
15
13
|
disabled,
|
|
16
14
|
onPress,
|
|
17
|
-
onLongPress,
|
|
18
|
-
hitSlop,
|
|
19
|
-
delayLongPress,
|
|
20
|
-
activeOpacity,
|
|
21
|
-
disabledOpacity,
|
|
22
15
|
style,
|
|
23
16
|
...props
|
|
24
17
|
} = _ref;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
19
|
+
onPress: onPress,
|
|
20
|
+
disabled: disabled,
|
|
21
|
+
hitSlop: 8,
|
|
22
|
+
style: _ref2 => {
|
|
23
|
+
let {
|
|
24
|
+
pressed
|
|
25
|
+
} = _ref2;
|
|
26
|
+
return [{
|
|
27
|
+
opacity: pressed || disabled ? 0.75 : 1
|
|
28
|
+
}, style];
|
|
29
|
+
},
|
|
30
|
+
...props
|
|
31
|
+
}, children);
|
|
32
|
+
}ops
|
|
33
|
+
} = _ref;
|
|
40
34
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
|
|
41
35
|
onPress: onPress,
|
|
42
|
-
onLongPress: onLongPress,
|
|
43
36
|
disabled: disabled,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
hitSlop: 8,
|
|
38
|
+
style: _ref2 => {
|
|
39
|
+
let {
|
|
40
|
+
pressed
|
|
41
|
+
} = _ref2;
|
|
42
|
+
return [{
|
|
43
|
+
opacity: pressed || disabled ? 0.75 : 1
|
|
44
|
+
}, style];
|
|
45
|
+
}
|
|
47
46
|
}, props), children);
|
|
48
47
|
}
|
|
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
|
|
|
12
12
|
android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
|
|
13
13
|
ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
|
|
14
14
|
});
|
|
15
|
-
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
15
|
+
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;AR_HEIGHT;
|
package/lib/commonjs/hooks.js
CHANGED
|
@@ -10,12 +10,11 @@ function usePrevious(value) {
|
|
|
10
10
|
// The ref object is a generic container whose current property is mutable
|
|
11
11
|
// and can hold any value, similar to an instance property on a class
|
|
12
12
|
const ref = _react.default.useRef();
|
|
13
|
-
|
|
14
13
|
// Store current value in ref
|
|
15
14
|
_react.default.useEffect(() => {
|
|
16
15
|
ref.current = value;
|
|
17
16
|
}, [value]);
|
|
18
|
-
|
|
19
17
|
// Return previous value (happens before update in useEffect above)
|
|
20
18
|
return ref.current;
|
|
19
|
+
}
|
|
21
20
|
}
|
|
@@ -5,10 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SEED_DATA = void 0;
|
|
7
7
|
var _types = require("@draftbit/types");
|
|
8
|
-
const SEED_DATA_TRIGGERS = [_types.Triggers.OnPress
|
|
8
|
+
const SEED_DATA_TRIGGERS = [_types.Triggers.OnPress];
|
|
9
9
|
const SEED_DATA_PROPS = {
|
|
10
10
|
onPress: (0, _types.createActionProp)(),
|
|
11
|
-
onLongPress: (0, _types.createActionProp)(),
|
|
12
11
|
icon: (0, _types.createIconProp)({
|
|
13
12
|
defaultValue: null,
|
|
14
13
|
required: false
|
|
@@ -19,11 +18,12 @@ const SEED_DATA_PROPS = {
|
|
|
19
18
|
defaultValue: "Get Started"
|
|
20
19
|
}),
|
|
21
20
|
disabled: (0, _types.createDisabledProp)(),
|
|
22
|
-
loading: (0, _types.createLoadingProp)()
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
loading: (0, _types.createLoadingProp)()
|
|
22
|
+
};
|
|
23
|
+
const LAYOUT = {
|
|
24
|
+
backgroundColor: "transparent",
|
|
25
|
+
borderRadius: 8,
|
|
26
|
+
fontFamily: "system-700"
|
|
27
27
|
};
|
|
28
28
|
const SEED_DATA = [{
|
|
29
29
|
name: "Button Outline",
|
|
@@ -31,9 +31,8 @@ const SEED_DATA = [{
|
|
|
31
31
|
category: _types.COMPONENT_TYPES.deprecated,
|
|
32
32
|
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
33
33
|
layout: {
|
|
34
|
+
...LAYOUT,
|
|
34
35
|
backgroundColor: "transparent",
|
|
35
|
-
borderRadius: 8,
|
|
36
|
-
fontFamily: "system-700",
|
|
37
36
|
borderWidth: 1,
|
|
38
37
|
textAlign: "center"
|
|
39
38
|
},
|
|
@@ -45,8 +44,7 @@ const SEED_DATA = [{
|
|
|
45
44
|
category: _types.COMPONENT_TYPES.deprecated,
|
|
46
45
|
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
47
46
|
layout: {
|
|
48
|
-
|
|
49
|
-
fontFamily: "system-700",
|
|
47
|
+
...LAYOUT,
|
|
50
48
|
backgroundColor: "primary",
|
|
51
49
|
textAlign: "center"
|
|
52
50
|
},
|
|
@@ -58,8 +56,7 @@ const SEED_DATA = [{
|
|
|
58
56
|
category: _types.COMPONENT_TYPES.button,
|
|
59
57
|
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
60
58
|
layout: {
|
|
61
|
-
|
|
62
|
-
fontFamily: "system-700",
|
|
59
|
+
...LAYOUT,
|
|
63
60
|
backgroundColor: "primary",
|
|
64
61
|
textAlign: "center"
|
|
65
62
|
},
|
|
@@ -0,0 +1,20 @@
|
|
|
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: "Touchable",
|
|
10
|
+
tag: "Touchable",
|
|
11
|
+
description: "Simple button with no styles",
|
|
12
|
+
category: _types.COMPONENT_TYPES.button,
|
|
13
|
+
stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Borders],
|
|
14
|
+
layout: {},
|
|
15
|
+
triggers: [_types.Triggers.OnPress],
|
|
16
|
+
props: {
|
|
17
|
+
onPress: (0, _types.createActionProp)()
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -15,7 +15,6 @@ function overlay(elevation) {
|
|
|
15
15
|
let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _DarkTheme.default.colors.surface;
|
|
16
16
|
if (isAnimatedValue(elevation)) {
|
|
17
17
|
const inputRange = [0, 1, 2, 3, 8, 24];
|
|
18
|
-
|
|
19
18
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
20
19
|
return elevation.interpolate({
|
|
21
20
|
inputRange,
|
|
@@ -24,7 +23,6 @@ function overlay(elevation) {
|
|
|
24
23
|
})
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
29
27
|
return calculateColor(surfaceColor, elevation);
|
|
30
28
|
}
|
|
@@ -65,4 +63,4 @@ const elevationOverlayTransparency = {
|
|
|
65
63
|
22: 15.72,
|
|
66
64
|
23: 15.84,
|
|
67
65
|
24: 16
|
|
68
|
-
};
|
|
66
|
+
};};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { Animated, Easing } from "react-native";
|
|
4
3
|
import CircularProgress from "./CircularProgress";
|
|
@@ -46,6 +45,19 @@ const AnimatedCircularProgress = _ref => {
|
|
|
46
45
|
React.useEffect(() => {
|
|
47
46
|
animate();
|
|
48
47
|
}, [fill, animate]);
|
|
48
|
+
return /*#__PURE__*/React.createElement(AnimatedProgress, {
|
|
49
|
+
...other,
|
|
50
|
+
style: other.style,
|
|
51
|
+
childrenContainerStyle: other.childrenContainerStyle,
|
|
52
|
+
fill: fillAnimation,
|
|
53
|
+
tintColor: animateColor()
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
export default AnimatedCircularProgress;imation;
|
|
57
|
+
};
|
|
58
|
+
React.useEffect(() => {
|
|
59
|
+
animate();
|
|
60
|
+
}, [fill, animate]);
|
|
49
61
|
return /*#__PURE__*/React.createElement(AnimatedProgress, _extends({}, other, {
|
|
50
62
|
style: other.style,
|
|
51
63
|
childrenContainerStyle: other.childrenContainerStyle,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
import { Text, Pressable, Platform, StyleSheet, ActivityIndicator } from "react-native";
|
|
4
4
|
import { withTheme } from "../theming";
|
|
5
5
|
const CONSTANTS = {
|
|
@@ -14,9 +14,6 @@ function Base(_ref) {
|
|
|
14
14
|
icon,
|
|
15
15
|
title,
|
|
16
16
|
onPress,
|
|
17
|
-
onLongPress,
|
|
18
|
-
activeOpacity,
|
|
19
|
-
disabledOpacity,
|
|
20
17
|
loading,
|
|
21
18
|
disabled,
|
|
22
19
|
style,
|
|
@@ -55,26 +52,17 @@ function Base(_ref) {
|
|
|
55
52
|
if (textAlign === "right") {
|
|
56
53
|
buttonStyles.justifyContent = "flex-end";
|
|
57
54
|
}
|
|
58
|
-
const getOpacity = useCallback(pressed => {
|
|
59
|
-
if (disabled) {
|
|
60
|
-
return disabledOpacity;
|
|
61
|
-
} else {
|
|
62
|
-
if (pressed) return activeOpacity;else return 1;
|
|
63
|
-
}
|
|
64
|
-
}, [activeOpacity, disabled, disabledOpacity]);
|
|
65
|
-
const _style = useCallback(_ref2 => {
|
|
66
|
-
let {
|
|
67
|
-
pressed
|
|
68
|
-
} = _ref2;
|
|
69
|
-
return [buttonStyles, {
|
|
70
|
-
opacity: getOpacity(pressed)
|
|
71
|
-
}];
|
|
72
|
-
}, [getOpacity, buttonStyles]);
|
|
73
55
|
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
74
56
|
onPress: onPress,
|
|
75
|
-
onLongPress: onLongPress,
|
|
76
57
|
disabled: disabled || loading,
|
|
77
|
-
style:
|
|
58
|
+
style: _ref2 => {
|
|
59
|
+
let {
|
|
60
|
+
pressed
|
|
61
|
+
} = _ref2;
|
|
62
|
+
return [styles.base, {
|
|
63
|
+
opacity: pressed || disabled ? 0.75 : 1
|
|
64
|
+
}, buttonStyles];
|
|
65
|
+
}
|
|
78
66
|
}, props), loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
79
67
|
size: "small",
|
|
80
68
|
color: color,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { View, Text } from "react-native";
|
|
4
3
|
import color from "color";
|
|
@@ -45,11 +44,12 @@ const CardContainer = _ref => {
|
|
|
45
44
|
titleStyle = typography.headline5;
|
|
46
45
|
break;
|
|
47
46
|
}
|
|
48
|
-
return /*#__PURE__*/React.createElement(Card,
|
|
47
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
49
48
|
style: style,
|
|
50
49
|
onPress: onPress,
|
|
51
|
-
numColumns: numColumns
|
|
52
|
-
|
|
50
|
+
numColumns: numColumns,
|
|
51
|
+
...rest
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Elevation, {
|
|
53
53
|
style: {
|
|
54
54
|
elevation,
|
|
55
55
|
borderRadius: roundness
|
|
@@ -118,4 +118,14 @@ const CardContainer = _ref => {
|
|
|
118
118
|
color: colors.surface
|
|
119
119
|
})) : null)));
|
|
120
120
|
};
|
|
121
|
+
export default withTheme(CardContainer);ONTAINER_PADDING,
|
|
122
|
+
borderRadius: ICON_CONTAINER_SIZE,
|
|
123
|
+
backgroundColor: color(colors.strong).alpha(Config.cardIconBackgroundOpacity).rgb().string()
|
|
124
|
+
}
|
|
125
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
126
|
+
name: icon,
|
|
127
|
+
size: Config.cardIconSize,
|
|
128
|
+
color: colors.surface
|
|
129
|
+
})) : null)));
|
|
130
|
+
};
|
|
121
131
|
export default withTheme(CardContainer);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { View, StyleSheet
|
|
3
|
+
import { View, StyleSheet } from "react-native";
|
|
4
4
|
import { useTheme } from "../../theming";
|
|
5
|
+
import Touchable from "../Touchable";
|
|
5
6
|
import { usePrevious } from "../../hooks";
|
|
6
7
|
const Checkbox = _ref => {
|
|
7
8
|
let {
|
|
@@ -50,7 +51,7 @@ const Checkbox = _ref => {
|
|
|
50
51
|
onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
|
-
return /*#__PURE__*/React.createElement(
|
|
54
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
|
|
54
55
|
onPress: handlePress,
|
|
55
56
|
disabled: disabled,
|
|
56
57
|
accessibilityState: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { StyleSheet, View, Platform } from "react-native";
|
|
4
3
|
import Checkbox from "./Checkbox";
|
|
@@ -7,7 +6,7 @@ import { useCheckboxGroupContext } from "./context";
|
|
|
7
6
|
import { Direction as GroupDirection } from "./context";
|
|
8
7
|
import Touchable from "../Touchable";
|
|
9
8
|
import { extractStyles } from "../../utilities";
|
|
10
|
-
export
|
|
9
|
+
export var Direction;
|
|
11
10
|
(function (Direction) {
|
|
12
11
|
Direction["Row"] = "row";
|
|
13
12
|
Direction["RowReverse"] = "row-reverse";
|
|
@@ -64,13 +63,14 @@ const CheckboxGroupRow = _ref => {
|
|
|
64
63
|
textStyles,
|
|
65
64
|
viewStyles
|
|
66
65
|
} = extractStyles(style);
|
|
67
|
-
return /*#__PURE__*/React.createElement(Touchable,
|
|
66
|
+
return /*#__PURE__*/React.createElement(Touchable, {
|
|
68
67
|
onPress: handlePress,
|
|
69
68
|
style: [styles.mainParent, {
|
|
70
69
|
flexDirection: direction
|
|
71
70
|
}, viewStyles],
|
|
72
|
-
disabled: disabled
|
|
73
|
-
|
|
71
|
+
disabled: disabled,
|
|
72
|
+
...rest
|
|
73
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
74
74
|
style: [styles.label, {
|
|
75
75
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
76
76
|
}, labelContainerStyle]
|
|
@@ -108,4 +108,23 @@ const styles = StyleSheet.create({
|
|
|
108
108
|
flex: 3
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
|
+
export default CheckboxGroupRow;reate({
|
|
112
|
+
mainParent: {
|
|
113
|
+
alignItems: "center",
|
|
114
|
+
justifyContent: "space-around",
|
|
115
|
+
paddingStart: 20,
|
|
116
|
+
minHeight: 50,
|
|
117
|
+
paddingEnd: 20,
|
|
118
|
+
display: "flex",
|
|
119
|
+
...Platform.select({
|
|
120
|
+
web: {
|
|
121
|
+
cursor: "pointer",
|
|
122
|
+
userSelect: "none"
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
},
|
|
126
|
+
label: {
|
|
127
|
+
flex: 3
|
|
128
|
+
}
|
|
129
|
+
});
|
|
111
130
|
export default CheckboxGroupRow;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { StyleSheet, View, Platform } from "react-native";
|
|
4
3
|
import { isString } from "lodash";
|
|
@@ -7,7 +6,7 @@ import { usePrevious } from "../../hooks";
|
|
|
7
6
|
import Text from "../Text";
|
|
8
7
|
import Touchable from "../Touchable";
|
|
9
8
|
import Checkbox from "./Checkbox";
|
|
10
|
-
export
|
|
9
|
+
export var Direction;
|
|
11
10
|
(function (Direction) {
|
|
12
11
|
Direction["Row"] = "row";
|
|
13
12
|
Direction["RowReverse"] = "row-reverse";
|
|
@@ -49,7 +48,6 @@ const CheckboxRow = _ref => {
|
|
|
49
48
|
setInternalValue(status);
|
|
50
49
|
}
|
|
51
50
|
}, [status]);
|
|
52
|
-
|
|
53
51
|
// This special logic is to handle weird APIs like Airtable that return
|
|
54
52
|
// true or undefined for a boolean
|
|
55
53
|
const previousDefaultValue = usePrevious(defaultValue);
|
|
@@ -73,13 +71,14 @@ const CheckboxRow = _ref => {
|
|
|
73
71
|
textStyles,
|
|
74
72
|
viewStyles
|
|
75
73
|
} = extractStyles(style);
|
|
76
|
-
return /*#__PURE__*/React.createElement(Touchable,
|
|
74
|
+
return /*#__PURE__*/React.createElement(Touchable, {
|
|
77
75
|
onPress: handlePress,
|
|
78
76
|
style: [viewStyles, styles.mainParent, {
|
|
79
77
|
flexDirection: direction
|
|
80
78
|
}],
|
|
81
|
-
disabled: disabled
|
|
82
|
-
|
|
79
|
+
disabled: disabled,
|
|
80
|
+
...rest
|
|
81
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
83
82
|
style: [styles.label, {
|
|
84
83
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
85
84
|
}, labelContainerStyle]
|
|
@@ -115,4 +114,23 @@ const styles = StyleSheet.create({
|
|
|
115
114
|
flex: 3
|
|
116
115
|
}
|
|
117
116
|
});
|
|
117
|
+
export default CheckboxRow;heet.create({
|
|
118
|
+
mainParent: {
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
justifyContent: "space-around",
|
|
121
|
+
paddingStart: 20,
|
|
122
|
+
minHeight: 50,
|
|
123
|
+
paddingEnd: 20,
|
|
124
|
+
display: "flex",
|
|
125
|
+
...Platform.select({
|
|
126
|
+
web: {
|
|
127
|
+
cursor: "pointer",
|
|
128
|
+
userSelect: "none"
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
},
|
|
132
|
+
label: {
|
|
133
|
+
flex: 3
|
|
134
|
+
}
|
|
135
|
+
});
|
|
118
136
|
export default CheckboxRow;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { Image } from "react-native";
|
|
4
3
|
import Config from "./Config";
|
|
@@ -10,6 +9,22 @@ const CircleImage = _ref => {
|
|
|
10
9
|
...props
|
|
11
10
|
} = _ref;
|
|
12
11
|
const borderRadius = size / 2;
|
|
12
|
+
return /*#__PURE__*/React.createElement(Image, {
|
|
13
|
+
style: [{
|
|
14
|
+
width: size,
|
|
15
|
+
height: size,
|
|
16
|
+
borderRadius
|
|
17
|
+
}, style],
|
|
18
|
+
source: typeof source === "string" ? {
|
|
19
|
+
uri: source
|
|
20
|
+
} : source,
|
|
21
|
+
resizeMode: "cover",
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export default CircleImage;props
|
|
26
|
+
} = _ref;
|
|
27
|
+
const borderRadius = size / 2;
|
|
13
28
|
return /*#__PURE__*/React.createElement(Image, _extends({
|
|
14
29
|
style: [{
|
|
15
30
|
width: size,
|
|
@@ -39,6 +39,8 @@ const DatePicker = _ref => {
|
|
|
39
39
|
placeholder,
|
|
40
40
|
borderColor: inputBorderColor,
|
|
41
41
|
borderColorActive: inputBorderColorActive,
|
|
42
|
+
pickerAccentColor,
|
|
43
|
+
pickerTextColor,
|
|
42
44
|
...props
|
|
43
45
|
} = _ref;
|
|
44
46
|
const [value, setValue] = React.useState(date || defaultValue);
|
|
@@ -341,6 +343,8 @@ const DatePicker = _ref => {
|
|
|
341
343
|
paddingRight: insets.right
|
|
342
344
|
}]
|
|
343
345
|
}, /*#__PURE__*/React.createElement(DateTimePicker, {
|
|
346
|
+
accentColor: pickerAccentColor,
|
|
347
|
+
textColor: pickerTextColor,
|
|
344
348
|
value: getValidDate(),
|
|
345
349
|
mode: mode,
|
|
346
350
|
isVisible: pickerVisible,
|
|
@@ -6,12 +6,16 @@ const DatePickerComponent = _ref => {
|
|
|
6
6
|
let {
|
|
7
7
|
value,
|
|
8
8
|
onChange,
|
|
9
|
+
textColor,
|
|
10
|
+
accentColor,
|
|
9
11
|
mode,
|
|
10
12
|
toggleVisibility
|
|
11
13
|
} = _ref;
|
|
12
14
|
return Platform.OS === "ios" || Platform.OS === "android" ? /*#__PURE__*/React.createElement(DateTimePickerModal, {
|
|
13
15
|
date: value,
|
|
14
16
|
mode: mode,
|
|
17
|
+
textColor: textColor,
|
|
18
|
+
accentColor: accentColor,
|
|
15
19
|
isVisible: true,
|
|
16
20
|
display: Platform.OS === "ios" ? "spinner" : "default",
|
|
17
21
|
onCancel: () => {
|
|
@@ -24,6 +28,8 @@ const DatePickerComponent = _ref => {
|
|
|
24
28
|
}) : /*#__PURE__*/React.createElement(DateTimePicker, {
|
|
25
29
|
value: value,
|
|
26
30
|
mode: mode,
|
|
31
|
+
textColor: textColor,
|
|
32
|
+
accentColor: accentColor,
|
|
27
33
|
onChange: onChange,
|
|
28
34
|
display: "default"
|
|
29
35
|
});
|