@draftbit/core 46.10.3-106fd0.2 → 46.10.3-17bcb4.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 (147) hide show
  1. package/lib/commonjs/components/AvatarEdit.js +15 -4
  2. package/lib/commonjs/components/Banner.js +23 -4
  3. package/lib/commonjs/components/Checkbox/Checkbox.js +3 -4
  4. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
  5. package/lib/commonjs/components/CircularProgress.js +26 -8
  6. package/lib/commonjs/components/DeprecatedButton.js +20 -3
  7. package/lib/commonjs/components/DeprecatedCardWrapper.js +54 -0
  8. package/lib/commonjs/components/DeprecatedFAB.js +157 -0
  9. package/lib/commonjs/components/Elevation.js +14 -2
  10. package/lib/commonjs/components/FormRow.js +16 -2
  11. package/lib/commonjs/components/IconButton.js +19 -4
  12. package/lib/commonjs/components/Layout.js +40 -19
  13. package/lib/commonjs/components/NumberInput.js +12 -3
  14. package/lib/commonjs/components/Picker/Picker.js +9 -6
  15. package/lib/commonjs/components/Picker/PickerComponent.web.js +20 -3
  16. package/lib/commonjs/components/Portal/Portal.js +27 -3
  17. package/lib/commonjs/components/Portal/PortalHost.js +44 -15
  18. package/lib/commonjs/components/Pressable.js +15 -2
  19. package/lib/commonjs/components/ProgressIndicator.js +55 -0
  20. package/lib/commonjs/components/RadioButton/RadioButton.js +13 -2
  21. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +15 -2
  22. package/lib/commonjs/components/RadioButton/context.js +1 -1
  23. package/lib/commonjs/components/ResizeMode.js +5 -0
  24. package/lib/commonjs/components/ScreenContainer.js +24 -6
  25. package/lib/commonjs/components/Slider.js +21 -4
  26. package/lib/commonjs/components/StarRating.js +23 -4
  27. package/lib/commonjs/components/StepIndicator.js +57 -18
  28. package/lib/commonjs/components/Surface.js +14 -2
  29. package/lib/commonjs/components/Switch.js +19 -10
  30. package/lib/commonjs/components/Table/Table.js +11 -10
  31. package/lib/commonjs/components/Table/TableCell.js +3 -3
  32. package/lib/commonjs/components/Table/TableCommon.js +30 -0
  33. package/lib/commonjs/components/Table/TableRow.js +4 -4
  34. package/lib/commonjs/components/Table/index.js +3 -27
  35. package/lib/commonjs/components/ToggleButton.js +15 -2
  36. package/lib/commonjs/constants.js +1 -1
  37. package/lib/commonjs/hooks.js +1 -2
  38. package/lib/commonjs/mappings/CardBlock.js +126 -0
  39. package/lib/commonjs/mappings/CardContainer.js +108 -0
  40. package/lib/commonjs/mappings/CardContainerRating.js +130 -0
  41. package/lib/commonjs/mappings/CardContainerShortImage.js +124 -0
  42. package/lib/commonjs/mappings/CardInline.js +59 -0
  43. package/lib/commonjs/mappings/ProgressIndicator.js +188 -0
  44. package/lib/commonjs/styles/overlay.js +1 -3
  45. package/lib/module/components/AnimatedCircularProgress.js +13 -1
  46. package/lib/module/components/AspectRatio.js +1 -18
  47. package/lib/module/components/AvatarEdit.js +15 -4
  48. package/lib/module/components/Banner.js +25 -4
  49. package/lib/module/components/Button.js +33 -10
  50. package/lib/module/components/Checkbox/CheckboxGroupRow.js +24 -5
  51. package/lib/module/components/Checkbox/CheckboxRow.js +24 -6
  52. package/lib/module/components/Checkbox/context.js +1 -1
  53. package/lib/module/components/CircleImage.js +1 -16
  54. package/lib/module/components/DatePicker/DatePicker.js +27 -13
  55. package/lib/module/components/DeprecatedButton.js +3 -21
  56. package/lib/module/components/DeprecatedCardWrapper.js +32 -0
  57. package/lib/module/components/DeprecatedFAB.js +167 -0
  58. package/lib/module/components/Divider.js +18 -1
  59. package/lib/module/components/IconButton.js +4 -21
  60. package/lib/module/components/Layout.js +42 -21
  61. package/lib/module/components/Picker/PickerComponent.android.js +21 -3
  62. package/lib/module/components/Portal/PortalConsumer.js +22 -7
  63. package/lib/module/components/Pressable.js +2 -15
  64. package/lib/module/components/ProgressIndicator.js +45 -0
  65. package/lib/module/components/RadioButton/RadioButton.js +13 -1
  66. package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +10 -1
  67. package/lib/module/components/RadioButton/context.js +1 -1
  68. package/lib/module/components/ResizeMode.js +1 -0
  69. package/lib/module/components/Shadow.js +2 -15
  70. package/lib/module/components/StepIndicator.js +58 -18
  71. package/lib/module/components/Surface.js +15 -1
  72. package/lib/module/components/Switch.js +21 -10
  73. package/lib/module/components/TabView/TabView.js +17 -7
  74. package/lib/module/components/TabView/TabViewItem.js +4 -3
  75. package/lib/module/components/Table/Table.js +12 -11
  76. package/lib/module/components/Table/TableCell.js +1 -1
  77. package/lib/module/components/Table/TableCommon.js +21 -0
  78. package/lib/module/components/Table/TableRow.js +3 -2
  79. package/lib/module/components/Table/index.js +1 -22
  80. package/lib/module/components/TextField.js +78 -28
  81. package/lib/module/mappings/CardBlock.js +119 -0
  82. package/lib/module/mappings/CardContainer.js +101 -0
  83. package/lib/module/mappings/CardContainerRating.js +123 -0
  84. package/lib/module/mappings/CardContainerShortImage.js +117 -0
  85. package/lib/module/mappings/CardInline.js +52 -0
  86. package/lib/module/mappings/ProgressIndicator.js +181 -0
  87. package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts +15 -0
  88. package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +1 -0
  89. package/lib/typescript/src/components/DeprecatedFAB.d.ts +56 -0
  90. package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -0
  91. package/lib/typescript/src/components/ProgressIndicator.d.ts +24 -0
  92. package/lib/typescript/src/components/ProgressIndicator.d.ts.map +1 -0
  93. package/lib/typescript/src/components/ResizeMode.d.ts +2 -0
  94. package/lib/typescript/src/components/ResizeMode.d.ts.map +1 -0
  95. package/lib/typescript/src/components/Table/Table.d.ts +7 -2
  96. package/lib/typescript/src/components/Table/Table.d.ts.map +1 -1
  97. package/lib/typescript/src/components/Table/TableCell.d.ts +1 -1
  98. package/lib/typescript/src/components/Table/TableCell.d.ts.map +1 -1
  99. package/lib/typescript/src/components/Table/TableCommon.d.ts +20 -0
  100. package/lib/typescript/src/components/Table/TableCommon.d.ts.map +1 -0
  101. package/lib/typescript/src/components/Table/TableRow.d.ts +1 -1
  102. package/lib/typescript/src/components/Table/TableRow.d.ts.map +1 -1
  103. package/lib/typescript/src/components/Table/index.d.ts +1 -19
  104. package/lib/typescript/src/components/Table/index.d.ts.map +1 -1
  105. package/lib/typescript/src/mappings/CardBlock.d.ts +289 -0
  106. package/lib/typescript/src/mappings/CardBlock.d.ts.map +1 -0
  107. package/lib/typescript/src/mappings/CardContainer.d.ts +102 -0
  108. package/lib/typescript/src/mappings/CardContainer.d.ts.map +1 -0
  109. package/lib/typescript/src/mappings/CardContainerRating.d.ts +108 -0
  110. package/lib/typescript/src/mappings/CardContainerRating.d.ts.map +1 -0
  111. package/lib/typescript/src/mappings/CardContainerShortImage.d.ts +139 -0
  112. package/lib/typescript/src/mappings/CardContainerShortImage.d.ts.map +1 -0
  113. package/lib/typescript/src/mappings/CardInline.d.ts +62 -0
  114. package/lib/typescript/src/mappings/CardInline.d.ts.map +1 -0
  115. package/lib/typescript/src/mappings/ProgressIndicator.d.ts +181 -0
  116. package/lib/typescript/src/mappings/ProgressIndicator.d.ts.map +1 -0
  117. package/package.json +3 -3
  118. package/src/components/DeprecatedCardWrapper.js +18 -0
  119. package/src/components/DeprecatedCardWrapper.tsx +46 -0
  120. package/src/components/DeprecatedFAB.js +114 -0
  121. package/src/components/DeprecatedFAB.tsx +231 -0
  122. package/src/components/ProgressIndicator.js +27 -0
  123. package/src/components/ProgressIndicator.tsx +71 -0
  124. package/src/components/ResizeMode.js +1 -0
  125. package/src/components/ResizeMode.ts +7 -0
  126. package/src/components/Table/Table.js +4 -2
  127. package/src/components/Table/Table.tsx +9 -3
  128. package/src/components/Table/TableCell.js +1 -1
  129. package/src/components/Table/TableCell.tsx +5 -1
  130. package/src/components/Table/TableCommon.js +12 -0
  131. package/src/components/Table/TableCommon.ts +40 -0
  132. package/src/components/Table/TableRow.js +1 -1
  133. package/src/components/Table/TableRow.tsx +1 -1
  134. package/src/components/Table/index.js +1 -13
  135. package/src/components/Table/index.tsx +1 -42
  136. package/src/mappings/CardBlock.js +123 -0
  137. package/src/mappings/CardBlock.ts +136 -0
  138. package/src/mappings/CardContainer.js +104 -0
  139. package/src/mappings/CardContainer.ts +116 -0
  140. package/src/mappings/CardContainerRating.js +126 -0
  141. package/src/mappings/CardContainerRating.ts +137 -0
  142. package/src/mappings/CardContainerShortImage.js +120 -0
  143. package/src/mappings/CardContainerShortImage.ts +130 -0
  144. package/src/mappings/CardInline.js +52 -0
  145. package/src/mappings/CardInline.ts +61 -0
  146. package/src/mappings/ProgressIndicator.js +181 -0
  147. package/src/mappings/ProgressIndicator.ts +190 -0
