@draftbit/core 46.6.2 → 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 (241) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +4 -23
  2. package/lib/commonjs/components/AvatarEdit.js +4 -15
  3. package/lib/commonjs/components/Banner.js +4 -23
  4. package/lib/commonjs/components/Button.js +10 -33
  5. package/lib/commonjs/components/Carousel.js +8 -30
  6. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +5 -23
  7. package/lib/commonjs/components/Container.js +4 -15
  8. package/lib/commonjs/components/DatePicker/DatePicker.js +13 -26
  9. package/lib/commonjs/components/DeprecatedCardWrapper.js +1 -15
  10. package/lib/commonjs/components/Divider.js +1 -14
  11. package/lib/commonjs/components/FAB.js +4 -18
  12. package/lib/commonjs/components/IconButton.js +4 -19
  13. package/lib/commonjs/components/Picker/PickerComponent.ios.js +11 -36
  14. package/lib/commonjs/components/Portal/Portal.js +3 -27
  15. package/lib/commonjs/components/Portal/PortalConsumer.js +7 -22
  16. package/lib/commonjs/components/Portal/PortalManager.js +8 -34
  17. package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +1 -9
  18. package/lib/commonjs/components/RadioButton/context.js +1 -1
  19. package/lib/commonjs/components/ScreenContainer.js +4 -20
  20. package/lib/commonjs/components/StarRating.js +4 -23
  21. package/lib/commonjs/components/Surface.js +2 -14
  22. package/lib/commonjs/components/TextField.js +28 -76
  23. package/lib/commonjs/components/ToggleButton.js +2 -15
  24. package/lib/commonjs/constants.js +1 -1
  25. package/lib/commonjs/hooks.js +2 -1
  26. package/lib/commonjs/mappings/StarRating.js +2 -6
  27. package/lib/commonjs/styles/overlay.js +3 -1
  28. package/lib/commonjs/utilities.js +2 -1
  29. package/lib/module/components/AspectRatio.js +1 -18
  30. package/lib/module/components/AvatarEdit.js +4 -15
  31. package/lib/module/components/Banner.js +4 -25
  32. package/lib/module/components/Button.js +10 -33
  33. package/lib/module/components/CardBlock.js +4 -14
  34. package/lib/module/components/CardContainerRating.js +4 -14
  35. package/lib/module/components/CardContainerShortImage.js +4 -18
  36. package/lib/module/components/Carousel.js +32 -8
  37. package/lib/module/components/Checkbox/CheckboxGroup.js +2 -16
  38. package/lib/module/components/Container.js +4 -17
  39. package/lib/module/components/DeprecatedFAB.js +3 -23
  40. package/lib/module/components/Elevation.js +2 -14
  41. package/lib/module/components/FormRow.js +2 -17
  42. package/lib/module/components/Layout.js +21 -42
  43. package/lib/module/components/NumberInput.js +3 -12
  44. package/lib/module/components/Picker/PickerComponent.web.js +21 -3
  45. package/lib/module/components/Portal/Portal.js +3 -28
  46. package/lib/module/components/Portal/PortalConsumer.js +0 -23
  47. package/lib/module/components/Portal/PortalHost.js +15 -45
  48. package/lib/module/components/Portal/PortalManager.js +7 -33
  49. package/lib/module/components/ProgressBar.js +7 -39
  50. package/lib/module/components/RadioButton/RadioButton.js +1 -13
  51. package/lib/module/components/RadioButton/RadioButtonGroup.js +2 -16
  52. package/lib/module/components/RadioButton/RadioButtonRow.js +5 -24
  53. package/lib/module/components/RadioButton/context.js +1 -1
  54. package/lib/module/components/Slider.js +4 -21
  55. package/lib/module/components/StepIndicator.js +18 -58
  56. package/lib/module/components/Surface.js +1 -15
  57. package/lib/module/components/Switch.js +10 -21
  58. package/lib/module/components/TextField.js +28 -78
  59. package/lib/module/constants.js +2 -1
  60. package/lib/module/mappings/FieldSearchBarFull.js +1 -4
  61. package/package.json +4 -4
  62. package/src/Provider.js +9 -0
  63. package/src/components/Accordion/AccordionGroup.js +44 -0
  64. package/src/components/Accordion/AccordionItem.js +32 -0
  65. package/src/components/Accordion/index.js +2 -0
  66. package/src/components/ActionSheet/ActionSheet.js +45 -0
  67. package/src/components/ActionSheet/ActionSheetCancel.js +6 -0
  68. package/src/components/ActionSheet/ActionSheetItem.js +30 -0
  69. package/src/components/ActionSheet/index.js +3 -0
  70. package/src/components/AnimatedCircularProgress.js +43 -0
  71. package/src/components/AspectRatio.js +18 -0
  72. package/src/components/AvatarEdit.js +30 -0
  73. package/src/components/Banner.js +109 -0
  74. package/src/components/Button.js +114 -0
  75. package/src/components/Card.js +57 -0
  76. package/src/components/CardBlock.js +54 -0
  77. package/src/components/CardContainer.js +69 -0
  78. package/src/components/CardContainerRating.js +79 -0
  79. package/src/components/CardContainerShortImage.js +33 -0
  80. package/src/components/CardInline.js +36 -0
  81. package/src/components/Carousel.js +68 -0
  82. package/src/components/Checkbox/Checkbox.js +62 -0
  83. package/src/components/Checkbox/CheckboxGroup.js +21 -0
  84. package/src/components/Checkbox/CheckboxGroupRow.js +76 -0
  85. package/src/components/Checkbox/CheckboxRow.js +77 -0
  86. package/src/components/Checkbox/context.js +14 -0
  87. package/src/components/Checkbox/index.js +3 -0
  88. package/src/components/CircleImage.js +8 -0
  89. package/src/components/CircularProgress.js +81 -0
  90. package/src/components/Config.js +64 -0
  91. package/src/components/Container.js +43 -0
  92. package/src/components/DatePicker/DatePicker.js +377 -0
  93. package/src/components/DatePicker/DatePickerComponent.js +13 -0
  94. package/src/components/DatePicker/DatePickerComponent.web.js +30 -0
  95. package/src/components/DatePicker/DatePickerComponentType.js +1 -0
  96. package/src/components/DeprecatedButton.js +83 -0
  97. package/src/components/DeprecatedCardWrapper.js +18 -0
  98. package/src/components/DeprecatedFAB.js +114 -0
  99. package/src/components/Divider.js +13 -0
  100. package/src/components/Elevation.js +20 -0
  101. package/src/components/FAB.js +46 -0
  102. package/src/components/FieldSearchBarFull.js +53 -0
  103. package/src/components/FormRow.js +19 -0
  104. package/src/components/Header.js +44 -0
  105. package/src/components/HeaderLarge.js +7 -0
  106. package/src/components/HeaderMedium.js +7 -0
  107. package/src/components/HeaderOverline.js +7 -0
  108. package/src/components/IconButton.js +35 -0
  109. package/src/components/Image.js +47 -0
  110. package/src/components/Justification.js +1 -0
  111. package/src/components/Layout.js +50 -0
  112. package/src/components/NumberInput.js +49 -0
  113. package/src/components/Picker/Picker.js +267 -0
  114. package/src/components/Picker/PickerComponent.android.js +69 -0
  115. package/src/components/Picker/PickerComponent.ios.js +79 -0
  116. package/src/components/Picker/PickerComponent.web.js +70 -0
  117. package/src/components/Picker/PickerTypes.js +1 -0
  118. package/src/components/Portal/Portal.js +35 -0
  119. package/src/components/Portal/PortalConsumer.js +27 -0
  120. package/src/components/Portal/PortalHost.js +107 -0
  121. package/src/components/Portal/PortalManager.js +32 -0
  122. package/src/components/Pressable.js +12 -0
  123. package/src/components/ProgressBar.js +118 -0
  124. package/src/components/ProgressCircle.js +13 -0
  125. package/src/components/ProgressIndicator.js +27 -0
  126. package/src/components/RadioButton/RadioButton.js +17 -0
  127. package/src/components/RadioButton/RadioButtonFieldGroup.js +17 -0
  128. package/src/components/RadioButton/RadioButtonGroup.js +43 -0
  129. package/src/components/RadioButton/RadioButtonRow.js +76 -0
  130. package/src/components/RadioButton/context.js +14 -0
  131. package/src/components/RadioButton/index.js +4 -0
  132. package/src/components/ResizeMode.js +1 -0
  133. package/src/components/Row.js +48 -0
  134. package/src/components/RowBodyIcon.js +8 -0
  135. package/src/components/RowHeadlineImageCaption.js +12 -0
  136. package/src/components/RowHeadlineImageIcon.js +14 -0
  137. package/src/components/SVG.js +13 -0
  138. package/src/components/ScreenContainer.js +34 -0
  139. package/src/components/Slider.js +63 -0
  140. package/src/components/StarRating.js +50 -0
  141. package/src/components/StepIndicator.js +346 -0
  142. package/src/components/Stepper.js +41 -0
  143. package/src/components/Surface.js +32 -0
  144. package/src/components/Swiper/Swiper.js +29 -0
  145. package/src/components/Swiper/SwiperItem.js +9 -0
  146. package/src/components/Swiper/index.js +2 -0
  147. package/src/components/Switch.js +56 -0
  148. package/src/components/Text.js +33 -0
  149. package/src/components/TextField.js +428 -0
  150. package/src/components/ToggleButton.js +39 -0
  151. package/src/components/Touchable.js +12 -0
  152. package/src/components/Touchable.web.js +2 -0
  153. package/src/components/Typography.js +36 -0
  154. package/src/components/useAuthState.js +31 -0
  155. package/src/constants.js +10 -0
  156. package/src/hooks.js +12 -0
  157. package/src/index.js +53 -0
  158. package/src/interfaces/Icon.js +8 -0
  159. package/src/mappings/Accordion.js +41 -0
  160. package/src/mappings/AccordionItem.js +16 -0
  161. package/src/mappings/ActionSheet.js +13 -0
  162. package/src/mappings/ActionSheetCancel.js +19 -0
  163. package/src/mappings/ActionSheetItem.js +23 -0
  164. package/src/mappings/ActivityIndicator.js +58 -0
  165. package/src/mappings/AudioPlayer.js +57 -0
  166. package/src/mappings/AvatarEdit.js +38 -0
  167. package/src/mappings/Banner.js +32 -0
  168. package/src/mappings/BlurView.js +42 -0
  169. package/src/mappings/Button.js +116 -0
  170. package/src/mappings/Card.js +52 -0
  171. package/src/mappings/CardBlock.js +123 -0
  172. package/src/mappings/CardContainer.js +104 -0
  173. package/src/mappings/CardContainerRating.js +126 -0
  174. package/src/mappings/CardContainerShortImage.js +120 -0
  175. package/src/mappings/CardInline.js +52 -0
  176. package/src/mappings/Carousel.js +19 -0
  177. package/src/mappings/Checkbox.js +46 -0
  178. package/src/mappings/CheckboxGroup.js +26 -0
  179. package/src/mappings/CheckboxRow.js +61 -0
  180. package/src/mappings/CircleImage.js +25 -0
  181. package/src/mappings/Container.js +30 -0
  182. package/src/mappings/CustomCode.js +8 -0
  183. package/src/mappings/DatePicker.js +176 -0
  184. package/src/mappings/Divider.js +27 -0
  185. package/src/mappings/FAB.js +37 -0
  186. package/src/mappings/Fetch.js +13 -0
  187. package/src/mappings/FieldSearchBarFull.js +50 -0
  188. package/src/mappings/FlashList.js +79 -0
  189. package/src/mappings/FlatList.js +36 -0
  190. package/src/mappings/HeaderLarge.js +29 -0
  191. package/src/mappings/HeaderMedium.js +55 -0
  192. package/src/mappings/HeaderOverline.js +55 -0
  193. package/src/mappings/Icon.js +32 -0
  194. package/src/mappings/IconButton.js +35 -0
  195. package/src/mappings/Image.js +35 -0
  196. package/src/mappings/ImageBackground.js +29 -0
  197. package/src/mappings/KeyboardAvoidingView.js +41 -0
  198. package/src/mappings/KeyboardAwareScrollView.js +50 -0
  199. package/src/mappings/Layout.js +200 -0
  200. package/src/mappings/LinearGradient.js +77 -0
  201. package/src/mappings/MapCallout.js +21 -0
  202. package/src/mappings/MapMarker.js +47 -0
  203. package/src/mappings/MapView.js +139 -0
  204. package/src/mappings/Modal.js +42 -0
  205. package/src/mappings/NumberInput.js +254 -0
  206. package/src/mappings/Picker.js +148 -0
  207. package/src/mappings/ProgressBar.js +101 -0
  208. package/src/mappings/ProgressCircle.js +109 -0
  209. package/src/mappings/ProgressIndicator.js +181 -0
  210. package/src/mappings/RadioButton.js +51 -0
  211. package/src/mappings/RadioButtonGroup.js +17 -0
  212. package/src/mappings/RadioButtonRow.js +42 -0
  213. package/src/mappings/RowBodyIcon.js +75 -0
  214. package/src/mappings/RowHeadlineImageCaption.js +167 -0
  215. package/src/mappings/RowHeadlineImageIcon.js +99 -0
  216. package/src/mappings/SVG.js +20 -0
  217. package/src/mappings/SafeAreaView.js +33 -0
  218. package/src/mappings/ScrollView.js +31 -0
  219. package/src/mappings/Slider.js +60 -0
  220. package/src/mappings/StarRating.js +43 -0
  221. package/src/mappings/Stepper.js +32 -0
  222. package/src/mappings/Surface.js +14 -0
  223. package/src/mappings/Swiper.js +62 -0
  224. package/src/mappings/SwiperItem.js +8 -0
  225. package/src/mappings/Switch.js +81 -0
  226. package/src/mappings/Text.js +251 -0
  227. package/src/mappings/TextArea.js +274 -0
  228. package/src/mappings/TextField.js +391 -0
  229. package/src/mappings/TextInput.js +402 -0
  230. package/src/mappings/ToggleButton.js +50 -0
  231. package/src/mappings/Touchable.js +60 -0
  232. package/src/mappings/Video.js +81 -0
  233. package/src/mappings/View.js +207 -0
  234. package/src/mappings/WebView.js +88 -0
  235. package/src/styles/DarkTheme.js +26 -0
  236. package/src/styles/DefaultTheme.js +111 -0
  237. package/src/styles/fonts.js +62 -0
  238. package/src/styles/overlay.js +60 -0
  239. package/src/styles/shadow.js +51 -0
  240. package/src/theming.js +3 -0
  241. package/src/utilities.js +102 -0
