@draftbit/core 46.7.1 → 46.7.3

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 (55) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +23 -4
  2. package/lib/commonjs/components/AnimatedCircularProgress.js +12 -1
  3. package/lib/commonjs/components/AvatarEdit.js +15 -4
  4. package/lib/commonjs/components/Button.js +33 -10
  5. package/lib/commonjs/components/CardBlock.js +13 -4
  6. package/lib/commonjs/components/CardContainer.js +13 -4
  7. package/lib/commonjs/components/Checkbox/Checkbox.js +22 -4
  8. package/lib/commonjs/components/Container.js +15 -4
  9. package/lib/commonjs/components/DeprecatedButton.js +20 -3
  10. package/lib/commonjs/components/DeprecatedCardWrapper.js +15 -1
  11. package/lib/commonjs/components/Divider.js +14 -1
  12. package/lib/commonjs/components/Image.js +17 -2
  13. package/lib/commonjs/components/Picker/Picker.js +9 -4
  14. package/lib/commonjs/components/Portal/PortalHost.js +44 -15
  15. package/lib/commonjs/components/Portal/PortalManager.js +34 -8
  16. package/lib/commonjs/components/ProgressBar.js +37 -7
  17. package/lib/commonjs/components/Slider.js +21 -4
  18. package/lib/commonjs/components/Surface.js +14 -2
  19. package/lib/commonjs/components/TextField.js +76 -28
  20. package/lib/commonjs/components/Touchable.js +15 -2
  21. package/lib/commonjs/constants.js +1 -1
  22. package/lib/commonjs/hooks.js +1 -2
  23. package/lib/commonjs/mappings/StarRating.js +6 -2
  24. package/lib/commonjs/utilities.js +1 -2
  25. package/lib/module/components/Accordion/AccordionItem.js +4 -25
  26. package/lib/module/components/Button.js +33 -10
  27. package/lib/module/components/CardBlock.js +14 -4
  28. package/lib/module/components/CardContainerRating.js +14 -4
  29. package/lib/module/components/CardContainerShortImage.js +18 -4
  30. package/lib/module/components/Checkbox/CheckboxGroupRow.js +24 -5
  31. package/lib/module/components/Checkbox/context.js +1 -1
  32. package/lib/module/components/CircleImage.js +16 -1
  33. package/lib/module/components/DeprecatedCardWrapper.js +18 -1
  34. package/lib/module/components/Divider.js +18 -1
  35. package/lib/module/components/Elevation.js +14 -2
  36. package/lib/module/components/FieldSearchBarFull.js +1 -2
  37. package/lib/module/components/FormRow.js +17 -2
  38. package/lib/module/components/Image.js +18 -2
  39. package/lib/module/components/Layout.js +42 -21
  40. package/lib/module/components/NumberInput.js +12 -3
  41. package/lib/module/components/Picker/PickerComponent.ios.js +36 -11
  42. package/lib/module/components/Portal/PortalConsumer.js +22 -7
  43. package/lib/module/components/RadioButton/RadioButton.js +13 -1
  44. package/lib/module/components/RadioButton/RadioButtonGroup.js +16 -2
  45. package/lib/module/components/RadioButton/RadioButtonRow.js +24 -5
  46. package/lib/module/components/Slider.js +21 -4
  47. package/lib/module/components/StepIndicator.js +58 -18
  48. package/lib/module/components/TextField.js +78 -28
  49. package/lib/module/components/ToggleButton.js +16 -2
  50. package/lib/module/components/Touchable.js +15 -2
  51. package/lib/module/constants.js +1 -2
  52. package/lib/module/mappings/FieldSearchBarFull.js +4 -1
  53. package/lib/module/styles/overlay.js +1 -3
  54. package/lib/module/utilities.js +1 -2
  55. package/package.json +3 -3
@@ -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 { Text, Pressable, Platform, StyleSheet, ActivityIndicator } from "react-native";
4
3
  import { withTheme } from "../theming";
