@draftbit/core 46.5.2-b58416.2 → 46.6.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.
Files changed (138) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +23 -4
  2. package/lib/commonjs/components/Banner.js +23 -4
  3. package/lib/commonjs/components/Button.js +36 -13
  4. package/lib/commonjs/components/CardContainer.js +13 -4
  5. package/lib/commonjs/components/CardContainerShortImage.js +15 -4
  6. package/lib/commonjs/components/Checkbox/Checkbox.js +22 -6
  7. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
  8. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +1 -2
  9. package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -2
  10. package/lib/commonjs/components/Container.js +15 -4
  11. package/lib/commonjs/components/DeprecatedButton.js +3 -27
  12. package/lib/commonjs/components/DeprecatedCardWrapper.js +15 -1
  13. package/lib/commonjs/components/DeprecatedFAB.js +1 -2
  14. package/lib/commonjs/components/Elevation.js +14 -2
  15. package/lib/commonjs/components/FAB.js +18 -4
  16. package/lib/commonjs/components/FieldSearchBarFull.js +1 -2
  17. package/lib/commonjs/components/Image.js +17 -2
  18. package/lib/commonjs/components/Layout.js +40 -19
  19. package/lib/commonjs/components/Picker/Picker.js +9 -4
  20. package/lib/commonjs/components/Picker/PickerComponent.ios.js +36 -11
  21. package/lib/commonjs/components/Picker/PickerComponent.web.js +20 -3
  22. package/lib/commonjs/components/Portal/PortalManager.js +34 -8
  23. package/lib/commonjs/components/Pressable.js +50 -0
  24. package/lib/commonjs/components/ProgressBar.js +37 -7
  25. package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +9 -1
  26. package/lib/commonjs/components/ScreenContainer.js +20 -4
  27. package/lib/commonjs/components/StepIndicator.js +57 -18
  28. package/lib/commonjs/components/Surface.js +14 -2
  29. package/lib/commonjs/components/Swiper/Swiper.js +2 -0
  30. package/lib/commonjs/components/Switch.js +19 -10
  31. package/lib/commonjs/components/TextField.js +76 -28
  32. package/lib/commonjs/components/ToggleButton.js +15 -2
  33. package/lib/commonjs/components/Touchable.js +23 -5
  34. package/lib/commonjs/index.js +7 -0
  35. package/lib/commonjs/mappings/Button.js +39 -10
  36. package/lib/commonjs/mappings/FlashList.js +45 -2
  37. package/lib/commonjs/mappings/FlatList.js +12 -0
  38. package/lib/commonjs/mappings/Swiper.js +2 -0
  39. package/lib/commonjs/mappings/Touchable.js +47 -7
  40. package/lib/module/components/AvatarEdit.js +15 -4
  41. package/lib/module/components/Button.js +36 -13
  42. package/lib/module/components/Carousel.js +32 -8
  43. package/lib/module/components/Checkbox/Checkbox.js +26 -6
  44. package/lib/module/components/Checkbox/CheckboxGroup.js +16 -2
  45. package/lib/module/components/Checkbox/CheckboxGroupRow.js +25 -7
  46. package/lib/module/components/Checkbox/CheckboxRow.js +2 -3
  47. package/lib/module/components/CircularProgress.js +28 -8
  48. package/lib/module/components/DatePicker/DatePicker.js +27 -13
  49. package/lib/module/components/DeprecatedButton.js +24 -30
  50. package/lib/module/components/DeprecatedFAB.js +2 -3
  51. package/lib/module/components/Elevation.js +14 -2
  52. package/lib/module/components/FieldSearchBarFull.js +1 -2
  53. package/lib/module/components/Image.js +18 -2
  54. package/lib/module/components/Layout.js +42 -21
  55. package/lib/module/components/NumberInput.js +12 -3
  56. package/lib/module/components/Picker/Picker.js +10 -4
  57. package/lib/module/components/Picker/PickerComponent.ios.js +36 -11
  58. package/lib/module/components/Picker/PickerComponent.web.js +21 -3
  59. package/lib/module/components/Portal/PortalConsumer.js +22 -7
  60. package/lib/module/components/Pressable.js +30 -0
  61. package/lib/module/components/RadioButton/RadioButtonRow.js +24 -5
  62. package/lib/module/components/ScreenContainer.js +21 -4
  63. package/lib/module/components/Swiper/Swiper.js +2 -0
  64. package/lib/module/components/Switch.js +21 -10
  65. package/lib/module/components/Text.js +50 -4
  66. package/lib/module/components/TextField.js +78 -28
  67. package/lib/module/components/Touchable.js +8 -3
  68. package/lib/module/constants.js +1 -2
  69. package/lib/module/index.js +1 -0
  70. package/lib/module/mappings/Button.js +40 -11
  71. package/lib/module/mappings/FieldSearchBarFull.js +4 -1
  72. package/lib/module/mappings/FlashList.js +46 -3
  73. package/lib/module/mappings/FlatList.js +13 -1
  74. package/lib/module/mappings/StarRating.js +7 -2
  75. package/lib/module/mappings/Swiper.js +3 -1
  76. package/lib/module/mappings/Touchable.js +49 -9
  77. package/lib/typescript/src/components/Button.d.ts.map +1 -1
  78. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -2
  79. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts.map +1 -1
  80. package/lib/typescript/src/components/Checkbox/CheckboxGroupRow.d.ts.map +1 -1
  81. package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts.map +1 -1
  82. package/lib/typescript/src/components/DeprecatedButton.d.ts +2 -2
  83. package/lib/typescript/src/components/DeprecatedButton.d.ts.map +1 -1
  84. package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
  85. package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -1
  86. package/lib/typescript/src/components/Pressable.d.ts +10 -0
  87. package/lib/typescript/src/components/Pressable.d.ts.map +1 -0
  88. package/lib/typescript/src/components/Swiper/Swiper.d.ts +2 -1
  89. package/lib/typescript/src/components/Swiper/Swiper.d.ts.map +1 -1
  90. package/lib/typescript/src/components/Touchable.d.ts +5 -6
  91. package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
  92. package/lib/typescript/src/index.d.ts +1 -0
  93. package/lib/typescript/src/index.d.ts.map +1 -1
  94. package/lib/typescript/src/mappings/Button.d.ts +113 -4
  95. package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
  96. package/lib/typescript/src/mappings/FlashList.d.ts +112 -2
  97. package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
  98. package/lib/typescript/src/mappings/FlatList.d.ts +42 -0
  99. package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
  100. package/lib/typescript/src/mappings/Swiper.d.ts +11 -0
  101. package/lib/typescript/src/mappings/Swiper.d.ts.map +1 -1
  102. package/lib/typescript/src/mappings/Touchable.d.ts +59 -5
  103. package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
  104. package/lib/typescript/src/styles/overlay.d.ts +1 -1
  105. package/lib/typescript/src/styles/overlay.d.ts.map +1 -1
  106. package/lib/typescript/src/styles/shadow.d.ts +2 -2
  107. package/package.json +7 -7
  108. package/src/components/Button.js +3 -3
  109. package/src/components/Button.tsx +14 -4
  110. package/src/components/Checkbox/Checkbox.js +2 -3
  111. package/src/components/Checkbox/Checkbox.tsx +5 -7
  112. package/src/components/Checkbox/CheckboxGroupRow.js +2 -3
  113. package/src/components/Checkbox/CheckboxGroupRow.tsx +3 -3
  114. package/src/components/Checkbox/CheckboxRow.js +2 -3
  115. package/src/components/Checkbox/CheckboxRow.tsx +3 -3
  116. package/src/components/DeprecatedButton.js +4 -16
  117. package/src/components/DeprecatedButton.tsx +7 -31
  118. package/src/components/DeprecatedFAB.js +2 -3
  119. package/src/components/DeprecatedFAB.tsx +5 -5
  120. package/src/components/Pressable.js +12 -0
  121. package/src/components/Pressable.tsx +44 -0
  122. package/src/components/Swiper/Swiper.js +2 -2
  123. package/src/components/Swiper/Swiper.tsx +3 -0
  124. package/src/components/Touchable.js +3 -3
  125. package/src/components/Touchable.tsx +11 -7
  126. package/src/index.js +1 -0
  127. package/src/index.tsx +1 -0
  128. package/src/mappings/Button.js +39 -10
  129. package/src/mappings/Button.ts +41 -10
  130. package/src/mappings/FlashList.js +77 -31
  131. package/src/mappings/FlashList.ts +82 -30
  132. package/src/mappings/FlatList.js +13 -1
  133. package/src/mappings/FlatList.ts +16 -0
  134. package/src/mappings/Swiper.js +3 -1
  135. package/src/mappings/Swiper.ts +4 -0
  136. package/src/mappings/Touchable.js +50 -7
  137. package/src/mappings/Touchable.ts +53 -6
  138. package/src/styles/overlay.tsx +2 -2
