@draftbit/core 46.7.3 → 46.7.5

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 (174) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +4 -23
  2. package/lib/commonjs/components/AnimatedCircularProgress.js +1 -12
  3. package/lib/commonjs/components/AvatarEdit.js +4 -15
  4. package/lib/commonjs/components/Button.js +12 -35
  5. package/lib/commonjs/components/Checkbox/Checkbox.js +4 -22
  6. package/lib/commonjs/components/Container.js +4 -15
  7. package/lib/commonjs/components/DeprecatedButton.js +3 -20
  8. package/lib/commonjs/components/DeprecatedCardWrapper.js +1 -15
  9. package/lib/commonjs/components/Elevation.js +14 -2
  10. package/lib/commonjs/components/IconButton.js +4 -2
  11. package/lib/commonjs/components/Image.js +2 -17
  12. package/lib/commonjs/components/NumberInput.js +1 -1
  13. package/lib/commonjs/components/Picker/Picker.js +4 -9
  14. package/lib/commonjs/components/Portal/PortalHost.js +15 -44
  15. package/lib/commonjs/components/Portal/PortalManager.js +8 -34
  16. package/lib/commonjs/components/Pressable.js +2 -2
  17. package/lib/commonjs/components/ProgressBar.js +7 -37
  18. package/lib/commonjs/components/Slider.js +4 -21
  19. package/lib/commonjs/components/Surface.js +2 -14
  20. package/lib/commonjs/components/TextField.js +28 -76
  21. package/lib/commonjs/components/Touchable.js +4 -17
  22. package/lib/commonjs/constants.js +1 -1
  23. package/lib/commonjs/hooks.js +2 -1
  24. package/lib/commonjs/index.js +0 -56
  25. package/lib/commonjs/mappings/Button.js +2 -2
  26. package/lib/commonjs/mappings/FlashList.js +28 -0
  27. package/lib/commonjs/mappings/FlatList.js +14 -0
  28. package/lib/commonjs/mappings/IconButton.js +4 -6
  29. package/lib/commonjs/mappings/MapView.js +3 -1
  30. package/lib/commonjs/mappings/ScrollView.js +7 -1
  31. package/lib/commonjs/mappings/Touchable.js +9 -2
  32. package/lib/commonjs/styles/overlay.js +1 -3
  33. package/lib/commonjs/utilities.js +2 -1
  34. package/lib/module/components/Button.js +12 -35
  35. package/lib/module/components/Checkbox/CheckboxGroupRow.js +5 -24
  36. package/lib/module/components/Checkbox/context.js +1 -1
  37. package/lib/module/components/CircleImage.js +1 -16
  38. package/lib/module/components/DeprecatedCardWrapper.js +1 -18
  39. package/lib/module/components/Divider.js +1 -18
  40. package/lib/module/components/Elevation.js +2 -14
  41. package/lib/module/components/FieldSearchBarFull.js +2 -1
  42. package/lib/module/components/FormRow.js +2 -17
  43. package/lib/module/components/IconButton.js +4 -2
  44. package/lib/module/components/Image.js +2 -18
  45. package/lib/module/components/Layout.js +21 -42
  46. package/lib/module/components/NumberInput.js +4 -13
  47. package/lib/module/components/Picker/PickerComponent.ios.js +11 -36
  48. package/lib/module/components/Portal/PortalConsumer.js +7 -22
  49. package/lib/module/components/Pressable.js +2 -2
  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/Slider.js +4 -21
  54. package/lib/module/components/StepIndicator.js +18 -58
  55. package/lib/module/components/TextField.js +28 -78
  56. package/lib/module/components/ToggleButton.js +2 -16
  57. package/lib/module/components/Touchable.js +4 -17
  58. package/lib/module/constants.js +2 -1
  59. package/lib/module/index.js +0 -8
  60. package/lib/module/mappings/Button.js +2 -2
  61. package/lib/module/mappings/FieldSearchBarFull.js +1 -4
  62. package/lib/module/mappings/FlashList.js +29 -1
  63. package/lib/module/mappings/FlatList.js +15 -1
  64. package/lib/module/mappings/IconButton.js +5 -7
  65. package/lib/module/mappings/MapView.js +3 -1
  66. package/lib/module/mappings/ScrollView.js +8 -2
  67. package/lib/module/mappings/Touchable.js +10 -3
  68. package/lib/module/styles/overlay.js +3 -1
  69. package/lib/module/utilities.js +2 -1
  70. package/lib/typescript/src/components/IconButton.d.ts +2 -0
  71. package/lib/typescript/src/components/IconButton.d.ts.map +1 -1
  72. package/lib/typescript/src/components/Pressable.d.ts.map +1 -1
  73. package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
  74. package/lib/typescript/src/index.d.ts +0 -8
  75. package/lib/typescript/src/index.d.ts.map +1 -1
  76. package/lib/typescript/src/mappings/FlashList.d.ts +60 -0
  77. package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
  78. package/lib/typescript/src/mappings/FlatList.d.ts +30 -0
  79. package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
  80. package/lib/typescript/src/mappings/IconButton.d.ts +20 -10
  81. package/lib/typescript/src/mappings/IconButton.d.ts.map +1 -1
  82. package/lib/typescript/src/mappings/MapView.d.ts +2 -0
  83. package/lib/typescript/src/mappings/MapView.d.ts.map +1 -1
  84. package/lib/typescript/src/mappings/ScrollView.d.ts +21 -0
  85. package/lib/typescript/src/mappings/ScrollView.d.ts.map +1 -1
  86. package/lib/typescript/src/mappings/Touchable.d.ts +20 -0
  87. package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
  88. package/package.json +3 -3
  89. package/src/components/Button.js +1 -1
  90. package/src/components/Button.tsx +2 -2
  91. package/src/components/IconButton.js +2 -2
  92. package/src/components/IconButton.tsx +6 -2
  93. package/src/components/NumberInput.js +1 -1
  94. package/src/components/NumberInput.tsx +1 -1
  95. package/src/components/Pressable.js +1 -1
  96. package/src/components/Pressable.tsx +2 -2
  97. package/src/components/Touchable.js +1 -1
  98. package/src/components/Touchable.tsx +2 -2
  99. package/src/index.js +0 -8
  100. package/src/index.tsx +0 -8
  101. package/src/mappings/Button.js +2 -2
  102. package/src/mappings/Button.ts +2 -2
  103. package/src/mappings/FlashList.js +29 -1
  104. package/src/mappings/FlashList.ts +33 -0
  105. package/src/mappings/FlatList.js +15 -1
  106. package/src/mappings/FlatList.ts +17 -0
  107. package/src/mappings/IconButton.js +5 -7
  108. package/src/mappings/IconButton.ts +5 -7
  109. package/src/mappings/MapView.js +2 -0
  110. package/src/mappings/MapView.ts +2 -0
  111. package/src/mappings/ScrollView.js +8 -2
  112. package/src/mappings/ScrollView.ts +10 -1
  113. package/src/mappings/Touchable.js +10 -3
  114. package/src/mappings/Touchable.ts +12 -2
  115. package/lib/commonjs/components/CardBlock.js +0 -115
  116. package/lib/commonjs/components/CardContainer.js +0 -138
  117. package/lib/commonjs/components/CardContainerRating.js +0 -133
  118. package/lib/commonjs/components/CardContainerShortImage.js +0 -84
  119. package/lib/commonjs/components/CardInline.js +0 -91
  120. package/lib/commonjs/components/Carousel.js +0 -130
  121. package/lib/commonjs/components/Header.js +0 -82
  122. package/lib/commonjs/components/HeaderLarge.js +0 -38
  123. package/lib/commonjs/components/HeaderMedium.js +0 -38
  124. package/lib/commonjs/components/HeaderOverline.js +0 -39
  125. package/lib/module/components/CardBlock.js +0 -108
  126. package/lib/module/components/CardContainer.js +0 -121
  127. package/lib/module/components/CardContainerRating.js +0 -135
  128. package/lib/module/components/CardContainerShortImage.js +0 -90
  129. package/lib/module/components/CardInline.js +0 -82
  130. package/lib/module/components/Carousel.js +0 -120
  131. package/lib/module/components/Header.js +0 -72
  132. package/lib/module/components/HeaderLarge.js +0 -28
  133. package/lib/module/components/HeaderMedium.js +0 -28
  134. package/lib/module/components/HeaderOverline.js +0 -29
  135. package/lib/typescript/src/components/CardBlock.d.ts +0 -21
  136. package/lib/typescript/src/components/CardBlock.d.ts.map +0 -1
  137. package/lib/typescript/src/components/CardContainer.d.ts +0 -23
  138. package/lib/typescript/src/components/CardContainer.d.ts.map +0 -1
  139. package/lib/typescript/src/components/CardContainerRating.d.ts +0 -24
  140. package/lib/typescript/src/components/CardContainerRating.d.ts.map +0 -1
  141. package/lib/typescript/src/components/CardContainerShortImage.d.ts +0 -19
  142. package/lib/typescript/src/components/CardContainerShortImage.d.ts.map +0 -1
  143. package/lib/typescript/src/components/CardInline.d.ts +0 -20
  144. package/lib/typescript/src/components/CardInline.d.ts.map +0 -1
  145. package/lib/typescript/src/components/Carousel.d.ts +0 -15
  146. package/lib/typescript/src/components/Carousel.d.ts.map +0 -1
  147. package/lib/typescript/src/components/Header.d.ts +0 -20
  148. package/lib/typescript/src/components/Header.d.ts.map +0 -1
  149. package/lib/typescript/src/components/HeaderLarge.d.ts +0 -17
  150. package/lib/typescript/src/components/HeaderLarge.d.ts.map +0 -1
  151. package/lib/typescript/src/components/HeaderMedium.d.ts +0 -17
  152. package/lib/typescript/src/components/HeaderMedium.d.ts.map +0 -1
  153. package/lib/typescript/src/components/HeaderOverline.d.ts +0 -17
  154. package/lib/typescript/src/components/HeaderOverline.d.ts.map +0 -1
  155. package/src/components/CardBlock.js +0 -54
  156. package/src/components/CardBlock.tsx +0 -127
  157. package/src/components/CardContainer.js +0 -69
  158. package/src/components/CardContainer.tsx +0 -165
  159. package/src/components/CardContainerRating.js +0 -79
  160. package/src/components/CardContainerRating.tsx +0 -175
  161. package/src/components/CardContainerShortImage.js +0 -33
  162. package/src/components/CardContainerShortImage.tsx +0 -101
  163. package/src/components/CardInline.js +0 -36
  164. package/src/components/CardInline.tsx +0 -93
  165. package/src/components/Carousel.js +0 -68
  166. package/src/components/Carousel.tsx +0 -134
  167. package/src/components/Header.js +0 -44
  168. package/src/components/Header.tsx +0 -105
  169. package/src/components/HeaderLarge.js +0 -7
  170. package/src/components/HeaderLarge.tsx +0 -40
  171. package/src/components/HeaderMedium.js +0 -7
  172. package/src/components/HeaderMedium.tsx +0 -41
  173. package/src/components/HeaderOverline.js +0 -7
  174. package/src/components/HeaderOverline.tsx +0 -42