@@ -0,0 +1,45 @@
1
+ import * as React from "react";
2
+ import StepIndicator from "./StepIndicator";
3
+ import { withTheme } from "../theming";
4
+ const ProgressIndicator = _ref => {
5
+ let {
6
+ numberOfSteps,
7
+ currentStep,
8
+ currentStepStrokeWidth = 3,
9
+ stepStrokeCurrentColor = "primary",
10
+ stepIndicatorSize,
11
+ currentStepIndicatorSize,
12
+ stepIndicatorCurrentColor,
13
+ stepIndicatorLabelCurrentColor,
14
+ stepIndicatorLabelFontSize = 12,
15
+ stepNumberFinishedColor = "strongInverse",
16
+ stepNumberUnfinishedColor = "primary",
17
+ unfinishedColor = "light",
18
+ finishedColor = "primary",
19
+ theme
20
+ } = _ref;
21
+ const currentPosition = currentStep - 1;
22
+ return /*#__PURE__*/React.createElement(StepIndicator, {
23
+ stepCount: numberOfSteps,
24
+ currentPosition: currentPosition,
25
+ customStyles: {
26
+ stepIndicatorSize,
27
+ currentStepIndicatorSize: currentStepIndicatorSize ? currentStepIndicatorSize : stepIndicatorSize,
28
+ stepStrokeFinishedColor: finishedColor,
29
+ stepStrokeUnFinishedColor: unfinishedColor,
30
+ separatorFinishedColor: finishedColor,
31
+ separatorUnFinishedColor: unfinishedColor,
32
+ stepIndicatorFinishedColor: finishedColor,
33
+ stepIndicatorUnFinishedColor: unfinishedColor,
34
+ currentStepStrokeWidth,
35
+ stepStrokeCurrentColor: stepStrokeCurrentColor || stepIndicatorCurrentColor,
36
+ stepIndicatorLabelUnFinishedColor: stepNumberUnfinishedColor,
37
+ stepIndicatorLabelFinishedColor: stepNumberFinishedColor,
38
+ stepIndicatorCurrentColor: stepIndicatorCurrentColor || unfinishedColor,
39
+ stepIndicatorLabelCurrentColor: stepIndicatorLabelCurrentColor || stepNumberUnfinishedColor,
40
+ stepIndicatorLabelFontSize,
41
+ labelFontFamily: theme.typography.body1.fontFamily
42
+ }
43
+ });
44
+ };
45
+ export default withTheme(ProgressIndicator);
@@ -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 Config from "../Config";
4
3
  import IconButton from "../IconButton";
