@draftbit/core 47.0.1-17098e.2 → 47.0.1-2935a8.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 (87) hide show
  1. package/lib/commonjs/components/Button.js +15 -27
  2. package/lib/commonjs/components/Checkbox/Checkbox.js +3 -1
  3. package/lib/commonjs/components/DeprecatedButton.js +151 -0
  4. package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -2
  5. package/lib/commonjs/components/DeprecatedFAB.js +2 -1
  6. package/lib/commonjs/components/Picker/Picker.js +4 -3
  7. package/lib/commonjs/components/Picker/PickerComponent.ios.js +2 -2
  8. package/lib/commonjs/components/Touchable.js +11 -27
  9. package/lib/commonjs/components/Touchable.web.js +9 -0
  10. package/lib/commonjs/mappings/Button.js +10 -14
  11. package/lib/commonjs/mappings/FlashList.js +38 -2
  12. package/lib/commonjs/mappings/FlatList.js +9 -0
  13. package/lib/commonjs/mappings/Touchable.js +20 -0
  14. package/lib/module/components/Button.js +9 -21
  15. package/lib/module/components/Checkbox/Checkbox.js +3 -2
  16. package/lib/module/components/DeprecatedButton.js +141 -0
  17. package/lib/module/components/DeprecatedCardWrapper.js +2 -2
  18. package/lib/module/components/DeprecatedFAB.js +3 -2
  19. package/lib/module/components/Picker/Picker.js +4 -3
  20. package/lib/module/components/Picker/PickerComponent.ios.js +1 -1
  21. package/lib/module/components/Touchable.js +10 -25
  22. package/lib/module/components/Touchable.web.js +2 -0
  23. package/lib/module/mappings/Button.js +11 -15
  24. package/lib/module/mappings/FlashList.js +39 -3
  25. package/lib/module/mappings/FlatList.js +10 -1
  26. package/lib/module/mappings/Touchable.js +13 -0
  27. package/lib/typescript/src/components/Button.d.ts +0 -2
  28. package/lib/typescript/src/components/Button.d.ts.map +1 -1
  29. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -2
  30. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts.map +1 -1
  31. package/lib/typescript/src/components/DeprecatedButton.d.ts +54 -0
  32. package/lib/typescript/src/components/DeprecatedButton.d.ts.map +1 -0
  33. package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +1 -1
  34. package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
  35. package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -1
  36. package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
  37. package/lib/typescript/src/components/Touchable.d.ts +2 -9
  38. package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
  39. package/lib/typescript/src/components/Touchable.web.d.ts +3 -0
  40. package/lib/typescript/src/components/Touchable.web.d.ts.map +1 -0
  41. package/lib/typescript/src/mappings/Button.d.ts +2 -224
  42. package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
  43. package/lib/typescript/src/mappings/FlashList.d.ts +130 -2
  44. package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
  45. package/lib/typescript/src/mappings/FlatList.d.ts +51 -0
  46. package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
  47. package/lib/typescript/src/mappings/Touchable.d.ts +22 -0
  48. package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -0
  49. package/package.json +3 -3
  50. package/src/components/Button.js +11 -18
  51. package/src/components/Button.tsx +11 -45
  52. package/src/components/Checkbox/Checkbox.js +3 -2
  53. package/src/components/Checkbox/Checkbox.tsx +7 -5
  54. package/src/components/DeprecatedButton.js +95 -0
  55. package/src/components/DeprecatedButton.tsx +214 -0
  56. package/src/components/DeprecatedCardWrapper.js +2 -2
  57. package/src/components/DeprecatedCardWrapper.tsx +4 -3
  58. package/src/components/DeprecatedFAB.js +3 -2
  59. package/src/components/DeprecatedFAB.tsx +5 -5
  60. package/src/components/Picker/Picker.js +4 -3
  61. package/src/components/Picker/Picker.tsx +4 -4
  62. package/src/components/Picker/PickerComponent.ios.js +1 -1
  63. package/src/components/Picker/PickerComponent.ios.tsx +1 -1
  64. package/src/components/Touchable.js +11 -16
  65. package/src/components/Touchable.tsx +11 -42
  66. package/src/components/Touchable.web.js +2 -0
  67. package/src/components/Touchable.web.tsx +3 -0
  68. package/src/mappings/Button.js +10 -14
  69. package/src/mappings/Button.ts +10 -14
  70. package/src/mappings/FlashList.js +75 -31
  71. package/src/mappings/FlashList.ts +77 -30
  72. package/src/mappings/FlatList.js +15 -1
  73. package/src/mappings/FlatList.ts +16 -0
  74. package/src/mappings/Touchable.js +17 -0
  75. package/src/mappings/Touchable.ts +23 -0
  76. package/lib/commonjs/components/Pressable.js +0 -48
  77. package/lib/commonjs/mappings/Pressable.js +0 -52
  78. package/lib/module/components/Pressable.js +0 -40
  79. package/lib/module/mappings/Pressable.js +0 -45
  80. package/lib/typescript/src/components/Pressable.d.ts +0 -18
  81. package/lib/typescript/src/components/Pressable.d.ts.map +0 -1
  82. package/lib/typescript/src/mappings/Pressable.d.ts +0 -76
  83. package/lib/typescript/src/mappings/Pressable.d.ts.map +0 -1
  84. package/src/components/Pressable.js +0 -17
  85. package/src/components/Pressable.tsx +0 -67
  86. package/src/mappings/Pressable.js +0 -52
  87. package/src/mappings/Pressable.ts +0 -63
