@draftbit/core 46.6.6 → 46.6.7

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 (252) hide show
  1. package/lib/commonjs/components/CardBlock.js +4 -13
  2. package/lib/commonjs/components/CardContainerRating.js +4 -13
  3. package/lib/commonjs/components/Checkbox/Checkbox.js +4 -22
  4. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +5 -23
  5. package/lib/commonjs/components/Checkbox/CheckboxRow.js +6 -23
  6. package/lib/commonjs/components/Container.js +4 -15
  7. package/lib/commonjs/components/DatePicker/DatePicker.js +13 -26
  8. package/lib/commonjs/components/DeprecatedFAB.js +3 -21
  9. package/lib/commonjs/components/Divider.js +1 -14
  10. package/lib/commonjs/components/FAB.js +4 -18
  11. package/lib/commonjs/components/FormRow.js +2 -16
  12. package/lib/commonjs/components/IconButton.js +4 -19
  13. package/lib/commonjs/components/Image.js +2 -17
  14. package/lib/commonjs/components/Justification.js +1 -5
  15. package/lib/commonjs/components/Layout.js +19 -40
  16. package/lib/commonjs/components/Picker/Picker.js +1 -1
  17. package/lib/commonjs/components/Picker/PickerComponent.web.js +4 -19
  18. package/lib/commonjs/components/Portal/PortalHost.js +15 -44
  19. package/lib/commonjs/components/Portal/PortalManager.js +8 -34
  20. package/lib/commonjs/components/Pressable.js +2 -15
  21. package/lib/commonjs/components/ProgressBar.js +7 -37
  22. package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +1 -9
  23. package/lib/commonjs/components/ResizeMode.js +1 -5
  24. package/lib/commonjs/components/ScreenContainer.js +4 -20
  25. package/lib/commonjs/components/StepIndicator.js +18 -57
  26. package/lib/commonjs/components/Stepper.js +0 -1
  27. package/lib/commonjs/components/Surface.js +2 -14
  28. package/lib/commonjs/components/Switch.js +10 -19
  29. package/lib/commonjs/components/TextField.js +28 -76
  30. package/lib/commonjs/components/ToggleButton.js +2 -15
  31. package/lib/commonjs/components/Touchable.js +2 -15
  32. package/lib/commonjs/constants.js +1 -1
  33. package/lib/commonjs/mappings/FieldSearchBarFull.js +1 -3
  34. package/lib/commonjs/utilities.js +2 -1
  35. package/lib/module/components/Accordion/AccordionItem.js +4 -25
  36. package/lib/module/components/AnimatedCircularProgress.js +1 -13
  37. package/lib/module/components/AspectRatio.js +1 -18
  38. package/lib/module/components/AvatarEdit.js +4 -15
  39. package/lib/module/components/CardContainerRating.js +4 -14
  40. package/lib/module/components/CardContainerShortImage.js +4 -18
  41. package/lib/module/components/Checkbox/Checkbox.js +4 -25
  42. package/lib/module/components/Checkbox/CheckboxGroup.js +2 -16
  43. package/lib/module/components/CircleImage.js +1 -16
  44. package/lib/module/components/CircularProgress.js +8 -28
  45. package/lib/module/components/Container.js +4 -17
  46. package/lib/module/components/DatePicker/DatePicker.js +13 -27
  47. package/lib/module/components/DeprecatedCardWrapper.js +1 -18
  48. package/lib/module/components/DeprecatedFAB.js +3 -23
  49. package/lib/module/components/Elevation.js +2 -14
  50. package/lib/module/components/FAB.js +4 -22
  51. package/lib/module/components/FieldSearchBarFull.js +2 -1
  52. package/lib/module/components/IconButton.js +4 -21
  53. package/lib/module/components/Justification.js +0 -1
  54. package/lib/module/components/Picker/Picker.js +1 -1
  55. package/lib/module/components/Picker/PickerComponent.web.js +4 -19
  56. package/lib/module/components/Portal/Portal.js +3 -28
  57. package/lib/module/components/Portal/PortalHost.js +15 -45
  58. package/lib/module/components/Portal/PortalManager.js +7 -33
  59. package/lib/module/components/ProgressBar.js +7 -39
  60. package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +1 -10
  61. package/lib/module/components/RadioButton/context.js +1 -1
  62. package/lib/module/components/ResizeMode.js +0 -1
  63. package/lib/module/components/StarRating.js +4 -24
  64. package/lib/module/components/Stepper.js +1 -1
  65. package/lib/module/components/Surface.js +1 -15
  66. package/lib/module/components/TextField.js +28 -78
  67. package/lib/module/components/ToggleButton.js +2 -16
  68. package/lib/module/components/Touchable.js +2 -15
  69. package/lib/module/constants.js +0 -1
  70. package/lib/module/mappings/StarRating.js +2 -7
  71. package/lib/module/utilities.js +2 -1
  72. package/package.json +3 -3
  73. package/src/Provider.js +0 -9
  74. package/src/components/Accordion/AccordionGroup.js +0 -44
  75. package/src/components/Accordion/AccordionItem.js +0 -32
  76. package/src/components/Accordion/index.js +0 -2
  77. package/src/components/ActionSheet/ActionSheet.js +0 -45
  78. package/src/components/ActionSheet/ActionSheetCancel.js +0 -6
  79. package/src/components/ActionSheet/ActionSheetItem.js +0 -30
  80. package/src/components/ActionSheet/index.js +0 -3
  81. package/src/components/AnimatedCircularProgress.js +0 -43
  82. package/src/components/AspectRatio.js +0 -18
  83. package/src/components/AvatarEdit.js +0 -30
  84. package/src/components/Banner.js +0 -109
  85. package/src/components/Button.js +0 -114
  86. package/src/components/Card.js +0 -57
  87. package/src/components/CardBlock.js +0 -54
  88. package/src/components/CardContainer.js +0 -69
  89. package/src/components/CardContainerRating.js +0 -79
  90. package/src/components/CardContainerShortImage.js +0 -33
  91. package/src/components/CardInline.js +0 -36
  92. package/src/components/Carousel.js +0 -68
  93. package/src/components/Checkbox/Checkbox.js +0 -62
  94. package/src/components/Checkbox/CheckboxGroup.js +0 -21
  95. package/src/components/Checkbox/CheckboxGroupRow.js +0 -76
  96. package/src/components/Checkbox/CheckboxRow.js +0 -77
  97. package/src/components/Checkbox/context.js +0 -14
  98. package/src/components/Checkbox/index.js +0 -3
  99. package/src/components/CircleImage.js +0 -8
  100. package/src/components/CircularProgress.js +0 -81
  101. package/src/components/Config.js +0 -64
  102. package/src/components/Container.js +0 -43
  103. package/src/components/DatePicker/DatePicker.js +0 -377
  104. package/src/components/DatePicker/DatePickerComponent.js +0 -13
  105. package/src/components/DatePicker/DatePickerComponent.web.js +0 -30
  106. package/src/components/DatePicker/DatePickerComponentType.js +0 -1
  107. package/src/components/DeprecatedButton.js +0 -83
  108. package/src/components/DeprecatedCardWrapper.js +0 -18
  109. package/src/components/DeprecatedFAB.js +0 -114
  110. package/src/components/Divider.js +0 -13
  111. package/src/components/Elevation.js +0 -20
  112. package/src/components/FAB.js +0 -46
  113. package/src/components/FieldSearchBarFull.js +0 -53
  114. package/src/components/FormRow.js +0 -19
  115. package/src/components/Header.js +0 -44
  116. package/src/components/HeaderLarge.js +0 -7
  117. package/src/components/HeaderMedium.js +0 -7
  118. package/src/components/HeaderOverline.js +0 -7
  119. package/src/components/IconButton.js +0 -35
  120. package/src/components/Image.js +0 -47
  121. package/src/components/Justification.js +0 -1
  122. package/src/components/Layout.js +0 -50
  123. package/src/components/NumberInput.js +0 -49
  124. package/src/components/Picker/Picker.js +0 -267
  125. package/src/components/Picker/PickerComponent.android.js +0 -69
  126. package/src/components/Picker/PickerComponent.ios.js +0 -79
  127. package/src/components/Picker/PickerComponent.web.js +0 -70
  128. package/src/components/Picker/PickerTypes.js +0 -1
  129. package/src/components/Portal/Portal.js +0 -35
  130. package/src/components/Portal/PortalConsumer.js +0 -27
  131. package/src/components/Portal/PortalHost.js +0 -107
  132. package/src/components/Portal/PortalManager.js +0 -32
  133. package/src/components/Pressable.js +0 -12
  134. package/src/components/ProgressBar.js +0 -118
  135. package/src/components/ProgressCircle.js +0 -13
  136. package/src/components/ProgressIndicator.js +0 -27
  137. package/src/components/RadioButton/RadioButton.js +0 -17
  138. package/src/components/RadioButton/RadioButtonFieldGroup.js +0 -17
  139. package/src/components/RadioButton/RadioButtonGroup.js +0 -43
  140. package/src/components/RadioButton/RadioButtonRow.js +0 -76
  141. package/src/components/RadioButton/context.js +0 -14
  142. package/src/components/RadioButton/index.js +0 -4
  143. package/src/components/ResizeMode.js +0 -1
  144. package/src/components/Row.js +0 -48
  145. package/src/components/RowBodyIcon.js +0 -8
  146. package/src/components/RowHeadlineImageCaption.js +0 -12
  147. package/src/components/RowHeadlineImageIcon.js +0 -14
  148. package/src/components/SVG.js +0 -13
  149. package/src/components/ScreenContainer.js +0 -34
  150. package/src/components/Slider.js +0 -63
  151. package/src/components/StarRating.js +0 -50
  152. package/src/components/StepIndicator.js +0 -346
  153. package/src/components/Stepper.js +0 -41
  154. package/src/components/Surface.js +0 -32
  155. package/src/components/Swiper/Swiper.js +0 -29
  156. package/src/components/Swiper/SwiperItem.js +0 -9
  157. package/src/components/Swiper/index.js +0 -2
  158. package/src/components/Switch.js +0 -56
  159. package/src/components/Text.js +0 -33
  160. package/src/components/TextField.js +0 -428
  161. package/src/components/ToggleButton.js +0 -39
  162. package/src/components/Touchable.js +0 -12
  163. package/src/components/Touchable.web.js +0 -2
  164. package/src/components/Typography.js +0 -36
  165. package/src/components/useAuthState.js +0 -31
  166. package/src/constants.js +0 -10
  167. package/src/hooks.js +0 -12
  168. package/src/index.js +0 -53
  169. package/src/interfaces/Icon.js +0 -8
  170. package/src/mappings/Accordion.js +0 -41
  171. package/src/mappings/AccordionItem.js +0 -16
  172. package/src/mappings/ActionSheet.js +0 -13
  173. package/src/mappings/ActionSheetCancel.js +0 -19
  174. package/src/mappings/ActionSheetItem.js +0 -23
  175. package/src/mappings/ActivityIndicator.js +0 -58
  176. package/src/mappings/AudioPlayer.js +0 -57
  177. package/src/mappings/AvatarEdit.js +0 -38
  178. package/src/mappings/Banner.js +0 -32
  179. package/src/mappings/BlurView.js +0 -42
  180. package/src/mappings/Button.js +0 -116
  181. package/src/mappings/Card.js +0 -52
  182. package/src/mappings/CardBlock.js +0 -123
  183. package/src/mappings/CardContainer.js +0 -104
  184. package/src/mappings/CardContainerRating.js +0 -126
  185. package/src/mappings/CardContainerShortImage.js +0 -120
  186. package/src/mappings/CardInline.js +0 -52
  187. package/src/mappings/Carousel.js +0 -19
  188. package/src/mappings/Checkbox.js +0 -46
  189. package/src/mappings/CheckboxGroup.js +0 -26
  190. package/src/mappings/CheckboxRow.js +0 -61
  191. package/src/mappings/CircleImage.js +0 -25
  192. package/src/mappings/Container.js +0 -30
  193. package/src/mappings/CustomCode.js +0 -8
  194. package/src/mappings/DatePicker.js +0 -176
  195. package/src/mappings/Divider.js +0 -27
  196. package/src/mappings/FAB.js +0 -37
  197. package/src/mappings/Fetch.js +0 -13
  198. package/src/mappings/FieldSearchBarFull.js +0 -50
  199. package/src/mappings/FlashList.js +0 -79
  200. package/src/mappings/FlatList.js +0 -36
  201. package/src/mappings/HeaderLarge.js +0 -29
  202. package/src/mappings/HeaderMedium.js +0 -55
  203. package/src/mappings/HeaderOverline.js +0 -55
  204. package/src/mappings/Icon.js +0 -32
  205. package/src/mappings/IconButton.js +0 -35
  206. package/src/mappings/Image.js +0 -35
  207. package/src/mappings/ImageBackground.js +0 -29
  208. package/src/mappings/KeyboardAvoidingView.js +0 -41
  209. package/src/mappings/KeyboardAwareScrollView.js +0 -50
  210. package/src/mappings/Layout.js +0 -200
  211. package/src/mappings/LinearGradient.js +0 -77
  212. package/src/mappings/MapCallout.js +0 -21
  213. package/src/mappings/MapMarker.js +0 -47
  214. package/src/mappings/MapView.js +0 -139
  215. package/src/mappings/Modal.js +0 -42
  216. package/src/mappings/NumberInput.js +0 -254
  217. package/src/mappings/Picker.js +0 -148
  218. package/src/mappings/ProgressBar.js +0 -101
  219. package/src/mappings/ProgressCircle.js +0 -109
  220. package/src/mappings/ProgressIndicator.js +0 -181
  221. package/src/mappings/RadioButton.js +0 -51
  222. package/src/mappings/RadioButtonGroup.js +0 -17
  223. package/src/mappings/RadioButtonRow.js +0 -42
  224. package/src/mappings/RowBodyIcon.js +0 -75
  225. package/src/mappings/RowHeadlineImageCaption.js +0 -167
  226. package/src/mappings/RowHeadlineImageIcon.js +0 -99
  227. package/src/mappings/SVG.js +0 -20
  228. package/src/mappings/SafeAreaView.js +0 -33
  229. package/src/mappings/ScrollView.js +0 -31
  230. package/src/mappings/Slider.js +0 -60
  231. package/src/mappings/StarRating.js +0 -43
  232. package/src/mappings/Stepper.js +0 -32
  233. package/src/mappings/Surface.js +0 -14
  234. package/src/mappings/Swiper.js +0 -62
  235. package/src/mappings/SwiperItem.js +0 -8
  236. package/src/mappings/Switch.js +0 -81
  237. package/src/mappings/Text.js +0 -251
  238. package/src/mappings/TextArea.js +0 -274
  239. package/src/mappings/TextField.js +0 -391
  240. package/src/mappings/TextInput.js +0 -402
  241. package/src/mappings/ToggleButton.js +0 -50
  242. package/src/mappings/Touchable.js +0 -60
  243. package/src/mappings/Video.js +0 -81
  244. package/src/mappings/View.js +0 -207
  245. package/src/mappings/WebView.js +0 -88
  246. package/src/styles/DarkTheme.js +0 -26
  247. package/src/styles/DefaultTheme.js +0 -111
  248. package/src/styles/fonts.js +0 -62
  249. package/src/styles/overlay.js +0 -60
  250. package/src/styles/shadow.js +0 -51
  251. package/src/theming.js +0 -3
  252. package/src/utilities.js +0 -102
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { View, StyleSheet } from "react-native";
3
4
  import { Picker as NativePicker } from "@react-native-picker/picker";
