@draftbit/core 46.6.0 → 46.6.4

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.
Files changed (54) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +4 -23
  2. package/lib/commonjs/components/Banner.js +4 -23
  3. package/lib/commonjs/components/Button.js +10 -33
  4. package/lib/commonjs/components/CardContainer.js +4 -13
  5. package/lib/commonjs/components/CardContainerShortImage.js +4 -15
  6. package/lib/commonjs/components/Checkbox/Checkbox.js +4 -22
  7. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +2 -17
  8. package/lib/commonjs/components/Container.js +4 -15
  9. package/lib/commonjs/components/DeprecatedCardWrapper.js +1 -15
  10. package/lib/commonjs/components/Elevation.js +2 -14
  11. package/lib/commonjs/components/FAB.js +4 -18
  12. package/lib/commonjs/components/FieldSearchBarFull.js +2 -1
  13. package/lib/commonjs/components/Image.js +2 -17
  14. package/lib/commonjs/components/Layout.js +19 -40
  15. package/lib/commonjs/components/Picker/Picker.js +4 -9
  16. package/lib/commonjs/components/Picker/PickerComponent.ios.js +11 -36
  17. package/lib/commonjs/components/Picker/PickerComponent.web.js +3 -20
  18. package/lib/commonjs/components/Portal/PortalManager.js +8 -34
  19. package/lib/commonjs/components/Pressable.js +2 -15
  20. package/lib/commonjs/components/ProgressBar.js +7 -37
  21. package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +1 -9
  22. package/lib/commonjs/components/ScreenContainer.js +4 -20
  23. package/lib/commonjs/components/StepIndicator.js +18 -57
  24. package/lib/commonjs/components/Surface.js +2 -14
  25. package/lib/commonjs/components/Switch.js +10 -19
  26. package/lib/commonjs/components/TextField.js +28 -76
  27. package/lib/commonjs/components/ToggleButton.js +2 -15
  28. package/lib/commonjs/components/Touchable.js +2 -15
  29. package/lib/module/components/AnimatedCircularProgress.js +13 -1
  30. package/lib/module/components/AvatarEdit.js +4 -15
  31. package/lib/module/components/Button.js +10 -33
  32. package/lib/module/components/Checkbox/Checkbox.js +4 -25
  33. package/lib/module/components/Checkbox/CheckboxGroup.js +2 -16
  34. package/lib/module/components/Checkbox/CheckboxGroupRow.js +5 -24
  35. package/lib/module/components/CircularProgress.js +8 -28
  36. package/lib/module/components/DatePicker/DatePicker.js +13 -27
  37. package/lib/module/components/DeprecatedButton.js +3 -21
  38. package/lib/module/components/Elevation.js +2 -14
  39. package/lib/module/components/FieldSearchBarFull.js +2 -1
  40. package/lib/module/components/Image.js +2 -18
  41. package/lib/module/components/Layout.js +21 -42
  42. package/lib/module/components/NumberInput.js +3 -12
  43. package/lib/module/components/Picker/Picker.js +4 -10
  44. package/lib/module/components/Picker/PickerComponent.ios.js +11 -36
  45. package/lib/module/components/Portal/PortalConsumer.js +0 -23
  46. package/lib/module/components/RadioButton/RadioButtonRow.js +5 -24
  47. package/lib/module/components/ScreenContainer.js +4 -21
  48. package/lib/module/components/Switch.js +10 -21
  49. package/lib/module/components/Text.js +4 -50
  50. package/lib/module/components/TextField.js +28 -78
  51. package/lib/module/constants.js +2 -1
  52. package/lib/module/mappings/FieldSearchBarFull.js +1 -4
  53. package/lib/module/mappings/StarRating.js +2 -7
  54. package/package.json +3 -3
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { View, StyleSheet, Pressable } from "react-native";
3
4
  import { useTheme } from "../../theming";
