@codeleap/mobile 1.3.1 → 1.4.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 (197) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.js +3 -0
  3. package/.vscode/settings.json +11 -0
  4. package/CodeLeap-Mobile-Packages.code-workspace +8 -0
  5. package/dist/components/ActivityIndicator.js +9 -6
  6. package/dist/components/ActivityIndicator.js.map +1 -1
  7. package/dist/components/Animated.d.ts +1 -89
  8. package/dist/components/Animated.js +2 -2
  9. package/dist/components/Animated.js.map +1 -1
  10. package/dist/components/Button.d.ts +107 -98
  11. package/dist/components/Button.js +29 -9
  12. package/dist/components/Button.js.map +1 -1
  13. package/dist/components/Checkbox/index.d.ts +1 -1
  14. package/dist/components/Checkbox/index.js +7 -8
  15. package/dist/components/Checkbox/index.js.map +1 -1
  16. package/dist/components/Checkbox/styles.d.ts +47 -43
  17. package/dist/components/Checkbox/styles.js +8 -8
  18. package/dist/components/Checkbox/styles.js.map +1 -1
  19. package/dist/components/ContentView.js +4 -2
  20. package/dist/components/ContentView.js.map +1 -1
  21. package/dist/components/FileInput.d.ts +10 -3
  22. package/dist/components/FileInput.js +94 -32
  23. package/dist/components/FileInput.js.map +1 -1
  24. package/dist/components/Icon.d.ts +4 -6
  25. package/dist/components/Icon.js +25 -11
  26. package/dist/components/Icon.js.map +1 -1
  27. package/dist/components/Image.d.ts +7 -6
  28. package/dist/components/Image.js +4 -4
  29. package/dist/components/Image.js.map +1 -1
  30. package/dist/components/List.d.ts +11 -0
  31. package/dist/components/List.js +77 -0
  32. package/dist/components/List.js.map +1 -0
  33. package/dist/components/Modal/index.d.ts +2 -1
  34. package/dist/components/Modal/index.js +23 -30
  35. package/dist/components/Modal/index.js.map +1 -1
  36. package/dist/components/Modal/styles.d.ts +51 -47
  37. package/dist/components/Modal/styles.js +13 -18
  38. package/dist/components/Modal/styles.js.map +1 -1
  39. package/dist/components/Navigation/Navigation.d.ts +3 -0
  40. package/dist/components/Navigation/Navigation.js +76 -0
  41. package/dist/components/Navigation/Navigation.js.map +1 -0
  42. package/dist/components/Navigation/constants.d.ts +5 -0
  43. package/dist/components/Navigation/constants.js +11 -0
  44. package/dist/components/Navigation/constants.js.map +1 -0
  45. package/dist/components/Navigation/index.d.ts +3 -0
  46. package/dist/components/Navigation/index.js +16 -0
  47. package/dist/components/Navigation/index.js.map +1 -0
  48. package/dist/components/Navigation/types.d.ts +26 -0
  49. package/dist/components/Navigation/types.js +8 -0
  50. package/dist/components/Navigation/types.js.map +1 -0
  51. package/dist/components/Navigation/utils.d.ts +3 -0
  52. package/dist/components/Navigation/utils.js +67 -0
  53. package/dist/components/Navigation/utils.js.map +1 -0
  54. package/dist/components/Overlay.d.ts +5 -5
  55. package/dist/components/Overlay.js +13 -15
  56. package/dist/components/Overlay.js.map +1 -1
  57. package/dist/components/Pager/index.d.ts +19 -0
  58. package/dist/components/Pager/index.js +164 -0
  59. package/dist/components/Pager/index.js.map +1 -0
  60. package/dist/components/Pager/styles.d.ts +51 -0
  61. package/dist/components/Pager/styles.js +44 -0
  62. package/dist/components/Pager/styles.js.map +1 -0
  63. package/dist/components/RadioInput/index.d.ts +1 -0
  64. package/dist/components/RadioInput/index.js +13 -19
  65. package/dist/components/RadioInput/index.js.map +1 -1
  66. package/dist/components/RadioInput/styles.d.ts +48 -44
  67. package/dist/components/RadioInput/styles.js +4 -4
  68. package/dist/components/RadioInput/styles.js.map +1 -1
  69. package/dist/components/Scroll.d.ts +3 -2
  70. package/dist/components/Scroll.js +11 -8
  71. package/dist/components/Scroll.js.map +1 -1
  72. package/dist/components/Sections.d.ts +11 -0
  73. package/dist/components/Sections.js +77 -0
  74. package/dist/components/Sections.js.map +1 -0
  75. package/dist/components/Select/index.d.ts +5 -2
  76. package/dist/components/Select/index.js +118 -5
  77. package/dist/components/Select/index.js.map +1 -1
  78. package/dist/components/Select/styles.d.ts +9 -0
  79. package/dist/components/Select/styles.js +57 -0
  80. package/dist/components/Select/styles.js.map +1 -0
  81. package/dist/components/Select/types.d.ts +33 -0
  82. package/dist/components/Select/types.js +3 -0
  83. package/dist/components/Select/types.js.map +1 -0
  84. package/dist/components/Slider/Mark.d.ts +3 -0
  85. package/dist/components/Slider/Mark.js +32 -0
  86. package/dist/components/Slider/Mark.js.map +1 -0
  87. package/dist/components/Slider/Thumb.d.ts +7 -0
  88. package/dist/components/Slider/Thumb.js +30 -0
  89. package/dist/components/Slider/Thumb.js.map +1 -0
  90. package/dist/components/Slider/index.d.ts +3 -0
  91. package/dist/components/Slider/index.js +94 -0
  92. package/dist/components/Slider/index.js.map +1 -0
  93. package/dist/components/{Slider.d.ts → Slider/types.d.ts} +12 -7
  94. package/dist/components/Slider/types.js +3 -0
  95. package/dist/components/Slider/types.js.map +1 -0
  96. package/dist/components/Switch.d.ts +2 -2
  97. package/dist/components/Switch.js +6 -7
  98. package/dist/components/Switch.js.map +1 -1
  99. package/dist/components/Text.js +5 -5
  100. package/dist/components/Text.js.map +1 -1
  101. package/dist/components/TextInput.d.ts +108 -94
  102. package/dist/components/TextInput.js +28 -25
  103. package/dist/components/TextInput.js.map +1 -1
  104. package/dist/components/Touchable.d.ts +1 -0
  105. package/dist/components/Touchable.js +9 -11
  106. package/dist/components/Touchable.js.map +1 -1
  107. package/dist/components/View.d.ts +97 -175
  108. package/dist/components/View.js +4 -4
  109. package/dist/components/View.js.map +1 -1
  110. package/dist/components/{index.d.ts → components.d.ts} +3 -0
  111. package/dist/components/{index.js → components.js} +4 -1
  112. package/dist/components/components.js.map +1 -0
  113. package/dist/index.d.ts +3 -1
  114. package/dist/index.js +5 -2
  115. package/dist/index.js.map +1 -1
  116. package/dist/modules/documentPicker.d.ts +3 -1
  117. package/dist/modules/documentPicker.js +6 -4
  118. package/dist/modules/documentPicker.js.map +1 -1
  119. package/dist/modules/fastImage.js +1 -1
  120. package/dist/modules/fastImage.js.map +1 -1
  121. package/dist/modules/reactNavigation.d.ts +3 -0
  122. package/dist/modules/reactNavigation.js +11 -0
  123. package/dist/modules/reactNavigation.js.map +1 -0
  124. package/dist/modules/types/fileTypes.d.ts +138 -0
  125. package/dist/modules/types/fileTypes.js +3 -0
  126. package/dist/modules/types/fileTypes.js.map +1 -0
  127. package/dist/types/utility.d.ts +1 -1
  128. package/dist/utils/OSAlert.d.ts +3 -3
  129. package/dist/utils/OSAlert.js.map +1 -1
  130. package/dist/utils/misc.d.ts +2 -0
  131. package/dist/utils/misc.js +26 -0
  132. package/dist/utils/misc.js.map +1 -0
  133. package/dist/utils/styles.js +1 -1
  134. package/dist/utils/styles.js.map +1 -1
  135. package/package.json +6 -3
  136. package/src/components/ActivityIndicator.tsx +38 -28
  137. package/src/components/Animated.tsx +22 -19
  138. package/src/components/Button.tsx +67 -34
  139. package/src/components/Checkbox/index.tsx +60 -48
  140. package/src/components/Checkbox/styles.ts +39 -30
  141. package/src/components/ContentView.tsx +24 -18
  142. package/src/components/FileInput.tsx +161 -52
  143. package/src/components/Icon.tsx +36 -23
  144. package/src/components/Image.tsx +42 -36
  145. package/src/components/List.tsx +100 -0
  146. package/src/components/Modal/index.tsx +109 -94
  147. package/src/components/Modal/styles.ts +62 -66
  148. package/src/components/Navigation/Navigation.tsx +51 -0
  149. package/src/components/Navigation/constants.ts +8 -0
  150. package/src/components/Navigation/index.tsx +3 -0
  151. package/src/components/Navigation/types.ts +37 -0
  152. package/src/components/Navigation/utils.tsx +54 -0
  153. package/src/components/Overlay.tsx +68 -64
  154. package/src/components/Pager/index.tsx +241 -0
  155. package/src/components/Pager/styles.ts +51 -0
  156. package/src/components/RadioInput/index.tsx +76 -52
  157. package/src/components/RadioInput/styles.ts +23 -18
  158. package/src/components/Scroll.tsx +84 -73
  159. package/src/components/Select/index.tsx +179 -6
  160. package/src/components/Select/styles.ts +81 -0
  161. package/src/components/Select/types.ts +41 -0
  162. package/src/components/Slider/Mark.tsx +46 -0
  163. package/src/components/Slider/Thumb.tsx +29 -0
  164. package/src/components/Slider/index.tsx +123 -0
  165. package/src/components/Slider/types.ts +25 -0
  166. package/src/components/Switch.tsx +63 -54
  167. package/src/components/Text.tsx +22 -23
  168. package/src/components/TextInput.tsx +195 -198
  169. package/src/components/Touchable.tsx +43 -30
  170. package/src/components/View.tsx +32 -29
  171. package/src/components/components.ts +26 -0
  172. package/src/index.ts +6 -3
  173. package/src/modules/documentPicker.ts +8 -2
  174. package/src/modules/fastImage.ts +2 -2
  175. package/src/modules/index.d.ts +496 -0
  176. package/src/modules/reactNavigation.ts +4 -0
  177. package/src/modules/types/documentPicker.d.ts +215 -0
  178. package/src/modules/types/fileTypes.ts +138 -0
  179. package/src/types/utility.ts +2 -2
  180. package/src/utils/OSAlert.ts +35 -33
  181. package/src/utils/misc.ts +24 -0
  182. package/src/utils/styles.ts +14 -17
  183. package/dist/components/Drawer.d.ts +0 -23
  184. package/dist/components/Drawer.js +0 -78
  185. package/dist/components/Drawer.js.map +0 -1
  186. package/dist/components/Navigation.d.ts +0 -30
  187. package/dist/components/Navigation.js +0 -126
  188. package/dist/components/Navigation.js.map +0 -1
  189. package/dist/components/Slider.js +0 -130
  190. package/dist/components/Slider.js.map +0 -1
  191. package/dist/components/index.js.map +0 -1
  192. package/dist/modules/cropPicker.d.ts +0 -1
  193. package/dist/modules/cropPicker.js +0 -10
  194. package/dist/modules/cropPicker.js.map +0 -1
  195. package/src/components/Navigation.tsx +0 -125
  196. package/src/components/Slider.tsx +0 -198
  197. package/src/components/index.ts +0 -23