@@ -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 { Text, StyleSheet } from "react-native";
3
4
  import { extractStyles } from "../utilities";
@@ -16,27 +17,11 @@ export default function FormRow(_ref) {
16
17
  textStyles,
17
18
  viewStyles
18
19
  } = extractStyles(style);
19
- return /*#__PURE__*/React.createElement(Touchable, {
20
+ return /*#__PURE__*/React.createElement(Touchable, _extends({
20
21
  disabled: disabled,
21
22
  onPress: onPress,
22
23
  style: [styles.row, {
23
24
  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
40
25
  }, viewStyles]
41
26
  }, rest), /*#__PURE__*/React.createElement(Text, {
42
27
  style: textStyles
@@ -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,
@@ -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,3 +1,6 @@
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 * as React from "react";
2
5
  import PortalConsumer from "./PortalConsumer";
3
6
  import PortalHost, { PortalContext } from "./PortalHost";
@@ -23,34 +26,6 @@ import { ThemeProvider, withTheme } from "../../theming";
23
26
  * }
24
27
  * ```
25
28
  */
26
- class Portal extends React.Component {
27
- render() {
28
- const {
29
- children,
30
- theme
31
- } = this.props;
32
- return /*#__PURE__*/React.createElement(PortalContext.Consumer, null, manager => /*#__PURE__*/React.createElement(PortalConsumer, {
33
- manager: manager
34
- }, /*#__PURE__*/React.createElement(ThemeProvider, {
35
- theme: theme
36
- }, children)));
37
- }
38
- }
39
- // @component ./PortalHost.tsx
40
- Portal.Host = PortalHost;
41
- export default withTheme(Portal);rt { Portal, Text } from 'react-native-paper';
42
- *
43
- * export default class MyComponent extends React.Component {
44
- * render() {
45
- * return (
46
- * <Portal>
47
- * <Text>This is rendered at a different place</Text>
48
- * </Portal>
49
- * );
50
- * }
51
- * }
52
- * ```
53
- */
54
29
  class Portal extends React.Component {
55
30
  // @component ./PortalHost.tsx
56
31
 
@@ -22,27 +22,4 @@ export default class PortalConsumer extends React.Component {
22
22
  render() {
23
23
  return null;
24
24
  }
25
- }sync componentDidMount() {
26
- this.checkManager();
27
-
28
- // Delay updating to prevent React from going to infinite loop
29
- await Promise.resolve();
30
- this.key = this.props.manager.mount(this.props.children);
31
- }
32
- componentDidUpdate() {
33
- this.checkManager();
34
- this.props.manager.update(this.key, this.props.children);
35
- }
36
- componentWillUnmount() {
37
- this.checkManager();
38
- this.props.manager.unmount(this.key);
39
- }
40
- checkManager() {
41
- if (!this.props.manager) {
42
- 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");
43
- }
44
- }
45
- render() {
46
- return null;
47
- }
48
25
  }
@@ -1,7 +1,11 @@
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 * as React from "react";
2
5
  import { View, StyleSheet } from "react-native";
3
6
  import PortalManager from "./PortalManager";
4
7
  export const PortalContext = /*#__PURE__*/React.createContext(null);
8
+
5
9
  /**
6
10
  * Portal host renders all of its children `Portal` elements.
7
11
  * For example, you can wrap a screen in `Portal.Host` to render items above the screen.
@@ -29,10 +33,10 @@ export const PortalContext = /*#__PURE__*/React.createContext(null);
29
33
  export default class PortalHost extends React.Component {
30
34
  constructor() {
31
35
  super(...arguments);
32
- this.setManager = manager => {
36
+ _defineProperty(this, "setManager", manager => {
33
37
  this.manager = manager;
34
- };
35
- this.mount = children => {
38
+ });
39
+ _defineProperty(this, "mount", children => {
36
40
  const key = this.nextKey++;
37
41
  if (this.manager) {
38
42
  this.manager.mount(key, children);
@@ -44,8 +48,8 @@ export default class PortalHost extends React.Component {
44
48
  });
45
49
  }
46
50
  return key;
47
- };
48
- this.update = (key, children) => {
51
+ });
52
+ _defineProperty(this, "update", (key, children) => {
49
53
  if (this.manager) {
50
54
  this.manager.update(key, children);
51
55
  } else {
@@ -62,8 +66,8 @@ export default class PortalHost extends React.Component {
62
66
  this.queue.push(op);
63
67
  }
64
68
  }
65
- };
66
- this.unmount = key => {
69
+ });
70
+ _defineProperty(this, "unmount", key => {
67
71
  if (this.manager) {
68
72
  this.manager.unmount(key);
69
73
  } else {
@@ -72,9 +76,10 @@ export default class PortalHost extends React.Component {
72
76
  key
73
77
  });
74
78
  }
75
- };
76
- this.nextKey = 0;
77
- this.queue = [];
79
+ });
80
+ _defineProperty(this, "nextKey", 0);
81
+ _defineProperty(this, "queue", []);
82
+ _defineProperty(this, "manager", void 0);
78
83
  }
79
84
  componentDidMount() {
80
85
  const manager = this.manager;
@@ -112,41 +117,6 @@ export default class PortalHost extends React.Component {
112
117
  }));
113
118
  }
114
119
  }
