@draftbit/core 46.5.2-b58416.2 → 46.6.0

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 (138) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +23 -4
  2. package/lib/commonjs/components/Banner.js +23 -4
  3. package/lib/commonjs/components/Button.js +36 -13
  4. package/lib/commonjs/components/CardContainer.js +13 -4
  5. package/lib/commonjs/components/CardContainerShortImage.js +15 -4
  6. package/lib/commonjs/components/Checkbox/Checkbox.js +22 -6
  7. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
  8. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +1 -2
  9. package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -2
  10. package/lib/commonjs/components/Container.js +15 -4
  11. package/lib/commonjs/components/DeprecatedButton.js +3 -27
  12. package/lib/commonjs/components/DeprecatedCardWrapper.js +15 -1
  13. package/lib/commonjs/components/DeprecatedFAB.js +1 -2
  14. package/lib/commonjs/components/Elevation.js +14 -2
  15. package/lib/commonjs/components/FAB.js +18 -4
  16. package/lib/commonjs/components/FieldSearchBarFull.js +1 -2
  17. package/lib/commonjs/components/Image.js +17 -2
  18. package/lib/commonjs/components/Layout.js +40 -19
  19. package/lib/commonjs/components/Picker/Picker.js +9 -4
  20. package/lib/commonjs/components/Picker/PickerComponent.ios.js +36 -11
  21. package/lib/commonjs/components/Picker/PickerComponent.web.js +20 -3
  22. package/lib/commonjs/components/Portal/PortalManager.js +34 -8
  23. package/lib/commonjs/components/Pressable.js +50 -0
  24. package/lib/commonjs/components/ProgressBar.js +37 -7
  25. package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +9 -1
  26. package/lib/commonjs/components/ScreenContainer.js +20 -4
  27. package/lib/commonjs/components/StepIndicator.js +57 -18
  28. package/lib/commonjs/components/Surface.js +14 -2
  29. package/lib/commonjs/components/Swiper/Swiper.js +2 -0
  30. package/lib/commonjs/components/Switch.js +19 -10
  31. package/lib/commonjs/components/TextField.js +76 -28
  32. package/lib/commonjs/components/ToggleButton.js +15 -2
  33. package/lib/commonjs/components/Touchable.js +23 -5
  34. package/lib/commonjs/index.js +7 -0
  35. package/lib/commonjs/mappings/Button.js +39 -10
  36. package/lib/commonjs/mappings/FlashList.js +45 -2
  37. package/lib/commonjs/mappings/FlatList.js +12 -0
  38. package/lib/commonjs/mappings/Swiper.js +2 -0
  39. package/lib/commonjs/mappings/Touchable.js +47 -7
  40. package/lib/module/components/AvatarEdit.js +15 -4
  41. package/lib/module/components/Button.js +36 -13
  42. package/lib/module/components/Carousel.js +32 -8
  43. package/lib/module/components/Checkbox/Checkbox.js +26 -6
  44. package/lib/module/components/Checkbox/CheckboxGroup.js +16 -2
  45. package/lib/module/components/Checkbox/CheckboxGroupRow.js +25 -7
  46. package/lib/module/components/Checkbox/CheckboxRow.js +2 -3
  47. package/lib/module/components/CircularProgress.js +28 -8
  48. package/lib/module/components/DatePicker/DatePicker.js +27 -13
  49. package/lib/module/components/DeprecatedButton.js +24 -30
  50. package/lib/module/components/DeprecatedFAB.js +2 -3
  51. package/lib/module/components/Elevation.js +14 -2
  52. package/lib/module/components/FieldSearchBarFull.js +1 -2
  53. package/lib/module/components/Image.js +18 -2
  54. package/lib/module/components/Layout.js +42 -21
  55. package/lib/module/components/NumberInput.js +12 -3
  56. package/lib/module/components/Picker/Picker.js +10 -4
  57. package/lib/module/components/Picker/PickerComponent.ios.js +36 -11
  58. package/lib/module/components/Picker/PickerComponent.web.js +21 -3
  59. package/lib/module/components/Portal/PortalConsumer.js +22 -7
  60. package/lib/module/components/Pressable.js +30 -0
  61. package/lib/module/components/RadioButton/RadioButtonRow.js +24 -5
  62. package/lib/module/components/ScreenContainer.js +21 -4
  63. package/lib/module/components/Swiper/Swiper.js +2 -0
  64. package/lib/module/components/Switch.js +21 -10
  65. package/lib/module/components/Text.js +50 -4
  66. package/lib/module/components/TextField.js +78 -28
  67. package/lib/module/components/Touchable.js +8 -3
  68. package/lib/module/constants.js +1 -2
  69. package/lib/module/index.js +1 -0
  70. package/lib/module/mappings/Button.js +40 -11
  71. package/lib/module/mappings/FieldSearchBarFull.js +4 -1
  72. package/lib/module/mappings/FlashList.js +46 -3
  73. package/lib/module/mappings/FlatList.js +13 -1
  74. package/lib/module/mappings/StarRating.js +7 -2
  75. package/lib/module/mappings/Swiper.js +3 -1
  76. package/lib/module/mappings/Touchable.js +49 -9
  77. package/lib/typescript/src/components/Button.d.ts.map +1 -1
  78. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -2
  79. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts.map +1 -1
  80. package/lib/typescript/src/components/Checkbox/CheckboxGroupRow.d.ts.map +1 -1
  81. package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts.map +1 -1
  82. package/lib/typescript/src/components/DeprecatedButton.d.ts +2 -2
  83. package/lib/typescript/src/components/DeprecatedButton.d.ts.map +1 -1
  84. package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
  85. package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -1
  86. package/lib/typescript/src/components/Pressable.d.ts +10 -0
  87. package/lib/typescript/src/components/Pressable.d.ts.map +1 -0
  88. package/lib/typescript/src/components/Swiper/Swiper.d.ts +2 -1
  89. package/lib/typescript/src/components/Swiper/Swiper.d.ts.map +1 -1
  90. package/lib/typescript/src/components/Touchable.d.ts +5 -6
  91. package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
  92. package/lib/typescript/src/index.d.ts +1 -0
  93. package/lib/typescript/src/index.d.ts.map +1 -1
  94. package/lib/typescript/src/mappings/Button.d.ts +113 -4
  95. package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
  96. package/lib/typescript/src/mappings/FlashList.d.ts +112 -2
  97. package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
  98. package/lib/typescript/src/mappings/FlatList.d.ts +42 -0
  99. package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
  100. package/lib/typescript/src/mappings/Swiper.d.ts +11 -0
  101. package/lib/typescript/src/mappings/Swiper.d.ts.map +1 -1
  102. package/lib/typescript/src/mappings/Touchable.d.ts +59 -5
  103. package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
  104. package/lib/typescript/src/styles/overlay.d.ts +1 -1
  105. package/lib/typescript/src/styles/overlay.d.ts.map +1 -1
  106. package/lib/typescript/src/styles/shadow.d.ts +2 -2
  107. package/package.json +7 -7
  108. package/src/components/Button.js +3 -3
  109. package/src/components/Button.tsx +14 -4
  110. package/src/components/Checkbox/Checkbox.js +2 -3
  111. package/src/components/Checkbox/Checkbox.tsx +5 -7
  112. package/src/components/Checkbox/CheckboxGroupRow.js +2 -3
  113. package/src/components/Checkbox/CheckboxGroupRow.tsx +3 -3
  114. package/src/components/Checkbox/CheckboxRow.js +2 -3
  115. package/src/components/Checkbox/CheckboxRow.tsx +3 -3
  116. package/src/components/DeprecatedButton.js +4 -16
  117. package/src/components/DeprecatedButton.tsx +7 -31
  118. package/src/components/DeprecatedFAB.js +2 -3
  119. package/src/components/DeprecatedFAB.tsx +5 -5
  120. package/src/components/Pressable.js +12 -0
  121. package/src/components/Pressable.tsx +44 -0
  122. package/src/components/Swiper/Swiper.js +2 -2
  123. package/src/components/Swiper/Swiper.tsx +3 -0
  124. package/src/components/Touchable.js +3 -3
  125. package/src/components/Touchable.tsx +11 -7
  126. package/src/index.js +1 -0
  127. package/src/index.tsx +1 -0
  128. package/src/mappings/Button.js +39 -10
  129. package/src/mappings/Button.ts +41 -10
  130. package/src/mappings/FlashList.js +77 -31
  131. package/src/mappings/FlashList.ts +82 -30
  132. package/src/mappings/FlatList.js +13 -1
  133. package/src/mappings/FlatList.ts +16 -0
  134. package/src/mappings/Swiper.js +3 -1
  135. package/src/mappings/Swiper.ts +4 -0
  136. package/src/mappings/Touchable.js +50 -7
  137. package/src/mappings/Touchable.ts +53 -6
  138. package/src/styles/overlay.tsx +2 -2
