@draftbit/core 46.4.4-c5d4b3.2 → 46.4.4-caab07.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 (372) hide show
  1. package/lib/commonjs/Provider.js.map +1 -1
  2. package/lib/commonjs/components/ActionSheet/ActionSheet.js.map +1 -1
  3. package/lib/commonjs/components/ActionSheet/ActionSheetCancel.js.map +1 -1
  4. package/lib/commonjs/components/ActionSheet/index.js.map +1 -1
  5. package/lib/commonjs/components/AvatarEdit.js +15 -4
  6. package/lib/commonjs/components/AvatarEdit.js.map +1 -1
  7. package/lib/commonjs/components/Banner.js +23 -4
  8. package/lib/commonjs/components/Banner.js.map +1 -1
  9. package/lib/commonjs/components/CardBlock.js +13 -4
  10. package/lib/commonjs/components/CardContainer.js +14 -4
  11. package/lib/commonjs/components/CardContainer.js.map +1 -1
  12. package/lib/commonjs/components/Carousel.js +2 -2
  13. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +22 -5
  14. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js.map +1 -1
  15. package/lib/commonjs/components/Checkbox/CheckboxRow.js.map +1 -1
  16. package/lib/commonjs/components/Checkbox/index.js.map +1 -1
  17. package/lib/commonjs/components/CircleImage.js +16 -2
  18. package/lib/commonjs/components/Config.js.map +1 -1
  19. package/lib/commonjs/components/DatePicker/DatePicker.js +43 -21
  20. package/lib/commonjs/components/DatePicker/DatePicker.js.map +1 -1
  21. package/lib/commonjs/components/DatePicker/DatePickerComponent.js.map +1 -1
  22. package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js.map +1 -1
  23. package/lib/commonjs/components/DeprecatedButton.js +19 -3
  24. package/lib/commonjs/components/DeprecatedButton.js.map +1 -1
  25. package/lib/commonjs/components/Divider.js +12 -1
  26. package/lib/commonjs/components/Divider.js.map +1 -1
  27. package/lib/commonjs/components/FAB.js +19 -4
  28. package/lib/commonjs/components/FAB.js.map +1 -1
  29. package/lib/commonjs/components/FieldSearchBarFull.js.map +1 -1
  30. package/lib/commonjs/components/FormRow.js +17 -3
  31. package/lib/commonjs/components/FormRow.js.map +1 -1
  32. package/lib/commonjs/components/Header.js.map +1 -1
  33. package/lib/commonjs/components/HeaderLarge.js.map +1 -1
  34. package/lib/commonjs/components/Image.js +16 -2
  35. package/lib/commonjs/components/Picker/Picker.js +7 -7
  36. package/lib/commonjs/components/Picker/Picker.js.map +1 -1
  37. package/lib/commonjs/components/Picker/PickerComponent.android.js +19 -5
  38. package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -1
  39. package/lib/commonjs/components/Picker/PickerComponent.ios.js +30 -11
  40. package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -1
  41. package/lib/commonjs/components/Portal/PortalHost.js +45 -15
  42. package/lib/commonjs/components/Portal/PortalHost.js.map +1 -1
  43. package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
  44. package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +10 -1
  45. package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js.map +1 -1
  46. package/lib/commonjs/components/ResizeMode.js +2 -1
  47. package/lib/commonjs/components/RowBodyIcon.js.map +1 -1
  48. package/lib/commonjs/components/RowHeadlineImageCaption.js.map +1 -1
  49. package/lib/commonjs/components/ScreenContainer.js +20 -4
  50. package/lib/commonjs/components/ScreenContainer.js.map +1 -1
  51. package/lib/commonjs/components/Stepper.js +1 -0
  52. package/lib/commonjs/components/Stepper.js.map +1 -1
  53. package/lib/commonjs/components/Surface.js +13 -2
  54. package/lib/commonjs/components/Swiper/index.js.map +1 -1
  55. package/lib/commonjs/components/Text.js +50 -4
  56. package/lib/commonjs/components/TextField.js +76 -28
  57. package/lib/commonjs/components/ToggleButton.js +14 -2
  58. package/lib/commonjs/components/ToggleButton.js.map +1 -1
  59. package/lib/commonjs/components/Typography.js.map +1 -1
  60. package/lib/commonjs/index.js.map +1 -1
  61. package/lib/commonjs/interfaces/Icon.js.map +1 -1
  62. package/lib/commonjs/mappings/AccordionItem.js.map +1 -1
  63. package/lib/commonjs/mappings/ActionSheet.js.map +1 -1
  64. package/lib/commonjs/mappings/ActionSheetItem.js.map +1 -1
  65. package/lib/commonjs/mappings/AudioPlayer.js.map +1 -1
  66. package/lib/commonjs/mappings/AvatarEdit.js.map +1 -1
  67. package/lib/commonjs/mappings/BlurView.js.map +1 -1
  68. package/lib/commonjs/mappings/Card.js.map +1 -1
  69. package/lib/commonjs/mappings/CardInline.js.map +1 -1
  70. package/lib/commonjs/mappings/Carousel.js.map +1 -1
  71. package/lib/commonjs/mappings/CheckboxRow.js.map +1 -1
  72. package/lib/commonjs/mappings/DatePicker.js +13 -0
  73. package/lib/commonjs/mappings/DatePicker.js.map +1 -1
  74. package/lib/commonjs/mappings/Fetch.js.map +1 -1
  75. package/lib/commonjs/mappings/FieldSearchBarFull.js +1 -1
  76. package/lib/commonjs/mappings/FieldSearchBarFull.js.map +1 -1
  77. package/lib/commonjs/mappings/HeaderLarge.js.map +1 -1
  78. package/lib/commonjs/mappings/HeaderMedium.js.map +1 -1
  79. package/lib/commonjs/mappings/ProgressCircle.js.map +1 -1
  80. package/lib/commonjs/mappings/ProgressIndicator.js.map +1 -1
  81. package/lib/commonjs/mappings/RadioButton.js.map +1 -1
  82. package/lib/commonjs/mappings/RadioButtonGroup.js.map +1 -1
  83. package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
  84. package/lib/commonjs/mappings/RowHeadlineImageCaption.js.map +1 -1
  85. package/lib/commonjs/mappings/Stepper.js.map +1 -1
  86. package/lib/commonjs/mappings/Surface.js.map +1 -1
  87. package/lib/commonjs/mappings/Swiper.js.map +1 -1
  88. package/lib/commonjs/mappings/SwiperItem.js.map +1 -1
  89. package/lib/commonjs/mappings/Switch.js.map +1 -1
  90. package/lib/commonjs/mappings/TextArea.js.map +1 -1
  91. package/lib/commonjs/mappings/TextField.js.map +1 -1
  92. package/lib/commonjs/mappings/View.js.map +1 -1
  93. package/lib/commonjs/utilities.js +1 -2
  94. package/lib/commonjs/utilities.js.map +1 -1
  95. package/lib/module/components/Accordion/index.js.map +1 -1
  96. package/lib/module/components/ActionSheet/ActionSheet.js.map +1 -1
  97. package/lib/module/components/ActionSheet/ActionSheetItem.js.map +1 -1
  98. package/lib/module/components/Banner.js.map +1 -1
  99. package/lib/module/components/Button.js.map +1 -1
  100. package/lib/module/components/Card.js.map +1 -1
  101. package/lib/module/components/CardBlock.js +14 -4
  102. package/lib/module/components/CardBlock.js.map +1 -1
  103. package/lib/module/components/CardContainerShortImage.js +16 -4
  104. package/lib/module/components/CardContainerShortImage.js.map +1 -1
  105. package/lib/module/components/Carousel.js +27 -9
  106. package/lib/module/components/Carousel.js.map +1 -1
  107. package/lib/module/components/Checkbox/CheckboxGroup.js +17 -2
  108. package/lib/module/components/Checkbox/CheckboxGroup.js.map +1 -1
  109. package/lib/module/components/Checkbox/index.js.map +1 -1
  110. package/lib/module/components/Container.js +16 -4
  111. package/lib/module/components/Container.js.map +1 -1
  112. package/lib/module/components/DatePicker/DatePicker.js +44 -21
  113. package/lib/module/components/DatePicker/DatePicker.js.map +1 -1
  114. package/lib/module/components/DatePicker/DatePickerComponent.js.map +1 -1
  115. package/lib/module/components/DatePicker/DatePickerComponentType.js.map +1 -1
  116. package/lib/module/components/DeprecatedFAB.js +21 -3
  117. package/lib/module/components/Elevation.js +15 -2
  118. package/lib/module/components/Elevation.js.map +1 -1
  119. package/lib/module/components/HeaderLarge.js.map +1 -1
  120. package/lib/module/components/HeaderMedium.js.map +1 -1
  121. package/lib/module/components/Justification.js +2 -2
  122. package/lib/module/components/Layout.js +41 -21
  123. package/lib/module/components/Layout.js.map +1 -1
  124. package/lib/module/components/NumberInput.js.map +1 -1
  125. package/lib/module/components/Picker/Picker.js +2 -2
  126. package/lib/module/components/Picker/Picker.js.map +1 -1
  127. package/lib/module/components/Picker/PickerComponent.android.js +19 -4
  128. package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
  129. package/lib/module/components/Picker/PickerComponent.ios.js +32 -11
  130. package/lib/module/components/Picker/PickerComponent.web.js +20 -4
  131. package/lib/module/components/Picker/PickerTypes.js.map +1 -1
  132. package/lib/module/components/Portal/PortalHost.js +45 -15
  133. package/lib/module/components/Portal/PortalHost.js.map +1 -1
  134. package/lib/module/components/Portal/PortalManager.js +34 -7
  135. package/lib/module/components/ProgressBar.js +38 -7
  136. package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +10 -1
  137. package/lib/module/components/RadioButton/RadioButtonFieldGroup.js.map +1 -1
  138. package/lib/module/components/RadioButton/RadioButtonRow.js +23 -6
  139. package/lib/module/components/RadioButton/RadioButtonRow.js.map +1 -1
  140. package/lib/module/components/Row.js.map +1 -1
  141. package/lib/module/components/RowBodyIcon.js.map +1 -1
  142. package/lib/module/components/SVG.js.map +1 -1
  143. package/lib/module/components/ScreenContainer.js +20 -4
  144. package/lib/module/components/ScreenContainer.js.map +1 -1
  145. package/lib/module/components/Stepper.js +2 -2
  146. package/lib/module/components/Stepper.js.map +1 -1
  147. package/lib/module/components/Surface.js +15 -1
  148. package/lib/module/components/Swiper/Swiper.js.map +1 -1
  149. package/lib/module/components/Swiper/SwiperItem.js.map +1 -1
  150. package/lib/module/components/Switch.js +20 -10
  151. package/lib/module/components/Switch.js.map +1 -1
  152. package/lib/module/components/Text.js +50 -4
  153. package/lib/module/components/TextField.js +78 -28
  154. package/lib/module/components/TextField.js.map +1 -1
  155. package/lib/module/components/ToggleButton.js +16 -2
  156. package/lib/module/components/ToggleButton.js.map +1 -1
  157. package/lib/module/constants.js +1 -1
  158. package/lib/module/hooks.js +1 -3
  159. package/lib/module/mappings/Accordion.js.map +1 -1
  160. package/lib/module/mappings/AccordionItem.js.map +1 -1
  161. package/lib/module/mappings/ActionSheetCancel.js.map +1 -1
  162. package/lib/module/mappings/AudioPlayer.js.map +1 -1
  163. package/lib/module/mappings/Banner.js.map +1 -1
  164. package/lib/module/mappings/Button.js.map +1 -1
  165. package/lib/module/mappings/Card.js.map +1 -1
  166. package/lib/module/mappings/CardContainer.js.map +1 -1
  167. package/lib/module/mappings/CardInline.js.map +1 -1
  168. package/lib/module/mappings/Carousel.js.map +1 -1
  169. package/lib/module/mappings/CustomCode.js.map +1 -1
  170. package/lib/module/mappings/DatePicker.js +14 -1
  171. package/lib/module/mappings/DatePicker.js.map +1 -1
  172. package/lib/module/mappings/Divider.js.map +1 -1
  173. package/lib/module/mappings/FAB.js.map +1 -1
  174. package/lib/module/mappings/KeyboardAwareScrollView.js.map +1 -1
  175. package/lib/module/mappings/MapCallout.js.map +1 -1
  176. package/lib/module/mappings/MapMarker.js.map +1 -1
  177. package/lib/module/mappings/Modal.js.map +1 -1
  178. package/lib/module/mappings/RadioButton.js.map +1 -1
  179. package/lib/module/mappings/RowHeadlineImageIcon.js.map +1 -1
  180. package/lib/module/mappings/SVG.js.map +1 -1
  181. package/lib/module/mappings/SafeAreaView.js.map +1 -1
  182. package/lib/module/mappings/ScrollView.js.map +1 -1
  183. package/lib/module/mappings/SwiperItem.js.map +1 -1
  184. package/lib/module/mappings/Text.js.map +1 -1
  185. package/lib/module/mappings/TextArea.js.map +1 -1
  186. package/lib/module/mappings/Video.js.map +1 -1
  187. package/lib/module/styles/DarkTheme.js.map +1 -1
  188. package/lib/module/styles/DefaultTheme.js.map +1 -1
  189. package/lib/module/styles/fonts.js.map +1 -1
  190. package/lib/module/theming.js.map +1 -1
  191. package/lib/module/utilities.js +1 -2
  192. package/lib/module/utilities.js.map +1 -1
  193. package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +4 -0
  194. package/lib/typescript/src/components/DatePicker/DatePicker.d.ts.map +1 -1
  195. package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
  196. package/lib/typescript/src/mappings/DatePicker.d.ts +42 -0
  197. package/lib/typescript/src/mappings/DatePicker.d.ts.map +1 -1
  198. package/package.json +3 -3
  199. package/src/Provider.js +11 -4
  200. package/src/components/Accordion/AccordionGroup.js +80 -36
  201. package/src/components/Accordion/AccordionItem.js +51 -24
  202. package/src/components/ActionSheet/ActionSheet.js +60 -35
  203. package/src/components/ActionSheet/ActionSheetCancel.js +7 -2
  204. package/src/components/ActionSheet/ActionSheetItem.js +35 -24
  205. package/src/components/AnimatedCircularProgress.js +57 -38
  206. package/src/components/AspectRatio.js +21 -13
  207. package/src/components/AvatarEdit.js +46 -23
  208. package/src/components/Banner.js +151 -99
  209. package/src/components/Button.js +152 -97
  210. package/src/components/Card.js +126 -45
  211. package/src/components/CardBlock.js +109 -46
  212. package/src/components/CardContainer.js +140 -58
  213. package/src/components/CardContainerRating.js +152 -67
  214. package/src/components/CardContainerShortImage.js +80 -25
  215. package/src/components/CardInline.js +64 -25
  216. package/src/components/Carousel.js +99 -58
  217. package/src/components/Carousel.tsx +2 -2
  218. package/src/components/Checkbox/Checkbox.js +93 -55
  219. package/src/components/Checkbox/CheckboxGroup.js +28 -15
  220. package/src/components/Checkbox/CheckboxGroupRow.js +104 -59
  221. package/src/components/Checkbox/CheckboxRow.js +107 -61
  222. package/src/components/Checkbox/context.js +6 -6
  223. package/src/components/CircleImage.js +14 -4
  224. package/src/components/CircularProgress.js +146 -75
  225. package/src/components/Config.js +59 -52
  226. package/src/components/Container.js +80 -38
  227. package/src/components/DatePicker/DatePicker.js +480 -337
  228. package/src/components/DatePicker/DatePicker.tsx +23 -7
  229. package/src/components/DatePicker/DatePickerComponent.js +21 -7
  230. package/src/components/DatePicker/DatePickerComponent.web.js +48 -22
  231. package/src/components/DeprecatedButton.js +136 -82
  232. package/src/components/DeprecatedCardWrapper.js +19 -10
  233. package/src/components/DeprecatedFAB.js +146 -101
  234. package/src/components/Divider.js +10 -7
  235. package/src/components/Elevation.js +24 -13
  236. package/src/components/FAB.js +84 -38
  237. package/src/components/FieldSearchBarFull.js +83 -46
  238. package/src/components/FormRow.js +28 -12
  239. package/src/components/Header.js +79 -35
  240. package/src/components/HeaderLarge.js +19 -2
  241. package/src/components/HeaderMedium.js +19 -2
  242. package/src/components/HeaderOverline.js +20 -2
  243. package/src/components/IconButton.js +68 -29
  244. package/src/components/Image.js +52 -38
  245. package/src/components/Layout.js +99 -38
  246. package/src/components/NumberInput.js +46 -42
  247. package/src/components/Picker/Picker.js +411 -238
  248. package/src/components/Picker/Picker.tsx +2 -2
  249. package/src/components/Picker/PickerComponent.android.js +110 -57
  250. package/src/components/Picker/PickerComponent.ios.js +131 -63
  251. package/src/components/Picker/PickerComponent.web.js +111 -58
  252. package/src/components/Portal/Portal.js +10 -5
  253. package/src/components/Portal/PortalConsumer.js +25 -23
  254. package/src/components/Portal/PortalHost.js +83 -72
  255. package/src/components/Portal/PortalManager.js +38 -25
  256. package/src/components/ProgressBar.js +139 -111
  257. package/src/components/ProgressCircle.js +40 -7
  258. package/src/components/ProgressIndicator.js +43 -22
  259. package/src/components/RadioButton/RadioButton.js +37 -10
  260. package/src/components/RadioButton/RadioButtonFieldGroup.js +26 -10
  261. package/src/components/RadioButton/RadioButtonGroup.js +53 -35
  262. package/src/components/RadioButton/RadioButtonRow.js +105 -58
  263. package/src/components/RadioButton/context.js +6 -6
  264. package/src/components/Row.js +81 -41
  265. package/src/components/RowBodyIcon.js +24 -2
  266. package/src/components/RowHeadlineImageCaption.js +30 -6
  267. package/src/components/RowHeadlineImageIcon.js +34 -8
  268. package/src/components/SVG.js +27 -7
  269. package/src/components/ScreenContainer.js +56 -27
  270. package/src/components/Slider.js +95 -49
  271. package/src/components/StarRating.js +85 -44
  272. package/src/components/StepIndicator.js +416 -328
  273. package/src/components/Stepper.js +74 -32
  274. package/src/components/Stepper.tsx +1 -1
  275. package/src/components/Surface.js +40 -25
  276. package/src/components/Swiper/Swiper.js +49 -18
  277. package/src/components/Swiper/SwiperItem.js +5 -4
  278. package/src/components/Switch.js +102 -46
  279. package/src/components/Text.js +37 -23
  280. package/src/components/TextField.js +515 -398
  281. package/src/components/ToggleButton.js +56 -31
  282. package/src/components/Touchable.js +25 -9
  283. package/src/components/Typography.js +45 -27
  284. package/src/components/useAuthState.js +27 -27
  285. package/src/constants.js +7 -5
  286. package/src/hooks.js +9 -9
  287. package/src/index.js +19 -3
  288. package/src/interfaces/Icon.js +2 -1
  289. package/src/mappings/Accordion.js +47 -39
  290. package/src/mappings/AccordionItem.js +19 -14
  291. package/src/mappings/ActionSheet.js +10 -10
  292. package/src/mappings/ActionSheetCancel.js +24 -17
  293. package/src/mappings/ActionSheetItem.js +28 -21
  294. package/src/mappings/ActivityIndicator.js +64 -55
  295. package/src/mappings/AudioPlayer.js +23 -17
  296. package/src/mappings/AvatarEdit.js +40 -34
  297. package/src/mappings/Banner.js +37 -30
  298. package/src/mappings/BlurView.js +46 -38
  299. package/src/mappings/Button.js +86 -77
  300. package/src/mappings/Card.js +61 -50
  301. package/src/mappings/CardBlock.js +125 -114
  302. package/src/mappings/CardContainer.js +108 -98
  303. package/src/mappings/CardContainerRating.js +126 -117
  304. package/src/mappings/CardContainerShortImage.js +125 -116
  305. package/src/mappings/CardInline.js +57 -49
  306. package/src/mappings/Carousel.js +21 -16
  307. package/src/mappings/Checkbox.js +54 -44
  308. package/src/mappings/CheckboxGroup.js +34 -24
  309. package/src/mappings/CheckboxRow.js +71 -59
  310. package/src/mappings/CircleImage.js +29 -22
  311. package/src/mappings/Container.js +37 -27
  312. package/src/mappings/CustomCode.js +5 -5
  313. package/src/mappings/DatePicker.js +181 -149
  314. package/src/mappings/DatePicker.ts +23 -0
  315. package/src/mappings/Divider.js +30 -24
  316. package/src/mappings/FAB.js +45 -35
  317. package/src/mappings/Fetch.js +10 -9
  318. package/src/mappings/FieldSearchBarFull.js +55 -47
  319. package/src/mappings/FlashList.js +38 -31
  320. package/src/mappings/FlatList.js +27 -22
  321. package/src/mappings/HeaderLarge.js +34 -26
  322. package/src/mappings/HeaderMedium.js +59 -52
  323. package/src/mappings/HeaderOverline.js +59 -52
  324. package/src/mappings/Icon.js +36 -29
  325. package/src/mappings/IconButton.js +43 -33
  326. package/src/mappings/Image.js +40 -32
  327. package/src/mappings/ImageBackground.js +38 -27
  328. package/src/mappings/KeyboardAvoidingView.js +46 -38
  329. package/src/mappings/KeyboardAwareScrollView.js +60 -48
  330. package/src/mappings/Layout.js +198 -192
  331. package/src/mappings/LinearGradient.js +79 -74
  332. package/src/mappings/MapCallout.js +27 -19
  333. package/src/mappings/MapMarker.js +53 -45
  334. package/src/mappings/MapView.js +146 -135
  335. package/src/mappings/Modal.js +47 -39
  336. package/src/mappings/NumberInput.js +247 -229
  337. package/src/mappings/Picker.js +153 -140
  338. package/src/mappings/ProgressBar.js +106 -98
  339. package/src/mappings/ProgressCircle.js +112 -105
  340. package/src/mappings/ProgressIndicator.js +186 -178
  341. package/src/mappings/RadioButton.js +59 -49
  342. package/src/mappings/RadioButtonGroup.js +21 -15
  343. package/src/mappings/RadioButtonRow.js +48 -40
  344. package/src/mappings/RowBodyIcon.js +77 -71
  345. package/src/mappings/RowHeadlineImageCaption.js +171 -161
  346. package/src/mappings/RowHeadlineImageIcon.js +98 -84
  347. package/src/mappings/SVG.js +22 -18
  348. package/src/mappings/SafeAreaView.js +35 -30
  349. package/src/mappings/ScrollView.js +36 -29
  350. package/src/mappings/Slider.js +67 -58
  351. package/src/mappings/StarRating.js +49 -41
  352. package/src/mappings/Stepper.js +34 -26
  353. package/src/mappings/Surface.js +16 -12
  354. package/src/mappings/Swiper.js +65 -58
  355. package/src/mappings/SwiperItem.js +5 -5
  356. package/src/mappings/Switch.js +87 -76
  357. package/src/mappings/Text.js +265 -242
  358. package/src/mappings/TextArea.js +273 -259
  359. package/src/mappings/TextField.js +379 -358
  360. package/src/mappings/TextInput.js +388 -362
  361. package/src/mappings/ToggleButton.js +60 -48
  362. package/src/mappings/Touchable.js +20 -15
  363. package/src/mappings/Video.js +92 -79
  364. package/src/mappings/View.js +225 -204
  365. package/src/mappings/WebView.js +104 -86
  366. package/src/styles/DarkTheme.js +17 -17
  367. package/src/styles/DefaultTheme.js +103 -103
  368. package/src/styles/fonts.js +55 -55
  369. package/src/styles/overlay.js +50 -49
  370. package/src/styles/shadow.js +43 -44
  371. package/src/theming.js +2 -1
  372. package/src/utilities.js +97 -76
