@draftbit/core 46.4.4-64c11a.2 → 46.4.4-808a01.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 (45) hide show
  1. package/lib/commonjs/components/AnimatedCircularProgress.js +12 -2
  2. package/lib/commonjs/components/AspectRatio.js +19 -2
  3. package/lib/commonjs/components/AvatarEdit.js +17 -5
  4. package/lib/commonjs/components/Banner.js +24 -4
  5. package/lib/commonjs/components/CardBlock.js +15 -5
  6. package/lib/commonjs/components/CardContainer.js +15 -5
  7. package/lib/commonjs/components/CardContainerRating.js +15 -5
  8. package/lib/commonjs/components/CardContainerShortImage.js +17 -5
  9. package/lib/commonjs/components/Carousel.js +34 -10
  10. package/lib/commonjs/components/Checkbox/CheckboxRow.js +24 -6
  11. package/lib/commonjs/components/Checkbox/context.js +1 -1
  12. package/lib/commonjs/components/CircleImage.js +16 -2
  13. package/lib/commonjs/components/CircularProgress.js +15 -7
  14. package/lib/commonjs/components/Container.js +17 -5
  15. package/lib/commonjs/components/DeprecatedCardWrapper.js +17 -2
  16. package/lib/commonjs/components/DeprecatedFAB.js +22 -4
  17. package/lib/commonjs/components/Divider.js +16 -2
  18. package/lib/commonjs/components/FAB.js +20 -5
  19. package/lib/commonjs/components/FormRow.js +17 -3
  20. package/lib/commonjs/components/IconButton.js +22 -5
  21. package/lib/commonjs/components/Layout.js +40 -19
  22. package/lib/commonjs/components/NumberInput.js +13 -2
  23. package/lib/commonjs/components/Picker/PickerComponent.web.js +24 -5
  24. package/lib/commonjs/components/Portal/PortalConsumer.js +10 -8
  25. package/lib/commonjs/components/Portal/PortalHost.js +27 -15
  26. package/lib/commonjs/components/Portal/PortalManager.js +19 -11
  27. package/lib/commonjs/components/ProgressBar.js +23 -7
  28. package/lib/commonjs/components/RadioButton/RadioButton.js +14 -3
  29. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +24 -6
  30. package/lib/commonjs/components/ScreenContainer.js +23 -5
  31. package/lib/commonjs/components/Slider.js +24 -5
  32. package/lib/commonjs/components/StarRating.js +25 -5
  33. package/lib/commonjs/components/StepIndicator.js +34 -16
  34. package/lib/commonjs/components/Surface.js +14 -3
  35. package/lib/commonjs/components/Text.js +37 -11
  36. package/lib/commonjs/components/TextField.js +63 -30
  37. package/lib/commonjs/components/ToggleButton.js +18 -3
  38. package/lib/commonjs/components/Touchable.js +16 -2
  39. package/lib/commonjs/mappings/AudioPlayer.js +6 -2
  40. package/lib/module/components/Checkbox/context.js +1 -1
  41. package/lib/module/mappings/AudioPlayer.js +6 -2
  42. package/lib/typescript/src/mappings/AudioPlayer.d.ts +10 -0
  43. package/package.json +3 -3
  44. package/src/mappings/AudioPlayer.js +6 -2
  45. package/src/mappings/AudioPlayer.ts +6 -2
@@ -17,10 +17,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
17
17
 
18
18
  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; }
19
19
 
20
- 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); }
21
-
22
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
-
24
20
  const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
25
21
 
26
22
  const FOCUS_ANIMATION_DURATION = 150;