@@ -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,105 @@ 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
+ numColumns: {
34
+ label: string;
35
+ description: string;
36
+ group: string;
37
+ formType: string;
38
+ propType: string;
39
+ defaultValue: number;
40
+ editable: boolean;
41
+ required: boolean;
42
+ };
43
+ estimatedItemSize: {
44
+ label: string;
45
+ description: string;
46
+ formType: string;
47
+ propType: string;
48
+ group: string;
49
+ defaultValue: null;
50
+ editable: boolean;
51
+ required: boolean;
52
+ step: number;
53
+ };
54
+ optimizeItemArrangement: {
55
+ label: string;
56
+ description: string;
57
+ formType: string;
58
+ propType: string;
59
+ defaultValue: boolean;
60
+ editable: boolean;
61
+ required: boolean;
62
+ group: string;
63
+ };
64
+ onEndReachedThreshold: {
65
+ label: string;
66
+ description: string;
67
+ formType: string;
68
+ propType: string;
69
+ group: string;
70
+ defaultValue: null;
71
+ editable: boolean;
72
+ required: boolean;
73
+ step: number;
74
+ };
75
+ horizontal?: undefined;
76
+ inverted?: undefined;
77
+ };
78
+ } | {
79
+ name: string;
80
+ tag: string;
81
+ description: string;
82
+ packageName: string;
83
+ category: string;
84
+ stylesPanelSections: string[];
85
+ layout: {
86
+ flex: number;
87
+ };
88
+ triggers: string[];
89
+ props: {
90
+ onRefresh: {
91
+ label: string;
92
+ description: string;
93
+ editable: boolean;
94
+ required: boolean;
95
+ formType: string;
96
+ propType: string;
97
+ defaultValue: null;
98
+ group: string;
99
+ };
100
+ onEndReached: {
101
+ label: string;
102
+ description: string;
103
+ editable: boolean;
104
+ required: boolean;
105
+ formType: string;
106
+ propType: string;
107
+ defaultValue: null;
108
+ group: string;
109
+ };
12
110
  estimatedItemSize: {
13
111
  label: string;
14
112
  description: string;
@@ -50,6 +148,18 @@ export declare const SEED_DATA: {
50
148
  editable: boolean;
51
149
  required: boolean;
52
150
  };
151
+ onEndReachedThreshold: {
152
+ label: string;
153
+ description: string;
154
+ formType: string;
155
+ propType: string;
156
+ group: string;
157
+ defaultValue: null;
158
+ editable: boolean;
159
+ required: boolean;
160
+ step: number;
161
+ };
162
+ optimizeItemArrangement?: undefined;
53
163
  };
54
- };
164
+ })[];
55
165
  //# 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":"AAYA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgFrB,CAAC"}