115
- PortalHost.displayName = "Portal.Host";
116
- const styles = StyleSheet.create({
117
- container: {
118
- flex: 1
119
- }
120
- }); switch (action.type) {
121
- case "mount":
122
- manager.mount(action.key, action.children);
123
- break;
124
- case "update":
125
- manager.update(action.key, action.children);
126
- break;
127
- case "unmount":
128
- manager.unmount(action.key);
129
- break;
130
- }
131
- }
132
- }
133
- }
134
- render() {
135
- return /*#__PURE__*/React.createElement(PortalContext.Provider, {
136
- value: {
137
- mount: this.mount,
138
- update: this.update,
139
- unmount: this.unmount
140
- }
141
- }, /*#__PURE__*/React.createElement(View, {
142
- style: styles.container,
143
- collapsable: false,
144
- pointerEvents: "box-none"
145
- }, this.props.children), /*#__PURE__*/React.createElement(PortalManager, {
146
- ref: this.setManager
147
- }));
148
- }
149
- }
150
120
  _defineProperty(PortalHost, "displayName", "Portal.Host");
151
121
  const styles = StyleSheet.create({
152
122
  container: {
@@ -1,3 +1,6 @@
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 * as React from "react";
2
5
  import { View, StyleSheet } from "react-native";
3
6
  /**
@@ -6,47 +9,18 @@ import { View, StyleSheet } from "react-native";
6
9
  export default class PortalManager extends React.PureComponent {
7
10
  constructor() {
8
11
  super(...arguments);
9
- this.state = {
12
+ _defineProperty(this, "state", {
10
13
  portals: []
11
- };
12
- this.mount = (key, children) => {
14
+ });
15
+ _defineProperty(this, "mount", (key, children) => {
13
16
  this.setState(state => ({
14
17
  portals: [...state.portals, {
15
18
  key,
16
19
  children
17
20
  }]
18
21
  }));
19
- };
20
- this.update = (key, children) => this.setState(state => ({
21
- portals: state.portals.map(item => {
22
- if (item.key === key) {
23
- return {
24
- ...item,
25
- children
26
- };
27
- }
28
- return item;
29
- })
30
- }));
31
- this.unmount = key => this.setState(state => ({
32
- portals: state.portals.filter(item => item.key !== key)
33
- }));
34
- }
35
- render() {
36
- return this.state.portals.map(_ref => {
37
- let {
38
- key,
39
- children
40
- } = _ref;
41
- return /*#__PURE__*/React.createElement(View, {
42
- key: key,
43
- collapsable: false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */,
44
- pointerEvents: "box-none",
45
- style: StyleSheet.absoluteFill
46
- }, children);
47
22
  });
48
- }
49
- }ey, children) => this.setState(state => ({
23
+ _defineProperty(this, "update", (key, children) => this.setState(state => ({
50
24
  portals: state.portals.map(item => {
51
25
  if (item.key === key) {
52
26
  return {
@@ -1,3 +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
+ 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; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
+ 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
5
  import React, { Component } from "react";
2
6
  import { Animated, Easing, View, I18nManager } from "react-native";
3
7
  const INDETERMINATE_WIDTH_FACTOR = 0.3;
@@ -5,7 +9,7 @@ const BAR_WIDTH_ZERO_POSITION = INDETERMINATE_WIDTH_FACTOR / (1 + INDETERMINATE_
5
9
  export default class ProgressBar extends Component {
6
10
  constructor(props) {
7
11
  super(props);
8
- this.handleLayout = event => {
12
+ _defineProperty(this, "handleLayout", event => {
9
13
  const {
10
14
  width = 150,
11
15
  onLayout
@@ -18,7 +22,7 @@ export default class ProgressBar extends Component {
18
22
  if (onLayout) {
19
23
  onLayout(event);
20
24
  }
21
- };
25
+ });
22
26
  const {
23
27
  progress: progressP = 0,
24
28
  indeterminate = false
@@ -66,6 +70,7 @@ export default class ProgressBar extends Component {
66
70
  ...animationConfig,
67
71
  toValue: progress,
68
72
  velocity: 0,
73
+ //adjust this value if animation fails - velocity is required
69
74
  useNativeDriver
70
75
  }).start();
71
76
  } else {
@@ -134,43 +139,6 @@ export default class ProgressBar extends Component {
134
139
  })
135
140
  }]
136
141
  };
137
- return /*#__PURE__*/React.createElement(View, {
138
- style: [containerStyle, style],
139
- onLayout: this.handleLayout,
140
- ...restProps
141
- }, /*#__PURE__*/React.createElement(Animated.View, {
142
- style: progressStyle
143
- }), children);
144
- }
145
- } width,
146
- borderWidth,
147
- borderColor: borderColor || color,
148
- borderRadius,
149
- overflow: "hidden",
150
- backgroundColor: unfilledColor
151
- };
152
- const progressStyle = {
153
- backgroundColor: color,
154
- // Always take up full height of container.
155
- height: "100%",
156
- transform: [{
157
- translateX: this.state.animationValue.interpolate({
158
- inputRange: [0, 1],
159
- outputRange: [innerWidth * -INDETERMINATE_WIDTH_FACTOR, innerWidth]
160
- })
161
- }, {
162
- translateX: this.state.progress.interpolate({
163
- inputRange: [0, 1],
164
- outputRange: [innerWidth / (I18nManager.isRTL ? 2 : -2), 0]
165
- })
166
- }, {
167
- // Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
168
- scaleX: this.state.progress.interpolate({
169
- inputRange: [0, 1],
170
- outputRange: [0.0001, 1]
171
- })
172
- }]
173
- };
174
142
  return /*#__PURE__*/React.createElement(View, _extends({
175
143
  style: [containerStyle, style],
176
144
  onLayout: this.handleLayout
@@ -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 Config from "../Config";
3
4
  import IconButton from "../IconButton";
@@ -29,19 +30,6 @@ const RadioButton = _ref => {
29
30
  onPress === null || onPress === void 0 ? void 0 : onPress(realValue);
30
31
  onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
31
32
  };
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
- };
45
33
  return /*#__PURE__*/React.createElement(IconButton, _extends({
46
34
  Icon: Icon,
47
35
  icon: isSelected ? selectedIcon : unselectedIcon,
@@ -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 { getValueForRadioButton } from "../../utilities";
@@ -41,22 +42,7 @@ const RadioButtonGroup = _ref => {
41
42
  alignItems: "center"
42
43
  });
43
44
  }
44
- return /*#__PURE__*/React.createElement(View, {
45
- style: [{
46
- minHeight: 40
47
- }, style],
48
- ...rest
49
- }, /*#__PURE__*/React.createElement(Provider, {
50
- value: {
51
- value: internalValue,
52
- onValueChange: handleValueChange,
53
- direction
54
- }
55
- }, /*#__PURE__*/React.createElement(View, {
56
- style: _containerStyle
57
- }, children)));
58
- };
59
- export default RadioButtonGroup;xtends({
45
+ return /*#__PURE__*/React.createElement(View, _extends({
60
46
  style: [{
61
47
  minHeight: 40
62
48
  }, 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 } from "react-native";
3
4
  import RadioButton from "./RadioButton";
@@ -6,7 +7,7 @@ import { useRadioButtonGroupContext } from "./context";
6
7
  import { Direction as GroupDirection } from "./context";
7
8
  import Touchable from "../Touchable";
8
9
  import { extractStyles, getValueForRadioButton } from "../../utilities";
9
- export var Direction;
10
+ export let Direction;
10
11
  (function (Direction) {
11
12
  Direction["Row"] = "row";
12
13
  Direction["RowReverse"] = "row-reverse";
@@ -62,14 +63,13 @@ const RadioButtonRow = _ref => {
62
63
  textStyles,
63
64
  viewStyles
64
65
  } = extractStyles(style);
65
- return /*#__PURE__*/React.createElement(Touchable, {
66
+ return /*#__PURE__*/React.createElement(Touchable, _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]
@@ -106,23 +106,4 @@ const styles = StyleSheet.create({
106
106
  flex: 3
107
107
  }
108
108
  });
109
- export default RadioButtonRow;.create({
110
- mainParent: {
111
- alignItems: "center",
112
- justifyContent: "space-around",
113
- paddingStart: 20,
114
- minHeight: 50,
115
- paddingEnd: 20,
116
- display: "flex",
117
- ...Platform.select({
118
- web: {
119
- cursor: "pointer",
120
- userSelect: "none"
121
- }
122
- })
123
- },
124
- label: {
125
- flex: 3
126
- }
127
- });
128
109
  export default RadioButtonRow;
@@ -1,5 +1,5 @@
1
1
  import { createContext, useContext } from "react";
2
- export var Direction;
2
+ export let Direction;
3
3
  (function (Direction) {
4
4
  Direction["Horizontal"] = "horizontal";
5
5
  Direction["Vertical"] = "vertical";