@draftbit/core 47.0.1-ed6e56.2 → 47.1.1-1883fa.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 (127) 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/DatePicker.js +1 -1
  16. package/lib/commonjs/mappings/FlashList.js +79 -2
  17. package/lib/commonjs/mappings/FlatList.js +27 -0
  18. package/lib/commonjs/mappings/ScrollView.js +6 -0
  19. package/lib/commonjs/mappings/Swiper.js +2 -0
  20. package/lib/commonjs/mappings/TextField.js +2 -2
  21. package/lib/commonjs/mappings/Touchable.js +47 -7
  22. package/lib/module/components/Button.js +3 -3
  23. package/lib/module/components/Checkbox/Checkbox.js +2 -3
  24. package/lib/module/components/Checkbox/CheckboxGroupRow.js +2 -3
  25. package/lib/module/components/Checkbox/CheckboxRow.js +2 -3
  26. package/lib/module/components/DatePicker/DatePicker.js +0 -1
  27. package/lib/module/components/DatePicker/DatePickerComponent.js +9 -3
  28. package/lib/module/components/DatePicker/DatePickerComponent.web.js +1 -0
  29. package/lib/module/components/DeprecatedButton.js +4 -28
  30. package/lib/module/components/DeprecatedFAB.js +2 -3
  31. package/lib/module/components/Pressable.js +30 -0
  32. package/lib/module/components/Swiper/Swiper.js +2 -0
  33. package/lib/module/components/Touchable.js +8 -3
  34. package/lib/module/index.js +1 -0
  35. package/lib/module/mappings/Button.js +40 -11
  36. package/lib/module/mappings/DatePicker.js +1 -1
  37. package/lib/module/mappings/FlashList.js +80 -3
  38. package/lib/module/mappings/FlatList.js +28 -1
  39. package/lib/module/mappings/ScrollView.js +7 -1
  40. package/lib/module/mappings/Swiper.js +3 -1
  41. package/lib/module/mappings/TextField.js +2 -2
  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/DatePicker.d.ts +1 -1
  68. package/lib/typescript/src/mappings/FlashList.d.ts +183 -2
  69. package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
  70. package/lib/typescript/src/mappings/FlatList.d.ts +73 -0
  71. package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
  72. package/lib/typescript/src/mappings/ScrollView.d.ts +21 -0
  73. package/lib/typescript/src/mappings/ScrollView.d.ts.map +1 -1
  74. package/lib/typescript/src/mappings/Swiper.d.ts +11 -0
  75. package/lib/typescript/src/mappings/Swiper.d.ts.map +1 -1
  76. package/lib/typescript/src/mappings/Touchable.d.ts +59 -5
  77. package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
  78. package/package.json +6 -6
  79. package/src/components/Button.js +3 -3
  80. package/src/components/Button.tsx +14 -4
  81. package/src/components/Checkbox/Checkbox.js +2 -3
  82. package/src/components/Checkbox/Checkbox.tsx +5 -7
  83. package/src/components/Checkbox/CheckboxGroupRow.js +2 -3
  84. package/src/components/Checkbox/CheckboxGroupRow.tsx +3 -3
  85. package/src/components/Checkbox/CheckboxRow.js +2 -3
  86. package/src/components/Checkbox/CheckboxRow.tsx +3 -3
  87. package/src/components/DatePicker/DatePicker.js +1 -1
  88. package/src/components/DatePicker/DatePicker.tsx +0 -1
  89. package/src/components/DatePicker/DatePickerComponent.js +5 -3
  90. package/src/components/DatePicker/DatePickerComponent.tsx +11 -3
  91. package/src/components/DatePicker/DatePickerComponent.web.js +1 -1
  92. package/src/components/DatePicker/DatePickerComponent.web.tsx +1 -0
  93. package/src/components/DatePicker/DatePickerComponentType.ts +0 -9
  94. package/src/components/DeprecatedButton.js +4 -16
  95. package/src/components/DeprecatedButton.tsx +7 -31
  96. package/src/components/DeprecatedFAB.js +2 -3
  97. package/src/components/DeprecatedFAB.tsx +5 -5
  98. package/src/components/Pressable.js +12 -0
  99. package/src/components/Pressable.tsx +44 -0
  100. package/src/components/Swiper/Swiper.js +2 -2
  101. package/src/components/Swiper/Swiper.tsx +3 -0
  102. package/src/components/Touchable.js +3 -3
  103. package/src/components/Touchable.tsx +11 -7
  104. package/src/index.js +1 -0
  105. package/src/index.tsx +1 -0
  106. package/src/mappings/Button.js +39 -10
  107. package/src/mappings/Button.ts +41 -10
  108. package/src/mappings/DatePicker.js +1 -1
  109. package/src/mappings/DatePicker.ts +1 -1
  110. package/src/mappings/FlashList.js +111 -31
  111. package/src/mappings/FlashList.ts +120 -30
  112. package/src/mappings/FlatList.js +28 -1
  113. package/src/mappings/FlatList.ts +34 -0
  114. package/src/mappings/ScrollView.js +7 -1
  115. package/src/mappings/ScrollView.ts +9 -0
  116. package/src/mappings/Swiper.js +3 -1
  117. package/src/mappings/Swiper.ts +4 -0
  118. package/src/mappings/TextField.js +2 -2
  119. package/src/mappings/TextField.ts +2 -2
  120. package/src/mappings/Touchable.js +50 -7
  121. package/src/mappings/Touchable.ts +53 -6
  122. package/lib/commonjs/components/DatePicker/DatePickerInput.js +0 -133
  123. package/lib/module/components/DatePicker/DatePickerInput.js +0 -123
  124. package/lib/typescript/src/components/DatePicker/DatePickerInput.d.ts +0 -18
  125. package/lib/typescript/src/components/DatePicker/DatePickerInput.d.ts.map +0 -1
  126. package/src/components/DatePicker/DatePickerInput.js +0 -97
  127. 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
  },