@@ -0,0 +1,138 @@
1
+ declare const mimeTypes: Readonly<{
2
+ readonly allFiles: '*/*';
3
+ readonly audio: 'audio/*';
4
+ readonly csv: 'text/csv';
5
+ readonly doc: 'application/msword';
6
+ readonly docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
7
+ readonly images: 'image/*';
8
+ readonly pdf: 'application/pdf';
9
+ readonly plainText: 'text/plain';
10
+ readonly ppt: 'application/vnd.ms-powerpoint';
11
+ readonly pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
12
+ readonly video: 'video/*';
13
+ readonly xls: 'application/vnd.ms-excel';
14
+ readonly xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
15
+ readonly zip: 'application/zip';
16
+ }>;
17
+ declare const utis: Readonly<{
18
+ readonly allFiles: 'public.item';
19
+ readonly audio: 'public.audio';
20
+ readonly csv: 'public.comma-separated-values-text';
21
+ readonly doc: 'com.microsoft.word.doc';
22
+ readonly docx: 'org.openxmlformats.wordprocessingml.document';
23
+ readonly images: 'public.image';
24
+ readonly pdf: 'com.adobe.pdf';
25
+ readonly plainText: 'public.plain-text';
26
+ readonly ppt: 'com.microsoft.powerpoint.ppt';
27
+ readonly pptx: 'org.openxmlformats.presentationml.presentation';
28
+ readonly video: 'public.movie';
29
+ readonly xls: 'com.microsoft.excel.xls';
30
+ readonly xlsx: 'org.openxmlformats.spreadsheetml.sheet';
31
+ readonly zip: 'public.zip-archive';
32
+ }>;
33
+ declare const extensions: Readonly<{
34
+ readonly allFiles: '*';
35
+ readonly audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma';
36
+ readonly csv: '.csv';
37
+ readonly doc: '.doc';
38
+ readonly docx: '.docx';
39
+ readonly images: '.jpeg .jpg .png';
40
+ readonly pdf: '.pdf';
41
+ readonly plainText: '.txt';
42
+ readonly ppt: '.ppt';
43
+ readonly pptx: '.pptx';
44
+ readonly video: '.mp4';
45
+ readonly xls: '.xls';
46
+ readonly xlsx: '.xlsx';
47
+ readonly zip: '.zip .gz';
48
+ }>;
49
+ export declare type PlatformTypes = {
50
+ android: typeof mimeTypes;
51
+ ios: typeof utis;
52
+ windows: typeof extensions;
53
+ };
54
+ export declare type SupportedPlatforms = 'ios' | 'android' | 'windows';
55
+ export declare const perPlatformTypes: {
56
+ android: Readonly<{
57
+ readonly allFiles: '*/*';
58
+ readonly audio: 'audio/*';
59
+ readonly csv: 'text/csv';
60
+ readonly doc: 'application/msword';
61
+ readonly docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
62
+ readonly images: 'image/*';
63
+ readonly pdf: 'application/pdf';
64
+ readonly plainText: 'text/plain';
65
+ readonly ppt: 'application/vnd.ms-powerpoint';
66
+ readonly pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
67
+ readonly video: 'video/*';
68
+ readonly xls: 'application/vnd.ms-excel';
69
+ readonly xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
70
+ readonly zip: 'application/zip';
71
+ }>;
72
+ ios: Readonly<{
73
+ readonly allFiles: 'public.item';
74
+ readonly audio: 'public.audio';
75
+ readonly csv: 'public.comma-separated-values-text';
76
+ readonly doc: 'com.microsoft.word.doc';
77
+ readonly docx: 'org.openxmlformats.wordprocessingml.document';
78
+ readonly images: 'public.image';
79
+ readonly pdf: 'com.adobe.pdf';
80
+ readonly plainText: 'public.plain-text';
81
+ readonly ppt: 'com.microsoft.powerpoint.ppt';
82
+ readonly pptx: 'org.openxmlformats.presentationml.presentation';
83
+ readonly video: 'public.movie';
84
+ readonly xls: 'com.microsoft.excel.xls';
85
+ readonly xlsx: 'org.openxmlformats.spreadsheetml.sheet';
86
+ readonly zip: 'public.zip-archive';
87
+ }>;
88
+ windows: Readonly<{
89
+ readonly allFiles: '*';
90
+ readonly audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma';
91
+ readonly csv: '.csv';
92
+ readonly doc: '.doc';
93
+ readonly docx: '.docx';
94
+ readonly images: '.jpeg .jpg .png';
95
+ readonly pdf: '.pdf';
96
+ readonly plainText: '.txt';
97
+ readonly ppt: '.ppt';
98
+ readonly pptx: '.pptx';
99
+ readonly video: '.mp4';
100
+ readonly xls: '.xls';
101
+ readonly xlsx: '.xlsx';
102
+ readonly zip: '.zip .gz';
103
+ }>;
104
+ macos: Readonly<{
105
+ readonly allFiles: '*';
106
+ readonly audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma';
107
+ readonly csv: '.csv';
108
+ readonly doc: '.doc';
109
+ readonly docx: '.docx';
110
+ readonly images: '.jpeg .jpg .png';
111
+ readonly pdf: '.pdf';
112
+ readonly plainText: '.txt';
113
+ readonly ppt: '.ppt';
114
+ readonly pptx: '.pptx';
115
+ readonly video: '.mp4';
116
+ readonly xls: '.xls';
117
+ readonly xlsx: '.xlsx';
118
+ readonly zip: '.zip .gz';
119
+ }>;
120
+ web: Readonly<{
121
+ readonly allFiles: '*';
122
+ readonly audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma';
123
+ readonly csv: '.csv';
124
+ readonly doc: '.doc';
125
+ readonly docx: '.docx';
126
+ readonly images: '.jpeg .jpg .png';
127
+ readonly pdf: '.pdf';
128
+ readonly plainText: '.txt';
129
+ readonly ppt: '.ppt';
130
+ readonly pptx: '.pptx';
131
+ readonly video: '.mp4';
132
+ readonly xls: '.xls';
133
+ readonly xlsx: '.xlsx';
134
+ readonly zip: '.zip .gz';
135
+ }>;
136
+ };
137
+ export declare const typesAreEqual: true;
138
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=fileTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileTypes.js","sourceRoot":"","sources":["../../../src/modules/types/fileTypes.ts"],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import { StyleProp } from "react-native";
1
+ import { StyleProp } from 'react-native';
2
2
  export declare type StylesOf<C extends string> = Partial<Record<C, StyleProp<any>>>;