@@ -25,6 +26,7 @@ const Checkbox = _ref => {
25
26
  setInternalValue(status);
26
27
  }
27
28
  }, [status]);
29
+
28
30
  // This special logic is to handle weird APIs like Airtable that return
29
31
  // true or undefined for a boolean
30
32
  const previousDefaultValue = usePrevious(defaultValue);
@@ -48,8 +50,7 @@ const Checkbox = _ref => {
48
50
  onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
49
51
  }
50
52
  };
51
- return /*#__PURE__*/React.createElement(Pressable, {
52
- ...rest,
53
+ return /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
53
54
  onPress: handlePress,
54
55
  disabled: disabled,
55
56
  accessibilityState: {
@@ -61,7 +62,7 @@ const Checkbox = _ref => {
61
62
  width: size,
62
63
  height: size
63
64
  }]
64
- }, /*#__PURE__*/React.createElement(Icon, {
65
+ }), /*#__PURE__*/React.createElement(Icon, {
65
66
  style: styles.icon,
66
67
  name: internalValue ? checkedIcon : uncheckedIcon,
67
68
  size: size,
@@ -94,26 +95,4 @@ const styles = StyleSheet.create({
94
95
  alignSelf: "center"
95
96
  }
96
97
  });
97
- export default Checkbox;or: checkboxColor
98
- }]
99
- })));
100
- };
101
- const styles = StyleSheet.create({
102
- container: {
103
- borderRadius: 18
104
- },
105
- fillContainer: {
106
- alignItems: "center",
107
- justifyContent: "center"
108
- },
109
- icon: {
110
- alignSelf: "center"
111
- },
112
- fill: {
113
- borderRadius: 5,
114
- width: 30,
115
- height: 30,
116
- alignSelf: "center"
117
- }
118
- });
119
98
  export default Checkbox;
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { View } from "react-native";
3
4
  import { checkboxGroupContext, Direction } from "./context";
@@ -22,22 +23,7 @@ const CheckboxGroup = _ref => {
22
23
  alignItems: "center"
23
24
  });
24
25
  }
