@draftbit/core 46.6.2 → 46.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +4 -23
  2. package/lib/commonjs/components/AvatarEdit.js +4 -15
  3. package/lib/commonjs/components/Banner.js +4 -23
  4. package/lib/commonjs/components/Button.js +10 -33
  5. package/lib/commonjs/components/Carousel.js +8 -30
  6. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +5 -23
  7. package/lib/commonjs/components/Container.js +4 -15
  8. package/lib/commonjs/components/DatePicker/DatePicker.js +13 -26
  9. package/lib/commonjs/components/DeprecatedCardWrapper.js +1 -15
  10. package/lib/commonjs/components/Divider.js +1 -14
  11. package/lib/commonjs/components/FAB.js +4 -18
  12. package/lib/commonjs/components/IconButton.js +4 -19
  13. package/lib/commonjs/components/Picker/PickerComponent.ios.js +11 -36
  14. package/lib/commonjs/components/Portal/Portal.js +3 -27
  15. package/lib/commonjs/components/Portal/PortalConsumer.js +7 -22
  16. package/lib/commonjs/components/Portal/PortalManager.js +8 -34
  17. package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +1 -9
  18. package/lib/commonjs/components/RadioButton/context.js +1 -1
  19. package/lib/commonjs/components/ScreenContainer.js +4 -20
  20. package/lib/commonjs/components/StarRating.js +4 -23
  21. package/lib/commonjs/components/Surface.js +2 -14
  22. package/lib/commonjs/components/TextField.js +28 -76
  23. package/lib/commonjs/components/ToggleButton.js +2 -15
  24. package/lib/commonjs/constants.js +1 -1
  25. package/lib/commonjs/hooks.js +2 -1
  26. package/lib/commonjs/mappings/StarRating.js +2 -6
  27. package/lib/commonjs/styles/overlay.js +3 -1
  28. package/lib/commonjs/utilities.js +2 -1
  29. package/lib/module/components/AspectRatio.js +1 -18
  30. package/lib/module/components/AvatarEdit.js +4 -15
  31. package/lib/module/components/Banner.js +4 -25
  32. package/lib/module/components/Button.js +10 -33
  33. package/lib/module/components/CardBlock.js +4 -14
  34. package/lib/module/components/CardContainerRating.js +4 -14
  35. package/lib/module/components/CardContainerShortImage.js +4 -18
  36. package/lib/module/components/Carousel.js +32 -8
  37. package/lib/module/components/Checkbox/CheckboxGroup.js +2 -16
  38. package/lib/module/components/Container.js +4 -17
  39. package/lib/module/components/DeprecatedFAB.js +3 -23
  40. package/lib/module/components/Elevation.js +2 -14
  41. package/lib/module/components/FormRow.js +2 -17
  42. package/lib/module/components/Layout.js +21 -42
  43. package/lib/module/components/NumberInput.js +3 -12
  44. package/lib/module/components/Picker/PickerComponent.web.js +21 -3
  45. package/lib/module/components/Portal/Portal.js +3 -28
  46. package/lib/module/components/Portal/PortalConsumer.js +0 -23
  47. package/lib/module/components/Portal/PortalHost.js +15 -45
  48. package/lib/module/components/Portal/PortalManager.js +7 -33
  49. package/lib/module/components/ProgressBar.js +7 -39
  50. package/lib/module/components/RadioButton/RadioButton.js +1 -13
  51. package/lib/module/components/RadioButton/RadioButtonGroup.js +2 -16
  52. package/lib/module/components/RadioButton/RadioButtonRow.js +5 -24
  53. package/lib/module/components/RadioButton/context.js +1 -1
  54. package/lib/module/components/Slider.js +4 -21
  55. package/lib/module/components/StepIndicator.js +18 -58
  56. package/lib/module/components/Surface.js +1 -15
  57. package/lib/module/components/Switch.js +10 -21
  58. package/lib/module/components/TextField.js +28 -78
  59. package/lib/module/constants.js +2 -1
  60. package/lib/module/mappings/FieldSearchBarFull.js +1 -4
  61. package/package.json +4 -4
  62. package/src/Provider.js +9 -0
  63. package/src/components/Accordion/AccordionGroup.js +44 -0
  64. package/src/components/Accordion/AccordionItem.js +32 -0
  65. package/src/components/Accordion/index.js +2 -0
  66. package/src/components/ActionSheet/ActionSheet.js +45 -0
  67. package/src/components/ActionSheet/ActionSheetCancel.js +6 -0
  68. package/src/components/ActionSheet/ActionSheetItem.js +30 -0
  69. package/src/components/ActionSheet/index.js +3 -0
  70. package/src/components/AnimatedCircularProgress.js +43 -0
  71. package/src/components/AspectRatio.js +18 -0
  72. package/src/components/AvatarEdit.js +30 -0
  73. package/src/components/Banner.js +109 -0
  74. package/src/components/Button.js +114 -0
  75. package/src/components/Card.js +57 -0
  76. package/src/components/CardBlock.js +54 -0
  77. package/src/components/CardContainer.js +69 -0
  78. package/src/components/CardContainerRating.js +79 -0
  79. package/src/components/CardContainerShortImage.js +33 -0
  80. package/src/components/CardInline.js +36 -0
  81. package/src/components/Carousel.js +68 -0
  82. package/src/components/Checkbox/Checkbox.js +62 -0
  83. package/src/components/Checkbox/CheckboxGroup.js +21 -0
  84. package/src/components/Checkbox/CheckboxGroupRow.js +76 -0
  85. package/src/components/Checkbox/CheckboxRow.js +77 -0
  86. package/src/components/Checkbox/context.js +14 -0
  87. package/src/components/Checkbox/index.js +3 -0
  88. package/src/components/CircleImage.js +8 -0
  89. package/src/components/CircularProgress.js +81 -0
  90. package/src/components/Config.js +64 -0
  91. package/src/components/Container.js +43 -0
  92. package/src/components/DatePicker/DatePicker.js +377 -0
  93. package/src/components/DatePicker/DatePickerComponent.js +13 -0
  94. package/src/components/DatePicker/DatePickerComponent.web.js +30 -0
  95. package/src/components/DatePicker/DatePickerComponentType.js +1 -0
  96. package/src/components/DeprecatedButton.js +83 -0
  97. package/src/components/DeprecatedCardWrapper.js +18 -0
  98. package/src/components/DeprecatedFAB.js +114 -0
  99. package/src/components/Divider.js +13 -0
  100. package/src/components/Elevation.js +20 -0
  101. package/src/components/FAB.js +46 -0
  102. package/src/components/FieldSearchBarFull.js +53 -0
  103. package/src/components/FormRow.js +19 -0
  104. package/src/components/Header.js +44 -0
  105. package/src/components/HeaderLarge.js +7 -0
  106. package/src/components/HeaderMedium.js +7 -0
  107. package/src/components/HeaderOverline.js +7 -0
  108. package/src/components/IconButton.js +35 -0
  109. package/src/components/Image.js +47 -0
  110. package/src/components/Justification.js +1 -0
  111. package/src/components/Layout.js +50 -0
  112. package/src/components/NumberInput.js +49 -0
  113. package/src/components/Picker/Picker.js +267 -0
  114. package/src/components/Picker/PickerComponent.android.js +69 -0
  115. package/src/components/Picker/PickerComponent.ios.js +79 -0
  116. package/src/components/Picker/PickerComponent.web.js +70 -0
  117. package/src/components/Picker/PickerTypes.js +1 -0
  118. package/src/components/Portal/Portal.js +35 -0
  119. package/src/components/Portal/PortalConsumer.js +27 -0
  120. package/src/components/Portal/PortalHost.js +107 -0
  121. package/src/components/Portal/PortalManager.js +32 -0
  122. package/src/components/Pressable.js +12 -0
  123. package/src/components/ProgressBar.js +118 -0
  124. package/src/components/ProgressCircle.js +13 -0
  125. package/src/components/ProgressIndicator.js +27 -0
  126. package/src/components/RadioButton/RadioButton.js +17 -0
  127. package/src/components/RadioButton/RadioButtonFieldGroup.js +17 -0
  128. package/src/components/RadioButton/RadioButtonGroup.js +43 -0
  129. package/src/components/RadioButton/RadioButtonRow.js +76 -0
  130. package/src/components/RadioButton/context.js +14 -0
  131. package/src/components/RadioButton/index.js +4 -0
  132. package/src/components/ResizeMode.js +1 -0
  133. package/src/components/Row.js +48 -0
  134. package/src/components/RowBodyIcon.js +8 -0
  135. package/src/components/RowHeadlineImageCaption.js +12 -0
  136. package/src/components/RowHeadlineImageIcon.js +14 -0
  137. package/src/components/SVG.js +13 -0
  138. package/src/components/ScreenContainer.js +34 -0
  139. package/src/components/Slider.js +63 -0
  140. package/src/components/StarRating.js +50 -0
  141. package/src/components/StepIndicator.js +346 -0
  142. package/src/components/Stepper.js +41 -0
  143. package/src/components/Surface.js +32 -0
  144. package/src/components/Swiper/Swiper.js +29 -0
  145. package/src/components/Swiper/SwiperItem.js +9 -0
  146. package/src/components/Swiper/index.js +2 -0
  147. package/src/components/Switch.js +56 -0
  148. package/src/components/Text.js +33 -0
  149. package/src/components/TextField.js +428 -0
  150. package/src/components/ToggleButton.js +39 -0
  151. package/src/components/Touchable.js +12 -0
  152. package/src/components/Touchable.web.js +2 -0
  153. package/src/components/Typography.js +36 -0
  154. package/src/components/useAuthState.js +31 -0
  155. package/src/constants.js +10 -0
  156. package/src/hooks.js +12 -0
  157. package/src/index.js +53 -0
  158. package/src/interfaces/Icon.js +8 -0
  159. package/src/mappings/Accordion.js +41 -0
  160. package/src/mappings/AccordionItem.js +16 -0
  161. package/src/mappings/ActionSheet.js +13 -0
  162. package/src/mappings/ActionSheetCancel.js +19 -0
  163. package/src/mappings/ActionSheetItem.js +23 -0
  164. package/src/mappings/ActivityIndicator.js +58 -0
  165. package/src/mappings/AudioPlayer.js +57 -0
  166. package/src/mappings/AvatarEdit.js +38 -0
  167. package/src/mappings/Banner.js +32 -0
  168. package/src/mappings/BlurView.js +42 -0
  169. package/src/mappings/Button.js +116 -0
  170. package/src/mappings/Card.js +52 -0
  171. package/src/mappings/CardBlock.js +123 -0
  172. package/src/mappings/CardContainer.js +104 -0
  173. package/src/mappings/CardContainerRating.js +126 -0
  174. package/src/mappings/CardContainerShortImage.js +120 -0
  175. package/src/mappings/CardInline.js +52 -0
  176. package/src/mappings/Carousel.js +19 -0
  177. package/src/mappings/Checkbox.js +46 -0
  178. package/src/mappings/CheckboxGroup.js +26 -0
  179. package/src/mappings/CheckboxRow.js +61 -0
  180. package/src/mappings/CircleImage.js +25 -0
  181. package/src/mappings/Container.js +30 -0
  182. package/src/mappings/CustomCode.js +8 -0
  183. package/src/mappings/DatePicker.js +176 -0
  184. package/src/mappings/Divider.js +27 -0
  185. package/src/mappings/FAB.js +37 -0
  186. package/src/mappings/Fetch.js +13 -0
  187. package/src/mappings/FieldSearchBarFull.js +50 -0
  188. package/src/mappings/FlashList.js +79 -0
  189. package/src/mappings/FlatList.js +36 -0
  190. package/src/mappings/HeaderLarge.js +29 -0
  191. package/src/mappings/HeaderMedium.js +55 -0
  192. package/src/mappings/HeaderOverline.js +55 -0
  193. package/src/mappings/Icon.js +32 -0
  194. package/src/mappings/IconButton.js +35 -0
  195. package/src/mappings/Image.js +35 -0
  196. package/src/mappings/ImageBackground.js +29 -0
  197. package/src/mappings/KeyboardAvoidingView.js +41 -0
  198. package/src/mappings/KeyboardAwareScrollView.js +50 -0
  199. package/src/mappings/Layout.js +200 -0
  200. package/src/mappings/LinearGradient.js +77 -0
  201. package/src/mappings/MapCallout.js +21 -0
  202. package/src/mappings/MapMarker.js +47 -0
  203. package/src/mappings/MapView.js +139 -0
  204. package/src/mappings/Modal.js +42 -0
  205. package/src/mappings/NumberInput.js +254 -0
  206. package/src/mappings/Picker.js +148 -0
  207. package/src/mappings/ProgressBar.js +101 -0
  208. package/src/mappings/ProgressCircle.js +109 -0
  209. package/src/mappings/ProgressIndicator.js +181 -0
  210. package/src/mappings/RadioButton.js +51 -0
  211. package/src/mappings/RadioButtonGroup.js +17 -0
  212. package/src/mappings/RadioButtonRow.js +42 -0
  213. package/src/mappings/RowBodyIcon.js +75 -0
  214. package/src/mappings/RowHeadlineImageCaption.js +167 -0
  215. package/src/mappings/RowHeadlineImageIcon.js +99 -0
  216. package/src/mappings/SVG.js +20 -0
  217. package/src/mappings/SafeAreaView.js +33 -0
  218. package/src/mappings/ScrollView.js +31 -0
  219. package/src/mappings/Slider.js +60 -0
  220. package/src/mappings/StarRating.js +43 -0
  221. package/src/mappings/Stepper.js +32 -0
  222. package/src/mappings/Surface.js +14 -0
  223. package/src/mappings/Swiper.js +62 -0
  224. package/src/mappings/SwiperItem.js +8 -0
  225. package/src/mappings/Switch.js +81 -0
  226. package/src/mappings/Text.js +251 -0
  227. package/src/mappings/TextArea.js +274 -0
  228. package/src/mappings/TextField.js +391 -0
  229. package/src/mappings/TextInput.js +402 -0
  230. package/src/mappings/ToggleButton.js +50 -0
  231. package/src/mappings/Touchable.js +60 -0
  232. package/src/mappings/Video.js +81 -0
  233. package/src/mappings/View.js +207 -0
  234. package/src/mappings/WebView.js +88 -0
  235. package/src/styles/DarkTheme.js +26 -0
  236. package/src/styles/DefaultTheme.js +111 -0
  237. package/src/styles/fonts.js +62 -0
  238. package/src/styles/overlay.js +60 -0
  239. package/src/styles/shadow.js +51 -0
  240. package/src/theming.js +3 -0
  241. package/src/utilities.js +102 -0
