@draftbit/core 46.5.2-404403.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/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/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/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 +9 -4
- package/lib/commonjs/components/Picker/PickerComponent.android.js +20 -3
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +36 -11
- 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 +16 -1
- package/lib/commonjs/hooks.js +1 -2
- package/lib/commonjs/styles/overlay.js +1 -3
- package/lib/module/components/AnimatedCircularProgress.js +13 -1
- package/lib/module/components/CardContainer.js +14 -4
- 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/DeprecatedFAB.js +23 -3
- 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/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/constants.js +1 -2
- package/lib/module/hooks.js +1 -2
- package/lib/module/index.js +1 -3
- package/lib/module/mappings/FieldSearchBarFull.js +4 -1
- package/lib/module/mappings/StarRating.js +7 -2
- package/lib/module/styles/overlay.js +1 -3
- 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/package.json +7 -7
- 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
|
@@ -13,7 +13,6 @@ var _hooks = require("../hooks");
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
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
15
|
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; }
|
|
16
|
-
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); }
|
|
17
16
|
function Switch(_ref) {
|
|
18
17
|
let {
|
|
19
18
|
value,
|
|
@@ -38,7 +37,6 @@ function Switch(_ref) {
|
|
|
38
37
|
setChecked(value);
|
|
39
38
|
}
|
|
40
39
|
}, [value, checked]);
|
|
41
|
-
|
|
42
40
|
// This special logic is to handle weird APIs like Airtable that return
|
|
43
41
|
// true or undefined for a boolean
|
|
44
42
|
const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
|
|
@@ -47,24 +45,24 @@ function Switch(_ref) {
|
|
|
47
45
|
setChecked(Boolean(defaultValue));
|
|
48
46
|
}
|
|
49
47
|
}, [defaultValue, previousDefaultValue]);
|
|
50
|
-
return /*#__PURE__*/React.createElement(_reactNative.Switch,
|
|
48
|
+
return /*#__PURE__*/React.createElement(_reactNative.Switch, {
|
|
51
49
|
value: checked,
|
|
52
50
|
disabled: disabled,
|
|
53
51
|
trackColor: {
|
|
54
52
|
false: inactiveTrackThemeColor,
|
|
55
53
|
true: activeTrackThemeColor
|
|
56
54
|
},
|
|
57
|
-
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor
|
|
55
|
+
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor,
|
|
58
56
|
// @ts-ignore react-native-web only
|
|
59
|
-
,
|
|
60
57
|
activeThumbColor: activeThumbThemeColor,
|
|
61
58
|
ios_backgroundColor: inactiveTrackThemeColor,
|
|
62
59
|
style: style,
|
|
63
60
|
onValueChange: bool => {
|
|
64
61
|
setChecked(bool);
|
|
65
62
|
onValueChange && onValueChange(bool);
|
|
66
|
-
}
|
|
67
|
-
|
|
63
|
+
},
|
|
64
|
+
...rest
|
|
65
|
+
});
|
|
68
66
|
}
|
|
69
67
|
function Row(_ref2) {
|
|
70
68
|
let {
|
|
@@ -93,7 +91,7 @@ function Row(_ref2) {
|
|
|
93
91
|
setChecked(defaultValue);
|
|
94
92
|
}
|
|
95
93
|
}, [defaultValue]);
|
|
96
|
-
return /*#__PURE__*/React.createElement(_FormRow.default,
|
|
94
|
+
return /*#__PURE__*/React.createElement(_FormRow.default, {
|
|
97
95
|
disabled: disabled,
|
|
98
96
|
onPress: () => {
|
|
99
97
|
setChecked(!checked);
|
|
@@ -101,8 +99,9 @@ function Row(_ref2) {
|
|
|
101
99
|
},
|
|
102
100
|
label: label,
|
|
103
101
|
direction: direction,
|
|
104
|
-
style: style
|
|
105
|
-
|
|
102
|
+
style: style,
|
|
103
|
+
...rest
|
|
104
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
106
105
|
theme: theme,
|
|
107
106
|
value: checked,
|
|
108
107
|
disabled: disabled,
|
|
@@ -116,4 +115,14 @@ function Row(_ref2) {
|
|
|
116
115
|
const SwitchRow = (0, _theming.withTheme)(Row);
|
|
117
116
|
exports.SwitchRow = SwitchRow;
|
|
118
117
|
var _default = (0, _theming.withTheme)(Switch);
|
|
118
|
+
exports.default = _default;hange: onValueChange,
|
|
119
|
+
activeTrackColor: activeTrackColor,
|
|
120
|
+
inactiveTrackColor: inactiveTrackColor,
|
|
121
|
+
activeThumbColor: activeThumbColor,
|
|
122
|
+
inactiveThumbColor: inactiveThumbColor
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
const SwitchRow = (0, _theming.withTheme)(Row);
|
|
126
|
+
exports.SwitchRow = SwitchRow;
|
|
127
|
+
var _default = (0, _theming.withTheme)(Switch);
|
|
119
128
|
exports.default = _default;
|
|
@@ -9,10 +9,56 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _theming = require("../theming");
|
|
10
10
|
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); }
|
|
11
11
|
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; }
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
class Text extends React.Component {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.state = {
|
|
16
|
+
nativeProps: {}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
setNativeProps(args) {
|
|
20
|
+
this.state.nativeProps = args || {};
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
const {
|
|
24
|
+
style,
|
|
25
|
+
...rest
|
|
26
|
+
} = this.props;
|
|
27
|
+
const writingDirection = _reactNative.I18nManager.isRTL ? "rtl" : "ltr";
|
|
28
|
+
return /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
29
|
+
...rest,
|
|
30
|
+
...this.state.nativeProps,
|
|
31
|
+
ref: c => {
|
|
32
|
+
this._root = c;
|
|
33
|
+
},
|
|
34
|
+
style: [{
|
|
35
|
+
textAlign: "left",
|
|
36
|
+
writingDirection
|
|
37
|
+
}, style]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const BaseLink = _ref => {
|
|
42
|
+
let {
|
|
43
|
+
style,
|
|
44
|
+
theme,
|
|
45
|
+
title,
|
|
46
|
+
...props
|
|
47
|
+
} = _ref;
|
|
48
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
49
|
+
hitSlop: 8,
|
|
50
|
+
style: [{
|
|
51
|
+
color: theme.colors.primary
|
|
52
|
+
}, style],
|
|
53
|
+
theme: theme,
|
|
54
|
+
...props
|
|
55
|
+
}, title);
|
|
56
|
+
};
|
|
57
|
+
exports.BaseLink = BaseLink;
|
|
58
|
+
const Link = (0, _theming.withTheme)(BaseLink);
|
|
59
|
+
exports.Link = Link;
|
|
60
|
+
var _default = (0, _theming.withTheme)(Text);
|
|
61
|
+
exports.default = _default;tring : Number)(input); }
|
|
16
62
|
class Text extends React.Component {
|
|
17
63
|
constructor() {
|
|
18
64
|
super(...arguments);
|
|
@@ -7,7 +7,6 @@ exports.default = Touchable;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
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); }
|
|
11
10
|
function Touchable(_ref) {
|
|
12
11
|
let {
|
|
13
12
|
children,
|
|
@@ -16,6 +15,22 @@ function Touchable(_ref) {
|
|
|
16
15
|
style,
|
|
17
16
|
...props
|
|
18
17
|
} = _ref;
|
|
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;
|
|
19
34
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
|
|
20
35
|
onPress: onPress,
|
|
21
36
|
disabled: disabled,
|
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
|
}
|
|
@@ -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,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,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
|
});
|
|
@@ -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 { ActivityIndicator, View, StyleSheet } from "react-native";
|
|
4
3
|
import color from "color";
|
|
@@ -98,7 +97,8 @@ const FAB = _ref => {
|
|
|
98
97
|
style: [{
|
|
99
98
|
elevation
|
|
100
99
|
}, style]
|
|
101
|
-
}, /*#__PURE__*/React.createElement(Touchable,
|
|
100
|
+
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
101
|
+
...rest,
|
|
102
102
|
onPress: onPress,
|
|
103
103
|
accessibilityState: {
|
|
104
104
|
disabled
|
|
@@ -106,7 +106,7 @@ const FAB = _ref => {
|
|
|
106
106
|
accessibilityRole: "button",
|
|
107
107
|
disabled: disabled || loading,
|
|
108
108
|
style: buttonStyles
|
|
109
|
-
}
|
|
109
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
110
110
|
style: styles.content
|
|
111
111
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
112
112
|
style: iconStyle
|
|
@@ -145,4 +145,24 @@ const styles = StyleSheet.create({
|
|
|
145
145
|
borderRadius: 0
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
|
+
export default withTheme(FAB);le: "solid"
|
|
149
|
+
},
|
|
150
|
+
content: {
|
|
151
|
+
flexDirection: "row",
|
|
152
|
+
alignItems: "center",
|
|
153
|
+
justifyContent: "center"
|
|
154
|
+
},
|
|
155
|
+
icon: {
|
|
156
|
+
alignItems: "center",
|
|
157
|
+
justifyContent: "center",
|
|
158
|
+
width: Config.buttonIconSize
|
|
159
|
+
},
|
|
160
|
+
fixed: {
|
|
161
|
+
left: 0,
|
|
162
|
+
right: 0,
|
|
163
|
+
bottom: 0,
|
|
164
|
+
height: 64,
|
|
165
|
+
borderRadius: 0
|
|
166
|
+
}
|
|
167
|
+
});
|
|
148
168
|
export default withTheme(FAB);
|
|
@@ -1,7 +1,24 @@
|
|
|
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 } from "react-native";
|
|
4
3
|
import { withTheme } from "../theming";
|
|
4
|
+
const Divider = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
style,
|
|
7
|
+
color,
|
|
8
|
+
theme: {
|
|
9
|
+
colors
|
|
10
|
+
},
|
|
11
|
+
...rest
|
|
12
|
+
} = _ref;
|
|
13
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
14
|
+
style: [{
|
|
15
|
+
backgroundColor: color || colors.divider,
|
|
16
|
+
height: StyleSheet.hairlineWidth
|
|
17
|
+
}, style],
|
|
18
|
+
...rest
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export default withTheme(Divider);ing";
|
|
5
22
|
const Divider = _ref => {
|
|
6
23
|
let {
|
|
7
24
|
style,
|
|
@@ -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, StyleSheet, View } from "react-native";
|
|
4
3
|
import shadow from "../styles/shadow";
|
|
@@ -19,7 +18,20 @@ const Elevation = _ref => {
|
|
|
19
18
|
colors
|
|
20
19
|
} = theme;
|
|
21
20
|
const borderRadius = radius;
|
|
22
|
-
return /*#__PURE__*/React.createElement(Animated.View,
|
|
21
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
22
|
+
...rest,
|
|
23
|
+
style: [{
|
|
24
|
+
borderRadius,
|
|
25
|
+
backgroundColor: colors.surface
|
|
26
|
+
}, elevation ? shadow(elevation) : null, style]
|
|
27
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
28
|
+
style: {
|
|
29
|
+
overflow: "hidden",
|
|
30
|
+
borderRadius
|
|
31
|
+
}
|
|
32
|
+
}, children));
|
|
33
|
+
};
|
|
34
|
+
export default withTheme(Elevation);React.createElement(Animated.View, _extends({}, rest, {
|
|
23
35
|
style: [{
|
|
24
36
|
borderRadius,
|
|
25
37
|
backgroundColor: colors.surface
|
|
@@ -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 { View, StyleSheet, ActivityIndicator, Pressable, Platform } from "react-native";
|
|
4
3
|
import { withTheme } from "../theming";
|
|
@@ -16,7 +15,7 @@ const IconButton = _ref => {
|
|
|
16
15
|
...props
|
|
17
16
|
} = _ref;
|
|
18
17
|
const iconColor = customColor || theme.colors.primary;
|
|
19
|
-
return /*#__PURE__*/React.createElement(Pressable,
|
|
18
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
20
19
|
onPress: onPress,
|
|
21
20
|
disabled: disabled || loading,
|
|
22
21
|
style: _ref2 => {
|
|
@@ -30,8 +29,9 @@ const IconButton = _ref => {
|
|
|
30
29
|
alignItems: "center",
|
|
31
30
|
justifyContent: "center"
|
|
32
31
|
}, style];
|
|
33
|
-
}
|
|
34
|
-
|
|
32
|
+
},
|
|
33
|
+
...props
|
|
34
|
+
}, /*#__PURE__*/React.createElement(View, null, icon && !loading ? /*#__PURE__*/React.createElement(Icon, {
|
|
35
35
|
name: icon,
|
|
36
36
|
size: size - 2,
|
|
37
37
|
color: iconColor
|
|
@@ -52,4 +52,21 @@ const styles = StyleSheet.create({
|
|
|
52
52
|
})
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
+
export default withTheme(IconButton);ement(ActivityIndicator, {
|
|
56
|
+
size: "small",
|
|
57
|
+
color: iconColor
|
|
58
|
+
}) : null));
|
|
59
|
+
};
|
|
60
|
+
const styles = StyleSheet.create({
|
|
61
|
+
container: {
|
|
62
|
+
alignItems: "center",
|
|
63
|
+
justifyContent: "center",
|
|
64
|
+
...Platform.select({
|
|
65
|
+
web: {
|
|
66
|
+
cursor: "pointer",
|
|
67
|
+
userSelect: "none"
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
});
|
|
55
72
|
export default withTheme(IconButton);
|