@@ -7,6 +8,7 @@ import { extractStyles } from "../../utilities";
7
8
  import TextField from "../TextField";
8
9
  import Touchable from "../Touchable";
9
10
  const Picker = _ref => {
11
+ var _options$find;
10
12
  let {
11
13
  style,
12
14
  options,
@@ -16,7 +18,6 @@ const Picker = _ref => {
16
18
  onValueChange: onValueChangeOverride = () => {},
17
19
  ...props
18
20
  } = _ref;
19
- var _a, _b;
20
21
  const {
21
22
  viewStyles: {
22
23
  borderRadius,
@@ -61,7 +62,7 @@ const Picker = _ref => {
61
62
  };
62
63
 
63
64
  const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
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);
65
+ const selectedLabel = selectedValue && (((_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) ?? selectedValue);
65
66
  return /*#__PURE__*/React.createElement(Touchable, {
66
67
  disabled: disabled,
67
68
  onPress: toggleFocus,
@@ -86,23 +87,7 @@ const Picker = _ref => {
86
87
  key: o.value
87
88
  }))), /*#__PURE__*/React.createElement(View, {
88
89
  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);ct.createElement(TextField, _extends({}, props, {
90
+ }, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
106
91
  value: selectedLabel,
107
92
  placeholder: placeholder
108
93
  // @ts-ignore
@@ -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
 
@@ -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 React from "react";
2
3
  import { View } from "react-native";
3
4
  import Text from "../Text";
@@ -19,16 +20,6 @@ const RadioButtonFieldGroup = _ref => {
19
20
  fontSize: theme.typography.headline4.fontSize,
20
21
  color: theme.typography.headline4.color
21
22
  }, labelStyle]
22
- }, label), /*#__PURE__*/React.createElement(RadioButtonGroup, {
23
- theme: theme,
24
- ...rest
25
- }, children));
26
- };
27
- export default withTheme(RadioButtonFieldGroup);}, /*#__PURE__*/React.createElement(Text, {
28
- style: [{
29
- fontSize: theme.typography.headline4.fontSize,
30
- color: theme.typography.headline4.color
31
- }, labelStyle]
32
23
  }, label), /*#__PURE__*/React.createElement(RadioButtonGroup, _extends({
33
24
  theme: theme
34
25
  }, rest), children));