@@ -53,7 +52,7 @@ function Base(_ref) {
53
52
  if (textAlign === "right") {
54
53
  buttonStyles.justifyContent = "flex-end";
55
54
  }
56
- return /*#__PURE__*/React.createElement(Pressable, _extends({
55
+ return /*#__PURE__*/React.createElement(Pressable, {
57
56
  disabled: disabled || loading,
58
57
  style: _ref2 => {
59
58
  let {
@@ -62,8 +61,9 @@ function Base(_ref) {
62
61
  return [styles.base, {
63
62
  opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
64
63
  }, buttonStyles];
65
- }
66
- }, props), loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
64
+ },
65
+ ...props
66
+ }, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
67
67
  size: "small",
68
68
  color: color,
69
69
  style: styles.loading
@@ -82,13 +82,14 @@ const Solid = _ref3 => {
82
82
  theme,
83
83
  ...props
84
84
  } = _ref3;
85
- return /*#__PURE__*/React.createElement(Base, _extends({
85
+ return /*#__PURE__*/React.createElement(Base, {
86
86
  style: [{
87
87
  color: "#FFF",
88
88
  borderRadius: theme.roundness,
89
89
  backgroundColor: theme.colors.primary
90
- }, style]
91
- }, props));
90
+ }, style],
91
+ ...props
92
+ });
92
93
  };
93
94
  const ButtonSolid = withTheme(Solid);
94
95
  export { ButtonSolid };
@@ -100,13 +101,14 @@ const Outline = _ref4 => {
100
101
  theme,
101
102
  ...props
102
103
  } = _ref4;
103
- return /*#__PURE__*/React.createElement(Base, _extends({
104
+ return /*#__PURE__*/React.createElement(Base, {
104
105
  style: [styles.outline, {
105
106
  borderRadius: theme.roundness,
106
107
  borderColor: theme.colors.primary,
107
108
  color: theme.colors.primary
108
- }, style]
109
- }, props));
109
+ }, style],
110
+ ...props
111
+ });
110
112
  };
111
113
  const ButtonOutline = withTheme(Outline);
112
114
  export { ButtonOutline };
@@ -153,4 +155,25 @@ const styles = StyleSheet.create({
153
155
  }
154
156
  })
155
157
  }
158
+ });or: "transparent",
159
+ padding: 0,
160
+ minHeight: undefined
161
+ },
162
+ loading: {
163
+ marginRight: 6
164
+ },
165
+ icon: {
166
+ ...Platform.select({
167
+ web: {
168
+ marginTop: 1,
169
+ marginRight: 4,
170
+ alignSelf: "center"
171
+ },
172
+ default: {
173
+ marginBottom: 2,
174
+ marginRight: 4,
175
+ alignSelf: "center"
176
+ }
177
+ })
178
+ }
156
179
  });
@@ -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 Image from "./Image";
@@ -42,11 +41,12 @@ const CardBlock = _ref => {
42
41
  const rightDescriptionStyles = [typography.subtitle2, {
43
42
  color: colors.light
44
43
  }];
45
- return /*#__PURE__*/React.createElement(Card, _extends({
44
+ return /*#__PURE__*/React.createElement(Card, {
46
45
  style: style,
47
46
  onPress: onPress,
48
- numColumns: numColumns
49
- }, rest), /*#__PURE__*/React.createElement(View, {
47
+ numColumns: numColumns,
48
+ ...rest
49
+ }, /*#__PURE__*/React.createElement(View, {
50
50
  style: {
51
51
  backgroundColor: colors.background
52
52
  }
@@ -95,4 +95,14 @@ const CardBlock = _ref => {
95
95
  style: rightDescriptionStyles
96
96
  }, rightDescription) : null) : null));
97
97
  };
98
+ export default withTheme(CardBlock);PURE__*/React.createElement(Text, {
99
+ numberOfLines: 1,
100
+ style: [typography.body2, {
101
+ color: colors.medium
102
+ }]
103
+ }, leftDescription), rightDescription ? /*#__PURE__*/React.createElement(Text, {
104
+ numberOfLines: 1,
105
+ style: rightDescriptionStyles
106
+ }, rightDescription) : null) : null));
107
+ };
98
108
  export default withTheme(CardBlock);
@@ -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";
@@ -42,11 +41,12 @@ const CardContainerRating = _ref => {
42
41
  rightDescriptionStyle = typography.caption;
43
42
  break;
44
43
  }
