@codeleap/mobile 2.4.7 → 3.1.1

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 (450) hide show
  1. package/mobile-packages.code-workspace +27 -0
  2. package/package.json +25 -33
  3. package/src/components/ActionIcon/index.tsx +16 -6
  4. package/src/components/ActionIcon/styles.ts +3 -90
  5. package/src/components/ActivityIndicator/index.tsx +28 -9
  6. package/src/components/ActivityIndicator/styles.ts +2 -59
  7. package/src/components/Autocomplete/index.tsx +235 -0
  8. package/src/components/Autocomplete/styles.ts +18 -0
  9. package/src/components/Autocomplete/types.ts +75 -0
  10. package/src/components/Avatar/index.tsx +126 -0
  11. package/src/components/Avatar/styles.ts +22 -0
  12. package/src/components/AvatarGroup/index.tsx +76 -0
  13. package/src/components/AvatarGroup/styles.ts +11 -0
  14. package/src/components/Backdrop/index.tsx +14 -13
  15. package/src/components/Backdrop/styles.ts +3 -24
  16. package/src/components/Badge/index.tsx +134 -0
  17. package/src/components/Badge/styles.ts +14 -0
  18. package/src/components/Button/index.tsx +39 -49
  19. package/src/components/Button/styles.ts +6 -107
  20. package/src/components/Calendar/index.tsx +3 -3
  21. package/src/components/Calendar/style.ts +2 -31
  22. package/src/components/Checkbox/index.tsx +137 -74
  23. package/src/components/Checkbox/styles.ts +13 -73
  24. package/src/components/ContentView/index.tsx +2 -2
  25. package/src/components/ContentView/styles.ts +1 -17
  26. package/src/components/DatePickerModal/index.tsx +240 -0
  27. package/src/components/DatePickerModal/styles.ts +15 -0
  28. package/src/components/DatePickerModal/types.ts +55 -0
  29. package/src/components/Drawer/index.tsx +2 -2
  30. package/src/components/Drawer/styles.ts +4 -39
  31. package/src/components/EmptyPlaceholder/index.tsx +3 -3
  32. package/src/components/EmptyPlaceholder/styles.ts +2 -47
  33. package/src/components/FileInput/styles.ts +1 -8
  34. package/src/components/Grid/index.tsx +76 -72
  35. package/src/components/Grid/styles.ts +4 -7
  36. package/src/components/Icon/index.tsx +46 -8
  37. package/src/components/Icon/styles.ts +3 -51
  38. package/src/components/Image/index.tsx +18 -22
  39. package/src/components/Image/styles.ts +1 -14
  40. package/src/components/ImageView/Spotlight.tsx +4 -2
  41. package/src/components/ImageView/component.tsx +0 -3
  42. package/src/components/InputBase/index.tsx +101 -0
  43. package/src/components/InputBase/styles.ts +135 -0
  44. package/src/components/InputBase/types.ts +28 -0
  45. package/src/components/InputBase/utils.ts +42 -0
  46. package/src/components/InputLabel/index.tsx +3 -3
  47. package/src/components/InputLabel/styles.ts +2 -14
  48. package/src/components/List/PaginationIndicator.tsx +4 -21
  49. package/src/components/List/index.tsx +84 -46
  50. package/src/components/List/styles.ts +8 -20
  51. package/src/components/LoadingOverlay/index.tsx +45 -45
  52. package/src/components/LoadingOverlay/styles.ts +5 -27
  53. package/src/components/Modal/index.tsx +56 -32
  54. package/src/components/Modal/styles.ts +3 -114
  55. package/src/components/NumberIncrement/index.tsx +318 -0
  56. package/src/components/NumberIncrement/styles.ts +14 -0
  57. package/src/components/NumberIncrement/types.ts +44 -0
  58. package/src/components/NumberIncrement/utils.ts +27 -0
  59. package/src/components/Pager/index.tsx +120 -67
  60. package/src/components/Pager/styles.ts +2 -69
  61. package/src/components/RadioInput/index.tsx +145 -68
  62. package/src/components/RadioInput/styles.ts +8 -61
  63. package/src/components/RefreshControl/index.tsx +28 -0
  64. package/src/components/RefreshControl/styles.ts +7 -0
  65. package/src/components/Scroll/index.tsx +22 -37
  66. package/src/components/Scroll/styles.ts +2 -16
  67. package/src/components/Sections/index.tsx +116 -54
  68. package/src/components/Sections/styles.ts +7 -0
  69. package/src/components/SegmentedControl/Option.tsx +51 -0
  70. package/src/components/SegmentedControl/index.tsx +51 -67
  71. package/src/components/SegmentedControl/styles.ts +7 -63
  72. package/src/components/Select/index.tsx +268 -95
  73. package/src/components/Select/styles.ts +11 -131
  74. package/src/components/Select/types.ts +47 -11
  75. package/src/components/Slider/index.tsx +151 -94
  76. package/src/components/Slider/styles.ts +7 -72
  77. package/src/components/Slider/types.ts +18 -20
  78. package/src/components/Switch/index.tsx +115 -63
  79. package/src/components/Switch/styles.ts +13 -30
  80. package/src/components/Text/index.tsx +14 -31
  81. package/src/components/Text/styles.ts +2 -41
  82. package/src/components/TextInput/index.tsx +237 -259
  83. package/src/components/TextInput/styles.ts +6 -120
  84. package/src/components/Touchable/index.tsx +74 -27
  85. package/src/components/Touchable/styles.ts +1 -12
  86. package/src/components/View/index.tsx +11 -26
  87. package/src/components/View/styles.ts +1 -17
  88. package/src/components/components.ts +9 -5
  89. package/src/components/defaultStyles.ts +74 -61
  90. package/src/index.ts +0 -1
  91. package/src/modules/PressableRipple/index.ts +5 -0
  92. package/src/modules/PressableRipple/ripple.js +258 -0
  93. package/src/modules/PressableRipple/styles.js +22 -0
  94. package/src/modules/PressableRipple/type.ts +17 -0
  95. package/src/modules/textInputMask.tsx +13 -0
  96. package/src/types/index.ts +5 -0
  97. package/src/types/utility.ts +2 -2
  98. package/src/utils/KeyboardAware/index.ts +0 -13
  99. package/src/utils/KeyboardAware/keyboardHooks.ts +69 -79
  100. package/src/utils/hooks.ts +63 -36
  101. package/src/utils/index.ts +1 -0
  102. package/src/utils/locale.ts +7 -0
  103. package/src/utils/theme.ts +1 -21
  104. package/dist/components/ActionIcon/index.d.ts +0 -13
  105. package/dist/components/ActionIcon/index.js +0 -51
  106. package/dist/components/ActionIcon/index.js.map +0 -1
  107. package/dist/components/ActionIcon/styles.d.ts +0 -65
  108. package/dist/components/ActionIcon/styles.js +0 -61
  109. package/dist/components/ActionIcon/styles.js.map +0 -1
  110. package/dist/components/ActivityIndicator/index.d.ts +0 -15
  111. package/dist/components/ActivityIndicator/index.js +0 -55
  112. package/dist/components/ActivityIndicator/index.js.map +0 -1
  113. package/dist/components/ActivityIndicator/styles.d.ts +0 -59
  114. package/dist/components/ActivityIndicator/styles.js +0 -52
  115. package/dist/components/ActivityIndicator/styles.js.map +0 -1
  116. package/dist/components/Animated.d.ts +0 -15
  117. package/dist/components/Animated.js +0 -55
  118. package/dist/components/Animated.js.map +0 -1
  119. package/dist/components/AutoComplete/index.d.ts +0 -34
  120. package/dist/components/AutoComplete/index.js +0 -126
  121. package/dist/components/AutoComplete/index.js.map +0 -1
  122. package/dist/components/AutoComplete/styles.d.ts +0 -57
  123. package/dist/components/AutoComplete/styles.js +0 -89
  124. package/dist/components/AutoComplete/styles.js.map +0 -1
  125. package/dist/components/Backdrop/index.d.ts +0 -14
  126. package/dist/components/Backdrop/index.js +0 -59
  127. package/dist/components/Backdrop/index.js.map +0 -1
  128. package/dist/components/Backdrop/styles.d.ts +0 -53
  129. package/dist/components/Backdrop/styles.js +0 -28
  130. package/dist/components/Backdrop/styles.js.map +0 -1
  131. package/dist/components/Button/index.d.ts +0 -246
  132. package/dist/components/Button/index.js +0 -115
  133. package/dist/components/Button/index.js.map +0 -1
  134. package/dist/components/Button/styles.d.ts +0 -65
  135. package/dist/components/Button/styles.js +0 -61
  136. package/dist/components/Button/styles.js.map +0 -1
  137. package/dist/components/Calendar/index.d.ts +0 -15
  138. package/dist/components/Calendar/index.js +0 -76
  139. package/dist/components/Calendar/index.js.map +0 -1
  140. package/dist/components/Calendar/style.d.ts +0 -4
  141. package/dist/components/Calendar/style.js +0 -36
  142. package/dist/components/Calendar/style.js.map +0 -1
  143. package/dist/components/Calendar/types.d.ts +0 -95
  144. package/dist/components/Calendar/types.js +0 -3
  145. package/dist/components/Calendar/types.js.map +0 -1
  146. package/dist/components/Checkbox/index.d.ts +0 -15
  147. package/dist/components/Checkbox/index.js +0 -81
  148. package/dist/components/Checkbox/index.js.map +0 -1
  149. package/dist/components/Checkbox/styles.d.ts +0 -56
  150. package/dist/components/Checkbox/styles.js +0 -53
  151. package/dist/components/Checkbox/styles.js.map +0 -1
  152. package/dist/components/ContentView/index.d.ts +0 -12
  153. package/dist/components/ContentView/index.js +0 -62
  154. package/dist/components/ContentView/index.js.map +0 -1
  155. package/dist/components/ContentView/styles.d.ts +0 -53
  156. package/dist/components/ContentView/styles.js +0 -26
  157. package/dist/components/ContentView/styles.js.map +0 -1
  158. package/dist/components/Drawer/index.d.ts +0 -7
  159. package/dist/components/Drawer/index.js +0 -66
  160. package/dist/components/Drawer/index.js.map +0 -1
  161. package/dist/components/Drawer/styles.d.ts +0 -56
  162. package/dist/components/Drawer/styles.js +0 -39
  163. package/dist/components/Drawer/styles.js.map +0 -1
  164. package/dist/components/EmptyPlaceholder/index.d.ts +0 -25
  165. package/dist/components/EmptyPlaceholder/index.js +0 -88
  166. package/dist/components/EmptyPlaceholder/index.js.map +0 -1
  167. package/dist/components/EmptyPlaceholder/styles.d.ts +0 -55
  168. package/dist/components/EmptyPlaceholder/styles.js +0 -30
  169. package/dist/components/EmptyPlaceholder/styles.js.map +0 -1
  170. package/dist/components/FileInput/index.d.ts +0 -24
  171. package/dist/components/FileInput/index.js +0 -179
  172. package/dist/components/FileInput/index.js.map +0 -1
  173. package/dist/components/FileInput/styles.d.ts +0 -53
  174. package/dist/components/FileInput/styles.js +0 -19
  175. package/dist/components/FileInput/styles.js.map +0 -1
  176. package/dist/components/Grid/index.d.ts +0 -32
  177. package/dist/components/Grid/index.js +0 -80
  178. package/dist/components/Grid/index.js.map +0 -1
  179. package/dist/components/Grid/styles.d.ts +0 -54
  180. package/dist/components/Grid/styles.js +0 -19
  181. package/dist/components/Grid/styles.js.map +0 -1
  182. package/dist/components/Icon/index.d.ts +0 -14
  183. package/dist/components/Icon/index.js +0 -75
  184. package/dist/components/Icon/index.js.map +0 -1
  185. package/dist/components/Icon/styles.d.ts +0 -61
  186. package/dist/components/Icon/styles.js +0 -49
  187. package/dist/components/Icon/styles.js.map +0 -1
  188. package/dist/components/Image/index.d.ts +0 -25
  189. package/dist/components/Image/index.js +0 -130
  190. package/dist/components/Image/index.js.map +0 -1
  191. package/dist/components/Image/styles.d.ts +0 -55
  192. package/dist/components/Image/styles.js +0 -25
  193. package/dist/components/Image/styles.js.map +0 -1
  194. package/dist/components/ImageView/Spotlight.d.ts +0 -25
  195. package/dist/components/ImageView/Spotlight.js +0 -150
  196. package/dist/components/ImageView/Spotlight.js.map +0 -1
  197. package/dist/components/ImageView/component.d.ts +0 -5
  198. package/dist/components/ImageView/component.js +0 -50
  199. package/dist/components/ImageView/component.js.map +0 -1
  200. package/dist/components/ImageView/index.d.ts +0 -2
  201. package/dist/components/ImageView/index.js +0 -15
  202. package/dist/components/ImageView/index.js.map +0 -1
  203. package/dist/components/InputLabel/index.d.ts +0 -12
  204. package/dist/components/InputLabel/index.js +0 -58
  205. package/dist/components/InputLabel/index.js.map +0 -1
  206. package/dist/components/InputLabel/styles.d.ts +0 -4
  207. package/dist/components/InputLabel/styles.js +0 -26
  208. package/dist/components/InputLabel/styles.js.map +0 -1
  209. package/dist/components/List/PaginationIndicator.d.ts +0 -67
  210. package/dist/components/List/PaginationIndicator.js +0 -51
  211. package/dist/components/List/PaginationIndicator.js.map +0 -1
  212. package/dist/components/List/index.d.ts +0 -31
  213. package/dist/components/List/index.js +0 -77
  214. package/dist/components/List/index.js.map +0 -1
  215. package/dist/components/List/styles.d.ts +0 -54
  216. package/dist/components/List/styles.js +0 -28
  217. package/dist/components/List/styles.js.map +0 -1
  218. package/dist/components/LoadingOverlay/index.d.ts +0 -11
  219. package/dist/components/LoadingOverlay/index.js +0 -60
  220. package/dist/components/LoadingOverlay/index.js.map +0 -1
  221. package/dist/components/LoadingOverlay/styles.d.ts +0 -7
  222. package/dist/components/LoadingOverlay/styles.js +0 -34
  223. package/dist/components/LoadingOverlay/styles.js.map +0 -1
  224. package/dist/components/Modal/index.d.ts +0 -43
  225. package/dist/components/Modal/index.js +0 -147
  226. package/dist/components/Modal/index.js.map +0 -1
  227. package/dist/components/Modal/styles.d.ts +0 -58
  228. package/dist/components/Modal/styles.js +0 -74
  229. package/dist/components/Modal/styles.js.map +0 -1
  230. package/dist/components/MultiSelect/index.d.ts +0 -6
  231. package/dist/components/MultiSelect/index.js +0 -119
  232. package/dist/components/MultiSelect/index.js.map +0 -1
  233. package/dist/components/MultiSelect/styles.d.ts +0 -7
  234. package/dist/components/MultiSelect/styles.js +0 -84
  235. package/dist/components/MultiSelect/styles.js.map +0 -1
  236. package/dist/components/MultiSelect/types.d.ts +0 -43
  237. package/dist/components/MultiSelect/types.js +0 -3
  238. package/dist/components/MultiSelect/types.js.map +0 -1
  239. package/dist/components/Navigation/Navigation.d.ts +0 -3
  240. package/dist/components/Navigation/Navigation.js +0 -80
  241. package/dist/components/Navigation/Navigation.js.map +0 -1
  242. package/dist/components/Navigation/constants.d.ts +0 -5
  243. package/dist/components/Navigation/constants.js +0 -11
  244. package/dist/components/Navigation/constants.js.map +0 -1
  245. package/dist/components/Navigation/index.d.ts +0 -3
  246. package/dist/components/Navigation/index.js +0 -16
  247. package/dist/components/Navigation/index.js.map +0 -1
  248. package/dist/components/Navigation/types.d.ts +0 -26
  249. package/dist/components/Navigation/types.js +0 -8
  250. package/dist/components/Navigation/types.js.map +0 -1
  251. package/dist/components/Navigation/utils.d.ts +0 -3
  252. package/dist/components/Navigation/utils.js +0 -69
  253. package/dist/components/Navigation/utils.js.map +0 -1
  254. package/dist/components/Pager/index.d.ts +0 -26
  255. package/dist/components/Pager/index.js +0 -84
  256. package/dist/components/Pager/index.js.map +0 -1
  257. package/dist/components/Pager/styles.d.ts +0 -87
  258. package/dist/components/Pager/styles.js +0 -72
  259. package/dist/components/Pager/styles.js.map +0 -1
  260. package/dist/components/RadioInput/index.d.ts +0 -27
  261. package/dist/components/RadioInput/index.js +0 -72
  262. package/dist/components/RadioInput/index.js.map +0 -1
  263. package/dist/components/RadioInput/styles.d.ts +0 -58
  264. package/dist/components/RadioInput/styles.js +0 -50
  265. package/dist/components/RadioInput/styles.js.map +0 -1
  266. package/dist/components/Scroll/index.d.ts +0 -124
  267. package/dist/components/Scroll/index.js +0 -97
  268. package/dist/components/Scroll/index.js.map +0 -1
  269. package/dist/components/Scroll/styles.d.ts +0 -53
  270. package/dist/components/Scroll/styles.js +0 -26
  271. package/dist/components/Scroll/styles.js.map +0 -1
  272. package/dist/components/Sections/index.d.ts +0 -115
  273. package/dist/components/Sections/index.js +0 -76
  274. package/dist/components/Sections/index.js.map +0 -1
  275. package/dist/components/SegmentedControl/index.d.ts +0 -52
  276. package/dist/components/SegmentedControl/index.js +0 -131
  277. package/dist/components/SegmentedControl/index.js.map +0 -1
  278. package/dist/components/SegmentedControl/styles.d.ts +0 -60
  279. package/dist/components/SegmentedControl/styles.js +0 -43
  280. package/dist/components/SegmentedControl/styles.js.map +0 -1
  281. package/dist/components/Select/index.d.ts +0 -16
  282. package/dist/components/Select/index.js +0 -122
  283. package/dist/components/Select/index.js.map +0 -1
  284. package/dist/components/Select/styles.d.ts +0 -60
  285. package/dist/components/Select/styles.js +0 -83
  286. package/dist/components/Select/styles.js.map +0 -1
  287. package/dist/components/Select/types.d.ts +0 -43
  288. package/dist/components/Select/types.js +0 -3
  289. package/dist/components/Select/types.js.map +0 -1
  290. package/dist/components/Slider/Mark.d.ts +0 -3
  291. package/dist/components/Slider/Mark.js +0 -32
  292. package/dist/components/Slider/Mark.js.map +0 -1
  293. package/dist/components/Slider/Thumb.d.ts +0 -7
  294. package/dist/components/Slider/Thumb.js +0 -30
  295. package/dist/components/Slider/Thumb.js.map +0 -1
  296. package/dist/components/Slider/index.d.ts +0 -4
  297. package/dist/components/Slider/index.js +0 -99
  298. package/dist/components/Slider/index.js.map +0 -1
  299. package/dist/components/Slider/styles.d.ts +0 -54
  300. package/dist/components/Slider/styles.js +0 -61
  301. package/dist/components/Slider/styles.js.map +0 -1
  302. package/dist/components/Slider/types.d.ts +0 -26
  303. package/dist/components/Slider/types.js +0 -3
  304. package/dist/components/Slider/types.js.map +0 -1
  305. package/dist/components/Switch/index.d.ts +0 -14
  306. package/dist/components/Switch/index.js +0 -81
  307. package/dist/components/Switch/index.js.map +0 -1
  308. package/dist/components/Switch/styles.d.ts +0 -55
  309. package/dist/components/Switch/styles.js +0 -34
  310. package/dist/components/Switch/styles.js.map +0 -1
  311. package/dist/components/Text/index.d.ts +0 -25
  312. package/dist/components/Text/index.js +0 -121
  313. package/dist/components/Text/index.js.map +0 -1
  314. package/dist/components/Text/styles.d.ts +0 -70
  315. package/dist/components/Text/styles.js +0 -34
  316. package/dist/components/Text/styles.js.map +0 -1
  317. package/dist/components/TextInput/index.d.ts +0 -181
  318. package/dist/components/TextInput/index.js +0 -213
  319. package/dist/components/TextInput/index.js.map +0 -1
  320. package/dist/components/TextInput/styles.d.ts +0 -63
  321. package/dist/components/TextInput/styles.js +0 -65
  322. package/dist/components/TextInput/styles.js.map +0 -1
  323. package/dist/components/Touchable/index.d.ts +0 -22
  324. package/dist/components/Touchable/index.js +0 -165
  325. package/dist/components/Touchable/index.js.map +0 -1
  326. package/dist/components/Touchable/styles.d.ts +0 -58
  327. package/dist/components/Touchable/styles.js +0 -24
  328. package/dist/components/Touchable/styles.js.map +0 -1
  329. package/dist/components/View/index.d.ts +0 -25
  330. package/dist/components/View/index.js +0 -107
  331. package/dist/components/View/index.js.map +0 -1
  332. package/dist/components/View/styles.d.ts +0 -54
  333. package/dist/components/View/styles.js +0 -29
  334. package/dist/components/View/styles.js.map +0 -1
  335. package/dist/components/components.d.ts +0 -37
  336. package/dist/components/components.js +0 -50
  337. package/dist/components/components.js.map +0 -1
  338. package/dist/components/defaultStyles.d.ts +0 -1468
  339. package/dist/components/defaultStyles.js +0 -67
  340. package/dist/components/defaultStyles.js.map +0 -1
  341. package/dist/index.d.ts +0 -7
  342. package/dist/index.js +0 -39
  343. package/dist/index.js.map +0 -1
  344. package/dist/modules/documentPicker.d.ts +0 -3
  345. package/dist/modules/documentPicker.js +0 -12
  346. package/dist/modules/documentPicker.js.map +0 -1
  347. package/dist/modules/fastImage.d.ts +0 -1
  348. package/dist/modules/fastImage.js +0 -10
  349. package/dist/modules/fastImage.js.map +0 -1
  350. package/dist/modules/reactNavigation.d.ts +0 -5
  351. package/dist/modules/reactNavigation.js +0 -26
  352. package/dist/modules/reactNavigation.js.map +0 -1
  353. package/dist/modules/rnDeviceInfo.d.ts +0 -2
  354. package/dist/modules/rnDeviceInfo.js +0 -10
  355. package/dist/modules/rnDeviceInfo.js.map +0 -1
  356. package/dist/modules/textInputMask.d.ts +0 -10
  357. package/dist/modules/textInputMask.js +0 -19
  358. package/dist/modules/textInputMask.js.map +0 -1
  359. package/dist/modules/types/fileTypes.d.ts +0 -138
  360. package/dist/modules/types/fileTypes.js +0 -3
  361. package/dist/modules/types/fileTypes.js.map +0 -1
  362. package/dist/modules/types/textInputMask.d.ts +0 -7
  363. package/dist/modules/types/textInputMask.js +0 -3
  364. package/dist/modules/types/textInputMask.js.map +0 -1
  365. package/dist/types/index.d.ts +0 -1
  366. package/dist/types/index.js +0 -14
  367. package/dist/types/index.js.map +0 -1
  368. package/dist/types/utility.d.ts +0 -14
  369. package/dist/types/utility.js +0 -3
  370. package/dist/types/utility.js.map +0 -1
  371. package/dist/utils/KeyboardAware/context.d.ts +0 -13
  372. package/dist/utils/KeyboardAware/context.js +0 -63
  373. package/dist/utils/KeyboardAware/context.js.map +0 -1
  374. package/dist/utils/KeyboardAware/index.d.ts +0 -8
  375. package/dist/utils/KeyboardAware/index.js +0 -29
  376. package/dist/utils/KeyboardAware/index.js.map +0 -1
  377. package/dist/utils/KeyboardAware/keyboardHooks.d.ts +0 -26
  378. package/dist/utils/KeyboardAware/keyboardHooks.js +0 -87
  379. package/dist/utils/KeyboardAware/keyboardHooks.js.map +0 -1
  380. package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.d.ts +0 -3
  381. package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js +0 -9
  382. package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js.map +0 -1
  383. package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.d.ts +0 -67
  384. package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js +0 -439
  385. package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js.map +0 -1
  386. package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.d.ts +0 -7
  387. package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js +0 -4
  388. package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js.map +0 -1
  389. package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.d.ts +0 -3
  390. package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js +0 -10
  391. package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js.map +0 -1
  392. package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.d.ts +0 -3
  393. package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js +0 -10
  394. package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js.map +0 -1
  395. package/dist/utils/KeyboardAware/types.d.ts +0 -1
  396. package/dist/utils/KeyboardAware/types.js +0 -7
  397. package/dist/utils/KeyboardAware/types.js.map +0 -1
  398. package/dist/utils/ModalManager/components.d.ts +0 -20
  399. package/dist/utils/ModalManager/components.js +0 -114
  400. package/dist/utils/ModalManager/components.js.map +0 -1
  401. package/dist/utils/ModalManager/context.d.ts +0 -48
  402. package/dist/utils/ModalManager/context.js +0 -201
  403. package/dist/utils/ModalManager/context.js.map +0 -1
  404. package/dist/utils/ModalManager/index.d.ts +0 -11
  405. package/dist/utils/ModalManager/index.js +0 -13
  406. package/dist/utils/ModalManager/index.js.map +0 -1
  407. package/dist/utils/OSAlert.d.ts +0 -32
  408. package/dist/utils/OSAlert.js +0 -143
  409. package/dist/utils/OSAlert.js.map +0 -1
  410. package/dist/utils/PermissionManager/context.d.ts +0 -53
  411. package/dist/utils/PermissionManager/context.js +0 -320
  412. package/dist/utils/PermissionManager/context.js.map +0 -1
  413. package/dist/utils/PermissionManager/index.d.ts +0 -4
  414. package/dist/utils/PermissionManager/index.js +0 -9
  415. package/dist/utils/PermissionManager/index.js.map +0 -1
  416. package/dist/utils/PermissionManager/types.d.ts +0 -13
  417. package/dist/utils/PermissionManager/types.js +0 -3
  418. package/dist/utils/PermissionManager/types.js.map +0 -1
  419. package/dist/utils/hooks.d.ts +0 -61
  420. package/dist/utils/hooks.js +0 -233
  421. package/dist/utils/hooks.js.map +0 -1
  422. package/dist/utils/index.d.ts +0 -10
  423. package/dist/utils/index.js +0 -36
  424. package/dist/utils/index.js.map +0 -1
  425. package/dist/utils/input.d.ts +0 -35
  426. package/dist/utils/input.js +0 -49
  427. package/dist/utils/input.js.map +0 -1
  428. package/dist/utils/misc.d.ts +0 -6
  429. package/dist/utils/misc.js +0 -87
  430. package/dist/utils/misc.js.map +0 -1
  431. package/dist/utils/notifications.d.ts +0 -34
  432. package/dist/utils/notifications.js +0 -268
  433. package/dist/utils/notifications.js.map +0 -1
  434. package/dist/utils/theme.d.ts +0 -42
  435. package/dist/utils/theme.js +0 -50
  436. package/dist/utils/theme.js.map +0 -1
  437. package/src/components/Animated.tsx +0 -34
  438. package/src/components/AutoComplete/index.tsx +0 -167
  439. package/src/components/AutoComplete/styles.ts +0 -150
  440. package/src/components/MultiSelect/index.tsx +0 -148
  441. package/src/components/MultiSelect/styles.ts +0 -131
  442. package/src/components/MultiSelect/types.ts +0 -51
  443. package/src/components/Slider/Mark.tsx +0 -46
  444. package/src/components/Slider/Thumb.tsx +0 -29
  445. package/src/modules/textInputMask.ts +0 -11
  446. package/src/utils/KeyboardAware/lib/KeyboardAwareFlatList.ts +0 -4
  447. package/src/utils/KeyboardAware/lib/KeyboardAwareHOC.tsx +0 -592
  448. package/src/utils/KeyboardAware/lib/KeyboardAwareInterface.ts +0 -13
  449. package/src/utils/KeyboardAware/lib/KeyboardAwareScrollView.ts +0 -6
  450. package/src/utils/KeyboardAware/lib/KeyboardAwareSectionList.ts +0 -6
