@draftbit/core 46.10.3-7afc5f.2 → 46.10.3-84bbff.2

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 (52) hide show
  1. package/lib/commonjs/components/AnimatedCircularProgress.js +12 -1
  2. package/lib/commonjs/components/Banner.js +23 -4
  3. package/lib/commonjs/components/BottomSheet/BottomSheet.js +22 -4
  4. package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +127 -111
  5. package/lib/commonjs/components/Button.js +33 -10
  6. package/lib/commonjs/components/Checkbox/Checkbox.js +3 -4
  7. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +5 -23
  8. package/lib/commonjs/components/Checkbox/CheckboxRow.js +6 -23
  9. package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +1 -4
  10. package/lib/commonjs/components/DeprecatedCardWrapper.js +15 -1
  11. package/lib/commonjs/components/Divider.js +14 -1
  12. package/lib/commonjs/components/FAB.js +18 -4
  13. package/lib/commonjs/components/Layout.js +40 -19
  14. package/lib/commonjs/components/Picker/PickerComponent.ios.js +36 -11
  15. package/lib/commonjs/components/Portal/Portal.js +27 -3
  16. package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
  17. package/lib/commonjs/components/Pressable.js +15 -2
  18. package/lib/commonjs/components/ScreenContainer.js +24 -6
  19. package/lib/commonjs/components/Shadow.js +15 -2
  20. package/lib/commonjs/components/Slider.js +21 -4
  21. package/lib/commonjs/components/Switch.js +19 -10
  22. package/lib/commonjs/components/TabView/TabView.js +13 -7
  23. package/lib/commonjs/components/Table/Table.js +5 -5
  24. package/lib/commonjs/components/Table/TableRow.js +1 -2
  25. package/lib/commonjs/components/Text.js +50 -4
  26. package/lib/commonjs/components/TextField.js +76 -28
  27. package/lib/commonjs/components/ToggleButton.js +15 -2
  28. package/lib/commonjs/components/Touchable.js +15 -2
  29. package/lib/commonjs/constants.js +1 -1
  30. package/lib/commonjs/mappings/FieldSearchBarFull.js +3 -1
  31. package/lib/commonjs/mappings/StarRating.js +6 -2
  32. package/lib/commonjs/styles/overlay.js +1 -3
  33. package/lib/module/components/Accordion/AccordionItem.js +25 -4
  34. package/lib/module/components/AnimatedCircularProgress.js +13 -1
  35. package/lib/module/components/AspectRatio.js +18 -1
  36. package/lib/module/components/AvatarEdit.js +15 -4
  37. package/lib/module/components/BottomSheet/BottomSheetComponent.js +124 -111
  38. package/lib/module/components/Checkbox/CheckboxGroup.js +16 -2
  39. package/lib/module/components/DeprecatedButton.js +21 -3
  40. package/lib/module/components/DeprecatedCardWrapper.js +18 -1
  41. package/lib/module/components/Picker/PickerComponent.android.js +21 -3
  42. package/lib/module/components/Picker/PickerComponent.ios.js +36 -11
  43. package/lib/module/components/Portal/PortalHost.js +45 -15
  44. package/lib/module/components/RadioButton/RadioButton.js +13 -1
  45. package/lib/module/components/RadioButton/RadioButtonGroup.js +16 -2
  46. package/lib/module/components/RadioButton/RadioButtonRow.js +24 -5
  47. package/lib/module/components/Surface.js +15 -1
  48. package/lib/module/components/TabView/TabView.js +17 -7
  49. package/lib/module/components/Touchable.js +15 -2
  50. package/lib/module/constants.js +1 -0
  51. package/lib/module/hooks.js +1 -2
  52. package/package.json +3 -3
@@ -10,7 +10,6 @@ var _theming = require("../../theming");
10
10
  var _hooks = require("../../hooks");
11
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
- 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); }
14
13
  const Checkbox = _ref => {
15
14
  let {
16
15
  Icon,
@@ -34,7 +33,6 @@ const Checkbox = _ref => {
34
33
  setInternalValue(status);
35
34
  }
36
35
  }, [status]);
