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.
- package/Examples/SampleUI/.bundle/config +2 -0
- package/Examples/SampleUI/.eslintrc.js +4 -0
- package/Examples/SampleUI/.prettierrc.js +7 -0
- package/Examples/SampleUI/.watchmanconfig +1 -0
- package/Examples/SampleUI/App.js +1 -0
- package/Examples/SampleUI/Gemfile +10 -0
- package/Examples/SampleUI/Gemfile.lock +121 -0
- package/Examples/SampleUI/README.md +79 -0
- package/Examples/SampleUI/__tests__/App.test.tsx +17 -0
- package/Examples/SampleUI/android/app/build.gradle +124 -0
- package/Examples/SampleUI/android/app/debug.keystore +0 -0
- package/Examples/SampleUI/android/app/proguard-rules.pro +10 -0
- package/Examples/SampleUI/android/app/src/debug/AndroidManifest.xml +9 -0
- package/Examples/SampleUI/android/app/src/main/AndroidManifest.xml +26 -0
- package/Examples/SampleUI/android/app/src/main/java/com/sampleui/MainActivity.kt +23 -0
- package/Examples/SampleUI/android/app/src/main/java/com/sampleui/MainApplication.kt +53 -0
- package/Examples/SampleUI/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/Examples/SampleUI/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/Examples/SampleUI/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/Examples/SampleUI/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/Examples/SampleUI/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/Examples/SampleUI/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/Examples/SampleUI/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/Examples/SampleUI/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/Examples/SampleUI/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/Examples/SampleUI/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/Examples/SampleUI/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/Examples/SampleUI/android/app/src/main/res/values/strings.xml +3 -0
- package/Examples/SampleUI/android/app/src/main/res/values/styles.xml +9 -0
- package/Examples/SampleUI/android/build.gradle +21 -0
- package/Examples/SampleUI/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/Examples/SampleUI/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/Examples/SampleUI/android/gradle.properties +39 -0
- package/Examples/SampleUI/android/gradlew +252 -0
- package/Examples/SampleUI/android/gradlew.bat +94 -0
- package/Examples/SampleUI/android/settings.gradle +21 -0
- package/Examples/SampleUI/app.json +51 -0
- package/Examples/SampleUI/assets/fonts/Abel-Regular.ttf +0 -0
- package/Examples/SampleUI/assets/fonts/NotoSans-Regular.ttf +0 -0
- package/Examples/SampleUI/assets/images/android-icon.png +0 -0
- package/Examples/SampleUI/assets/images/artist-1.jpg +0 -0
- package/Examples/SampleUI/assets/images/artist-2.jpg +0 -0
- package/Examples/SampleUI/assets/images/avatar.png +0 -0
- package/Examples/SampleUI/assets/images/beach.jpg +0 -0
- package/Examples/SampleUI/assets/images/bridge.jpg +0 -0
- package/Examples/SampleUI/assets/images/chameleon.jpg +0 -0
- package/Examples/SampleUI/assets/images/city.jpg +0 -0
- package/Examples/SampleUI/assets/images/email-icon.png +0 -0
- package/Examples/SampleUI/assets/images/favorite.png +0 -0
- package/Examples/SampleUI/assets/images/forest.jpg +0 -0
- package/Examples/SampleUI/assets/images/paper-icon.png +0 -0
- package/Examples/SampleUI/assets/images/players-2.jpg +0 -0
- package/Examples/SampleUI/assets/images/players.jpg +0 -0
- package/Examples/SampleUI/assets/images/restaurant-1.jpg +0 -0
- package/Examples/SampleUI/assets/images/restaurant-2.jpg +0 -0
- package/Examples/SampleUI/assets/images/song-1.jpg +0 -0
- package/Examples/SampleUI/assets/images/song-2.jpg +0 -0
- package/Examples/SampleUI/assets/images/splash.png +0 -0
- package/Examples/SampleUI/assets/images/strawberries.jpg +0 -0
- package/Examples/SampleUI/assets/images/wrecked-ship.jpg +0 -0
- package/Examples/SampleUI/assets/styles/fonts.css +47 -0
- package/Examples/SampleUI/babel.config.js +22 -0
- package/Examples/SampleUI/index.js +9 -0
- package/Examples/SampleUI/ios/.xcode.env +11 -0
- package/Examples/SampleUI/ios/Podfile +58 -0
- package/Examples/SampleUI/ios/SampleUI/AppDelegate.h +7 -0
- package/Examples/SampleUI/ios/SampleUI/AppDelegate.mm +31 -0
- package/Examples/SampleUI/ios/SampleUI/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/Examples/SampleUI/ios/SampleUI/Images.xcassets/Contents.json +6 -0
- package/Examples/SampleUI/ios/SampleUI/Info.plist +52 -0
- package/Examples/SampleUI/ios/SampleUI/LaunchScreen.storyboard +47 -0
- package/Examples/SampleUI/ios/SampleUI/PrivacyInfo.xcprivacy +48 -0
- package/Examples/SampleUI/ios/SampleUI/main.m +10 -0
- package/Examples/SampleUI/ios/SampleUI.xcodeproj/project.pbxproj +785 -0
- package/Examples/SampleUI/ios/SampleUI.xcodeproj/xcshareddata/xcschemes/SampleUI.xcscheme +88 -0
- package/Examples/SampleUI/ios/SampleUI.xcworkspace/contents.xcworkspacedata +10 -0
- package/Examples/SampleUI/ios/SampleUITests/Info.plist +24 -0
- package/Examples/SampleUI/ios/SampleUITests/SampleUITests.m +66 -0
- package/Examples/SampleUI/jest.config.js +3 -0
- package/Examples/SampleUI/metro.config.js +53 -0
- package/Examples/SampleUI/package-lock.json +17033 -0
- package/Examples/SampleUI/package.json +62 -0
- package/Examples/SampleUI/src/DrawerItems.tsx +322 -0
- package/Examples/SampleUI/src/ExampleList.tsx +175 -0
- package/Examples/SampleUI/src/Examples/ActivityIndicatorExample.tsx +73 -0
- package/Examples/SampleUI/src/Examples/AnimatedFABExample/AnimatedFABExample.tsx +220 -0
- package/Examples/SampleUI/src/Examples/AnimatedFABExample/CustomFAB.tsx +70 -0
- package/Examples/SampleUI/src/Examples/AnimatedFABExample/CustomFABControls.tsx +146 -0
- package/Examples/SampleUI/src/Examples/AnimatedFABExample/index.ts +1 -0
- package/Examples/SampleUI/src/Examples/AppbarExample.tsx +263 -0
- package/Examples/SampleUI/src/Examples/AvatarExample.tsx +76 -0
- package/Examples/SampleUI/src/Examples/BadgeExample.tsx +97 -0
- package/Examples/SampleUI/src/Examples/BannerExample.tsx +152 -0
- package/Examples/SampleUI/src/Examples/BottomNavigationBarExample.tsx +94 -0
- package/Examples/SampleUI/src/Examples/BottomNavigationExample.tsx +205 -0
- package/Examples/SampleUI/src/Examples/ButtonExample.tsx +405 -0
- package/Examples/SampleUI/src/Examples/CardExample.tsx +245 -0
- package/Examples/SampleUI/src/Examples/CheckboxExample.tsx +87 -0
- package/Examples/SampleUI/src/Examples/CheckboxItemExample.tsx +72 -0
- package/Examples/SampleUI/src/Examples/ChipExample.tsx +432 -0
- package/Examples/SampleUI/src/Examples/DataTableExample.tsx +128 -0
- package/Examples/SampleUI/src/Examples/DialogExample.tsx +131 -0
- package/Examples/SampleUI/src/Examples/Dialogs/DialogTextComponent.tsx +31 -0
- package/Examples/SampleUI/src/Examples/Dialogs/DialogWithCustomColors.tsx +57 -0
- package/Examples/SampleUI/src/Examples/Dialogs/DialogWithDismissableBackButton.tsx +38 -0
- package/Examples/SampleUI/src/Examples/Dialogs/DialogWithIcon.tsx +42 -0
- package/Examples/SampleUI/src/Examples/Dialogs/DialogWithLoadingIndicator.tsx +48 -0
- package/Examples/SampleUI/src/Examples/Dialogs/DialogWithLongText.tsx +81 -0
- package/Examples/SampleUI/src/Examples/Dialogs/DialogWithRadioBtns.tsx +111 -0
- package/Examples/SampleUI/src/Examples/Dialogs/UndismissableDialog.tsx +30 -0
- package/Examples/SampleUI/src/Examples/Dialogs/index.tsx +7 -0
- package/Examples/SampleUI/src/Examples/DividerExample.tsx +30 -0
- package/Examples/SampleUI/src/Examples/FABExample.tsx +226 -0
- package/Examples/SampleUI/src/Examples/IconButtonExample.tsx +230 -0
- package/Examples/SampleUI/src/Examples/IconExample.tsx +50 -0
- package/Examples/SampleUI/src/Examples/ListAccordionExample.tsx +65 -0
- package/Examples/SampleUI/src/Examples/ListAccordionGroupExample.tsx +80 -0
- package/Examples/SampleUI/src/Examples/ListItemExample.tsx +310 -0
- package/Examples/SampleUI/src/Examples/ListSectionExample.tsx +159 -0
- package/Examples/SampleUI/src/Examples/MaterialBottomTabNavigatorExample.tsx +87 -0
- package/Examples/SampleUI/src/Examples/MenuExample.tsx +211 -0
- package/Examples/SampleUI/src/Examples/ProgressBarExample.tsx +142 -0
- package/Examples/SampleUI/src/Examples/RadioButtonExample.tsx +104 -0
- package/Examples/SampleUI/src/Examples/RadioButtonGroupExample.tsx +67 -0
- package/Examples/SampleUI/src/Examples/RadioButtonItemExample.tsx +77 -0
- package/Examples/SampleUI/src/Examples/SearchbarExample.tsx +249 -0
- package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonCustomColorCheck.tsx +93 -0
- package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonDefault.tsx +49 -0
- package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonDisabled.tsx +47 -0
- package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonMultiselect.tsx +50 -0
- package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonMultiselectIcons.tsx +49 -0
- package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonMultiselectRealCase.tsx +114 -0
- package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonOnlyIcons.tsx +40 -0
- package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonOnlyIconsWithCheck.tsx +43 -0
- package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonRealCase.tsx +97 -0
- package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonWithDensity.tsx +47 -0
- package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonWithSelectedCheck.tsx +52 -0
- package/Examples/SampleUI/src/Examples/SegmentedButtons/index.ts +9 -0
- package/Examples/SampleUI/src/Examples/SegmentedButtonsExample.tsx +57 -0
- package/Examples/SampleUI/src/Examples/SnackbarExample.tsx +141 -0
- package/Examples/SampleUI/src/Examples/SurfaceExample.tsx +130 -0
- package/Examples/SampleUI/src/Examples/SwitchExample.tsx +105 -0
- package/Examples/SampleUI/src/Examples/TeamDetails.tsx +291 -0
- package/Examples/SampleUI/src/Examples/TeamsList.tsx +57 -0
- package/Examples/SampleUI/src/Examples/TextExample.tsx +132 -0
- package/Examples/SampleUI/src/Examples/TextInputExample.tsx +914 -0
- package/Examples/SampleUI/src/Examples/ThemeExample.tsx +41 -0
- package/Examples/SampleUI/src/Examples/ThemingWithReactNavigation.tsx +75 -0
- package/Examples/SampleUI/src/Examples/ToggleButtonExample.tsx +128 -0
- package/Examples/SampleUI/src/Examples/TooltipExample.tsx +191 -0
- package/Examples/SampleUI/src/Examples/TouchableRippleExample.tsx +37 -0
- package/Examples/SampleUI/src/RootNavigator.tsx +86 -0
- package/Examples/SampleUI/src/ScreenWrapper.tsx +67 -0
- package/Examples/SampleUI/src/components/ActivityIndicator.tsx +254 -0
- package/Examples/SampleUI/src/components/Appbar/Appbar.tsx +364 -0
- package/Examples/SampleUI/src/components/Appbar/AppbarAction.tsx +132 -0
- package/Examples/SampleUI/src/components/Appbar/AppbarBackAction.tsx +77 -0
- package/Examples/SampleUI/src/components/Appbar/AppbarBackIcon.tsx +52 -0
- package/Examples/SampleUI/src/components/Appbar/AppbarContent.tsx +249 -0
- package/Examples/SampleUI/src/components/Appbar/AppbarHeader.tsx +174 -0
- package/Examples/SampleUI/src/components/Appbar/index.ts +22 -0
- package/Examples/SampleUI/src/components/Appbar/utils.ts +188 -0
- package/Examples/SampleUI/src/components/Avatar/Avatar.tsx +8 -0
- package/Examples/SampleUI/src/components/Avatar/AvatarIcon.tsx +87 -0
- package/Examples/SampleUI/src/components/Avatar/AvatarImage.tsx +128 -0
- package/Examples/SampleUI/src/components/Avatar/AvatarText.tsx +127 -0
- package/Examples/SampleUI/src/components/Badge.tsx +138 -0
- package/Examples/SampleUI/src/components/Banner.tsx +302 -0
- package/Examples/SampleUI/src/components/BottomNavigation/BottomNavigation.tsx +643 -0
- package/Examples/SampleUI/src/components/BottomNavigation/BottomNavigationBar.tsx +1039 -0
- package/Examples/SampleUI/src/components/BottomNavigation/BottomNavigationRouteScreen.tsx +31 -0
- package/Examples/SampleUI/src/components/BottomNavigation/utils.ts +70 -0
- package/Examples/SampleUI/src/components/Button/Button.tsx +503 -0
- package/Examples/SampleUI/src/components/Button/utils.tsx +272 -0
- package/Examples/SampleUI/src/components/Card/Card.tsx +373 -0
- package/Examples/SampleUI/src/components/Card/CardActions.tsx +74 -0
- package/Examples/SampleUI/src/components/Card/CardContent.tsx +99 -0
- package/Examples/SampleUI/src/components/Card/CardCover.tsx +96 -0
- package/Examples/SampleUI/src/components/Card/CardTitle.tsx +236 -0
- package/Examples/SampleUI/src/components/Card/utils.tsx +110 -0
- package/Examples/SampleUI/src/components/Checkbox/Checkbox.tsx +78 -0
- package/Examples/SampleUI/src/components/Checkbox/CheckboxAndroid.tsx +180 -0
- package/Examples/SampleUI/src/components/Checkbox/CheckboxIOS.tsx +104 -0
- package/Examples/SampleUI/src/components/Checkbox/CheckboxItem.tsx +236 -0
- package/Examples/SampleUI/src/components/Checkbox/index.ts +19 -0
- package/Examples/SampleUI/src/components/Checkbox/utils.ts +183 -0
- package/Examples/SampleUI/src/components/Chip/Chip.tsx +513 -0
- package/Examples/SampleUI/src/components/Chip/helpers.tsx +322 -0
- package/Examples/SampleUI/src/components/CrossFadeIcon.tsx +140 -0
- package/Examples/SampleUI/src/components/DataTable/DataTable.tsx +138 -0
- package/Examples/SampleUI/src/components/DataTable/DataTableCell.tsx +132 -0
- package/Examples/SampleUI/src/components/DataTable/DataTableHeader.tsx +82 -0
- package/Examples/SampleUI/src/components/DataTable/DataTablePagination.tsx +407 -0
- package/Examples/SampleUI/src/components/DataTable/DataTableRow.tsx +107 -0
- package/Examples/SampleUI/src/components/DataTable/DataTableTitle.tsx +208 -0
- package/Examples/SampleUI/src/components/Dialog/Dialog.tsx +191 -0
- package/Examples/SampleUI/src/components/Dialog/DialogActions.tsx +94 -0
- package/Examples/SampleUI/src/components/Dialog/DialogContent.tsx +54 -0
- package/Examples/SampleUI/src/components/Dialog/DialogIcon.tsx +100 -0
- package/Examples/SampleUI/src/components/Dialog/DialogScrollArea.tsx +88 -0
- package/Examples/SampleUI/src/components/Dialog/DialogTitle.tsx +94 -0
- package/Examples/SampleUI/src/components/Divider.tsx +102 -0
- package/Examples/SampleUI/src/components/Drawer/Drawer.tsx +8 -0
- package/Examples/SampleUI/src/components/Drawer/DrawerCollapsedItem.tsx +282 -0
- package/Examples/SampleUI/src/components/Drawer/DrawerItem.tsx +209 -0
- package/Examples/SampleUI/src/components/Drawer/DrawerSection.tsx +138 -0
- package/Examples/SampleUI/src/components/FAB/AnimatedFAB.tsx +619 -0
- package/Examples/SampleUI/src/components/FAB/FAB.tsx +371 -0
- package/Examples/SampleUI/src/components/FAB/FABGroup.tsx +532 -0
- package/Examples/SampleUI/src/components/FAB/index.ts +13 -0
- package/Examples/SampleUI/src/components/FAB/utils.ts +474 -0
- package/Examples/SampleUI/src/components/HelperText/HelperText.tsx +168 -0
- package/Examples/SampleUI/src/components/HelperText/utils.ts +30 -0
- package/Examples/SampleUI/src/components/Icon.tsx +170 -0
- package/Examples/SampleUI/src/components/IconButton/IconButton.tsx +234 -0
- package/Examples/SampleUI/src/components/IconButton/utils.ts +190 -0
- package/Examples/SampleUI/src/components/List/List.tsx +20 -0
- package/Examples/SampleUI/src/components/List/ListAccordion.tsx +391 -0
- package/Examples/SampleUI/src/components/List/ListAccordionGroup.tsx +88 -0
- package/Examples/SampleUI/src/components/List/ListIcon.tsx +79 -0
- package/Examples/SampleUI/src/components/List/ListImage.tsx +89 -0
- package/Examples/SampleUI/src/components/List/ListItem.tsx +313 -0
- package/Examples/SampleUI/src/components/List/ListSection.tsx +87 -0
- package/Examples/SampleUI/src/components/List/ListSubheader.tsx +79 -0
- package/Examples/SampleUI/src/components/List/utils.ts +113 -0
- package/Examples/SampleUI/src/components/MaterialCommunityIcon.tsx +121 -0
- package/Examples/SampleUI/src/components/Menu/Menu.tsx +711 -0
- package/Examples/SampleUI/src/components/Menu/MenuItem.tsx +257 -0
- package/Examples/SampleUI/src/components/Menu/utils.ts +110 -0
- package/Examples/SampleUI/src/components/Modal.tsx +245 -0
- package/Examples/SampleUI/src/components/Portal/Portal.tsx +69 -0
- package/Examples/SampleUI/src/components/Portal/PortalConsumer.tsx +44 -0
- package/Examples/SampleUI/src/components/Portal/PortalHost.tsx +143 -0
- package/Examples/SampleUI/src/components/Portal/PortalManager.tsx +54 -0
- package/Examples/SampleUI/src/components/ProgressBar.tsx +292 -0
- package/Examples/SampleUI/src/components/RadioButton/RadioButton.tsx +86 -0
- package/Examples/SampleUI/src/components/RadioButton/RadioButtonAndroid.tsx +202 -0
- package/Examples/SampleUI/src/components/RadioButton/RadioButtonGroup.tsx +67 -0
- package/Examples/SampleUI/src/components/RadioButton/RadioButtonIOS.tsx +130 -0
- package/Examples/SampleUI/src/components/RadioButton/RadioButtonItem.tsx +268 -0
- package/Examples/SampleUI/src/components/RadioButton/index.ts +22 -0
- package/Examples/SampleUI/src/components/RadioButton/utils.ts +37 -0
- package/Examples/SampleUI/src/components/Searchbar.tsx +459 -0
- package/Examples/SampleUI/src/components/SegmentedButtons/SegmentedButtonItem.tsx +271 -0
- package/Examples/SampleUI/src/components/SegmentedButtons/SegmentedButtons.tsx +197 -0
- package/Examples/SampleUI/src/components/SegmentedButtons/utils.ts +179 -0
- package/Examples/SampleUI/src/components/Snackbar.tsx +430 -0
- package/Examples/SampleUI/src/components/Surface.tsx +376 -0
- package/Examples/SampleUI/src/components/Switch/Switch.tsx +108 -0
- package/Examples/SampleUI/src/components/Switch/utils.ts +113 -0
- package/Examples/SampleUI/src/components/TextInput/Addons/Outline.tsx +64 -0
- package/Examples/SampleUI/src/components/TextInput/Addons/Underline.tsx +78 -0
- package/Examples/SampleUI/src/components/TextInput/Adornment/TextInputAdornment.tsx +208 -0
- package/Examples/SampleUI/src/components/TextInput/Adornment/TextInputAffix.tsx +212 -0
- package/Examples/SampleUI/src/components/TextInput/Adornment/TextInputIcon.tsx +195 -0
- package/Examples/SampleUI/src/components/TextInput/Adornment/enums.tsx +12 -0
- package/Examples/SampleUI/src/components/TextInput/Adornment/types.tsx +11 -0
- package/Examples/SampleUI/src/components/TextInput/Adornment/utils.ts +48 -0
- package/Examples/SampleUI/src/components/TextInput/Label/InputLabel.tsx +217 -0
- package/Examples/SampleUI/src/components/TextInput/Label/LabelBackground.tsx +100 -0
- package/Examples/SampleUI/src/components/TextInput/TextInput.tsx +572 -0
- package/Examples/SampleUI/src/components/TextInput/TextInputFlat.tsx +475 -0
- package/Examples/SampleUI/src/components/TextInput/TextInputOutlined.tsx +450 -0
- package/Examples/SampleUI/src/components/TextInput/constants.tsx +48 -0
- package/Examples/SampleUI/src/components/TextInput/helpers.tsx +612 -0
- package/Examples/SampleUI/src/components/TextInput/types.tsx +155 -0
- package/Examples/SampleUI/src/components/ToggleButton/ToggleButton.tsx +187 -0
- package/Examples/SampleUI/src/components/ToggleButton/ToggleButtonGroup.tsx +72 -0
- package/Examples/SampleUI/src/components/ToggleButton/ToggleButtonRow.tsx +107 -0
- package/Examples/SampleUI/src/components/ToggleButton/index.ts +16 -0
- package/Examples/SampleUI/src/components/ToggleButton/utils.ts +26 -0
- package/Examples/SampleUI/src/components/Tooltip/Tooltip.tsx +249 -0
- package/Examples/SampleUI/src/components/Tooltip/utils.ts +129 -0
- package/Examples/SampleUI/src/components/TouchableRipple/Pressable.tsx +41 -0
- package/Examples/SampleUI/src/components/TouchableRipple/TouchableRipple.native.tsx +145 -0
- package/Examples/SampleUI/src/components/TouchableRipple/TouchableRipple.tsx +317 -0
- package/Examples/SampleUI/src/components/TouchableRipple/utils.ts +66 -0
- package/Examples/SampleUI/src/components/Typography/AnimatedText.tsx +107 -0
- package/Examples/SampleUI/src/components/Typography/Text.tsx +184 -0
- package/Examples/SampleUI/src/components/Typography/types.tsx +5 -0
- package/Examples/SampleUI/src/components/Typography/v2/Caption.tsx +50 -0
- package/Examples/SampleUI/src/components/Typography/v2/Headline.tsx +52 -0
- package/Examples/SampleUI/src/components/Typography/v2/Paragraph.tsx +49 -0
- package/Examples/SampleUI/src/components/Typography/v2/StyledText.tsx +56 -0
- package/Examples/SampleUI/src/components/Typography/v2/Subheading.tsx +50 -0
- package/Examples/SampleUI/src/components/Typography/v2/Text.tsx +62 -0
- package/Examples/SampleUI/src/components/Typography/v2/Title.tsx +49 -0
- package/Examples/SampleUI/src/components/Typography/v2/index.ts +5 -0
- package/Examples/SampleUI/src/core/PaperProvider.tsx +122 -0
- package/Examples/SampleUI/src/core/SafeAreaProviderCompat.tsx +65 -0
- package/Examples/SampleUI/src/core/settings.tsx +23 -0
- package/Examples/SampleUI/src/core/theming.tsx +170 -0
- package/Examples/SampleUI/src/index.native.tsx +270 -0
- package/Examples/SampleUI/src/index.tsx +226 -0
- package/Examples/SampleUI/src/react-navigation/index.tsx +19 -0
- package/Examples/SampleUI/src/react-navigation/navigators/createMaterialBottomTabNavigator.tsx +72 -0
- package/Examples/SampleUI/src/react-navigation/types.tsx +126 -0
- package/Examples/SampleUI/src/react-navigation/views/MaterialBottomTabView.tsx +140 -0
- package/Examples/SampleUI/src/styles/__tests__/fonts.test.js +290 -0
- package/Examples/SampleUI/src/styles/fonts.tsx +143 -0
- package/Examples/SampleUI/src/styles/overlay.tsx +70 -0
- package/Examples/SampleUI/src/styles/shadow.tsx +109 -0
- package/Examples/SampleUI/src/styles/themes/index.ts +4 -0
- package/Examples/SampleUI/src/styles/themes/v2/DarkTheme.tsx +30 -0
- package/Examples/SampleUI/src/styles/themes/v2/LightTheme.tsx +30 -0
- package/Examples/SampleUI/src/styles/themes/v2/colors.tsx +277 -0
- package/Examples/SampleUI/src/styles/themes/v3/DarkTheme.tsx +66 -0
- package/Examples/SampleUI/src/styles/themes/v3/LightTheme.tsx +69 -0
- package/Examples/SampleUI/src/styles/themes/v3/tokens.tsx +230 -0
- package/Examples/SampleUI/src/utils/BackHandler/BackHandler.native.tsx +3 -0
- package/Examples/SampleUI/src/utils/BackHandler/BackHandler.tsx +11 -0
- package/Examples/SampleUI/src/utils/addEventListener.tsx +56 -0
- package/Examples/SampleUI/src/utils/forwardRef.tsx +23 -0
- package/Examples/SampleUI/src/utils/getContrastingColor.tsx +15 -0
- package/Examples/SampleUI/src/utils/hasTouchHandler.tsx +23 -0
- package/Examples/SampleUI/src/utils/roundLayoutSize.ts +2 -0
- package/Examples/SampleUI/src/utils/splitStyles.ts +60 -0
- package/Examples/SampleUI/src/utils/useAnimatedValue.tsx +9 -0
- package/Examples/SampleUI/src/utils/useAnimatedValueArray.tsx +13 -0
- package/Examples/SampleUI/src/utils/useIsKeyboardShown.tsx +55 -0
- package/Examples/SampleUI/src/utils/useLayout.tsx +29 -0
- package/Examples/SampleUI/src/utils/useLazyRef.tsx +11 -0
- package/Examples/SampleUI/tsconfig.json +3 -0
- package/Examples/SampleUI/utils/index.ts +1426 -0
- package/lib/typescript/jslib/TLTRN.d.ts +5 -5
- package/lib/typescript/jslib/TLTRN.d.ts.map +1 -1
- 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;
|