@@ -0,0 +1,27 @@
1
+ import { useState, useCallback } from 'react'
2
+
3
+ const initialState = {
4
+ message: '',
5
+ isValid: true,
6
+ }
7
+
8
+ export const useActionValidate = (validator: any) => {
9
+ const [error, setError] = useState(initialState)
10
+
11
+ const validate = useCallback((value: number) => {
12
+ if (!validator) return
13
+
14
+ const { valid, message } = validator(value, {})
15
+
16
+ setError({
17
+ isValid: valid,
18
+ message: message,
19
+ })
20
+ }, [validator])
21
+
22
+ return {
23
+ onAction: validate,
24
+ message: error?.message,
25
+ isValid: error?.isValid
26
+ }
27
+ }
@@ -1,14 +1,22 @@
1
1
  import {
2
2
  ComponentVariants,
3
+ onUpdate,
4
+ TypeGuards,
3
5
  useDefaultComponentStyle,
6
+ useWarning
4
7
  } from '@codeleap/common'
5
- import React, {
6
- ReactNode,
7
- } from 'react'
8
- import { StyleSheet } from 'react-native'
8
+ import React, { ReactNode, useCallback, useRef } from 'react'
9
+ import {
10
+ Dimensions,
11
+ NativeScrollEvent,
12
+ NativeSyntheticEvent,
13
+ ScrollView,
14
+ StyleSheet,
15
+ } from 'react-native'
9
16
  import { StylesOf } from '../../types/utility'