@@ -11,6 +11,7 @@ var _IconButton = _interopRequireDefault(require("./IconButton"));
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 _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
15
  const ToggleButton = _ref => {
15
16
  let {
16
17
  Icon,
@@ -46,7 +47,7 @@ const ToggleButton = _ref => {
46
47
  setInternalValue(!internalValue);
47
48
  onPress(!internalValue);
48
49
  };
49
- return /*#__PURE__*/React.createElement(_IconButton.default, {
50
+ return /*#__PURE__*/React.createElement(_IconButton.default, _extends({
50
51
  Icon: Icon,
51
52
  icon: icon,
52
53
  size: iconSize,
@@ -58,20 +59,6 @@ const ToggleButton = _ref => {
58
59
  height,
59
60
  backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
60
61
  borderColor: colors[borderColor]
61
- }, style],
62
- ...rest
63
- });
64
- };
65
- const styles = _reactNative.StyleSheet.create({
66
- mainContainer: {
67
- borderWidth: 1
68
- }
69
- });
70
- var _default = (0, _theming.withTheme)(ToggleButton);
71
- exports.default = _default;idth,
72
- height,
73
- backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
74
- borderColor: colors[borderColor]
75
62
  }, style]
76
63
  }, rest));
77
64
  };
@@ -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;AR_HEIGHT;
15
+ exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_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
  }