25
- return /*#__PURE__*/React.createElement(View, {
26
- style: [{
27
- minHeight: 40
28
- }, style],
29
- ...rest
30
- }, /*#__PURE__*/React.createElement(Provider, {
31
- value: {
32
- values,
33
- onValueChange,
34
- direction
35
- }
36
- }, /*#__PURE__*/React.createElement(View, {
37
- style: _containerStyle
38
- }, children)));
39
- };
40
- export default CheckboxGroup;PURE__*/React.createElement(View, _extends({
26
+ return /*#__PURE__*/React.createElement(View, _extends({
41
27
  style: [{
42
28
  minHeight: 40
43
29
  }, style]
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { StyleSheet, View, Platform, Pressable } from "react-native";
3
4
  import Checkbox from "./Checkbox";
@@ -5,7 +6,7 @@ import Text from "../Text";
5
6
  import { useCheckboxGroupContext } from "./context";
6
7
  import { Direction as GroupDirection } from "./context";
7
8
  import { extractStyles } from "../../utilities";
8
- export var Direction;
9
+ export let Direction;
9
10
  (function (Direction) {
10
11
  Direction["Row"] = "row";
11
12
  Direction["RowReverse"] = "row-reverse";
@@ -62,14 +63,13 @@ const CheckboxGroupRow = _ref => {
62
63
  textStyles,
63
64
  viewStyles
64
65
  } = extractStyles(style);
65
- return /*#__PURE__*/React.createElement(Pressable, {
66
+ return /*#__PURE__*/React.createElement(Pressable, _extends({
66
67
  onPress: handlePress,
67
68
  style: [styles.mainParent, {
68
69
  flexDirection: direction
69
70
  }, viewStyles],
70
- disabled: disabled,
71
- ...rest
72
- }, /*#__PURE__*/React.createElement(View, {
71
+ disabled: disabled
72
+ }, rest), /*#__PURE__*/React.createElement(View, {
73
73
  style: [styles.label, {
74
74
  alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
75
75
  }, labelContainerStyle]
@@ -107,23 +107,4 @@ const styles = StyleSheet.create({
107
107
  flex: 3
108
108
  }
109
109
  });
110
- export default CheckboxGroupRow;reate({
111
- mainParent: {
112
- alignItems: "center",
113
- justifyContent: "space-around",
114
- paddingStart: 20,
115
- minHeight: 50,
116
- paddingEnd: 20,
117
- display: "flex",
118
- ...Platform.select({
119
- web: {
120
- cursor: "pointer",
121
- userSelect: "none"
122
- }
123
- })
124
- },
125
- label: {
126
- flex: 3
127
- }
128
- });
129
110
  export default CheckboxGroupRow;
@@ -1,24 +1,27 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1
4
  import React from "react";
2
5
  import { View } from "react-native";
3
6
  import { Svg, Path, G } from "react-native-svg";
4
7
  class CircularProgress extends React.Component {
5
8
  constructor() {
6
9
  super(...arguments);
7
- this.polarToCartesian = (centerX, centerY, radius, angleInDegrees) => {
10
+ _defineProperty(this, "polarToCartesian", (centerX, centerY, radius, angleInDegrees) => {
8
11
  var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;
9
12
  return {
10
13
  x: centerX + radius * Math.cos(angleInRadians),
11
14
  y: centerY + radius * Math.sin(angleInRadians)
12
15
  };
13
- };
14
- this.circlePath = (x, y, radius, startAngle, endAngle) => {
16
+ });
17
+ _defineProperty(this, "circlePath", (x, y, radius, startAngle, endAngle) => {
15
18
  var start = this.polarToCartesian(x, y, radius, endAngle * 0.9999);
16
19
  var end = this.polarToCartesian(x, y, radius, startAngle);
17
20
  var largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
18
21
  var d = ["M", start.x, start.y, "A", radius, radius, 0, largeArcFlag, 0, end.x, end.y];
19
22
  return d.join(" ");
20
- };
21
- this.clampFill = fill => Math.min(100, Math.max(0, fill));
23
+ });
24
+ _defineProperty(this, "clampFill", fill => Math.min(100, Math.max(0, fill)));
22
25
  }
23
26
  render() {
24
27
  const {
@@ -98,27 +101,4 @@ class CircularProgress extends React.Component {
98
101
  }, children(fill)));
99
102
  }
100
103
  }
101
- export default CircularProgress;eElement(G, {
102
- rotation: rotation,
103
- originX: (size + padding) / 2,
104
- originY: (size + padding) / 2
105
- }, backgroundColor && /*#__PURE__*/React.createElement(Path, {
106
- d: backgroundPath,
107
- stroke: backgroundColor,
108
- strokeWidth: backgroundWidth || width,
109
- strokeLinecap: lineCap,
110
- strokeDasharray: strokeDasharrayBackground,
111
- fill: "transparent"
112
- }), fill > 0 && /*#__PURE__*/React.createElement(Path, {
113
- d: circlePathItem,
114
- stroke: tintColor,
115
- strokeWidth: width,
116
- strokeLinecap: lineCap,
117
- strokeDasharray: strokeDasharrayTint,
118
- fill: "transparent"
119
- }), cap)), children && /*#__PURE__*/React.createElement(View, {
120
- style: localChildrenContainerStyle
121
- }, children(fill)));
122
- }
123
- }
124
104
  export default CircularProgress;
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { View, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput } from "react-native";
3
4
  import { useSafeAreaInsets } from "react-native-safe-area-context";
@@ -81,20 +82,24 @@ const DatePicker = _ref => {
81
82
  focused ? _handleBlur() : _handleFocus();
82
83
  };
83
84
  const insets = useSafeAreaInsets();
85
+
84
86
  // const _restoreLabel = () =>
85
87
  // Animated.timing(labeled, {
86
88
  // toValue: 1,
87
89
  // duration: FOCUS_ANIMATION_DURATION,
88
90
  // useNativeDriver: true,
89
91
  // }).start();
92
+
90
93
  // const _minmizeLabel = () =>
91
94
  // Animated.timing(labeled, {
92
95
  // toValue: 0,
93
96
  // duration: BLUR_ANIMATION_DURATION,
94
97
  // useNativeDriver: true,
95
98
  // }).start();
99
+
96
100
  // const _showPlaceholder = () =>
97
101
  // setTimeout(() => setPlaceholder1(placeholder || ""), 50);
102
+
98
103
  const _hidePlaceholder = () => {
99
104
  setPlaceholder1("");
100
105
  };
@@ -237,7 +242,9 @@ const DatePicker = _ref => {
237
242
  const inputStyles = [styles.input, inputStyle, type === "solid" ? {
238
243
  marginHorizontal: 12
239
244
  } : {}];
245
+
240
246
  // const render = (props) => <NativeTextInput {...props} />;
247
+
241
248
  return /*#__PURE__*/React.createElement(View, {
242
249
  style: [styles.container, style]
243
250
  }, /*#__PURE__*/React.createElement(Touchable, {
@@ -247,10 +254,9 @@ const DatePicker = _ref => {
247
254
  pointerEvents: "none"
248
255
  }, /*#__PURE__*/React.createElement(View, {
249
256
  style: [styles.container, style]
250
- }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
251
- ...leftIconProps,
257
+ }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
252
258
  style: leftIconStyle
253
- }) : null, /*#__PURE__*/React.createElement(View, {
259
+ })) : null, /*#__PURE__*/React.createElement(View, {
254
260
  style: [containerStyle, style ? {
255
261
  height: style.height
256
262
  } : {}, viewStyles]
@@ -299,13 +305,12 @@ const DatePicker = _ref => {
299
305
  opacity: hasActiveOutline ? labeled : 1
300
306
  }],
301
307
  numberOfLines: 1
302
- }, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, {
303
- ...leftIconProps,
308
+ }, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
304
309
  style: {
305
310
  ...leftIconStyle,
306
311
  marginLeft: type === "solid" ? 16 : 0
307
312
  }
308
- }) : null, /*#__PURE__*/React.createElement(NativeTextInput, {
313
+ })) : null, /*#__PURE__*/React.createElement(NativeTextInput, _extends({
309
314
  value: formatDate(),
310
315
  placeholder: label ? placeholder1 : placeholder,
311
316
  editable: !disabled,
@@ -314,9 +319,8 @@ const DatePicker = _ref => {
314
319
  onFocus: _handleFocus,
315
320
  onBlur: _handleBlur,
316
321
  underlineColorAndroid: "transparent",
317
- style: [inputStyles, textStyles],
318
- ...props
319
- })), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
322
+ style: [inputStyles, textStyles]
323
+ }, props))), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
320
324
  name: rightIconName,
321
325
  size: ICON_SIZE,
322
326
  color: colors.light,
@@ -387,22 +391,4 @@ const styles = StyleSheet.create({
387
391
  alignSelf: "flex-end"
388
392
  }
389
393
  });
390
- export default withTheme(DatePicker);yContent: "center",
391
- textAlignVertical: "center",
392
- margin: 0,
393
- textAlign: I18nManager.isRTL ? "right" : "left"
394
- },
395
- placeholder: {
396
- position: "absolute",
397
- left: 0
398
- },
399
- pickerContainer: {
400
- flexDirection: "column",
401
- width: "100%",
402
- zIndex: 100
403
- },
404
- closeButton: {
405
- alignSelf: "flex-end"
406
- }
407
- });
408
394
  export default withTheme(DatePicker);
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { ActivityIndicator, View, Text, StyleSheet, Pressable } from "react-native";
3
4
  import color from "color";