@@ -30,6 +29,19 @@ const RadioButton = _ref => {
30
29
  onPress === null || onPress === void 0 ? void 0 : onPress(realValue);
31
30
  onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
32
31
  };
32
+ return /*#__PURE__*/React.createElement(IconButton, {
33
+ Icon: Icon,
34
+ icon: isSelected ? selectedIcon : unselectedIcon,
35
+ color: isSelected ? color : unselectedColor,
36
+ disabled: disabled,
37
+ onPress: handlePress,
38
+ size: size,
39
+ style: style,
40
+ ...rest
41
+ });
42
+ };
43
+ export default RadioButton;: onValueChange(realValue);
44
+ };
33
45
  return /*#__PURE__*/React.createElement(IconButton, _extends({
34
46
  Icon: Icon,
35
47
  icon: isSelected ? selectedIcon : unselectedIcon,
@@ -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 React from "react";
3
2
  import { View } from "react-native";
4
3
  import Text from "../Text";
@@ -20,6 +19,16 @@ const RadioButtonFieldGroup = _ref => {
20
19
  fontSize: theme.typography.headline4.fontSize,
21
20
  color: theme.typography.headline4.color
22
21
  }, labelStyle]
22
+ }, label), /*#__PURE__*/React.createElement(RadioButtonGroup, {
23
+ theme: theme,
24
+ ...rest
25
+ }, children));
26
+ };
27
+ export default withTheme(RadioButtonFieldGroup);}, /*#__PURE__*/React.createElement(Text, {
28
+ style: [{
29
+ fontSize: theme.typography.headline4.fontSize,
30
+ color: theme.typography.headline4.color
31
+ }, labelStyle]
23
32
  }, label), /*#__PURE__*/React.createElement(RadioButtonGroup, _extends({
24
33
  theme: theme
25
34
  }, rest), children));
