@draftbit/core 46.10.3-177666.2 → 46.10.3-17bcb4.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/AvatarEdit.js +15 -4
- package/lib/commonjs/components/Banner.js +23 -4
- package/lib/commonjs/components/Checkbox/Checkbox.js +3 -4
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
- package/lib/commonjs/components/CircularProgress.js +26 -8
- package/lib/commonjs/components/DeprecatedButton.js +20 -3
- package/lib/commonjs/components/DeprecatedCardWrapper.js +54 -0
- package/lib/commonjs/components/DeprecatedFAB.js +157 -0
- package/lib/commonjs/components/Elevation.js +14 -2
- package/lib/commonjs/components/FormRow.js +16 -2
- package/lib/commonjs/components/IconButton.js +19 -4
- package/lib/commonjs/components/Layout.js +40 -19
- package/lib/commonjs/components/NumberInput.js +12 -3
- package/lib/commonjs/components/Picker/Picker.js +9 -6
- package/lib/commonjs/components/Picker/PickerComponent.web.js +20 -3
- package/lib/commonjs/components/Portal/Portal.js +27 -3
- package/lib/commonjs/components/Portal/PortalHost.js +44 -15
- package/lib/commonjs/components/Pressable.js +15 -2
- package/lib/commonjs/components/ProgressIndicator.js +55 -0
- package/lib/commonjs/components/RadioButton/RadioButton.js +13 -2
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +15 -2
- package/lib/commonjs/components/RadioButton/context.js +1 -1
- package/lib/commonjs/components/ResizeMode.js +5 -0
- package/lib/commonjs/components/ScreenContainer.js +24 -6
- package/lib/commonjs/components/Slider.js +21 -4
- package/lib/commonjs/components/StarRating.js +23 -4
- package/lib/commonjs/components/StepIndicator.js +57 -18
- package/lib/commonjs/components/Surface.js +14 -2
- package/lib/commonjs/components/Switch.js +19 -10
- package/lib/commonjs/components/ToggleButton.js +15 -2
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/hooks.js +1 -2
- package/lib/commonjs/mappings/CardBlock.js +126 -0
- package/lib/commonjs/mappings/CardContainer.js +108 -0
- package/lib/commonjs/mappings/CardContainerRating.js +130 -0
- package/lib/commonjs/mappings/CardContainerShortImage.js +124 -0
- package/lib/commonjs/mappings/CardInline.js +59 -0
- package/lib/commonjs/mappings/HeaderLarge.js +34 -0
- package/lib/commonjs/mappings/HeaderMedium.js +60 -0
- package/lib/commonjs/mappings/HeaderOverline.js +60 -0
- package/lib/commonjs/mappings/ProgressIndicator.js +188 -0
- package/lib/commonjs/styles/overlay.js +1 -3
- package/lib/module/components/Accordion/AccordionItem.js +4 -25
- package/lib/module/components/AnimatedCircularProgress.js +13 -1
- package/lib/module/components/AvatarEdit.js +15 -4
- package/lib/module/components/Banner.js +25 -4
- package/lib/module/components/Button.js +33 -10
- package/lib/module/components/Checkbox/CheckboxGroup.js +16 -2
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +24 -5
- package/lib/module/components/Checkbox/CheckboxRow.js +24 -6
- package/lib/module/components/DatePicker/DatePicker.js +27 -13
- package/lib/module/components/DeprecatedCardWrapper.js +32 -0
- package/lib/module/components/DeprecatedFAB.js +167 -0
- package/lib/module/components/Divider.js +18 -1
- package/lib/module/components/Layout.js +42 -21
- package/lib/module/components/Picker/PickerComponent.android.js +21 -3
- package/lib/module/components/Portal/PortalConsumer.js +22 -7
- package/lib/module/components/ProgressIndicator.js +45 -0
- package/lib/module/components/RadioButton/RadioButton.js +13 -1
- package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +10 -1
- package/lib/module/components/RadioButton/context.js +1 -1
- package/lib/module/components/ResizeMode.js +1 -0
- package/lib/module/components/StepIndicator.js +58 -18
- package/lib/module/components/Surface.js +15 -1
- package/lib/module/components/Switch.js +21 -10
- package/lib/module/components/TabView/TabView.js +17 -7
- package/lib/module/components/TabView/TabViewItem.js +4 -3
- package/lib/module/components/Table/Table.js +6 -5
- package/lib/module/components/TextField.js +78 -28
- package/lib/module/components/ToggleButton.js +16 -2
- package/lib/module/constants.js +1 -0
- package/lib/module/mappings/CardBlock.js +119 -0
- package/lib/module/mappings/CardContainer.js +101 -0
- package/lib/module/mappings/CardContainerRating.js +123 -0
- package/lib/module/mappings/CardContainerShortImage.js +117 -0
- package/lib/module/mappings/CardInline.js +52 -0
- package/lib/module/mappings/HeaderLarge.js +27 -0
- package/lib/module/mappings/HeaderMedium.js +53 -0
- package/lib/module/mappings/HeaderOverline.js +53 -0
- package/lib/module/mappings/ProgressIndicator.js +181 -0
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts +15 -0
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +1 -0
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +56 -0
- package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -0
- package/lib/typescript/src/components/ProgressIndicator.d.ts +24 -0
- package/lib/typescript/src/components/ProgressIndicator.d.ts.map +1 -0
- package/lib/typescript/src/components/ResizeMode.d.ts +2 -0
- package/lib/typescript/src/components/ResizeMode.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardBlock.d.ts +289 -0
- package/lib/typescript/src/mappings/CardBlock.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardContainer.d.ts +102 -0
- package/lib/typescript/src/mappings/CardContainer.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardContainerRating.d.ts +108 -0
- package/lib/typescript/src/mappings/CardContainerRating.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardContainerShortImage.d.ts +139 -0
- package/lib/typescript/src/mappings/CardContainerShortImage.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardInline.d.ts +62 -0
- package/lib/typescript/src/mappings/CardInline.d.ts.map +1 -0
- package/lib/typescript/src/mappings/HeaderLarge.d.ts +34 -0
- package/lib/typescript/src/mappings/HeaderLarge.d.ts.map +1 -0
- package/lib/typescript/src/mappings/HeaderMedium.d.ts +53 -0
- package/lib/typescript/src/mappings/HeaderMedium.d.ts.map +1 -0
- package/lib/typescript/src/mappings/HeaderOverline.d.ts +53 -0
- package/lib/typescript/src/mappings/HeaderOverline.d.ts.map +1 -0
- package/lib/typescript/src/mappings/ProgressIndicator.d.ts +181 -0
- package/lib/typescript/src/mappings/ProgressIndicator.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/DeprecatedCardWrapper.js +18 -0
- package/src/components/DeprecatedCardWrapper.tsx +46 -0
- package/src/components/DeprecatedFAB.js +114 -0
- package/src/components/DeprecatedFAB.tsx +231 -0
- package/src/components/ProgressIndicator.js +27 -0
- package/src/components/ProgressIndicator.tsx +71 -0
- package/src/components/ResizeMode.js +1 -0
- package/src/components/ResizeMode.ts +7 -0
- package/src/mappings/CardBlock.js +123 -0
- package/src/mappings/CardBlock.ts +136 -0
- package/src/mappings/CardContainer.js +104 -0
- package/src/mappings/CardContainer.ts +116 -0
- package/src/mappings/CardContainerRating.js +126 -0
- package/src/mappings/CardContainerRating.ts +137 -0
- package/src/mappings/CardContainerShortImage.js +120 -0
- package/src/mappings/CardContainerShortImage.ts +130 -0
- package/src/mappings/CardInline.js +52 -0
- package/src/mappings/CardInline.ts +61 -0
- package/src/mappings/HeaderLarge.js +29 -0
- package/src/mappings/HeaderLarge.ts +38 -0
- package/src/mappings/HeaderMedium.js +55 -0
- package/src/mappings/HeaderMedium.ts +63 -0
- package/src/mappings/HeaderOverline.js +55 -0
- package/src/mappings/HeaderOverline.ts +63 -0
- package/src/mappings/ProgressIndicator.js +181 -0
- package/src/mappings/ProgressIndicator.ts +190 -0
|
@@ -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,8 +1,5 @@
|
|
|
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 } from "react-native";
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
|
|
6
3
|
export function Center(_ref) {
|
|
7
4
|
let {
|
|
8
5
|
width = 240,
|
|
@@ -12,15 +9,16 @@ export function Center(_ref) {
|
|
|
12
9
|
style,
|
|
13
10
|
...rest
|
|
14
11
|
} = _ref;
|
|
15
|
-
return /*#__PURE__*/React.createElement(View,
|
|
12
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
16
13
|
style: [{
|
|
17
14
|
justifyContent: "center",
|
|
18
15
|
alignItems: "center",
|
|
19
16
|
width,
|
|
20
17
|
height,
|
|
21
18
|
backgroundColor: bgColor
|
|
22
|
-
}, style]
|
|
23
|
-
|
|
19
|
+
}, style],
|
|
20
|
+
...rest
|
|
21
|
+
}, children);
|
|
24
22
|
}
|
|
25
23
|
export function Circle(_ref2) {
|
|
26
24
|
let {
|
|
@@ -31,7 +29,7 @@ export function Circle(_ref2) {
|
|
|
31
29
|
...rest
|
|
32
30
|
} = _ref2;
|
|
33
31
|
const borderRadius = 1000;
|
|
34
|
-
return /*#__PURE__*/React.createElement(Center,
|
|
32
|
+
return /*#__PURE__*/React.createElement(Center, {
|
|
35
33
|
width: size,
|
|
36
34
|
height: size,
|
|
37
35
|
bgColor: bgColor,
|
|
@@ -39,8 +37,9 @@ export function Circle(_ref2) {
|
|
|
39
37
|
backgroundColor: bgColor,
|
|
40
38
|
borderRadius,
|
|
41
39
|
overflow: "hidden"
|
|
42
|
-
}]
|
|
43
|
-
|
|
40
|
+
}],
|
|
41
|
+
...rest
|
|
42
|
+
}, children);
|
|
44
43
|
}
|
|
45
44
|
export function Square(_ref3) {
|
|
46
45
|
let {
|
|
@@ -50,12 +49,13 @@ export function Square(_ref3) {
|
|
|
50
49
|
style,
|
|
51
50
|
...rest
|
|
52
51
|
} = _ref3;
|
|
53
|
-
return /*#__PURE__*/React.createElement(Center,
|
|
52
|
+
return /*#__PURE__*/React.createElement(Center, {
|
|
54
53
|
style: style,
|
|
55
54
|
width: size,
|
|
56
55
|
height: size,
|
|
57
|
-
bgColor: bgColor
|
|
58
|
-
|
|
56
|
+
bgColor: bgColor,
|
|
57
|
+
...rest
|
|
58
|
+
}, children);
|
|
59
59
|
}
|
|
60
60
|
export function Row(_ref4) {
|
|
61
61
|
let {
|
|
@@ -65,15 +65,14 @@ export function Row(_ref4) {
|
|
|
65
65
|
style,
|
|
66
66
|
...rest
|
|
67
67
|
} = _ref4;
|
|
68
|
-
return /*#__PURE__*/React.createElement(View,
|
|
69
|
-
style: [style,
|
|
70
|
-
// style goes first b/c we can't override these
|
|
71
|
-
{
|
|
68
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
69
|
+
style: [style, {
|
|
72
70
|
alignItems,
|
|
73
71
|
flexDirection: "row",
|
|
74
72
|
justifyContent: justifyContent
|
|
75
|
-
}]
|
|
76
|
-
|
|
73
|
+
}],
|
|
74
|
+
...rest
|
|
75
|
+
}, children);
|
|
77
76
|
}
|
|
78
77
|
export function Spacer(_ref5) {
|
|
79
78
|
let {
|
|
@@ -85,14 +84,36 @@ export function Spacer(_ref5) {
|
|
|
85
84
|
style,
|
|
86
85
|
...rest
|
|
87
86
|
} = _ref5;
|
|
88
|
-
return /*#__PURE__*/React.createElement(View,
|
|
87
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
89
88
|
style: [style, {
|
|
90
89
|
paddingRight: right,
|
|
91
90
|
paddingTop: top,
|
|
92
91
|
paddingLeft: left,
|
|
93
92
|
paddingBottom: bottom
|
|
94
|
-
}]
|
|
95
|
-
|
|
93
|
+
}],
|
|
94
|
+
...rest
|
|
95
|
+
}, children);
|
|
96
|
+
}
|
|
97
|
+
export function Stack(_ref6) {
|
|
98
|
+
let {
|
|
99
|
+
children,
|
|
100
|
+
justifyContent = "flex-start",
|
|
101
|
+
alignItems = "flex-start",
|
|
102
|
+
style,
|
|
103
|
+
...rest
|
|
104
|
+
} = _ref6;
|
|
105
|
+
return (
|
|
106
|
+
/*#__PURE__*/
|
|
107
|
+
// style must go first since we don't want justifyContent, alignItems overridden
|
|
108
|
+
React.createElement(View, {
|
|
109
|
+
style: [style, {
|
|
110
|
+
justifyContent,
|
|
111
|
+
alignItems
|
|
112
|
+
}],
|
|
113
|
+
...rest
|
|
114
|
+
}, children)
|
|
115
|
+
);
|
|
116
|
+
}hildren);
|
|
96
117
|
}
|
|
97
118
|
export function Stack(_ref6) {
|
|
98
119
|
let {
|
|
@@ -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 } from "react-native";
|
|
4
3
|
import omit from "lodash.omit";
|
|
@@ -8,7 +7,6 @@ import { extractStyles } from "../../utilities";
|
|
|
8
7
|
import TextField from "../TextField";
|
|
9
8
|
import Touchable from "../Touchable";
|
|
10
9
|
const Picker = _ref => {
|
|
11
|
-
var _options$find$label, _options$find;
|
|
12
10
|
let {
|
|
13
11
|
style,
|
|
14
12
|
options,
|
|
@@ -18,6 +16,7 @@ const Picker = _ref => {
|
|
|
18
16
|
onValueChange: onValueChangeOverride = () => {},
|
|
19
17
|
...props
|
|
20
18
|
} = _ref;
|
|
19
|
+
var _a, _b;
|
|
21
20
|
const {
|
|
22
21
|
viewStyles: {
|
|
23
22
|
borderRadius,
|
|
@@ -62,7 +61,7 @@ const Picker = _ref => {
|
|
|
62
61
|
};
|
|
63
62
|
|
|
64
63
|
const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
65
|
-
const selectedLabel = selectedValue && ((
|
|
64
|
+
const selectedLabel = selectedValue && ((_b = (_a = options.find(o => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
|
|
66
65
|
return /*#__PURE__*/React.createElement(Touchable, {
|
|
67
66
|
disabled: disabled,
|
|
68
67
|
onPress: toggleFocus,
|
|
@@ -84,6 +83,25 @@ const Picker = _ref => {
|
|
|
84
83
|
label: o.label,
|
|
85
84
|
value: o.value,
|
|
86
85
|
key: o.value
|
|
86
|
+
}))), /*#__PURE__*/React.createElement(View, {
|
|
87
|
+
pointerEvents: "none"
|
|
88
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
89
|
+
...props,
|
|
90
|
+
value: selectedLabel,
|
|
91
|
+
placeholder: placeholder,
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
ref: textField,
|
|
94
|
+
disabled: disabled,
|
|
95
|
+
// @ts-expect-error
|
|
96
|
+
style: stylesWithoutMargin
|
|
97
|
+
}))));
|
|
98
|
+
};
|
|
99
|
+
const styles = StyleSheet.create({
|
|
100
|
+
container: {
|
|
101
|
+
alignSelf: "stretch"
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
export default withTheme(Picker);y: o.value
|
|
87
105
|
}))), /*#__PURE__*/React.createElement(View, {
|
|
88
106
|
pointerEvents: "none"
|
|
89
107
|
}, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
|
@@ -1,14 +1,29 @@
|
|
|
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); }
|
|
4
1
|
import * as React from "react";
|
|
5
2
|
export default class PortalConsumer extends React.Component {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
_defineProperty(this, "key", void 0);
|
|
9
|
-
}
|
|
10
3
|
async componentDidMount() {
|
|
11
4
|
this.checkManager();
|
|
5
|
+
// Delay updating to prevent React from going to infinite loop
|
|
6
|
+
await Promise.resolve();
|
|
7
|
+
this.key = this.props.manager.mount(this.props.children);
|
|
8
|
+
}
|
|
9
|
+
componentDidUpdate() {
|
|
10
|
+
this.checkManager();
|
|
11
|
+
this.props.manager.update(this.key, this.props.children);
|
|
12
|
+
}
|
|
13
|
+
componentWillUnmount() {
|
|
14
|
+
this.checkManager();
|
|
15
|
+
this.props.manager.unmount(this.key);
|
|
16
|
+
}
|
|
17
|
+
checkManager() {
|
|
18
|
+
if (!this.props.manager) {
|
|
19
|
+
throw new Error("Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.\n\n" + "Please read our getting-started guide and make sure you've followed all the required steps.\n\n" + "https://callstack.github.io/react-native-paper/getting-started.html");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}sync componentDidMount() {
|
|
26
|
+
this.checkManager();
|
|
12
27
|
|
|
13
28
|
// Delay updating to prevent React from going to infinite loop
|
|
14
29
|
await Promise.resolve();
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import StepIndicator from "./StepIndicator";
|
|
3
|
+
import { withTheme } from "../theming";
|
|
4
|
+
const ProgressIndicator = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
numberOfSteps,
|
|
7
|
+
currentStep,
|
|
8
|
+
currentStepStrokeWidth = 3,
|
|
9
|
+
stepStrokeCurrentColor = "primary",
|
|
10
|
+
stepIndicatorSize,
|
|
11
|
+
currentStepIndicatorSize,
|
|
12
|
+
stepIndicatorCurrentColor,
|
|
13
|
+
stepIndicatorLabelCurrentColor,
|
|
14
|
+
stepIndicatorLabelFontSize = 12,
|
|
15
|
+
stepNumberFinishedColor = "strongInverse",
|
|
16
|
+
stepNumberUnfinishedColor = "primary",
|
|
17
|
+
unfinishedColor = "light",
|
|
18
|
+
finishedColor = "primary",
|
|
19
|
+
theme
|
|
20
|
+
} = _ref;
|
|
21
|
+
const currentPosition = currentStep - 1;
|
|
22
|
+
return /*#__PURE__*/React.createElement(StepIndicator, {
|
|
23
|
+
stepCount: numberOfSteps,
|
|
24
|
+
currentPosition: currentPosition,
|
|
25
|
+
customStyles: {
|
|
26
|
+
stepIndicatorSize,
|
|
27
|
+
currentStepIndicatorSize: currentStepIndicatorSize ? currentStepIndicatorSize : stepIndicatorSize,
|
|
28
|
+
stepStrokeFinishedColor: finishedColor,
|
|
29
|
+
stepStrokeUnFinishedColor: unfinishedColor,
|
|
30
|
+
separatorFinishedColor: finishedColor,
|
|
31
|
+
separatorUnFinishedColor: unfinishedColor,
|
|
32
|
+
stepIndicatorFinishedColor: finishedColor,
|
|
33
|
+
stepIndicatorUnFinishedColor: unfinishedColor,
|
|
34
|
+
currentStepStrokeWidth,
|
|
35
|
+
stepStrokeCurrentColor: stepStrokeCurrentColor || stepIndicatorCurrentColor,
|
|
36
|
+
stepIndicatorLabelUnFinishedColor: stepNumberUnfinishedColor,
|
|
37
|
+
stepIndicatorLabelFinishedColor: stepNumberFinishedColor,
|
|
38
|
+
stepIndicatorCurrentColor: stepIndicatorCurrentColor || unfinishedColor,
|
|
39
|
+
stepIndicatorLabelCurrentColor: stepIndicatorLabelCurrentColor || stepNumberUnfinishedColor,
|
|
40
|
+
stepIndicatorLabelFontSize,
|
|
41
|
+
labelFontFamily: theme.typography.body1.fontFamily
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
export default withTheme(ProgressIndicator);
|
|
@@ -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 Config from "../Config";
|
|
4
3
|
import IconButton from "../IconButton";
|
|
@@ -30,6 +29,19 @@ const RadioButton = _ref => {
|
|
|
30
29
|
onPress === null || onPress === void 0 ? void 0 : onPress(realValue);
|
|
31
30
|
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
|
|
32
31
|
};
|
|
32
|
+
return /*#__PURE__*/React.createElement(IconButton, {
|
|
33
|
+
Icon: Icon,
|
|
34
|
+
icon: isSelected ? selectedIcon : unselectedIcon,
|
|
35
|
+
color: isSelected ? color : unselectedColor,
|
|
36
|
+
disabled: disabled,
|
|
37
|
+
onPress: handlePress,
|
|
38
|
+
size: size,
|
|
39
|
+
style: style,
|
|
40
|
+
...rest
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
export default RadioButton;: onValueChange(realValue);
|
|
44
|
+
};
|
|
33
45
|
return /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
34
46
|
Icon: Icon,
|
|
35
47
|
icon: isSelected ? selectedIcon : unselectedIcon,
|
|
@@ -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 } from "react-native";
|
|
4
3
|
import Text from "../Text";
|
|
@@ -20,6 +19,16 @@ const RadioButtonFieldGroup = _ref => {
|
|
|
20
19
|
fontSize: theme.typography.headline4.fontSize,
|
|
21
20
|
color: theme.typography.headline4.color
|
|
22
21
|
}, labelStyle]
|
|
22
|
+
}, label), /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
23
|
+
theme: theme,
|
|
24
|
+
...rest
|
|
25
|
+
}, children));
|
|
26
|
+
};
|
|
27
|
+
export default withTheme(RadioButtonFieldGroup);}, /*#__PURE__*/React.createElement(Text, {
|
|
28
|
+
style: [{
|
|
29
|
+
fontSize: theme.typography.headline4.fontSize,
|
|
30
|
+
color: theme.typography.headline4.color
|
|
31
|
+
}, labelStyle]
|
|
23
32
|
}, label), /*#__PURE__*/React.createElement(RadioButtonGroup, _extends({
|
|
24
33
|
theme: theme
|
|
25
34
|
}, rest), children));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,3 @@
|
|
|
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); }
|
|
4
1
|
// @ts-nocheck
|
|
5
2
|
import React, { Component } from "react";
|
|
6
3
|
import { View, Text, StyleSheet, Animated, TouchableWithoutFeedback } from "react-native";
|
|
@@ -12,7 +9,7 @@ const STEP_STATUS = {
|
|
|
12
9
|
export default class StepIndicator extends Component {
|
|
13
10
|
constructor(props) {
|
|
14
11
|
super(props);
|
|
15
|
-
|
|
12
|
+
this.renderProgressBarBackground = () => {
|
|
16
13
|
const {
|
|
17
14
|
stepCount,
|
|
18
15
|
direction
|
|
@@ -55,8 +52,8 @@ export default class StepIndicator extends Component {
|
|
|
55
52
|
},
|
|
56
53
|
style: progressBarBackgroundStyle
|
|
57
54
|
});
|
|
58
|
-
}
|
|
59
|
-
|
|
55
|
+
};
|
|
56
|
+
this.renderProgressBar = () => {
|
|
60
57
|
const {
|
|
61
58
|
stepCount,
|
|
62
59
|
direction
|
|
@@ -86,8 +83,8 @@ export default class StepIndicator extends Component {
|
|
|
86
83
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
87
84
|
style: progressBarStyle
|
|
88
85
|
});
|
|
89
|
-
}
|
|
90
|
-
|
|
86
|
+
};
|
|
87
|
+
this.renderStepIndicator = () => {
|
|
91
88
|
let steps = [];
|
|
92
89
|
const {
|
|
93
90
|
stepCount,
|
|
@@ -118,8 +115,8 @@ export default class StepIndicator extends Component {
|
|
|
118
115
|
height: this.state.customStyles.currentStepIndicatorSize
|
|
119
116
|
}]
|
|
120
117
|
}, steps);
|
|
121
|
-
}
|
|
122
|
-
|
|
118
|
+
};
|
|
119
|
+
this.renderStepLabels = () => {
|
|
123
120
|
const {
|
|
124
121
|
labels,
|
|
125
122
|
direction,
|
|
@@ -161,8 +158,8 @@ export default class StepIndicator extends Component {
|
|
|
161
158
|
alignItems: this.state.customStyles.labelAlign
|
|
162
159
|
}]
|
|
163
160
|
}, labelViews);
|
|
164
|
-
}
|
|
165
|
-
|
|
161
|
+
};
|
|
162
|
+
this.renderStep = position => {
|
|
166
163
|
const {
|
|
167
164
|
renderStepIndicator
|
|
168
165
|
} = this.props;
|
|
@@ -229,8 +226,8 @@ export default class StepIndicator extends Component {
|
|
|
229
226
|
}) : /*#__PURE__*/React.createElement(Text, {
|
|
230
227
|
style: indicatorLabelStyle
|
|
231
228
|
}, "".concat(position + 1)));
|
|
232
|
-
}
|
|
233
|
-
|
|
229
|
+
};
|
|
230
|
+
this.getStepStatus = stepPosition => {
|
|
234
231
|
const {
|
|
235
232
|
currentPosition
|
|
236
233
|
} = this.props;
|
|
@@ -241,8 +238,8 @@ export default class StepIndicator extends Component {
|
|
|
241
238
|
} else {
|
|
242
239
|
return STEP_STATUS.UNFINISHED;
|
|
243
240
|
}
|
|
244
|
-
}
|
|
245
|
-
|
|
241
|
+
};
|
|
242
|
+
this.onCurrentPositionChanged = position => {
|
|
246
243
|
let {
|
|
247
244
|
stepCount
|
|
248
245
|
} = this.props;
|
|
@@ -262,7 +259,7 @@ export default class StepIndicator extends Component {
|
|
|
262
259
|
toValue: this.state.customStyles.currentStepIndicatorSize / 2,
|
|
263
260
|
duration: 100
|
|
264
261
|
})])]).start();
|
|
265
|
-
}
|
|
262
|
+
};
|
|
266
263
|
const defaultStyles = {
|
|
267
264
|
stepIndicatorSize: 30,
|
|
268
265
|
currentStepIndicatorSize: 40,
|
|
@@ -328,7 +325,6 @@ export default class StepIndicator extends Component {
|
|
|
328
325
|
// ),
|
|
329
326
|
// }));
|
|
330
327
|
// }
|
|
331
|
-
|
|
332
328
|
if (prevProps.currentPosition !== this.props.currentPosition) {
|
|
333
329
|
this.onCurrentPositionChanged(this.props.currentPosition);
|
|
334
330
|
}
|
|
@@ -369,6 +365,50 @@ const styles = StyleSheet.create({
|
|
|
369
365
|
justifyContent: "center"
|
|
370
366
|
}
|
|
371
367
|
});
|
|
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
|
+
});
|
|
372
412
|
StepIndicator.defaultProps = {
|
|
373
413
|
currentPosition: 0,
|
|
374
414
|
stepCount: 5,
|
|
@@ -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
|
/* Copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx */
|
|
3
2
|
import * as React from "react";
|
|
4
3
|
import { Animated, StyleSheet } from "react-native";
|
|
@@ -34,6 +33,21 @@ const Surface = _ref => {
|
|
|
34
33
|
return colors.surface;
|
|
35
34
|
}
|
|
36
35
|
};
|
|
36
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
37
|
+
...rest,
|
|
38
|
+
style: [{
|
|
39
|
+
backgroundColor: getBackgroundColor(),
|
|
40
|
+
elevation,
|
|
41
|
+
...evalationStyles,
|
|
42
|
+
...restStyle
|
|
43
|
+
}]
|
|
44
|
+
}, children);
|
|
45
|
+
};
|
|
46
|
+
export default withTheme(Surface);erlay(elevation, colors.surface);
|
|
47
|
+
} else {
|
|
48
|
+
return colors.surface;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
37
51
|
return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
|
|
38
52
|
style: [{
|
|
39
53
|
backgroundColor: getBackgroundColor(),
|
|
@@ -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 { Switch as NativeSwitch } from "react-native";
|
|
4
3
|
import { withTheme } from "../theming";
|
|
@@ -29,7 +28,6 @@ function Switch(_ref) {
|
|
|
29
28
|
setChecked(value);
|
|
30
29
|
}
|
|
31
30
|
}, [value, checked]);
|
|
32
|
-
|
|
33
31
|
// This special logic is to handle weird APIs like Airtable that return
|
|
34
32
|
// true or undefined for a boolean
|
|
35
33
|
const previousDefaultValue = usePrevious(defaultValue);
|
|
@@ -38,24 +36,24 @@ function Switch(_ref) {
|
|
|
38
36
|
setChecked(Boolean(defaultValue));
|
|
39
37
|
}
|
|
40
38
|
}, [defaultValue, previousDefaultValue]);
|
|
41
|
-
return /*#__PURE__*/React.createElement(NativeSwitch,
|
|
39
|
+
return /*#__PURE__*/React.createElement(NativeSwitch, {
|
|
42
40
|
value: checked,
|
|
43
41
|
disabled: disabled,
|
|
44
42
|
trackColor: {
|
|
45
43
|
false: inactiveTrackThemeColor,
|
|
46
44
|
true: activeTrackThemeColor
|
|
47
45
|
},
|
|
48
|
-
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor
|
|
46
|
+
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor,
|
|
49
47
|
// @ts-ignore react-native-web only
|
|
50
|
-
,
|
|
51
48
|
activeThumbColor: activeThumbThemeColor,
|
|
52
49
|
ios_backgroundColor: inactiveTrackThemeColor,
|
|
53
50
|
style: style,
|
|
54
51
|
onValueChange: bool => {
|
|
55
52
|
setChecked(bool);
|
|
56
53
|
onValueChange && onValueChange(bool);
|
|
57
|
-
}
|
|
58
|
-
|
|
54
|
+
},
|
|
55
|
+
...rest
|
|
56
|
+
});
|
|
59
57
|
}
|
|
60
58
|
function Row(_ref2) {
|
|
61
59
|
let {
|
|
@@ -84,7 +82,7 @@ function Row(_ref2) {
|
|
|
84
82
|
setChecked(defaultValue);
|
|
85
83
|
}
|
|
86
84
|
}, [defaultValue]);
|
|
87
|
-
return /*#__PURE__*/React.createElement(FormRow,
|
|
85
|
+
return /*#__PURE__*/React.createElement(FormRow, {
|
|
88
86
|
disabled: disabled,
|
|
89
87
|
onPress: () => {
|
|
90
88
|
setChecked(!checked);
|
|
@@ -92,8 +90,9 @@ function Row(_ref2) {
|
|
|
92
90
|
},
|
|
93
91
|
label: label,
|
|
94
92
|
direction: direction,
|
|
95
|
-
style: style
|
|
96
|
-
|
|
93
|
+
style: style,
|
|
94
|
+
...rest
|
|
95
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
97
96
|
theme: theme,
|
|
98
97
|
value: checked,
|
|
99
98
|
disabled: disabled,
|
|
@@ -106,4 +105,16 @@ function Row(_ref2) {
|
|
|
106
105
|
}
|
|
107
106
|
const SwitchRow = withTheme(Row);
|
|
108
107
|
export { SwitchRow };
|
|
108
|
+
export default withTheme(Switch);: theme,
|
|
109
|
+
value: checked,
|
|
110
|
+
disabled: disabled,
|
|
111
|
+
onValueChange: onValueChange,
|
|
112
|
+
activeTrackColor: activeTrackColor,
|
|
113
|
+
inactiveTrackColor: inactiveTrackColor,
|
|
114
|
+
activeThumbColor: activeThumbColor,
|
|
115
|
+
inactiveThumbColor: inactiveThumbColor
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
const SwitchRow = withTheme(Row);
|
|
119
|
+
export { SwitchRow };
|
|
109
120
|
export default withTheme(Switch);
|
|
@@ -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 { TabView, TabBar, SceneMap } from "react-native-tab-view";
|
|
4
3
|
import { withTheme } from "../../theming";
|
|
@@ -28,13 +27,11 @@ const TabViewComponent = _ref => {
|
|
|
28
27
|
textStyles,
|
|
29
28
|
viewStyles
|
|
30
29
|
} = extractStyles(style);
|
|
31
|
-
|
|
32
30
|
//Check type of child using props
|
|
33
31
|
//Regular '.type' cannot work because Draftbit strips the type in Draft view
|
|
34
32
|
const instanceOfTabViewItemProps = object => {
|
|
35
33
|
return "title" in object;
|
|
36
34
|
};
|
|
37
|
-
|
|
38
35
|
//Populate routes and scenes based on children
|
|
39
36
|
React.useEffect(() => {
|
|
40
37
|
const newRoutes = [];
|
|
@@ -60,7 +57,8 @@ const TabViewComponent = _ref => {
|
|
|
60
57
|
}
|
|
61
58
|
};
|
|
62
59
|
const renderTabBar = props => {
|
|
63
|
-
return /*#__PURE__*/React.createElement(TabBar,
|
|
60
|
+
return /*#__PURE__*/React.createElement(TabBar, {
|
|
61
|
+
...props,
|
|
64
62
|
activeColor: activeColor || theme.colors.primary,
|
|
65
63
|
inactiveColor: inactiveColor || theme.colors.divider,
|
|
66
64
|
pressColor: pressColor || theme.colors.primary,
|
|
@@ -74,7 +72,7 @@ const TabViewComponent = _ref => {
|
|
|
74
72
|
route,
|
|
75
73
|
color
|
|
76
74
|
} = _ref2;
|
|
77
|
-
return route
|
|
75
|
+
return (route === null || route === void 0 ? void 0 : route.icon) ? /*#__PURE__*/React.createElement(Icon, {
|
|
78
76
|
name: route.icon,
|
|
79
77
|
color: color,
|
|
80
78
|
size: 16
|
|
@@ -83,9 +81,8 @@ const TabViewComponent = _ref => {
|
|
|
83
81
|
style: {
|
|
84
82
|
backgroundColor: tabsBackgroundColor || theme.colors.background
|
|
85
83
|
}
|
|
86
|
-
})
|
|
84
|
+
});
|
|
87
85
|
};
|
|
88
|
-
|
|
89
86
|
//Cannot render TabView without at least one tab
|
|
90
87
|
if (!routes.length) {
|
|
91
88
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
@@ -104,4 +101,17 @@ const TabViewComponent = _ref => {
|
|
|
104
101
|
swipeEnabled: swipeEnabled
|
|
105
102
|
});
|
|
106
103
|
};
|
|
104
|
+
export default withTheme(TabViewComponent);tyles],
|
|
105
|
+
navigationState: {
|
|
106
|
+
index,
|
|
107
|
+
routes
|
|
108
|
+
},
|
|
109
|
+
renderScene: SceneMap(tabScenes),
|
|
110
|
+
renderTabBar: renderTabBar,
|
|
111
|
+
onIndexChange: indexChangeHandler,
|
|
112
|
+
tabBarPosition: tabBarPosition,
|
|
113
|
+
keyboardDismissMode: keyboardDismissMode,
|
|
114
|
+
swipeEnabled: swipeEnabled
|
|
115
|
+
});
|
|
116
|
+
};
|
|
107
117
|
export default withTheme(TabViewComponent);
|