@draftbit/core 46.6.0 → 46.6.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 (244) hide show
  1. package/lib/commonjs/components/AvatarEdit.js +15 -4
  2. package/lib/commonjs/components/CardContainer.js +4 -13
  3. package/lib/commonjs/components/CardContainerShortImage.js +4 -15
  4. package/lib/commonjs/components/Carousel.js +30 -8
  5. package/lib/commonjs/components/Checkbox/Checkbox.js +4 -22
  6. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +2 -17
  7. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +23 -5
  8. package/lib/commonjs/components/DatePicker/DatePicker.js +26 -13
  9. package/lib/commonjs/components/Divider.js +14 -1
  10. package/lib/commonjs/components/Elevation.js +2 -14
  11. package/lib/commonjs/components/FieldSearchBarFull.js +2 -1
  12. package/lib/commonjs/components/IconButton.js +19 -4
  13. package/lib/commonjs/components/Image.js +2 -17
  14. package/lib/commonjs/components/Layout.js +19 -40
  15. package/lib/commonjs/components/Picker/Picker.js +4 -9
  16. package/lib/commonjs/components/Picker/PickerComponent.web.js +3 -20
  17. package/lib/commonjs/components/Portal/Portal.js +27 -3
  18. package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
  19. package/lib/commonjs/components/Pressable.js +2 -15
  20. package/lib/commonjs/components/ProgressBar.js +7 -37
  21. package/lib/commonjs/components/RadioButton/context.js +1 -1
  22. package/lib/commonjs/components/StarRating.js +23 -4
  23. package/lib/commonjs/components/StepIndicator.js +18 -57
  24. package/lib/commonjs/components/Switch.js +10 -19
  25. package/lib/commonjs/components/Touchable.js +2 -15
  26. package/lib/commonjs/constants.js +1 -1
  27. package/lib/commonjs/hooks.js +1 -2
  28. package/lib/commonjs/mappings/StarRating.js +6 -2
  29. package/lib/commonjs/styles/overlay.js +1 -3
  30. package/lib/commonjs/utilities.js +1 -2
  31. package/lib/module/components/AnimatedCircularProgress.js +13 -1
  32. package/lib/module/components/AspectRatio.js +18 -1
  33. package/lib/module/components/Banner.js +25 -4
  34. package/lib/module/components/CardBlock.js +14 -4
  35. package/lib/module/components/CardContainerRating.js +14 -4
  36. package/lib/module/components/CardContainerShortImage.js +18 -4
  37. package/lib/module/components/Carousel.js +8 -32
  38. package/lib/module/components/Checkbox/Checkbox.js +4 -25
  39. package/lib/module/components/Checkbox/CheckboxGroupRow.js +5 -24
  40. package/lib/module/components/CircularProgress.js +8 -28
  41. package/lib/module/components/Container.js +17 -4
  42. package/lib/module/components/DatePicker/DatePicker.js +13 -27
  43. package/lib/module/components/DeprecatedButton.js +3 -21
  44. package/lib/module/components/DeprecatedFAB.js +23 -3
  45. package/lib/module/components/FieldSearchBarFull.js +2 -1
  46. package/lib/module/components/FormRow.js +17 -2
  47. package/lib/module/components/Image.js +2 -18
  48. package/lib/module/components/Picker/Picker.js +4 -10
  49. package/lib/module/components/Picker/PickerComponent.ios.js +11 -36
  50. package/lib/module/components/Picker/PickerComponent.web.js +3 -21
  51. package/lib/module/components/Portal/Portal.js +28 -3
  52. package/lib/module/components/Portal/PortalHost.js +45 -15
  53. package/lib/module/components/Portal/PortalManager.js +33 -7
  54. package/lib/module/components/ProgressBar.js +39 -7
  55. package/lib/module/components/RadioButton/RadioButton.js +13 -1
  56. package/lib/module/components/RadioButton/RadioButtonGroup.js +16 -2
  57. package/lib/module/components/RadioButton/context.js +1 -1
  58. package/lib/module/components/ScreenContainer.js +4 -21
  59. package/lib/module/components/Slider.js +21 -4
  60. package/lib/module/components/StepIndicator.js +58 -18
  61. package/lib/module/components/Surface.js +15 -1
  62. package/lib/module/components/Text.js +4 -50
  63. package/lib/module/mappings/StarRating.js +2 -7
  64. package/package.json +3 -3
  65. package/src/Provider.js +0 -9
  66. package/src/components/Accordion/AccordionGroup.js +0 -44
  67. package/src/components/Accordion/AccordionItem.js +0 -32
  68. package/src/components/Accordion/index.js +0 -2
  69. package/src/components/ActionSheet/ActionSheet.js +0 -45
  70. package/src/components/ActionSheet/ActionSheetCancel.js +0 -6
  71. package/src/components/ActionSheet/ActionSheetItem.js +0 -30
  72. package/src/components/ActionSheet/index.js +0 -3
  73. package/src/components/AnimatedCircularProgress.js +0 -43
  74. package/src/components/AspectRatio.js +0 -18
  75. package/src/components/AvatarEdit.js +0 -30
  76. package/src/components/Banner.js +0 -109
  77. package/src/components/Button.js +0 -114
  78. package/src/components/Card.js +0 -57
  79. package/src/components/CardBlock.js +0 -54
  80. package/src/components/CardContainer.js +0 -69
  81. package/src/components/CardContainerRating.js +0 -79
  82. package/src/components/CardContainerShortImage.js +0 -33
  83. package/src/components/CardInline.js +0 -36
  84. package/src/components/Carousel.js +0 -68
  85. package/src/components/Checkbox/Checkbox.js +0 -62
  86. package/src/components/Checkbox/CheckboxGroup.js +0 -21
  87. package/src/components/Checkbox/CheckboxGroupRow.js +0 -76
  88. package/src/components/Checkbox/CheckboxRow.js +0 -77
  89. package/src/components/Checkbox/context.js +0 -14
  90. package/src/components/Checkbox/index.js +0 -3
  91. package/src/components/CircleImage.js +0 -8
  92. package/src/components/CircularProgress.js +0 -81
  93. package/src/components/Config.js +0 -64
  94. package/src/components/Container.js +0 -43
  95. package/src/components/DatePicker/DatePicker.js +0 -377
  96. package/src/components/DatePicker/DatePickerComponent.js +0 -13
  97. package/src/components/DatePicker/DatePickerComponent.web.js +0 -30
  98. package/src/components/DatePicker/DatePickerComponentType.js +0 -1
  99. package/src/components/DeprecatedButton.js +0 -83
  100. package/src/components/DeprecatedCardWrapper.js +0 -18
  101. package/src/components/DeprecatedFAB.js +0 -114
  102. package/src/components/Divider.js +0 -13
  103. package/src/components/Elevation.js +0 -20
  104. package/src/components/FAB.js +0 -46
  105. package/src/components/FieldSearchBarFull.js +0 -53
  106. package/src/components/FormRow.js +0 -19
  107. package/src/components/Header.js +0 -44
  108. package/src/components/HeaderLarge.js +0 -7
  109. package/src/components/HeaderMedium.js +0 -7
  110. package/src/components/HeaderOverline.js +0 -7
  111. package/src/components/IconButton.js +0 -35
  112. package/src/components/Image.js +0 -47
  113. package/src/components/Justification.js +0 -1
  114. package/src/components/Layout.js +0 -50
  115. package/src/components/NumberInput.js +0 -49
  116. package/src/components/Picker/Picker.js +0 -267
  117. package/src/components/Picker/PickerComponent.android.js +0 -69
  118. package/src/components/Picker/PickerComponent.ios.js +0 -79
  119. package/src/components/Picker/PickerComponent.web.js +0 -70
  120. package/src/components/Picker/PickerTypes.js +0 -1
  121. package/src/components/Portal/Portal.js +0 -35
  122. package/src/components/Portal/PortalConsumer.js +0 -27
  123. package/src/components/Portal/PortalHost.js +0 -107
  124. package/src/components/Portal/PortalManager.js +0 -32
  125. package/src/components/Pressable.js +0 -12
  126. package/src/components/ProgressBar.js +0 -118
  127. package/src/components/ProgressCircle.js +0 -13
  128. package/src/components/ProgressIndicator.js +0 -27
  129. package/src/components/RadioButton/RadioButton.js +0 -17
  130. package/src/components/RadioButton/RadioButtonFieldGroup.js +0 -17
  131. package/src/components/RadioButton/RadioButtonGroup.js +0 -43
  132. package/src/components/RadioButton/RadioButtonRow.js +0 -76
  133. package/src/components/RadioButton/context.js +0 -14
  134. package/src/components/RadioButton/index.js +0 -4
  135. package/src/components/ResizeMode.js +0 -1
  136. package/src/components/Row.js +0 -48
  137. package/src/components/RowBodyIcon.js +0 -8
  138. package/src/components/RowHeadlineImageCaption.js +0 -12
  139. package/src/components/RowHeadlineImageIcon.js +0 -14
  140. package/src/components/SVG.js +0 -13
  141. package/src/components/ScreenContainer.js +0 -34
  142. package/src/components/Slider.js +0 -63
  143. package/src/components/StarRating.js +0 -50
  144. package/src/components/StepIndicator.js +0 -346
  145. package/src/components/Stepper.js +0 -41
  146. package/src/components/Surface.js +0 -32
  147. package/src/components/Swiper/Swiper.js +0 -29
  148. package/src/components/Swiper/SwiperItem.js +0 -9
  149. package/src/components/Swiper/index.js +0 -2
  150. package/src/components/Switch.js +0 -56
  151. package/src/components/Text.js +0 -33
  152. package/src/components/TextField.js +0 -428
  153. package/src/components/ToggleButton.js +0 -39
  154. package/src/components/Touchable.js +0 -12
  155. package/src/components/Touchable.web.js +0 -2
  156. package/src/components/Typography.js +0 -36
  157. package/src/components/useAuthState.js +0 -31
  158. package/src/constants.js +0 -10
  159. package/src/hooks.js +0 -12
  160. package/src/index.js +0 -53
  161. package/src/interfaces/Icon.js +0 -8
  162. package/src/mappings/Accordion.js +0 -41
  163. package/src/mappings/AccordionItem.js +0 -16
  164. package/src/mappings/ActionSheet.js +0 -13
  165. package/src/mappings/ActionSheetCancel.js +0 -19
  166. package/src/mappings/ActionSheetItem.js +0 -23
  167. package/src/mappings/ActivityIndicator.js +0 -58
  168. package/src/mappings/AudioPlayer.js +0 -57
  169. package/src/mappings/AvatarEdit.js +0 -38
  170. package/src/mappings/Banner.js +0 -32
  171. package/src/mappings/BlurView.js +0 -42
  172. package/src/mappings/Button.js +0 -116
  173. package/src/mappings/Card.js +0 -52
  174. package/src/mappings/CardBlock.js +0 -123
  175. package/src/mappings/CardContainer.js +0 -104
  176. package/src/mappings/CardContainerRating.js +0 -126
  177. package/src/mappings/CardContainerShortImage.js +0 -120
  178. package/src/mappings/CardInline.js +0 -52
  179. package/src/mappings/Carousel.js +0 -19
  180. package/src/mappings/Checkbox.js +0 -46
  181. package/src/mappings/CheckboxGroup.js +0 -26
  182. package/src/mappings/CheckboxRow.js +0 -61
  183. package/src/mappings/CircleImage.js +0 -25
  184. package/src/mappings/Container.js +0 -30
  185. package/src/mappings/CustomCode.js +0 -8
  186. package/src/mappings/DatePicker.js +0 -176
  187. package/src/mappings/Divider.js +0 -27
  188. package/src/mappings/FAB.js +0 -37
  189. package/src/mappings/Fetch.js +0 -13
  190. package/src/mappings/FieldSearchBarFull.js +0 -50
  191. package/src/mappings/FlashList.js +0 -79
  192. package/src/mappings/FlatList.js +0 -36
  193. package/src/mappings/HeaderLarge.js +0 -29
  194. package/src/mappings/HeaderMedium.js +0 -55
  195. package/src/mappings/HeaderOverline.js +0 -55
  196. package/src/mappings/Icon.js +0 -32
  197. package/src/mappings/IconButton.js +0 -35
  198. package/src/mappings/Image.js +0 -35
  199. package/src/mappings/ImageBackground.js +0 -29
  200. package/src/mappings/KeyboardAvoidingView.js +0 -41
  201. package/src/mappings/KeyboardAwareScrollView.js +0 -50
  202. package/src/mappings/Layout.js +0 -200
  203. package/src/mappings/LinearGradient.js +0 -77
  204. package/src/mappings/MapCallout.js +0 -21
  205. package/src/mappings/MapMarker.js +0 -47
  206. package/src/mappings/MapView.js +0 -139
  207. package/src/mappings/Modal.js +0 -42
  208. package/src/mappings/NumberInput.js +0 -254
  209. package/src/mappings/Picker.js +0 -148
  210. package/src/mappings/ProgressBar.js +0 -101
  211. package/src/mappings/ProgressCircle.js +0 -109
  212. package/src/mappings/ProgressIndicator.js +0 -181
  213. package/src/mappings/RadioButton.js +0 -51
  214. package/src/mappings/RadioButtonGroup.js +0 -17
  215. package/src/mappings/RadioButtonRow.js +0 -42
  216. package/src/mappings/RowBodyIcon.js +0 -75
  217. package/src/mappings/RowHeadlineImageCaption.js +0 -167
  218. package/src/mappings/RowHeadlineImageIcon.js +0 -99
  219. package/src/mappings/SVG.js +0 -20
  220. package/src/mappings/SafeAreaView.js +0 -33
  221. package/src/mappings/ScrollView.js +0 -31
  222. package/src/mappings/Slider.js +0 -60
  223. package/src/mappings/StarRating.js +0 -43
  224. package/src/mappings/Stepper.js +0 -32
  225. package/src/mappings/Surface.js +0 -14
  226. package/src/mappings/Swiper.js +0 -62
  227. package/src/mappings/SwiperItem.js +0 -8
  228. package/src/mappings/Switch.js +0 -81
  229. package/src/mappings/Text.js +0 -251
  230. package/src/mappings/TextArea.js +0 -274
  231. package/src/mappings/TextField.js +0 -391
  232. package/src/mappings/TextInput.js +0 -402
  233. package/src/mappings/ToggleButton.js +0 -50
  234. package/src/mappings/Touchable.js +0 -60
  235. package/src/mappings/Video.js +0 -81
  236. package/src/mappings/View.js +0 -207
  237. package/src/mappings/WebView.js +0 -88
  238. package/src/styles/DarkTheme.js +0 -26
  239. package/src/styles/DefaultTheme.js +0 -111
  240. package/src/styles/fonts.js +0 -62
  241. package/src/styles/overlay.js +0 -60
  242. package/src/styles/shadow.js +0 -51
  243. package/src/theming.js +0 -3
  244. package/src/utilities.js +0 -102