@@ -30,8 +26,7 @@ const ICON_SIZE = 24;
30
26
  class TextField extends React.Component {
31
27
  constructor() {
32
28
  super(...arguments);
33
-
34
- _defineProperty(this, "state", {
29
+ this.state = {
35
30
  labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
36
31
  focused: false,
37
32
  placeholder: this.props.error ? this.props.placeholder : "",
@@ -39,36 +34,35 @@ class TextField extends React.Component {
39
34
  measured: false,
40
35
  width: 0
41
36
  }
42
- });
43
-
44
- _defineProperty(this, "_timer", setTimeout(() => {}, 0));
37
+ };
38
+ this._timer = setTimeout(() => {}, 0);
45
39
 
46
- _defineProperty(this, "_showPlaceholder", () => {
40
+ this._showPlaceholder = () => {
47
41
  clearTimeout(this._timer); // Set the placeholder in a delay to offset the label animation
48
42
  // If we show it immediately, they'll overlap and look ugly
49
43
 
50
44
  this._timer = setTimeout(() => this.setState({
51
45
  placeholder: this.props.placeholder
52
46
  }), 50);
53
- });
47
+ };
54
48
 
55
- _defineProperty(this, "_hidePlaceholder", () => this.setState({
49
+ this._hidePlaceholder = () => this.setState({
56
50
  placeholder: ""
57
- }));
51
+ });
58
52
 
59
- _defineProperty(this, "_restoreLabel", () => _reactNative.Animated.timing(this.state.labeled, {
53
+ this._restoreLabel = () => _reactNative.Animated.timing(this.state.labeled, {
60
54
  toValue: 1,
61
55
  duration: FOCUS_ANIMATION_DURATION,
62
56
  useNativeDriver: true
63
- }).start());
57
+ }).start();
64
58
 
65
- _defineProperty(this, "_minmizeLabel", () => _reactNative.Animated.timing(this.state.labeled, {
59
+ this._minmizeLabel = () => _reactNative.Animated.timing(this.state.labeled, {
66
60
  toValue: 0,
67
61
  duration: BLUR_ANIMATION_DURATION,
68
62
  useNativeDriver: true
69
- }).start());
63
+ }).start();
70
64
 
71
- _defineProperty(this, "_handleFocus", () => {
65
+ this._handleFocus = () => {
72
66
  if (this.props.disabled) {
73
67
  return;
74
68
  }
@@ -76,9 +70,9 @@ class TextField extends React.Component {
76
70
  this.setState({
77
71
  focused: true
78
72
  });
79
- });
73
+ };
80
74
 
81
- _defineProperty(this, "_handleBlur", () => {
75
+ this._handleBlur = () => {
82
76
  if (this.props.disabled) {
83
77
  return;
84
78
  }
@@ -86,9 +80,9 @@ class TextField extends React.Component {
86
80
  this.setState({
87
81
  focused: false
88
82
  });
89
- });
83
+ };
90
84
 
91
- _defineProperty(this, "_handleChangeText", value => {
85
+ this._handleChangeText = value => {
92
86
  if (this.props.disabled) {
93
87
  return;
94
88
  }
@@ -104,9 +98,9 @@ class TextField extends React.Component {
104
98
  });
105
99
  this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
106
100
  }
107
- });
101
+ };
108
102
 
109
- _defineProperty(this, "_root", undefined);
103
+ this._root = undefined;
110
104
  }
111
105
 
112
106
  static getDerivedStateFromProps(nextProps, prevState) {
@@ -157,10 +151,11 @@ class TextField extends React.Component {
157
151
  focused: !prevState.focused
158
152
  }));
159
153
  }
160
-
161
154
  /**
162
155
  * @internal
163
156
  */
157
+
158
+
164
159
  setNativeProps(args) {
165
160
  return this._root && this._root.setNativeProps(args);
166
161
  }
@@ -203,7 +198,8 @@ class TextField extends React.Component {
203
198
  roundness,
204
199
  disabledOpacity
205
200
  },
206
- render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, props),
201
+ render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, { ...props
202
+ }),
207
203
  ...rest
208
204
  } = this.props;
209
205
  const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