@@ -8,54 +8,28 @@ var React = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  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); }
10
10
  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; }
11
+ 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; }
12
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
13
+ 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); }
11
14
  /**
12
15
  * Portal host is the component which actually renders all Portals.
13
16
  */
14
17
  class PortalManager extends React.PureComponent {
15
18
  constructor() {
16
19
  super(...arguments);
17
- this.state = {
20
+ _defineProperty(this, "state", {
18
21
  portals: []
19
- };
20
- this.mount = (key, children) => {
22
+ });
23
+ _defineProperty(this, "mount", (key, children) => {
21
24
  this.setState(state => ({
22
25
  portals: [...state.portals, {
23
26
  key,
24
27
  children
25
28
  }]
26
29
  }));
27
- };
28
- this.update = (key, children) => this.setState(state => ({
29
- portals: state.portals.map(item => {
30
- if (item.key === key) {
31
- return {
32
- ...item,
33
- children
34
- };
35
- }
36
- return item;
37
- })
38
- }));
39
- this.unmount = key => this.setState(state => ({
40
- portals: state.portals.filter(item => item.key !== key)
41
- }));
42
- }
43
- render() {
44
- return this.state.portals.map(_ref => {
45
- let {
46
- key,
47
- children
48
- } = _ref;
49
- return /*#__PURE__*/React.createElement(_reactNative.View, {
50
- key: key,
51
- collapsable: false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */,
52
- pointerEvents: "box-none",
53
- style: _reactNative.StyleSheet.absoluteFill
54
- }, children);
55
30
  });
56
- }
57
- }
58
- exports.default = PortalManager;tate.portals.map(item => {
31
+ _defineProperty(this, "update", (key, children) => this.setState(state => ({
32
+ portals: state.portals.map(item => {
59
33
  if (item.key === key) {
60
34
  return {
61
35
  ...item,
@@ -13,8 +13,8 @@ function Pressable(_ref) {
13
13
  children,
14
14
  disabled,
15
15
  onPress,
16
- activeOpacity,
17
- disabledOpacity,
16
+ activeOpacity = 0.8,
17
+ disabledOpacity = 0.8,
18
18
  delayLongPress,
19
19
  hitSlop,
20
20
  style,
@@ -8,12 +8,16 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  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); }
10
10
  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; }
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
+ 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; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
+ 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); }
11
15
  const INDETERMINATE_WIDTH_FACTOR = 0.3;
12
16
  const BAR_WIDTH_ZERO_POSITION = INDETERMINATE_WIDTH_FACTOR / (1 + INDETERMINATE_WIDTH_FACTOR);
13
17
  class ProgressBar extends _react.Component {
14
18
  constructor(props) {
15
19
  super(props);
16
- this.handleLayout = event => {
20
+ _defineProperty(this, "handleLayout", event => {
17
21
  const {
18
22
  width = 150,
19
23
  onLayout
@@ -26,7 +30,7 @@ class ProgressBar extends _react.Component {
26
30
  if (onLayout) {
27
31
  onLayout(event);
28
32
  }
29
- };
33
+ });
30
34
  const {
31
35
  progress: progressP = 0,
32
36
  indeterminate = false
@@ -74,6 +78,7 @@ class ProgressBar extends _react.Component {
74
78
  ...animationConfig,
75
79
  toValue: progress,
76
80
  velocity: 0,
81
+ //adjust this value if animation fails - velocity is required
77
82
  useNativeDriver
78
83
  }).start();
79
84
  } else {
@@ -142,41 +147,6 @@ class ProgressBar extends _react.Component {
142
147
  })
143
148
  }]
144
149
  };
145
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
146
- style: [containerStyle, style],
147
- onLayout: this.handleLayout,
148
- ...restProps
149
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
150
- style: progressStyle
151
- }), children);
152
- }
153
- }
154
- exports.default = ProgressBar;,
155
- overflow: "hidden",
156
- backgroundColor: unfilledColor
157
- };
158
- const progressStyle = {
159
- backgroundColor: color,
160
- // Always take up full height of container.
161
- height: "100%",
162
- transform: [{
163
- translateX: this.state.animationValue.interpolate({
164
- inputRange: [0, 1],
165
- outputRange: [innerWidth * -INDETERMINATE_WIDTH_FACTOR, innerWidth]
166
- })
167
- }, {
168
- translateX: this.state.progress.interpolate({
169
- inputRange: [0, 1],
170
- outputRange: [innerWidth / (_reactNative.I18nManager.isRTL ? 2 : -2), 0]
171
- })
172
- }, {
173
- // Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
174
- scaleX: this.state.progress.interpolate({
175
- inputRange: [0, 1],
176
- outputRange: [0.0001, 1]
177
- })
178
- }]
179
- };
180
150
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
181
151
  style: [containerStyle, style],
182
152
  onLayout: this.handleLayout
@@ -13,6 +13,7 @@ var _theming = require("../theming");
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
+ 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); }
16
17
  function maybeParseValue(value) {
17
18
  if (value === undefined) {
18
19
  return undefined;
@@ -72,10 +73,9 @@ function Slider(_ref) {
72
73
  setInternalValue(newValue);
73
74
  onValueChange(newValue);
74
75
  };
75
- return /*#__PURE__*/React.createElement(_reactNative.View, {
76
- style: [styles.container, style],
77
- ...rest
78
- }, leftIcon ? /*#__PURE__*/React.createElement(Icon, {
76
+ return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
77
+ style: [styles.container, style]
78
+ }, rest), leftIcon ? /*#__PURE__*/React.createElement(Icon, {
79
79
  color: leftIconThemeColor,
80
80
  name: leftIcon,
81
81
  size: 24
@@ -108,21 +108,4 @@ const styles = _reactNative.StyleSheet.create({
108
108
  }
109
109
  });
110
110
  var _default = (0, _theming.withTheme)(Slider);
111
- exports.default = _default;or: rightIconThemeColor,
112
- name: rightIcon,
113
- size: 24
114
- }) : null);
115
- }
116
- const styles = _reactNative.StyleSheet.create({
117
- container: {
118
- height: 40,
119
- flexDirection: "row",
120
- alignItems: "center"
121
- },
122
- slider: {
123
- flex: 1,
124
- marginHorizontal: 12
125
- }
126
- });
127
- var _default = (0, _theming.withTheme)(Slider);
128
111
  exports.default = _default;