@@ -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
  import * as React from "react";
5
2
  import { View, StyleSheet } from "react-native";
6
3
  /**
@@ -9,18 +6,47 @@ import { View, StyleSheet } from "react-native";
9
6
  export default class PortalManager extends React.PureComponent {
10
7
  constructor() {
11
8
  super(...arguments);
12
- _defineProperty(this, "state", {
9
+ this.state = {
13
10
  portals: []
14
- });
15
- _defineProperty(this, "mount", (key, children) => {
11
+ };
12
+ this.mount = (key, children) => {
16
13
  this.setState(state => ({
17
14
  portals: [...state.portals, {
18
15
  key,
19
16
  children
20
17
  }]
21
18
  }));
19
+ };
20
+ this.update = (key, children) => this.setState(state => ({
21
+ portals: state.portals.map(item => {
22
+ if (item.key === key) {
23
+ return {
24
+ ...item,
25
+ children
26
+ };
27
+ }
28
+ return item;
29
+ })
30
+ }));
31
+ this.unmount = key => this.setState(state => ({
32
+ portals: state.portals.filter(item => item.key !== key)
33
+ }));
34
+ }
35
+ render() {
36
+ return this.state.portals.map(_ref => {
37
+ let {
38
+ key,
39
+ children
40
+ } = _ref;
41
+ return /*#__PURE__*/React.createElement(View, {
42
+ key: key,
43
+ collapsable: false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */,
44
+ pointerEvents: "box-none",
45
+ style: StyleSheet.absoluteFill
46
+ }, children);
22
47
  });
