@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
@@ -27,81 +27,92 @@ export const PortalContext = React.createContext(null);
27
27
  * Here any `Portal` elements under `<App />` are rendered alongside `<App />` and will appear above `<App />` like a `Modal`.
28
28
  */
29
29
  export default class PortalHost extends React.Component {
30
- constructor() {
31
- super(...arguments);
32
- this.setManager = (manager) => {
33
- this.manager = manager;
34
- };
35
- this.mount = (children) => {
36
- const key = this.nextKey++;
37
- if (this.manager) {
38
- this.manager.mount(key, children);
39
- }
40
- else {
41
- this.queue.push({ type: "mount", key, children });
42
- }
43
- return key;
44
- };
45
- this.update = (key, children) => {
46
- if (this.manager) {
47
- this.manager.update(key, children);
48
- }
49
- else {
50
- const op = { type: "mount", key, children };
51
- const index = this.queue.findIndex((o) => o.type === "mount" || (o.type === "update" && o.key === key));
52
- if (index > -1) {
53
- // @ts-ignore
54
- this.queue[index] = op;
55
- }
56
- else {
57
- this.queue.push(op);
58
- }
59
- }
60
- };
61
- this.unmount = (key) => {
62
- if (this.manager) {
63
- this.manager.unmount(key);
64
- }
65
- else {
66
- this.queue.push({ type: "unmount", key });
67
- }
68
- };
69
- this.nextKey = 0;
70
- this.queue = [];
71
- }
72
- componentDidMount() {
73
- const manager = this.manager;
74
- const queue = this.queue;
75
- while (queue.length && manager) {
76
- const action = queue.pop();
77
- if (action) {
78
- switch (action.type) {
79
- case "mount":
80
- manager.mount(action.key, action.children);
81
- break;
82
- case "update":
83
- manager.update(action.key, action.children);
84
- break;
85
- case "unmount":
86
- manager.unmount(action.key);
87
- break;
88
- }
89
- }
30
+ constructor() {
31
+ super(...arguments);
32
+ this.setManager = (manager) => {
33
+ this.manager = manager;
34
+ };
35
+ this.mount = (children) => {
36
+ const key = this.nextKey++;
37
+ if (this.manager) {
38
+ this.manager.mount(key, children);
39
+ } else {
40
+ this.queue.push({ type: "mount", key, children });
41
+ }
42
+ return key;
43
+ };
44
+ this.update = (key, children) => {
45
+ if (this.manager) {
46
+ this.manager.update(key, children);
47
+ } else {
48
+ const op = { type: "mount", key, children };
49
+ const index = this.queue.findIndex(
50
+ (o) => o.type === "mount" || (o.type === "update" && o.key === key)
51
+ );
52
+ if (index > -1) {
53
+ // @ts-ignore
54
+ this.queue[index] = op;
55
+ } else {
56
+ this.queue.push(op);
90
57
  }
58
+ }
59
+ };
60
+ this.unmount = (key) => {
61
+ if (this.manager) {
62
+ this.manager.unmount(key);
63
+ } else {
64
+ this.queue.push({ type: "unmount", key });
65
+ }
66
+ };
67
+ this.nextKey = 0;
68
+ this.queue = [];
69
+ }
70
+ componentDidMount() {
71
+ const manager = this.manager;
72
+ const queue = this.queue;
73
+ while (queue.length && manager) {
74
+ const action = queue.pop();
75
+ if (action) {
76
+ switch (action.type) {
77
+ case "mount":
78
+ manager.mount(action.key, action.children);
79
+ break;
80
+ case "update":
81
+ manager.update(action.key, action.children);
82
+ break;
83
+ case "unmount":
84
+ manager.unmount(action.key);
85
+ break;
86
+ }
87
+ }
91
88
  }
92
- render() {
93
- return (React.createElement(PortalContext.Provider, { value: {
94
- mount: this.mount,
95
- update: this.update,
96
- unmount: this.unmount,
97
- } },
98
- React.createElement(View, { style: styles.container, collapsable: false, pointerEvents: "box-none" }, this.props.children),
99
- React.createElement(PortalManager, { ref: this.setManager })));
100
- }
89
+ }
90
+ render() {
91
+ return React.createElement(
92
+ PortalContext.Provider,
93
+ {
94
+ value: {
95
+ mount: this.mount,
96
+ update: this.update,
97
+ unmount: this.unmount,
98
+ },
99
+ },
100
+ React.createElement(
101
+ View,
102
+ {
103
+ style: styles.container,
104
+ collapsable: false,
105
+ pointerEvents: "box-none",
106
+ },
107
+ this.props.children
108
+ ),
109
+ React.createElement(PortalManager, { ref: this.setManager })
110
+ );
111
+ }
101
112
  }
102
113
  PortalHost.displayName = "Portal.Host";
103
114
  const styles = StyleSheet.create({
104
- container: {
105
- flex: 1,
106
- },
115
+ container: {
116
+ flex: 1,
117
+ },
107
118
  });
@@ -4,29 +4,42 @@ import { View, StyleSheet } from "react-native";
4
4
  * Portal host is the component which actually renders all Portals.
5
5
  */
6
6
  export default class PortalManager extends React.PureComponent {
7
- constructor() {
8
- super(...arguments);
9
- this.state = {
10
- portals: [],
11
- };
12
- this.mount = (key, children) => {
13
- this.setState((state) => ({
14
- portals: [...state.portals, { key, children }],
15
- }));
16
- };
17
- this.update = (key, children) => this.setState((state) => ({
18
- portals: state.portals.map((item) => {
19
- if (item.key === key) {
20
- return { ...item, children };
21
- }
22
- return item;
23
- }),
24
- }));
25
- this.unmount = (key) => this.setState((state) => ({
26
- portals: state.portals.filter((item) => item.key !== key),
27
- }));
28
- }
29
- render() {
30
- return this.state.portals.map(({ key, children }) => (React.createElement(View, { key: key, collapsable: false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */, pointerEvents: "box-none", style: StyleSheet.absoluteFill }, children)));
31
- }
7
+ constructor() {
8
+ super(...arguments);
9
+ this.state = {
10
+ portals: [],
11
+ };
12
+ this.mount = (key, children) => {
13
+ this.setState((state) => ({
14
+ portals: [...state.portals, { key, children }],
15
+ }));
16
+ };
17
+ this.update = (key, children) =>
18
+ this.setState((state) => ({
19
+ portals: state.portals.map((item) => {
20
+ if (item.key === key) {
21
+ return { ...item, children };
22
+ }
23
+ return item;
24
+ }),
25
+ }));
26
+ this.unmount = (key) =>
27
+ this.setState((state) => ({
28
+ portals: state.portals.filter((item) => item.key !== key),
29
+ }));
30
+ }
31
+ render() {
32
+ return this.state.portals.map(({ key, children }) =>
33
+ React.createElement(
34
+ View,
35
+ {
36
+ key: key,
37
+ collapsable: false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */,
38
+ pointerEvents: "box-none",
39
+ style: StyleSheet.absoluteFill,
40
+ },
41
+ children
42
+ )
43
+ );
44
+ }
32
45
  }
@@ -1,118 +1,146 @@
1
1
  import React, { Component } from "react";
2
- import { Animated, Easing, View, I18nManager, } from "react-native";
2
+ import { Animated, Easing, View, I18nManager } from "react-native";
3
3
  const INDETERMINATE_WIDTH_FACTOR = 0.3;
4
- const BAR_WIDTH_ZERO_POSITION = INDETERMINATE_WIDTH_FACTOR / (1 + INDETERMINATE_WIDTH_FACTOR);
4
+ const BAR_WIDTH_ZERO_POSITION =
5
+ INDETERMINATE_WIDTH_FACTOR / (1 + INDETERMINATE_WIDTH_FACTOR);
5
6
  export default class ProgressBar extends Component {
6
- constructor(props) {
7
- super(props);
8
- this.handleLayout = (event) => {
9
- const { width = 150, onLayout } = this.props;
10
- if (!width) {
11
- this.setState({ width: event.nativeEvent.layout.width });
12
- }
13
- if (onLayout) {
14
- onLayout(event);
15
- }
16
- };
17
- const { progress: progressP = 0, indeterminate = false } = props;
18
- const progress = Math.min(Math.max(progressP, 0), 1);
19
- this.state = {
20
- width: 0,
21
- progress: new Animated.Value(indeterminate ? INDETERMINATE_WIDTH_FACTOR : progress),
22
- animationValue: new Animated.Value(BAR_WIDTH_ZERO_POSITION),
23
- };
7
+ constructor(props) {
8
+ super(props);
9
+ this.handleLayout = (event) => {
10
+ const { width = 150, onLayout } = this.props;
11
+ if (!width) {
12
+ this.setState({ width: event.nativeEvent.layout.width });
13
+ }
14
+ if (onLayout) {
15
+ onLayout(event);
16
+ }
17
+ };
18
+ const { progress: progressP = 0, indeterminate = false } = props;
19
+ const progress = Math.min(Math.max(progressP, 0), 1);
20
+ this.state = {
21
+ width: 0,
22
+ progress: new Animated.Value(
23
+ indeterminate ? INDETERMINATE_WIDTH_FACTOR : progress
24
+ ),
25
+ animationValue: new Animated.Value(BAR_WIDTH_ZERO_POSITION),
26
+ };
27
+ }
28
+ componentDidMount() {
29
+ const { indeterminate = false } = this.props;
30
+ if (indeterminate) {
31
+ this.animate();
24
32
  }
25
- componentDidMount() {
26
- const { indeterminate = false } = this.props;
27
- if (indeterminate) {
28
- this.animate();
29
- }
33
+ }
34
+ componentDidUpdate(prevProps) {
35
+ const {
36
+ indeterminate = false,
37
+ useNativeDriver = false,
38
+ progress: progressP = 0,
39
+ animationType = "spring",
40
+ animationConfig = { bounciness: 0 },
41
+ animated = true,
42
+ } = this.props;
43
+ if (prevProps.indeterminate !== indeterminate) {
44
+ if (indeterminate) {
45
+ this.animate();
46
+ } else {
47
+ Animated.spring(this.state.animationValue, {
48
+ toValue: BAR_WIDTH_ZERO_POSITION,
49
+ useNativeDriver,
50
+ }).start();
51
+ }
30
52
  }
31
- componentDidUpdate(prevProps) {
32
- const { indeterminate = false, useNativeDriver = false, progress: progressP = 0, animationType = "spring", animationConfig = { bounciness: 0 }, animated = true, } = this.props;
33
- if (prevProps.indeterminate !== indeterminate) {
34
- if (indeterminate) {
35
- this.animate();
36
- }
37
- else {
38
- Animated.spring(this.state.animationValue, {
39
- toValue: BAR_WIDTH_ZERO_POSITION,
40
- useNativeDriver,
41
- }).start();
42
- }
43
- }
44
- if (prevProps.indeterminate !== indeterminate ||
45
- prevProps.progress !== progressP) {
46
- const progress = this.props.indeterminate
47
- ? INDETERMINATE_WIDTH_FACTOR
48
- : Math.min(Math.max(progressP, 0), 1);
49
- if (animated) {
50
- Animated[animationType](this.state.progress, {
51
- ...animationConfig,
52
- toValue: progress,
53
- velocity: 0,
54
- useNativeDriver,
55
- }).start();
56
- }
57
- else {
58
- this.state.progress.setValue(progress);
59
- }
60
- }
61
- }
62
- animate() {
63
- const { useNativeDriver = false, indeterminateAnimationDuration = 1000 } = this.props;
64
- this.state.animationValue.setValue(0);
65
- Animated.timing(this.state.animationValue, {
66
- toValue: 1,
67
- duration: indeterminateAnimationDuration,
68
- easing: Easing.linear,
69
- isInteraction: false,
70
- useNativeDriver,
71
- }).start((endState) => {
72
- if (endState.finished) {
73
- this.animate();
74
- }
75
- });
76
- }
77
- render() {
78
- const { borderColor, borderRadius = 4, borderWidth = 1, children, color = "rgba(0, 122, 255, 1)", style, unfilledColor, width = 150, ...restProps } = this.props;
79
- const innerWidth = Math.max(0, width || this.state.width) - borderWidth * 2;
80
- const containerStyle = {
81
- width,
82
- borderWidth,
83
- borderColor: borderColor || color,
84
- borderRadius,
85
- overflow: "hidden",
86
- backgroundColor: unfilledColor,
87
- };
88
- const progressStyle = {
89
- backgroundColor: color,
90
- // Always take up full height of container.
91
- height: "100%",
92
- transform: [
93
- {
94
- translateX: this.state.animationValue.interpolate({
95
- inputRange: [0, 1],
96
- outputRange: [innerWidth * -INDETERMINATE_WIDTH_FACTOR, innerWidth],
97
- }),
98
- },
99
- {
100
- translateX: this.state.progress.interpolate({
101
- inputRange: [0, 1],
102
- outputRange: [innerWidth / (I18nManager.isRTL ? 2 : -2), 0],
103
- }),
104
- },
105
- {
106
- // Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
107
- scaleX: this.state.progress.interpolate({
108
- inputRange: [0, 1],
109
- outputRange: [0.0001, 1],
110
- }),
111
- },
112
- ],
113
- };
114
- return (React.createElement(View, { style: [containerStyle, style], onLayout: this.handleLayout, ...restProps },
115
- React.createElement(Animated.View, { style: progressStyle }),
116
- children));
53
+ if (
54
+ prevProps.indeterminate !== indeterminate ||
55
+ prevProps.progress !== progressP
56
+ ) {
57
+ const progress = this.props.indeterminate
58
+ ? INDETERMINATE_WIDTH_FACTOR
59
+ : Math.min(Math.max(progressP, 0), 1);
60
+ if (animated) {
61
+ Animated[animationType](this.state.progress, {
62
+ ...animationConfig,
63
+ toValue: progress,
64
+ velocity: 0,
65
+ useNativeDriver,
66
+ }).start();
67
+ } else {
68
+ this.state.progress.setValue(progress);
69
+ }
117
70
  }
71
+ }
72
+ animate() {
73
+ const { useNativeDriver = false, indeterminateAnimationDuration = 1000 } =
74
+ this.props;
75
+ this.state.animationValue.setValue(0);
76
+ Animated.timing(this.state.animationValue, {
77
+ toValue: 1,
78
+ duration: indeterminateAnimationDuration,
79
+ easing: Easing.linear,
80
+ isInteraction: false,
81
+ useNativeDriver,
82
+ }).start((endState) => {
83
+ if (endState.finished) {
84
+ this.animate();
85
+ }
86
+ });
87
+ }
88
+ render() {
89
+ const {
90
+ borderColor,
91
+ borderRadius = 4,
92
+ borderWidth = 1,
93
+ children,
94
+ color = "rgba(0, 122, 255, 1)",
95
+ style,
96
+ unfilledColor,
97
+ width = 150,
98
+ ...restProps
99
+ } = this.props;
100
+ const innerWidth = Math.max(0, width || this.state.width) - borderWidth * 2;
101
+ const containerStyle = {
102
+ width,
103
+ borderWidth,
104
+ borderColor: borderColor || color,
105
+ borderRadius,
106
+ overflow: "hidden",
107
+ backgroundColor: unfilledColor,
108
+ };
109
+ const progressStyle = {
110
+ backgroundColor: color,
111
+ // Always take up full height of container.
112
+ height: "100%",
113
+ transform: [
114
+ {
115
+ translateX: this.state.animationValue.interpolate({
116
+ inputRange: [0, 1],
117
+ outputRange: [innerWidth * -INDETERMINATE_WIDTH_FACTOR, innerWidth],
118
+ }),
119
+ },
120
+ {
121
+ translateX: this.state.progress.interpolate({
122
+ inputRange: [0, 1],
123
+ outputRange: [innerWidth / (I18nManager.isRTL ? 2 : -2), 0],
124
+ }),
125
+ },
126
+ {
127
+ // Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
128
+ scaleX: this.state.progress.interpolate({
129
+ inputRange: [0, 1],
130
+ outputRange: [0.0001, 1],
131
+ }),
132
+ },
133
+ ],
134
+ };
135
+ return React.createElement(
136
+ View,
137
+ {
138
+ style: [containerStyle, style],
139
+ onLayout: this.handleLayout,
140
+ ...restProps,
141
+ },
142
+ React.createElement(Animated.View, { style: progressStyle }),
143
+ children
144
+ );
145
+ }
118
146
  }
@@ -2,12 +2,45 @@ import * as React from "react";
2
2
  import { Text } from "react-native";
3
3
  import AnimatedCircularProgress from "./AnimatedCircularProgress";
4
4
  import { withTheme } from "../theming";
5
- const ProgressCircle = ({ progress = 0.5, style, color = "primary", size = 100, showsText = true, unfilledColor, strokeCap = "butt", textStyle, thickness = 1, theme, }) => {
6
- const progressNum = Math.round(progress * 100);
7
- const tintColor = color || theme.colors.primary;
8
- const backgroundColor = unfilledColor || theme.colors.secondary;
9
- return (React.createElement(AnimatedCircularProgress, { size: size, width: thickness, backgroundWidth: thickness, fill: progressNum, tintColor: tintColor, backgroundColor: backgroundColor, rotation: 0, lineCap: strokeCap, style: style }, (fill) => showsText ? (React.createElement(Text, { style: [{ fontSize: size * 0.275, color: tintColor }, textStyle] },
10
- Math.round(fill),
11
- "%")) : null));
5
+ const ProgressCircle = ({
6
+ progress = 0.5,
7
+ style,
8
+ color = "primary",
9
+ size = 100,
10
+ showsText = true,
11
+ unfilledColor,
12
+ strokeCap = "butt",
13
+ textStyle,
14
+ thickness = 1,
15
+ theme,
16
+ }) => {
17
+ const progressNum = Math.round(progress * 100);
18
+ const tintColor = color || theme.colors.primary;
19
+ const backgroundColor = unfilledColor || theme.colors.secondary;
20
+ return React.createElement(
21
+ AnimatedCircularProgress,
22
+ {
23
+ size: size,
24
+ width: thickness,
25
+ backgroundWidth: thickness,
26
+ fill: progressNum,
27
+ tintColor: tintColor,
28
+ backgroundColor: backgroundColor,
29
+ rotation: 0,
30
+ lineCap: strokeCap,
31
+ style: style,
32
+ },
33
+ (fill) =>
34
+ showsText
35
+ ? React.createElement(
36
+ Text,
37
+ {
38
+ style: [{ fontSize: size * 0.275, color: tintColor }, textStyle],
39
+ },
40
+ Math.round(fill),
41
+ "%"
42
+ )
43
+ : null
44
+ );
12
45
  };
13
46
  export default withTheme(ProgressCircle);
@@ -1,27 +1,48 @@
1
1
  import * as React from "react";
2
2
  import StepIndicator from "./StepIndicator";
3
3
  import { withTheme } from "../theming";
4
- const ProgressIndicator = ({ numberOfSteps, currentStep, currentStepStrokeWidth = 3, stepStrokeCurrentColor = "primary", stepIndicatorSize, currentStepIndicatorSize, stepIndicatorCurrentColor, stepIndicatorLabelCurrentColor, stepIndicatorLabelFontSize = 12, stepNumberFinishedColor = "strongInverse", stepNumberUnfinishedColor = "primary", unfinishedColor = "light", finishedColor = "primary", theme, }) => {
5
- const currentPosition = currentStep - 1;
6
- return (React.createElement(StepIndicator, { stepCount: numberOfSteps, currentPosition: currentPosition, customStyles: {
7
- stepIndicatorSize,
8
- currentStepIndicatorSize: currentStepIndicatorSize
9
- ? currentStepIndicatorSize
10
- : stepIndicatorSize,
11
- stepStrokeFinishedColor: finishedColor,
12
- stepStrokeUnFinishedColor: unfinishedColor,
13
- separatorFinishedColor: finishedColor,
14
- separatorUnFinishedColor: unfinishedColor,
15
- stepIndicatorFinishedColor: finishedColor,
16
- stepIndicatorUnFinishedColor: unfinishedColor,
17
- currentStepStrokeWidth,
18
- stepStrokeCurrentColor: stepStrokeCurrentColor || stepIndicatorCurrentColor,
19
- stepIndicatorLabelUnFinishedColor: stepNumberUnfinishedColor,
20
- stepIndicatorLabelFinishedColor: stepNumberFinishedColor,
21
- stepIndicatorCurrentColor: stepIndicatorCurrentColor || unfinishedColor,
22
- stepIndicatorLabelCurrentColor: stepIndicatorLabelCurrentColor || stepNumberUnfinishedColor,
23
- stepIndicatorLabelFontSize,
24
- labelFontFamily: theme.typography.body1.fontFamily,
25
- } }));
4
+ const ProgressIndicator = ({
5
+ numberOfSteps,
6
+ currentStep,
7
+ currentStepStrokeWidth = 3,
8
+ stepStrokeCurrentColor = "primary",
9
+ stepIndicatorSize,
10
+ currentStepIndicatorSize,
11
+ stepIndicatorCurrentColor,
12
+ stepIndicatorLabelCurrentColor,
13
+ stepIndicatorLabelFontSize = 12,
14
+ stepNumberFinishedColor = "strongInverse",
15
+ stepNumberUnfinishedColor = "primary",
16
+ unfinishedColor = "light",
17
+ finishedColor = "primary",
18
+ theme,
19
+ }) => {
20
+ const currentPosition = currentStep - 1;
21
+ return React.createElement(StepIndicator, {
22
+ stepCount: numberOfSteps,
23
+ currentPosition: currentPosition,
24
+ customStyles: {
25
+ stepIndicatorSize,
26
+ currentStepIndicatorSize: currentStepIndicatorSize
27
+ ? currentStepIndicatorSize
28
+ : stepIndicatorSize,
29
+ stepStrokeFinishedColor: finishedColor,
30
+ stepStrokeUnFinishedColor: unfinishedColor,
31
+ separatorFinishedColor: finishedColor,
32
+ separatorUnFinishedColor: unfinishedColor,
33
+ stepIndicatorFinishedColor: finishedColor,
34
+ stepIndicatorUnFinishedColor: unfinishedColor,
35
+ currentStepStrokeWidth,
36
+ stepStrokeCurrentColor:
37
+ stepStrokeCurrentColor || stepIndicatorCurrentColor,
38
+ stepIndicatorLabelUnFinishedColor: stepNumberUnfinishedColor,
39
+ stepIndicatorLabelFinishedColor: stepNumberFinishedColor,
40
+ stepIndicatorCurrentColor: stepIndicatorCurrentColor || unfinishedColor,
41
+ stepIndicatorLabelCurrentColor:
42
+ stepIndicatorLabelCurrentColor || stepNumberUnfinishedColor,
43
+ stepIndicatorLabelFontSize,
44
+ labelFontFamily: theme.typography.body1.fontFamily,
45
+ },
46
+ });
26
47
  };
27
48
  export default withTheme(ProgressIndicator);
@@ -3,15 +3,42 @@ import Config from "../Config";
3
3
  import IconButton from "../IconButton";
4
4
  import { getValueForRadioButton } from "../../utilities";
5
5
  import { useRadioButtonGroupContext } from "./context";
6
- const RadioButton = ({ Icon, disabled = false, color, value = "", selected, unselectedColor, onPress, size = Config.radioButtonSize, selectedIcon = "MaterialIcons/radio-button-checked", unselectedIcon = "MaterialIcons/radio-button-unchecked", style, ...rest }) => {
7
- const { value: contextValue, onValueChange } = useRadioButtonGroupContext();
8
- const realValue = getValueForRadioButton(value);
9
- const realContextValue = getValueForRadioButton(contextValue);
10
- const isSelected = selected !== null && selected !== void 0 ? selected : realContextValue === realValue;
11
- const handlePress = () => {
12
- onPress === null || onPress === void 0 ? void 0 : onPress(realValue);
13
- onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
14
- };
15
- return (React.createElement(IconButton, { Icon: Icon, icon: isSelected ? selectedIcon : unselectedIcon, color: isSelected ? color : unselectedColor, disabled: disabled, onPress: handlePress, size: size, style: style, ...rest }));
6
+ const RadioButton = ({
7
+ Icon,
8
+ disabled = false,
9
+ color,
10
+ value = "",
11
+ selected,
12
+ unselectedColor,
13
+ onPress,
14
+ size = Config.radioButtonSize,
15
+ selectedIcon = "MaterialIcons/radio-button-checked",
16
+ unselectedIcon = "MaterialIcons/radio-button-unchecked",
17
+ style,
18
+ ...rest
19
+ }) => {
20
+ const { value: contextValue, onValueChange } = useRadioButtonGroupContext();
21
+ const realValue = getValueForRadioButton(value);
22
+ const realContextValue = getValueForRadioButton(contextValue);
23
+ const isSelected =
24
+ selected !== null && selected !== void 0
25
+ ? selected
26
+ : realContextValue === realValue;
27
+ const handlePress = () => {
28
+ onPress === null || onPress === void 0 ? void 0 : onPress(realValue);
29
+ onValueChange === null || onValueChange === void 0
30
+ ? void 0
31
+ : onValueChange(realValue);
32
+ };
33
+ return React.createElement(IconButton, {
34
+ Icon: Icon,
35
+ icon: isSelected ? selectedIcon : unselectedIcon,
36
+ color: isSelected ? color : unselectedColor,
37
+ disabled: disabled,
38
+ onPress: handlePress,
39
+ size: size,
40
+ style: style,
41
+ ...rest,
42
+ });
16
43
  };
17
44
  export default RadioButton;