@@ -23,7 +23,9 @@ const SEED_DATA = {
23
23
  }),
24
24
  fieldName: (0, _types.createFieldNameProp)({
25
25
  defaultValue: "ratingValue",
26
+ // this is the name of the variable declared on the screen in Draftbit
26
27
  handlerPropName: "onPress",
28
+ // the change handler prop in this component
27
29
  valuePropName: "rating" // the value prop in this component
28
30
  }),
29
31
 
@@ -48,10 +50,4 @@ const SEED_DATA = {
48
50
  })
49
51
  }
50
52
  };
51
- exports.SEED_DATA = SEED_DATA;pes.createColorProp)({
52
- label: "Inactive Color",
53
- defaultValue: "divider"
54
- })
55
- }
56
- };
57
53
  exports.SEED_DATA = SEED_DATA;
@@ -15,6 +15,7 @@ function overlay(elevation) {
15
15
  let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _DarkTheme.default.colors.surface;
16
16
  if (isAnimatedValue(elevation)) {
17
17
  const inputRange = [0, 1, 2, 3, 8, 24];
18
+
18
19
  // @ts-expect-error: TS doesn't seem to refine the type correctly
19
20
  return elevation.interpolate({
20
21
  inputRange,
@@ -23,6 +24,7 @@ function overlay(elevation) {
23
24
  })
24
25
  });
25
26
  }