17
+ import { ScrollProps } from '../Scroll'
10
18
  import { View } from '../View'
11
- import { PagerStyles, PagerComposition } from './styles'
19
+ import { PagerPresets, PagerComposition } from './styles'
12
20
  export * from './styles'
13
21
 
14
22
  export type PageProps = {
@@ -19,34 +27,46 @@ export type PageProps = {
19
27
  page: number
20
28
  index: number
21
29
  isPrevious: boolean
30
+
22
31
  }
23
32
 
24
- export type PagerProps = {
25
- variants?: ComponentVariants<typeof PagerStyles>['variants']
33
+ export type PagerProps = React.PropsWithChildren<{
34
+ variants?: ComponentVariants<typeof PagerPresets>['variants']
26
35
  styles?: StylesOf<PagerComposition>
27
36
  children?: (((pageData: PageProps) => ReactNode) | ReactNode)[]
28
37
  page?: number
29
38
  style?: any
30
39
  setPage?: (page: number) => void
31
40
  returnEarly?: boolean
32
- renderPageWrapper?:React.FC<PageProps>
41
+ renderPageWrapper?: React.FC<PageProps>
33
42
  pageWrapperProps?: any
34
- }
43
+ width?: number
44
+ onScroll: ScrollProps['onScroll']
45
+ /** If TRUE render page, nextPage and prevPage only */
46
+ windowing?:boolean
47
+ }>
35
48
 
36
- export const Pager:React.FC<PagerProps> = (pagerProps) => {
49
+ export const Pager: React.FC<PagerProps> = (pagerProps) => {
37
50
  const {
38
-
39
51
  styles,
40
52
  variants,
53
+ width: widthProp,
41
54
  page,
42
55
  style = {},
43
56
  returnEarly = true,
44
57
  renderPageWrapper,
45
58
  pageWrapperProps = {},
46
59
  children,
60
+ windowing = false,
61
+ setPage,
47
62
  } = pagerProps
48
63
 
49
- let variantStyles = useDefaultComponentStyle<'u:Pager', typeof PagerStyles>(
64
+
65
+ const childArr = React.Children.toArray(children)
66
+ const scrollRef = useRef<ScrollView>(null)
67
+ const [positionX, setPositionX] = React.useState(0)
68
+
69
+ let variantStyles = useDefaultComponentStyle<'u:Pager', typeof PagerPresets>(
50
70
  'u:Pager',
51
71
  {
52
72
  styles,
@@ -54,69 +74,102 @@ export const Pager:React.FC<PagerProps> = (pagerProps) => {
54
74
  variants,
55
75
  },
56
76
  )
77
+
78
+
79
+ const windowWidth = Dimensions.get('window').width
80
+ let width = widthProp ?? variantStyles.wrapper.width
81
+
82
+ const validWidth = TypeGuards.isNumber(width)
83
+
84
+ if (!validWidth) {
85
+ width = windowWidth
86
+
87
+ }
88
+
89
+ useWarning(
90
+ !validWidth,
91
+ 'Pager',
92
+ 'provided width is not a number, using default width',
93
+ )
94
+
57
95
  const nChildren = React.Children.count(children)
58
96
 
59
97
  const lastPage = nChildren - 1
60
98
 
99
+ const WrapperComponent = renderPageWrapper || View
61
100
 
62
- const childArr = React.Children.toArray(children)
63
101
 
64
- const WrapperComponent = renderPageWrapper || View
102
+ const handleScrollEnd = useCallback(
103
+ ({ nativeEvent }: NativeSyntheticEvent<NativeScrollEvent>) => {
104
+ const x = nativeEvent.contentOffset.x
105
+ const toPage = Math.ceil(x / width)
106
+
107
+ if (toPage !== page && toPage <= childArr.length - 1) {
108
+ setPage(toPage)
109
+ setPositionX(toPage * width)
110
+ }
111
+ },
112
+ [childArr, page, setPage],
113
+ )
65
114
 
66
- // Reamimated seems to glitch if this is not done
67
- variantStyles = JSON.parse(JSON.stringify(variantStyles))
115
+ onUpdate(() => {
116
+ const x = width * page
117
+ if (scrollRef.current && x !== positionX) {
118
+ scrollRef.current.scrollTo({
119
+ x,
120
+ animated: true,
121
+ })
122
+ setPositionX(x)
123
+ }
124
+ }, [page])
68
125
 
69
126
  return (
70
- <View style={[variantStyles.wrapper, style]} >
71
- {
72
- childArr.map((child:PagerProps['children'][number], index) => {
73
- const isActive = index === page
74
- const isLast = index === lastPage
75
- const isFirst = index === 0
76
- const isNext = index === page + 1
77
- const isPrevious = index === page - 1
78
- const shouldRender = isActive || isNext || isPrevious
79
-
80
- if (!shouldRender && returnEarly) return null
81
- let pos = 0
82
-
83
- if (isActive) {
84
- pos = 1
85
- } else if (index > page) {
86
- pos = 2
87
- } else {
88
- pos = 0
89
- }
90
-
91
- const pageProps = {
92
- isLast,
93
- isActive,
94
- isFirst,
95
- isNext,
96
- isPrevious,
97
- index,
98
- page,
99
- }
100
-
101
- const content = typeof child === 'function' ? child(pageProps) : child
102
-
103
- const wrapperProps = {
104
- key: index,
105
- style: variantStyles.page,
106
- animated: true,
107
- transition: variantStyles['page:transition'],
108
- animate: [variantStyles['page:previous'], variantStyles['page:current'], variantStyles['page:next']][pos],
109
- ...pageWrapperProps,
110
- }
111
-
112
- return (
113
- <WrapperComponent {...wrapperProps}>
114
- {content}
115
- </WrapperComponent>
116
- )
117
-
118
- })
119
- }
120
- </View>
127
+ <ScrollView
128
+ {...pagerProps}
129
+ ref={scrollRef}
130
+ horizontal
131
+ pagingEnabled
132
+ onMomentumScrollEnd={handleScrollEnd}
133
+ scrollEventThrottle={300}
134
+ showsHorizontalScrollIndicator={false}
135
+ scrollEnabled={childArr.length > 1}
136
+ style={[variantStyles.wrapper, style]}
137
+ >
138
+ {childArr.map((child: PagerProps['children'][number], index) => {
139
+
140
+ const isActive = index === page
141
+ const isLast = index === lastPage
142
+ const isFirst = index === 0
143
+ const isNext = index === page + 1
144
+ const isPrevious = index === page - 1
145
+
146
+ const shouldRender = windowing ? (isActive || isNext || isPrevious) : true
147
+
148
+ if (!shouldRender && returnEarly) {
149
+ return <View style={{ height: '100%', width }} />
150
+ }
151
+
152
+
153
+ const pageProps:PageProps = {
154
+ isLast,
155
+ isActive,
156
+ isFirst,
157
+ isNext,
158
+ isPrevious,
159
+ index,
160
+ page,
161
+ }
162
+
163
+ const content = typeof child === 'function' ? child(pageProps) : child
164
+
165
+ const wrapperProps = {
166
+ key: index,
167
+ style: [{ height: '100%', width }, variantStyles.page],
168
+ ...pageWrapperProps,
169
+ }
170
+
171
+ return <WrapperComponent {...wrapperProps}>{content}</WrapperComponent>
172
+ })}
173
+ </ScrollView>
121
174
  )
122
175
  }
@@ -2,80 +2,13 @@ import {
2
2
  createDefaultVariantFactory,
3
3
  includePresets,
4
4
  } from '@codeleap/common'
5
- import { Easing } from 'react-native'
5
+
6
6
 
7
7
  export type PagerComposition =
8
8
  | 'page'
9
- | 'page:transition'
10
- | 'page:previous'
11
- | 'page:next'
12
- | 'page:current'
13
9
  | 'wrapper'
14
10
 
15
11
  const createPagerStyle = createDefaultVariantFactory<PagerComposition>()
16
12
 
17
- const presets = includePresets((style) => createPagerStyle(() => ({ wrapper: style })),
18
- )
19
- export const defaultPagerTransition = {
20
- type: 'timing',
21
- duration: 300,
22
- easing: Easing.linear,
23
- }
24
-
25
- export function pagerAnimation(height, width, translate = 'X', transition = defaultPagerTransition) {
26
- const translateProp = `translate${translate}`
27
-
28
- const translateVal = translate === 'X' ? width : height
29
-
30
- return {
31
- wrapper: {
32
- height,
33
- width,
34
- overflow: 'hidden',
35
- },
36
- 'page:transition': {
37
- [translateProp]: transition,
38
- },
39
- 'page:next': {
40
- [translateProp]: translateVal,
41
-
42
- },
43
- 'page:current': {
44
- [translateProp]: 0,
45
- },
46
- 'page:previous': {
47
- [translateProp]: -translateVal,
48
- },
49
- }
50
- }
51
-
52
- export const PagerStyles = {
53
- ...presets,
54
- default: createPagerStyle((theme) => {
55
- const width = theme.values.width
56
- const height = theme.values.window.height * 0.8
57
- return {
58
- ...pagerAnimation(height, width, 'X'),
59
- page: {
60
- width: '100%',
61
- height: '100%',
62
- position: 'absolute',
63
- left: 0,
64
- right: 0,
65
- bottom: 0,
66
- top: 0,
67
- },
68
- }
69
- }),
70
- horizontal: createPagerStyle((theme) => {
13
+ export const PagerPresets = includePresets((style) => createPagerStyle(() => ({ wrapper: style })))
71
14
 
72
- const width = theme.values.width
73
- const height = theme.values.window.height * 0.8
74
- return pagerAnimation(height, width, 'X')
75
- }),
76
- vertical: createPagerStyle((theme) => {
77
- const height = theme.values.window.height * 0.8
78
- const width = theme.values.width
79
- return pagerAnimation(height, width, 'Y')
80
- }),
81
- }
@@ -5,102 +5,179 @@ import { Text } from '../Text'
5
5
  import { Touchable } from '../Touchable'
6
6
  import {
7
7
  ComponentVariants,
8
+ FormTypes,
8
9
  getNestedStylesByKey,
9
10
  StylesOf,
11
+ TypeGuards,
10
12
  useDefaultComponentStyle,
11
13
  } from '@codeleap/common'
12
14
  import { View } from '../View'
13
- import { RadioInputComposition, RadioInputStyles } from './styles'
15
+ import { RadioInputComposition, RadioInputPresets } from './styles'
14
16
  import { InputLabel } from '../InputLabel'
15
-
17
+ import { StyleSheet } from 'react-native'
18
+ import { InputBase, InputBaseDefaultOrder, InputBaseProps, selectInputBaseProps } from '../InputBase'
16
19
  export * from './styles'
17
20
 
18
- type RadioItem<T extends unknown = any> = {
19
- value: T
20
- label: ReactNode
21
- }
21
+ type WrapperProps = InputBaseProps
22
22
 
23
- const getRadioStyle = (props) => useDefaultComponentStyle<'u:RadioInput', typeof RadioInputStyles>('u:RadioInput', props)
24
-
25
- export type RadioButtonProps = Omit<
26
- ComponentPropsWithoutRef<typeof Touchable>,
27
- 'style'
28
- > & {
29
- item: RadioItem
30
- select: () => void
31
- style: StylesOf<RadioInputComposition>
32
- checked: boolean
33
- defaultValue?: number
23
+ type RadioOption<T> = FormTypes.Options<T>[number] & {
24
+ disabled?: boolean
34
25
  }
35
-
36
- export type RadioGroupProps<T> = {
37
- options: RadioItem<T>[]
26
+ export type RadioGroupProps<T extends string|number> = WrapperProps & {
27
+ options: RadioOption<T>[]
38
28
  value: T
39
29
  onValueChange(value: T): void
40
- required?: boolean
41
30
  label: ReactNode
42
31
  styles?: StylesOf<RadioInputComposition>
43
- } & ComponentVariants<typeof RadioInputStyles>
44
-
45
- export const RadioButton: React.FC<RadioButtonProps> = ({
46
- item,
47
- select,
48
- style,
49
- checked,
50
- ...props
51
- }) => {
52
- return (
53
- <Touchable onPress={select} style={style.itemWrapper} debugName={'Change radioButton value'} styles={{
54
- feedback: style.buttonFeedback,
55
- }}>
56
- <View style={[style.button, checked && style['button:checked']]}>
57
- <View
58
- style={[style.buttonMark, checked && style['buttonMark:checked']]}
59
- />
60
- </View>
61
- {typeof item.label === 'string' ? (
62
- <Text text={item.label} style={style.text} />
32
+ variants?: ComponentVariants<typeof RadioInputPresets>['variants']
33
+ radioOnRight?: boolean
34
+ }
35
+
36
+ type OptionProps<T extends string|number> = {
37
+ item: RadioOption<T>
38
+ selected: boolean
39
+ onSelect(): void
40
+ styles?: StylesOf<RadioInputComposition>
41
+ debugName?: string
42
+ disabled?: boolean
43
+ separator?: boolean
44
+ reverseOrder?: boolean
45
+ }
46
+
47
+ const Option = <T extends string|number>(props: OptionProps<T>) => {
48
+ const {
49
+ debugName,
50
+ item,
51
+ disabled,
52
+ styles,
53
+ selected,
54
+ onSelect,
55
+ separator = false,
56
+ reverseOrder,
57
+ } = props
58
+
59
+ const isDisabled = disabled || item.disabled
60
+
61
+ const getStyle = (key) => {
62
+ if (isDisabled && selected) {
63
+ return styles[`${key}:selectedDisabled`]
64
+ }
65
+ if (isDisabled) {
66
+ return styles[`${key}:disabled`]
67
+ }
68
+ if (selected) {
69
+ return styles[`${key}:selected`]
70
+ }
71
+ return styles[key]
72
+ }
73
+
74
+ const label = TypeGuards.isString(item.label) ? <Text
75
+ style={[
76
+ styles.optionLabel,
77
+ getStyle('optionLabel'),
78
+ ]}
79
+ text={item.label}
80
+ /> : item.label
81
+
82
+ return <>
83
+ <Touchable
84
+ debugName={`${debugName} option ${item.value}`}
85
+ style={[
86
+ styles.optionWrapper,
87
+ getStyle('optionWrapper'),
88
+ ]}
89
+ rippleDisabled
90
+ onPress={onSelect}
91
+ disabled={isDisabled}
92
+ >
93
+
94
+ {reverseOrder ? (
95
+ <>
96
+ {label}
97
+ <View
98
+ style={[
99
+ styles.optionIndicator,
100
+ getStyle('optionIndicator'),
101
+ ]}
102
+ >
103
+ <View
104
+ style={[
105
+ styles.optionIndicatorInner,
106
+ getStyle('optionIndicatorInner'),
107
+ ]}
108
+ />
109
+ </View>
110
+ </>
63
111
  ) : (
64
- item.label
112
+ <>
113
+ <View
114
+ style={[
115
+ styles.optionIndicator,
116
+ getStyle('optionIndicator'),
117
+ ]}
118
+ >
119
+ <View
120
+ style={[
121
+ styles.optionIndicatorInner,
122
+ getStyle('optionIndicatorInner'),
123
+ ]}
124
+ />
125
+ </View>
126
+ {label}
127
+ </>
65
128
  )}
129
+
66
130
  </Touchable>
67
- )
131
+ {separator && <View style={styles.optionSeparator} />}
132
+ </>
68
133
  }
69
134
 
70
- export const RadioGroup = <T extends unknown>(
71
- radioGroupProps: RadioGroupProps<T>,
135
+ export const RadioGroup = <T extends string|number>(
136
+ props: RadioGroupProps<T>,
72
137
  ) => {
138
+ const {
139
+ inputBaseProps,
140
+ others,
141
+ } = selectInputBaseProps(props)
142
+
73
143
  const {
74
144
  options,
75
145
  value,
76
146
  onValueChange,
77
- label,
78
- responsiveVariants,
79
- required = false,
80
147
  variants,
81
148
  styles,
82
- } = radioGroupProps
149
+ disabled,
150
+ debugName,
151
+ radioOnRight,
152
+ } = others
83
153
 
84
- const radioStyle = getRadioStyle({
85
- responsiveVariants,
154
+ const variantStyles = useDefaultComponentStyle<'u:RadioInput', typeof RadioInputPresets>('u:RadioInput', {
86
155
  variants,
87
156
  styles,
157
+ transform: StyleSheet.flatten,
88
158
  })
89
- return (
90
- <View style={radioStyle.wrapper}>
91
- <InputLabel required={required} label={label} styles={getNestedStylesByKey('label', radioStyle)}/>
92
- <View style={radioStyle.list}>
93
- {options?.map((item, idx) => (
94
- <RadioButton
95
- debugName={'RadioButton'}
96
- item={item}
97
- key={idx}
98
- style={radioStyle}
99
- checked={value === item.value}
100
- select={() => onValueChange(item.value)}
101
- />
102
- ))}
103
- </View>
104
- </View>
105
- )
159
+
160
+ const _radioOnRight = radioOnRight ?? variantStyles.__props?.radioOnRight
161
+
162
+ return <InputBase
163
+ {...inputBaseProps}
164
+ disabled={disabled}
165
+ styles={variantStyles}
166
+ debugName={debugName}
167
+ >
168
+ {options?.map((item, idx) => (
169
+ <Option
170
+ debugName={debugName}
171
+ item={item}
172
+ key={idx}
173
+ disabled={disabled}
174
+ styles={variantStyles}
175
+ selected={value === item.value}
176
+ onSelect={() => onValueChange(item.value)}
177
+ separator={idx < options.length - 1}
178
+ reverseOrder={_radioOnRight}
179
+ />
180
+ ))}
181
+ </InputBase>
182
+
106
183
  }
@@ -1,67 +1,14 @@
1
- import {
2
- createDefaultVariantFactory, includePresets,
3
- } from '@codeleap/common'
4
- import { InputLabelComposition } from '../InputLabel'
5
- type RadioParts = 'button' | 'itemWrapper' | 'text' | 'buttonMark' | 'buttonFeedback'
1
+ import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
2
+ import { IconLessInputBaseParts } from '../InputBase'
6
3
 
7
- type RadioGroupParts = `label${Capitalize<InputLabelComposition>}` | 'wrapper' | 'list'
4
+ type OptionParts = 'wrapper' | 'label' | 'indicator' | 'indicatorInner' | 'separator'
5
+ type OptionStates = 'selected' | 'disabled' | 'selectedDisabled'
8
6
 
9
- export type RadioInputComposition =
10
- | `${RadioParts}:checked`
11
- | RadioParts
12
- | RadioGroupParts
7
+ type OptionComposition = `${OptionParts}:${OptionStates}` | OptionParts
8
+
9
+ export type RadioInputComposition = IconLessInputBaseParts | `${IconLessInputBaseParts}:disabled` | `option${Capitalize<OptionComposition>}` | '__props'
13
10
 
14
11
  const createRadioStyle =
15
12
  createDefaultVariantFactory<RadioInputComposition>()
16
13
 
17
- const presets = includePresets(style => createRadioStyle(() => ({ wrapper: style })))
18
-
19
- export const RadioInputStyles = {
20
- ...presets,
21
- default: createRadioStyle((theme) => {
22
-
23
- const itemHeight = theme.typography.baseFontSize * 1.2
24
- const markHeight = itemHeight / 2
25
- const translateX = -(markHeight / 2)
26
- const translateY = -(markHeight / 2)
27
- return {
28
- itemWrapper: {
29
- ...theme.presets.row,
30
- ...theme.spacing.marginVertical(1.3),
31
- },
32
- button: {
33
- height: itemHeight,
34
- width: itemHeight,
35
- ...theme.border.primary(1),
36
- borderRadius: theme.borderRadius.large,
37
-
38
- position: 'relative',
39
- ...theme.spacing.marginRight(1),
40
- },
41
- buttonFeedback: { type: 'opacity', value: 0.5 },
42
- buttonMark: {
43
- backgroundColor: theme.colors.primary,
44
- position: 'absolute',
45
- left: '50%',
46
- top: '50%',
47
- height: markHeight,
48
- width: markHeight,
49
-
50
- transform: [{ translateX }, { translateY }],
51
- borderRadius: theme.borderRadius.large,
52
- opacity: 0,
53
- },
54
- 'buttonMark:checked': {
55
- opacity: 1,
56
- },
57
- }
58
- }),
59
- square: createRadioStyle(() => ({
60
- buttonMark: {
61
- borderRadius: 0,
62
- },
63
- button: {
64
- borderRadius: 0,
65
- },
66
- })),
67
- }
14
+ export const RadioInputPresets = includePresets(style => createRadioStyle(() => ({ wrapper: style })))