@@ -12,8 +12,7 @@ var _theming = require("../theming");
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
  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); }
14
14
  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; }
15
- /* Copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx */
16
-
15
+ 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
  const Surface = _ref => {
18
17
  let {
19
18
  elevation: propElevation,
@@ -43,18 +42,7 @@ const Surface = _ref => {
43
42
  return colors.surface;
44
43
  }
45
44
  };
46
- return /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
47
- ...rest,
48
- style: [{
49
- backgroundColor: getBackgroundColor(),
50
- elevation,
51
- ...evalationStyles,
52
- ...restStyle
53
- }]
54
- }, children);
55
- };
56
- var _default = (0, _theming.withTheme)(Surface);
57
- exports.default = _default;xtends({}, rest, {
45
+ return /*#__PURE__*/React.createElement(_reactNative.Animated.View, _extends({}, rest, {
58
46
  style: [{
59
47
  backgroundColor: getBackgroundColor(),
60
48
  elevation,
@@ -10,6 +10,10 @@ var _theming = require("../theming");
10
10
  var _utilities = require("../utilities");
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
+ 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); }
13
17
  const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
14
18
  const FOCUS_ANIMATION_DURATION = 150;
15
19
  const BLUR_ANIMATION_DURATION = 180;
@@ -17,7 +21,7 @@ const ICON_SIZE = 24;
17
21
  class TextField extends React.Component {
18
22
  constructor() {
19
23
  super(...arguments);
20
- this.state = {
24
+ _defineProperty(this, "state", {
21
25
  nativeProps: {},
22
26
  labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
23
27
  focused: false,
@@ -26,46 +30,47 @@ class TextField extends React.Component {
26
30
  measured: false,
27
31
  width: 0
28
32
  }
29
- };
30
- this._timer = setTimeout(() => {}, 0);
31
- this._showPlaceholder = () => {
33
+ });
34
+ _defineProperty(this, "_timer", setTimeout(() => {}, 0));
35
+ _defineProperty(this, "_showPlaceholder", () => {
32
36
  clearTimeout(this._timer);
37
+
33
38
  // Set the placeholder in a delay to offset the label animation
34
39
  // If we show it immediately, they'll overlap and look ugly
35
40
  this._timer = setTimeout(() => this.setState({
36
41
  placeholder: this.props.placeholder
37
42
  }), 50);
38
- };
39
- this._hidePlaceholder = () => this.setState({
40
- placeholder: ""
41
43
  });
42
- this._restoreLabel = () => _reactNative.Animated.timing(this.state.labeled, {
44
+ _defineProperty(this, "_hidePlaceholder", () => this.setState({
45
+ placeholder: ""
46
+ }));
47
+ _defineProperty(this, "_restoreLabel", () => _reactNative.Animated.timing(this.state.labeled, {
43
48
  toValue: 1,
44
49
  duration: FOCUS_ANIMATION_DURATION,
45
50
  useNativeDriver: true
46
- }).start();
47
- this._minmizeLabel = () => _reactNative.Animated.timing(this.state.labeled, {
51
+ }).start());
52
+ _defineProperty(this, "_minmizeLabel", () => _reactNative.Animated.timing(this.state.labeled, {
48
53
  toValue: 0,
49
54
  duration: BLUR_ANIMATION_DURATION,
50
55
  useNativeDriver: true
51
- }).start();
52
- this._handleFocus = () => {
56
+ }).start());
57
+ _defineProperty(this, "_handleFocus", () => {
53
58
  if (this.props.disabled) {
54
59
  return;
55
60
  }
56
61
  this.setState({
57
62
  focused: true
58
63
  });
59
- };
60
- this._handleBlur = () => {
64
+ });
65
+ _defineProperty(this, "_handleBlur", () => {
61
66
  if (this.props.disabled) {
62
67
  return;
63
68
  }
64
69
  this.setState({
65
70
  focused: false
66
71
  });
67
- };
68
- this._handleChangeText = value => {
72
+ });
73
+ _defineProperty(this, "_handleChangeText", value => {
69
74
  if (this.props.disabled) {
70
75
  return;
71
76
  }
@@ -80,8 +85,8 @@ class TextField extends React.Component {
80
85
  });
81
86
  this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
82
87
  }
83
- };
84
- this._root = undefined;
88
+ });
89
+ _defineProperty(this, "_root", undefined);
85
90
  }
86
91
  static getDerivedStateFromProps(nextProps, prevState) {
87
92
  return {
@@ -168,9 +173,7 @@ class TextField extends React.Component {
168
173
  roundness,
169
174
  disabledOpacity
170
175
  },
171
- render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, {
172
- ...props
173
- }),
176
+ render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, props),
174
177
  ...rest
175
178
  } = this.props;
176
179
  const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
@@ -310,10 +313,9 @@ class TextField extends React.Component {
310
313
  } = _reactNative.StyleSheet.flatten(style || {});
311
314
  return /*#__PURE__*/React.createElement(_reactNative.View, {
312
315
  style: [styles.container, styleProp]
313
- }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
314
- ...leftIconProps,
316
+ }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
315
317
  style: leftIconStyle
316
- }) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
318
+ })) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
317
319
  style: (0, _utilities.applyStyles)([containerStyle], {
318
320
  height: style === null || style === void 0 ? void 0 : style.height,
319
321
  backgroundColor: bgColor,
@@ -381,10 +383,9 @@ class TextField extends React.Component {
381
383
  style: {
382
384
  justifyContent: type === "solid" ? "center" : undefined
383
385
  }
384
- }, /*#__PURE__*/React.createElement(Icon, {
385
- ...leftIconProps,
386
+ }, /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
386
387
  style: leftIconStyle
387
- })) : null, render({
388
+ }))) : null, render({
388
389
  ref: c => {
389
390
  this._root = c;
390
391
  },
@@ -422,55 +423,6 @@ class TextField extends React.Component {
422
423
  }
423
424
  var _default = (0, _theming.withTheme)(TextField);
424
425
  exports.default = _default;
425
- const styles = _reactNative.StyleSheet.create({
426
- container: {
427
- alignSelf: "stretch"
428
- },
429
- placeholder: {
430
- position: "absolute",
431
- left: 0
432
- },
433
- underline: {
434
- position: "absolute",
435
- left: 0,
436
- right: 0,
437
- bottom: 0,
438
- height: 2
439
- },
440
- input: {
441
- flexGrow: 1,
442
- justifyContent: "center",
443
- textAlignVertical: "center",
444
- margin: 0,
445
- textAlign: _reactNative.I18nManager.isRTL ? "right" : "left"
446
- }
447
- });_handleFocus,
448
- onBlur: this._handleBlur,
449
- underlineColorAndroid: "transparent",
450
- style: inputStyles,
451
- ...rest,
452
- ...this.state.nativeProps,
453
- value: this.state.value
454
- })), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
455
- name: rightIconName,
456
- size: ICON_SIZE,
457
- color: colors.light,
458
- style: {
459
- position: "absolute",
460
- right: 16,
461
- marginTop: type === "solid" ? MINIMIZED_LABEL_FONT_SIZE + 4 : 16
462
- }
463
- }) : null, assistiveText ? /*#__PURE__*/React.createElement(_reactNative.Text, {
464
- style: [{
465
- color: error ? colors.error : colors.light,
466
- marginTop: 8,
467
- marginLeft: assistiveTextLeftMargin
468
- }]
469
- }, assistiveText) : null);
470
- }
471
- }
472
- var _default = (0, _theming.withTheme)(TextField);
473
- exports.default = _default;
474
426
  const styles = _reactNative.StyleSheet.create({
475
427
  container: {
476
428
  alignSelf: "stretch"
@@ -7,34 +7,21 @@ exports.default = Touchable;
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); }
10
11
  function Touchable(_ref) {
11
12
  let {
12
13
  children,
13
14
  disabled,
14
15
  onPress,
15
- activeOpacity,
16
- disabledOpacity,
16
+ activeOpacity = 0.8,
17
+ disabledOpacity = 0.8,
17
18
  delayLongPress,
18
19
  hitSlop,
19
20
  style,
20
21
  ...props
21
22
  } = _ref;
22
- return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
23
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
23
24
  disabled: disabled,
24
- onPress: onPress,
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
- } disabled: disabled,
38
25
  onPress: onPress,
39
26
  delayLongPress: delayLongPress ? delayLongPress : 500,
40
27
  hitSlop: hitSlop ? hitSlop : 8,
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
12
12
  android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
13
13
  ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
14
14
  });