@@ -156,7 +156,7 @@ const SEED_DATA = [{
156
156
  category: _types.COMPONENT_TYPES.input,
157
157
  layout: null,
158
158
  triggers: [_types.Triggers.OnDateChange],
159
- StylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position],
159
+ stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position],
160
160
  props: {
161
161
  ...SEED_DATA_PROPS,
162
162
  type: {
@@ -5,7 +5,57 @@ 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
+ initialNumToRender: (0, _types.createStaticNumberProp)({
34
+ label: "Initial Num To Render",
35
+ description: "How many items to render in the initial batch",
36
+ defaultValue: null
37
+ }),
38
+ onEndReachedThreshold: (0, _types.createStaticNumberProp)({
39
+ label: "End Reached Threshold",
40
+ 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.",
41
+ defaultValue: 0.5
42
+ }),
43
+ refreshColor: (0, _types.createColorProp)({
44
+ label: "Refreshing Color",
45
+ description: "Color of the refresh indicator"
46
+ }),
47
+ showsHorizontalScrollIndicator: (0, _types.createStaticBoolProp)({
48
+ label: "Show Horizontal Scroll Indicator",
49
+ description: "When true, shows a horizontal scroll indicator. The default value is false.",
50
+ defaultValue: false
51
+ }),
52
+ showsVerticalScrollIndicator: (0, _types.createStaticBoolProp)({
53
+ label: "Show Vertical Scroll Indicator",
54
+ description: "When true, shows a vertical scroll indicator. The default value is true.",
55
+ defaultValue: true
56
+ })
57
+ }
58
+ }, {
9
59
  name: "FlashList",
10
60
  tag: "FlashList",
11
61
  description: "Flashlist by Shopify",
@@ -15,7 +65,10 @@ const SEED_DATA = {
15
65
  layout: {
16
66
  flex: 1
17
67
  },
68
+ triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
18
69
  props: {
70
+ onRefresh: (0, _types.createActionProp)(),
71
+ onEndReached: (0, _types.createActionProp)(),
19
72
  estimatedItemSize: (0, _types.createNumberProp)({
20
73
  group: _types.GROUPS.basic,
21
74
  label: "Est. Item Size",
@@ -34,7 +87,31 @@ const SEED_DATA = {
34
87
  }),
35
88
  numColumns: (0, _types.createNumColumnsType)({
36
89
  editable: true
90
+ }),
91
+ initialNumToRender: (0, _types.createStaticNumberProp)({
92
+ label: "Initial Num To Render",
93
+ description: "How many items to render in the initial batch",
94
+ defaultValue: null
95
+ }),
96
+ onEndReachedThreshold: (0, _types.createStaticNumberProp)({
97
+ label: "End Reached Threshold",
98
+ 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.",
99
+ defaultValue: 0.5
100
+ }),
101
+ refreshColor: (0, _types.createColorProp)({
102
+ label: "Refreshing Color",
103
+ description: "Color of the refresh indicator"
104
+ }),
105
+ showsHorizontalScrollIndicator: (0, _types.createStaticBoolProp)({
106
+ label: "Show Horizontal Scroll Indicator",
107
+ description: "When true, shows a horizontal scroll indicator. The default value is false.",
108
+ defaultValue: false
109
+ }),
110
+ showsVerticalScrollIndicator: (0, _types.createStaticBoolProp)({
111
+ label: "Show Vertical Scroll Indicator",
112
+ description: "When true, shows a vertical scroll indicator. The default value is true.",
113
+ defaultValue: true
37
114
  })
38
115
  }
39
- };
116
+ }];
40
117
  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,30 @@ 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