@@ -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, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput } from "react-native";
4
3
  import { useSafeAreaInsets } from "react-native-safe-area-context";
@@ -82,24 +81,20 @@ const DatePicker = _ref => {
82
81
  focused ? _handleBlur() : _handleFocus();
83
82
  };
84
83
  const insets = useSafeAreaInsets();
85
-
86
84
  // const _restoreLabel = () =>
87
85
  // Animated.timing(labeled, {
88
86
  // toValue: 1,
89
87
  // duration: FOCUS_ANIMATION_DURATION,
90
88
  // useNativeDriver: true,
91
89
  // }).start();
92
-
93
90
  // const _minmizeLabel = () =>
94
91
  // Animated.timing(labeled, {
95
92
  // toValue: 0,
96
93
  // duration: BLUR_ANIMATION_DURATION,
97
94
  // useNativeDriver: true,
98
95
  // }).start();
99
-
100
96
  // const _showPlaceholder = () =>
101
97
  // setTimeout(() => setPlaceholder1(placeholder || ""), 50);
102
-
103
98
  const _hidePlaceholder = () => {
104
99
  setPlaceholder1("");
105
100
  };
@@ -242,9 +237,7 @@ const DatePicker = _ref => {
242
237
  const inputStyles = [styles.input, inputStyle, type === "solid" ? {
243
238
  marginHorizontal: 12
244
239
  } : {}];
245
-
246
240
  // const render = (props) => <NativeTextInput {...props} />;
247
-
248
241
  return /*#__PURE__*/React.createElement(View, {
249
242
  style: [styles.container, style]
250
243
  }, /*#__PURE__*/React.createElement(Touchable, {
@@ -254,9 +247,10 @@ const DatePicker = _ref => {
254
247
  pointerEvents: "none"
255
248
  }, /*#__PURE__*/React.createElement(View, {
256
249
  style: [styles.container, style]
257
- }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
250
+ }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
251
+ ...leftIconProps,
258
252
  style: leftIconStyle
259
- })) : null, /*#__PURE__*/React.createElement(View, {
253
+ }) : null, /*#__PURE__*/React.createElement(View, {
260
254
  style: [containerStyle, style ? {
261
255
  height: style.height
262
256
  } : {}, viewStyles]
@@ -305,12 +299,13 @@ const DatePicker = _ref => {
305
299
  opacity: hasActiveOutline ? labeled : 1
306
300
  }],
307
301
  numberOfLines: 1
308
- }, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
302
+ }, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, {
303
+ ...leftIconProps,
309
304
  style: {
310
305
  ...leftIconStyle,
311
306
  marginLeft: type === "solid" ? 16 : 0
312
307
  }
313
- })) : null, /*#__PURE__*/React.createElement(NativeTextInput, _extends({
308
+ }) : null, /*#__PURE__*/React.createElement(NativeTextInput, {
314
309
  value: formatDate(),
315
310
  placeholder: label ? placeholder1 : placeholder,
316
311
  editable: !disabled,
@@ -319,8 +314,9 @@ const DatePicker = _ref => {
319
314
  onFocus: _handleFocus,
320
315
  onBlur: _handleBlur,
321
316
  underlineColorAndroid: "transparent",
322
- style: [inputStyles, textStyles]
323
- }, props))), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
317
+ style: [inputStyles, textStyles],
318
+ ...props
319
+ })), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
324
320
  name: rightIconName,