@@ -1,5 +1,5 @@
1
1
  import { createContext, useContext } from "react";
2
- export let Direction;
2
+ export var Direction;
3
3
  (function (Direction) {
4
4
  Direction["Horizontal"] = "horizontal";
5
5
  Direction["Vertical"] = "vertical";
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  import React from "react";
2
3
  import { Shadow as ShadowComponent } from "react-native-shadow-2";
3
4
  const Shadow = _ref => {
@@ -16,7 +17,7 @@ const Shadow = _ref => {
16
17
  style,
17
18
  ...rest
18
19
  } = _ref;
19
- return /*#__PURE__*/React.createElement(ShadowComponent, {
20
+ return /*#__PURE__*/React.createElement(ShadowComponent, _extends({
20
21
  offset: [offsetX, offsetY],
21
22
  sides: {
22
23
  start: showShadowSideStart,
@@ -31,20 +32,6 @@ const Shadow = _ref => {
31
32
  bottomEnd: showShadowCornerBottomEnd
32
33
  },
33
34
  containerStyle: style,
34
- paintInside: paintInside,
35
- ...rest
36
- });
37
- };
38
- export default Shadow;hadowSideTop,
39
- bottom: showShadowSideBottom
40
- },
41
- corners: {
42
- topStart: showShadowCornerTopStart,
43
- topEnd: showShadowCornerTopEnd,
44
- bottomStart: showShadowCornerBottomStart,
45
- bottomEnd: showShadowCornerBottomEnd
46
- },
47
- containerStyle: style,
48
35
  paintInside: paintInside
49
36
  }, rest));
50
37
  };
@@ -1,6 +1,3 @@
1
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
1
  // @ts-nocheck
5
2
  import React, { Component } from "react";
6
3
  import { View, Text, StyleSheet, Animated, TouchableWithoutFeedback } from "react-native";
@@ -12,7 +9,7 @@ const STEP_STATUS = {
12
9
  export default class StepIndicator extends Component {
13
10
  constructor(props) {
14
11
  super(props);
15
- _defineProperty(this, "renderProgressBarBackground", () => {
12
+ this.renderProgressBarBackground = () => {
16
13
  const {
17
14
  stepCount,
18
15
  direction
@@ -55,8 +52,8 @@ export default class StepIndicator extends Component {
55
52
  },
56
53
  style: progressBarBackgroundStyle
57
54
  });
58
- });
59
- _defineProperty(this, "renderProgressBar", () => {
55
+ };
56
+ this.renderProgressBar = () => {
60
57
  const {
61
58
  stepCount,
62
59
  direction
@@ -86,8 +83,8 @@ export default class StepIndicator extends Component {
86
83
  return /*#__PURE__*/React.createElement(Animated.View, {
87
84
  style: progressBarStyle
88
85
  });
89
- });
90
- _defineProperty(this, "renderStepIndicator", () => {
86
+ };
87
+ this.renderStepIndicator = () => {
91
88
  let steps = [];
92
89
  const {
93
90
  stepCount,
@@ -118,8 +115,8 @@ export default class StepIndicator extends Component {
118
115
  height: this.state.customStyles.currentStepIndicatorSize
119
116
  }]
120
117
  }, steps);
121
- });
122
- _defineProperty(this, "renderStepLabels", () => {
118
+ };
119
+ this.renderStepLabels = () => {
123
120
  const {
124
121
  labels,
125
122
  direction,
@@ -161,8 +158,8 @@ export default class StepIndicator extends Component {
161
158
  alignItems: this.state.customStyles.labelAlign
162
159
  }]
163
160
  }, labelViews);
164
- });
165
- _defineProperty(this, "renderStep", position => {
161
+ };
162
+ this.renderStep = position => {
166
163
  const {
167
164
  renderStepIndicator
168
165
  } = this.props;
@@ -229,8 +226,8 @@ export default class StepIndicator extends Component {
229
226
  }) : /*#__PURE__*/React.createElement(Text, {
230
227
  style: indicatorLabelStyle
231
228
  }, "".concat(position + 1)));
232
- });
233
- _defineProperty(this, "getStepStatus", stepPosition => {
229
+ };
230
+ this.getStepStatus = stepPosition => {
234
231
  const {
235
232
  currentPosition
236
233
  } = this.props;
@@ -241,8 +238,8 @@ export default class StepIndicator extends Component {
241
238
  } else {
242
239
  return STEP_STATUS.UNFINISHED;
243
240
  }
244
- });
245
- _defineProperty(this, "onCurrentPositionChanged", position => {
241
+ };
242
+ this.onCurrentPositionChanged = position => {
246
243
  let {
247
244
  stepCount
248
245
  } = this.props;
@@ -262,7 +259,7 @@ export default class StepIndicator extends Component {
262
259
  toValue: this.state.customStyles.currentStepIndicatorSize / 2,
263
260
  duration: 100
264
261
  })])]).start();