@@ -1,63 +1,101 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, } from "react-native";
2
+ import { View, StyleSheet } from "react-native";
3
3
  import { useTheme } from "../../theming";
4
4
  import Touchable from "../Touchable";
5
5
  import { usePrevious } from "../../hooks";
6
- 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
- const [internalValue, setInternalValue] = React.useState(status || defaultValue || false);
8
- React.useEffect(() => {
9
- if (status != null) {
10
- setInternalValue(status);
11
- }
12
- }, [status]);
13
- // This special logic is to handle weird APIs like Airtable that return
14
- // true or undefined for a boolean
15
- const previousDefaultValue = usePrevious(defaultValue);
16
- React.useEffect(() => {
17
- if (defaultValue !== previousDefaultValue) {
18
- setInternalValue(Boolean(defaultValue));
19
- }
20
- }, [defaultValue, previousDefaultValue]);
21
- const { colors } = useTheme();
22
- const checkboxColor = internalValue
23
- ? color || colors.primary
24
- : uncheckedColor || colors.primary;
25
- const handlePress = () => {
26
- const newValue = !internalValue;
27
- setInternalValue(newValue);
28
- onPress === null || onPress === void 0 ? void 0 : onPress(newValue);
29
- if (newValue) {
30
- onCheck === null || onCheck === void 0 ? void 0 : onCheck();
31
- }
32
- if (!newValue) {
33
- onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
34
- }
35
- };
36
- return (React.createElement(Touchable, { ...rest, onPress: handlePress, disabled: disabled, accessibilityState: { disabled }, accessibilityRole: "button", accessibilityLiveRegion: "polite", style: [styles.container, style, { width: size, height: size }] },
37
- React.createElement(Icon, { style: styles.icon, name: internalValue ? checkedIcon : uncheckedIcon, size: size, color: checkboxColor }),
38
- React.createElement(View, { style: [StyleSheet.absoluteFill, styles.fillContainer] },
39
- React.createElement(View, { style: [
40
- styles.fill,
41
- { opacity: disabled ? 0.5 : 1 },
42
- { borderColor: checkboxColor },
43
- ] }))));
6
+ const Checkbox = ({
7
+ Icon,
8
+ status,
9
+ disabled = false,
10
+ onPress,
11
+ onCheck,
12
+ onUncheck,
13
+ color,
14
+ uncheckedColor,
15
+ defaultValue,
16
+ checkedIcon = "MaterialCommunityIcons/checkbox-marked",
17
+ uncheckedIcon = "MaterialCommunityIcons/checkbox-blank-outline",
18
+ size = 24,
19
+ style,
20
+ ...rest
21
+ }) => {
22
+ const [internalValue, setInternalValue] = React.useState(
23
+ status || defaultValue || false
24
+ );
25
+ React.useEffect(() => {
26
+ if (status != null) {
27
+ setInternalValue(status);
28
+ }
29
+ }, [status]);
30
+ // This special logic is to handle weird APIs like Airtable that return
31
+ // true or undefined for a boolean
32
+ const previousDefaultValue = usePrevious(defaultValue);
33
+ React.useEffect(() => {
34
+ if (defaultValue !== previousDefaultValue) {
35
+ setInternalValue(Boolean(defaultValue));
36
+ }
37
+ }, [defaultValue, previousDefaultValue]);
38
+ const { colors } = useTheme();
39
+ const checkboxColor = internalValue
40
+ ? color || colors.primary
41
+ : uncheckedColor || colors.primary;
42
+ const handlePress = () => {
43
+ const newValue = !internalValue;
44
+ setInternalValue(newValue);
45
+ onPress === null || onPress === void 0 ? void 0 : onPress(newValue);
46
+ if (newValue) {
47
+ onCheck === null || onCheck === void 0 ? void 0 : onCheck();
48
+ }
49
+ if (!newValue) {
50
+ onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
51
+ }
52
+ };
53
+ return React.createElement(
54
+ Touchable,
55
+ {
56
+ ...rest,
57
+ onPress: handlePress,
58
+ disabled: disabled,
59
+ accessibilityState: { disabled },
60
+ accessibilityRole: "button",
61
+ accessibilityLiveRegion: "polite",
62
+ style: [styles.container, style, { width: size, height: size }],
63
+ },
64
+ React.createElement(Icon, {
65
+ style: styles.icon,
66
+ name: internalValue ? checkedIcon : uncheckedIcon,
67
+ size: size,
68
+ color: checkboxColor,
69
+ }),
70
+ React.createElement(
71
+ View,
72
+ { style: [StyleSheet.absoluteFill, styles.fillContainer] },
73
+ React.createElement(View, {
74
+ style: [
75
+ styles.fill,
76
+ { opacity: disabled ? 0.5 : 1 },
77
+ { borderColor: checkboxColor },
78
+ ],
79
+ })
80
+ )
81
+ );
44
82
  };