37
-
38
36
  // This special logic is to handle weird APIs like Airtable that return
39
37
  // true or undefined for a boolean
40
38
  const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
@@ -58,7 +56,8 @@ const Checkbox = _ref => {
58
56
  onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
59
57
  }
60
58
  };
61
- return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({}, rest, {
59
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
60
+ ...rest,
62
61
  onPress: handlePress,
63
62
  disabled: disabled,
64
63
  accessibilityState: {
@@ -70,7 +69,7 @@ const Checkbox = _ref => {
70
69
  width: size,
71
70
  height: size
72
71
  }]
73
- }), /*#__PURE__*/React.createElement(Icon, {
72
+ }, /*#__PURE__*/React.createElement(Icon, {
74
73
  style: styles.icon,
75
74
  name: internalValue ? checkedIcon : uncheckedIcon,
76
75
  size: size,
@@ -13,7 +13,8 @@ var _utilities = require("../../utilities");
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
- var Direction;
16
+ 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); }
17
+ let Direction;
17
18
  exports.Direction = Direction;
18
19
  (function (Direction) {
19
20
  Direction["Row"] = "row";
@@ -71,14 +72,13 @@ const CheckboxGroupRow = _ref => {
71
72
  textStyles,
72
73
  viewStyles
73
74
  } = (0, _utilities.extractStyles)(style);
74
- return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
75
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
75
76
  onPress: handlePress,
76
77
  style: [styles.mainParent, {
77
78
  flexDirection: direction
78
79
  }, viewStyles],
79
- disabled: disabled,
80
- ...rest
81
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
80
+ disabled: disabled
81
+ }, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
82
82
  style: [styles.label, {
83
83
  alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
84
84
  }, labelContainerStyle]
@@ -117,22 +117,4 @@ const styles = _reactNative.StyleSheet.create({
117
117
  }
118
118
  });
119
119
  var _default = CheckboxGroupRow;
120
- exports.default = _default;center",
121
- justifyContent: "space-around",
122
- paddingStart: 20,
123
- minHeight: 50,
124
- paddingEnd: 20,
125
- display: "flex",
126
- ..._reactNative.Platform.select({
127
- web: {
128
- cursor: "pointer",
129
- userSelect: "none"
130
- }
131
- })
132
- },
133
- label: {
134
- flex: 3
135
- }
136
- });
137
- var _default = CheckboxGroupRow;
138
120
  exports.default = _default;
@@ -14,7 +14,8 @@ var _Checkbox = _interopRequireDefault(require("./Checkbox"));
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
- var Direction;
17
+ 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); }
18
+ let Direction;
18
19
  exports.Direction = Direction;
19
20
  (function (Direction) {
20
21
  Direction["Row"] = "row";
@@ -57,6 +58,7 @@ const CheckboxRow = _ref => {
57
58
  setInternalValue(status);
58
59
  }
59
60
  }, [status]);
61
+
60
62
  // This special logic is to handle weird APIs like Airtable that return
61
63
  // true or undefined for a boolean
62
64
  const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
@@ -80,14 +82,13 @@ const CheckboxRow = _ref => {
80
82
  textStyles,
81
83
  viewStyles
82
84
  } = (0, _utilities.extractStyles)(style);
83
- return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
85
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
84
86
  onPress: handlePress,
85
87
  style: [viewStyles, styles.mainParent, {
86
88
  flexDirection: direction
87
89
  }],
88
- disabled: disabled,
89
- ...rest
90
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
90
+ disabled: disabled
91
+ }, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
91
92
  style: [styles.label, {
92
93
  alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
93
94
  }, labelContainerStyle]
@@ -124,22 +125,4 @@ const styles = _reactNative.StyleSheet.create({
124
125
  }
125
126
  });
126
127
  var _default = CheckboxRow;
127
- exports.default = _default;ems: "center",
128
- justifyContent: "space-around",
129
- paddingStart: 20,
130
- minHeight: 50,
131
- paddingEnd: 20,
132
- display: "flex",
133
- ..._reactNative.Platform.select({
134
- web: {
135
- cursor: "pointer",
136
- userSelect: "none"
137
- }
138
- })
139
- },
140
- label: {
141
- flex: 3
142
- }
143
- });
144
- var _default = CheckboxRow;
145
128
  exports.default = _default;