265
- });
262
+ };
266
263
  const defaultStyles = {
267
264
  stepIndicatorSize: 30,
268
265
  currentStepIndicatorSize: 40,
@@ -328,7 +325,6 @@ export default class StepIndicator extends Component {
328
325
  // ),
329
326
  // }));
330
327
  // }
331
-
332
328
  if (prevProps.currentPosition !== this.props.currentPosition) {
333
329
  this.onCurrentPositionChanged(this.props.currentPosition);
334
330
  }
@@ -369,6 +365,50 @@ const styles = StyleSheet.create({
369
365
  justifyContent: "center"
370
366
  }
371
367
  });
368
+ StepIndicator.defaultProps = {
369
+ currentPosition: 0,
370
+ stepCount: 5,
371
+ customStyles: {},
372
+ direction: "horizontal"
373
+ };rrentPositionChanged(this.props.currentPosition);
374
+ }
375
+ }
376
+ }
377
+ const styles = StyleSheet.create({
378
+ container: {
379
+ backgroundColor: "transparent"
380
+ },
381
+ stepIndicatorContainer: {
382
+ flexDirection: "row",
383
+ alignItems: "center",
384
+ justifyContent: "space-around",
385
+ backgroundColor: "transparent"
386
+ },
387
+ stepLabelsContainer: {
388
+ justifyContent: "space-around"
389
+ },
390
+ step: {
391
+ alignItems: "center",
392
+ justifyContent: "center",
393
+ zIndex: 2
394
+ },
395
+ stepContainer: {
396
+ flex: 1,
397
+ flexDirection: "row",
398
+ alignItems: "center",
399
+ justifyContent: "center"
400
+ },
401
+ stepLabel: {
402
+ fontSize: 12,
403
+ textAlign: "center",
404
+ fontWeight: "500"
405
+ },
406
+ stepLabelItem: {
407
+ flex: 1,
408
+ alignItems: "center",
409
+ justifyContent: "center"
410
+ }
411
+ });
372
412
  StepIndicator.defaultProps = {
373
413
  currentPosition: 0,
374
414
  stepCount: 5,
@@ -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
  /* Copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx */
3
2
  import * as React from "react";
4
3
  import { Animated, StyleSheet } from "react-native";
@@ -34,6 +33,21 @@ const Surface = _ref => {
34
33
  return colors.surface;
35
34
  }
36
35
  };