27
+
26
28
  // @ts-expect-error: TS doesn't seem to refine the type correctly
27
29
  return calculateColor(surfaceColor, elevation);
28
30
  }
@@ -63,4 +65,4 @@ const elevationOverlayTransparency = {
63
65
  22: 15.72,
64
66
  23: 15.84,
65
67
  24: 16
66
- };};
68
+ };
@@ -57,6 +57,7 @@ function extractBorderAndMarginStyles(style, additionalBorderStyles, additionalM
57
57
  marginStyles
58
58
  };
59
59
  }
60
+
60
61
  /**
61
62
  * Merges a style object on top of another style object. In React Native,
62
63
  * keys with undefined values in a style object will still override styles
@@ -89,4 +90,4 @@ function getValueForRadioButton(value) {
89
90
  } else {
90
91
  throw new Error("Invalid value: ".concat(value));
91
92
  }
92
- }}
93
+ }
@@ -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, StyleSheet } from "react-native";
3
4
  const AspectRatio = props => {
@@ -26,24 +27,6 @@ const AspectRatio = props => {
26
27
  });
27
28
  }
28
29
  }
29
- return /*#__PURE__*/React.createElement(View, {
30
- ...props,
31
- style: style,
32
- onLayout: _ref => {
33
- let {
34
- nativeEvent: {
35
- layout: l
36
- }
37
- } = _ref;
38
- return setLayout(l);
39
- }
40
- }, props.children);
41
- };
42
- export default AspectRatio;idth,
43
- height: width * (1 / aspectRatio)
44
- });
45
- }
46
- }
47
30
  return /*#__PURE__*/React.createElement(View, _extends({}, props, {
48
31
  style: style,
49
32
  onLayout: _ref => {
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { View } from "react-native";
3
4
  import Touchable from "./Touchable";
@@ -22,10 +23,9 @@ const AvatarEdit = _ref => {
22
23
  width: size,
23
24
  height: size
24
25
  };
25
- return /*#__PURE__*/React.createElement(View, {
26
- style: [style, dimensions],
27
- ...rest
28
- }, /*#__PURE__*/React.createElement(Touchable, {
26
+ return /*#__PURE__*/React.createElement(View, _extends({
27
+ style: [style, dimensions]
28
+ }, rest), /*#__PURE__*/React.createElement(Touchable, {
29
29
  onPress: onPress
30
30
  }, /*#__PURE__*/React.createElement(CircleImage, {
31
31
  source: image,
@@ -46,15 +46,4 @@ const AvatarEdit = _ref => {
46
46
  size: size * (3 / 16)
47
47
  }))));
48
48
  };
49
- export default withTheme(AvatarEdit);yles.editBorderColor,
50
- backgroundColor: colorStyles.editBackgroundColor,
51
- borderRadius: size * (3 / 16),
52
- padding: size * (3 / 32)
53
- }
54
- }, /*#__PURE__*/React.createElement(Icon, {
55
- name: "MaterialIcons/edit",
56
- color: colorStyles.editIconColor,
57
- size: size * (3 / 16)
58
- }))));
59
- };
60
49
  export default withTheme(AvatarEdit);