@@ -19,9 +19,9 @@ declare type OSAlertArgs = {
19
19
  declare type AlertEvent = AlertButton['onPress'];
20
20
  declare type NamedEvents<E extends string> = Partial<Record<E, AlertEvent>>;
21
21
  declare function ask({ title, body, options }: OSAlertArgs): void;
22
- declare function warn({ title, body, onAccept, onReject }: OSAlertArgs & NamedEvents<'onReject' | 'onAccept'>): void;
23
- declare function info({ title, body, onDismiss }: OSAlertArgs & NamedEvents<'onDismiss'>): void;
24
- declare function OSError({ title, body, onDismiss }: OSAlertArgs & NamedEvents<'onDismiss'>): void;
22
+ declare function warn({ title, body, onAccept, onReject, }: OSAlertArgs & NamedEvents<'onReject' | 'onAccept'>): void;
23
+ declare function info({ title, body, onDismiss, }: OSAlertArgs & NamedEvents<'onDismiss'>): void;
24
+ declare function OSError({ title, body, onDismiss, }: OSAlertArgs & NamedEvents<'onDismiss'>): void;
25
25
  declare const _default: {
26
26
  ask: typeof ask;
27
27
  warn: typeof warn;
@@ -1 +1 @@
1
- {"version":3,"file":"OSAlert.js","sourceRoot":"","sources":["../../src/utils/OSAlert.ts"],"names":[],"mappings":";;AAAA,yCAAyC;AACzC,6CAAiD;AA0BjD,SAAS,GAAG,CAAC,EAA2C;QAAzC,KAAK,WAAA,EAAE,IAAI,UAAA,EAAE,eAAc,EAAd,OAAO,mBAAG,IAAI,KAAA;IAExC,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,eAAe,CAAA;KACxB;IACD,OAAO,CAAC;QACN,KAAK,OAAA;QACL,IAAI,MAAA;QACJ,OAAO,SAAA;KACR,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,IAAI,CAAC,EAAoF;QAAlF,KAAK,WAAA,EAAE,IAAI,UAAA,EAAE,QAAQ,cAAA,EAAE,QAAQ,cAAA;IAE7C,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,SAAS,CAAA;KAClB;IACD,IAAI,CAAC,IAAI,EAAE;QACT,IAAI,GAAG,eAAe,CAAA;KACvB;IACD,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAA;KACtB;IACD,OAAO,CAAC;QACN,KAAK,OAAA;QACL,IAAI,MAAA;QACJ,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAC,QAAQ;aACjB;YACD;gBACE,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,aAAa;gBACpB,OAAO,EAAE,QAAQ;aAClB;SACF;KACF,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,IAAI,CAAC,EAA8E;QAA5E,KAAK,WAAA,EAAE,IAAI,UAAA,EAAE,iBAAsB,EAAtB,SAAS,mBAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,KAAA;IAEjD,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,KAAK,CAAA;KACd;IACD,OAAO,CAAC;QACN,KAAK,OAAA;QACL,IAAI,MAAA;QACJ,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,IAAI;gBACV,OAAO,EAAC,SAAS;aAClB;SACF;KACF,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,EAA8E;QAA5E,KAAK,WAAA,EAAE,IAAI,UAAA,EAAE,iBAAsB,EAAtB,SAAS,mBAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,KAAA;IACpD,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,SAAS,CAAA;KAClB;IACD,IAAI,CAAC,IAAI,EAAE;QACT,IAAI,GAAG,sBAAsB,CAAA;KAC9B;IACD,OAAO,CAAC;QACN,KAAK,OAAA;QACL,IAAI,MAAA;QACJ,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE,cAAM,OAAA,SAAS,EAAE,EAAX,CAAW;aAC3B;SACF;KACF,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,MAAkB;IACjC,oBAAK,CAAC,KAAK,CACT,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,OAAO,EACd;QACE,UAAU,EAAE,KAAK;KAClB,CACF,CAAA;AACH,CAAC;AAGD,kBAAe;IACX,GAAG,KAAA;IACH,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,KAAK,EAAE,OAAO;CACf,CAAA"}
1
+ {"version":3,"file":"OSAlert.js","sourceRoot":"","sources":["../../src/utils/OSAlert.ts"],"names":[],"mappings":";;AAAA,yCAAyC;AACzC,6CAAiD;AAyBjD,SAAS,GAAG,CAAC,EAA4C;QAA1C,KAAK,WAAA,EAAE,IAAI,UAAA,EAAE,eAAc,EAAd,OAAO,mBAAG,IAAI,KAAA;IACxC,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,eAAe,CAAA;KACxB;IACD,OAAO,CAAC;QACN,KAAK,OAAA;QACL,IAAI,MAAA;QACJ,OAAO,SAAA;KACR,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,IAAI,CAAC,EAKuC;QAJnD,KAAK,WAAA,EACL,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR,QAAQ,cAAA;IAER,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,SAAS,CAAA;KAClB;IACD,IAAI,CAAC,IAAI,EAAE;QACT,IAAI,GAAG,eAAe,CAAA;KACvB;IACD,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAA;KACtB;IACD,OAAO,CAAC;QACN,KAAK,OAAA;QACL,IAAI,MAAA;QACJ,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,QAAQ;aAClB;YACD;gBACE,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,aAAa;gBACpB,OAAO,EAAE,QAAQ;aAClB;SACF;KACF,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,IAAI,CAAC,EAI2B;QAHvC,KAAK,WAAA,EACL,IAAI,UAAA,EACJ,iBAAsB,EAAtB,SAAS,mBAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,KAAA;IAEtB,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,KAAK,CAAA;KACd;IACD,OAAO,CAAC;QACN,KAAK,OAAA;QACL,IAAI,MAAA;QACJ,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE,SAAS;aACnB;SACF;KACF,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,EAIwB;QAHvC,KAAK,WAAA,EACL,IAAI,UAAA,EACJ,iBAAsB,EAAtB,SAAS,mBAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,KAAA;IAEtB,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,SAAS,CAAA;KAClB;IACD,IAAI,CAAC,IAAI,EAAE;QACT,IAAI,GAAG,sBAAsB,CAAA;KAC9B;IACD,OAAO,CAAC;QACN,KAAK,OAAA;QACL,IAAI,MAAA;QACJ,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE,cAAM,OAAA,SAAS,EAAE,EAAX,CAAW;aAC3B;SACF;KACF,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,MAAmB;IAClC,oBAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE;QACrD,UAAU,EAAE,KAAK;KAClB,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe;IACb,GAAG,KAAA;IACH,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,KAAK,EAAE,OAAO;CACf,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { MobileInputFile } from '@codeleap/common';
2
+ export declare const stringToFile: (str: string) => MobileInputFile;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stringToFile = void 0;
4
+ var common_1 = require("@codeleap/common");
5
+ var stringToFile = function (str) {
6
+ if (!str) {
7
+ return {
8
+ file: null,
9
+ preview: null,
10
+ };
11
+ }
12
+ var fileData = (0, common_1.parseFilePathData)(str);
13
+ var data = {
14
+ name: fileData.name,
15
+ type: 'image/' + fileData.extension,
16
+ size: 1000,
17
+ uri: str,
18
+ fileCopyUri: str,
19
+ };
20
+ return {
21
+ file: data,
22
+ preview: data.uri,
23
+ };
24
+ };
25
+ exports.stringToFile = stringToFile;
26
+ //# sourceMappingURL=misc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/utils/misc.ts"],"names":[],"mappings":";;;AAAA,2CAAqE;AAE9D,IAAM,YAAY,GAAG,UAAC,GAAW;IACtC,IAAI,CAAC,GAAG,EAAE;QACR,OAAO;YACL,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,IAAI;SACd,CAAA;KACF;IACD,IAAM,QAAQ,GAAG,IAAA,0BAAiB,EAAC,GAAG,CAAC,CAAA;IAEvC,IAAM,IAAI,GAA4B;QACpC,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC,SAAS;QACnC,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,GAAG;QACR,WAAW,EAAE,GAAG;KACjB,CAAA;IAED,OAAO;QACL,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KAClB,CAAA;AACH,CAAC,CAAA;AArBY,QAAA,YAAY,gBAqBxB"}
@@ -4,7 +4,7 @@ exports.useLogStyles = void 0;
4
4
  var common_1 = require("@codeleap/common");
5
5
  var react_native_1 = require("react-native");
6
6
  function useLogStyles() {
7
- var logger = (0, common_1.useStyle)().logger;
7
+ var logger = (0, common_1.useCodeleapContext)().logger;
8
8
  return function (name, styles) {
9
9
  logger.debug.blue(name, JSON.stringify(react_native_1.StyleSheet.flatten(styles), null, 2), 'Component Styles');
10
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/utils/styles.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,6CAA0C;AAE1C,SAAgB,YAAY;IAEjB,IAAA,MAAM,GAAI,IAAA,iBAAQ,GAAE,OAAd,CAAc;IAG3B,OAAO,UAAC,IAAI,EAAC,MAAM;QACf,MAAM,CAAC,KAAK,CAAC,IAAI,CACb,IAAI,EACJ,IAAI,CAAC,SAAS,CAAC,yBAAU,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EACnD,kBAAkB,CACrB,CAAA;IACL,CAAC,CAAA;AAEL,CAAC;AAbD,oCAaC"}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/utils/styles.ts"],"names":[],"mappings":";;;AAAA,2CAAqD;AACrD,6CAAyC;AAEzC,SAAgB,YAAY;IAClB,IAAA,MAAM,GAAK,IAAA,2BAAkB,GAAE,OAAzB,CAAyB;IAEvC,OAAO,UAAC,IAAI,EAAE,MAAM;QAClB,MAAM,CAAC,KAAK,CAAC,IAAI,CACf,IAAI,EACJ,IAAI,CAAC,SAAS,CAAC,yBAAU,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EACnD,kBAAkB,CACnB,CAAA;IACH,CAAC,CAAA;AACH,CAAC;AAVD,oCAUC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeleap/mobile",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "main": "src/index.ts",
5
5
  "repository": "git@github.com:codeleap-uk/codeleap-lib.git",
6
6
  "author": "Paulo Henrique De Souza <paulosouza300272@gmail.com>",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "scripts": {
15
15
  "build": "tsc --build",
16
- "lint": "./node_modules/.bin/eslint -c .eslintrc.js \"./src/**/*.{ts,tsx,js,jsx}\"",
16
+ "lint": "eslint -c .eslintrc.js --fix \"./src/**/*.{ts,tsx,js,jsx}\"",
17
17
  "publish": "npm publish"
18
18
  },
19
19
  "peerDependencies": {
@@ -22,9 +22,12 @@
22
22
  "@react-navigation/drawer": "^6.1.8",
23
23
  "@react-navigation/native": "^6.0.6",
24
24
  "@react-navigation/native-stack": "^6.2.5",
25
+ "@react-navigation/stack": "^6.1.1",
25
26
  "react": "*",
26
27
  "react-native": "*",
27
- "react-native-fast-image": "^8.5.11"
28
+ "react-native-fast-image": "^8.5.11",
29
+ "react-native-gesture-handler": "^2.2.0",
30
+ "react-native-image-crop-picker": "*"
28
31
  },
29
32
  "dependencies": {
30
33
  "@miblanchard/react-native-slider": "^2.1.0",
@@ -1,37 +1,47 @@
1
1
  import * as React from 'react'
2
2
  import { ComponentPropsWithoutRef, forwardRef } from 'react'
3
3
  import { ActivityIndicator as Indicator, StyleSheet } from 'react-native'
4
- import { ActivityIndicatorComposition, ActivityIndicatorStyles,
5
- useComponentStyle, ComponentVariants, useStyle } from '@codeleap/common'
4
+ import {
5
+ ActivityIndicatorComposition,
6
+ ActivityIndicatorStyles,
7
+ useDefaultComponentStyle,
8
+ ComponentVariants,
9
+ useCodeleapContext,
10
+ } from '@codeleap/common'
6
11
  import { StylesOf } from '../types/utility'
7
12
 
8
- export type ActivityIndicatorProps =
9
- ComponentPropsWithoutRef<typeof Indicator> &
10
- {
11
- variants?: ComponentVariants <typeof ActivityIndicatorStyles>['variants'],
12
- styles?: StylesOf<ActivityIndicatorComposition>
13
- }
13
+ export type ActivityIndicatorProps = ComponentPropsWithoutRef<
14
+ typeof Indicator
15
+ > & {
16
+ variants?: ComponentVariants<typeof ActivityIndicatorStyles>['variants'];
17
+ styles?: StylesOf<ActivityIndicatorComposition>;
18
+ };
14
19
 
15
- export const ActivityIndicator =
16
- forwardRef<Indicator, ActivityIndicatorProps>((activityIndicatorProps, ref) => {
20
+ export const ActivityIndicator = forwardRef<Indicator, ActivityIndicatorProps>(
21
+ (activityIndicatorProps, ref) => {
22
+ const { variants = [], style, styles: propStyles, ...props } = activityIndicatorProps
17
23
 
18
- const {
19
- variants = [],
20
- style,
21
- ...props
22
- } = activityIndicatorProps
24
+ const variantStyles = useDefaultComponentStyle('ActivityIndicator', {
25
+ variants,
26
+ transform: StyleSheet.flatten,
27
+ styles: propStyles,
28
+ })
23
29
 
24
- const variantStyles = useComponentStyle('ActivityIndicator', {
25
- variants
26
- })
30
+ const { Theme } = useCodeleapContext()
27
31
 
28
- const { Theme } = useStyle()
29
-
30
- const styles = StyleSheet.flatten([variantStyles.wrapper, style])
31
- const color = styles?.color || Theme.colors.gray
32
- const size = styles?.height || styles?.width || 'large'
33
- return (
34
- <Indicator size={size} ref={ref} color={color} style={styles} {...props} />
35
- )
36
-
37
- })
32
+ const color = variantStyles.wrapper?.color || Theme.colors.gray
33
+ const size = variantStyles.wrapper?.height || variantStyles.wrapper?.width || 'large'
34
+
35
+ const styles = StyleSheet.flatten([variantStyles.wrapper, style])
36
+
37
+ return (
38
+ <Indicator
39
+ size={size}
40
+ ref={ref}
41
+ color={color}
42
+ style={styles}
43
+ {...props}
44
+ />
45
+ )
46
+ },
47
+ )
@@ -2,30 +2,33 @@ import { onUpdate } from '@codeleap/common'
2
2
  import React, { useRef } from 'react'
3
3
 
4
4
  import posed from 'react-native-pose'
5
- import {Touchable} from './Touchable'
6
- import {View} from './View'
5
+ import { Touchable } from './Touchable'
6
+ import { View } from './View'
7
7
  const Components = {
8
- Touchable,
9
- View
8
+ Touchable,
9
+ View,
10
10
  }
11
11
 
12
+ const PosedComponents = Object.fromEntries(
13
+ Object.entries(Components).map(([key, Render]) => [key, posed(Render)]),
14
+ )
12
15
 
13
- const PosedComponents = Object.fromEntries(Object.entries(Components).map(([key,Render]) => [key, posed(Render)]))
16
+ type AnimatedComponents = typeof Components;
17
+ type CP = keyof AnimatedComponents;
14
18
 
15
- type AnimatedComponents = typeof Components
16
- type CP = keyof AnimatedComponents
19
+ type AnimatedProps<T extends CP, CFG = Record<string, any>> = {
20
+ component: T;
21
+ config: CFG;
22
+ pose: keyof CFG;
23
+ initialPose?: keyof CFG;
24
+ } & Omit<Parameters<AnimatedComponents[T]>[0], 'component'>;
17
25
 
18
- type AnimatedProps<T extends CP, CFG = Record<string,any>> = {
19
- component: T
20
- config: CFG
21
- pose: keyof CFG
22
- initialPose?: keyof CFG
23
- } & Omit<Parameters<AnimatedComponents[T]>[0],'component'>
26
+ export const Animated = <T extends CP, CFG = any>({
27
+ config,
28
+ component,
29
+ ...props
30
+ }: AnimatedProps<T, CFG>) => {
31
+ const Component = useRef(PosedComponents[component](config)).current
24
32
 
25
- export const Animated = <T extends CP, CFG = any>({config,component, ...props}:AnimatedProps<T, CFG>) => {
26
-
27
- const Component = useRef(PosedComponents[component](config)).current
28
-
29
- return <Component {...props} />
33
+ return <Component withParent={false} {...props} />
30
34
  }
31
-
@@ -1,62 +1,95 @@
1
1
  import * as React from 'react'
2
- import { useComponentStyle, ButtonStyles, ComponentVariants, ButtonComposition } from '@codeleap/common';
3
- import { forwardRef } from 'react'
4
- import { StylesOf } from '../types/utility';
5
- import { Text } from './Text';
6
- import { Touchable, TouchableProps } from './Touchable';
7
- import { Icon } from './Icon';
8
- import { ActivityIndicator } from './ActivityIndicator';
9
- import { IconPlaceholder } from '@codeleap/common';
10
- import { StyleSheet, TouchableOpacity } from 'react-native';
2
+ import {
3
+ useDefaultComponentStyle,
4
+ ButtonStyles,
5
+ ComponentVariants,
6
+ ButtonComposition,
7
+ ButtonParts,
8
+ IconPlaceholder,
9
+ } from '@codeleap/common'
10
+ import { forwardRef } from 'react'
11
+ import { StylesOf } from '../types/utility'
12
+ import { Text } from './Text'
13
+ import { Touchable, TouchableProps } from './Touchable'
14
+ import { Icon } from './Icon'
15
+ import { ActivityIndicator } from './ActivityIndicator'
16
+ import { StyleSheet, TouchableOpacity } from 'react-native'
11
17
 
12
18
 
19
+ export type ButtonProps = Omit<TouchableProps, 'variants'> &
20
+ ComponentVariants<typeof ButtonStyles> & {
21
+ text?: string;
22
+ rightIcon?: IconPlaceholder;
23
+ icon?: IconPlaceholder;
24
+ styles?: StylesOf<ButtonComposition>;
25
+ loading?: boolean;
26
+ debounce?: number
27
+ debugName?: string; // NOTE this should not be optional
28
+ };
13
29
 
14
-
15
- export type ButtonProps = Omit<TouchableProps,'variants'> & ComponentVariants<typeof ButtonStyles> & {
16
- text?:string
17
- rightIcon?: IconPlaceholder
18
- icon?: IconPlaceholder
19
- styles?: StylesOf<ButtonComposition>
20
- loading?: boolean
21
- }
22
-
23
- export const Button = forwardRef<TouchableOpacity, ButtonProps>( (buttonProps,ref) => {
24
- const {
30
+ export const Button = forwardRef<TouchableOpacity, ButtonProps>((buttonProps, ref) => {
31
+ const {
25
32
  variants = [],
26
- responsiveVariants = {},
27
33
  children,
28
34
  icon,
29
35
  text,
30
36
  loading,
31
37
  styles = {},
32
38
  onPress,
39
+ disabled,
33
40
  rightIcon,
34
- ...props
41
+ debounce = 600,
42
+ ...props
35
43
  } = buttonProps
36
-
37
-
38
- const variantStyles = useComponentStyle('Button', {
44
+ const [pressed, setPressed] = React.useState(false)
45
+
46
+
47
+ const variantStyles = useDefaultComponentStyle('Button', {
39
48
  variants,
40
- })
49
+ transform: StyleSheet.flatten,
50
+ styles,
51
+ })
52
+
53
+ function handlePress() {
54
+ if (!pressed){
55
+ setPressed(true)
41
56
 
57
+ setTimeout(() => setPressed(false), debounce)
58
+
59
+ onPress && onPress()
60
+ }
61
+ }
42
62
 
43
- function handlePress(e:Parameters<ButtonProps['onPress']>[0]){
44
- onPress && onPress(e)
63
+ function getStyles(key: ButtonParts) {
64
+ return [
65
+ variantStyles[key],
66
+ disabled && variantStyles[key + ':disabled'],
67
+ styles[key],
68
+ disabled && styles[key + ':disabled'],
69
+ ]
45
70
  }
46
71
 
47
-
72
+ const iconStyle = getStyles('icon')
73
+
74
+ const leftIconStyle = StyleSheet.flatten([iconStyle, getStyles('leftIcon')])
75
+ const rightIconStyle = StyleSheet.flatten([iconStyle, getStyles('rightIcon')])
76
+
77
+ const hasText = !!(text || children)
48
78
  return (
49
79
  <Touchable
50
- style={[variantStyles.wrapper, styles.wrapper]}
80
+ style={getStyles('wrapper')}
51
81
  onPress={handlePress}
52
82
  ref={ref}
83
+ disabled={disabled}
84
+ debugComponent={'Button'}
53
85
  {...props}
54
86
  >
55
- {loading && <ActivityIndicator style={[variantStyles.loader, styles.loader]} />}
56
- {!loading && <Icon name={icon} style={StyleSheet.flatten([variantStyles.icon, styles.icon, variantStyles.leftIcon, styles.leftIcon])}/>}
57
- {text ? <Text text={text} style={[variantStyles.text, styles.text]}/> : null}
87
+
88
+ {loading && <ActivityIndicator style={getStyles('loader')} />}
89
+ {!loading && <Icon name={icon} style={leftIconStyle} renderEmptySpace={hasText}/>}
90
+ {text ? <Text text={text} style={getStyles('text')} /> : null}
58
91
  {children}
59
- <Icon name={rightIcon} style={StyleSheet.flatten([variantStyles.icon, styles.icon, variantStyles.rightIcon, styles.rightIcon])}/>
92
+ <Icon name={rightIcon} style={rightIconStyle} renderEmptySpace={hasText} />
60
93
  </Touchable>
61
94
  )
62
95
  })
@@ -1,68 +1,80 @@
1
1
  import * as React from 'react'
2
- import { ComponentVariants, useComponentStyle, StylesOf, Form, useValidate } from '@codeleap/common'
2
+ import {
3
+ ComponentVariants,
4
+ useDefaultComponentStyle,
5
+ StylesOf,
6
+ Form,
7
+ useValidate,
8
+ } from '@codeleap/common'
3
9
  import { ComponentPropsWithRef, forwardRef, ReactNode } from 'react'
4
10
  import { Switch as NativeCheckbox } from 'react-native'
5
11
  import { InputLabel, FormError } from '../TextInput'
6
12
  import { View } from '../View'
7
13
  import { Touchable } from '../Touchable'
8
14
  import {
9
- MobileCheckboxStyles as CheckboxStyles, MobileCheckboxComposition as CheckboxComposition
10
- } from './styles'
15
+ MobileCheckboxStyles as CheckboxStyles,
16
+ MobileCheckboxComposition as CheckboxComposition,
17
+ } from './styles'
11
18
  export * from './styles'
12
19
 
13
20
  type NativeCheckboxProps = Omit<
14
- ComponentPropsWithRef<typeof NativeCheckbox>,
15
- 'thumbColor'|'trackColor'
16
- >
21
+ ComponentPropsWithRef<typeof NativeCheckbox>,
22
+ 'thumbColor' | 'trackColor'
23
+ >;
17
24
  type CheckboxProps = NativeCheckboxProps & {
18
- variants?: ComponentVariants<typeof CheckboxStyles>['variants']
19
- label?: ReactNode
20
- styles?: StylesOf<CheckboxComposition>
21
- validate?: Form.ValidatorFunction | string
22
- }
25
+ variants?: ComponentVariants<typeof CheckboxStyles>['variants'];
26
+ label?: ReactNode;
27
+ styles?: StylesOf<CheckboxComposition>;
28
+ validate?: Form.ValidatorFunctionWithoutForm | string;
29
+ };
23
30
 
24
- export const Checkbox = forwardRef<NativeCheckbox,CheckboxProps>((checkboxProps,ref) => {
25
- const {
26
- variants = [],
27
- style = {},
28
- styles = {},
29
- label,
30
- value,
31
- onValueChange,
32
- validate,
33
- ...props
31
+ export const Checkbox = forwardRef<NativeCheckbox, CheckboxProps>(
32
+ (checkboxProps, ref) => {
33
+ const {
34
+ variants = [],
35
+ style = {},
36
+ styles = {},
37
+ label,
38
+ value,
39
+ onValueChange,
40
+ validate,
41
+ ...props
34
42
  } = checkboxProps
35
-
36
- const variantStyles = useComponentStyle('Checkbox', {
37
- // @ts-ignore
38
- variants,
39
- })
40
43
 
41
- const {error, showError} = useValidate(value,validate)
44
+ const variantStyles = useDefaultComponentStyle('Checkbox', {
45
+ // @ts-ignore
46
+ variants,
47
+ })
42
48
 
49
+ const { error, showError } = useValidate(value, validate)
43
50
 
44
- function getStyles(key:CheckboxComposition){
45
- return [
46
- variantStyles[key],
47
- variantStyles[key],
48
- key === 'wrapper' ? style : {},
49
- value ? variantStyles[key + ':checked'] : {},
50
- value ? styles[key + ':checked'] : {},
51
- showError ? variantStyles[key + ':error'] : {},
52
- showError ? styles[key + ':error'] : {},
53
- checkboxProps.disabled ? variantStyles[key + ':disabled'] : {},
54
- checkboxProps.disabled ? styles[key + ':disabled'] : {},
55
- ]
51
+ function getStyles(key: CheckboxComposition) {
52
+ return [
53
+ variantStyles[key],
54
+ variantStyles[key],
55
+ key === 'wrapper' ? style : {},
56
+ value ? variantStyles[key + ':checked'] : {},
57
+ value ? styles[key + ':checked'] : {},
58
+ showError ? variantStyles[key + ':error'] : {},
59
+ showError ? styles[key + ':error'] : {},
60
+ checkboxProps.disabled ? variantStyles[key + ':disabled'] : {},
61
+ checkboxProps.disabled ? styles[key + ':disabled'] : {},
62
+ ]
56
63
  }
57
64
 
58
- return <View style={getStyles('wrapper')} {...props}>
59
- <Touchable style={getStyles('input')} onPress={() => onValueChange(!value)}>
60
- <View style={getStyles('checkmarkWrapper')}>
61
- <View style={getStyles('checkmark')}/>
62
- </View>
63
- <InputLabel label={label} style={getStyles('label')}/>
64
-
65
+ return (
66
+ <View style={getStyles('wrapper')} {...props}>
67
+ <Touchable
68
+ style={getStyles('input')}
69
+ onPress={() => onValueChange(!value)}
70
+ >
71
+ <View style={getStyles('checkmarkWrapper')}>
72
+ <View style={getStyles('checkmark')} />
73
+ </View>
74
+ <InputLabel label={label} style={getStyles('label')} />
65
75
  </Touchable>
66
76
  <FormError message={error.message} style={getStyles('error')} />
67
- </View>
68
- })
77
+ </View>
78
+ )
79
+ },
80
+ )