@@ -357,9 +353,9 @@ class TextField extends React.Component {
357
353
 
358
354
  return /*#__PURE__*/React.createElement(_reactNative.View, {
359
355
  style: [styles.container, styleProp]
360
- }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
356
+ }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, { ...leftIconProps,
361
357
  style: leftIconStyle
362
- })) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
358
+ }) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
363
359
  style: (0, _utilities.applyStyles)([containerStyle], {
364
360
  height: style === null || style === void 0 ? void 0 : style.height,
365
361
  backgroundColor: bgColor,
@@ -426,9 +422,9 @@ class TextField extends React.Component {
426
422
  style: {
427
423
  justifyContent: type === "solid" ? "center" : undefined
428
424
  }
429
- }, /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
425
+ }, /*#__PURE__*/React.createElement(Icon, { ...leftIconProps,
430
426
  style: leftIconStyle
431
- }))) : null, render({
427
+ })) : null, render({
432
428
  ref: c => {
433
429
  this._root = c;
434
430
  },
@@ -469,6 +465,43 @@ var _default = (0, _theming.withTheme)(TextField);
469
465
 
470
466
  exports.default = _default;
471
467
 
468
+ const styles = _reactNative.StyleSheet.create({
469
+ container: {
470
+ alignSelf: "stretch"
471
+ },
472
+ placeholder: {
473
+ position: "absolute",
474
+ left: 0
475
+ },
476
+ underline: {
477
+ position: "absolute",
478
+ left: 0,
479
+ right: 0,
480
+ bottom: 0,
481
+ height: 2
482
+ },
483
+ input: {
484
+ flexGrow: 1,
485
+ justifyContent: "center",
486
+ textAlignVertical: "center",
487
+ margin: 0,
488
+ textAlign: _reactNative.I18nManager.isRTL ? "right" : "left"
489
+ }
490
+ });? /*#__PURE__*/React.createElement(_reactNative.Text, {
491
+ style: [{
492
+ color: error ? colors.error : colors.light,
493
+ marginTop: 8,
494
+ marginLeft: assistiveTextLeftMargin
495
+ }]
496
+ }, assistiveText) : null);
497
+ }
498
+
499
+ }
500
+
501
+ var _default = (0, _theming.withTheme)(TextField);
502
+
503
+ exports.default = _default;
504
+
472
505
  const styles = _reactNative.StyleSheet.create({
473
506
  container: {
474
507
  alignSelf: "stretch"
@@ -19,8 +19,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
 
20
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
21
 
22
- 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); }
23
-
24
22
  const ToggleButton = _ref => {
25
23
  let {
26
24
  Icon,
@@ -58,7 +56,7 @@ const ToggleButton = _ref => {
58
56
  onPress(!internalValue);
59
57
  };
60
58
 
61
- return /*#__PURE__*/React.createElement(_IconButton.default, _extends({
59
+ return /*#__PURE__*/React.createElement(_IconButton.default, {
62
60
  Icon: Icon,
63
61
  icon: icon,
64
62
  size: iconSize,
@@ -70,6 +68,23 @@ const ToggleButton = _ref => {
70
68
  height,
71
69
  backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
72
70
  borderColor: colors[borderColor]
71
+ }, style],
72
+ ...rest
73
+ });
74
+ };
75
+
76
+ const styles = _reactNative.StyleSheet.create({
77
+ mainContainer: {
78
+ borderWidth: 1
79
+ }
80
+ });
81
+
82
+ var _default = (0, _theming.withTheme)(ToggleButton);
83
+
84
+ exports.default = _default;th,
85
+ height,
86
+ backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
87
+ borderColor: colors[borderColor]
73
88
  }, style]
74
89
  }, rest));
75
90
  };
@@ -11,8 +11,6 @@ var _reactNative = require("react-native");
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
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); }
15
-
16
14
  function Touchable(_ref) {
17
15
  let {
18
16
  children,
@@ -21,6 +19,22 @@ function Touchable(_ref) {
21
19
  style,
22
20
  ...props
23
21
  } = _ref;
22
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
23
+ onPress: onPress,
24
+ disabled: disabled,
25
+ hitSlop: 8,
26
+ style: _ref2 => {
27
+ let {
28
+ pressed
29
+ } = _ref2;
30
+ return [{
31
+ opacity: pressed || disabled ? 0.75 : 1
32
+ }, style];
33
+ },
34
+ ...props
35
+ }, children);
36
+ }rops
37
+ } = _ref;
24
38
  return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
25
39
  onPress: onPress,
26
40
  disabled: disabled,
@@ -39,16 +39,20 @@ const SEED_DATA = {
39
39
  defaultValue: "black"
40
40
  }),
41
41
  completedTrackColor: (0, _types.createColorProp)({
42
- label: "Completed Track Color",
42
+ label: "Completed Track",
43
43
  defaultValue: "white"
44
44
  }),