45
- return /*#__PURE__*/React.createElement(Card, _extends({
44
+ return /*#__PURE__*/React.createElement(Card, {
46
45
  style: style,
47
46
  onPress: onPress,
48
- numColumns: numColumns
49
- }, rest), /*#__PURE__*/React.createElement(Elevation, {
47
+ numColumns: numColumns,
48
+ ...rest
49
+ }, /*#__PURE__*/React.createElement(Elevation, {
50
50
  style: {
51
51
  elevation,
52
52
  borderRadius: roundness
@@ -122,4 +122,14 @@ const CardContainerRating = _ref => {
122
122
  color: colors.surface
123
123
  })) : null)));
124
124
  };
125
+ export default withTheme(CardContainerRating);ER_PADDING,
126
+ borderRadius: ICON_CONTAINER_SIZE,
127
+ backgroundColor: color(colors.strong).alpha(Config.cardIconBackgroundOpacity).rgb().string()
128
+ }
129
+ }, /*#__PURE__*/React.createElement(Icon, {
130
+ name: icon,
131
+ size: Config.cardIconSize,
132
+ color: colors.surface
133
+ })) : null)));
134
+ };
125
135
  export default withTheme(CardContainerRating);
@@ -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 Image from "./Image";
@@ -23,10 +22,11 @@ const CardContainerShortImage = _ref => {
23
22
  onPress,
24
23
  ...rest
25
24
  } = _ref;
26
- return /*#__PURE__*/React.createElement(Card, _extends({
25
+ return /*#__PURE__*/React.createElement(Card, {
27
26
  style: style,
28
- onPress: onPress
29
- }, rest), /*#__PURE__*/React.createElement(Elevation, {
27
+ onPress: onPress,
28
+ ...rest
29
+ }, /*#__PURE__*/React.createElement(Elevation, {
30
30
  style: {
31
31
  elevation,
32
32
  borderRadius: roundness
@@ -73,4 +73,18 @@ const CardContainerShortImage = _ref => {
73
73
  resizeMode: "cover"
74
74
  }))));
75
75
  };
76
+ export default withTheme(CardContainerShortImage);2, {
77
+ color: colors.medium,
78
+ marginTop: 4
79
+ }]
80
+ }, subtitle) : null), mode === "right" && /*#__PURE__*/React.createElement(Image, {
81
+ style: {
82
+ aspectRatio
83
+ },
84
+ source: typeof image === "string" ? {
85
+ uri: image
86
+ } : image,
87
+ resizeMode: "cover"
88
+ }))));
89
+ };
76
90
  export default withTheme(CardContainerShortImage);
@@ -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, Pressable } from "react-native";
4
3
  import Checkbox from "./Checkbox";
@@ -6,7 +5,7 @@ import Text from "../Text";
6
5
  import { useCheckboxGroupContext } from "./context";
7
6
  import { Direction as GroupDirection } from "./context";
8
7
  import { extractStyles } from "../../utilities";