@@ -7,7 +7,28 @@ 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
+ };
11
32
  horizontal: {
12
33
  label: string;
13
34
  description: string;
@@ -38,6 +59,27 @@ export declare const SEED_DATA: {
38
59
  editable: boolean;
39
60
  required: boolean;
40
61
  };
62
+ initialNumToRender: {
63
+ label: string;
64
+ description: string;
65
+ formType: string;
66
+ propType: string;
67
+ defaultValue: boolean;
68
+ editable: boolean;
69
+ required: boolean;
70
+ group: string;
71
+ };
72
+ onEndReachedThreshold: {
73
+ label: string;
74
+ description: string;
75
+ formType: string;
76
+ propType: string;
77
+ group: string;
78
+ defaultValue: null;
79
+ editable: boolean;
80
+ required: boolean;
81
+ step: number;
82
+ };
41
83
  };
42
84
  };
43
85
  //# 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":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCrB,CAAC"}
@@ -7,7 +7,18 @@ export declare const SEED_DATA: {
7
7
  height: number;
8
8
  width: string;
9
9
  };
10
+ triggers: string[];
10
11
  props: {
12
+ onIndexChanged: {
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
+ };
11
22
  from: {
12
23
  label: string;
13
24
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Swiper.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Swiper.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DrB,CAAC"}
1
+ {"version":3,"file":"Swiper.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Swiper.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DrB,CAAC"}
@@ -1,8 +1,4 @@
1
1
  export declare const SEED_DATA: {
2
- name: string;
3
- tag: string;
4
- description: string;
5
- category: string;
6
2
  stylesPanelSections: string[];
7
3
  layout: {};
8
4
  triggers: string[];
@@ -17,6 +13,64 @@ export declare const SEED_DATA: {
17
13
  defaultValue: null;
18
14
  group: string;
19
15
  };
16
+ onLongPress: {
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
+ activeOpacity: {
27
+ label: string;
28
+ description: string;
29
+ formType: string;
30
+ propType: string;
31
+ group: string;
32
+ defaultValue: null;
33
+ editable: boolean;
34
+ required: boolean;
35
+ step: number;
36
+ };
37
+ disabledOpacity: {
38
+ label: string;
39
+ description: string;
40
+ formType: string;
41
+ propType: string;
42
+ group: string;
43
+ defaultValue: null;
44
+ editable: boolean;
45
+ required: boolean;
46
+ step: number;
47
+ };
48
+ delayLongPress: {
49
+ label: string;
50
+ description: string;
51
+ formType: string;
52
+ propType: string;
53
+ group: string;
54
+ defaultValue: null;
55
+ editable: boolean;
56
+ required: boolean;
57
+ step: number;
58
+ };
59
+ hitSlop: {
60
+ label: string;
61
+ description: string;
62
+ formType: string;
63
+ propType: string;
64
+ group: string;
65
+ defaultValue: null;
66
+ editable: boolean;
67
+ required: boolean;
68
+ step: number;
69
+ };
20
70
  };
21
- };
71
+ name: string;
72
+ tag: string;
73
+ description: string;
74
+ category: string;
75
+ }[];
22
76
  //# sourceMappingURL=Touchable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Touchable.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;CAerB,CAAC"}
1
+ {"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Touchable.ts"],"names":[],"mappings":"AAsDA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAerB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { Animated } from "react-native";
2
- export default function overlay<T extends Animated.Value | number>(elevation: T, surfaceColor?: string): T extends number ? string : Animated.AnimatedInterpolation<string | number>;
2
+ export default function overlay<T extends Animated.Value | number>(elevation: T, surfaceColor?: string): T extends number ? string : Animated.AnimatedInterpolation;
3
3
  //# sourceMappingURL=overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/styles/overlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAOxC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,SAAS,QAAQ,CAAC,KAAK,GAAG,MAAM,EAC/D,SAAS,EAAE,CAAC,EACZ,YAAY,GAAE,MAAiC,GAC9C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,qBAAqB,CAAC,MAAM,GAAG,MAAM,CAAC,CAe7E"}
1
+ {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/styles/overlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAOxC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,SAAS,QAAQ,CAAC,KAAK,GAAG,MAAM,EAC/D,SAAS,EAAE,CAAC,EACZ,YAAY,GAAE,MAAiC,GAC9C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,qBAAqB,CAe5D"}
@@ -3,10 +3,10 @@ export default function shadow(elevation?: number | Animated.Value): {
3
3
  shadowColor: string;
4
4
  shadowOffset: {
5
5
  width: Animated.Value;
6
- height: Animated.AnimatedInterpolation<string | number>;
6
+ height: Animated.AnimatedInterpolation;
7
7
  };
8
8
  shadowOpacity: Animated.Value;
9
- shadowRadius: Animated.AnimatedInterpolation<string | number>;
9
+ shadowRadius: Animated.AnimatedInterpolation;
10
10
  } | {
11
11
  shadowColor?: undefined;
12
12
  shadowOffset?: undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.5.2-b58416.2+b584161",
3
+ "version": "46.6.0",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,12 +41,12 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^46.5.2-b58416.2+b584161",
44
+ "@draftbit/types": "^46.6.0",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
- "@react-native-community/slider": "4.2.4",
48
- "@react-native-picker/picker": "2.4.8",
49
- "@shopify/flash-list": "1.3.1",
47
+ "@react-native-community/slider": "4.2.3",
48
+ "@react-native-picker/picker": "2.4.2",
49
+ "@shopify/flash-list": "1.2.0",
50
50
  "color": "^3.1.2",
51
51
  "date-fns": "^2.16.1",
52
52
  "dateformat": "^3.0.3",
@@ -54,7 +54,7 @@
54
54
  "lodash.omit": "^4.5.0",
55
55
  "lodash.tonumber": "^4.0.3",
56
56
  "react-native-modal-datetime-picker": "^13.0.0",
57
- "react-native-svg": "13.4.0",
57
+ "react-native-svg": "12.3.0",
58
58
  "react-native-typography": "^1.4.1",
59
59
  "react-native-web-swiper": "^2.2.3"
60
60
  },
@@ -91,5 +91,5 @@
91
91
  ]
92
92
  ]