45
45
  remainingTrackColor: (0, _types.createColorProp)({
46
- label: "Remaining Track Color",
46
+ label: "Remaining Track",
47
47
  defaultValue: "#333333"
48
48
  }),
49
49
  trackThumbSize: (0, _types.createNumberProp)({
50
50
  label: "Thumb Size",
51
51
  defaultValue: 24
52
+ }),
53
+ playIconColor: (0, _types.createColorProp)({
54
+ label: "Play Icon",
55
+ defaultValue: "black"
52
56
  })
53
57
  }
54
58
  };
@@ -1,5 +1,5 @@
1
1
  import { createContext, useContext } from "react";
2
- export let Direction;
2
+ export var Direction;
3
3
 
4
4
  (function (Direction) {
5
5
  Direction["Horizontal"] = "horizontal";
@@ -31,16 +31,20 @@ export const SEED_DATA = {
31
31
  defaultValue: "black"
32
32
  }),
33
33
  completedTrackColor: createColorProp({
34
- label: "Completed Track Color",
34
+ label: "Completed Track",
35
35
  defaultValue: "white"
36
36
  }),
37
37
  remainingTrackColor: createColorProp({
38
- label: "Remaining Track Color",
38
+ label: "Remaining Track",
39
39
  defaultValue: "#333333"
40
40
  }),
41
41
  trackThumbSize: createNumberProp({
42
42
  label: "Thumb Size",
43
43
  defaultValue: 24
44
+ }),
45
+ playIconColor: createColorProp({
46
+ label: "Play Icon",
47
+ defaultValue: "black"
44
48
  })
45
49
  }
46
50
  };
@@ -66,5 +66,15 @@ export declare const SEED_DATA: {
66
66
  required: boolean;
67
67
  step: number;
68
68
  };
69
+ playIconColor: {
70
+ group: string;
71
+ label: string;
72
+ description: string;
73
+ editable: boolean;
74
+ required: boolean;
75
+ defaultValue: null;
76
+ formType: string;
77
+ propType: string;
78
+ };
69
79
  };
70
80
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.4.4-64c11a.2+64c11a6",
3
+ "version": "46.4.4-808a01.2+808a01f",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^46.4.4-64c11a.2+64c11a6",
44
+ "@draftbit/types": "^46.4.4-808a01.2+808a01f",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.3",
@@ -81,5 +81,5 @@
81
81
  ]
82
82
  ]
83
83
  },
84
- "gitHead": "64c11a6d42bef20b500a03e6ca52f5ad693d569f"
84
+ "gitHead": "808a01f4217781b64477c695613005de9f9e4f2f"
85
85
  }
@@ -38,16 +38,20 @@ export const SEED_DATA = {
38
38
  defaultValue: "black",
39
39
  }),
40
40
  completedTrackColor: createColorProp({
41
- label: "Completed Track Color",
41
+ label: "Completed Track",
42
42
  defaultValue: "white",
43
43
  }),
44
44
  remainingTrackColor: createColorProp({
45
- label: "Remaining Track Color",
45
+ label: "Remaining Track",
46
46
  defaultValue: "#333333",
47
47
  }),
48
48
  trackThumbSize: createNumberProp({
49
49
  label: "Thumb Size",
50
50
  defaultValue: 24,
51
51
  }),
52
+ playIconColor: createColorProp({
53
+ label: "Play Icon",
54
+ defaultValue: "black",
55
+ }),
52
56
  },
53
57
  };
@@ -48,16 +48,20 @@ export const SEED_DATA = {
48
48
  defaultValue: "black",
49
49
  }),
50
50
  completedTrackColor: createColorProp({
51
- label: "Completed Track Color",
51
+ label: "Completed Track",
52
52
  defaultValue: "white",
53
53
  }),
54
54
  remainingTrackColor: createColorProp({
55
- label: "Remaining Track Color",
55
+ label: "Remaining Track",
56
56
  defaultValue: "#333333",
57
57
  }),
58
58
  trackThumbSize: createNumberProp({
59
59
  label: "Thumb Size",
60
60
  defaultValue: 24,
61
61
  }),
62
+ playIconColor: createColorProp({
63
+ label: "Play Icon",
64
+ defaultValue: "black",
65
+ }),
62
66
  },
63
67
  };