@draftbit/core 47.0.1-ed6e56.2 → 47.1.1-8b0b37.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 (118) hide show
  1. package/lib/commonjs/components/Button.js +3 -3
  2. package/lib/commonjs/components/Checkbox/Checkbox.js +1 -3
  3. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +1 -2
  4. package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -2
  5. package/lib/commonjs/components/DatePicker/DatePicker.js +0 -1
  6. package/lib/commonjs/components/DatePicker/DatePickerComponent.js +9 -3
  7. package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +1 -0
  8. package/lib/commonjs/components/DeprecatedButton.js +3 -27
  9. package/lib/commonjs/components/DeprecatedFAB.js +1 -2
  10. package/lib/commonjs/components/Pressable.js +37 -0
  11. package/lib/commonjs/components/Swiper/Swiper.js +2 -0
  12. package/lib/commonjs/components/Touchable.js +8 -3
  13. package/lib/commonjs/index.js +7 -0
  14. package/lib/commonjs/mappings/Button.js +39 -10
  15. package/lib/commonjs/mappings/FlashList.js +55 -2
  16. package/lib/commonjs/mappings/FlatList.js +13 -0
  17. package/lib/commonjs/mappings/Swiper.js +2 -0
  18. package/lib/commonjs/mappings/Touchable.js +47 -7
  19. package/lib/module/components/Button.js +3 -3
  20. package/lib/module/components/CardBlock.js +14 -4
  21. package/lib/module/components/Checkbox/Checkbox.js +2 -3
  22. package/lib/module/components/Checkbox/CheckboxGroupRow.js +2 -3
  23. package/lib/module/components/Checkbox/CheckboxRow.js +2 -3
  24. package/lib/module/components/CircularProgress.js +28 -8
  25. package/lib/module/components/DatePicker/DatePicker.js +0 -1
  26. package/lib/module/components/DatePicker/DatePickerComponent.js +9 -3
  27. package/lib/module/components/DatePicker/DatePickerComponent.web.js +1 -0
  28. package/lib/module/components/DeprecatedButton.js +4 -28
  29. package/lib/module/components/DeprecatedFAB.js +2 -3
  30. package/lib/module/components/Image.js +18 -2
  31. package/lib/module/components/Picker/PickerComponent.android.js +21 -3
  32. package/lib/module/components/Pressable.js +30 -0
  33. package/lib/module/components/RadioButton/context.js +1 -1
  34. package/lib/module/components/Swiper/Swiper.js +2 -0
  35. package/lib/module/components/Touchable.js +8 -3
  36. package/lib/module/hooks.js +1 -2
  37. package/lib/module/index.js +1 -0
  38. package/lib/module/mappings/Button.js +40 -11
  39. package/lib/module/mappings/FlashList.js +56 -3
  40. package/lib/module/mappings/FlatList.js +14 -1
  41. package/lib/module/mappings/Swiper.js +3 -1
  42. package/lib/module/mappings/Touchable.js +49 -9
  43. package/lib/typescript/src/components/Button.d.ts.map +1 -1
  44. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -2
  45. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts.map +1 -1
  46. package/lib/typescript/src/components/Checkbox/CheckboxGroupRow.d.ts.map +1 -1
  47. package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts.map +1 -1
  48. package/lib/typescript/src/components/DatePicker/DatePicker.d.ts.map +1 -1
  49. package/lib/typescript/src/components/DatePicker/DatePickerComponent.d.ts.map +1 -1
  50. package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.d.ts.map +1 -1
  51. package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts +0 -2
  52. package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts.map +1 -1
  53. package/lib/typescript/src/components/DeprecatedButton.d.ts +2 -2
  54. package/lib/typescript/src/components/DeprecatedButton.d.ts.map +1 -1
  55. package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
  56. package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -1
  57. package/lib/typescript/src/components/Pressable.d.ts +10 -0
  58. package/lib/typescript/src/components/Pressable.d.ts.map +1 -0
  59. package/lib/typescript/src/components/Swiper/Swiper.d.ts +2 -1
  60. package/lib/typescript/src/components/Swiper/Swiper.d.ts.map +1 -1
  61. package/lib/typescript/src/components/Touchable.d.ts +5 -6
  62. package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
  63. package/lib/typescript/src/index.d.ts +1 -0
  64. package/lib/typescript/src/index.d.ts.map +1 -1
  65. package/lib/typescript/src/mappings/Button.d.ts +113 -4
  66. package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
  67. package/lib/typescript/src/mappings/FlashList.d.ts +134 -2
  68. package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
  69. package/lib/typescript/src/mappings/FlatList.d.ts +43 -0
  70. package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
  71. package/lib/typescript/src/mappings/Swiper.d.ts +11 -0
  72. package/lib/typescript/src/mappings/Swiper.d.ts.map +1 -1
  73. package/lib/typescript/src/mappings/Touchable.d.ts +59 -5
  74. package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
  75. package/package.json +6 -6
  76. package/src/components/Button.js +3 -3
  77. package/src/components/Button.tsx +14 -4
  78. package/src/components/Checkbox/Checkbox.js +2 -3
  79. package/src/components/Checkbox/Checkbox.tsx +5 -7
  80. package/src/components/Checkbox/CheckboxGroupRow.js +2 -3
  81. package/src/components/Checkbox/CheckboxGroupRow.tsx +3 -3
  82. package/src/components/Checkbox/CheckboxRow.js +2 -3
  83. package/src/components/Checkbox/CheckboxRow.tsx +3 -3
  84. package/src/components/DatePicker/DatePicker.js +1 -1
  85. package/src/components/DatePicker/DatePicker.tsx +0 -1
  86. package/src/components/DatePicker/DatePickerComponent.js +5 -3
  87. package/src/components/DatePicker/DatePickerComponent.tsx +11 -3
  88. package/src/components/DatePicker/DatePickerComponent.web.js +1 -1
  89. package/src/components/DatePicker/DatePickerComponent.web.tsx +1 -0
  90. package/src/components/DatePicker/DatePickerComponentType.ts +0 -9
  91. package/src/components/DeprecatedButton.js +4 -16
  92. package/src/components/DeprecatedButton.tsx +7 -31
  93. package/src/components/DeprecatedFAB.js +2 -3
  94. package/src/components/DeprecatedFAB.tsx +5 -5
  95. package/src/components/Pressable.js +12 -0
  96. package/src/components/Pressable.tsx +44 -0
  97. package/src/components/Swiper/Swiper.js +2 -2
  98. package/src/components/Swiper/Swiper.tsx +3 -0
  99. package/src/components/Touchable.js +3 -3
  100. package/src/components/Touchable.tsx +11 -7
  101. package/src/index.js +1 -0
  102. package/src/index.tsx +1 -0
  103. package/src/mappings/Button.js +39 -10
  104. package/src/mappings/Button.ts +41 -10
  105. package/src/mappings/FlashList.js +87 -31
  106. package/src/mappings/FlashList.ts +92 -30
  107. package/src/mappings/FlatList.js +14 -1
  108. package/src/mappings/FlatList.ts +17 -0
  109. package/src/mappings/Swiper.js +3 -1
  110. package/src/mappings/Swiper.ts +4 -0
  111. package/src/mappings/Touchable.js +50 -7
  112. package/src/mappings/Touchable.ts +53 -6
  113. package/lib/commonjs/components/DatePicker/DatePickerInput.js +0 -133
  114. package/lib/module/components/DatePicker/DatePickerInput.js +0 -123
  115. package/lib/typescript/src/components/DatePicker/DatePickerInput.d.ts +0 -18
  116. package/lib/typescript/src/components/DatePicker/DatePickerInput.d.ts.map +0 -1
  117. package/src/components/DatePicker/DatePickerInput.js +0 -97
  118. package/src/components/DatePicker/DatePickerInput.tsx +0 -195