93
93
  },
94
- "gitHead": "b584161a8d6042f3d8ab8a4cb3b697889503a5db"
94
+ "gitHead": "4403cb452dfeff35e782f2eca66e87831b92473f"
95
95
  }
@@ -7,7 +7,7 @@ const CONSTANTS = {
7
7
  padding: 8,
8
8
  icon: 24,
9
9
  };
10
- function Base({ Icon, icon, title, onPress, loading, disabled, style, ...props }) {
10
+ function Base({ Icon, icon, title, loading, disabled, style, activeOpacity, disabledOpacity, ...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,11 +28,11 @@ function Base({ Icon, icon, title, onPress, loading, disabled, style, ...props }
28
28
  if (textAlign === "right") {
29
29
  buttonStyles.justifyContent = "flex-end";
30
30
  }
31
- return (React.createElement(Pressable, { onPress: onPress, disabled: disabled || loading, style: ({ pressed }) => {
31
+ return (React.createElement(Pressable, { disabled: disabled || loading, style: ({ pressed }) => {
32
32
  return [
33
33
  styles.base,
34
34
  {
35
- opacity: pressed || disabled ? 0.75 : 1,
35
+ opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1,
36
36
  },
37
37
  buttonStyles,
38
38
  ];
@@ -2,10 +2,10 @@ import * as React from "react";
2
2
  import {
3
3
  Text,
4
4
  Pressable,
5
+ PressableProps,
5
6
  Platform,
6
7
  StyleSheet,
7
8
  TextStyle,
8
- PressableProps,
9
9
  ActivityIndicator,
10
10
  } from "react-native";
11
11
 
@@ -27,6 +27,11 @@ type BaseProps = {
27
27
  loading: boolean;
28
28
  style?: TextStyle;
29
29
  onPress: () => void;
30
+ onLongPress?: () => void;
31
+ activeOpacity?: number;
32
+ disabledOpacity?: number;
33
+ delayLongPress?: number;
34
+ hitSlop?: number;
30
35
  icon?: string;
31
36
  } & PressableProps &
32
37
  IconSlot;
@@ -37,6 +42,11 @@ type Props = {
37
42
  loading: boolean;
38
43
  style?: TextStyle;
39
44
  onPress: () => void;
45
+ onLongPress?: () => void;
46
+ activeOpacity?: number;
47
+ disabledOpacity?: number;
48
+ delayLongPress?: number;
49
+ hitSlop?: number;
40
50
  icon?: string;
41
51
  theme: Theme;
42
52
  } & PressableProps &
@@ -46,10 +56,11 @@ function Base({
46
56
  Icon,
47
57
  icon,
48
58
  title,
49
- onPress,
50
59
  loading,
51
60
  disabled,
52
61
  style,
62
+ activeOpacity,
63
+ disabledOpacity,
53
64
  ...props
54
65
  }: BaseProps): JSX.Element {
55
66
  const {
@@ -91,13 +102,12 @@ function Base({
91
102
 
92
103
  return (
93
104
  <Pressable
94
- onPress={onPress}
95
105
  disabled={disabled || loading}
96
106
  style={({ pressed }) => {
97
107
  return [
98
108
  styles.base,
99
109
  {
100
- opacity: pressed || disabled ? 0.75 : 1,
110
+ opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1,
101
111
  },
102
112
  buttonStyles,
103
113
  ];
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, } from "react-native";
2
+ import { View, StyleSheet, Pressable, } from "react-native";
3
3
  import { useTheme } from "../../theming";
4
- import Touchable from "../Touchable";
5
4
  import { usePrevious } from "../../hooks";
6
5
  const Checkbox = ({ Icon, status, disabled = false, onPress, onCheck, onUncheck, color, uncheckedColor, defaultValue, checkedIcon = "MaterialCommunityIcons/checkbox-marked", uncheckedIcon = "MaterialCommunityIcons/checkbox-blank-outline", size = 24, style, ...rest }) => {
7
6
  const [internalValue, setInternalValue] = React.useState(status || defaultValue || false);
@@ -33,7 +32,7 @@ const Checkbox = ({ Icon, status, disabled = false, onPress, onCheck, onUncheck,
33
32
  onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
34
33
  }
35
34
  };
36
- return (React.createElement(Touchable, { ...rest, onPress: handlePress, disabled: disabled, accessibilityState: { disabled }, accessibilityRole: "button", accessibilityLiveRegion: "polite", style: [styles.container, style, { width: size, height: size }] },
35
+ return (React.createElement(Pressable, { ...rest, onPress: handlePress, disabled: disabled, accessibilityState: { disabled }, accessibilityRole: "button", accessibilityLiveRegion: "polite", style: [styles.container, style, { width: size, height: size }] },
37
36
  React.createElement(Icon, { style: styles.icon, name: internalValue ? checkedIcon : uncheckedIcon, size: size, color: checkboxColor }),
38
37
  React.createElement(View, { style: [StyleSheet.absoluteFill, styles.fillContainer] },
39
38
  React.createElement(View, { style: [
@@ -2,14 +2,14 @@ import * as React from "react";
2
2
  import {
3
3
  View,
4
4
  StyleSheet,
5
- TouchableHighlightProps,
5
+ Pressable,
6
+ PressableProps,
6
7
  StyleProp,
7
8
  ViewStyle,
8
9
  } from "react-native";
9
10
  import { useTheme } from "../../theming";
10
11
  import type { IconSlot } from "../../interfaces/Icon";
11
12
 
12
- import Touchable from "../Touchable";
13
13
  import { usePrevious } from "../../hooks";
14
14
 
15
15
  export interface CheckboxProps {
@@ -27,9 +27,7 @@ export interface CheckboxProps {
27
27
  style?: StyleProp<ViewStyle>;
28
28
  }
29
29
 
30
- const Checkbox: React.FC<
31
- CheckboxProps & TouchableHighlightProps & IconSlot
32
- > = ({
30
+ const Checkbox: React.FC<CheckboxProps & PressableProps & IconSlot> = ({
33
31
  Icon,
34
32
  status,
35
33
  disabled = false,
@@ -87,7 +85,7 @@ const Checkbox: React.FC<
87
85
  };
88
86
 
89
87
  return (
90
- <Touchable
88
+ <Pressable
91
89
  {...rest}
92
90
  onPress={handlePress}
93
91
  disabled={disabled}
@@ -111,7 +109,7 @@ const Checkbox: React.FC<
111
109
  ]}
112
110
  />
113
111
  </View>
114
- </Touchable>
112
+ </Pressable>
115
113
  );
116
114
  };
117
115
 
@@ -1,10 +1,9 @@
1
1
  import * as React from "react";
2
- import { StyleSheet, View, Platform, } from "react-native";
2
+ import { StyleSheet, View, Platform, Pressable, } from "react-native";
3
3
  import Checkbox from "./Checkbox";
4
4
  import Text from "../Text";
5
5
  import { useCheckboxGroupContext } from "./context";
6
6
  import { Direction as GroupDirection } from "./context";
7
- import Touchable from "../Touchable";
8
7
  import { extractStyles } from "../../utilities";
9
8
  export var Direction;
10
9
  (function (Direction) {
@@ -41,7 +40,7 @@ const CheckboxGroupRow = ({ Icon, label = "Label", status, value, onPress, label
41
40
  }
42
41
  };
43
42
  const { textStyles, viewStyles } = extractStyles(style);
44
- return (React.createElement(Touchable, { onPress: handlePress, style: [styles.mainParent, { flexDirection: direction }, viewStyles], disabled: disabled, ...rest },
43
+ return (React.createElement(Pressable, { onPress: handlePress, style: [styles.mainParent, { flexDirection: direction }, viewStyles], disabled: disabled, ...rest },
45
44
  React.createElement(View, { style: [
46
45
  styles.label,
47
46
  {
@@ -6,13 +6,13 @@ import {
6
6
  TextStyle,
7
7
  View,
8
8
  Platform,
9
+ Pressable,
9
10
  } from "react-native";
10
11
  import Checkbox, { CheckboxProps } from "./Checkbox";
11
12
  import Text from "../Text";
12
13
  import { useCheckboxGroupContext } from "./context";
13
14
  import type { IconSlot } from "../../interfaces/Icon";
14
15
  import { Direction as GroupDirection } from "./context";
15
- import Touchable from "../Touchable";
16
16
  import { extractStyles } from "../../utilities";
17
17
 
18
18
  export enum Direction {
@@ -92,7 +92,7 @@ const CheckboxGroupRow: React.FC<CheckboxGroupRowProps & IconSlot> = ({
92
92
  const { textStyles, viewStyles } = extractStyles(style);
93
93
 
94
94
  return (
95
- <Touchable
95
+ <Pressable
96
96
  onPress={handlePress}
97
97
  style={[styles.mainParent, { flexDirection: direction }, viewStyles]}
98
98
  disabled={disabled}
@@ -125,7 +125,7 @@ const CheckboxGroupRow: React.FC<CheckboxGroupRowProps & IconSlot> = ({
125
125
  uncheckedColor={uncheckedColor}
126
126
  />
127
127
  </View>
128
- </Touchable>
128
+ </Pressable>
129
129
  );
130
130
  };
131
131
 
@@ -1,10 +1,9 @@
1
1
  import * as React from "react";
2
- import { StyleSheet, View, Platform, } from "react-native";
2
+ import { StyleSheet, View, Platform, Pressable, } from "react-native";
3
3
  import { isString } from "lodash";
4
4
  import { extractStyles } from "../../utilities";
5
5
  import { usePrevious } from "../../hooks";
6
6
  import Text from "../Text";
7
- import Touchable from "../Touchable";
8
7
  import Checkbox from "./Checkbox";
9
8
  export var Direction;
10
9
  (function (Direction) {
@@ -46,7 +45,7 @@ const CheckboxRow = ({ label = "Label", labelStyle, labelContainerStyle, checkbo
46
45
  }
47
46
  };
48
47
  const { textStyles, viewStyles } = extractStyles(style);
49
- return (React.createElement(Touchable, { onPress: handlePress, style: [viewStyles, styles.mainParent, { flexDirection: direction }], disabled: disabled, ...rest },
48
+ return (React.createElement(Pressable, { onPress: handlePress, style: [viewStyles, styles.mainParent, { flexDirection: direction }], disabled: disabled, ...rest },
50
49
  React.createElement(View, { style: [
51
50
  styles.label,
52
51
  {
@@ -6,6 +6,7 @@ import {
6
6
  TextStyle,
7
7
  View,
8
8
  Platform,
9
+ Pressable,
9
10
  } from "react-native";
10
11
  import { isString } from "lodash";
11
12
 
@@ -13,7 +14,6 @@ import type { IconSlot } from "../../interfaces/Icon";
13
14
  import { extractStyles } from "../../utilities";
14
15
  import { usePrevious } from "../../hooks";
15
16
  import Text from "../Text";
16
- import Touchable from "../Touchable";
17
17
  import Checkbox, { CheckboxProps } from "./Checkbox";
18
18
 
19
19
  export enum Direction {
@@ -100,7 +100,7 @@ const CheckboxRow: React.FC<CheckboxRowProps & IconSlot> = ({
100
100
  const { textStyles, viewStyles } = extractStyles(style);
101
101
 
102
102
  return (
103
- <Touchable
103
+ <Pressable
104
104
  onPress={handlePress}
105
105
  style={[viewStyles, styles.mainParent, { flexDirection: direction }]}
106
106
  disabled={disabled}
@@ -130,7 +130,7 @@ const CheckboxRow: React.FC<CheckboxRowProps & IconSlot> = ({
130
130
  uncheckedIcon={uncheckedIcon}
131
131
  size={size}
132
132
  />
133
- </Touchable>
133
+ </Pressable>
134
134
  );
135
135
  };
136
136
 
@@ -1,11 +1,10 @@
1
1
  import * as React from "react";
2
- import { ActivityIndicator, View, Text, StyleSheet, } from "react-native";
2
+ import { ActivityIndicator, View, Text, StyleSheet, Pressable, } from "react-native";
3
3
  import color from "color";
4
4
  import Config from "./Config";
5
- import Touchable from "./Touchable";
6
5
  import Elevation from "./Elevation";
7
6
  import { withTheme } from "../theming";
8
- const Button = ({ Icon, icon, disabled = false, type = "solid", loading = false, labelColor, color: colorOverride, children, onPress, elevation = 0, style, theme: { colors, disabledOpacity, roundness, typography }, ...rest }) => {
7
+ const Button = ({ Icon, icon, disabled = false, type = "solid", loading = false, labelColor, color: colorOverride, children, onPress, elevation = 0, theme: { colors, disabledOpacity, roundness, typography }, ...rest }) => {
9
8
  let backgroundColor, borderColor, textColor, borderWidth;
10
9
  const buttonColor = colorOverride || colors.primary;
11
10
  if (type === "solid") {
@@ -59,19 +58,8 @@ const Button = ({ Icon, icon, disabled = false, type = "solid", loading = false,
59
58
  width: Config.buttonIconSize,
60
59
  },
61
60
  ];
62
- const { margin, marginEnd, marginTop, marginLeft, marginRight, marginBottom, marginHorizontal, marginVertical, ...innerStyles } = StyleSheet.flatten(style || {});
63
- const margins = {
64
- margin,
65
- marginEnd,
66
- marginTop,
67
- marginLeft,
68
- marginRight,
69
- marginBottom,
70
- marginHorizontal,
71
- marginVertical,
72
- };
73
- return (React.createElement(Elevation, { style: { elevation, alignSelf: "stretch", ...margins } },
74
- React.createElement(Touchable, { ...rest, onPress: onPress, accessibilityState: { disabled }, accessibilityRole: "button", disabled: disabled || loading, style: [styles.button, buttonStyle, innerStyles] },
61
+ return (React.createElement(Elevation, { style: { elevation, alignSelf: "stretch" } },
62
+ React.createElement(Pressable, { ...rest, onPress: onPress, accessibilityState: { disabled }, accessibilityRole: "button", disabled: disabled || loading, style: [styles.button, buttonStyle] },
75
63
  React.createElement(View, { style: styles.content },
76
64
  icon && loading !== true ? (React.createElement(View, { style: iconStyle },
77
65
  React.createElement(Icon, { name: icon, size: Config.buttonIconSize, color: textColor }))) : null,