@@ -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";
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { View, StyleSheet, Pressable } from "react-native";
3
4
  import { withTheme } from "../theming";
@@ -31,10 +32,9 @@ const StarRating = _ref => {
31
32
  !!onPress && onPress(r);
32
33
  }, [onPress]);
33
34
  const ratingRounded = Math.round(localRating * 2) / 2;
34
- return /*#__PURE__*/React.createElement(View, {
35
- style: [styles.container, style],
36
- ...rest
37
- }, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(View, {
35
+ return /*#__PURE__*/React.createElement(View, _extends({
36
+ style: [styles.container, style]
37
+ }, rest), [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(View, {
38
38
  key: i,
39
39
  style: {
40
40
  display: "flex"
@@ -74,24 +74,4 @@ const styles = StyleSheet.create({
74
74
  width: "50%"
75
75
  }
76
76
  });
77
- export default withTheme(StarRating);ntainer: {
78
- flexDirection: "row",
79
- alignItems: "center"
80
- },
81
- touchContainer: {
82
- display: "flex",
83
- flexDirection: "row",
84
- position: "absolute",
85
- top: 0,
86
- right: 0,
87
- left: 0,
88
- bottom: 0,
89
- zIndex: 1
90
- },
91
- pressable: {
92
- flex: 1,
93
- height: "100%",
94
- width: "50%"
95
- }
96
- });
97
77
  export default withTheme(StarRating);
@@ -24,7 +24,7 @@ const Stepper = _ref => {
24
24
  viewStyles,
25
25
  textStyles
26
26
  } = extractStyles(style);
27
- const [value, setValue] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0);
27
+ const [value, setValue] = useState(defaultValue ?? 0);
28
28
  const isValidValue = valueArg => valueArg >= min && valueArg <= max;
29
29
  const handlePlusOrMinus = type => {
30
30
  const newValue = type === "plus" ? value + 1 : value - 1;
@@ -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
  /* Copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx */
2
3
  import * as React from "react";
3
4
  import { Animated, StyleSheet } from "react-native";
@@ -33,21 +34,6 @@ const Surface = _ref => {
33
34
  return colors.surface;
34
35
  }
35
36
  };
36
- return /*#__PURE__*/React.createElement(Animated.View, {
37
- ...rest,
38
- style: [{
39
- backgroundColor: getBackgroundColor(),
40
- elevation,
41
- ...evalationStyles,
42
- ...restStyle
43
- }]
44
- }, children);
45
- };
46
- export default withTheme(Surface);erlay(elevation, colors.surface);
47
- } else {
48
- return colors.surface;
49
- }
50
- };
51
37
  return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
52
38
  style: [{
53
39
  backgroundColor: getBackgroundColor(),
@@ -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 * as React from "react";
2
6
  import { View, Animated, TextInput as NativeTextInput, StyleSheet, Text, I18nManager } from "react-native";
3
7
  import { withTheme } from "../theming";
@@ -9,7 +13,7 @@ const ICON_SIZE = 24;
9
13
  class TextField extends React.Component {
10
14
  constructor() {
11
15
  super(...arguments);
12
- this.state = {
16
+ _defineProperty(this, "state", {
13
17
  nativeProps: {},
14
18
  labeled: new Animated.Value(this.props.value || this.props.error ? 0 : 1),
15
19
  focused: false,
@@ -18,46 +22,47 @@ class TextField extends React.Component {
18
22
  measured: false,
19
23
  width: 0
20
24
  }
21
- };
22
- this._timer = setTimeout(() => {}, 0);
23
- this._showPlaceholder = () => {
25
+ });
26
+ _defineProperty(this, "_timer", setTimeout(() => {}, 0));
27
+ _defineProperty(this, "_showPlaceholder", () => {
24
28
  clearTimeout(this._timer);
29
+
25
30
  // Set the placeholder in a delay to offset the label animation
26
31
  // If we show it immediately, they'll overlap and look ugly
27
32
  this._timer = setTimeout(() => this.setState({
28
33
  placeholder: this.props.placeholder
29
34
  }), 50);
30
- };
31
- this._hidePlaceholder = () => this.setState({
32
- placeholder: ""
33
35
  });
34
- this._restoreLabel = () => Animated.timing(this.state.labeled, {
36
+ _defineProperty(this, "_hidePlaceholder", () => this.setState({
37
+ placeholder: ""
38
+ }));
39
+ _defineProperty(this, "_restoreLabel", () => Animated.timing(this.state.labeled, {
35
40
  toValue: 1,
36
41
  duration: FOCUS_ANIMATION_DURATION,
37
42
  useNativeDriver: true
38
- }).start();
39
- this._minmizeLabel = () => Animated.timing(this.state.labeled, {
43
+ }).start());
44
+ _defineProperty(this, "_minmizeLabel", () => Animated.timing(this.state.labeled, {
40
45
  toValue: 0,
41
46
  duration: BLUR_ANIMATION_DURATION,
42
47
  useNativeDriver: true
43
- }).start();
44
- this._handleFocus = () => {
48
+ }).start());
49
+ _defineProperty(this, "_handleFocus", () => {
45
50
  if (this.props.disabled) {
46
51
  return;
47
52
  }
48
53
  this.setState({
49
54
  focused: true
50
55
  });
51
- };
52
- this._handleBlur = () => {
56
+ });
57
+ _defineProperty(this, "_handleBlur", () => {
53
58
  if (this.props.disabled) {
54
59
  return;
55
60
  }
56
61
  this.setState({
57
62
  focused: false
58
63
  });
59
- };
60
- this._handleChangeText = value => {
64
+ });
65
+ _defineProperty(this, "_handleChangeText", value => {
61
66
  if (this.props.disabled) {
62
67
  return;
63
68
  }
@@ -72,8 +77,8 @@ class TextField extends React.Component {
72
77
  });
73
78
  this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
74
79
  }
75
- };
76
- this._root = undefined;
80
+ });
81
+ _defineProperty(this, "_root", undefined);
77
82
  }
78
83
  static getDerivedStateFromProps(nextProps, prevState) {
79
84
  return {
@@ -160,9 +165,7 @@ class TextField extends React.Component {
160
165
  roundness,
161
166
  disabledOpacity
162
167
  },
163
- render = props => /*#__PURE__*/React.createElement(NativeTextInput, {
164
- ...props
165
- }),
168
+ render = props => /*#__PURE__*/React.createElement(NativeTextInput, props),
166
169
  ...rest
167
170
  } = this.props;
168
171
  const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
@@ -302,10 +305,9 @@ class TextField extends React.Component {
302
305
  } = StyleSheet.flatten(style || {});
303
306
  return /*#__PURE__*/React.createElement(View, {
304
307
  style: [styles.container, styleProp]
305
- }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
306
- ...leftIconProps,
308
+ }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
307
309
  style: leftIconStyle
308
- }) : null, /*#__PURE__*/React.createElement(View, {
310
+ })) : null, /*#__PURE__*/React.createElement(View, {
309
311
  style: applyStyles([containerStyle], {
310
312
  height: style === null || style === void 0 ? void 0 : style.height,
311
313
  backgroundColor: bgColor,
@@ -373,10 +375,9 @@ class TextField extends React.Component {
373
375
  style: {
374
376
  justifyContent: type === "solid" ? "center" : undefined
375
377
  }
376
- }, /*#__PURE__*/React.createElement(Icon, {
377
- ...leftIconProps,
378
+ }, /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
378
379
  style: leftIconStyle
379
- })) : null, render({
380
+ }))) : null, render({
380
381
  ref: c => {
381
382
  this._root = c;
382
383
  },
@@ -413,57 +414,6 @@ class TextField extends React.Component {
413
414
  }
414
415
  }
415
416
  export default withTheme(TextField);
416
- const styles = StyleSheet.create({
417
- container: {
418
- alignSelf: "stretch"
419
- },
420
- placeholder: {
421
- position: "absolute",
422
- left: 0
423
- },
424
- underline: {
425
- position: "absolute",
426
- left: 0,
427
- right: 0,
428
- bottom: 0,
429
- height: 2
430
- },
431
- input: {
432
- flexGrow: 1,
433
- justifyContent: "center",
434
- textAlignVertical: "center",
435
- margin: 0,
436
- textAlign: I18nManager.isRTL ? "right" : "left"
437
- }
438
- });ionColor: activeColor,
439
- multiline,
440
- numberOfLines,
441
- onFocus: this._handleFocus,
442
- onBlur: this._handleBlur,
443
- underlineColorAndroid: "transparent",
444
- style: inputStyles,
445
- ...rest,
446
- ...this.state.nativeProps,
447
- value: this.state.value
448
- })), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
449
- name: rightIconName,
450
- size: ICON_SIZE,
451
- color: colors.light,
452
- style: {
453
- position: "absolute",
454
- right: 16,
455
- marginTop: type === "solid" ? MINIMIZED_LABEL_FONT_SIZE + 4 : 16
456
- }
457
- }) : null, assistiveText ? /*#__PURE__*/React.createElement(Text, {
458
- style: [{
459
- color: error ? colors.error : colors.light,
460
- marginTop: 8,
461
- marginLeft: assistiveTextLeftMargin
462
- }]
463
- }, assistiveText) : null);
464
- }
465
- }
466
- export default withTheme(TextField);
467
417
  const styles = StyleSheet.create({
468
418
  container: {
469
419
  alignSelf: "stretch"
@@ -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 { withTheme } from "../theming";
3
4
  import { StyleSheet } from "react-native";
@@ -37,28 +38,13 @@ const ToggleButton = _ref => {
37
38
  setInternalValue(!internalValue);
38
39
  onPress(!internalValue);
39
40
  };
40
- return /*#__PURE__*/React.createElement(IconButton, {
41
+ return /*#__PURE__*/React.createElement(IconButton, _extends({
41
42
  Icon: Icon,
42
43
  icon: icon,
43
44
  size: iconSize,
44
45
  color: internalValue ? colors[color] : colors[colorSecondary],
45
46
  onPress: handlePress,
46
47
  disabled: disabled,
47
- style: [styles.mainContainer, {
48
- width,
49
- height,
50
- backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
51
- borderColor: colors[borderColor]
52
- }, style],
53
- ...rest
54
- });
55
- };
56
- const styles = StyleSheet.create({
57
- mainContainer: {
58
- borderWidth: 1
59
- }
60
- });
61
- export default withTheme(ToggleButton);: disabled,
62
48
  style: [styles.mainContainer, {
63
49
  width,
64
50
  height,