react-native-acoustic-connect-beta 18.0.7 → 18.0.9

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 (327) hide show
  1. package/Examples/SampleUI/.bundle/config +2 -0
  2. package/Examples/SampleUI/.eslintrc.js +4 -0
  3. package/Examples/SampleUI/.prettierrc.js +7 -0
  4. package/Examples/SampleUI/.watchmanconfig +1 -0
  5. package/Examples/SampleUI/App.js +1 -0
  6. package/Examples/SampleUI/Gemfile +10 -0
  7. package/Examples/SampleUI/Gemfile.lock +121 -0
  8. package/Examples/SampleUI/README.md +79 -0
  9. package/Examples/SampleUI/__tests__/App.test.tsx +17 -0
  10. package/Examples/SampleUI/android/app/build.gradle +124 -0
  11. package/Examples/SampleUI/android/app/debug.keystore +0 -0
  12. package/Examples/SampleUI/android/app/proguard-rules.pro +10 -0
  13. package/Examples/SampleUI/android/app/src/debug/AndroidManifest.xml +9 -0
  14. package/Examples/SampleUI/android/app/src/main/AndroidManifest.xml +26 -0
  15. package/Examples/SampleUI/android/app/src/main/java/com/sampleui/MainActivity.kt +23 -0
  16. package/Examples/SampleUI/android/app/src/main/java/com/sampleui/MainApplication.kt +53 -0
  17. package/Examples/SampleUI/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  18. package/Examples/SampleUI/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  19. package/Examples/SampleUI/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  20. package/Examples/SampleUI/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  21. package/Examples/SampleUI/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  22. package/Examples/SampleUI/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  23. package/Examples/SampleUI/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  24. package/Examples/SampleUI/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  25. package/Examples/SampleUI/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  26. package/Examples/SampleUI/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  27. package/Examples/SampleUI/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  28. package/Examples/SampleUI/android/app/src/main/res/values/strings.xml +3 -0
  29. package/Examples/SampleUI/android/app/src/main/res/values/styles.xml +9 -0
  30. package/Examples/SampleUI/android/build.gradle +21 -0
  31. package/Examples/SampleUI/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  32. package/Examples/SampleUI/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  33. package/Examples/SampleUI/android/gradle.properties +39 -0
  34. package/Examples/SampleUI/android/gradlew +252 -0
  35. package/Examples/SampleUI/android/gradlew.bat +94 -0
  36. package/Examples/SampleUI/android/settings.gradle +21 -0
  37. package/Examples/SampleUI/app.json +51 -0
  38. package/Examples/SampleUI/assets/fonts/Abel-Regular.ttf +0 -0
  39. package/Examples/SampleUI/assets/fonts/NotoSans-Regular.ttf +0 -0
  40. package/Examples/SampleUI/assets/images/android-icon.png +0 -0
  41. package/Examples/SampleUI/assets/images/artist-1.jpg +0 -0
  42. package/Examples/SampleUI/assets/images/artist-2.jpg +0 -0
  43. package/Examples/SampleUI/assets/images/avatar.png +0 -0
  44. package/Examples/SampleUI/assets/images/beach.jpg +0 -0
  45. package/Examples/SampleUI/assets/images/bridge.jpg +0 -0
  46. package/Examples/SampleUI/assets/images/chameleon.jpg +0 -0
  47. package/Examples/SampleUI/assets/images/city.jpg +0 -0
  48. package/Examples/SampleUI/assets/images/email-icon.png +0 -0
  49. package/Examples/SampleUI/assets/images/favorite.png +0 -0
  50. package/Examples/SampleUI/assets/images/forest.jpg +0 -0
  51. package/Examples/SampleUI/assets/images/paper-icon.png +0 -0
  52. package/Examples/SampleUI/assets/images/players-2.jpg +0 -0
  53. package/Examples/SampleUI/assets/images/players.jpg +0 -0
  54. package/Examples/SampleUI/assets/images/restaurant-1.jpg +0 -0
  55. package/Examples/SampleUI/assets/images/restaurant-2.jpg +0 -0
  56. package/Examples/SampleUI/assets/images/song-1.jpg +0 -0
  57. package/Examples/SampleUI/assets/images/song-2.jpg +0 -0
  58. package/Examples/SampleUI/assets/images/splash.png +0 -0
  59. package/Examples/SampleUI/assets/images/strawberries.jpg +0 -0
  60. package/Examples/SampleUI/assets/images/wrecked-ship.jpg +0 -0
  61. package/Examples/SampleUI/assets/styles/fonts.css +47 -0
  62. package/Examples/SampleUI/babel.config.js +22 -0
  63. package/Examples/SampleUI/index.js +9 -0
  64. package/Examples/SampleUI/ios/.xcode.env +11 -0
  65. package/Examples/SampleUI/ios/Podfile +58 -0
  66. package/Examples/SampleUI/ios/SampleUI/AppDelegate.h +7 -0
  67. package/Examples/SampleUI/ios/SampleUI/AppDelegate.mm +31 -0
  68. package/Examples/SampleUI/ios/SampleUI/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  69. package/Examples/SampleUI/ios/SampleUI/Images.xcassets/Contents.json +6 -0
  70. package/Examples/SampleUI/ios/SampleUI/Info.plist +52 -0
  71. package/Examples/SampleUI/ios/SampleUI/LaunchScreen.storyboard +47 -0
  72. package/Examples/SampleUI/ios/SampleUI/PrivacyInfo.xcprivacy +48 -0
  73. package/Examples/SampleUI/ios/SampleUI/main.m +10 -0
  74. package/Examples/SampleUI/ios/SampleUI.xcodeproj/project.pbxproj +785 -0
  75. package/Examples/SampleUI/ios/SampleUI.xcodeproj/xcshareddata/xcschemes/SampleUI.xcscheme +88 -0
  76. package/Examples/SampleUI/ios/SampleUI.xcworkspace/contents.xcworkspacedata +10 -0
  77. package/Examples/SampleUI/ios/SampleUITests/Info.plist +24 -0
  78. package/Examples/SampleUI/ios/SampleUITests/SampleUITests.m +66 -0
  79. package/Examples/SampleUI/jest.config.js +3 -0
  80. package/Examples/SampleUI/metro.config.js +53 -0
  81. package/Examples/SampleUI/package-lock.json +17033 -0
  82. package/Examples/SampleUI/package.json +62 -0
  83. package/Examples/SampleUI/src/DrawerItems.tsx +322 -0
  84. package/Examples/SampleUI/src/ExampleList.tsx +175 -0
  85. package/Examples/SampleUI/src/Examples/ActivityIndicatorExample.tsx +73 -0
  86. package/Examples/SampleUI/src/Examples/AnimatedFABExample/AnimatedFABExample.tsx +220 -0
  87. package/Examples/SampleUI/src/Examples/AnimatedFABExample/CustomFAB.tsx +70 -0
  88. package/Examples/SampleUI/src/Examples/AnimatedFABExample/CustomFABControls.tsx +146 -0
  89. package/Examples/SampleUI/src/Examples/AnimatedFABExample/index.ts +1 -0
  90. package/Examples/SampleUI/src/Examples/AppbarExample.tsx +263 -0
  91. package/Examples/SampleUI/src/Examples/AvatarExample.tsx +76 -0
  92. package/Examples/SampleUI/src/Examples/BadgeExample.tsx +97 -0
  93. package/Examples/SampleUI/src/Examples/BannerExample.tsx +152 -0
  94. package/Examples/SampleUI/src/Examples/BottomNavigationBarExample.tsx +94 -0
  95. package/Examples/SampleUI/src/Examples/BottomNavigationExample.tsx +205 -0
  96. package/Examples/SampleUI/src/Examples/ButtonExample.tsx +405 -0
  97. package/Examples/SampleUI/src/Examples/CardExample.tsx +245 -0
  98. package/Examples/SampleUI/src/Examples/CheckboxExample.tsx +87 -0
  99. package/Examples/SampleUI/src/Examples/CheckboxItemExample.tsx +72 -0
  100. package/Examples/SampleUI/src/Examples/ChipExample.tsx +432 -0
  101. package/Examples/SampleUI/src/Examples/DataTableExample.tsx +128 -0
  102. package/Examples/SampleUI/src/Examples/DialogExample.tsx +131 -0
  103. package/Examples/SampleUI/src/Examples/Dialogs/DialogTextComponent.tsx +31 -0
  104. package/Examples/SampleUI/src/Examples/Dialogs/DialogWithCustomColors.tsx +57 -0
  105. package/Examples/SampleUI/src/Examples/Dialogs/DialogWithDismissableBackButton.tsx +38 -0
  106. package/Examples/SampleUI/src/Examples/Dialogs/DialogWithIcon.tsx +42 -0
  107. package/Examples/SampleUI/src/Examples/Dialogs/DialogWithLoadingIndicator.tsx +48 -0
  108. package/Examples/SampleUI/src/Examples/Dialogs/DialogWithLongText.tsx +81 -0
  109. package/Examples/SampleUI/src/Examples/Dialogs/DialogWithRadioBtns.tsx +111 -0
  110. package/Examples/SampleUI/src/Examples/Dialogs/UndismissableDialog.tsx +30 -0
  111. package/Examples/SampleUI/src/Examples/Dialogs/index.tsx +7 -0
  112. package/Examples/SampleUI/src/Examples/DividerExample.tsx +30 -0
  113. package/Examples/SampleUI/src/Examples/FABExample.tsx +226 -0
  114. package/Examples/SampleUI/src/Examples/IconButtonExample.tsx +230 -0
  115. package/Examples/SampleUI/src/Examples/IconExample.tsx +50 -0
  116. package/Examples/SampleUI/src/Examples/ListAccordionExample.tsx +65 -0
  117. package/Examples/SampleUI/src/Examples/ListAccordionGroupExample.tsx +80 -0
  118. package/Examples/SampleUI/src/Examples/ListItemExample.tsx +310 -0
  119. package/Examples/SampleUI/src/Examples/ListSectionExample.tsx +159 -0
  120. package/Examples/SampleUI/src/Examples/MaterialBottomTabNavigatorExample.tsx +87 -0
  121. package/Examples/SampleUI/src/Examples/MenuExample.tsx +211 -0
  122. package/Examples/SampleUI/src/Examples/ProgressBarExample.tsx +142 -0
  123. package/Examples/SampleUI/src/Examples/RadioButtonExample.tsx +104 -0
  124. package/Examples/SampleUI/src/Examples/RadioButtonGroupExample.tsx +67 -0
  125. package/Examples/SampleUI/src/Examples/RadioButtonItemExample.tsx +77 -0
  126. package/Examples/SampleUI/src/Examples/SearchbarExample.tsx +249 -0
  127. package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonCustomColorCheck.tsx +93 -0
  128. package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonDefault.tsx +49 -0
  129. package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonDisabled.tsx +47 -0
  130. package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonMultiselect.tsx +50 -0
  131. package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonMultiselectIcons.tsx +49 -0
  132. package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonMultiselectRealCase.tsx +114 -0
  133. package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonOnlyIcons.tsx +40 -0
  134. package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonOnlyIconsWithCheck.tsx +43 -0
  135. package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonRealCase.tsx +97 -0
  136. package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonWithDensity.tsx +47 -0
  137. package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonWithSelectedCheck.tsx +52 -0
  138. package/Examples/SampleUI/src/Examples/SegmentedButtons/index.ts +9 -0
  139. package/Examples/SampleUI/src/Examples/SegmentedButtonsExample.tsx +57 -0
  140. package/Examples/SampleUI/src/Examples/SnackbarExample.tsx +141 -0
  141. package/Examples/SampleUI/src/Examples/SurfaceExample.tsx +130 -0
  142. package/Examples/SampleUI/src/Examples/SwitchExample.tsx +105 -0
  143. package/Examples/SampleUI/src/Examples/TeamDetails.tsx +291 -0
  144. package/Examples/SampleUI/src/Examples/TeamsList.tsx +57 -0
  145. package/Examples/SampleUI/src/Examples/TextExample.tsx +132 -0
  146. package/Examples/SampleUI/src/Examples/TextInputExample.tsx +914 -0
  147. package/Examples/SampleUI/src/Examples/ThemeExample.tsx +41 -0
  148. package/Examples/SampleUI/src/Examples/ThemingWithReactNavigation.tsx +75 -0
  149. package/Examples/SampleUI/src/Examples/ToggleButtonExample.tsx +128 -0
  150. package/Examples/SampleUI/src/Examples/TooltipExample.tsx +191 -0
  151. package/Examples/SampleUI/src/Examples/TouchableRippleExample.tsx +37 -0
  152. package/Examples/SampleUI/src/RootNavigator.tsx +86 -0
  153. package/Examples/SampleUI/src/ScreenWrapper.tsx +67 -0
  154. package/Examples/SampleUI/src/components/ActivityIndicator.tsx +254 -0
  155. package/Examples/SampleUI/src/components/Appbar/Appbar.tsx +364 -0
  156. package/Examples/SampleUI/src/components/Appbar/AppbarAction.tsx +132 -0
  157. package/Examples/SampleUI/src/components/Appbar/AppbarBackAction.tsx +77 -0
  158. package/Examples/SampleUI/src/components/Appbar/AppbarBackIcon.tsx +52 -0
  159. package/Examples/SampleUI/src/components/Appbar/AppbarContent.tsx +249 -0
  160. package/Examples/SampleUI/src/components/Appbar/AppbarHeader.tsx +174 -0
  161. package/Examples/SampleUI/src/components/Appbar/index.ts +22 -0
  162. package/Examples/SampleUI/src/components/Appbar/utils.ts +188 -0
  163. package/Examples/SampleUI/src/components/Avatar/Avatar.tsx +8 -0
  164. package/Examples/SampleUI/src/components/Avatar/AvatarIcon.tsx +87 -0
  165. package/Examples/SampleUI/src/components/Avatar/AvatarImage.tsx +128 -0
  166. package/Examples/SampleUI/src/components/Avatar/AvatarText.tsx +127 -0
  167. package/Examples/SampleUI/src/components/Badge.tsx +138 -0
  168. package/Examples/SampleUI/src/components/Banner.tsx +302 -0
  169. package/Examples/SampleUI/src/components/BottomNavigation/BottomNavigation.tsx +643 -0
  170. package/Examples/SampleUI/src/components/BottomNavigation/BottomNavigationBar.tsx +1039 -0
  171. package/Examples/SampleUI/src/components/BottomNavigation/BottomNavigationRouteScreen.tsx +31 -0
  172. package/Examples/SampleUI/src/components/BottomNavigation/utils.ts +70 -0
  173. package/Examples/SampleUI/src/components/Button/Button.tsx +503 -0
  174. package/Examples/SampleUI/src/components/Button/utils.tsx +272 -0
  175. package/Examples/SampleUI/src/components/Card/Card.tsx +373 -0
  176. package/Examples/SampleUI/src/components/Card/CardActions.tsx +74 -0
  177. package/Examples/SampleUI/src/components/Card/CardContent.tsx +99 -0
  178. package/Examples/SampleUI/src/components/Card/CardCover.tsx +96 -0
  179. package/Examples/SampleUI/src/components/Card/CardTitle.tsx +236 -0
  180. package/Examples/SampleUI/src/components/Card/utils.tsx +110 -0
  181. package/Examples/SampleUI/src/components/Checkbox/Checkbox.tsx +78 -0
  182. package/Examples/SampleUI/src/components/Checkbox/CheckboxAndroid.tsx +180 -0
  183. package/Examples/SampleUI/src/components/Checkbox/CheckboxIOS.tsx +104 -0
  184. package/Examples/SampleUI/src/components/Checkbox/CheckboxItem.tsx +236 -0
  185. package/Examples/SampleUI/src/components/Checkbox/index.ts +19 -0
  186. package/Examples/SampleUI/src/components/Checkbox/utils.ts +183 -0
  187. package/Examples/SampleUI/src/components/Chip/Chip.tsx +513 -0
  188. package/Examples/SampleUI/src/components/Chip/helpers.tsx +322 -0
  189. package/Examples/SampleUI/src/components/CrossFadeIcon.tsx +140 -0
  190. package/Examples/SampleUI/src/components/DataTable/DataTable.tsx +138 -0
  191. package/Examples/SampleUI/src/components/DataTable/DataTableCell.tsx +132 -0
  192. package/Examples/SampleUI/src/components/DataTable/DataTableHeader.tsx +82 -0
  193. package/Examples/SampleUI/src/components/DataTable/DataTablePagination.tsx +407 -0
  194. package/Examples/SampleUI/src/components/DataTable/DataTableRow.tsx +107 -0
  195. package/Examples/SampleUI/src/components/DataTable/DataTableTitle.tsx +208 -0
  196. package/Examples/SampleUI/src/components/Dialog/Dialog.tsx +191 -0
  197. package/Examples/SampleUI/src/components/Dialog/DialogActions.tsx +94 -0
  198. package/Examples/SampleUI/src/components/Dialog/DialogContent.tsx +54 -0
  199. package/Examples/SampleUI/src/components/Dialog/DialogIcon.tsx +100 -0
  200. package/Examples/SampleUI/src/components/Dialog/DialogScrollArea.tsx +88 -0
  201. package/Examples/SampleUI/src/components/Dialog/DialogTitle.tsx +94 -0
  202. package/Examples/SampleUI/src/components/Divider.tsx +102 -0
  203. package/Examples/SampleUI/src/components/Drawer/Drawer.tsx +8 -0
  204. package/Examples/SampleUI/src/components/Drawer/DrawerCollapsedItem.tsx +282 -0
  205. package/Examples/SampleUI/src/components/Drawer/DrawerItem.tsx +209 -0
  206. package/Examples/SampleUI/src/components/Drawer/DrawerSection.tsx +138 -0
  207. package/Examples/SampleUI/src/components/FAB/AnimatedFAB.tsx +619 -0
  208. package/Examples/SampleUI/src/components/FAB/FAB.tsx +371 -0
  209. package/Examples/SampleUI/src/components/FAB/FABGroup.tsx +532 -0
  210. package/Examples/SampleUI/src/components/FAB/index.ts +13 -0
  211. package/Examples/SampleUI/src/components/FAB/utils.ts +474 -0
  212. package/Examples/SampleUI/src/components/HelperText/HelperText.tsx +168 -0
  213. package/Examples/SampleUI/src/components/HelperText/utils.ts +30 -0
  214. package/Examples/SampleUI/src/components/Icon.tsx +170 -0
  215. package/Examples/SampleUI/src/components/IconButton/IconButton.tsx +234 -0
  216. package/Examples/SampleUI/src/components/IconButton/utils.ts +190 -0
  217. package/Examples/SampleUI/src/components/List/List.tsx +20 -0
  218. package/Examples/SampleUI/src/components/List/ListAccordion.tsx +391 -0
  219. package/Examples/SampleUI/src/components/List/ListAccordionGroup.tsx +88 -0
  220. package/Examples/SampleUI/src/components/List/ListIcon.tsx +79 -0
  221. package/Examples/SampleUI/src/components/List/ListImage.tsx +89 -0
  222. package/Examples/SampleUI/src/components/List/ListItem.tsx +313 -0
  223. package/Examples/SampleUI/src/components/List/ListSection.tsx +87 -0
  224. package/Examples/SampleUI/src/components/List/ListSubheader.tsx +79 -0
  225. package/Examples/SampleUI/src/components/List/utils.ts +113 -0
  226. package/Examples/SampleUI/src/components/MaterialCommunityIcon.tsx +121 -0
  227. package/Examples/SampleUI/src/components/Menu/Menu.tsx +711 -0
  228. package/Examples/SampleUI/src/components/Menu/MenuItem.tsx +257 -0
  229. package/Examples/SampleUI/src/components/Menu/utils.ts +110 -0
  230. package/Examples/SampleUI/src/components/Modal.tsx +245 -0
  231. package/Examples/SampleUI/src/components/Portal/Portal.tsx +69 -0
  232. package/Examples/SampleUI/src/components/Portal/PortalConsumer.tsx +44 -0
  233. package/Examples/SampleUI/src/components/Portal/PortalHost.tsx +143 -0
  234. package/Examples/SampleUI/src/components/Portal/PortalManager.tsx +54 -0
  235. package/Examples/SampleUI/src/components/ProgressBar.tsx +292 -0
  236. package/Examples/SampleUI/src/components/RadioButton/RadioButton.tsx +86 -0
  237. package/Examples/SampleUI/src/components/RadioButton/RadioButtonAndroid.tsx +202 -0
  238. package/Examples/SampleUI/src/components/RadioButton/RadioButtonGroup.tsx +67 -0
  239. package/Examples/SampleUI/src/components/RadioButton/RadioButtonIOS.tsx +130 -0
  240. package/Examples/SampleUI/src/components/RadioButton/RadioButtonItem.tsx +268 -0
  241. package/Examples/SampleUI/src/components/RadioButton/index.ts +22 -0
  242. package/Examples/SampleUI/src/components/RadioButton/utils.ts +37 -0
  243. package/Examples/SampleUI/src/components/Searchbar.tsx +459 -0
  244. package/Examples/SampleUI/src/components/SegmentedButtons/SegmentedButtonItem.tsx +271 -0
  245. package/Examples/SampleUI/src/components/SegmentedButtons/SegmentedButtons.tsx +197 -0
  246. package/Examples/SampleUI/src/components/SegmentedButtons/utils.ts +179 -0
  247. package/Examples/SampleUI/src/components/Snackbar.tsx +430 -0
  248. package/Examples/SampleUI/src/components/Surface.tsx +376 -0
  249. package/Examples/SampleUI/src/components/Switch/Switch.tsx +108 -0
  250. package/Examples/SampleUI/src/components/Switch/utils.ts +113 -0
  251. package/Examples/SampleUI/src/components/TextInput/Addons/Outline.tsx +64 -0
  252. package/Examples/SampleUI/src/components/TextInput/Addons/Underline.tsx +78 -0
  253. package/Examples/SampleUI/src/components/TextInput/Adornment/TextInputAdornment.tsx +208 -0
  254. package/Examples/SampleUI/src/components/TextInput/Adornment/TextInputAffix.tsx +212 -0
  255. package/Examples/SampleUI/src/components/TextInput/Adornment/TextInputIcon.tsx +195 -0
  256. package/Examples/SampleUI/src/components/TextInput/Adornment/enums.tsx +12 -0
  257. package/Examples/SampleUI/src/components/TextInput/Adornment/types.tsx +11 -0
  258. package/Examples/SampleUI/src/components/TextInput/Adornment/utils.ts +48 -0
  259. package/Examples/SampleUI/src/components/TextInput/Label/InputLabel.tsx +217 -0
  260. package/Examples/SampleUI/src/components/TextInput/Label/LabelBackground.tsx +100 -0
  261. package/Examples/SampleUI/src/components/TextInput/TextInput.tsx +572 -0
  262. package/Examples/SampleUI/src/components/TextInput/TextInputFlat.tsx +475 -0
  263. package/Examples/SampleUI/src/components/TextInput/TextInputOutlined.tsx +450 -0
  264. package/Examples/SampleUI/src/components/TextInput/constants.tsx +48 -0
  265. package/Examples/SampleUI/src/components/TextInput/helpers.tsx +612 -0
  266. package/Examples/SampleUI/src/components/TextInput/types.tsx +155 -0
  267. package/Examples/SampleUI/src/components/ToggleButton/ToggleButton.tsx +187 -0
  268. package/Examples/SampleUI/src/components/ToggleButton/ToggleButtonGroup.tsx +72 -0
  269. package/Examples/SampleUI/src/components/ToggleButton/ToggleButtonRow.tsx +107 -0
  270. package/Examples/SampleUI/src/components/ToggleButton/index.ts +16 -0
  271. package/Examples/SampleUI/src/components/ToggleButton/utils.ts +26 -0
  272. package/Examples/SampleUI/src/components/Tooltip/Tooltip.tsx +249 -0
  273. package/Examples/SampleUI/src/components/Tooltip/utils.ts +129 -0
  274. package/Examples/SampleUI/src/components/TouchableRipple/Pressable.tsx +41 -0
  275. package/Examples/SampleUI/src/components/TouchableRipple/TouchableRipple.native.tsx +145 -0
  276. package/Examples/SampleUI/src/components/TouchableRipple/TouchableRipple.tsx +317 -0
  277. package/Examples/SampleUI/src/components/TouchableRipple/utils.ts +66 -0
  278. package/Examples/SampleUI/src/components/Typography/AnimatedText.tsx +107 -0
  279. package/Examples/SampleUI/src/components/Typography/Text.tsx +184 -0
  280. package/Examples/SampleUI/src/components/Typography/types.tsx +5 -0
  281. package/Examples/SampleUI/src/components/Typography/v2/Caption.tsx +50 -0
  282. package/Examples/SampleUI/src/components/Typography/v2/Headline.tsx +52 -0
  283. package/Examples/SampleUI/src/components/Typography/v2/Paragraph.tsx +49 -0
  284. package/Examples/SampleUI/src/components/Typography/v2/StyledText.tsx +56 -0
  285. package/Examples/SampleUI/src/components/Typography/v2/Subheading.tsx +50 -0
  286. package/Examples/SampleUI/src/components/Typography/v2/Text.tsx +62 -0
  287. package/Examples/SampleUI/src/components/Typography/v2/Title.tsx +49 -0
  288. package/Examples/SampleUI/src/components/Typography/v2/index.ts +5 -0
  289. package/Examples/SampleUI/src/core/PaperProvider.tsx +122 -0
  290. package/Examples/SampleUI/src/core/SafeAreaProviderCompat.tsx +65 -0
  291. package/Examples/SampleUI/src/core/settings.tsx +23 -0
  292. package/Examples/SampleUI/src/core/theming.tsx +170 -0
  293. package/Examples/SampleUI/src/index.native.tsx +270 -0
  294. package/Examples/SampleUI/src/index.tsx +226 -0
  295. package/Examples/SampleUI/src/react-navigation/index.tsx +19 -0
  296. package/Examples/SampleUI/src/react-navigation/navigators/createMaterialBottomTabNavigator.tsx +72 -0
  297. package/Examples/SampleUI/src/react-navigation/types.tsx +126 -0
  298. package/Examples/SampleUI/src/react-navigation/views/MaterialBottomTabView.tsx +140 -0
  299. package/Examples/SampleUI/src/styles/__tests__/fonts.test.js +290 -0
  300. package/Examples/SampleUI/src/styles/fonts.tsx +143 -0
  301. package/Examples/SampleUI/src/styles/overlay.tsx +70 -0
  302. package/Examples/SampleUI/src/styles/shadow.tsx +109 -0
  303. package/Examples/SampleUI/src/styles/themes/index.ts +4 -0
  304. package/Examples/SampleUI/src/styles/themes/v2/DarkTheme.tsx +30 -0
  305. package/Examples/SampleUI/src/styles/themes/v2/LightTheme.tsx +30 -0
  306. package/Examples/SampleUI/src/styles/themes/v2/colors.tsx +277 -0
  307. package/Examples/SampleUI/src/styles/themes/v3/DarkTheme.tsx +66 -0
  308. package/Examples/SampleUI/src/styles/themes/v3/LightTheme.tsx +69 -0
  309. package/Examples/SampleUI/src/styles/themes/v3/tokens.tsx +230 -0
  310. package/Examples/SampleUI/src/utils/BackHandler/BackHandler.native.tsx +3 -0
  311. package/Examples/SampleUI/src/utils/BackHandler/BackHandler.tsx +11 -0
  312. package/Examples/SampleUI/src/utils/addEventListener.tsx +56 -0
  313. package/Examples/SampleUI/src/utils/forwardRef.tsx +23 -0
  314. package/Examples/SampleUI/src/utils/getContrastingColor.tsx +15 -0
  315. package/Examples/SampleUI/src/utils/hasTouchHandler.tsx +23 -0
  316. package/Examples/SampleUI/src/utils/roundLayoutSize.ts +2 -0
  317. package/Examples/SampleUI/src/utils/splitStyles.ts +60 -0
  318. package/Examples/SampleUI/src/utils/useAnimatedValue.tsx +9 -0
  319. package/Examples/SampleUI/src/utils/useAnimatedValueArray.tsx +13 -0
  320. package/Examples/SampleUI/src/utils/useIsKeyboardShown.tsx +55 -0
  321. package/Examples/SampleUI/src/utils/useLayout.tsx +29 -0
  322. package/Examples/SampleUI/src/utils/useLazyRef.tsx +11 -0
  323. package/Examples/SampleUI/tsconfig.json +3 -0
  324. package/Examples/SampleUI/utils/index.ts +1426 -0
  325. package/lib/typescript/jslib/TLTRN.d.ts +5 -5
  326. package/lib/typescript/jslib/TLTRN.d.ts.map +1 -1
  327. package/package.json +7 -2