9
- export let Direction;
8
+ export var Direction;
10
9
  (function (Direction) {
11
10
  Direction["Row"] = "row";
12
11
  Direction["RowReverse"] = "row-reverse";
@@ -63,13 +62,14 @@ const CheckboxGroupRow = _ref => {
63
62
  textStyles,
64
63
  viewStyles
65
64
  } = extractStyles(style);
66
- return /*#__PURE__*/React.createElement(Pressable, _extends({
65
+ return /*#__PURE__*/React.createElement(Pressable, {
67
66
  onPress: handlePress,
68
67
  style: [styles.mainParent, {
69
68
  flexDirection: direction
70
69
  }, viewStyles],
71
- disabled: disabled
72
- }, rest), /*#__PURE__*/React.createElement(View, {
70
+ disabled: disabled,
71
+ ...rest
72
+ }, /*#__PURE__*/React.createElement(View, {
73
73
  style: [styles.label, {
74
74
  alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
75
75
  }, labelContainerStyle]
@@ -107,4 +107,23 @@ 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
+ });
110
129
  export default CheckboxGroupRow;
@@ -1,5 +1,5 @@
1
1
  import { createContext, useContext } from "react";
2
- export let Direction;
2
+ export var Direction;
3
3
  (function (Direction) {
4
4
  Direction["Horizontal"] = "horizontal";
5
5
  Direction["Vertical"] = "vertical";
@@ -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,
@@ -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 { withTheme } from "../theming";
4
3
  import Touchable from "./Touchable";
@@ -13,6 +12,24 @@ const getWidth = numColumns => {
13
12
  }
14
13
  };
15
14
  const Card = _ref => {
15
+ let {
16
+ numColumns = 3,
17
+ children,
18
+ onPress,
19
+ style,
20
+ ...rest
21
+ } = _ref;
22
+ const width = getWidth(numColumns);
23
+ return /*#__PURE__*/React.createElement(Touchable, {
24
+ disabled: !onPress,
25
+ onPress: onPress,
26
+ style: [style, {
27
+ width
28
+ }],
29
+ ...rest
30
+ }, children);
31
+ };
32
+ export default withTheme(Card);ef => {
16
33
  let {
17
34
  numColumns = 3,
18
35
  children,
@@ -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, _extends({}, rest, {
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
@@ -46,7 +46,6 @@ const FieldSearchBarFull = _ref => {
46
46
  lineHeight,
47
47
  ...typeStyles
48
48
  } = typography.body2; // eslint-disable-line @typescript-eslint/no-unused-vars
49
-
50
49
  const handleChangeText = newValue => {
51
50
  setInternalValue(newValue);
52
51
  if (onChange) {
@@ -84,4 +83,4 @@ const styles = StyleSheet.create({
84
83
  alignItems: "center"
85
84
  }
86
85
  });
87
- export default withTheme(FieldSearchBarFull);
86
+ export default withTheme(FieldSearchBarFull);;
@@ -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 { Text, StyleSheet } from "react-native";
4
3
  import { extractStyles } from "../utilities";
@@ -17,11 +16,27 @@ export default function FormRow(_ref) {
17
16
  textStyles,
18
17
  viewStyles
19
18
  } = extractStyles(style);
20
- return /*#__PURE__*/React.createElement(Touchable, _extends({
19
+ return /*#__PURE__*/React.createElement(Touchable, {
21
20
  disabled: disabled,
22
21
  onPress: onPress,
23
22
  style: [styles.row, {
24
23
  flexDirection: direction
24
+ }, viewStyles],
25
+ ...rest
26
+ }, /*#__PURE__*/React.createElement(Text, {
27
+ style: textStyles
28
+ }, label), children);
29
+ }
30
+ const styles = StyleSheet.create({
31
+ row: {
32
+ marginLeft: 8,
33
+ marginRight: 8,
34
+ flexDirection: "row",
35
+ justifyContent: "space-between",
36
+ alignItems: "center"
37
+ }
38
+ });styles.row, {
39
+ flexDirection: direction
25
40
  }, viewStyles]
26
41
  }, rest), /*#__PURE__*/React.createElement(Text, {
27
42
  style: textStyles
@@ -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
  /* README: Internal Image component used for stuff like Card. DO NOT EXPORT! */
3
2
  import React from "react";
4
3
  import { Image as NativeImage, StyleSheet } from "react-native";
@@ -56,7 +55,24 @@ const Image = _ref2 => {
56
55
  height,
57
56
  aspectRatio
58
57
  }]
59
- }, /*#__PURE__*/React.createElement(NativeImage, _extends({}, props, {
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, {
60
76
  source: imageSource,
61
77
  resizeMode: resizeMode,
62
78
  style: [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, _extends({
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
- }, rest), children);
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, _extends({
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
- }, rest), children);
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, _extends({
52
+ return /*#__PURE__*/React.createElement(Center, {
54
53
  style: style,
55
54
  width: size,
56
55
  height: size,
57
- bgColor: bgColor
58
- }, rest), children);
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, _extends({
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
- }, rest), children);
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, _extends({
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
- }, rest), children);
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 React, { useEffect, useState } from "react";
3
2
  import { TextInput } from "react-native";
4
3
  import { isString, isNumber, isNaN } from "lodash";
@@ -26,7 +25,6 @@ const NumberInput = _ref => {
26
25
  }
27
26
  return "0";
28
27
  };
29
-
30
28
  // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
31
29
  useEffect(() => {
32
30
  const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
@@ -41,7 +39,6 @@ const NumberInput = _ref => {
41
39
  setCurrentStringNumberValue(newStringNumberValue);
42
40
  onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(number);
43
41
  };
44
-
45
42
  // run handleChangeText with value prop only when value prop changes (and first render to reset currentStringNumberValue)
46
43
  useEffect(() => {
47
44
  const nextStringNumberValue = formatValueToStringNumber(value);
@@ -50,6 +47,18 @@ const NumberInput = _ref => {
50
47
  }
51
48
  // eslint-disable-next-line react-hooks/exhaustive-deps
52
49
  }, [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]);
53
62
  return /*#__PURE__*/React.createElement(TextInput, _extends({
54
63
  keyboardType: "numeric",
55
64
  value: currentStringNumberValue,