36
+ return /*#__PURE__*/React.createElement(Animated.View, {
37
+ ...rest,
38
+ style: [{
39
+ backgroundColor: getBackgroundColor(),
40
+ elevation,
41
+ ...evalationStyles,
42
+ ...restStyle
43
+ }]
44
+ }, children);
45
+ };
46
+ export default withTheme(Surface);erlay(elevation, colors.surface);
47
+ } else {
48
+ return colors.surface;
49
+ }
50
+ };
37
51
  return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
38
52
  style: [{
39
53
  backgroundColor: getBackgroundColor(),
@@ -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 { Switch as NativeSwitch } from "react-native";
4
3
  import { withTheme } from "../theming";
@@ -29,7 +28,6 @@ function Switch(_ref) {
29
28
  setChecked(value);
30
29
  }
31
30
  }, [value, checked]);
32
-
33
31
  // This special logic is to handle weird APIs like Airtable that return
34
32
  // true or undefined for a boolean
35
33
  const previousDefaultValue = usePrevious(defaultValue);
@@ -38,24 +36,24 @@ function Switch(_ref) {
38
36
  setChecked(Boolean(defaultValue));
39
37
  }
40
38
  }, [defaultValue, previousDefaultValue]);
41
- return /*#__PURE__*/React.createElement(NativeSwitch, _extends({
39
+ return /*#__PURE__*/React.createElement(NativeSwitch, {
42
40
  value: checked,
43
41
  disabled: disabled,
44
42
  trackColor: {
45
43
  false: inactiveTrackThemeColor,
46
44
  true: activeTrackThemeColor
47
45
  },
48
- thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor
46
+ thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor,
49
47
  // @ts-ignore react-native-web only
50
- ,
51
48
  activeThumbColor: activeThumbThemeColor,
52
49
  ios_backgroundColor: inactiveTrackThemeColor,
53
50
  style: style,
54
51
  onValueChange: bool => {
55
52
  setChecked(bool);
56
53
  onValueChange && onValueChange(bool);
57
- }
58
- }, rest));
54
+ },
55
+ ...rest
56
+ });
59
57
  }
60
58
  function Row(_ref2) {
61
59
  let {
@@ -84,7 +82,7 @@ function Row(_ref2) {
84
82
  setChecked(defaultValue);
85
83
  }
86
84
  }, [defaultValue]);