@@ -31,7 +31,6 @@ const DeckSwiper = _ref => {
31
31
  console.warn("'children' of DeckSwiper ignored due to usage of 'data' and 'renderItem'");
32
32
  }
33
33
  const childrenArray = _react.default.useMemo(() => _react.default.Children.toArray(children), [children]);
34
-
35
34
  // an array of indices based on children count
36
35
  const cardsFillerData = _react.default.useMemo(() => Array.from(Array(childrenArray.length).keys()), [childrenArray]);
37
36
  const cardsData = data || cardsFillerData;
@@ -58,7 +57,6 @@ const DeckSwiper = _ref => {
58
57
  return card === null || card === void 0 ? void 0 : card.toString();
59
58
  }
60
59
  };
61
-
62
60
  /**
63
61
  * By default react-native-deck-swiper positions everything with absolute position.
64
62
  * To overcome this, it is wrapped in a View to be able to add the component in any layout structure.
@@ -68,7 +66,6 @@ const DeckSwiper = _ref => {
68
66
  * To fix/mitage this without setting a static height, the first card is rendered in invisible state to take up space.
69
67
  * This effectivley makes the default height of the container be the height of the first card.
70
68
  */
71
-
72
69
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
73
70
  style: styles.containerHeightFiller
74
71
  }, renderFirstCard()), /*#__PURE__*/_react.default.createElement(_reactNativeDeckSwiper.default, {
@@ -105,4 +102,4 @@ const styles = _reactNative.StyleSheet.create({
105
102
  }
106
103
  });
107
104
  var _default = DeckSwiper;
108
- exports.default = _default;
105
+ exports.default = _default;lt;
@@ -8,7 +8,6 @@ var _react = _interopRequireDefault(require("react"));
8
8
  var _theming = require("../theming");
9
9
  var _Touchable = _interopRequireDefault(require("./Touchable"));
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- 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); }
12
11
  const getWidth = numColumns => {
13
12
  switch (numColumns) {
14
13
  case 1:
@@ -28,6 +27,21 @@ const Card = _ref => {
28
27
  ...rest
29
28
  } = _ref;
30
29
  const width = getWidth(numColumns);
30
+ return /*#__PURE__*/_react.default.createElement(_Touchable.default, {
31
+ disabled: !onPress,
32
+ onPress: onPress,
33
+ style: [style, {
34
+ width
35
+ }],
36
+ ...rest
37
+ }, children);
38
+ };
39
+ var _default = (0, _theming.withTheme)(Card);
40
+ exports.default = _default;s,
41
+ style,
42
+ ...rest
43
+ } = _ref;
44
+ const width = getWidth(numColumns);
31
45
  return /*#__PURE__*/_react.default.createElement(_Touchable.default, _extends({
32
46
  disabled: !onPress,
33
47
  onPress: onPress,
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
9
9
  var _theming = require("../theming");
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
- 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); }
13
12
  const Divider = _ref => {
14
13
  let {
15
14
  style,
@@ -19,6 +18,20 @@ const Divider = _ref => {
19
18
  },
20
19
  ...rest
21
20
  } = _ref;
21
+ return /*#__PURE__*/React.createElement(_reactNative.View, {
22
+ style: [{
23
+ backgroundColor: color || colors.divider,
24
+ height: _reactNative.StyleSheet.hairlineWidth
25
+ }, style],
26
+ ...rest
27
+ });
28
+ };
29
+ var _default = (0, _theming.withTheme)(Divider);
30
+ exports.default = _default;eme: {
31
+ colors
32
+ },
33
+ ...rest
34
+ } = _ref;
22
35
  return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