@@ -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 { Button, Text, View, StyleSheet, Animated } from "react-native";
3
4
  import Surface from "./Surface";
@@ -60,6 +61,7 @@ const Banner = _ref => {
60
61
  measured: true
61
62
  });
62
63
  };
64
+
63
65
  // The banner animation has 2 parts:
64
66
  // 1. Blank spacer element which animates its height to move the content
65
67
  // 2. Actual banner which animates its translateY
@@ -69,10 +71,9 @@ const Banner = _ref => {
69
71
  // However we can't animated banner's height directly as it'll also resize the content inside
70
72
  const height = Animated.multiply(position, layout.height);
71
73
  const translateY = Animated.multiply(Animated.add(position, -1), layout.height);
72
- return /*#__PURE__*/React.createElement(Surface, {
73
- ...rest,
74
+ return /*#__PURE__*/React.createElement(Surface, _extends({}, rest, {
74
75
  style: [styles.container, shadow(ELEVATION), style]
75
- }, /*#__PURE__*/React.createElement(View, {
76
+ }), /*#__PURE__*/React.createElement(View, {
76
77
  style: [styles.wrapper, contentStyle]
77
78
  }, /*#__PURE__*/React.createElement(Animated.View, {
78
79
  style: {
@@ -153,26 +154,4 @@ const styles = StyleSheet.create({
153
154
  margin: 8
154
155
  }
155
156
  });
156
- export default withTheme(Banner);
157
- },
158
- content: {
159
- flexDirection: "row",
160
- justifyContent: "flex-start",
161
- marginHorizontal: 8,
162
- marginTop: 16,
163
- marginBottom: 0
164
- },
165
- icon: {
166
- margin: 8
167
- },
168
- message: {
169
- flex: 1,
170
- margin: 8
171
- },
172
- actions: {
173
- flexDirection: "row",
174
- justifyContent: "flex-end",
175
- margin: 8
176
- }
177
- });
178
157
  export default withTheme(Banner);
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { Text, Pressable, Platform, StyleSheet, ActivityIndicator } from "react-native";
3
4
  import { withTheme } from "../theming";
@@ -52,7 +53,7 @@ function Base(_ref) {
52
53
  if (textAlign === "right") {
53
54
  buttonStyles.justifyContent = "flex-end";
54
55
  }
55
- return /*#__PURE__*/React.createElement(Pressable, {
56
+ return /*#__PURE__*/React.createElement(Pressable, _extends({
56
57
  disabled: disabled || loading,
57
58
  style: _ref2 => {
58
59
  let {
@@ -61,9 +62,8 @@ function Base(_ref) {
61
62
  return [styles.base, {
62
63
  opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
63
64
  }, buttonStyles];
64
- },
65
- ...props
66
- }, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
65
+ }
66
+ }, props), loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
67
67
  size: "small",
68
68
  color: color,
69
69
  style: styles.loading
@@ -82,14 +82,13 @@ const Solid = _ref3 => {
82
82
  theme,
83
83
  ...props
84
84
  } = _ref3;
85
- return /*#__PURE__*/React.createElement(Base, {
85
+ return /*#__PURE__*/React.createElement(Base, _extends({
86
86
  style: [{
87
87
  color: "#FFF",
88
88
  borderRadius: theme.roundness,
89
89
  backgroundColor: theme.colors.primary
90
- }, style],
91
- ...props
92
- });
90
+ }, style]
91
+ }, props));
93
92
  };
94
93
  const ButtonSolid = withTheme(Solid);
95
94
  export { ButtonSolid };
@@ -101,14 +100,13 @@ const Outline = _ref4 => {
101
100
  theme,
102
101
  ...props
103
102
  } = _ref4;
104
- return /*#__PURE__*/React.createElement(Base, {
103
+ return /*#__PURE__*/React.createElement(Base, _extends({
105
104
  style: [styles.outline, {
106
105
  borderRadius: theme.roundness,
107
106
  borderColor: theme.colors.primary,
108
107
  color: theme.colors.primary
109
- }, style],
110
- ...props
111
- });
108
+ }, style]
109
+ }, props));
112
110
  };
113
111
  const ButtonOutline = withTheme(Outline);
114
112
  export { ButtonOutline };
@@ -155,25 +153,4 @@ const styles = StyleSheet.create({
155
153
  }
156
154
  })
157
155
  }
158
- });or: "transparent",
159
- padding: 0,
160
- minHeight: undefined
161
- },
162
- loading: {
163
- marginRight: 6
164
- },
165
- icon: {
166
- ...Platform.select({
167
- web: {
168
- marginTop: 1,
169
- marginRight: 4,
170
- alignSelf: "center"
171
- },
172
- default: {
173
- marginBottom: 2,
174
- marginRight: 4,
175
- alignSelf: "center"
176
- }
177
- })
178
- }
179
156
  });