@@ -0,0 +1,914 @@
1
+ import * as React from 'react';
2
+ import {
3
+ KeyboardAvoidingView,
4
+ Platform,
5
+ StyleSheet,
6
+ Text,
7
+ View,
8
+ } from 'react-native';
9
+
10
+ import { useFonts } from 'expo-font';
11
+ import {
12
+ configureFonts,
13
+ HelperText,
14
+ List,
15
+ MD2Colors,
16
+ MD3Colors,
17
+ TextInput,
18
+ } from 'react-native-paper';
19
+ import Icon from 'react-native-vector-icons/FontAwesome';
20
+
21
+ import { useExampleTheme } from '..';
22
+ import { inputReducer, State } from '../../utils';
23
+ import ScreenWrapper from '../ScreenWrapper';
24
+
25
+ const MAX_LENGTH = 20;
26
+
27
+ const initialState: State = {
28
+ text: '',
29
+ customIconText: '',
30
+ name: '',
31
+ outlinedText: '',
32
+ largeText: '',
33
+ flatTextPassword: 'Password',
34
+ flatLongText:
35
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae odio quis dolor tempor mattis at non sem. Suspendisse et sem tincidunt, accumsan massa eleifend, euismod dui. Praesent eget urna lectus.',
36
+ outlinedLargeText: '',
37
+ outlinedCustomLabel: '',
38
+ outlinedTextPassword: '',
39
+ outlinedLongText:
40
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae odio quis dolor tempor mattis at non sem. Suspendisse et sem tincidunt, accumsan massa eleifend, euismod dui. Praesent eget urna lectus.',
41
+ nameNoPadding: '',
42
+ customStyleText: '',
43
+ nameRequired: '',
44
+ flatDenseText: '',
45
+ flatDense: '',
46
+ outlinedDenseText: '',
47
+ outlinedDense: '',
48
+ flatMultiline: '',
49
+ flatTextArea: '',
50
+ flatUnderlineColors: '',
51
+ outlinedMultiline: '',
52
+ outlinedTextArea: '',
53
+ outlinedColors: '',
54
+ outlinedLongLabel: '',
55
+ maxLengthName: '',
56
+ flatTextSecureEntry: true,
57
+ outlineTextSecureEntry: true,
58
+ iconsColor: {
59
+ flatLeftIcon: undefined,
60
+ flatRightIcon: undefined,
61
+ outlineLeftIcon: undefined,
62
+ outlineRightIcon: undefined,
63
+ customIcon: undefined,
64
+ },
65
+ };
66
+
67
+ type AvoidingViewProps = {
68
+ children: React.ReactNode;
69
+ };
70
+
71
+ type ExpandedId = string | number | undefined;
72
+
73
+ const TextInputAvoidingView = ({ children }: AvoidingViewProps) => {
74
+ return Platform.OS === 'ios' ? (
75
+ <KeyboardAvoidingView
76
+ style={styles.wrapper}
77
+ behavior="padding"
78
+ keyboardVerticalOffset={80}
79
+ >
80
+ {children}
81
+ </KeyboardAvoidingView>
82
+ ) : (
83
+ <>{children}</>
84
+ );
85
+ };
86
+
87
+ const TextInputExample = () => {
88
+ const [state, dispatch] = React.useReducer(inputReducer, initialState);
89
+ const {
90
+ text,
91
+ customIconText,
92
+ name,
93
+ outlinedText,
94
+ largeText,
95
+ flatTextPassword,
96
+ flatLongText,
97
+ outlinedLargeText,
98
+ outlinedCustomLabel,
99
+ outlinedTextPassword,
100
+ outlinedLongText,
101
+ nameNoPadding,
102
+ customStyleText,
103
+ nameRequired,
104
+ flatDenseText,
105
+ flatDense,
106
+ outlinedDenseText,
107
+ outlinedDense,
108
+ flatMultiline,
109
+ flatTextArea,
110
+ flatUnderlineColors,
111
+ outlinedMultiline,
112
+ outlinedTextArea,
113
+ outlinedColors,
114
+ maxLengthName,
115
+ flatTextSecureEntry,
116
+ outlineTextSecureEntry,
117
+ iconsColor: {
118
+ flatLeftIcon,
119
+ flatRightIcon,
120
+ outlineLeftIcon,
121
+ outlineRightIcon,
122
+ customIcon,
123
+ },
124
+ } = state;
125
+
126
+ const _isUsernameValid = (name: string) => /^[a-zA-Z]*$/.test(name);
127
+
128
+ const theme = useExampleTheme();
129
+
130
+ const inputActionHandler = (type: keyof State, payload: string) =>
131
+ dispatch({
132
+ type: type,
133
+ payload: payload,
134
+ });
135
+
136
+ const changeIconColor = (name: keyof State['iconsColor']) => {
137
+ const color = state.iconsColor[name];
138
+
139
+ const newColors = {
140
+ ...state.iconsColor,
141
+ [name]: !color
142
+ ? theme.isV3
143
+ ? theme.colors.primary
144
+ : theme.colors?.accent
145
+ : undefined,
146
+ };
147
+
148
+ dispatch({
149
+ type: 'iconsColor',
150
+ payload: newColors,
151
+ });
152
+ };
153
+
154
+ const [fontsLoaded] = useFonts({
155
+ Abel: require('../../assets/fonts/Abel-Regular.ttf'),
156
+ });
157
+
158
+ const [expandedId, setExpandedId] = React.useState<ExpandedId>('flat');
159
+
160
+ const onAccordionPress = (id: string | number) =>
161
+ setExpandedId(expandedId === id ? undefined : id);
162
+
163
+ return (
164
+ <TextInputAvoidingView>
165
+ <ScreenWrapper
166
+ keyboardShouldPersistTaps={'always'}
167
+ removeClippedSubviews={false}
168
+ >
169
+ <List.AccordionGroup
170
+ expandedId={expandedId}
171
+ onAccordionPress={onAccordionPress}
172
+ >
173
+ <List.Accordion title="Flat inputs" id="flat">
174
+ <TextInput
175
+ style={styles.inputContainerStyle}
176
+ label="Flat input"
177
+ placeholder="Type something"
178
+ value={text}
179
+ onChangeText={(text) => inputActionHandler('text', text)}
180
+ left={
181
+ <TextInput.Icon
182
+ icon="magnify"
183
+ color={flatLeftIcon}
184
+ onPress={() => {
185
+ changeIconColor('flatLeftIcon');
186
+ }}
187
+ />
188
+ }
189
+ maxLength={100}
190
+ right={<TextInput.Affix text={`${text.length}/100`} />}
191
+ />
192
+ <TextInput
193
+ style={styles.inputContainerStyle}
194
+ label="Flat input with custom icon"
195
+ placeholder="Type something"
196
+ value={customIconText}
197
+ onChangeText={(text) =>
198
+ inputActionHandler('customIconText', text)
199
+ }
200
+ maxLength={100}
201
+ right={<TextInput.Affix text={`${customIconText.length}/100`} />}
202
+ left={
203
+ <TextInput.Icon
204
+ icon={() => (
205
+ <Icon
206
+ name="home"
207
+ size={24}
208
+ color={customIcon}
209
+ onPress={() => {
210
+ changeIconColor('customIcon');
211
+ }}
212
+ />
213
+ )}
214
+ />
215
+ }
216
+ />
217
+ <TextInput
218
+ style={[styles.inputContainerStyle, styles.fontSize]}
219
+ label="Flat input large font"
220
+ placeholder="Type something"
221
+ value={largeText}
222
+ onChangeText={(largeText) =>
223
+ inputActionHandler('largeText', largeText)
224
+ }
225
+ left={<TextInput.Affix text="#" />}
226
+ right={
227
+ <TextInput.Icon
228
+ icon="magnify"
229
+ color={flatRightIcon}
230
+ onPress={() => {
231
+ changeIconColor('flatRightIcon');
232
+ }}
233
+ />
234
+ }
235
+ />
236
+ <TextInput
237
+ style={[styles.inputContainerStyle, styles.fontSize]}
238
+ label="Flat input large font"
239
+ placeholder="Type something"
240
+ value={flatTextPassword}
241
+ onChangeText={(flatTextPassword) =>
242
+ inputActionHandler('flatTextPassword', flatTextPassword)
243
+ }
244
+ secureTextEntry={flatTextSecureEntry}
245
+ right={
246
+ <TextInput.Icon
247
+ icon={flatTextSecureEntry ? 'eye' : 'eye-off'}
248
+ onPress={() =>
249
+ dispatch({
250
+ type: 'flatTextSecureEntry',
251
+ payload: !flatTextSecureEntry,
252
+ })
253
+ }
254
+ forceTextInputFocus={false}
255
+ />
256
+ }
257
+ />
258
+ <TextInput
259
+ style={[
260
+ styles.inputContainerStyle,
261
+ styles.fixedHeight,
262
+ styles.autoText,
263
+ ]}
264
+ label="Flat input long text"
265
+ placeholder="Type something"
266
+ value={flatLongText}
267
+ onChangeText={(flatLongText) =>
268
+ inputActionHandler('flatLongText', flatLongText)
269
+ }
270
+ />
271
+ </List.Accordion>
272
+ <List.Accordion title="Outlined inputs" id="outlined">
273
+ <TextInput
274
+ mode="outlined"
275
+ style={styles.inputContainerStyle}
276
+ label="Outlined input"
277
+ placeholder="Type something"
278
+ value={outlinedText}
279
+ onChangeText={(outlinedText) =>
280
+ inputActionHandler('outlinedText', outlinedText)
281
+ }
282
+ left={
283
+ <TextInput.Icon
284
+ icon="magnify"
285
+ color={outlineLeftIcon}
286
+ onPress={() => {
287
+ changeIconColor('outlineLeftIcon');
288
+ }}
289
+ />
290
+ }
291
+ maxLength={100}
292
+ right={<TextInput.Affix text={`${outlinedText.length}/100`} />}
293
+ />
294
+ <TextInput
295
+ mode="outlined"
296
+ style={[styles.inputContainerStyle, styles.fontSize]}
297
+ label="Outlined large font"
298
+ placeholder="Type something"
299
+ value={outlinedLargeText}
300
+ onChangeText={(outlinedLargeText) =>
301
+ inputActionHandler('outlinedLargeText', outlinedLargeText)
302
+ }
303
+ left={<TextInput.Affix text="$" />}
304
+ right={
305
+ <TextInput.Icon
306
+ icon="magnify"
307
+ color={outlineRightIcon}
308
+ onPress={() => {
309
+ changeIconColor('outlineRightIcon');
310
+ }}
311
+ />
312
+ }
313
+ />
314
+ <TextInput
315
+ mode="outlined"
316
+ style={[styles.inputContainerStyle, styles.fontSize]}
317
+ label={<Text style={styles.inputLabelText}>Custom label</Text>}
318
+ placeholder="Type something"
319
+ value={outlinedCustomLabel}
320
+ onChangeText={(outlinedCustomLabel) =>
321
+ inputActionHandler('outlinedCustomLabel', outlinedCustomLabel)
322
+ }
323
+ />
324
+ <TextInput
325
+ mode="outlined"
326
+ style={[styles.inputContainerStyle, styles.fontSize]}
327
+ label="Outlined large font"
328
+ placeholder="Type something"
329
+ value={outlinedTextPassword}
330
+ onChangeText={(outlinedTextPassword) =>
331
+ inputActionHandler('outlinedTextPassword', outlinedTextPassword)
332
+ }
333
+ secureTextEntry={outlineTextSecureEntry}
334
+ right={
335
+ <TextInput.Icon
336
+ icon={outlineTextSecureEntry ? 'eye' : 'eye-off'}
337
+ onPress={() =>
338
+ dispatch({
339
+ type: 'outlineTextSecureEntry',
340
+ payload: !outlineTextSecureEntry,
341
+ })
342
+ }
343
+ />
344
+ }
345
+ />
346
+ <TextInput
347
+ mode="outlined"
348
+ style={[
349
+ styles.inputContainerStyle,
350
+ styles.fixedHeight,
351
+ styles.autoText,
352
+ ]}
353
+ label="Outlined input long text"
354
+ placeholder="Type something"
355
+ value={outlinedLongText}
356
+ onChangeText={(outlinedLongText) =>
357
+ inputActionHandler('outlinedLongText', outlinedLongText)
358
+ }
359
+ />
360
+ </List.Accordion>
361
+ <List.Accordion title="Disabled inputs" id="disabled">
362
+ <TextInput
363
+ disabled
364
+ style={styles.inputContainerStyle}
365
+ label="Disabled flat input"
366
+ />
367
+ <TextInput
368
+ disabled
369
+ style={styles.inputContainerStyle}
370
+ label="Disabled flat input with value"
371
+ value="Disabled flat input value"
372
+ />
373
+ <TextInput
374
+ style={styles.inputContainerStyle}
375
+ label="Flat input"
376
+ disabled
377
+ value="Disabled flat input with adornments"
378
+ left={
379
+ <TextInput.Icon
380
+ icon="magnify"
381
+ color={flatLeftIcon}
382
+ onPress={() => {
383
+ changeIconColor('flatLeftIcon');
384
+ }}
385
+ />
386
+ }
387
+ right={<TextInput.Affix text="/100" />}
388
+ />
389
+ <TextInput
390
+ mode="outlined"
391
+ disabled
392
+ style={styles.inputContainerStyle}
393
+ label="Disabled outlined input"
394
+ />
395
+ <TextInput
396
+ mode="outlined"
397
+ disabled
398
+ style={styles.inputContainerStyle}
399
+ label="Disabled outlined input"
400
+ value="Disabled outlined input with value"
401
+ />
402
+ <TextInput
403
+ style={styles.inputContainerStyle}
404
+ label="Flat input"
405
+ disabled
406
+ mode="outlined"
407
+ value="Disabled flat input with adornments"
408
+ left={
409
+ <TextInput.Icon
410
+ icon="magnify"
411
+ color={flatLeftIcon}
412
+ onPress={() => {
413
+ changeIconColor('flatLeftIcon');
414
+ }}
415
+ />
416
+ }
417
+ right={<TextInput.Affix text="/100" />}
418
+ />
419
+ </List.Accordion>
420
+ <List.Accordion title="Dense inputs" id="dense">
421
+ <TextInput
422
+ style={styles.inputContainerStyle}
423
+ dense
424
+ label="Dense flat input"
425
+ placeholder="Type something"
426
+ value={flatDenseText}
427
+ onChangeText={(flatDenseText) =>
428
+ inputActionHandler('flatDenseText', flatDenseText)
429
+ }
430
+ left={<TextInput.Affix text="#" />}
431
+ right={
432
+ <TextInput.Icon
433
+ icon="chevron-up"
434
+ color={(focused) =>
435
+ focused ? theme.colors?.primary : undefined
436
+ }
437
+ />
438
+ }
439
+ />
440
+ <TextInput
441
+ style={styles.inputContainerStyle}
442
+ dense
443
+ placeholder="Dense flat input without label"
444
+ value={flatDense}
445
+ onChangeText={(flatDense) =>
446
+ inputActionHandler('flatDense', flatDense)
447
+ }
448
+ />
449
+ <TextInput
450
+ mode="outlined"
451
+ style={styles.inputContainerStyle}
452
+ dense
453
+ label="Dense outlined input"
454
+ placeholder="Type something"
455
+ value={outlinedDenseText}
456
+ onChangeText={(outlinedDenseText) =>
457
+ inputActionHandler('outlinedDenseText', outlinedDenseText)
458
+ }
459
+ left={<TextInput.Affix text="$" />}
460
+ />
461
+ <TextInput
462
+ mode="outlined"
463
+ style={styles.inputContainerStyle}
464
+ dense
465
+ placeholder="Dense outlined input without label"
466
+ value={outlinedDense}
467
+ onChangeText={(outlinedDense) =>
468
+ inputActionHandler('outlinedDense', outlinedDense)
469
+ }
470
+ />
471
+ </List.Accordion>
472
+ <List.Accordion title="Multiline inputs" id="multiline">
473
+ <TextInput
474
+ style={styles.inputContainerStyle}
475
+ label="Flat input multiline"
476
+ multiline
477
+ placeholder="Type something"
478
+ value={flatMultiline}
479
+ onChangeText={(flatMultiline) =>
480
+ inputActionHandler('flatMultiline', flatMultiline)
481
+ }
482
+ />
483
+ <TextInput
484
+ style={[styles.inputContainerStyle, styles.textArea]}
485
+ label="Flat input text area"
486
+ multiline
487
+ placeholder="Type something"
488
+ value={flatTextArea}
489
+ onChangeText={(flatTextArea) =>
490
+ inputActionHandler('flatTextArea', flatTextArea)
491
+ }
492
+ />
493
+ <View style={styles.inputContainerStyle}>
494
+ <TextInput
495
+ mode="flat"
496
+ label="Flat multiline text input with fixed height"
497
+ multiline
498
+ style={styles.fixedHeight}
499
+ />
500
+ </View>
501
+ <TextInput
502
+ mode="outlined"
503
+ style={styles.inputContainerStyle}
504
+ label="Outlined input multiline"
505
+ multiline
506
+ placeholder="Type something"
507
+ value={outlinedMultiline}
508
+ onChangeText={(outlinedMultiline) =>
509
+ inputActionHandler('outlinedMultiline', outlinedMultiline)
510
+ }
511
+ />
512
+ <TextInput
513
+ mode="outlined"
514
+ style={[styles.inputContainerStyle, styles.textArea]}
515
+ label="Outlined input text area"
516
+ multiline
517
+ placeholder="Type something"
518
+ value={outlinedTextArea}
519
+ onChangeText={(outlinedTextArea) =>
520
+ inputActionHandler('outlinedTextArea', outlinedTextArea)
521
+ }
522
+ />
523
+ <View style={styles.inputContainerStyle}>
524
+ <TextInput
525
+ mode="outlined"
526
+ label="Outlined multiline text input with fixed height"
527
+ multiline
528
+ style={styles.fixedHeight}
529
+ />
530
+ </View>
531
+ </List.Accordion>
532
+ <List.Accordion title="Inputs with helpers" id="withAddons">
533
+ <View style={styles.inputContainerStyle}>
534
+ <TextInput
535
+ label="Input with helper text"
536
+ placeholder="Enter username, only letters"
537
+ value={name}
538
+ error={!_isUsernameValid(name)}
539
+ onChangeText={(name) => inputActionHandler('name', name)}
540
+ />
541
+ <HelperText type="error" visible={!_isUsernameValid(name)}>
542
+ Error: Only letters are allowed
543
+ </HelperText>
544
+ </View>
545
+ <View style={styles.inputContainerStyle}>
546
+ <TextInput
547
+ label="Input with helper text and character counter"
548
+ placeholder="Enter username, only letters"
549
+ value={maxLengthName}
550
+ error={!_isUsernameValid(maxLengthName)}
551
+ onChangeText={(maxLengthName) =>
552
+ inputActionHandler('maxLengthName', maxLengthName)
553
+ }
554
+ maxLength={MAX_LENGTH}
555
+ />
556
+ <View style={styles.helpersWrapper}>
557
+ <HelperText
558
+ type="error"
559
+ visible={!_isUsernameValid(maxLengthName)}
560
+ style={styles.helper}
561
+ >
562
+ Error: Numbers and special characters are not allowed
563
+ </HelperText>
564
+ <HelperText type="info" visible style={styles.counterHelper}>
565
+ {maxLengthName.length} / {MAX_LENGTH}
566
+ </HelperText>
567
+ </View>
568
+ </View>
569
+ <View style={styles.inputContainerStyle}>
570
+ <TextInput
571
+ label={
572
+ <Text>
573
+ <Text
574
+ style={{
575
+ color: theme.isV3
576
+ ? MD3Colors.error50
577
+ : MD2Colors.red500,
578
+ }}
579
+ >
580
+ *
581
+ </Text>{' '}
582
+ Label as component
583
+ </Text>
584
+ }
585
+ style={styles.noPaddingInput}
586
+ placeholder="Enter username, required"
587
+ value={nameRequired}
588
+ error={!nameRequired}
589
+ onChangeText={(nameRequired) =>
590
+ inputActionHandler('nameRequired', nameRequired)
591
+ }
592
+ />
593
+ <HelperText type="error" padding="none" visible={!nameRequired}>
594
+ Error: Username is required
595
+ </HelperText>
596
+ </View>
597
+ </List.Accordion>
598
+ <List.Accordion title="Custom inputs" id="custom">
599
+ <TextInput
600
+ style={styles.inputContainerStyle}
601
+ label="Flat input with custom underline colors"
602
+ placeholder="Type something"
603
+ value={flatUnderlineColors}
604
+ onChangeText={(flatUnderlineColors) =>
605
+ inputActionHandler('flatUnderlineColors', flatUnderlineColors)
606
+ }
607
+ underlineColor={
608
+ theme.isV3 ? MD3Colors.primary70 : MD2Colors.pink400
609
+ }
610
+ activeUnderlineColor={
611
+ theme.isV3 ? MD3Colors.tertiary50 : MD2Colors.amber900
612
+ }
613
+ />
614
+ <TextInput
615
+ mode="outlined"
616
+ style={styles.inputContainerStyle}
617
+ label="Outlined input with custom outline colors"
618
+ placeholder="Type something"
619
+ value={outlinedColors}
620
+ onChangeText={(outlinedColors) =>
621
+ inputActionHandler('outlinedColors', outlinedColors)
622
+ }
623
+ outlineColor={
624
+ theme.isV3 ? MD3Colors.primary70 : MD2Colors.pink400
625
+ }
626
+ activeOutlineColor={
627
+ theme.isV3 ? MD3Colors.tertiary50 : MD2Colors.amber900
628
+ }
629
+ />
630
+ <TextInput
631
+ mode="outlined"
632
+ style={styles.inputContainerStyle}
633
+ label="Outlined with super long label which is truncating at some point"
634
+ placeholder="Type something"
635
+ onChangeText={(outlinedLongLabel) =>
636
+ inputActionHandler('outlinedLongLabel', outlinedLongLabel)
637
+ }
638
+ />
639
+
640
+ <TextInput
641
+ mode="flat"
642
+ style={styles.inputContainerStyle}
643
+ label="Custom style input"
644
+ placeholder="Input with custom style"
645
+ value={customStyleText}
646
+ onChangeText={(customStyleText) =>
647
+ inputActionHandler('customStyleText', customStyleText)
648
+ }
649
+ contentStyle={styles.inputContentStyle}
650
+ />
651
+
652
+ <View style={styles.inputContainerStyle}>
653
+ <TextInput
654
+ label="Input with no padding"
655
+ style={styles.noPaddingInput}
656
+ placeholder="Enter username, only letters"
657
+ value={nameNoPadding}
658
+ error={!_isUsernameValid(nameNoPadding)}
659
+ onChangeText={(nameNoPadding) =>
660
+ inputActionHandler('nameNoPadding', nameNoPadding)
661
+ }
662
+ />
663
+ <HelperText
664
+ type="error"
665
+ padding="none"
666
+ visible={!_isUsernameValid(nameNoPadding)}
667
+ >
668
+ Error: Only letters are allowed
669
+ </HelperText>
670
+ </View>
671
+
672
+ <View style={styles.inputContainerStyle}>
673
+ <TextInput
674
+ label="Input with text align center"
675
+ style={styles.centeredText}
676
+ activeUnderlineColor="transparent"
677
+ />
678
+ </View>
679
+ <View style={styles.inputContainerStyle}>
680
+ <TextInput
681
+ mode="outlined"
682
+ label="Outlined input with text align center"
683
+ style={styles.centeredText}
684
+ />
685
+ </View>
686
+ <View style={styles.inputContainerStyle}>
687
+ <TextInput
688
+ mode="outlined"
689
+ theme={{
690
+ roundness: 25,
691
+ }}
692
+ label="Outlined text input with custom roundness"
693
+ />
694
+ </View>
695
+ <View style={styles.inputContainerStyle}>
696
+ <TextInput
697
+ mode="outlined"
698
+ label="Outlined text input without roundness"
699
+ theme={{ roundness: 0 }}
700
+ />
701
+ </View>
702
+ <View style={styles.inputContainerStyle}>
703
+ <TextInput
704
+ mode="outlined"
705
+ label="Outlined text input with error"
706
+ error
707
+ />
708
+ </View>
709
+ <View style={styles.inputContainerStyle}>
710
+ <TextInput mode="outlined" placeholder="Outlined without label" />
711
+ </View>
712
+ <View style={styles.inputContainerStyle}>
713
+ <TextInput
714
+ mode="outlined"
715
+ label="Outlined input with custom cursor and selection colors"
716
+ selectionColor={'rgba(0,255,1,0.5)'}
717
+ cursorColor={'rgba(255,1,1,1)'}
718
+ placeholderTextColor={'rgba(255,0,125,1)'}
719
+ placeholder="Custom colors"
720
+ />
721
+ </View>
722
+ <View style={styles.inputContainerStyle}>
723
+ <TextInput
724
+ label="Flat input with custom cursor and selection colors"
725
+ selectionColor={'rgba(0,255,1,0.5)'}
726
+ cursorColor={'rgba(255,1,1,1)'}
727
+ placeholderTextColor={'rgba(255,0,125,1)'}
728
+ placeholder="Custom colors"
729
+ />
730
+ </View>
731
+ {fontsLoaded && theme.isV3 ? (
732
+ <View style={styles.inputContainerStyle}>
733
+ <TextInput
734
+ mode="outlined"
735
+ label="Text input with custom font"
736
+ placeholder="Custom font"
737
+ style={styles.fontSize}
738
+ theme={{
739
+ fonts: configureFonts({
740
+ config: {
741
+ fontFamily: 'Abel',
742
+ },
743
+ }),
744
+ }}
745
+ />
746
+ </View>
747
+ ) : null}
748
+ <View style={styles.row}>
749
+ <TextInput
750
+ mode="outlined"
751
+ label="CVV"
752
+ placeholder="CVV"
753
+ keyboardType="phone-pad"
754
+ maxLength={3}
755
+ />
756
+ </View>
757
+ <View style={styles.row}>
758
+ <TextInput
759
+ mode="flat"
760
+ label="CVV"
761
+ placeholder="CVV"
762
+ keyboardType="phone-pad"
763
+ maxLength={3}
764
+ />
765
+ </View>
766
+ <View style={styles.row}>
767
+ <TextInput
768
+ mode="outlined"
769
+ label="Code"
770
+ placeholder="Code"
771
+ keyboardType="phone-pad"
772
+ maxLength={4}
773
+ />
774
+ </View>
775
+ <View style={styles.row}>
776
+ <TextInput
777
+ mode="flat"
778
+ label="Code"
779
+ placeholder="Code"
780
+ keyboardType="phone-pad"
781
+ maxLength={4}
782
+ />
783
+ </View>
784
+ <View style={styles.row}>
785
+ <TextInput
786
+ mode="flat"
787
+ label="Month"
788
+ placeholder="Month"
789
+ style={styles.month}
790
+ />
791
+ <TextInput
792
+ mode="flat"
793
+ label="Year"
794
+ placeholder="Year"
795
+ keyboardType="phone-pad"
796
+ style={styles.year}
797
+ />
798
+ </View>
799
+ <View style={styles.row}>
800
+ <View style={styles.left}>
801
+ <TextInput
802
+ mode="flat"
803
+ label="Month of the car registration (optional)"
804
+ placeholder="Month"
805
+ style={styles.month}
806
+ />
807
+ </View>
808
+ <View style={styles.right}>
809
+ <TextInput
810
+ mode="flat"
811
+ label="Year of the car registration (optional)"
812
+ placeholder="Year"
813
+ keyboardType="phone-pad"
814
+ style={styles.year}
815
+ left={<TextInput.Icon icon="calendar" />}
816
+ />
817
+ </View>
818
+ </View>
819
+ <View style={styles.row}>
820
+ <View style={styles.left}>
821
+ <TextInput
822
+ mode="outlined"
823
+ label="Month of the car registration (optional)"
824
+ placeholder="Month"
825
+ style={styles.month}
826
+ />
827
+ </View>
828
+ <View style={styles.right}>
829
+ <TextInput
830
+ mode="outlined"
831
+ label="Year of the car registration (optional)"
832
+ placeholder="Year"
833
+ keyboardType="phone-pad"
834
+ style={styles.year}
835
+ right={<TextInput.Icon icon="calendar" />}
836
+ />
837
+ </View>
838
+ </View>
839
+ </List.Accordion>
840
+ </List.AccordionGroup>
841
+ </ScreenWrapper>
842
+ </TextInputAvoidingView>
843
+ );
844
+ };
845
+
846
+ TextInputExample.title = 'TextInput';
847
+
848
+ const styles = StyleSheet.create({
849
+ helpersWrapper: {
850
+ flexDirection: 'row',
851
+ justifyContent: 'space-between',
852
+ },
853
+ wrapper: {
854
+ flex: 1,
855
+ },
856
+ helper: {
857
+ flexShrink: 1,
858
+ },
859
+ counterHelper: {
860
+ textAlign: 'right',
861
+ },
862
+ inputContainerStyle: {
863
+ margin: 8,
864
+ },
865
+ inputContentStyle: {
866
+ paddingLeft: 50,
867
+ fontWeight: 'bold',
868
+ fontStyle: 'italic',
869
+ },
870
+ fontSize: {
871
+ fontSize: 32,
872
+ },
873
+ textArea: {
874
+ height: 80,
875
+ },
876
+ // eslint-disable-next-line react-native/no-color-literals
877
+ noPaddingInput: {
878
+ backgroundColor: 'transparent',
879
+ paddingHorizontal: 0,
880
+ },
881
+ centeredText: {
882
+ textAlign: 'center',
883
+ },
884
+ fixedHeight: {
885
+ height: 100,
886
+ },
887
+ row: {
888
+ margin: 8,
889
+ justifyContent: 'space-between',
890
+ flexDirection: 'row',
891
+ },
892
+ month: {
893
+ flex: 1,
894
+ marginRight: 4,
895
+ },
896
+ year: {
897
+ flex: 1,
898
+ marginLeft: 4,
899
+ },
900
+ inputLabelText: {
901
+ color: MD3Colors.tertiary70,
902
+ },
903
+ left: {
904
+ width: '30%',
905
+ },
906
+ right: {
907
+ width: '70%',
908
+ },
909
+ autoText: {
910
+ textAlign: 'auto',
911
+ },
912
+ });
913
+
914
+ export default TextInputExample;