react-native-acoustic-connect-beta 18.0.7 → 18.0.8
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,249 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Keyboard, StyleSheet } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { DrawerNavigationProp } from '@react-navigation/drawer';
|
|
5
|
+
import type { StackNavigationProp } from '@react-navigation/stack';
|
|
6
|
+
import {
|
|
7
|
+
List,
|
|
8
|
+
MD3Colors,
|
|
9
|
+
Searchbar,
|
|
10
|
+
Snackbar,
|
|
11
|
+
Avatar,
|
|
12
|
+
} from 'react-native-paper';
|
|
13
|
+
|
|
14
|
+
import { useExampleTheme } from '..';
|
|
15
|
+
import ScreenWrapper from '../ScreenWrapper';
|
|
16
|
+
|
|
17
|
+
type Props = {
|
|
18
|
+
navigation: StackNavigationProp<{}>;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const SearchExample = ({ navigation }: Props) => {
|
|
22
|
+
const [isVisible, setIsVisible] = React.useState(false);
|
|
23
|
+
const [searchQueries, setSearchQuery] = React.useState({
|
|
24
|
+
searchBarMode: '',
|
|
25
|
+
traileringIcon: '',
|
|
26
|
+
traileringIconWithRightItem: '',
|
|
27
|
+
rightItem: '',
|
|
28
|
+
loadingBarMode: '',
|
|
29
|
+
searchViewMode: '',
|
|
30
|
+
searchWithoutBottomLine: '',
|
|
31
|
+
loadingViewMode: '',
|
|
32
|
+
clickableBack: '',
|
|
33
|
+
clickableDrawer: '',
|
|
34
|
+
clickableLoading: '',
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const { isV3, colors } = useExampleTheme();
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
<ScreenWrapper>
|
|
42
|
+
{!isV3 && (
|
|
43
|
+
<Searchbar
|
|
44
|
+
placeholder="Search"
|
|
45
|
+
onChangeText={(query) =>
|
|
46
|
+
setSearchQuery({ ...searchQueries, searchBarMode: query })
|
|
47
|
+
}
|
|
48
|
+
value={searchQueries.searchBarMode}
|
|
49
|
+
style={styles.searchbar}
|
|
50
|
+
/>
|
|
51
|
+
)}
|
|
52
|
+
{isV3 && (
|
|
53
|
+
<List.Section title="Bar mode">
|
|
54
|
+
<Searchbar
|
|
55
|
+
placeholder="Search"
|
|
56
|
+
onChangeText={(query) =>
|
|
57
|
+
setSearchQuery({ ...searchQueries, searchBarMode: query })
|
|
58
|
+
}
|
|
59
|
+
value={searchQueries.searchBarMode}
|
|
60
|
+
style={styles.searchbar}
|
|
61
|
+
mode="bar"
|
|
62
|
+
/>
|
|
63
|
+
<Searchbar
|
|
64
|
+
placeholder="Trailering icon"
|
|
65
|
+
onChangeText={(query) =>
|
|
66
|
+
setSearchQuery({ ...searchQueries, traileringIcon: query })
|
|
67
|
+
}
|
|
68
|
+
value={searchQueries.traileringIcon}
|
|
69
|
+
traileringIcon={'microphone'}
|
|
70
|
+
traileringIconColor={
|
|
71
|
+
isVisible ? MD3Colors.error40 : colors.onSurfaceVariant
|
|
72
|
+
}
|
|
73
|
+
traileringIconAccessibilityLabel={'microphone button'}
|
|
74
|
+
onTraileringIconPress={() => setIsVisible(true)}
|
|
75
|
+
style={styles.searchbar}
|
|
76
|
+
mode="bar"
|
|
77
|
+
/>
|
|
78
|
+
<Searchbar
|
|
79
|
+
mode="bar"
|
|
80
|
+
placeholder="Trailering icon with right item"
|
|
81
|
+
onChangeText={(query) =>
|
|
82
|
+
setSearchQuery({
|
|
83
|
+
...searchQueries,
|
|
84
|
+
traileringIconWithRightItem: query,
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
value={searchQueries.traileringIconWithRightItem}
|
|
88
|
+
traileringIcon={'microphone'}
|
|
89
|
+
traileringIconColor={
|
|
90
|
+
isVisible ? MD3Colors.error40 : colors.onSurfaceVariant
|
|
91
|
+
}
|
|
92
|
+
traileringIconAccessibilityLabel={'microphone button'}
|
|
93
|
+
onTraileringIconPress={() => setIsVisible(true)}
|
|
94
|
+
right={(props) => (
|
|
95
|
+
<Avatar.Image
|
|
96
|
+
{...props}
|
|
97
|
+
size={30}
|
|
98
|
+
source={require('../../assets/images/avatar.png')}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
style={styles.searchbar}
|
|
102
|
+
/>
|
|
103
|
+
<Searchbar
|
|
104
|
+
mode="bar"
|
|
105
|
+
placeholder="Right item"
|
|
106
|
+
onChangeText={(query) =>
|
|
107
|
+
setSearchQuery({
|
|
108
|
+
...searchQueries,
|
|
109
|
+
rightItem: query,
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
value={searchQueries.rightItem}
|
|
113
|
+
right={(props) => (
|
|
114
|
+
<Avatar.Image
|
|
115
|
+
{...props}
|
|
116
|
+
size={30}
|
|
117
|
+
source={require('../../assets/images/avatar.png')}
|
|
118
|
+
/>
|
|
119
|
+
)}
|
|
120
|
+
style={styles.searchbar}
|
|
121
|
+
/>
|
|
122
|
+
<Searchbar
|
|
123
|
+
placeholder="Loading"
|
|
124
|
+
onChangeText={(query) =>
|
|
125
|
+
setSearchQuery({
|
|
126
|
+
...searchQueries,
|
|
127
|
+
loadingBarMode: query,
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
value={searchQueries.loadingBarMode}
|
|
131
|
+
style={styles.searchbar}
|
|
132
|
+
mode="bar"
|
|
133
|
+
loading
|
|
134
|
+
traileringIcon={'microphone'}
|
|
135
|
+
/>
|
|
136
|
+
</List.Section>
|
|
137
|
+
)}
|
|
138
|
+
{isV3 && (
|
|
139
|
+
<List.Section title="View mode">
|
|
140
|
+
<Searchbar
|
|
141
|
+
placeholder="Search"
|
|
142
|
+
onChangeText={(query) =>
|
|
143
|
+
setSearchQuery({
|
|
144
|
+
...searchQueries,
|
|
145
|
+
searchViewMode: query,
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
value={searchQueries.searchViewMode}
|
|
149
|
+
style={styles.searchbar}
|
|
150
|
+
mode="view"
|
|
151
|
+
/>
|
|
152
|
+
<Searchbar
|
|
153
|
+
placeholder="Search without bottom line"
|
|
154
|
+
onChangeText={(query) =>
|
|
155
|
+
setSearchQuery({
|
|
156
|
+
...searchQueries,
|
|
157
|
+
searchWithoutBottomLine: query,
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
value={searchQueries.searchWithoutBottomLine}
|
|
161
|
+
style={styles.searchbar}
|
|
162
|
+
mode="view"
|
|
163
|
+
showDivider={false}
|
|
164
|
+
/>
|
|
165
|
+
<Searchbar
|
|
166
|
+
placeholder="Loading"
|
|
167
|
+
onChangeText={(query) =>
|
|
168
|
+
setSearchQuery({
|
|
169
|
+
...searchQueries,
|
|
170
|
+
loadingViewMode: query,
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
value={searchQueries.loadingViewMode}
|
|
174
|
+
style={styles.searchbar}
|
|
175
|
+
mode="view"
|
|
176
|
+
loading
|
|
177
|
+
/>
|
|
178
|
+
</List.Section>
|
|
179
|
+
)}
|
|
180
|
+
<List.Section title="Clickable icon">
|
|
181
|
+
<Searchbar
|
|
182
|
+
placeholder="Search"
|
|
183
|
+
onChangeText={(query) =>
|
|
184
|
+
setSearchQuery({
|
|
185
|
+
...searchQueries,
|
|
186
|
+
clickableBack: query,
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
value={searchQueries.clickableBack}
|
|
190
|
+
onIconPress={() => {
|
|
191
|
+
Keyboard.dismiss();
|
|
192
|
+
navigation.goBack();
|
|
193
|
+
}}
|
|
194
|
+
onClearIconPress={() => {
|
|
195
|
+
Keyboard.dismiss();
|
|
196
|
+
}}
|
|
197
|
+
icon={{ source: 'arrow-left', direction: 'auto' }}
|
|
198
|
+
style={styles.searchbar}
|
|
199
|
+
/>
|
|
200
|
+
<Searchbar
|
|
201
|
+
placeholder="Search"
|
|
202
|
+
onChangeText={(query) =>
|
|
203
|
+
setSearchQuery({
|
|
204
|
+
...searchQueries,
|
|
205
|
+
clickableDrawer: query,
|
|
206
|
+
})
|
|
207
|
+
}
|
|
208
|
+
value={searchQueries.clickableDrawer}
|
|
209
|
+
onIconPress={() => {
|
|
210
|
+
Keyboard.dismiss();
|
|
211
|
+
(navigation as any as DrawerNavigationProp<{}>).openDrawer();
|
|
212
|
+
}}
|
|
213
|
+
icon="menu"
|
|
214
|
+
style={styles.searchbar}
|
|
215
|
+
/>
|
|
216
|
+
<Searchbar
|
|
217
|
+
placeholder="Search"
|
|
218
|
+
onChangeText={(query) =>
|
|
219
|
+
setSearchQuery({
|
|
220
|
+
...searchQueries,
|
|
221
|
+
clickableLoading: query,
|
|
222
|
+
})
|
|
223
|
+
}
|
|
224
|
+
value={searchQueries.clickableLoading}
|
|
225
|
+
loading
|
|
226
|
+
style={styles.searchbar}
|
|
227
|
+
/>
|
|
228
|
+
</List.Section>
|
|
229
|
+
</ScreenWrapper>
|
|
230
|
+
<Snackbar
|
|
231
|
+
visible={isVisible}
|
|
232
|
+
onDismiss={() => setIsVisible(false)}
|
|
233
|
+
duration={Snackbar.DURATION_SHORT}
|
|
234
|
+
>
|
|
235
|
+
Microphone button pressed
|
|
236
|
+
</Snackbar>
|
|
237
|
+
</>
|
|
238
|
+
);
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
SearchExample.title = 'Searchbar';
|
|
242
|
+
|
|
243
|
+
const styles = StyleSheet.create({
|
|
244
|
+
searchbar: {
|
|
245
|
+
margin: 4,
|
|
246
|
+
},
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
export default SearchExample;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { List, SegmentedButtons } from 'react-native-paper';
|
|
5
|
+
|
|
6
|
+
type TransportMode = 'walk' | 'train' | 'drive';
|
|
7
|
+
|
|
8
|
+
const themeMock = {
|
|
9
|
+
colors: {
|
|
10
|
+
onSurface: '#3700B3',
|
|
11
|
+
secondaryContainer: '#3700B3',
|
|
12
|
+
onSecondaryContainer: '#FFFFFF',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const SegmentButtonCustomColorCheck = () => {
|
|
17
|
+
const [themeValue, setThemeValue] = React.useState<TransportMode>('walk');
|
|
18
|
+
const [colorValue, setColorValue] = React.useState<TransportMode>('walk');
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<List.Section title={`Segmented Button - Custom Colors`}>
|
|
22
|
+
<List.Subheader>Via Theme</List.Subheader>
|
|
23
|
+
<SegmentedButtons
|
|
24
|
+
value={themeValue}
|
|
25
|
+
onValueChange={setThemeValue}
|
|
26
|
+
theme={themeMock}
|
|
27
|
+
buttons={[
|
|
28
|
+
{
|
|
29
|
+
value: 'walk',
|
|
30
|
+
icon: 'walk',
|
|
31
|
+
label: 'Walking',
|
|
32
|
+
disabled: true,
|
|
33
|
+
style: styles.button,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
value: 'train',
|
|
37
|
+
icon: 'train',
|
|
38
|
+
label: 'Transit',
|
|
39
|
+
style: styles.button,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: 'drive',
|
|
43
|
+
icon: 'car',
|
|
44
|
+
label: 'Driving',
|
|
45
|
+
style: styles.button,
|
|
46
|
+
},
|
|
47
|
+
]}
|
|
48
|
+
style={styles.group}
|
|
49
|
+
/>
|
|
50
|
+
<List.Subheader>Via Props</List.Subheader>
|
|
51
|
+
<SegmentedButtons<TransportMode>
|
|
52
|
+
value={colorValue}
|
|
53
|
+
onValueChange={setColorValue}
|
|
54
|
+
theme={themeMock}
|
|
55
|
+
buttons={[
|
|
56
|
+
{
|
|
57
|
+
value: 'walk',
|
|
58
|
+
icon: 'walk',
|
|
59
|
+
label: 'Walking',
|
|
60
|
+
checkedColor: '#F9AA33',
|
|
61
|
+
style: styles.button,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
value: 'train',
|
|
65
|
+
icon: 'train',
|
|
66
|
+
showSelectedCheck: true,
|
|
67
|
+
checkedColor: '#F9AA33',
|
|
68
|
+
uncheckedColor: '#000000',
|
|
69
|
+
label: 'Transit',
|
|
70
|
+
style: styles.button,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
value: 'drive',
|
|
74
|
+
icon: 'car',
|
|
75
|
+
checkedColor: '#F9AA33',
|
|
76
|
+
label: 'Driving',
|
|
77
|
+
style: styles.button,
|
|
78
|
+
},
|
|
79
|
+
]}
|
|
80
|
+
style={styles.group}
|
|
81
|
+
/>
|
|
82
|
+
</List.Section>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const styles = StyleSheet.create({
|
|
87
|
+
button: {
|
|
88
|
+
flex: 1,
|
|
89
|
+
},
|
|
90
|
+
group: { paddingHorizontal: 20, justifyContent: 'center' },
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export default SegmentButtonCustomColorCheck;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { List, SegmentedButtons } from 'react-native-paper';
|
|
5
|
+
|
|
6
|
+
type TransportMode = 'walk' | 'train' | 'drive';
|
|
7
|
+
|
|
8
|
+
const SegmentedButtonDefault = () => {
|
|
9
|
+
const [value, setValue] = React.useState<TransportMode>('walk');
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<List.Section title={`Segmented Button`}>
|
|
13
|
+
<SegmentedButtons
|
|
14
|
+
value={value}
|
|
15
|
+
onValueChange={setValue}
|
|
16
|
+
buttons={[
|
|
17
|
+
{
|
|
18
|
+
value: 'walk',
|
|
19
|
+
icon: 'walk',
|
|
20
|
+
label: 'Walking',
|
|
21
|
+
style: styles.button,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
value: 'train',
|
|
25
|
+
icon: 'train',
|
|
26
|
+
label: 'Transit',
|
|
27
|
+
style: styles.button,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: 'drive',
|
|
31
|
+
icon: 'car',
|
|
32
|
+
label: 'Driving',
|
|
33
|
+
style: styles.button,
|
|
34
|
+
},
|
|
35
|
+
]}
|
|
36
|
+
style={styles.group}
|
|
37
|
+
/>
|
|
38
|
+
</List.Section>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const styles = StyleSheet.create({
|
|
43
|
+
button: {
|
|
44
|
+
flex: 1,
|
|
45
|
+
},
|
|
46
|
+
group: { paddingHorizontal: 20, justifyContent: 'center' },
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export default SegmentedButtonDefault;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { List, SegmentedButtons } from 'react-native-paper';
|
|
5
|
+
|
|
6
|
+
type TransportMode = 'walk' | 'disabled' | 'drive';
|
|
7
|
+
|
|
8
|
+
const SegmentedButtonDisabled = () => {
|
|
9
|
+
const [value, setValue] = React.useState<TransportMode>('walk');
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<List.Section title={`Segmented Button - disabled`}>
|
|
13
|
+
<SegmentedButtons
|
|
14
|
+
onValueChange={setValue}
|
|
15
|
+
buttons={[
|
|
16
|
+
{
|
|
17
|
+
value: 'walk',
|
|
18
|
+
label: 'Walking',
|
|
19
|
+
style: styles.button,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: 'disabled',
|
|
23
|
+
label: 'Disabled',
|
|
24
|
+
disabled: true,
|
|
25
|
+
style: styles.button,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: 'drive',
|
|
29
|
+
label: 'Driving',
|
|
30
|
+
style: styles.button,
|
|
31
|
+
},
|
|
32
|
+
]}
|
|
33
|
+
value={value}
|
|
34
|
+
style={styles.group}
|
|
35
|
+
/>
|
|
36
|
+
</List.Section>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const styles = StyleSheet.create({
|
|
41
|
+
button: {
|
|
42
|
+
flex: 1,
|
|
43
|
+
},
|
|
44
|
+
group: { paddingHorizontal: 20, justifyContent: 'center' },
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export default SegmentedButtonDisabled;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { List, SegmentedButtons } from 'react-native-paper';
|
|
5
|
+
|
|
6
|
+
type TransportMode = 'walk' | 'transit' | 'drive';
|
|
7
|
+
|
|
8
|
+
const SegmentedButtonMultiselect = () => {
|
|
9
|
+
const [value, setValue] = React.useState<TransportMode[]>([]);
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<List.Section title={`Segmented Button - multiselect`}>
|
|
13
|
+
<SegmentedButtons
|
|
14
|
+
multiSelect
|
|
15
|
+
onValueChange={setValue}
|
|
16
|
+
value={value}
|
|
17
|
+
style={styles.group}
|
|
18
|
+
buttons={[
|
|
19
|
+
{
|
|
20
|
+
style: styles.button,
|
|
21
|
+
value: 'walk',
|
|
22
|
+
label: 'Walking',
|
|
23
|
+
showSelectedCheck: true,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
style: styles.button,
|
|
27
|
+
value: 'transit',
|
|
28
|
+
label: 'Transit',
|
|
29
|
+
showSelectedCheck: true,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
style: styles.button,
|
|
33
|
+
value: 'drive',
|
|
34
|
+
label: 'Driving',
|
|
35
|
+
showSelectedCheck: true,
|
|
36
|
+
},
|
|
37
|
+
]}
|
|
38
|
+
/>
|
|
39
|
+
</List.Section>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const styles = StyleSheet.create({
|
|
44
|
+
group: { paddingHorizontal: 20, justifyContent: 'center' },
|
|
45
|
+
button: {
|
|
46
|
+
flex: 1,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export default SegmentedButtonMultiselect;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { List, SegmentedButtons } from 'react-native-paper';
|
|
5
|
+
|
|
6
|
+
type Size = 'size-s' | 'size-m' | 'size-l' | 'size-xl' | 'size-xxl';
|
|
7
|
+
|
|
8
|
+
const SegmentedButtonMultiselectIcons = () => {
|
|
9
|
+
const [value, setValue] = React.useState<Size[]>([]);
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<List.Section title={`Segmented Button - multiselect only icons`}>
|
|
13
|
+
<SegmentedButtons
|
|
14
|
+
multiSelect
|
|
15
|
+
onValueChange={setValue}
|
|
16
|
+
value={value}
|
|
17
|
+
style={styles.group}
|
|
18
|
+
buttons={[
|
|
19
|
+
{
|
|
20
|
+
value: 'size-s',
|
|
21
|
+
icon: 'size-s',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
value: 'size-m',
|
|
25
|
+
icon: 'size-m',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: 'size-l',
|
|
29
|
+
icon: 'size-l',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: 'size-xl',
|
|
33
|
+
icon: 'size-xl',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
value: 'size-xxl',
|
|
37
|
+
icon: 'size-xxl',
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
</List.Section>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const styles = StyleSheet.create({
|
|
46
|
+
group: { paddingHorizontal: 20, justifyContent: 'center' },
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export default SegmentedButtonMultiselectIcons;
|
package/Examples/SampleUI/src/Examples/SegmentedButtons/SegmentedButtonMultiselectRealCase.tsx
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FlatList, StyleSheet, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { Card, IconButton, SegmentedButtons } from 'react-native-paper';
|
|
5
|
+
|
|
6
|
+
import { restaurantsData } from '../../../utils';
|
|
7
|
+
|
|
8
|
+
type PriceRange = '1' | '2' | '3' | '4';
|
|
9
|
+
|
|
10
|
+
const SegmentedButtonMultiselectRealCase = () => {
|
|
11
|
+
const [value, setValue] = React.useState<PriceRange[]>([]);
|
|
12
|
+
|
|
13
|
+
const filteredData = React.useMemo(
|
|
14
|
+
() =>
|
|
15
|
+
restaurantsData.filter((item) =>
|
|
16
|
+
value.includes(item.price.toString() as PriceRange)
|
|
17
|
+
),
|
|
18
|
+
[value]
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<View style={styles.container}>
|
|
23
|
+
<SegmentedButtons
|
|
24
|
+
value={value}
|
|
25
|
+
onValueChange={setValue}
|
|
26
|
+
multiSelect
|
|
27
|
+
buttons={[
|
|
28
|
+
{
|
|
29
|
+
value: '1',
|
|
30
|
+
label: '$',
|
|
31
|
+
style: styles.button,
|
|
32
|
+
showSelectedCheck: true,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: '2',
|
|
36
|
+
label: '$$',
|
|
37
|
+
style: styles.button,
|
|
38
|
+
showSelectedCheck: true,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
value: '3',
|
|
42
|
+
label: '$$$',
|
|
43
|
+
style: styles.button,
|
|
44
|
+
showSelectedCheck: true,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
value: '4',
|
|
48
|
+
label: '$$$$',
|
|
49
|
+
style: styles.button,
|
|
50
|
+
showSelectedCheck: true,
|
|
51
|
+
},
|
|
52
|
+
]}
|
|
53
|
+
style={styles.group}
|
|
54
|
+
/>
|
|
55
|
+
<FlatList
|
|
56
|
+
data={value.length > 0 ? filteredData : restaurantsData}
|
|
57
|
+
keyExtractor={(item) => item.id}
|
|
58
|
+
contentContainerStyle={styles.contentContainer}
|
|
59
|
+
renderItem={({ item }) => {
|
|
60
|
+
return (
|
|
61
|
+
<Card mode="contained" style={styles.card}>
|
|
62
|
+
<Card.Content style={styles.content}>
|
|
63
|
+
<Card.Cover style={styles.cover} source={item.cover} />
|
|
64
|
+
<Card.Title
|
|
65
|
+
title={item.name}
|
|
66
|
+
subtitle={'$'.repeat(item.price)}
|
|
67
|
+
titleVariant="titleMedium"
|
|
68
|
+
style={styles.title}
|
|
69
|
+
right={() => <IconButton icon={'bookmark-outline'} />}
|
|
70
|
+
/>
|
|
71
|
+
</Card.Content>
|
|
72
|
+
</Card>
|
|
73
|
+
);
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
</View>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const styles = StyleSheet.create({
|
|
81
|
+
container: {
|
|
82
|
+
marginVertical: 16,
|
|
83
|
+
flex: 1,
|
|
84
|
+
},
|
|
85
|
+
contentContainer: {
|
|
86
|
+
paddingBottom: 16,
|
|
87
|
+
},
|
|
88
|
+
card: {
|
|
89
|
+
marginHorizontal: 16,
|
|
90
|
+
marginTop: 16,
|
|
91
|
+
},
|
|
92
|
+
content: {
|
|
93
|
+
flexDirection: 'row',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
paddingHorizontal: 0,
|
|
96
|
+
paddingVertical: 0,
|
|
97
|
+
},
|
|
98
|
+
cover: {
|
|
99
|
+
width: 72,
|
|
100
|
+
height: 72,
|
|
101
|
+
},
|
|
102
|
+
title: {
|
|
103
|
+
flexShrink: 1,
|
|
104
|
+
marginVertical: 0,
|
|
105
|
+
},
|
|
106
|
+
button: {
|
|
107
|
+
flex: 1,
|
|
108
|
+
},
|
|
109
|
+
group: { paddingHorizontal: 20, justifyContent: 'center' },
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
SegmentedButtonMultiselectRealCase.title = 'Restaurants';
|
|
113
|
+
|
|
114
|
+
export default SegmentedButtonMultiselectRealCase;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { List, SegmentedButtons } from 'react-native-paper';
|
|
5
|
+
|
|
6
|
+
type TransportMode = 'walk' | 'train' | 'drive';
|
|
7
|
+
|
|
8
|
+
const SegmentedButtonOnlyIcons = () => {
|
|
9
|
+
const [value, setValue] = React.useState<TransportMode>('walk');
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<List.Section title={`Segmented Button - only icons`}>
|
|
13
|
+
<SegmentedButtons
|
|
14
|
+
onValueChange={setValue}
|
|
15
|
+
style={styles.group}
|
|
16
|
+
value={value}
|
|
17
|
+
buttons={[
|
|
18
|
+
{
|
|
19
|
+
icon: 'walk',
|
|
20
|
+
value: 'walk',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
icon: 'train',
|
|
24
|
+
value: 'train',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
icon: 'car',
|
|
28
|
+
value: 'drive',
|
|
29
|
+
},
|
|
30
|
+
]}
|
|
31
|
+
/>
|
|
32
|
+
</List.Section>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const styles = StyleSheet.create({
|
|
37
|
+
group: { paddingHorizontal: 20, justifyContent: 'center' },
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export default SegmentedButtonOnlyIcons;
|