41
+ }),
42
+ refreshColor: (0, _types.createColorProp)({
43
+ label: "Refreshing Color",
44
+ description: "Color of the refresh indicator"
45
+ }),
46
+ showsHorizontalScrollIndicator: (0, _types.createStaticBoolProp)({
47
+ label: "Show Horizontal Scroll Indicator",
48
+ description: "When true, shows a horizontal scroll indicator. The default value is false.",
49
+ defaultValue: false
50
+ }),
51
+ showsVerticalScrollIndicator: (0, _types.createStaticBoolProp)({
52
+ label: "Show Vertical Scroll Indicator",
53
+ description: "When true, shows a vertical scroll indicator. The default value is true.",
54
+ defaultValue: true
28
55
  })
29
56
  }
30
57
  };
@@ -12,7 +12,9 @@ const SEED_DATA = {
12
12
  category: _types.COMPONENT_TYPES.view,
13
13
  stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
14
14
  layout: {},
15
+ triggers: [_types.Triggers.OnRefresh],
15
16
  props: {
17
+ onRefresh: (0, _types.createActionProp)(),
16
18
  horizontal: (0, _types.createStaticBoolProp)({
17
19
  label: "Horizontal",
18
20
  description: "Render your list horizontally",
@@ -32,6 +34,10 @@ const SEED_DATA = {
32
34
  label: "Bounce",
33
35
  description: "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
34
36
  defaultValue: true
37
+ }),
38
+ refreshColor: (0, _types.createColorProp)({
39
+ label: "Refreshing Color",
40
+ description: "Color of the refresh indicator"
35
41
  })
36
42
  }
37
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"
@@ -283,7 +283,7 @@ const SEED_DATA = [{
283
283
  ...SEED_DATA_PROPS,
284
284
  type: {
285
285
  label: "Appearance",
286
- description: "Type of Datepicker",
286
+ description: "Type of Field",
287
287
  formType: _types.FORM_TYPES.flatArray,
288
288
  propType: _types.PROP_TYPES.STRING,
289
289
  defaultValue: "solid",
@@ -325,7 +325,7 @@ const SEED_DATA = [{
325
325
  ...SEED_DATA_PROPS,
326
326
  type: {
327
327
  label: "Appearance",
328
- description: "Type of Datepicker",
328
+ description: "Type of Field",
329
329
  formType: _types.FORM_TYPES.flatArray,
330
330
  propType: _types.PROP_TYPES.STRING,
331
331
  defaultValue: "solid",