@@ -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, Text } from "react-native";
3
4
  import Image from "./Image";
@@ -41,12 +42,11 @@ const CardBlock = _ref => {
41
42
  const rightDescriptionStyles = [typography.subtitle2, {
42
43
  color: colors.light
43
44
  }];
44
- return /*#__PURE__*/React.createElement(Card, {
45
+ return /*#__PURE__*/React.createElement(Card, _extends({
45
46
  style: style,
46
47
  onPress: onPress,
47
- numColumns: numColumns,
48
- ...rest
49
- }, /*#__PURE__*/React.createElement(View, {
48
+ numColumns: numColumns
49
+ }, rest), /*#__PURE__*/React.createElement(View, {
50
50
  style: {
51
51
  backgroundColor: colors.background
52
52
  }
@@ -95,14 +95,4 @@ const CardBlock = _ref => {
95
95
  style: rightDescriptionStyles
96
96
  }, rightDescription) : null) : null));
97
97
  };
98
- export default withTheme(CardBlock);PURE__*/React.createElement(Text, {
99
- numberOfLines: 1,
100
- style: [typography.body2, {
101
- color: colors.medium
102
- }]
103
- }, leftDescription), rightDescription ? /*#__PURE__*/React.createElement(Text, {
104
- numberOfLines: 1,
105
- style: rightDescriptionStyles
106
- }, rightDescription) : null) : null));
107
- };
108
98
  export default withTheme(CardBlock);
@@ -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, Text } from "react-native";
3
4
  import color from "color";
@@ -41,12 +42,11 @@ const CardContainerRating = _ref => {
41
42
  rightDescriptionStyle = typography.caption;
42
43
  break;
43
44
  }
44
- return /*#__PURE__*/React.createElement(Card, {
45
+ return /*#__PURE__*/React.createElement(Card, _extends({
45
46
  style: style,
46
47
  onPress: onPress,
47
- numColumns: numColumns,
48
- ...rest
49
- }, /*#__PURE__*/React.createElement(Elevation, {
48
+ numColumns: numColumns
49
+ }, rest), /*#__PURE__*/React.createElement(Elevation, {
50
50
  style: {
51
51
  elevation,
52
52
  borderRadius: roundness
@@ -122,14 +122,4 @@ const CardContainerRating = _ref => {
122
122
  color: colors.surface
123
123
  })) : null)));
124
124
  };
125
- export default withTheme(CardContainerRating);ER_PADDING,
126
- borderRadius: ICON_CONTAINER_SIZE,
127
- backgroundColor: color(colors.strong).alpha(Config.cardIconBackgroundOpacity).rgb().string()
128
- }
129
- }, /*#__PURE__*/React.createElement(Icon, {
130
- name: icon,
131
- size: Config.cardIconSize,
132
- color: colors.surface
133
- })) : null)));
134
- };
135
125
  export default withTheme(CardContainerRating);