23
36
  style: [{
24
37
  backgroundColor: color || colors.divider,
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
9
9
  var _theming = require("../theming");
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
- 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); }
13
12
  const FAB = _ref => {
14
13
  let {
15
14
  onPress,
@@ -33,7 +32,7 @@ const FAB = _ref => {
33
32
  borderRadius: size / 2,
34
33
  overflow: "hidden"
35
34
  }, style]
36
- }, /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
35
+ }, /*#__PURE__*/React.createElement(_reactNative.Pressable, {
37
36
  onPress: onPress,
38
37
  disabled: loading || disabled,
39
38
  android_ripple: {
@@ -51,8 +50,9 @@ const FAB = _ref => {
51
50
  borderRadius: size / 2,
52
51
  backgroundColor
53
52
  }];
54
- }
55
- }, props), /*#__PURE__*/React.createElement(_reactNative.View, null, loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
53
+ },
54
+ ...props
55
+ }, /*#__PURE__*/React.createElement(_reactNative.View, null, loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
56
56
  style: size > 50 ? {
57
57
  marginTop: 2,
58
58
  marginLeft: 2
@@ -79,4 +79,18 @@ const styles = _reactNative.StyleSheet.create({
79
79
  }
80
80
  });
81
81
  var _default = (0, _theming.withTheme)(FAB);
82
+ exports.default = _default; styles = _reactNative.StyleSheet.create({
83
+ button: {
84
+ backgroundColor: "#5a45ff",
85
+ justifyContent: "center",
86
+ alignItems: "center",
87
+ ..._reactNative.Platform.select({
88
+ web: {
89
+ cursor: "pointer",
90
+ userSelect: "none"
91
+ }
92
+ })
93
+ }
94
+ });
95
+ var _default = (0, _theming.withTheme)(FAB);
82
96
  exports.default = _default;
@@ -13,7 +13,6 @@ var React = _interopRequireWildcard(require("react"));
13
13
  var _reactNative = require("react-native");
14
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
- 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); }
17
16
  function Center(_ref) {
18
17
  let {
19
18
  width = 240,
@@ -23,15 +22,16 @@ function Center(_ref) {
23
22
  style,
24
23
  ...rest
25
24
  } = _ref;
26
- return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
25
+ return /*#__PURE__*/React.createElement(_reactNative.View, {
27
26
  style: [{
28
27
  justifyContent: "center",
29
28
  alignItems: "center",
30
29
  width,
31
30
  height,
32
31
  backgroundColor: bgColor
33
- }, style]
34
- }, rest), children);
32
+ }, style],
33
+ ...rest
34
+ }, children);
35
35
  }
36
36
  function Circle(_ref2) {
37
37
  let {
@@ -42,7 +42,7 @@ function Circle(_ref2) {
42
42
  ...rest
43
43
  } = _ref2;
44
44
  const borderRadius = 1000;
45
- return /*#__PURE__*/React.createElement(Center, _extends({
45
+ return /*#__PURE__*/React.createElement(Center, {
46
46
  width: size,
47
47
  height: size,
48
48
  bgColor: bgColor,
@@ -50,8 +50,9 @@ function Circle(_ref2) {
50
50
  backgroundColor: bgColor,
51
51
  borderRadius,
52
52
  overflow: "hidden"
53
- }]
54
- }, rest), children);
53
+ }],
54
+ ...rest
55
+ }, children);
55
56
  }
56
57
  function Square(_ref3) {
57
58
  let {
@@ -61,12 +62,13 @@ function Square(_ref3) {
61
62
  style,
62
63
  ...rest
63
64
  } = _ref3;
64
- return /*#__PURE__*/React.createElement(Center, _extends({
65
+ return /*#__PURE__*/React.createElement(Center, {
65
66
  style: style,
66
67
  width: size,
67
68
  height: size,
68
- bgColor: bgColor
69
- }, rest), children);
69
+ bgColor: bgColor,
70
+ ...rest
71
+ }, children);
70
72
  }
71
73
  function Row(_ref4) {
72
74
  let {
@@ -76,15 +78,14 @@ function Row(_ref4) {
76
78
  style,
77
79
  ...rest
78
80
  } = _ref4;
79
- return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
80
- style: [style,
81
- // style goes first b/c we can't override these
82
- {
81
+ return /*#__PURE__*/React.createElement(_reactNative.View, {
82
+ style: [style, {
83
83
  alignItems,
84
84
  flexDirection: "row",
85
85
  justifyContent: justifyContent
86
- }]
87
- }, rest), children);
86
+ }],
87
+ ...rest
88
+ }, children);
88
89
  }