45
83
  const styles = StyleSheet.create({
46
- container: {
47
- borderRadius: 18,
48
- },
49
- fillContainer: {
50
- alignItems: "center",
51
- justifyContent: "center",
52
- },
53
- icon: {
54
- alignSelf: "center",
55
- },
56
- fill: {
57
- borderRadius: 5,
58
- width: 30,
59
- height: 30,
60
- alignSelf: "center",
61
- },
84
+ container: {
85
+ borderRadius: 18,
86
+ },
87
+ fillContainer: {
88
+ alignItems: "center",
89
+ justifyContent: "center",
90
+ },
91
+ icon: {
92
+ alignSelf: "center",
93
+ },
94
+ fill: {
95
+ borderRadius: 5,
96
+ width: 30,
97
+ height: 30,
98
+ alignSelf: "center",
99
+ },
62
100
  });
63
101
  export default Checkbox;
@@ -2,20 +2,33 @@ import * as React from "react";
2
2
  import { View } from "react-native";
3
3
  import { checkboxGroupContext, Direction } from "./context";
4
4
  const { Provider } = checkboxGroupContext;
5
- const CheckboxGroup = ({ direction = Direction.Vertical, values, onValueChange = () => { }, style, children, ...rest }) => {
6
- const _containerStyle = [
7
- {
8
- flexDirection: direction === Direction.Horizontal ? "row" : "column",
9
- overflow: "hidden",
10
- },
11
- ];
12
- if (direction !== Direction.Vertical) {
13
- _containerStyle.push({
14
- alignItems: "center",
15
- });
16
- }
17
- return (React.createElement(View, { style: [{ minHeight: 40 }, style], ...rest },
18
- React.createElement(Provider, { value: { values, onValueChange, direction } },
19
- React.createElement(View, { style: _containerStyle }, children))));
5
+ const CheckboxGroup = ({
6
+ direction = Direction.Vertical,
7
+ values,
8
+ onValueChange = () => {},
9
+ style,
10
+ children,
11
+ ...rest
12
+ }) => {
13
+ const _containerStyle = [
14
+ {
15
+ flexDirection: direction === Direction.Horizontal ? "row" : "column",
16
+ overflow: "hidden",
17
+ },
18
+ ];
19
+ if (direction !== Direction.Vertical) {
20
+ _containerStyle.push({
21
+ alignItems: "center",
22
+ });
23
+ }
24
+ return React.createElement(
25
+ View,
26
+ { style: [{ minHeight: 40 }, style], ...rest },
27
+ React.createElement(
28
+ Provider,
29
+ { value: { values, onValueChange, direction } },
30
+ React.createElement(View, { style: _containerStyle }, children)
31
+ )
32
+ );
20
33
  };
21
34
  export default CheckboxGroup;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { StyleSheet, View, Platform, } from "react-native";
2
+ import { StyleSheet, View, Platform } from "react-native";
3
3
  import Checkbox from "./Checkbox";
4
4
  import Text from "../Text";
5
5
  import { useCheckboxGroupContext } from "./context";
@@ -8,70 +8,115 @@ import Touchable from "../Touchable";
8
8
  import { extractStyles } from "../../utilities";
9
9
  export var Direction;
10
10
  (function (Direction) {
11
- Direction["Row"] = "row";
12
- Direction["RowReverse"] = "row-reverse";
11
+ Direction["Row"] = "row";
12
+ Direction["RowReverse"] = "row-reverse";
13
13
  })(Direction || (Direction = {}));
14
14
  const getCheckboxAlignment = (parentDirection, direction) => {
15
- if (parentDirection === GroupDirection.Horizontal) {
16
- return direction === Direction.Row ? "flex-start" : "flex-end";
17
- }
18
- else if (direction === Direction.RowReverse) {
19
- return "flex-start";
20
- }
21
- else {
22
- return "flex-end";
23
- }
15
+ if (parentDirection === GroupDirection.Horizontal) {
16
+ return direction === Direction.Row ? "flex-start" : "flex-end";
17
+ } else if (direction === Direction.RowReverse) {
18
+ return "flex-start";
19
+ } else {
20
+ return "flex-end";
21
+ }
24
22
  };
25
23
  const renderLabel = (value, labelStyle, textStyle) => {
26
- if (typeof value === "string") {
27
- return React.createElement(Text, { style: [labelStyle, textStyle] }, value);
28
- }
29
- else {
30
- return React.createElement(React.Fragment, null, value);
31
- }
24
+ if (typeof value === "string") {
25
+ return React.createElement(Text, { style: [labelStyle, textStyle] }, value);
26
+ } else {
27
+ return React.createElement(React.Fragment, null, value);
28
+ }
32
29
  };
33
- const CheckboxGroupRow = ({ Icon, label = "Label", status, value, onPress, labelContainerStyle, labelStyle, checkboxStyle, direction = Direction.Row, disabled, style, color, uncheckedColor, ...rest }) => {
34
- const { values: selectedValues, onValueChange, direction: parentDirection, } = useCheckboxGroupContext();
35
- const values = Array.isArray(selectedValues) ? selectedValues : [];
36
- const isChecked = status || values.includes(value);
37
- const handlePress = () => {
38
- if (!disabled) {
39
- onPress === null || onPress === void 0 ? void 0 : onPress(!isChecked);
40
- onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(value, !isChecked);
41
- }
42
- };
43
- const { textStyles, viewStyles } = extractStyles(style);
44
- return (React.createElement(Touchable, { onPress: handlePress, style: [styles.mainParent, { flexDirection: direction }, viewStyles], disabled: disabled, ...rest },
45
- React.createElement(View, { style: [
46
- styles.label,
47
- {
48
- alignItems: direction === Direction.Row ? "flex-start" : "flex-end",
49
- },
50
- labelContainerStyle,
51
- ] }, renderLabel(label, labelStyle, textStyles)),
52
- React.createElement(View, { style: {
53
- flex: 1,
54
- alignItems: getCheckboxAlignment(parentDirection, direction),
55
- } },
56
- React.createElement(Checkbox, { Icon: Icon, status: isChecked, onPress: handlePress, style: checkboxStyle, disabled: disabled, color: color, uncheckedColor: uncheckedColor }))));
30
+ const CheckboxGroupRow = ({
31
+ Icon,
32
+ label = "Label",
33
+ status,
34
+ value,
35
+ onPress,
36
+ labelContainerStyle,
37
+ labelStyle,
38
+ checkboxStyle,
39
+ direction = Direction.Row,
40
+ disabled,
41
+ style,
42
+ color,
43
+ uncheckedColor,
44
+ ...rest
45
+ }) => {
46
+ const {
47
+ values: selectedValues,
48
+ onValueChange,
49
+ direction: parentDirection,
50
+ } = useCheckboxGroupContext();
51
+ const values = Array.isArray(selectedValues) ? selectedValues : [];
52
+ const isChecked = status || values.includes(value);
53
+ const handlePress = () => {
54
+ if (!disabled) {
55
+ onPress === null || onPress === void 0 ? void 0 : onPress(!isChecked);
56
+ onValueChange === null || onValueChange === void 0
57
+ ? void 0
58
+ : onValueChange(value, !isChecked);
59
+ }
60
+ };
61
+ const { textStyles, viewStyles } = extractStyles(style);
62
+ return React.createElement(
63
+ Touchable,
64
+ {
65
+ onPress: handlePress,
66
+ style: [styles.mainParent, { flexDirection: direction }, viewStyles],
67
+ disabled: disabled,
68
+ ...rest,
69
+ },
70
+ React.createElement(
71
+ View,
72
+ {
73
+ style: [
74
+ styles.label,
75
+ {
76
+ alignItems: direction === Direction.Row ? "flex-start" : "flex-end",
77
+ },
78
+ labelContainerStyle,
79
+ ],
80
+ },
81
+ renderLabel(label, labelStyle, textStyles)
82
+ ),
83
+ React.createElement(
84
+ View,
85
+ {
86
+ style: {
87
+ flex: 1,
88
+ alignItems: getCheckboxAlignment(parentDirection, direction),
89
+ },
90
+ },
91
+ React.createElement(Checkbox, {
92
+ Icon: Icon,
93
+ status: isChecked,
94
+ onPress: handlePress,
95
+ style: checkboxStyle,
96
+ disabled: disabled,
97
+ color: color,
98
+ uncheckedColor: uncheckedColor,
99
+ })
100
+ )
101
+ );
57
102
  };
58
103
  const styles = StyleSheet.create({
59
- mainParent: {
60
- alignItems: "center",
61
- justifyContent: "space-around",
62
- paddingStart: 20,
63
- minHeight: 50,
64
- paddingEnd: 20,
65
- display: "flex",
66
- ...Platform.select({
67
- web: {
68
- cursor: "pointer",
69
- userSelect: "none",
70
- },
71
- }),
72
- },
73
- label: {
74
- flex: 3,
75
- },
104
+ mainParent: {
105
+ alignItems: "center",
106
+ justifyContent: "space-around",
107
+ paddingStart: 20,
108
+ minHeight: 50,
109
+ paddingEnd: 20,
110
+ display: "flex",
111
+ ...Platform.select({
112
+ web: {
113
+ cursor: "pointer",
114
+ userSelect: "none",
115
+ },
116
+ }),
117
+ },
118
+ label: {
119
+ flex: 3,
120
+ },
76
121
  });
77
122
  export default CheckboxGroupRow;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { StyleSheet, View, Platform, } from "react-native";
2
+ import { StyleSheet, View, Platform } from "react-native";
3
3
  import { isString } from "lodash";
4
4
  import { extractStyles } from "../../utilities";
5
5
  import { usePrevious } from "../../hooks";
@@ -8,71 +8,117 @@ import Touchable from "../Touchable";
8
8
  import Checkbox from "./Checkbox";
9
9
  export var Direction;
10
10
  (function (Direction) {
11
- Direction["Row"] = "row";
12
- Direction["RowReverse"] = "row-reverse";
11
+ Direction["Row"] = "row";
12
+ Direction["RowReverse"] = "row-reverse";
13
13
  })(Direction || (Direction = {}));
14
14
  const renderLabel = (value, labelStyle, textStyle) => {
15
- if (isString(value)) {
16
- return React.createElement(Text, { style: [textStyle, labelStyle] }, value);
15
+ if (isString(value)) {
16
+ return React.createElement(Text, { style: [textStyle, labelStyle] }, value);
17
+ } else {
18
+ return React.createElement(React.Fragment, null, value);
19
+ }
20
+ };
21
+ const CheckboxRow = ({
22
+ label = "Label",
23
+ labelStyle,
24
+ labelContainerStyle,
25
+ checkboxStyle,
26
+ direction = Direction.Row,
27
+ Icon,
28
+ status,
29
+ disabled = false,
30
+ onPress,
31
+ onCheck,
32
+ onUncheck,
33
+ color,
34
+ uncheckedColor,
35
+ defaultValue,
36
+ checkedIcon,
37
+ uncheckedIcon,
38
+ size,
39
+ style,
40
+ ...rest
41
+ }) => {
42
+ const [internalValue, setInternalValue] = React.useState(
43
+ status || defaultValue || false
44
+ );
45
+ React.useEffect(() => {
46
+ if (status != null) {
47
+ setInternalValue(status);
17
48
  }
18
- else {
19
- return React.createElement(React.Fragment, null, value);
49
+ }, [status]);
50
+ // This special logic is to handle weird APIs like Airtable that return
51
+ // true or undefined for a boolean
52
+ const previousDefaultValue = usePrevious(defaultValue);
53
+ React.useEffect(() => {
54
+ if (defaultValue !== previousDefaultValue) {
55
+ setInternalValue(Boolean(defaultValue));
20
56
  }
21
- };
22
- const CheckboxRow = ({ label = "Label", labelStyle, labelContainerStyle, checkboxStyle, direction = Direction.Row, Icon, status, disabled = false, onPress, onCheck, onUncheck, color, uncheckedColor, defaultValue, checkedIcon, uncheckedIcon, size, style, ...rest }) => {
23
- const [internalValue, setInternalValue] = React.useState(status || defaultValue || false);
24
- React.useEffect(() => {
25
- if (status != null) {
26
- setInternalValue(status);
27
- }
28
- }, [status]);
29
- // This special logic is to handle weird APIs like Airtable that return
30
- // true or undefined for a boolean
31
- const previousDefaultValue = usePrevious(defaultValue);
32
- React.useEffect(() => {
33
- if (defaultValue !== previousDefaultValue) {
34
- setInternalValue(Boolean(defaultValue));
35
- }
36
- }, [defaultValue, previousDefaultValue]);
37
- const handlePress = () => {
38
- const newValue = !internalValue;
39
- setInternalValue(newValue);
40
- onPress === null || onPress === void 0 ? void 0 : onPress(newValue);
41
- if (newValue) {
42
- onCheck === null || onCheck === void 0 ? void 0 : onCheck();
43
- }
44
- if (!newValue) {
45
- onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
46
- }
47
- };
48
- const { textStyles, viewStyles } = extractStyles(style);
49
- return (React.createElement(Touchable, { onPress: handlePress, style: [viewStyles, styles.mainParent, { flexDirection: direction }], disabled: disabled, ...rest },
50
- React.createElement(View, { style: [
51
- styles.label,
52
- {
53
- alignItems: direction === Direction.Row ? "flex-start" : "flex-end",
54
- },
55
- labelContainerStyle,
56
- ] }, renderLabel(label, textStyles, labelStyle)),
57
- React.createElement(Checkbox, { Icon: Icon, status: internalValue, style: checkboxStyle, disabled: disabled, onPress: handlePress, color: color, uncheckedColor: uncheckedColor, checkedIcon: checkedIcon, uncheckedIcon: uncheckedIcon, size: size })));
57
+ }, [defaultValue, previousDefaultValue]);
58
+ const handlePress = () => {
59
+ const newValue = !internalValue;
60
+ setInternalValue(newValue);
61
+ onPress === null || onPress === void 0 ? void 0 : onPress(newValue);
62
+ if (newValue) {
63
+ onCheck === null || onCheck === void 0 ? void 0 : onCheck();
64
+ }
65
+ if (!newValue) {
66
+ onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
67
+ }
68
+ };
69
+ const { textStyles, viewStyles } = extractStyles(style);
70
+ return React.createElement(
71
+ Touchable,
72
+ {
73
+ onPress: handlePress,
74
+ style: [viewStyles, styles.mainParent, { flexDirection: direction }],
75
+ disabled: disabled,
76
+ ...rest,
77
+ },
78
+ React.createElement(
79
+ View,
80
+ {
81
+ style: [
82
+ styles.label,
83
+ {
84
+ alignItems: direction === Direction.Row ? "flex-start" : "flex-end",
85
+ },
86
+ labelContainerStyle,
87
+ ],
88
+ },
89
+ renderLabel(label, textStyles, labelStyle)
90
+ ),
91
+ React.createElement(Checkbox, {
92
+ Icon: Icon,
93
+ status: internalValue,
94
+ style: checkboxStyle,
95
+ disabled: disabled,
96
+ onPress: handlePress,
97
+ color: color,
98
+ uncheckedColor: uncheckedColor,
99
+ checkedIcon: checkedIcon,
100
+ uncheckedIcon: uncheckedIcon,
101
+ size: size,
102
+ })
103
+ );
58
104
  };
59
105
  const styles = StyleSheet.create({
60
- mainParent: {
61
- alignItems: "center",
62
- justifyContent: "space-around",
63
- paddingStart: 20,
64
- minHeight: 50,
65
- paddingEnd: 20,
66
- display: "flex",
67
- ...Platform.select({
68
- web: {
69
- cursor: "pointer",
70
- userSelect: "none",
71
- },
72
- }),
73
- },
74
- label: {
75
- flex: 3,
76
- },
106
+ mainParent: {
107
+ alignItems: "center",
108
+ justifyContent: "space-around",
109
+ paddingStart: 20,
110
+ minHeight: 50,
111
+ paddingEnd: 20,
112
+ display: "flex",
113
+ ...Platform.select({
114
+ web: {
115
+ cursor: "pointer",
116
+ userSelect: "none",
117
+ },
118
+ }),
119
+ },
120
+ label: {
121
+ flex: 3,
122
+ },
77
123
  });
78
124
  export default CheckboxRow;
@@ -1,14 +1,14 @@
1
1
  import { createContext, useContext } from "react";
2
2
  export var Direction;
3
3
  (function (Direction) {
4
- Direction["Horizontal"] = "horizontal";
5
- Direction["Vertical"] = "vertical";
4
+ Direction["Horizontal"] = "horizontal";
5
+ Direction["Vertical"] = "vertical";
6
6
  })(Direction || (Direction = {}));
7
7
  export const checkboxGroupContext = createContext({
8
- onValueChange: () => { },
9
- values: [],
10
- direction: undefined,
8
+ onValueChange: () => {},
9
+ values: [],
10
+ direction: undefined,
11
11
  });
12
12
  export function useCheckboxGroupContext() {
13
- return useContext(checkboxGroupContext);
13
+ return useContext(checkboxGroupContext);
14
14
  }
@@ -1,8 +1,18 @@
1
1
  import * as React from "react";
2
- import { Image, } from "react-native";
2
+ import { Image } from "react-native";
3
3
  import Config from "./Config";
4
- const CircleImage = ({ source = Config.placeholderImageURL, size = 60, style, ...props }) => {
5
- const borderRadius = size / 2;
6
- return (React.createElement(Image, { style: [{ width: size, height: size, borderRadius }, style], source: typeof source === "string" ? { uri: source } : source, resizeMode: "cover", ...props }));
4
+ const CircleImage = ({
5
+ source = Config.placeholderImageURL,
6
+ size = 60,
7
+ style,
8
+ ...props
9
+ }) => {
10
+ const borderRadius = size / 2;
11
+ return React.createElement(Image, {
12
+ style: [{ width: size, height: size, borderRadius }, style],
13
+ source: typeof source === "string" ? { uri: source } : source,
14
+ resizeMode: "cover",
15
+ ...props,
16
+ });
7
17
  };
8
18
  export default CircleImage;