325
321
  size: ICON_SIZE,
326
322
  color: colors.light,
@@ -391,4 +387,22 @@ const styles = StyleSheet.create({
391
387
  alignSelf: "flex-end"
392
388
  }
393
389
  });
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
+ });
394
408
  export default withTheme(DatePicker);
@@ -1,9 +1,7 @@
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
- import { ActivityIndicator, View, Text, StyleSheet } from "react-native";
2
+ import { ActivityIndicator, View, Text, StyleSheet, Pressable } from "react-native";
4
3
  import color from "color";
5
4
  import Config from "./Config";
6
- import Touchable from "./Touchable";
7
5
  import Elevation from "./Elevation";
8
6
  import { withTheme } from "../theming";
9
7
  const Button = _ref => {
@@ -18,7 +16,6 @@ const Button = _ref => {
18
16
  children,
19
17
  onPress,
20
18
  elevation = 0,
21
- style,
22
19
  theme: {
23
20
  colors,
24
21
  disabledOpacity,
@@ -72,42 +69,21 @@ const Button = _ref => {
72
69
  marginRight: -8,
73
70
  width: Config.buttonIconSize
74
71
  }];
75
- const {
76
- margin,
77
- marginEnd,
78
- marginTop,
79
- marginLeft,
80
- marginRight,
81
- marginBottom,
82
- marginHorizontal,
83
- marginVertical,
84
- ...innerStyles
85
- } = StyleSheet.flatten(style || {});
86
- const margins = {
87
- margin,
88
- marginEnd,
89
- marginTop,
90
- marginLeft,
91
- marginRight,
92
- marginBottom,
93
- marginHorizontal,
94
- marginVertical
95
- };
96
72
  return /*#__PURE__*/React.createElement(Elevation, {
97
73
  style: {
98
74
  elevation,
99
- alignSelf: "stretch",
100
- ...margins
75
+ alignSelf: "stretch"
101
76
  }
102
- }, /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
77
+ }, /*#__PURE__*/React.createElement(Pressable, {
78
+ ...rest,
103
79
  onPress: onPress,
104
80
  accessibilityState: {
105
81
  disabled
106
82
  },
107
83
  accessibilityRole: "button",
108
84
  disabled: disabled || loading,
109
- style: [styles.button, buttonStyle, innerStyles]
110
- }), /*#__PURE__*/React.createElement(View, {
85
+ style: [styles.button, buttonStyle]
86
+ }, /*#__PURE__*/React.createElement(View, {
111
87
  style: styles.content
112
88
  }, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
113
89
  style: iconStyle
@@ -138,4 +114,22 @@ const styles = StyleSheet.create({
138
114
  width: Config.buttonIconSize
139
115
  }
140
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
+ });
141
135
  export default withTheme(Button);
@@ -1,10 +1,9 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  import * as React from "react";
3
- import { ActivityIndicator, View, StyleSheet } from "react-native";
3
+ import { ActivityIndicator, View, StyleSheet, Pressable } from "react-native";
4
4
  import color from "color";
5
5
  import Config from "./Config";
6
6
  import Text from "./Text";
7
- import Touchable from "./Touchable";
8
7
  import Elevation from "./Elevation";
9
8
  import { withTheme } from "../theming";
10
9
  const FAB = _ref => {
@@ -98,7 +97,7 @@ const FAB = _ref => {
98
97
  style: [{
99
98
  elevation
100
99
  }, style]
101
- }, /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
100
+ }, /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
102
101
  onPress: onPress,
103
102
  accessibilityState: {
104
103
  disabled
@@ -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
  /* 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,
@@ -37,7 +37,6 @@ 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;
41
40
  let {
42
41
  error,
43
42
  options = [],
@@ -59,6 +58,7 @@ const Picker = _ref => {
59
58
  rightIconName,
60
59
  type = "solid"
61
60
  } = _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;
79
80
  if (pickerVisible && androidPickerRef.current) {
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();
81
+ (_a = androidPickerRef === null || androidPickerRef === void 0 ? void 0 : androidPickerRef.current) === null || _a === void 0 ? void 0 : _a.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 && ((_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);
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);
132
132
  const labelText = label ? /*#__PURE__*/React.createElement(Text, {
133
133
  style: {
134
134
  textAlign: textStyles.textAlign,
@@ -314,4 +314,10 @@ 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
+ });
317
323
  export default withTheme(Picker);
@@ -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 { SafeAreaView } from "react-native-safe-area-context";
@@ -11,7 +10,6 @@ import TextField from "../TextField";
11
10
  import Touchable from "../Touchable";
12
11
  import { extractStyles } from "../../utilities";
13
12
  const Picker = _ref => {
14
- var _options$find$label, _options$find;
15
13
  let {
16
14
  Icon,
17
15
  style,
@@ -25,6 +23,7 @@ const Picker = _ref => {
25
23
  },
26
24
  ...props
27
25
  } = _ref;
26
+ var _a, _b;
28
27
  const {
29
28
  viewStyles: {
30
29
  borderRadius,
@@ -65,26 +64,24 @@ const Picker = _ref => {
65
64
  };
66
65
 
67
66
  const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
68
- const selectedLabel = selectedValue && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : selectedValue);
67
+ 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);
69
68
  return /*#__PURE__*/React.createElement(View, {
70
69
  style: [styles.container, viewStyles]
71
70
  }, /*#__PURE__*/React.createElement(Touchable, {
72
71
  disabled: disabled,
73
72
  onPress: toggleVisibility
74
- }, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
73
+ }, /*#__PURE__*/React.createElement(TextField, {
74
+ ...props,
75
75
  value: String(selectedLabel),
76
- placeholder: placeholder
76
+ placeholder: placeholder,
77
77
  // @ts-ignore
78
- ,
79
- ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
80
- ,
78
+ ref: textField,
81
79
  disabled: disabled,
82
- pointerEvents: "none"
80
+ pointerEvents: "none",
83
81
  // @ts-expect-error
84
- ,
85
82
  style: stylesWithoutMargin,
86
83
  Icon: Icon
87
- }))), pickerVisible && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(View, {
84
+ })), pickerVisible && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(View, {
88
85
  style: [styles.picker, {
89
86
  backgroundColor: colors.divider
90
87
  }]
@@ -128,4 +125,32 @@ const styles = StyleSheet.create({
128
125
  alignSelf: "flex-end"
129
126
  }
130
127
  });
128
+ export default withTheme(Picker);nValueChange
129
+ }, options.map(o => /*#__PURE__*/React.createElement(NativePicker.Item, {
130
+ label: o.label,
131
+ value: o.value,
132
+ key: o.value
133
+ })))))));
134
+ };
135
+ const styles = StyleSheet.create({
136
+ container: {
137
+ alignSelf: "stretch"
138
+ },
139
+ picker: {
140
+ position: "absolute",
141
+ bottom: 0,
142
+ left: 0,
143
+ right: 0,
144
+ flexDirection: "row",
145
+ justifyContent: "center"
146
+ },
147
+ pickerContainer: {
148
+ backgroundColor: "white",
149
+ flexDirection: "column",
150
+ width: "100%"
151
+ },
152
+ closeButton: {
153
+ alignSelf: "flex-end"
154
+ }
155
+ });
131
156
  export default withTheme(Picker);
@@ -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 { Picker as NativePicker } from "@react-native-picker/picker";
@@ -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 && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : 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,
@@ -85,6 +84,25 @@ const Picker = _ref => {
85
84
  label: o.label,
86
85
  value: o.value,
87
86
  key: o.value
87
+ }))), /*#__PURE__*/React.createElement(View, {
88
+ pointerEvents: "none"
89
+ }, /*#__PURE__*/React.createElement(TextField, {
90
+ ...props,
91
+ value: selectedLabel,
92
+ placeholder: placeholder,
93
+ // @ts-ignore
94
+ ref: textField,
95
+ disabled: disabled,
96
+ // @ts-expect-error
97
+ style: stylesWithoutMargin
98
+ }))));
99
+ };
100
+ const styles = StyleSheet.create({
101
+ container: {
102
+ alignSelf: "stretch"
103
+ }
104
+ });
105
+ export default withTheme(Picker);y: o.value
88
106
  }))), /*#__PURE__*/React.createElement(View, {
89
107
  pointerEvents: "none"
90
108
  }, /*#__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();