@@ -74,8 +75,7 @@ const Button = _ref => {
74
75
  elevation,
75
76
  alignSelf: "stretch"
76
77
  }
77
- }, /*#__PURE__*/React.createElement(Pressable, {
78
- ...rest,
78
+ }, /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
79
79
  onPress: onPress,
80
80
  accessibilityState: {
81
81
  disabled
@@ -83,7 +83,7 @@ const Button = _ref => {
83
83
  accessibilityRole: "button",
84
84
  disabled: disabled || loading,
85
85
  style: [styles.button, buttonStyle]
86
- }, /*#__PURE__*/React.createElement(View, {
86
+ }), /*#__PURE__*/React.createElement(View, {
87
87
  style: styles.content
88
88
  }, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
89
89
  style: iconStyle
@@ -114,22 +114,4 @@ const styles = StyleSheet.create({
114
114
  width: Config.buttonIconSize
115
115
  }
116
116
  });
117
- export default withTheme(Button);: 1,
118
- style: [textStyle, typography.button]
119
- }, children))));
120
- };
121
- const styles = StyleSheet.create({
122
- button: {
123
- minWidth: 64,
124
- borderStyle: "solid"
125
- },
126
- content: {
127
- flexDirection: "row",
128
- alignItems: "center",
129
- justifyContent: "center"
130
- },
131
- icon: {
132
- width: Config.buttonIconSize
133
- }
134
- });
135
117
  export default withTheme(Button);
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { Animated, StyleSheet, View } from "react-native";
3
4
  import shadow from "../styles/shadow";