@@ -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, Text } from "react-native";
3
4
  import Image from "./Image";
@@ -22,11 +23,10 @@ const CardContainerShortImage = _ref => {
22
23
  onPress,
23
24
  ...rest
24
25
  } = _ref;
25
- return /*#__PURE__*/React.createElement(Card, {
26
+ return /*#__PURE__*/React.createElement(Card, _extends({
26
27
  style: style,
27
- onPress: onPress,
28
- ...rest
29
- }, /*#__PURE__*/React.createElement(Elevation, {
28
+ onPress: onPress
29
+ }, rest), /*#__PURE__*/React.createElement(Elevation, {
30
30
  style: {
31
31
  elevation,
32
32
  borderRadius: roundness
@@ -73,18 +73,4 @@ const CardContainerShortImage = _ref => {
73
73
  resizeMode: "cover"
74
74
  }))));
75
75
  };
76
- export default withTheme(CardContainerShortImage);2, {
77
- color: colors.medium,
78
- marginTop: 4
79
- }]
80
- }, subtitle) : null), mode === "right" && /*#__PURE__*/React.createElement(Image, {
81
- style: {
82
- aspectRatio
83
- },
84
- source: typeof image === "string" ? {
85
- uri: image
86
- } : image,
87
- resizeMode: "cover"
88
- }))));
89
- };
90
76
  export default withTheme(CardContainerShortImage);
@@ -1,4 +1,3 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
1
  import * as React from "react";
3
2
  import { withTheme } from "../theming";
4
3
  import { ScrollView, View, StyleSheet, Dimensions } from "react-native";
@@ -30,7 +29,6 @@ function Pager(_ref) {
30
29
  }));
31
30
  }