87
- return /*#__PURE__*/React.createElement(FormRow, _extends({
85
+ return /*#__PURE__*/React.createElement(FormRow, {
88
86
  disabled: disabled,
89
87
  onPress: () => {
90
88
  setChecked(!checked);
@@ -92,8 +90,9 @@ function Row(_ref2) {
92
90
  },
93
91
  label: label,
94
92
  direction: direction,
95
- style: style
96
- }, rest), /*#__PURE__*/React.createElement(Switch, {
93
+ style: style,
94
+ ...rest
95
+ }, /*#__PURE__*/React.createElement(Switch, {
97
96
  theme: theme,
98
97
  value: checked,
99
98
  disabled: disabled,
@@ -106,4 +105,16 @@ function Row(_ref2) {
106
105
  }
107
106
  const SwitchRow = withTheme(Row);
108
107
  export { SwitchRow };
108
+ export default withTheme(Switch);: theme,
109
+ value: checked,
110
+ disabled: disabled,
111
+ onValueChange: onValueChange,
112
+ activeTrackColor: activeTrackColor,
113
+ inactiveTrackColor: inactiveTrackColor,
114
+ activeThumbColor: activeThumbColor,
115
+ inactiveThumbColor: inactiveThumbColor
116
+ }));
117
+ }
118
+ const SwitchRow = withTheme(Row);
119
+ export { SwitchRow };
109
120
  export default withTheme(Switch);
@@ -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 { TabView, TabBar, SceneMap } from "react-native-tab-view";
4
3
  import { withTheme } from "../../theming";
@@ -28,13 +27,11 @@ const TabViewComponent = _ref => {
28
27
  textStyles,
29
28
  viewStyles
30
29
  } = extractStyles(style);
31
-
32
30
  //Check type of child using props
33
31
  //Regular '.type' cannot work because Draftbit strips the type in Draft view
34
32
  const instanceOfTabViewItemProps = object => {
35
33
  return "title" in object;
36
34
  };
37
-
38
35
  //Populate routes and scenes based on children
39
36
  React.useEffect(() => {
40
37
  const newRoutes = [];
@@ -60,7 +57,8 @@ const TabViewComponent = _ref => {
60
57
  }
61
58
  };
62
59
  const renderTabBar = props => {
63
- return /*#__PURE__*/React.createElement(TabBar, _extends({}, props, {
60
+ return /*#__PURE__*/React.createElement(TabBar, {
61
+ ...props,
64
62
  activeColor: activeColor || theme.colors.primary,
65
63
  inactiveColor: inactiveColor || theme.colors.divider,
66
64
  pressColor: pressColor || theme.colors.primary,
@@ -74,7 +72,7 @@ const TabViewComponent = _ref => {
74
72
  route,
75
73
  color
76
74
  } = _ref2;
77
- return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
75
+ return (route === null || route === void 0 ? void 0 : route.icon) ? /*#__PURE__*/React.createElement(Icon, {
78
76
  name: route.icon,
79
77
  color: color,
80
78
  size: 16
@@ -83,9 +81,8 @@ const TabViewComponent = _ref => {
83
81
  style: {
84
82
  backgroundColor: tabsBackgroundColor || theme.colors.background
85
83
  }
86
- }));
84
+ });
87
85
  };
88
-
89
86
  //Cannot render TabView without at least one tab
90
87
  if (!routes.length) {
91
88
  return /*#__PURE__*/React.createElement(React.Fragment, null);
@@ -104,4 +101,17 @@ const TabViewComponent = _ref => {
104
101
  swipeEnabled: swipeEnabled
105
102
  });
106
103
  };
104
+ export default withTheme(TabViewComponent);tyles],
105
+ navigationState: {
106
+ index,
107
+ routes
108
+ },
109
+ renderScene: SceneMap(tabScenes),
110
+ renderTabBar: renderTabBar,
111
+ onIndexChange: indexChangeHandler,
112
+ tabBarPosition: tabBarPosition,
113
+ keyboardDismissMode: keyboardDismissMode,
114
+ swipeEnabled: swipeEnabled
115
+ });
116
+ };
107
117
  export default withTheme(TabViewComponent);
@@ -1,8 +1,5 @@
1
1
  import React from "react";
2
2
  import { StyleSheet, View } from "react-native";
3
-
4
- //Props used by parent (TabView) to create tabs
5
-
6
3
  const TabViewItem = _ref => {
7
4
  let {
8
5
  style,
@@ -17,4 +14,8 @@ const styles = StyleSheet.create({
17
14
  flex: 1
18
15
  }
19
16
  });
17
+ export default TabViewItem; {
18
+ flex: 1
19
+ }
20
+ });
20
21
  export default TabViewItem;
@@ -1,10 +1,12 @@
1
1
  import React from "react";
2
2
  import { ScrollView, View, StyleSheet } from "react-native";
3
- import { generateBorderStyles, TableStyleContext } from "./index";
4
- export const Table = _ref => {
3
+ import { withTheme } from "../../theming";
4
+ import { generateBorderStyles, TableStyleContext } from "./TableCommon";
5
+ const Table = _ref => {
5
6
  let {
7
+ theme,
6
8
  borderWidth = 1,
7
- borderColor = "rgba(200, 200, 200, 1)",
9
+ borderColor = theme.colors.divider,
8
10
  borderStyle = "solid",
9
11
  drawTopBorder = true,
10
12
  drawBottomBorder = false,
@@ -30,7 +32,6 @@ export const Table = _ref => {
30
32
  return object.isTableHeader;
31
33
  }, []);
32
34
  const isRenderItem = data && renderItem;
33
-
34
35
  //Uses 'renderItem' and 'data' to create an array of children
35
36
  const dataAsChildren = React.useMemo(() => {
36
37
  if (!isRenderItem) return [];
@@ -55,7 +56,7 @@ export const Table = _ref => {
55
56
  const nestedChildren = React.Children.toArray(item.props.children);
56
57
  //Header can be nested in React.Fragment when in renderItem
57
58
  const nestedHeaders = nestedChildren.filter(child => isTableHeader(child.props));
58
- if (nestedHeaders !== null && nestedHeaders !== void 0 && nestedHeaders.length) {
59
+ if (nestedHeaders === null || nestedHeaders === void 0 ? void 0 : nestedHeaders.length) {
59
60
  //New element excluding header children
60
61
  return /*#__PURE__*/React.cloneElement(item, {
61
62
  children: nestedChildren.filter(child => !isTableHeader(child.props))
@@ -70,7 +71,7 @@ export const Table = _ref => {
70
71
  const nestedChildren = React.Children.toArray(item.props.children);
71
72
  //Header can be nested in React.Fragment when in renderItem
72
73
  const nestedHeaders = nestedChildren.filter(child => isTableHeader(child.props));
73
- if (nestedHeaders !== null && nestedHeaders !== void 0 && nestedHeaders.length) {
74
+ if (nestedHeaders === null || nestedHeaders === void 0 ? void 0 : nestedHeaders.length) {
74
75
  return nestedHeaders[0];
75
76
  }
76
77
  return item;
@@ -102,13 +103,13 @@ export const Table = _ref => {
102
103
  value: contextValue
103
104
  }, /*#__PURE__*/React.createElement(View, {
104
105
  style: [styles.container, borderViewStyle, style]
105
- }, /*#__PURE__*/React.createElement(React.Fragment, null, header), /*#__PURE__*/React.createElement(ScrollView, rest, childrenWithoutHeader)));
106
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, header), /*#__PURE__*/React.createElement(ScrollView, {
107
+ ...rest
108
+ }, childrenWithoutHeader)));
106
109
  };
107
110
  const styles = StyleSheet.create({
108
111
  container: {
109
112
  flex: 1
110
113
  }
111
- });ainer: {
112
- flex: 1
113
- }
114
- });
114
+ });
115
+ export default withTheme(Table);
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { View, StyleSheet } from "react-native";
3
- import { generateBorderStyles, TableStyleContext } from "./index";
3
+ import { generateBorderStyles, TableStyleContext } from "./TableCommon";
4
4
  const TableCell = _ref => {
5
5
  let {
6
6
  borderWidth,
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ export const TableStyleContext = /*#__PURE__*/React.createContext({});
3
+ export function generateBorderStyles(_ref) {
4
+ let {
5
+ borderColor,
6
+ borderWidth,
7
+ borderStyle,
8
+ drawTopBorder,
9
+ drawBottomBorder,
10
+ drawStartBorder,
11
+ drawEndBorder
12
+ } = _ref;
13
+ return {
14
+ borderColor,
15
+ borderStyle,
16
+ borderTopWidth: drawTopBorder ? borderWidth : 0,
17
+ borderBottomWidth: drawBottomBorder ? borderWidth : 0,
18
+ borderStartWidth: drawStartBorder ? borderWidth : 0,
19
+ borderEndWidth: drawEndBorder ? borderWidth : 0
20
+ };
21
+ }
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { View, StyleSheet } from "react-native";
3
- import { generateBorderStyles, TableStyleContext } from "./index";
3
+ import { generateBorderStyles, TableStyleContext } from "./TableCommon";
4
4
  import { withTheme } from "../../theming";
5
5
  const TableRow = _ref => {
6
6
  let {
@@ -19,6 +19,7 @@ const TableRow = _ref => {
19
19
  theme
20
20
  } = _ref;
21
21
  const parentContextValue = React.useContext(TableStyleContext);
22
+
22
23
  //Create context to use and pass to children based on own props or fall back to parent provided context
23
24
  const contextValue = {
24
25
  borderColor: borderColor || parentContextValue.borderColor,
@@ -49,4 +50,4 @@ const styles = StyleSheet.create({
49
50
  flexDirection: "row"
50
51
  }
51
52
  });
52
- export default withTheme(TableRow);;
53
+ export default withTheme(TableRow);
@@ -1,24 +1,3 @@
1
- import React from "react";
2
- export const TableStyleContext = /*#__PURE__*/React.createContext({});
3
- export function generateBorderStyles(_ref) {
4
- let {
5
- borderColor,
6
- borderWidth,
7
- borderStyle,
8
- drawTopBorder,
9
- drawBottomBorder,
10
- drawStartBorder,
11
- drawEndBorder
12
- } = _ref;
13
- return {
14
- borderColor,
15
- borderStyle,
16
- borderTopWidth: drawTopBorder ? borderWidth : 0,
17
- borderBottomWidth: drawBottomBorder ? borderWidth : 0,
18
- borderStartWidth: drawStartBorder ? borderWidth : 0,
19
- borderEndWidth: drawEndBorder ? borderWidth : 0
20
- };
21
- }
22
- export { Table } from "./Table";
1
+ export { default as Table } from "./Table";
23
2
  export { default as TableRow } from "./TableRow";
24
3
  export { default as TableCell } from "./TableCell";