@@ -18,20 +19,7 @@ const Elevation = _ref => {
18
19
  colors
19
20
  } = theme;
20
21
  const borderRadius = radius;
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, {
22
+ return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
35
23
  style: [{
36
24
  borderRadius,
37
25
  backgroundColor: colors.surface
@@ -46,6 +46,7 @@ const FieldSearchBarFull = _ref => {
46
46
  lineHeight,
47
47
  ...typeStyles
48
48
  } = typography.body2; // eslint-disable-line @typescript-eslint/no-unused-vars
49
+
49
50
  const handleChangeText = newValue => {
50
51
  setInternalValue(newValue);
51
52
  if (onChange) {
@@ -83,4 +84,4 @@ const styles = StyleSheet.create({
83
84
  alignItems: "center"
84
85
  }
85
86
  });
86
- export default withTheme(FieldSearchBarFull);;
87
+ export default withTheme(FieldSearchBarFull);
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  /* README: Internal Image component used for stuff like Card. DO NOT EXPORT! */
2
3
  import React from "react";
3
4
  import { Image as NativeImage, StyleSheet } from "react-native";
@@ -55,24 +56,7 @@ const Image = _ref2 => {
55
56
  height,
56
57
  aspectRatio
57
58
  }]
58
- }, /*#__PURE__*/React.createElement(NativeImage, {
59
- ...props,
60
- source: imageSource,
61
- resizeMode: resizeMode,
62
- style: [style, {
63
- height: "100%",
64
- width: "100%"
65
- }]
66
- }));
67
- }
68
- return /*#__PURE__*/React.createElement(NativeImage, {
69
- ...props,
70
- source: source,
71
- resizeMode: resizeMode,
72
- style: style
73
- });
74
- };
75
- export default Image;eImage, _extends({}, props, {
59
+ }, /*#__PURE__*/React.createElement(NativeImage, _extends({}, props, {
76
60
  source: imageSource,
77
61
  resizeMode: resizeMode,
78
62
  style: [style, {
@@ -1,5 +1,8 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { View } from "react-native";
4
+ // @ts-ignore
5
+
3
6
  export function Center(_ref) {
4
7
  let {
5
8
  width = 240,
@@ -9,16 +12,15 @@ export function Center(_ref) {
9
12
  style,
10
13
  ...rest
11
14
  } = _ref;
12
- return /*#__PURE__*/React.createElement(View, {
15
+ return /*#__PURE__*/React.createElement(View, _extends({
13
16
  style: [{
14
17
  justifyContent: "center",
15
18
  alignItems: "center",
16
19
  width,
17
20
  height,
18
21
  backgroundColor: bgColor
19
- }, style],
20
- ...rest
21
- }, children);
22
+ }, style]
23
+ }, rest), children);
22
24
  }
23
25
  export function Circle(_ref2) {
24
26
  let {
@@ -29,7 +31,7 @@ export function Circle(_ref2) {
29
31
  ...rest
30
32
  } = _ref2;
31
33
  const borderRadius = 1000;
32
- return /*#__PURE__*/React.createElement(Center, {
34
+ return /*#__PURE__*/React.createElement(Center, _extends({
33
35
  width: size,
34
36
  height: size,
35
37
  bgColor: bgColor,
@@ -37,9 +39,8 @@ export function Circle(_ref2) {
37
39
  backgroundColor: bgColor,
38
40
  borderRadius,
39
41
  overflow: "hidden"
40
- }],
41
- ...rest
42
- }, children);
42
+ }]
43
+ }, rest), children);
43
44
  }
44
45
  export function Square(_ref3) {
45
46
  let {
@@ -49,13 +50,12 @@ export function Square(_ref3) {
49
50
  style,
50
51
  ...rest
51
52
  } = _ref3;
52
- return /*#__PURE__*/React.createElement(Center, {
53
+ return /*#__PURE__*/React.createElement(Center, _extends({
53
54
  style: style,
54
55
  width: size,
55
56
  height: size,
56
- bgColor: bgColor,
57
- ...rest
58
- }, children);
57
+ bgColor: bgColor
58
+ }, rest), children);
59
59
  }
60
60
  export function Row(_ref4) {
61
61
  let {
@@ -65,14 +65,15 @@ export function Row(_ref4) {
65
65
  style,
66
66
  ...rest
67
67
  } = _ref4;
68
- return /*#__PURE__*/React.createElement(View, {
69
- style: [style, {
68
+ return /*#__PURE__*/React.createElement(View, _extends({
69
+ style: [style,
70
+ // style goes first b/c we can't override these
71
+ {
70
72
  alignItems,
71
73
  flexDirection: "row",
72
74
  justifyContent: justifyContent
73
- }],
74
- ...rest
75
- }, children);
75
+ }]
76
+ }, rest), children);
76
77
  }
77
78
  export function Spacer(_ref5) {
78
79
  let {
@@ -84,36 +85,14 @@ export function Spacer(_ref5) {
84
85
  style,
85
86
  ...rest
86
87
  } = _ref5;
87
- return /*#__PURE__*/React.createElement(View, {
88
+ return /*#__PURE__*/React.createElement(View, _extends({
88
89
  style: [style, {
89
90
  paddingRight: right,
90
91
  paddingTop: top,
91
92
  paddingLeft: left,
92
93
  paddingBottom: bottom
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);
94
+ }]
95
+ }, rest), children);
117
96
  }
118
97
  export function Stack(_ref6) {
119
98
  let {
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import React, { useEffect, useState } from "react";
2
3
  import { TextInput } from "react-native";
3
4
  import { isString, isNumber, isNaN } from "lodash";
@@ -25,6 +26,7 @@ const NumberInput = _ref => {
25
26
  }
26
27
  return "0";
27
28
  };
29
+
28
30
  // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
29
31
  useEffect(() => {
30
32
  const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
@@ -39,6 +41,7 @@ const NumberInput = _ref => {
39
41
  setCurrentStringNumberValue(newStringNumberValue);
40
42
  onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(number);
41
43
  };
44
+
42
45
  // run handleChangeText with value prop only when value prop changes (and first render to reset currentStringNumberValue)
43
46
  useEffect(() => {
44
47
  const nextStringNumberValue = formatValueToStringNumber(value);
@@ -47,18 +50,6 @@ const NumberInput = _ref => {
47
50
  }
48
51
  // eslint-disable-next-line react-hooks/exhaustive-deps
49
52
  }, [value]);
50
- return /*#__PURE__*/React.createElement(TextInput, {
51
- keyboardType: "numeric",
52
- value: currentStringNumberValue,
53
- onChangeText: handleChangeText,
54
- ...props
55
- });
56
- };
57
- export default NumberInput;alue) {
58
- handleChangeText(nextStringNumberValue);
59
- }
60
- // eslint-disable-next-line react-hooks/exhaustive-deps
61
- }, [value]);
62
53
  return /*#__PURE__*/React.createElement(TextInput, _extends({
63
54
  keyboardType: "numeric",
64
55
  value: currentStringNumberValue,
@@ -37,6 +37,7 @@ const unstyledColor = "rgba(165, 173, 183, 1)";
37
37
  const disabledColor = "rgb(240, 240, 240)";
38
38
  const errorColor = "rgba(255, 69, 100, 1)";
39
39
  const Picker = _ref => {
40
+ var _find$label, _find;
40
41
  let {
41
42
  error,
42
43
  options = [],
@@ -58,7 +59,6 @@ const Picker = _ref => {
58
59
  rightIconName,
59
60
  type = "solid"
60
61
  } = _ref;
61
- var _a, _b;
62
62
  const androidPickerRef = React.useRef(undefined);
63
63
  const [internalValue, setInternalValue] = React.useState(value || defaultValue);
64
64
  const [pickerVisible, setPickerVisible] = React.useState(false);
@@ -76,9 +76,9 @@ const Picker = _ref => {
76
76
  }
77
77
  }, [defaultValue]);
78
78
  React.useEffect(() => {
79
- var _a;
80
79
  if (pickerVisible && androidPickerRef.current) {
81
- (_a = androidPickerRef === null || androidPickerRef === void 0 ? void 0 : androidPickerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
80
+ var _androidPickerRef$cur;
81
+ androidPickerRef === null || androidPickerRef === void 0 ? void 0 : (_androidPickerRef$cur = androidPickerRef.current) === null || _androidPickerRef$cur === void 0 ? void 0 : _androidPickerRef$cur.focus();
82
82
  }
83
83
  }, [pickerVisible, androidPickerRef]);
84
84
  const normalizedOptions = normalizeOptions(options);
@@ -128,7 +128,7 @@ const Picker = _ref => {
128
128
  ...extractedMarginStyles
129
129
  };
130
130
  const stylesWithoutBordersAndMargins = omit(viewStyles, [...borderStyleNames, ...marginStyleNames, ...additionalBorderStyles, ...additionalMarginStyles]);
131
- const selectedLabel = internalValue && ((_b = (_a = pickerOptions.find(option => option.value === internalValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : internalValue);
131
+ const selectedLabel = internalValue && ((_find$label = (_find = pickerOptions.find(option => option.value === internalValue)) === null || _find === void 0 ? void 0 : _find.label) !== null && _find$label !== void 0 ? _find$label : internalValue);
132
132
  const labelText = label ? /*#__PURE__*/React.createElement(Text, {
133
133
  style: {
134
134
  textAlign: textStyles.textAlign,
@@ -314,10 +314,4 @@ const styles = StyleSheet.create({
314
314
  maxHeight: deviceHeight
315
315
  }
316
316
  });
317
- export default withTheme(Picker);bottom: 0,
318
- width: "100%",
319
- maxWidth: deviceWidth,
320
- maxHeight: deviceHeight
321
- }
322
- });
323
317
  export default withTheme(Picker);