32
31
  function Carousel(_ref2) {
33
- var _data$length;
34
32
  let {
35
33
  data,
36
34
  children,
@@ -38,9 +36,10 @@ function Carousel(_ref2) {
38
36
  style,
39
37
  ...rest
40
38
  } = _ref2;
39
+ var _a;
41
40
  const [index, setIndex] = React.useState(0);
42
41
  const length = React.Children.count(children);
43
- const itemsLength = ((_data$length = data === null || data === void 0 ? void 0 : data.length) !== null && _data$length !== void 0 ? _data$length : 0) + length;
42
+ const itemsLength = ((_a = data === null || data === void 0 ? void 0 : data.length) !== null && _a !== void 0 ? _a : 0) + length;
44
43
  const slides = Array.isArray(data) ? data : [];
45
44
  const {
46
45
  width,
@@ -48,9 +47,10 @@ function Carousel(_ref2) {
48
47
  } = StyleSheet.flatten(style || {});
49
48
  const slideWidth = width || screenWidth;
50
49
  const slideHeight = height || 250;
51
- return /*#__PURE__*/React.createElement(View, _extends({
52
- style: [styles.container, style]
53
- }, rest), /*#__PURE__*/React.createElement(ScrollView, {
50
+ return /*#__PURE__*/React.createElement(View, {
51
+ style: [styles.container, style],
52
+ ...rest
53
+ }, /*#__PURE__*/React.createElement(ScrollView, {
54
54
  pagingEnabled: true,
55
55
  horizontal: true,
56
56
  decelerationRate: "fast",
@@ -78,8 +78,8 @@ function Carousel(_ref2) {
78
78
  }]
79
79
  });
80
80
  }) : null, React.Children.map(children, child => {
81
- var _child$props;
82
- const s = (child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.style) || {};
81
+ var _a;
82
+ const s = ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.style) || {};
83
83
  return /*#__PURE__*/React.createElement(View, {
84
84
  style: {
85
85
  width: slideWidth
@@ -117,4 +117,28 @@ const styles = StyleSheet.create({
117
117
  backgroundColor: "#000"
118
118
  }
119
119
  });
120
+ export default withTheme(Carousel);gth
121
+ }));
122
+ }
123
+ const styles = StyleSheet.create({
124
+ container: {
125
+ backgroundColor: "#eee"
126
+ },
127
+ pager: {
128
+ position: "absolute",
129
+ bottom: 12,
130
+ left: 0,
131
+ right: 0,
132
+ flexDirection: "row",
133
+ justifyContent: "center",
134
+ alignItems: "center"
135
+ },
136
+ bullet: {
137
+ marginHorizontal: 2,
138
+ width: 10,
139
+ height: 10,
140
+ borderRadius: 20,
141
+ backgroundColor: "#000"
142
+ }
143
+ });
120
144
  export default withTheme(Carousel);
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { View } from "react-native";
3
4
  import { checkboxGroupContext, Direction } from "./context";
@@ -22,22 +23,7 @@ const CheckboxGroup = _ref => {
22
23
  alignItems: "center"
23
24
  });
24
25
  }
25
- return /*#__PURE__*/React.createElement(View, {
26
- style: [{
27
- minHeight: 40
28
- }, style],
29
- ...rest
30
- }, /*#__PURE__*/React.createElement(Provider, {
31
- value: {
32
- values,
33
- onValueChange,
34
- direction
35
- }
36
- }, /*#__PURE__*/React.createElement(View, {
37
- style: _containerStyle
38
- }, children)));
39
- };
40
- export default CheckboxGroup;PURE__*/React.createElement(View, _extends({
26
+ return /*#__PURE__*/React.createElement(View, _extends({
41
27
  style: [{
42
28
  minHeight: 40
43
29
  }, style]
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import * as React from "react";
2
3
  import { View, ImageBackground, StyleSheet } from "react-native";
3
4
  import { withTheme } from "../theming";
@@ -63,10 +64,9 @@ const Container = _ref => {
63
64
  };
64
65
  const Wrap = elevation ? Elevation : View;
65
66
  if (elevation) containerStyle.elevation = elevation;
66
- return /*#__PURE__*/React.createElement(Wrap, {
67
- style: [containerStyle, style],
68
- ...rest
69
- }, backgroundImage ? /*#__PURE__*/React.createElement(ImageBackground, {
67
+ return /*#__PURE__*/React.createElement(Wrap, _extends({
68
+ style: [containerStyle, style]
69
+ }, rest), backgroundImage ? /*#__PURE__*/React.createElement(ImageBackground, {
70
70
  source: typeof backgroundImage === "string" ? {
71
71
  uri: backgroundImage
72
72
  } : backgroundImage,
@@ -80,17 +80,4 @@ const Container = _ref => {
80
80
  style: innerStyle
81
81
  }, children));
82
82
  };
83
- export default withTheme(Container);ring" ? {
84
- uri: backgroundImage
85
- } : backgroundImage,
86
- resizeMode: backgroundImageResizeMode,
87
- style: {
88
- flex: 1
89
- }
90
- }, /*#__PURE__*/React.createElement(View, {
91
- style: innerStyle
92
- }, children)) : /*#__PURE__*/React.createElement(View, {
93
- style: innerStyle
94
- }, children));
95
- };
96
83
  export default withTheme(Container);
@@ -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 { ActivityIndicator, View, StyleSheet, Pressable } from "react-native";
3
4
  import color from "color";
@@ -96,8 +97,7 @@ const FAB = _ref => {
96
97
  style: [{
97
98
  elevation
98
99
  }, style]
99
- }, /*#__PURE__*/React.createElement(Pressable, {
100
- ...rest,
100
+ }, /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
101
101
  onPress: onPress,
102
102
  accessibilityState: {
103
103
  disabled
@@ -105,7 +105,7 @@ const FAB = _ref => {
105
105
  accessibilityRole: "button",
106
106
  disabled: disabled || loading,
107
107
  style: buttonStyles
108
- }, /*#__PURE__*/React.createElement(View, {
108
+ }), /*#__PURE__*/React.createElement(View, {
109
109
  style: styles.content
110
110
  }, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
111
111
  style: iconStyle
@@ -144,24 +144,4 @@ const styles = StyleSheet.create({
144
144
  borderRadius: 0
145
145
  }
146
146
  });
147
- export default withTheme(FAB);le: "solid"
148
- },
149
- content: {
150
- flexDirection: "row",
151
- alignItems: "center",
152
- justifyContent: "center"
153
- },
154
- icon: {
155
- alignItems: "center",
156
- justifyContent: "center",
157
- width: Config.buttonIconSize
158
- },
159
- fixed: {
160
- left: 0,
161
- right: 0,
162
- bottom: 0,
163
- height: 64,
164
- borderRadius: 0
165
- }
166
- });
167
147
  export default withTheme(FAB);
@@ -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 { Animated, StyleSheet, View } from "react-native";
3
4
  import shadow from "../styles/shadow";
@@ -18,20 +19,7 @@ const Elevation = _ref => {
18
19
  colors
19
20
  } = theme;
20
21
  const borderRadius = radius;
21
- return /*#__PURE__*/React.createElement(Animated.View, {
22
- ...rest,
23
- style: [{
24
- borderRadius,
25
- backgroundColor: colors.surface
26
- }, elevation ? shadow(elevation) : null, style]
27
- }, /*#__PURE__*/React.createElement(View, {
28
- style: {
29
- overflow: "hidden",
30
- borderRadius
31
- }
32
- }, children));
33
- };
34
- export default withTheme(Elevation);React.createElement(Animated.View, _extends({}, rest, {
22
+ return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
35
23
  style: [{
36
24
  borderRadius,
37
25
  backgroundColor: colors.surface