89
90
  function Spacer(_ref5) {
90
91
  let {
@@ -96,16 +97,36 @@ function Spacer(_ref5) {
96
97
  style,
97
98
  ...rest
98
99
  } = _ref5;
99
- return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
100
+ return /*#__PURE__*/React.createElement(_reactNative.View, {
100
101
  style: [style, {
101
102
  paddingRight: right,
102
103
  paddingTop: top,
103
104
  paddingLeft: left,
104
105
  paddingBottom: bottom
105
- }]
106
- }, rest), children);
106
+ }],
107
+ ...rest
108
+ }, children);
107
109
  }
108
110
  function Stack(_ref6) {
111
+ let {
112
+ children,
113
+ justifyContent = "flex-start",
114
+ alignItems = "flex-start",
115
+ style,
116
+ ...rest
117
+ } = _ref6;
118
+ return (
119
+ /*#__PURE__*/
120
+ // style must go first since we don't want justifyContent, alignItems overridden
121
+ React.createElement(_reactNative.View, {
122
+ style: [style, {
123
+ justifyContent,
124
+ alignItems
125
+ }],
126
+ ...rest
127
+ }, children)
128
+ );
129
+ }Stack(_ref6) {
109
130
  let {
110
131
  children,
111
132
  justifyContent = "flex-start",
@@ -18,9 +18,7 @@ var _utilities = require("../../utilities");
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
- 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); }
22
21
  const Picker = _ref => {
23
- var _options$find$label, _options$find;
24
22
  let {
25
23
  Icon,
26
24
  style,
@@ -34,6 +32,7 @@ const Picker = _ref => {
34
32
  },
35
33
  ...props
36
34
  } = _ref;
35
+ var _a, _b;
37
36
  const {
38
37
  viewStyles: {
39
38
  borderRadius,
@@ -74,26 +73,24 @@ const Picker = _ref => {
74
73
  };
75
74
 
76
75
  const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
77
- 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);
76
+ 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);
78
77
  return /*#__PURE__*/React.createElement(_reactNative.View, {
79
78
  style: [styles.container, viewStyles]
80
79
  }, /*#__PURE__*/React.createElement(_Touchable.default, {
81
80
  disabled: disabled,
82
81
  onPress: toggleVisibility
83
- }, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
82
+ }, /*#__PURE__*/React.createElement(_TextField.default, {
83
+ ...props,
84
84
  value: String(selectedLabel),
85
- placeholder: placeholder
85
+ placeholder: placeholder,
86
86
  // @ts-ignore
87
- ,
88
- ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
89
- ,
87
+ ref: textField,
90
88
  disabled: disabled,
91
- pointerEvents: "none"
89
+ pointerEvents: "none",
92
90
  // @ts-expect-error
93
- ,
94
91
  style: stylesWithoutMargin,
95
92
  Icon: Icon
96
- }))), pickerVisible && /*#__PURE__*/React.createElement(_Portal.default, null, /*#__PURE__*/React.createElement(_reactNative.View, {
93
+ })), pickerVisible && /*#__PURE__*/React.createElement(_Portal.default, null, /*#__PURE__*/React.createElement(_reactNative.View, {
97
94
  style: [styles.picker, {
98
95
  backgroundColor: colors.divider
99
96
  }]
@@ -138,4 +135,32 @@ const styles = _reactNative.StyleSheet.create({
138
135
  }
139
136
  });
140
137
  var _default = (0, _theming.withTheme)(Picker);
138
+ exports.default = _default;ateElement(_picker.Picker.Item, {
139
+ label: o.label,
140
+ value: o.value,
141
+ key: o.value
142
+ })))))));
143
+ };
144
+ const styles = _reactNative.StyleSheet.create({
145
+ container: {
146
+ alignSelf: "stretch"
147
+ },
148
+ picker: {
149
+ position: "absolute",
150
+ bottom: 0,
151
+ left: 0,
152
+ right: 0,
153
+ flexDirection: "row",
154
+ justifyContent: "center"
155
+ },
156
+ pickerContainer: {
157
+ backgroundColor: "white",
158
+ flexDirection: "column",
159
+ width: "100%"
160
+ },
161
+ closeButton: {
162
+ alignSelf: "flex-end"
163
+ }
164
+ });
165
+ var _default = (0, _theming.withTheme)(Picker);
141
166
  exports.default = _default;