15
- exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
15
+ exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;AR_HEIGHT;
@@ -10,11 +10,12 @@ function usePrevious(value) {
10
10
  // The ref object is a generic container whose current property is mutable
11
11
  // and can hold any value, similar to an instance property on a class
12
12
  const ref = _react.default.useRef();
13
+
13
14
  // Store current value in ref
14
15
  _react.default.useEffect(() => {
15
16
  ref.current = value;
16
17
  }, [value]);
18
+
17
19
  // Return previous value (happens before update in useEffect above)
18
20
  return ref.current;
19
- }
20
21
  }
@@ -75,36 +75,6 @@ Object.defineProperty(exports, "Card", {
75
75
  return _Card.default;
76
76
  }
77
77
  });
78
- Object.defineProperty(exports, "CardBlock", {
79
- enumerable: true,
80
- get: function () {
81
- return _CardBlock.default;
82
- }
83
- });
84
- Object.defineProperty(exports, "CardContainer", {
85
- enumerable: true,
86
- get: function () {
87
- return _CardContainer.default;
88
- }
89
- });
90
- Object.defineProperty(exports, "CardContainerRating", {
91
- enumerable: true,
92
- get: function () {
93
- return _CardContainerRating.default;
94
- }
95
- });
96
- Object.defineProperty(exports, "CardInline", {
97
- enumerable: true,
98
- get: function () {
99
- return _CardInline.default;
100
- }
101
- });
102
- Object.defineProperty(exports, "Carousel", {
103
- enumerable: true,
104
- get: function () {
105
- return _Carousel.default;
106
- }
107
- });
108
78
  Object.defineProperty(exports, "Center", {
109
79
  enumerable: true,
110
80
  get: function () {
@@ -177,24 +147,6 @@ Object.defineProperty(exports, "FieldSearchBarFull", {
177
147
  return _FieldSearchBarFull.default;
178
148
  }
179
149
  });
180
- Object.defineProperty(exports, "HeaderLarge", {
181
- enumerable: true,
182
- get: function () {
183
- return _HeaderLarge.default;
184
- }
185
- });
186
- Object.defineProperty(exports, "HeaderMedium", {
187
- enumerable: true,
188
- get: function () {
189
- return _HeaderMedium.default;
190
- }
191
- });
192
- Object.defineProperty(exports, "HeaderOverline", {
193
- enumerable: true,
194
- get: function () {
195
- return _HeaderOverline.default;
196
- }
197
- });
198
150
  Object.defineProperty(exports, "IconButton", {
199
151
  enumerable: true,
200
152
  get: function () {
@@ -427,7 +379,6 @@ var _Button = require("./components/Button");
427
379
  var _CircleImage = _interopRequireDefault(require("./components/CircleImage"));
428
380
  var _AvatarEdit = _interopRequireDefault(require("./components/AvatarEdit"));
429
381
  var _Card = _interopRequireDefault(require("./components/Card"));
430
- var _Carousel = _interopRequireDefault(require("./components/Carousel"));
431
382
  var _Checkbox = require("./components/Checkbox");
432
383
  var _Container = _interopRequireDefault(require("./components/Container"));
433
384
  var _Divider = _interopRequireDefault(require("./components/Divider"));
@@ -450,14 +401,7 @@ var _ActionSheet = require("./components/ActionSheet");
450
401
  var _Swiper = require("./components/Swiper");
451
402
  var _Layout = require("./components/Layout");
452
403
  var _index = require("./components/RadioButton/index");
453
- var _CardBlock = _interopRequireDefault(require("./components/CardBlock"));
454
- var _CardContainer = _interopRequireDefault(require("./components/CardContainer"));
455
- var _CardContainerRating = _interopRequireDefault(require("./components/CardContainerRating"));
456
- var _CardInline = _interopRequireDefault(require("./components/CardInline"));
457
404
  var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
458
- var _HeaderLarge = _interopRequireDefault(require("./components/HeaderLarge"));
459
- var _HeaderMedium = _interopRequireDefault(require("./components/HeaderMedium"));
460
- var _HeaderOverline = _interopRequireDefault(require("./components/HeaderOverline"));
461
405
  var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
462
406
  var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
463
407
  var _ProgressCircle = _interopRequireDefault(require("./components/ProgressCircle"));
@@ -23,7 +23,7 @@ const SEED_DATA_PROPS = {
23
23
  activeOpacity: (0, _types.createStaticNumberProp)({
24
24
  label: "Active Opacity",
25
25
  description: "Opacity of the button when active.",
26
- defaultValue: 0.8,
26
+ defaultValue: null,
27
27
  min: 0,
28
28
  max: 1,
29
29
  step: 0.01,
@@ -33,7 +33,7 @@ const SEED_DATA_PROPS = {
33
33
  disabledOpacity: (0, _types.createStaticNumberProp)({
34
34
  label: "Disabled Opacity",
35
35
  description: "Opacity of the button when disabled.",
36
- defaultValue: 0.8,
36
+ defaultValue: null,
37
37
  min: 0,
38
38
  max: 1,
39
39
  step: 0.01,
@@ -39,6 +39,20 @@ const SEED_DATA = [{
39
39
  label: "End Reached Threshold",
40
40
  description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
41
41
  defaultValue: 0.5
42
+ }),
43
+ refreshColor: (0, _types.createColorProp)({
44
+ label: "Refreshing Color",
45
+ description: "Color of the refresh indicator"
46
+ }),
47
+ showsHorizontalScrollIndicator: (0, _types.createStaticBoolProp)({
48
+ label: "Show Horizontal Scroll Indicator",
49
+ description: "When true, shows a horizontal scroll indicator. The default value is true.",
50
+ defaultValue: true
51
+ }),
52
+ showsVerticalScrollIndicator: (0, _types.createStaticBoolProp)({
53
+ label: "Show Vertical Scroll Indicator",
54
+ description: "When true, shows a vertical scroll indicator. The default value is true.",
55
+ defaultValue: true
42
56
  })
43
57
  }
44
58
  }, {
@@ -83,6 +97,20 @@ const SEED_DATA = [{
83
97
  label: "End Reached Threshold",
84
98
  description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
85
99
  defaultValue: 0.5
100
+ }),
101
+ refreshColor: (0, _types.createColorProp)({
102
+ label: "Refreshing Color",
103
+ description: "Color of the refresh indicator"
104
+ }),
105
+ showsHorizontalScrollIndicator: (0, _types.createStaticBoolProp)({
106
+ label: "Show Horizontal Scroll Indicator",
107
+ description: "When true, shows a horizontal scroll indicator. The default value is true.",
108
+ defaultValue: true
109
+ }),
110
+ showsVerticalScrollIndicator: (0, _types.createStaticBoolProp)({
111
+ label: "Show Vertical Scroll Indicator",
112
+ description: "When true, shows a vertical scroll indicator. The default value is true.",
113
+ defaultValue: true
86
114
  })
87
115
  }
88
116
  }];
@@ -38,6 +38,20 @@ const SEED_DATA = {
38
38
  label: "End Reached Threshold",
39
39
  description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
40
40
  defaultValue: 0.5
41
+ }),
42
+ refreshColor: (0, _types.createColorProp)({
43
+ label: "Refreshing Color",
44
+ description: "Color of the refresh indicator"
45
+ }),
46
+ showsHorizontalScrollIndicator: (0, _types.createStaticBoolProp)({
47
+ label: "Show Horizontal Scroll Indicator",
48
+ description: "When true, shows a horizontal scroll indicator. The default value is true.",
49
+ defaultValue: true
50
+ }),
51
+ showsVerticalScrollIndicator: (0, _types.createStaticBoolProp)({
52
+ label: "Show Vertical Scroll Indicator",
53
+ description: "When true, shows a vertical scroll indicator. The default value is true.",
54
+ defaultValue: true
41
55
  })
42
56
  }
43
57
  };