@@ -5,122 +5,10 @@ export declare const SEED_DATA: ({
5
5
  stylesPanelSections: string[];
6
6
  layout: {
7
7
  backgroundColor: string;
8
- borderRadius: number;
9
- fontFamily: string;
10
8
  borderWidth: number;
11
9
  textAlign: string;
12
- height?: undefined;
13
- };
14
- triggers: string[];
15
- props: {
16
- onPress: {
17
- label: string;
18
- description: string;
19
- editable: boolean;
20
- required: boolean;
21
- formType: string;
22
- propType: string;
23
- defaultValue: null;
24
- group: string;
25
- };
26
- onLongPress: {
27
- label: string;
28
- description: string;
29
- editable: boolean;
30
- required: boolean;
31
- formType: string;
32
- propType: string;
33
- defaultValue: null;
34
- group: string;
35
- };
36
- icon: {
37
- label: string;
38
- description: string;
39
- formType: string;
40
- propType: string;
41
- defaultValue: string;
42
- required: boolean;
43
- editable: boolean;
44
- group: string;
45
- };
46
- title: any;
47
- disabled: {
48
- label: string;
49
- description: string;
50
- group: string;
51
- editable: boolean;
52
- required: boolean;
53
- formType: string;
54
- propType: string;
55
- defaultValue: null;
56
- };
57
- loading: {
58
- label: string;
59
- description: string;
60
- group: string;
61
- editable: boolean;
62
- required: boolean;
63
- formType: string;
64
- propType: string;
65
- defaultValue: null;
66
- };
67
- activeOpacity: {
68
- label: string;
69
- description: string;
70
- formType: string;
71
- propType: string;
72
- group: string;
73
- defaultValue: null;
74
- editable: boolean;
75
- required: boolean;
76
- step: number;
77
- };
78
- disabledOpacity: {
79
- label: string;
80
- description: string;
81
- formType: string;
82
- propType: string;
83
- group: string;
84
- defaultValue: null;
85
- editable: boolean;
86
- required: boolean;
87
- step: number;
88
- };
89
- delayLongPress: {
90
- label: string;
91
- description: string;
92
- formType: string;
93
- propType: string;
94
- group: string;
95
- defaultValue: null;
96
- editable: boolean;
97
- required: boolean;
98
- step: number;
99
- };
100
- hitSlop: {
101
- label: string;
102
- description: string;
103
- formType: string;
104
- propType: string;
105
- group: string;
106
- defaultValue: null;
107
- editable: boolean;
108
- required: boolean;
109
- step: number;
110
- };
111
- };
112
- } | {
113
- name: string;
114
- tag: string;
115
- category: string;
116
- stylesPanelSections: string[];
117
- layout: {
118
10
  borderRadius: number;
119
11
  fontFamily: string;
120
- backgroundColor: string;
121
- textAlign: string;
122
- borderWidth?: undefined;
123
- height?: undefined;
124
12
  };
125
13
  triggers: string[];
126
14
  props: {
@@ -134,16 +22,6 @@ export declare const SEED_DATA: ({
134
22
  defaultValue: null;
135
23
  group: string;
136
24
  };
137
- onLongPress: {
138
- label: string;
139
- description: string;
140
- editable: boolean;
141
- required: boolean;
142
- formType: string;
143
- propType: string;
144
- defaultValue: null;
145
- group: string;
146
- };
147
25
  icon: {
148
26
  label: string;
149
27
  description: string;
@@ -175,50 +53,6 @@ export declare const SEED_DATA: ({
175
53
  propType: string;
176
54
  defaultValue: null;
177
55
  };
178
- activeOpacity: {
179
- label: string;
180
- description: string;
181
- formType: string;
182
- propType: string;
183
- group: string;
184
- defaultValue: null;
185
- editable: boolean;
186
- required: boolean;
187
- step: number;
188
- };
189
- disabledOpacity: {
190
- label: string;
191
- description: string;
192
- formType: string;
193
- propType: string;
194
- group: string;
195
- defaultValue: null;
196
- editable: boolean;
197
- required: boolean;
198
- step: number;
199
- };
200
- delayLongPress: {
201
- label: string;
202
- description: string;
203
- formType: string;
204
- propType: string;
205
- group: string;
206
- defaultValue: null;
207
- editable: boolean;
208
- required: boolean;
209
- step: number;
210
- };
211
- hitSlop: {
212
- label: string;
213
- description: string;
214
- formType: string;
215
- propType: string;
216
- group: string;
217
- defaultValue: null;
218
- editable: boolean;
219
- required: boolean;
220
- step: number;
221
- };
222
56
  };
223
57
  } | {
224
58
  name: string;
@@ -226,12 +60,10 @@ export declare const SEED_DATA: ({
226
60
  category: string;
227
61
  stylesPanelSections: string[];
228
62
  layout: {
229
- borderRadius: number;
230
- height: number;
231
- fontFamily: string;
232
63
  backgroundColor: string;
233
64
  textAlign: string;
234
- borderWidth?: undefined;
65
+ borderRadius: number;
66
+ fontFamily: string;
235
67
  };
236
68
  triggers: string[];
237
69
  props: {
@@ -245,16 +77,6 @@ export declare const SEED_DATA: ({
245
77
  defaultValue: null;
246
78
  group: string;
247
79
  };
248
- onLongPress: {
249
- label: string;
250
- description: string;
251
- editable: boolean;
252
- required: boolean;
253
- formType: string;
254
- propType: string;
255
- defaultValue: null;
256
- group: string;
257
- };
258
80
  icon: {
259
81
  label: string;
260
82
  description: string;
@@ -286,50 +108,6 @@ export declare const SEED_DATA: ({
286
108
  propType: string;
287
109
  defaultValue: null;
288
110
  };
289
- activeOpacity: {
290
- label: string;
291
- description: string;
292
- formType: string;
293
- propType: string;
294
- group: string;
295
- defaultValue: null;
296
- editable: boolean;
297
- required: boolean;
298
- step: number;
299
- };
300
- disabledOpacity: {
301
- label: string;
302
- description: string;
303
- formType: string;
304
- propType: string;
305
- group: string;
306
- defaultValue: null;
307
- editable: boolean;
308
- required: boolean;
309
- step: number;
310
- };
311
- delayLongPress: {
312
- label: string;
313
- description: string;
314
- formType: string;
315
- propType: string;
316
- group: string;
317
- defaultValue: null;
318
- editable: boolean;
319
- required: boolean;
320
- step: number;
321
- };
322
- hitSlop: {
323
- label: string;
324
- description: string;
325
- formType: string;
326
- propType: string;
327
- group: string;
328
- defaultValue: null;
329
- editable: boolean;
330
- required: boolean;
331
- step: number;
332
- };
333
111
  };
334
112
  })[];
335
113
  //# sourceMappingURL=Button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Button.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqErB,CAAC"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Button.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiErB,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare const SEED_DATA: {
1
+ export declare const SEED_DATA: ({
2
2
  name: string;
3
3
  tag: string;
4
4
  description: string;
@@ -8,7 +8,133 @@ export declare const SEED_DATA: {
8
8
  layout: {
9
9
  flex: number;
10
10
  };
11
+ triggers: string[];
11
12
  props: {
13
+ onRefresh: {
14
+ label: string;
15
+ description: string;
16
+ editable: boolean;
17
+ required: boolean;
18
+ formType: string;
19
+ propType: string;
20
+ defaultValue: null;
21
+ group: string;
22
+ };
23
+ onEndReached: {
24
+ label: string;
25
+ description: string;
26
+ editable: boolean;
27
+ required: boolean;
28
+ formType: string;
29
+ propType: string;
30
+ defaultValue: null;
31
+ group: string;
32
+ };
33
+ onEndReachedThreshold: {
34
+ label: string;
35
+ description: string;
36
+ editable: boolean;
37
+ required: boolean;
38
+ formType: string;
39
+ propType: string;
40
+ defaultValue: null;
41
+ group: string;
42
+ };
43
+ onViewableItemsChanged: {
44
+ label: string;
45
+ description: string;
46
+ editable: boolean;
47
+ required: boolean;
48
+ formType: string;
49
+ propType: string;
50
+ defaultValue: null;
51
+ group: string;
52
+ };
53
+ numColumns: {
54
+ label: string;
55
+ description: string;
56
+ group: string;
57
+ formType: string;
58
+ propType: string;
59
+ defaultValue: number;
60
+ editable: boolean;
61
+ required: boolean;
62
+ };
63
+ estimatedItemSize: {
64
+ label: string;
65
+ description: string;
66
+ formType: string;
67
+ propType: string;
68
+ group: string;
69
+ defaultValue: null;
70
+ editable: boolean;
71
+ required: boolean;
72
+ step: number;
73
+ };
74
+ optimizeItemArrangement: {
75
+ label: string;
76
+ description: string;
77
+ formType: string;
78
+ propType: string;
79
+ defaultValue: boolean;
80
+ editable: boolean;
81
+ required: boolean;
82
+ group: string;
83
+ };
84
+ horizontal?: undefined;
85
+ inverted?: undefined;
86
+ };
87
+ } | {
88
+ name: string;
89
+ tag: string;
90
+ description: string;
91
+ packageName: string;
92
+ category: string;
93
+ stylesPanelSections: string[];
94
+ layout: {
95
+ flex: number;
96
+ };
97
+ props: {
98
+ onRefresh: {
99
+ label: string;
100
+ description: string;
101
+ editable: boolean;
102
+ required: boolean;
103
+ formType: string;
104
+ propType: string;
105
+ defaultValue: null;
106
+ group: string;
107
+ };
108
+ onEndReached: {
109
+ label: string;
110
+ description: string;
111
+ editable: boolean;
112
+ required: boolean;
113
+ formType: string;
114
+ propType: string;
115
+ defaultValue: null;
116
+ group: string;
117
+ };
118
+ onEndReachedThreshold: {
119
+ label: string;
120
+ description: string;
121
+ editable: boolean;
122
+ required: boolean;
123
+ formType: string;
124
+ propType: string;
125
+ defaultValue: null;
126
+ group: string;
127
+ };
128
+ onViewableItemsChanged: {
129
+ label: string;
130
+ description: string;
131
+ editable: boolean;
132
+ required: boolean;
133
+ formType: string;
134
+ propType: string;
135
+ defaultValue: null;
136
+ group: string;
137
+ };
12
138
  estimatedItemSize: {
13
139
  label: string;
14
140
  description: string;
@@ -50,6 +176,8 @@ export declare const SEED_DATA: {
50
176
  editable: boolean;
51
177
  required: boolean;
52
178
  };
179
+ optimizeItemArrangement?: undefined;
53
180
  };
54
- };
181
+ triggers?: undefined;
182
+ })[];
55
183
  //# sourceMappingURL=FlashList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FlashList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlashList.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BrB,CAAC"}
1
+ {"version":3,"file":"FlashList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlashList.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4ErB,CAAC"}
@@ -7,7 +7,48 @@ export declare const SEED_DATA: {
7
7
  layout: {
8
8
  flex: number;
9
9
  };
10
+ triggers: string[];
10
11
  props: {
12
+ onRefresh: {
13
+ label: string;
14
+ description: string;
15
+ editable: boolean;
16
+ required: boolean;
17
+ formType: string;
18
+ propType: string;
19
+ defaultValue: null;
20
+ group: string;
21
+ };
22
+ onEndReached: {
23
+ label: string;
24
+ description: string;
25
+ editable: boolean;
26
+ required: boolean;
27
+ formType: string;
28
+ propType: string;
29
+ defaultValue: null;
30
+ group: string;
31
+ };
32
+ onEndReachedThreshold: {
33
+ label: string;
34
+ description: string;
35
+ editable: boolean;
36
+ required: boolean;
37
+ formType: string;
38
+ propType: string;
39
+ defaultValue: null;
40
+ group: string;
41
+ };
42
+ onViewableItemsChanged: {
43
+ label: string;
44
+ description: string;
45
+ editable: boolean;
46
+ required: boolean;
47
+ formType: string;
48
+ propType: string;
49
+ defaultValue: null;
50
+ group: string;
51
+ };
11
52
  horizontal: {
12
53
  label: string;
13
54
  description: string;
@@ -38,6 +79,16 @@ export declare const SEED_DATA: {
38
79
  editable: boolean;
39
80
  required: boolean;
40
81
  };
82
+ initialNumToRender: {
83
+ label: string;
84
+ description: string;
85
+ formType: string;
86
+ propType: string;
87
+ defaultValue: boolean;
88
+ editable: boolean;
89
+ required: boolean;
90
+ group: string;
91
+ };
41
92
  };
42
93
  };
43
94
  //# sourceMappingURL=FlatList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FlatList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlatList.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBrB,CAAC"}
1
+ {"version":3,"file":"FlatList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlatList.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCrB,CAAC"}
@@ -0,0 +1,22 @@
1
+ export declare const SEED_DATA: {
2
+ name: string;
3
+ tag: string;
4
+ description: string;
5
+ category: string;
6
+ stylesPanelSections: string[];
7
+ layout: {};
8
+ triggers: string[];
9
+ props: {
10
+ onPress: {
11
+ label: string;
12
+ description: string;
13
+ editable: boolean;
14
+ required: boolean;
15
+ formType: string;
16
+ propType: string;
17
+ defaultValue: null;
18
+ group: string;
19
+ };
20
+ };
21
+ };
22
+ //# sourceMappingURL=Touchable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Touchable.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;CAerB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "47.0.1-17098e.2+17098ef",
3
+ "version": "47.0.1-2935a8.2+2935a81",
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": "^47.0.1-17098e.2+17098ef",
44
+ "@draftbit/types": "^47.0.1-2935a8.2+2935a81",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.4",
@@ -91,5 +91,5 @@
91
91
  ]
92
92
  ]
93
93
  },
94
- "gitHead": "17098ef43f2803aa04abc191f3f193bd8f8e7103"
94
+ "gitHead": "2935a812f6a4cc177567fb8c498ad6a1cf356a31"
95
95
  }
@@ -1,4 +1,4 @@
1
- import React, { useCallback } from "react";
1
+ import * as React from "react";
2
2
  import { Text, Pressable, Platform, StyleSheet, ActivityIndicator, } from "react-native";
3
3
  import { withTheme } from "../theming";
4
4
  const CONSTANTS = {
@@ -7,7 +7,7 @@ const CONSTANTS = {
7
7
  padding: 8,
8
8
  icon: 24,
9
9
  };
10
- function Base({ Icon, icon, title, onPress, onLongPress, activeOpacity, disabledOpacity, loading, disabled, style, ...props }) {
10
+ function Base({ Icon, icon, title, onPress, loading, disabled, style, ...props }) {
11
11
  const { color, fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textTransform, textAlign, textDecorationLine, textDecorationColor, textDecorationStyle, ...buttonStyles } = StyleSheet.flatten(style || {});
12
12
  const titleStyles = {
13
13
  color,
@@ -28,22 +28,15 @@ function Base({ Icon, icon, title, onPress, onLongPress, activeOpacity, disabled
28
28
  if (textAlign === "right") {
29
29
  buttonStyles.justifyContent = "flex-end";
30
30
  }
31
- const getOpacity = useCallback((pressed) => {
32
- if (disabled) {
33
- return disabledOpacity;
34
- }
35
- else {
36
- if (pressed)
37
- return activeOpacity;
38
- else
39
- return 1;
40
- }
41
- }, [activeOpacity, disabled, disabledOpacity]);
42
- const _style = useCallback(({ pressed }) => [
43
- buttonStyles,
44
- { opacity: getOpacity(pressed) },
45
- ], [getOpacity, buttonStyles]);
46
- return (React.createElement(Pressable, { onPress: onPress, onLongPress: onLongPress, disabled: disabled || loading, style: (styles.base, _style), ...props },
31
+ return (React.createElement(Pressable, { onPress: onPress, disabled: disabled || loading, style: ({ pressed }) => {
32
+ return [
33
+ styles.base,
34
+ {
35
+ opacity: pressed || disabled ? 0.75 : 1,
36
+ },
37
+ buttonStyles,
38
+ ];
39
+ }, ...props },
47
40
  loading ? (React.createElement(ActivityIndicator, { size: "small", color: color, style: styles.loading })) : null,
48
41
  icon && !loading ? (React.createElement(Icon, { name: icon, color: color, style: styles.icon, size: CONSTANTS.icon })) : null,
49
42
  React.createElement(Text, { style: titleStyles }, title)));
@@ -1,14 +1,11 @@
1
- import React, { useCallback } from "react";
1
+ import * as React from "react";
2
2
  import {
3
3
  Text,
4
4
  Pressable,
5
- PressableProps,
6
- PressableStateCallbackType,
7
5
  Platform,
8
6
  StyleSheet,
9
- StyleProp,
10
7
  TextStyle,
11
- ViewStyle,
8
+ PressableProps,
12
9
  ActivityIndicator,
13
10
  } from "react-native";
14
11
 
@@ -30,12 +27,6 @@ type BaseProps = {
30
27
  loading: boolean;
31
28
  style?: TextStyle;
32
29
  onPress: () => void;
33
- onLongPress?: () => void;
34
- activeOpacity?: number;
35
- disabledOpacity?: number;
36
- delayLongPress?: number;
37
- hitSlop?: number;
38
- pressRetentionOffset?: number;
39
30
  icon?: string;
40
31
  } & PressableProps &
41
32
  IconSlot;
@@ -46,29 +37,16 @@ type Props = {
46
37
  loading: boolean;
47
38
  style?: TextStyle;
48
39
  onPress: () => void;
49
- onLongPress?: () => void;
50
- activeOpacity?: number;
51
- disabledOpacity?: number;
52
- delayLongPress?: number;
53
- hitSlop?: number;
54
- pressRetentionOffset?: number;
55
40
  icon?: string;
56
41
  theme: Theme;
57
42
  } & PressableProps &
58
43
  IconSlot;
59
44
 
60
- export type StyleType = (
61
- state: PressableStateCallbackType
62
- ) => StyleProp<ViewStyle>;
63
-
64
45
  function Base({
65
46
  Icon,
66
47
  icon,
67
48
  title,
68
49
  onPress,
69
- onLongPress,
70
- activeOpacity,
71
- disabledOpacity,
72
50
  loading,
73
51
  disabled,
74
52
  style,
@@ -111,31 +89,19 @@ function Base({
111
89
  buttonStyles.justifyContent = "flex-end";
112
90
  }
113
91
 
114
- const getOpacity = useCallback(
115
- (pressed: boolean) => {
116
- if (disabled) {
117
- return disabledOpacity;
118
- } else {
119
- if (pressed) return activeOpacity;
120
- else return 1;
121
- }
122
- },
123
- [activeOpacity, disabled, disabledOpacity]
124
- );
125
- const _style = useCallback<StyleType>(
126
- ({ pressed }) => [
127
- buttonStyles as ViewStyle,
128
- { opacity: getOpacity(pressed) },
129
- ],
130
- [getOpacity, buttonStyles]
131
- );
132
-
133
92
  return (
134
93
  <Pressable
135
94
  onPress={onPress}
136
- onLongPress={onLongPress}
137
95
  disabled={disabled || loading}
138
- style={(styles.base, _style)}
96
+ style={({ pressed }) => {
97
+ return [
98
+ styles.base,
99
+ {
100
+ opacity: pressed || disabled ? 0.75 : 1,
101
+ },
102
+ buttonStyles,
103
+ ];
104
+ }}
139
105
  {...props}
140
106
  >
141
107
  {loading ? (