@@ -11,9 +11,6 @@ var _theming = require("../../theming");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
- 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; }
15
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
16
- 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); }
17
14
  /**
18
15
  * Portal allows to render a component at a different place in the parent tree.
19
16
  * You can use it to render content which should appear above other elements, similar to `Modal`.
@@ -35,6 +32,33 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
35
32
  * }
36
33
  * ```
37
34
  */
35
+ class Portal extends React.Component {
36
+ render() {
37
+ const {
38
+ children,
39
+ theme
40
+ } = this.props;
41
+ return /*#__PURE__*/React.createElement(_PortalHost.PortalContext.Consumer, null, manager => /*#__PURE__*/React.createElement(_PortalConsumer.default, {
42
+ manager: manager
43
+ }, /*#__PURE__*/React.createElement(_theming.ThemeProvider, {
44
+ theme: theme
45
+ }, children)));
46
+ }
47
+ }
48
+ // @component ./PortalHost.tsx
49
+ Portal.Host = _PortalHost.default;
50
+ var _default = (0, _theming.withTheme)(Portal);
51
+ exports.default = _default;nent extends React.Component {
52
+ * render() {
53
+ * return (
54
+ * <Portal>
55
+ * <Text>This is rendered at a different place</Text>
56
+ * </Portal>
57
+ * );
58
+ * }
59
+ * }
60
+ * ```
61
+ */
38
62
  class Portal extends React.Component {
39
63
  // @component ./PortalHost.tsx
40
64
 
@@ -7,16 +7,31 @@ exports.default = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
8
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
9
9
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
10
- 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; }
11
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
12
- 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); }
13
10
  class PortalConsumer extends React.Component {
14
- constructor() {
15
- super(...arguments);
16
- _defineProperty(this, "key", void 0);
17
- }
18
11
  async componentDidMount() {
19
12
  this.checkManager();
13
+ // Delay updating to prevent React from going to infinite loop
14
+ await Promise.resolve();
15
+ this.key = this.props.manager.mount(this.props.children);
16
+ }
17
+ componentDidUpdate() {
18
+ this.checkManager();
19
+ this.props.manager.update(this.key, this.props.children);
20
+ }
21
+ componentWillUnmount() {
22
+ this.checkManager();
23
+ this.props.manager.unmount(this.key);
24
+ }
25
+ checkManager() {
26
+ if (!this.props.manager) {
27
+ 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");
28
+ }
29
+ }
30
+ render() {
31
+ return null;
32
+ }
33
+ }
34
+ exports.default = PortalConsumer;s.checkManager();
20
35
 
21
36
  // Delay updating to prevent React from going to infinite loop
22
37
  await Promise.resolve();
@@ -7,7 +7,6 @@ exports.default = Pressable;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- 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); }
11
10
  function Pressable(_ref) {
12
11
  let {
13
12
  children,
@@ -20,8 +19,22 @@ function Pressable(_ref) {
20
19
  style,
21
20
  ...props
22
21
  } = _ref;
23
- return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
22
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
24
23
  onPress: onPress,
24
+ disabled: disabled,
25
+ delayLongPress: delayLongPress ? delayLongPress : 500,
26
+ hitSlop: hitSlop ? hitSlop : 8,
27
+ style: _ref2 => {
28
+ let {
29
+ pressed
30
+ } = _ref2;
31
+ return [{
32
+ opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
33
+ }, style];
34
+ },
35
+ ...props
36
+ }, children);
37
+ } onPress: onPress,
25
38
  disabled: disabled,
26
39
  delayLongPress: delayLongPress ? delayLongPress : 500,
27
40
  hitSlop: hitSlop ? hitSlop : 8,