@@ -21,10 +21,11 @@ function Base(_ref) {
21
21
  Icon,
22
22
  icon,
23
23
  title,
24
- onPress,
25
24
  loading,
26
25
  disabled,
27
26
  style,
27
+ activeOpacity,
28
+ disabledOpacity,
28
29
  ...props
29
30
  } = _ref;
30
31
  const {
@@ -61,14 +62,13 @@ function Base(_ref) {
61
62
  buttonStyles.justifyContent = "flex-end";
62
63
  }
63
64
  return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
64
- onPress: onPress,
65
65
  disabled: disabled || loading,
66
66
  style: _ref2 => {
67
67
  let {
68
68
  pressed
69
69
  } = _ref2;
70
70
  return [styles.base, {
71
- opacity: pressed || disabled ? 0.75 : 1
71
+ opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
72
72
  }, buttonStyles];
73
73
  }
74
74
  }, props), loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
@@ -7,9 +7,7 @@ exports.default = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _theming = require("../../theming");
10
- var _Touchable = _interopRequireDefault(require("../Touchable"));
11
10
  var _hooks = require("../../hooks");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
13
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -60,7 +58,7 @@ const Checkbox = _ref => {
60
58
  onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
61
59
  }
62
60
  };
63
- return /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
61
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({}, rest, {
64
62
  onPress: handlePress,
65
63
  disabled: disabled,
66
64
  accessibilityState: {
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
9
9
  var _Checkbox = _interopRequireDefault(require("./Checkbox"));
10
10
  var _Text = _interopRequireDefault(require("../Text"));
11
11
  var _context = require("./context");
12
- var _Touchable = _interopRequireDefault(require("../Touchable"));
13
12
  var _utilities = require("../../utilities");
14
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -73,7 +72,7 @@ const CheckboxGroupRow = _ref => {
73
72
  textStyles,
74
73
  viewStyles
75
74
  } = (0, _utilities.extractStyles)(style);
76
- return /*#__PURE__*/React.createElement(_Touchable.default, _extends({
75
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
77
76
  onPress: handlePress,
78
77
  style: [styles.mainParent, {
79
78
  flexDirection: direction
@@ -10,7 +10,6 @@ var _lodash = require("lodash");
10
10
  var _utilities = require("../../utilities");
11
11
  var _hooks = require("../../hooks");
12
12
  var _Text = _interopRequireDefault(require("../Text"));
13
- var _Touchable = _interopRequireDefault(require("../Touchable"));
14
13
  var _Checkbox = _interopRequireDefault(require("./Checkbox"));
15
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
15
  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); }
@@ -83,7 +82,7 @@ const CheckboxRow = _ref => {
83
82
  textStyles,
84
83
  viewStyles
85
84
  } = (0, _utilities.extractStyles)(style);
86
- return /*#__PURE__*/React.createElement(_Touchable.default, _extends({
85
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
87
86
  onPress: handlePress,
88
87
  style: [viewStyles, styles.mainParent, {
89
88
  flexDirection: direction
@@ -352,7 +352,6 @@ const DatePicker = _ref => {
352
352
  }, /*#__PURE__*/React.createElement(_DatePickerComponent.default, {
353
353
  value: getValidDate(),
354
354
  mode: mode,
355
- displayMode: "default",
356
355
  isVisible: pickerVisible,
357
356
  toggleVisibility: toggleVisibility,
358
357
  onChange: (_event, data) => {
@@ -5,21 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _datetimepicker = _interopRequireDefault(require("@react-native-community/datetimepicker"));
8
10
  var _reactNativeModalDatetimePicker = _interopRequireDefault(require("react-native-modal-datetime-picker"));
9
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
12
  const DatePickerComponent = _ref => {
11
13
  let {
12
14
  value,
13
15
  onChange,
14
- displayMode = "default",
15
16
  mode,
16
17
  toggleVisibility
17
18
  } = _ref;
18
- return /*#__PURE__*/_react.default.createElement(_reactNativeModalDatetimePicker.default, {
19
+ return _reactNative.Platform.OS === "ios" || _reactNative.Platform.OS === "android" ? /*#__PURE__*/_react.default.createElement(_reactNativeModalDatetimePicker.default, {
19
20
  date: value,
20
21
  mode: mode,
21
22
  isVisible: true,
22
- display: displayMode,
23
+ display: _reactNative.Platform.OS === "ios" ? "spinner" : "default",
23
24
  onCancel: () => {
24
25
  console.log("Picker cancelled before selecting anything.");
25
26
  toggleVisibility();
@@ -27,6 +28,11 @@ const DatePickerComponent = _ref => {
27
28
  onConfirm: data => {
28
29
  onChange(null, data);
29
30
  }
31
+ }) : /*#__PURE__*/_react.default.createElement(_datetimepicker.default, {
32
+ value: value,
33
+ mode: mode,
34
+ onChange: onChange,
35
+ display: "default"
30
36
  });
31
37
  };
32
38
  var _default = DatePickerComponent;
@@ -43,6 +43,7 @@ const DatePickerComponent = _ref => {
43
43
  onChange(null, d);
44
44
  },
45
45
  onClose: () => toggleVisibility(),
46
+ variant: "dialog",
46
47
  TextFieldComponent: () => null
47
48
  })));
48
49
  };
@@ -8,7 +8,6 @@ var React = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _color = _interopRequireDefault(require("color"));
10
10
  var _Config = _interopRequireDefault(require("./Config"));
11
- var _Touchable = _interopRequireDefault(require("./Touchable"));
12
11
  var _Elevation = _interopRequireDefault(require("./Elevation"));
13
12
  var _theming = require("../theming");
14
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -27,7 +26,6 @@ const Button = _ref => {
27
26
  children,
28
27
  onPress,
29
28
  elevation = 0,
30
- style,
31
29
  theme: {
32
30
  colors,
33
31
  disabledOpacity,
@@ -81,41 +79,19 @@ const Button = _ref => {
81
79
  marginRight: -8,
82
80
  width: _Config.default.buttonIconSize
83
81
  }];
84
- const {
85
- margin,
86
- marginEnd,
87
- marginTop,
88
- marginLeft,
89
- marginRight,
90
- marginBottom,
91
- marginHorizontal,
92
- marginVertical,
93
- ...innerStyles
94
- } = _reactNative.StyleSheet.flatten(style || {});
95
- const margins = {
96
- margin,
97
- marginEnd,
98
- marginTop,
99
- marginLeft,
100
- marginRight,
101
- marginBottom,
102
- marginHorizontal,
103
- marginVertical
104
- };
105
82
  return /*#__PURE__*/React.createElement(_Elevation.default, {
106
83
  style: {
107
84
  elevation,
108
- alignSelf: "stretch",
109
- ...margins
85
+ alignSelf: "stretch"
110
86
  }
111
- }, /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
87
+ }, /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({}, rest, {
112
88
  onPress: onPress,
113
89
  accessibilityState: {
114
90
  disabled
115
91
  },
116
92
  accessibilityRole: "button",
117
93
  disabled: disabled || loading,
118
- style: [styles.button, buttonStyle, innerStyles]
94
+ style: [styles.button, buttonStyle]
119
95
  }), /*#__PURE__*/React.createElement(_reactNative.View, {
120
96
  style: styles.content
121
97
  }, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
9
9
  var _color = _interopRequireDefault(require("color"));
10
10
  var _Config = _interopRequireDefault(require("./Config"));
11
11
  var _Text = _interopRequireDefault(require("./Text"));
12
- var _Touchable = _interopRequireDefault(require("./Touchable"));
13
12
  var _Elevation = _interopRequireDefault(require("./Elevation"));
14
13
  var _theming = require("../theming");
15
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -107,7 +106,7 @@ const FAB = _ref => {
107
106
  style: [{
108
107
  elevation
109
108
  }, style]
110
- }, /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
109
+ }, /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({}, rest, {
111
110
  onPress: onPress,
112
111
  accessibilityState: {
113
112
  disabled
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = Pressable;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11
+ function Pressable(_ref) {
12
+ let {
13
+ children,
14
+ disabled,
15
+ onPress,
16
+ activeOpacity,
17
+ disabledOpacity,
18
+ delayLongPress,
19
+ hitSlop,
20
+ style,
21
+ ...props
22
+ } = _ref;
23
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
24
+ onPress: onPress,
25
+ disabled: disabled,
26
+ delayLongPress: delayLongPress ? delayLongPress : 500,
27
+ hitSlop: hitSlop ? hitSlop : 8,
28
+ style: _ref2 => {
29
+ let {
30
+ pressed
31
+ } = _ref2;
32
+ return [{
33
+ opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
34
+ }, style];
35
+ }
36
+ }, props), children);
37
+ }
@@ -25,6 +25,7 @@ const Swiper = _ref => {
25
25
  keyExtractor,
26
26
  renderItem,
27
27
  children,
28
+ onIndexChanged,
28
29
  style
29
30
  } = _ref;
30
31
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
@@ -34,6 +35,7 @@ const Swiper = _ref => {
34
35
  loop: loop,
35
36
  timeout: timeout,
36
37
  vertical: vertical,
38
+ onIndexChanged: onIndexChanged,
37
39
  controlsProps: {
38
40
  prevTitle,
39
41
  nextTitle,
@@ -13,19 +13,24 @@ function Touchable(_ref) {
13
13
  children,
14
14
  disabled,
15
15
  onPress,
16
+ activeOpacity,
17
+ disabledOpacity,
18
+ delayLongPress,
19
+ hitSlop,
16
20
  style,
17
21
  ...props
18
22
  } = _ref;
19
23
  return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
20
- onPress: onPress,
21
24
  disabled: disabled,
22
- hitSlop: 8,
25
+ onPress: onPress,
26
+ delayLongPress: delayLongPress ? delayLongPress : 500,
27
+ hitSlop: hitSlop ? hitSlop : 8,
23
28
  style: _ref2 => {
24
29
  let {
25
30
  pressed
26
31
  } = _ref2;
27
32
  return [{
28
- opacity: pressed || disabled ? 0.75 : 1
33
+ opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
29
34
  }, style];
30
35
  }
31
36
  }, props), children);
@@ -225,6 +225,12 @@ Object.defineProperty(exports, "Picker", {
225
225
  return _Picker.default;
226
226
  }
227
227
  });
228
+ Object.defineProperty(exports, "Pressable", {
229
+ enumerable: true,
230
+ get: function () {
231
+ return _Pressable.default;
232
+ }
233
+ });
228
234
  Object.defineProperty(exports, "ProgressBar", {
229
235
  enumerable: true,
230
236
  get: function () {
@@ -438,6 +444,7 @@ var _Switch = _interopRequireWildcard(require("./components/Switch"));
438
444
  var _TextField = _interopRequireDefault(require("./components/TextField"));
439
445
  var _ToggleButton = _interopRequireDefault(require("./components/ToggleButton"));
440
446
  var _Touchable = _interopRequireDefault(require("./components/Touchable"));
447
+ var _Pressable = _interopRequireDefault(require("./components/Pressable"));
441
448
  var _Accordion = require("./components/Accordion");
442
449
  var _ActionSheet = require("./components/ActionSheet");
443
450
  var _Swiper = require("./components/Swiper");
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.SEED_DATA = void 0;
7
7
  var _types = require("@draftbit/types");
8
- const SEED_DATA_TRIGGERS = [_types.Triggers.OnPress];
8
+ const SEED_DATA_TRIGGERS = [_types.Triggers.OnPress, _types.Triggers.OnLongPress];
9
9
  const SEED_DATA_PROPS = {
10
10
  onPress: (0, _types.createActionProp)(),
11
+ onLongPress: (0, _types.createActionProp)(),
11
12
  icon: (0, _types.createIconProp)({
12
13
  defaultValue: null,
13
14
  required: false
@@ -18,12 +19,37 @@ const SEED_DATA_PROPS = {
18
19
  defaultValue: "Get Started"
19
20
  }),
20
21
  disabled: (0, _types.createDisabledProp)(),
21
- loading: (0, _types.createLoadingProp)()
22
- };
23
- const LAYOUT = {
24
- backgroundColor: "transparent",
25
- borderRadius: 8,
26
- fontFamily: "system-700"
22
+ loading: (0, _types.createLoadingProp)(),
23
+ activeOpacity: (0, _types.createStaticNumberProp)({
24
+ label: "Active Opacity",
25
+ description: "Opacity of the button when active.",
26
+ defaultValue: 0.8,
27
+ min: 0,
28
+ max: 1,
29
+ step: 0.01,
30
+ precision: 2,
31
+ required: false
32
+ }),
33
+ disabledOpacity: (0, _types.createStaticNumberProp)({
34
+ label: "Disabled Opacity",
35
+ description: "Opacity of the button when disabled.",
36
+ defaultValue: 0.8,
37
+ min: 0,
38
+ max: 1,
39
+ step: 0.01,
40
+ precision: 2,
41
+ required: false
42
+ }),
43
+ delayLongPress: (0, _types.createStaticNumberProp)({
44
+ label: "Delay Long Press",
45
+ description: "Duration (in milliseconds) from onPressIn before onLongPress is called.",
46
+ required: false
47
+ }),
48
+ hitSlop: (0, _types.createStaticNumberProp)({
49
+ label: "Hit Slop",
50
+ description: "Sets additional distance outside of element in which a press can be detected",
51
+ required: false
52
+ })
27
53
  };
28
54
  const SEED_DATA = [{
29
55
  name: "Button Outline",
@@ -31,7 +57,8 @@ const SEED_DATA = [{
31
57
  category: _types.COMPONENT_TYPES.deprecated,
32
58
  stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
33
59
  layout: {
34
- ...LAYOUT,
60
+ borderRadius: 8,
61
+ fontFamily: "system-700",
35
62
  backgroundColor: "transparent",
36
63
  borderWidth: 1,
37
64
  textAlign: "center"
@@ -44,7 +71,8 @@ const SEED_DATA = [{
44
71
  category: _types.COMPONENT_TYPES.deprecated,
45
72
  stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
46
73
  layout: {
47
- ...LAYOUT,
74
+ borderRadius: 8,
75
+ fontFamily: "system-700",
48
76
  backgroundColor: "primary",
49
77
  textAlign: "center"
50
78
  },
@@ -56,7 +84,8 @@ const SEED_DATA = [{
56
84
  category: _types.COMPONENT_TYPES.button,
57
85
  stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
58
86
  layout: {
59
- ...LAYOUT,
87
+ borderRadius: 8,
88
+ fontFamily: "system-700",
60
89
  backgroundColor: "primary",
61
90
  textAlign: "center"
62
91
  },
@@ -5,7 +5,47 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.SEED_DATA = void 0;
7
7
  var _types = require("@draftbit/types");
8
- const SEED_DATA = {
8
+ const SEED_DATA = [{
9
+ name: "Masonry List",
10
+ tag: "MasonryFlashList",
11
+ description: "Masonry Flashlist by Shopify",
12
+ packageName: "@shopify/flash-list",
13
+ category: _types.COMPONENT_TYPES.data,
14
+ stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
15
+ layout: {
16
+ flex: 1
17
+ },
18
+ triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
19
+ props: {
20
+ onRefresh: (0, _types.createActionProp)(),
21
+ onEndReached: (0, _types.createActionProp)(),
22
+ numColumns: (0, _types.createNumColumnsType)({
23
+ editable: true
24
+ }),
25
+ estimatedItemSize: (0, _types.createNumberProp)({
26
+ group: _types.GROUPS.basic,
27
+ label: "Est. Item Size",
28
+ description: "Approximate size of the items before rendering.",
29
+ defaultValue: 50,
30
+ step: 1,
31
+ precision: 0
32
+ }),
33
+ optimizeItemArrangement: (0, _types.createStaticBoolProp)({
34
+ label: "Optimize Item Arrangement",
35
+ description: "If enabled, MasonryFlashList will try to reduce difference in column height by modifying item order. If true, specifying overrideItemLayout is required. Default value is false."
36
+ }),
37
+ initialNumToRender: (0, _types.createStaticNumberProp)({
38
+ label: "Initial Num To Render",
39
+ description: "How many items to render in the initial batch",
40
+ defaultValue: null
41
+ }),
42
+ onEndReachedThreshold: (0, _types.createStaticNumberProp)({
43
+ label: "End Reached Threshold",
44
+ description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
45
+ defaultValue: 0.5
46
+ })
47
+ }
48
+ }, {
9
49
  name: "FlashList",
10
50
  tag: "FlashList",
11
51
  description: "Flashlist by Shopify",
@@ -15,7 +55,10 @@ const SEED_DATA = {
15
55
  layout: {
16
56
  flex: 1
17
57
  },
58
+ triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
18
59
  props: {
60
+ onRefresh: (0, _types.createActionProp)(),
61
+ onEndReached: (0, _types.createActionProp)(),
19
62
  estimatedItemSize: (0, _types.createNumberProp)({
20
63
  group: _types.GROUPS.basic,
21
64
  label: "Est. Item Size",
@@ -34,7 +77,17 @@ const SEED_DATA = {
34
77
  }),
35
78
  numColumns: (0, _types.createNumColumnsType)({
36
79
  editable: true
80
+ }),
81
+ initialNumToRender: (0, _types.createStaticNumberProp)({
82
+ label: "Initial Num To Render",
83
+ description: "How many items to render in the initial batch",
84
+ defaultValue: null
85
+ }),
86
+ onEndReachedThreshold: (0, _types.createStaticNumberProp)({
87
+ label: "End Reached Threshold",
88
+ description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
89
+ defaultValue: 0.5
37
90
  })
38
91
  }
39
- };
92
+ }];
40
93
  exports.SEED_DATA = SEED_DATA;
@@ -14,7 +14,10 @@ const SEED_DATA = {
14
14
  layout: {
15
15
  flex: 1
16
16
  },
17
+ triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
17
18
  props: {
19
+ onRefresh: (0, _types.createActionProp)(),
20
+ onEndReached: (0, _types.createActionProp)(),
18
21
  horizontal: (0, _types.createStaticBoolProp)({
19
22
  label: "Horizontal",
20
23
  description: "Render list horizontally"
@@ -25,6 +28,16 @@ const SEED_DATA = {
25
28
  }),
26
29
  numColumns: (0, _types.createNumColumnsType)({
27
30
  editable: true
31
+ }),
32
+ initialNumToRender: (0, _types.createStaticNumberProp)({
33
+ label: "Initial Num To Render",
34
+ description: "How many items to render in the initial batch",
35
+ defaultValue: null
36
+ }),
37
+ onEndReachedThreshold: (0, _types.createStaticNumberProp)({
38
+ label: "End Reached Threshold",
39
+ description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
40
+ defaultValue: 0.5
28
41
  })
29
42
  }
30
43
  };
@@ -14,7 +14,9 @@ const SEED_DATA = {
14
14
  height: 300,
15
15
  width: "100%"
16
16
  },
17
+ triggers: [_types.Triggers.OnIndexChanged],
17
18
  props: {
19
+ onIndexChanged: (0, _types.createActionProp)(),
18
20
  from: (0, _types.createNumberProp)({
19
21
  group: _types.GROUPS.basic,
20
22
  label: "Initial Slide"
@@ -5,16 +5,56 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.SEED_DATA = void 0;
7
7
  var _types = require("@draftbit/types");
8
- const SEED_DATA = {
9
- name: "Touchable",
10
- tag: "Touchable",
11
- description: "Simple button with no styles",
12
- category: _types.COMPONENT_TYPES.button,
8
+ const SEED_DATA_PROPS = {
13
9
  stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Borders],
14
10
  layout: {},
15
- triggers: [_types.Triggers.OnPress],
11
+ triggers: [_types.Triggers.OnPress, _types.Triggers.OnLongPress],
16
12
  props: {
17
- onPress: (0, _types.createActionProp)()
13
+ onPress: (0, _types.createActionProp)(),
14
+ onLongPress: (0, _types.createActionProp)(),
15
+ activeOpacity: (0, _types.createStaticNumberProp)({
16
+ label: "Active Opacity",
17
+ description: "The opacity when the button is pressed.",
18
+ defaultValue: 0.8,
19
+ min: 0,
20
+ max: 1,
21
+ step: 0.01,
22
+ precision: 2,
23
+ required: false
24
+ }),
25
+ disabledOpacity: (0, _types.createStaticNumberProp)({
26
+ label: "Disabled Opacity",
27
+ description: "The opacity when the button is disabled.",
28
+ defaultValue: 0.8,
29
+ min: 0,
30
+ max: 1,
31
+ step: 0.01,
32
+ precision: 2,
33
+ required: false
34
+ }),
35
+ delayLongPress: (0, _types.createStaticNumberProp)({
36
+ label: "Delay Long Press",
37
+ description: "Duration (in milliseconds) from onPressIn before onLongPress is called.",
38
+ required: false
39
+ }),
40
+ hitSlop: (0, _types.createStaticNumberProp)({
41
+ label: "Hit Slop",
42
+ description: "Sets additional distance outside of element in which a press can be detected.",
43
+ required: false
44
+ })
18
45
  }
19
46
  };
47
+ const SEED_DATA = [{
48
+ name: "Touchable",
49
+ tag: "Touchable",
50
+ description: "An interactive view with no styles",
51
+ category: _types.COMPONENT_TYPES.button,
52
+ ...SEED_DATA_PROPS
53
+ }, {
54
+ name: "Pressable",
55
+ tag: "Pressable",
56
+ description: "An interactive view with no styles",
57
+ category: _types.COMPONENT_TYPES.button,
58
+ ...SEED_DATA_PROPS
59
+ }];
20
60
  exports.SEED_DATA = SEED_DATA;
@@ -13,10 +13,11 @@ function Base(_ref) {
13
13
  Icon,
14
14
  icon,
15
15
  title,
16
- onPress,
17
16
  loading,
18
17
  disabled,
19
18
  style,
19
+ activeOpacity,
20
+ disabledOpacity,
20
21
  ...props
21
22
  } = _ref;
22
23
  const {
@@ -53,14 +54,13 @@ function Base(_ref) {
53
54
  buttonStyles.justifyContent = "flex-end";
54
55
  }
55
56
  return /*#__PURE__*/React.createElement(Pressable, _extends({
56
- onPress: onPress,
57
57
  disabled: disabled || loading,
58
58
  style: _ref2 => {
59
59
  let {
60
60
  pressed
61
61
  } = _ref2;
62
62
  return [styles.base, {
63
- opacity: pressed || disabled ? 0.75 : 1
63
+ opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
64
64
  }, buttonStyles];
65
65
  }
66
66
  }, props), loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
@@ -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, Text } from "react-native";
4
3
  import Image from "./Image";
@@ -42,11 +41,12 @@ const CardBlock = _ref => {
42
41
  const rightDescriptionStyles = [typography.subtitle2, {
43
42
  color: colors.light
44
43
  }];
45
- return /*#__PURE__*/React.createElement(Card, _extends({
44
+ return /*#__PURE__*/React.createElement(Card, {
46
45
  style: style,
47
46
  onPress: onPress,
48
- numColumns: numColumns
49
- }, rest), /*#__PURE__*/React.createElement(View, {
47
+ numColumns: numColumns,
48
+ ...rest
49
+ }, /*#__PURE__*/React.createElement(View, {
50
50
  style: {
51
51
  backgroundColor: colors.background
52
52
  }
@@ -95,4 +95,14 @@ 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
+ };
98
108
  export default withTheme(CardBlock);