23
- _defineProperty(this, "update", (key, children) => this.setState(state => ({
48
+ }
49
+ }ey, children) => this.setState(state => ({
24
50
  portals: state.portals.map(item => {
25
51
  if (item.key === key) {
26
52
  return {
@@ -1,7 +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
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
1
  import React, { Component } from "react";
6
2
  import { Animated, Easing, View, I18nManager } from "react-native";
7
3
  const INDETERMINATE_WIDTH_FACTOR = 0.3;
@@ -9,7 +5,7 @@ const BAR_WIDTH_ZERO_POSITION = INDETERMINATE_WIDTH_FACTOR / (1 + INDETERMINATE_
9
5
  export default class ProgressBar extends Component {
10
6
  constructor(props) {
11
7
  super(props);
12
- _defineProperty(this, "handleLayout", event => {
8
+ this.handleLayout = event => {
13
9
  const {
14
10
  width = 150,
15
11
  onLayout
@@ -22,7 +18,7 @@ export default class ProgressBar extends Component {
22
18
  if (onLayout) {
23
19
  onLayout(event);
24
20
  }
25
- });
21
+ };
26
22
  const {
27
23
  progress: progressP = 0,
28
24
  indeterminate = false
@@ -70,7 +66,6 @@ export default class ProgressBar extends Component {
70
66
  ...animationConfig,
71
67
  toValue: progress,
72
68
  velocity: 0,
73
- //adjust this value if animation fails - velocity is required
74
69
  useNativeDriver
75
70
  }).start();
76
71
  } else {
@@ -139,6 +134,43 @@ export default class ProgressBar extends Component {
139
134
  })
140
135
  }]
141
136
  };
137
+ return /*#__PURE__*/React.createElement(View, {
138
+ style: [containerStyle, style],
139
+ onLayout: this.handleLayout,
140
+ ...restProps
141
+ }, /*#__PURE__*/React.createElement(Animated.View, {
142
+ style: progressStyle
143
+ }), children);
144
+ }
145
+ } width,
146
+ borderWidth,
147
+ borderColor: borderColor || color,
148
+ borderRadius,
149
+ overflow: "hidden",
150
+ backgroundColor: unfilledColor
151
+ };
152
+ const progressStyle = {
153
+ backgroundColor: color,
154
+ // Always take up full height of container.
155
+ height: "100%",
156
+ transform: [{
157
+ translateX: this.state.animationValue.interpolate({
158
+ inputRange: [0, 1],
159
+ outputRange: [innerWidth * -INDETERMINATE_WIDTH_FACTOR, innerWidth]
160
+ })
161
+ }, {
162
+ translateX: this.state.progress.interpolate({
163
+ inputRange: [0, 1],
164
+ outputRange: [innerWidth / (I18nManager.isRTL ? 2 : -2), 0]
165
+ })
166
+ }, {
167
+ // Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
168
+ scaleX: this.state.progress.interpolate({
169
+ inputRange: [0, 1],
170
+ outputRange: [0.0001, 1]
171
+ })
172
+ }]
173
+ };
142
174
  return /*#__PURE__*/React.createElement(View, _extends({
143
175
  style: [containerStyle, style],
144
176
  onLayout: this.handleLayout
@@ -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 * as React from "react";
3
2
  import { View } from "react-native";
4
3
  import { getValueForRadioButton } from "../../utilities";
@@ -42,7 +41,22 @@ const RadioButtonGroup = _ref => {
42
41
  alignItems: "center"
43
42
  });
44
43
  }
45
- return /*#__PURE__*/React.createElement(View, _extends({
44
+ return /*#__PURE__*/React.createElement(View, {
45
+ style: [{
46
+ minHeight: 40
47
+ }, style],
48
+ ...rest
49
+ }, /*#__PURE__*/React.createElement(Provider, {
50
+ value: {
51
+ value: internalValue,
52
+ onValueChange: handleValueChange,
53
+ direction
54
+ }
55
+ }, /*#__PURE__*/React.createElement(View, {
56
+ style: _containerStyle
57
+ }, children)));
58
+ };
59
+ export default RadioButtonGroup;xtends({
46
60
  style: [{
47
61
  minHeight: 40
48
62
  }, style]
@@ -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";
@@ -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 { StyleSheet, ScrollView, View } from "react-native";
3
4
  import { SafeAreaView } from "react-native-safe-area-context";
@@ -21,13 +22,12 @@ function ScreenContainer(_ref) {
21
22
  if (hasSafeArea || hasBottomSafeArea) {
22
23
  edges.push("bottom");
23
24
  }
24
- return /*#__PURE__*/React.createElement(SafeAreaView, {
25
+ return /*#__PURE__*/React.createElement(SafeAreaView, _extends({
25
26
  edges: edges,
26
27
  style: [styles.container, {
27
28
  backgroundColor
28
- }],
29
- ...rest
30
- }, scrollable ? /*#__PURE__*/React.createElement(ScrollView, {
29
+ }]
30
+ }, rest), scrollable ? /*#__PURE__*/React.createElement(ScrollView, {
31
31
  contentContainerStyle: [styles.scrollViewContainer, {
32
32
  backgroundColor
33
33
  }, style]
@@ -46,21 +46,4 @@ const styles = StyleSheet.create({
46
46
  flex: undefined
47
47
  }
48
48
  });
49
- export default withTheme(ScreenContainer);olor
50
- }, style]
51
- }, children) : /*#__PURE__*/React.createElement(View, {
52
- style: [styles.container, {
53
- backgroundColor
54
- }, style]
55
- }, children));
56
- }
57
- const styles = StyleSheet.create({
58
- container: {
59
- flex: 1
60
- },
61
- scrollViewContainer: {
62
- flexGrow: 1,
63
- flex: undefined
64
- }
65
- });
66
49
  export default withTheme(ScreenContainer);
@@ -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 { View, StyleSheet } from "react-native";
4
3
  import NativeSlider from "@react-native-community/slider";
@@ -64,9 +63,10 @@ function Slider(_ref) {
64
63
  setInternalValue(newValue);
65
64
  onValueChange(newValue);
66
65
  };
67
- return /*#__PURE__*/React.createElement(View, _extends({
68
- style: [styles.container, style]
69
- }, rest), leftIcon ? /*#__PURE__*/React.createElement(Icon, {
66
+ return /*#__PURE__*/React.createElement(View, {
67
+ style: [styles.container, style],
68
+ ...rest
69
+ }, leftIcon ? /*#__PURE__*/React.createElement(Icon, {
70
70
  color: leftIconThemeColor,
71
71
  name: leftIcon,
72
72
  size: 24
@@ -98,4 +98,21 @@ const styles = StyleSheet.create({
98
98
  marginHorizontal: 12
99
99
  }
100
100
  });
101
+ export default withTheme(Slider);Icon ? /*#__PURE__*/React.createElement(Icon, {
102
+ color: rightIconThemeColor,
103
+ name: rightIcon,
104
+ size: 24
105
+ }) : null);
106
+ }
107
+ const styles = StyleSheet.create({
108
+ container: {
109
+ height: 40,
110
+ flexDirection: "row",
111
+ alignItems: "center"
112
+ },
113
+ slider: {
114
+ flex: 1,
115
+ marginHorizontal: 12
116
+ }
117
+ });
101
118
  export default withTheme(Slider);
@@ -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,56 +1,10 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1
5
  import * as React from "react";
2
6
  import { Text as NativeText, I18nManager } from "react-native";
3
7
  import { withTheme } from "../theming";
4
- class Text extends React.Component {
5
- constructor() {
6
- super(...arguments);
7
- this.state = {
8
- nativeProps: {}
9
- };
10
- }
11
- setNativeProps(args) {
12
- this.state.nativeProps = args || {};
13
- }
14
- render() {
15
- const {
16
- style,
17
- ...rest
18
- } = this.props;
19
- const writingDirection = I18nManager.isRTL ? "rtl" : "ltr";
20
- return /*#__PURE__*/React.createElement(NativeText, {
21
- ...rest,
22
- ...this.state.nativeProps,
23
- ref: c => {
24
- this._root = c;
25
- },
26
- style: [{
27
- textAlign: "left",
28
- writingDirection
29
- }, style]
30
- });
31
- }
32
- }
33
- export const BaseLink = _ref => {
34
- let {
35
- style,
36
- theme,
37
- title,
38
- ...props
39
- } = _ref;
40
- return /*#__PURE__*/React.createElement(Text, {
41
- hitSlop: 8,
42
- style: [{
43
- color: theme.colors.primary
44
- }, style],
45
- theme: theme,
46
- ...props
47
- }, title);
48
- };
49
- const Link = withTheme(BaseLink);
50
- export { Link };
51
- export default withTheme(Text); as React from "react";
52
- import { Text as NativeText, I18nManager } from "react-native";
53
- import { withTheme } from "../theming";
54
8
  class Text extends React.Component {
55
9
  constructor() {
56
10
  super(...arguments);
@@ -17,7 +17,9 @@ export const SEED_DATA = {
17
17
  }),
18
18
  fieldName: createFieldNameProp({
19
19
  defaultValue: "ratingValue",
20
+ // this is the name of the variable declared on the screen in Draftbit
20
21
  handlerPropName: "onPress",
22
+ // the change handler prop in this component
21
23
  valuePropName: "rating" // the value prop in this component
22
24
  }),
23
25
 
@@ -41,11 +43,4 @@ export const SEED_DATA = {
41
43
  defaultValue: "divider"
42
44
  })
43
45
  }
44
- };primary"
45
- }),
46
- inactiveColor: createColorProp({
47
- label: "Inactive Color",
48
- defaultValue: "divider"
49
- })
50
- }
51
46
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.6.0",
3
+ "version": "46.6.2",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -46,7 +46,7 @@
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.3",
48
48
  "@react-native-picker/picker": "2.4.2",
49
- "@shopify/flash-list": "1.2.0",
49
+ "@shopify/flash-list": "1.3.1",
50
50
  "color": "^3.1.2",
51
51
  "date-fns": "^2.16.1",
52
52
  "dateformat": "^3.0.3",
@@ -91,5 +91,5 @@
91
91
  ]
92
92
  ]
93
93
  },
94
- "gitHead": "4403cb452dfeff35e782f2eca66e87831b92473f"
94
+ "gitHead": "b0df05ed1014083c4a399e66623bc752cf238ee3"
95
95
  }
package/src/Provider.js DELETED
@@ -1,9 +0,0 @@
1
- import * as React from "react";
2
- import { ThemeProvider } from "./theming";
3
- import PortalHost from "./components/Portal/PortalHost";
4
- export default class Provider extends React.Component {
5
- render() {
6
- return (React.createElement(PortalHost, null,
7
- React.createElement(ThemeProvider, { theme: this.props.theme }, this.props.children)));
8
- }
9
- }
@@ -1,44 +0,0 @@
1
- import * as React from "react";
2
- import { View, StyleSheet, Pressable, } from "react-native";
3
- import Text from "../Text";
4
- import { withTheme } from "../../theming";
5
- import { extractStyles } from "../../utilities";
6
- const AccordionGroup = ({ label, expanded: expandedProp = false, openColor, closedColor, caretColor: caretColorProp, caretSize = 24, icon, iconSize = 24, style, children, theme, Icon, }) => {
7
- const [expanded, setExpanded] = React.useState(expandedProp);
8
- const { textStyles, viewStyles } = extractStyles(style);
9
- const expandedColor = openColor || theme.colors.primary;
10
- const collapsedColor = closedColor || theme.colors.primary;
11
- const labelColor = expanded ? expandedColor : collapsedColor;
12
- const caretColor = caretColorProp || labelColor;
13
- const handlePressAction = () => {
14
- setExpanded(!expanded);
15
- };
16
- return (React.createElement(React.Fragment, null,
17
- React.createElement(Pressable, { style: [styles.row, viewStyles], onPress: handlePressAction, accessibilityRole: "button" },
18
- icon ? (React.createElement(Icon, { name: icon, size: iconSize, color: labelColor, style: styles.icon })) : null,
19
- React.createElement(View, { style: styles.content },
20
- React.createElement(Text, { selectable: false, style: [
21
- textStyles,
22
- {
23
- color: labelColor,
24
- },
25
- ] }, label)),
26
- React.createElement(Icon, { name: expanded
27
- ? "MaterialIcons/keyboard-arrow-up"
28
- : "MaterialIcons/keyboard-arrow-down", color: caretColor, size: caretSize })),
29
- expanded ? children : null));
30
- };
31
- const styles = StyleSheet.create({
32
- row: {
33
- flexDirection: "row",
34
- alignItems: "center",
35
- },
36
- content: {
37
- flex: 1,
38
- justifyContent: "center",
39
- },
40
- icon: {
41
- marginRight: 8,
42
- },
43
- });
44
- export default withTheme(AccordionGroup);
@@ -1,32 +0,0 @@
1
- import * as React from "react";
2
- import { Pressable, StyleSheet, View, } from "react-native";
3
- import Text from "../Text";
4
- import { extractStyles } from "../../utilities";
5
- import { withTheme } from "../../theming";
6
- const AccordionItem = ({ Icon, icon, label, style, iconColor, theme, ...rest }) => {
7
- const { textStyles, viewStyles } = extractStyles(style);
8
- return (React.createElement(Pressable, { style: [styles.container, viewStyles], ...rest },
9
- React.createElement(View, { style: styles.row },
10
- icon ? (React.createElement(Icon, { name: icon, size: 24, color: iconColor || theme.colors.primary })) : null,
11
- React.createElement(View, { style: [styles.item, styles.content] },
12
- React.createElement(Text, { selectable: false, style: textStyles }, label)))));
13
- };
14
- const styles = StyleSheet.create({
15
- container: {
16
- padding: 8,
17
- },
18
- row: {
19
- flexDirection: "row",
20
- alignItems: "center",
21
- paddingLeft: 8,
22
- },
23
- item: {
24
- marginVertical: 6,
25
- paddingLeft: 8,
26
- },
27
- content: {
28
- flex: 1,
29
- justifyContent: "center",
30
- },
31
- });
32
- export default withTheme(AccordionItem);
@@ -1,2 +0,0 @@
1
- export { default as AccordionGroup } from "./AccordionGroup";
2
- export { default as AccordionItem } from "./AccordionItem";