@expo/ui 56.0.18 → 56.0.20
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/CHANGELOG.md +38 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/DatePickerView.kt +33 -8
- package/build/community/bottom-sheet/BottomSheet.android.d.ts.map +1 -1
- package/build/community/bottom-sheet/BottomSheet.ios.d.ts.map +1 -1
- package/build/community/bottom-sheet/scrollContextReset.d.ts +5 -0
- package/build/community/bottom-sheet/scrollContextReset.d.ts.map +1 -0
- package/build/community/datetime-picker/DateTimePicker.d.ts.map +1 -1
- package/build/community/datetime-picker/types.d.ts +2 -2
- package/build/community/datetime-picker/types.d.ts.map +1 -1
- package/build/community/masked-view/MaskedView.android.d.ts.map +1 -1
- package/build/community/masked-view/MaskedView.ios.d.ts.map +1 -1
- package/build/community/menu/types.d.ts +2 -2
- package/build/community/menu/types.d.ts.map +1 -1
- package/build/community/pager-view/types.d.ts +2 -2
- package/build/community/pager-view/types.d.ts.map +1 -1
- package/build/community/segmented-control/types.d.ts +2 -2
- package/build/community/segmented-control/types.d.ts.map +1 -1
- package/build/community/slider/types.d.ts +2 -2
- package/build/community/slider/types.d.ts.map +1 -1
- package/build/jetpack-compose/AlertDialog/index.d.ts +2 -2
- package/build/jetpack-compose/AlertDialog/index.d.ts.map +1 -1
- package/build/jetpack-compose/AnimatedVisibility/index.d.ts +2 -2
- package/build/jetpack-compose/AnimatedVisibility/index.d.ts.map +1 -1
- package/build/jetpack-compose/Badge/index.d.ts +2 -2
- package/build/jetpack-compose/Badge/index.d.ts.map +1 -1
- package/build/jetpack-compose/BadgedBox/index.d.ts +2 -2
- package/build/jetpack-compose/BadgedBox/index.d.ts.map +1 -1
- package/build/jetpack-compose/BasicAlertDialog/index.d.ts +2 -2
- package/build/jetpack-compose/BasicAlertDialog/index.d.ts.map +1 -1
- package/build/jetpack-compose/Box/index.d.ts +2 -2
- package/build/jetpack-compose/Box/index.d.ts.map +1 -1
- package/build/jetpack-compose/Button/index.d.ts +2 -2
- package/build/jetpack-compose/Button/index.d.ts.map +1 -1
- package/build/jetpack-compose/Card/index.d.ts +6 -6
- package/build/jetpack-compose/Card/index.d.ts.map +1 -1
- package/build/jetpack-compose/Carousel/index.d.ts +6 -6
- package/build/jetpack-compose/Carousel/index.d.ts.map +1 -1
- package/build/jetpack-compose/Checkbox/index.d.ts +4 -4
- package/build/jetpack-compose/Checkbox/index.d.ts.map +1 -1
- package/build/jetpack-compose/Chip/index.d.ts +8 -8
- package/build/jetpack-compose/Chip/index.d.ts.map +1 -1
- package/build/jetpack-compose/Column/index.d.ts +2 -2
- package/build/jetpack-compose/Column/index.d.ts.map +1 -1
- package/build/jetpack-compose/DatePicker/index.d.ts +6 -6
- package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
- package/build/jetpack-compose/DockedSearchBar/index.d.ts +2 -2
- package/build/jetpack-compose/DockedSearchBar/index.d.ts.map +1 -1
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts +2 -2
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/build/jetpack-compose/DropdownMenu/index.d.ts +2 -2
- package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -1
- package/build/jetpack-compose/ExposedDropdownMenuBox/ExposedDropdownMenu.d.ts +2 -2
- package/build/jetpack-compose/ExposedDropdownMenuBox/ExposedDropdownMenu.d.ts.map +1 -1
- package/build/jetpack-compose/ExposedDropdownMenuBox/index.d.ts +2 -2
- package/build/jetpack-compose/ExposedDropdownMenuBox/index.d.ts.map +1 -1
- package/build/jetpack-compose/FloatingActionButton/index.d.ts +8 -6
- package/build/jetpack-compose/FloatingActionButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/FlowRow/index.d.ts +2 -2
- package/build/jetpack-compose/FlowRow/index.d.ts.map +1 -1
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts +4 -4
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts.map +1 -1
- package/build/jetpack-compose/HorizontalPager/index.d.ts +2 -2
- package/build/jetpack-compose/HorizontalPager/index.d.ts.map +1 -1
- package/build/jetpack-compose/Host/index.d.ts +2 -2
- package/build/jetpack-compose/Host/index.d.ts.map +1 -1
- package/build/jetpack-compose/Icon/index.d.ts +2 -2
- package/build/jetpack-compose/Icon/index.d.ts.map +1 -1
- package/build/jetpack-compose/IconButton/index.d.ts +2 -2
- package/build/jetpack-compose/IconButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/LazyColumn/index.d.ts +2 -2
- package/build/jetpack-compose/LazyColumn/index.d.ts.map +1 -1
- package/build/jetpack-compose/LazyRow/index.d.ts +2 -2
- package/build/jetpack-compose/LazyRow/index.d.ts.map +1 -1
- package/build/jetpack-compose/ListItem/index.d.ts +2 -2
- package/build/jetpack-compose/ListItem/index.d.ts.map +1 -1
- package/build/jetpack-compose/LoadingIndicator/index.d.ts +2 -2
- package/build/jetpack-compose/LoadingIndicator/index.d.ts.map +1 -1
- package/build/jetpack-compose/ModalBottomSheet/index.d.ts +2 -2
- package/build/jetpack-compose/ModalBottomSheet/index.d.ts.map +1 -1
- package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts +2 -2
- package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts.map +1 -1
- package/build/jetpack-compose/NavigationBar/index.d.ts +4 -4
- package/build/jetpack-compose/NavigationBar/index.d.ts.map +1 -1
- package/build/jetpack-compose/Progress/index.d.ts +9 -8
- package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
- package/build/jetpack-compose/PullToRefreshBox/index.d.ts +4 -4
- package/build/jetpack-compose/PullToRefreshBox/index.d.ts.map +1 -1
- package/build/jetpack-compose/RadioButton/index.d.ts +2 -2
- package/build/jetpack-compose/RadioButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/Row/index.d.ts +2 -2
- package/build/jetpack-compose/Row/index.d.ts.map +1 -1
- package/build/jetpack-compose/SearchBar/index.d.ts +2 -2
- package/build/jetpack-compose/SearchBar/index.d.ts.map +1 -1
- package/build/jetpack-compose/SegmentedButton/index.d.ts +2 -2
- package/build/jetpack-compose/SegmentedButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/Shape/index.d.ts +2 -2
- package/build/jetpack-compose/Shape/index.d.ts.map +1 -1
- package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts +2 -2
- package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts.map +1 -1
- package/build/jetpack-compose/Slider/index.d.ts +2 -2
- package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
- package/build/jetpack-compose/Snackbar/index.d.ts +4 -4
- package/build/jetpack-compose/Snackbar/index.d.ts.map +1 -1
- package/build/jetpack-compose/Spacer/index.d.ts +2 -2
- package/build/jetpack-compose/Spacer/index.d.ts.map +1 -1
- package/build/jetpack-compose/Surface/index.d.ts +2 -2
- package/build/jetpack-compose/Surface/index.d.ts.map +1 -1
- package/build/jetpack-compose/Switch/index.d.ts +2 -2
- package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
- package/build/jetpack-compose/SyncSwitch/index.d.ts +2 -2
- package/build/jetpack-compose/SyncSwitch/index.d.ts.map +1 -1
- package/build/jetpack-compose/Text/index.d.ts +2 -2
- package/build/jetpack-compose/Text/index.d.ts.map +1 -1
- package/build/jetpack-compose/TextField/BasicTextField.d.ts +2 -2
- package/build/jetpack-compose/TextField/BasicTextField.d.ts.map +1 -1
- package/build/jetpack-compose/TextField/TextField.d.ts +4 -4
- package/build/jetpack-compose/TextField/TextField.d.ts.map +1 -1
- package/build/jetpack-compose/ToggleButton/index.d.ts +2 -2
- package/build/jetpack-compose/ToggleButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/Tooltip/index.d.ts +6 -6
- package/build/jetpack-compose/Tooltip/index.d.ts.map +1 -1
- package/build/swift-ui/AccessoryWidgetBackground/index.d.ts +2 -1
- package/build/swift-ui/AccessoryWidgetBackground/index.d.ts.map +1 -1
- package/build/swift-ui/Alert/index.d.ts +2 -2
- package/build/swift-ui/Alert/index.d.ts.map +1 -1
- package/build/swift-ui/BottomSheet/index.d.ts +2 -2
- package/build/swift-ui/BottomSheet/index.d.ts.map +1 -1
- package/build/swift-ui/Button/index.d.ts +2 -2
- package/build/swift-ui/Button/index.d.ts.map +1 -1
- package/build/swift-ui/Chart/index.d.ts +2 -2
- package/build/swift-ui/Chart/index.d.ts.map +1 -1
- package/build/swift-ui/ColorPicker/index.d.ts +2 -2
- package/build/swift-ui/ColorPicker/index.d.ts.map +1 -1
- package/build/swift-ui/ConfirmationDialog/index.d.ts +2 -2
- package/build/swift-ui/ConfirmationDialog/index.d.ts.map +1 -1
- package/build/swift-ui/ContextMenu/types.d.ts +4 -4
- package/build/swift-ui/ContextMenu/types.d.ts.map +1 -1
- package/build/swift-ui/DatePicker/index.d.ts +2 -2
- package/build/swift-ui/DatePicker/index.d.ts.map +1 -1
- package/build/swift-ui/Divider/index.d.ts +2 -1
- package/build/swift-ui/Divider/index.d.ts.map +1 -1
- package/build/swift-ui/Gauge/index.d.ts +2 -2
- package/build/swift-ui/Gauge/index.d.ts.map +1 -1
- package/build/swift-ui/GlassEffectContainer/index.d.ts +2 -2
- package/build/swift-ui/GlassEffectContainer/index.d.ts.map +1 -1
- package/build/swift-ui/Grid/index.d.ts +2 -2
- package/build/swift-ui/Grid/index.d.ts.map +1 -1
- package/build/swift-ui/HStack/index.d.ts +2 -2
- package/build/swift-ui/HStack/index.d.ts.map +1 -1
- package/build/swift-ui/Host/index.d.ts +9 -3
- package/build/swift-ui/Host/index.d.ts.map +1 -1
- package/build/swift-ui/Label/index.d.ts +2 -2
- package/build/swift-ui/Label/index.d.ts.map +1 -1
- package/build/swift-ui/LabeledContent/index.d.ts +2 -2
- package/build/swift-ui/LabeledContent/index.d.ts.map +1 -1
- package/build/swift-ui/LazyHStack/index.d.ts +2 -2
- package/build/swift-ui/LazyHStack/index.d.ts.map +1 -1
- package/build/swift-ui/LazyVStack/index.d.ts +2 -2
- package/build/swift-ui/LazyVStack/index.d.ts.map +1 -1
- package/build/swift-ui/Link/index.d.ts +2 -2
- package/build/swift-ui/Link/index.d.ts.map +1 -1
- package/build/swift-ui/List/ListForEach.d.ts +2 -2
- package/build/swift-ui/List/ListForEach.d.ts.map +1 -1
- package/build/swift-ui/Mask/index.d.ts +2 -2
- package/build/swift-ui/Mask/index.d.ts.map +1 -1
- package/build/swift-ui/Menu/types.d.ts +2 -2
- package/build/swift-ui/Menu/types.d.ts.map +1 -1
- package/build/swift-ui/Namespace.d.ts +2 -2
- package/build/swift-ui/Namespace.d.ts.map +1 -1
- package/build/swift-ui/Overlay/index.d.ts +2 -2
- package/build/swift-ui/Overlay/index.d.ts.map +1 -1
- package/build/swift-ui/Popover/index.d.ts +2 -2
- package/build/swift-ui/Popover/index.d.ts.map +1 -1
- package/build/swift-ui/ProgressView/index.d.ts +2 -2
- package/build/swift-ui/ProgressView/index.d.ts.map +1 -1
- package/build/swift-ui/RNHostView.d.ts +2 -2
- package/build/swift-ui/RNHostView.d.ts.map +1 -1
- package/build/swift-ui/ScrollView/index.d.ts +2 -2
- package/build/swift-ui/ScrollView/index.d.ts.map +1 -1
- package/build/swift-ui/Section/index.d.ts +2 -2
- package/build/swift-ui/Section/index.d.ts.map +1 -1
- package/build/swift-ui/SecureField/index.d.ts +2 -2
- package/build/swift-ui/SecureField/index.d.ts.map +1 -1
- package/build/swift-ui/ShareLink/index.d.ts +2 -2
- package/build/swift-ui/ShareLink/index.d.ts.map +1 -1
- package/build/swift-ui/Slider/index.d.ts +2 -2
- package/build/swift-ui/Slider/index.d.ts.map +1 -1
- package/build/swift-ui/Stepper/index.d.ts +2 -2
- package/build/swift-ui/Stepper/index.d.ts.map +1 -1
- package/build/swift-ui/SwipeActions/index.d.ts +4 -4
- package/build/swift-ui/SwipeActions/index.d.ts.map +1 -1
- package/build/swift-ui/SyncToggle/index.d.ts +2 -2
- package/build/swift-ui/SyncToggle/index.d.ts.map +1 -1
- package/build/swift-ui/TabView/Tab.d.ts +2 -2
- package/build/swift-ui/TabView/Tab.d.ts.map +1 -1
- package/build/swift-ui/TabView/index.d.ts +2 -2
- package/build/swift-ui/TabView/index.d.ts.map +1 -1
- package/build/swift-ui/TextField/index.d.ts +2 -2
- package/build/swift-ui/TextField/index.d.ts.map +1 -1
- package/build/swift-ui/Toggle/index.d.ts +2 -2
- package/build/swift-ui/Toggle/index.d.ts.map +1 -1
- package/build/swift-ui/VStack/index.d.ts +2 -2
- package/build/swift-ui/VStack/index.d.ts.map +1 -1
- package/build/swift-ui/ZStack/index.d.ts +2 -2
- package/build/swift-ui/ZStack/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +107 -1
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/presentationModifiers.d.ts +19 -0
- package/build/swift-ui/modifiers/presentationModifiers.d.ts.map +1 -1
- package/build/universal/Button/index.d.ts.map +1 -1
- package/build/universal/Checkbox/index.d.ts.map +1 -1
- package/build/universal/Collapsible/index.d.ts.map +1 -1
- package/build/universal/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/build/universal/FieldGroup/FieldSection.d.ts.map +1 -1
- package/build/universal/Host/index.d.ts +1 -2
- package/build/universal/Host/index.d.ts.map +1 -1
- package/build/universal/Host/types.d.ts +16 -2
- package/build/universal/Host/types.d.ts.map +1 -1
- package/build/universal/ListItem/ListItem.android.d.ts.map +1 -1
- package/build/universal/ListItem/ListItem.ios.d.ts.map +1 -1
- package/build/universal/ListItem/types.d.ts +8 -0
- package/build/universal/ListItem/types.d.ts.map +1 -1
- package/build/universal/Picker/Picker.d.ts.map +1 -1
- package/build/universal/Slider/index.d.ts.map +1 -1
- package/build/universal/Switch/index.d.ts.map +1 -1
- package/build/universal/TextInput/index.d.ts.map +1 -1
- package/build/universal/hooks.d.ts +11 -0
- package/build/universal/hooks.d.ts.map +1 -1
- package/build/universal/keyboardEvent.fx.d.ts +2 -0
- package/build/universal/keyboardEvent.fx.d.ts.map +1 -0
- package/build/universal/webUtils.d.ts +66 -0
- package/build/universal/webUtils.d.ts.map +1 -0
- package/expo-module.config.json +1 -1
- package/ios/HostView.swift +15 -0
- package/ios/Modifiers/PresentationModifiers.swift +30 -0
- package/ios/Modifiers/ShapeTypes.swift +50 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +259 -11
- package/ios/Modifiers/WidgetModifiers.swift +1 -1
- package/ios/RNHostView.swift +5 -0
- package/ios/TextFieldView.swift +29 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{56.0.18/expo.modules.ui-56.0.18-sources.jar → 56.0.20/expo.modules.ui-56.0.20-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{56.0.18/expo.modules.ui-56.0.18.module → 56.0.20/expo.modules.ui-56.0.20.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{56.0.18/expo.modules.ui-56.0.18.pom → 56.0.20/expo.modules.ui-56.0.20.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.20/expo.modules.ui-56.0.20.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
- package/package.json +5 -9
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/src/State/index.fx.ts +4 -5
- package/src/community/bottom-sheet/BottomSheet.android.tsx +6 -1
- package/src/community/bottom-sheet/BottomSheet.ios.tsx +8 -4
- package/src/community/bottom-sheet/scrollContextReset.tsx +24 -0
- package/src/community/datetime-picker/DateTimePicker.tsx +9 -1
- package/src/community/datetime-picker/types.tsx +2 -2
- package/src/community/masked-view/MaskedView.android.tsx +5 -2
- package/src/community/masked-view/MaskedView.ios.tsx +5 -2
- package/src/community/menu/types.tsx +2 -2
- package/src/community/pager-view/types.tsx +2 -2
- package/src/community/segmented-control/types.tsx +2 -2
- package/src/community/slider/types.tsx +2 -2
- package/src/jetpack-compose/AlertDialog/index.tsx +2 -2
- package/src/jetpack-compose/AnimatedVisibility/index.tsx +2 -2
- package/src/jetpack-compose/Badge/index.tsx +2 -2
- package/src/jetpack-compose/BadgedBox/index.tsx +2 -2
- package/src/jetpack-compose/BasicAlertDialog/index.tsx +2 -2
- package/src/jetpack-compose/Box/index.tsx +2 -2
- package/src/jetpack-compose/Button/index.tsx +2 -2
- package/src/jetpack-compose/Card/index.tsx +6 -6
- package/src/jetpack-compose/Carousel/index.tsx +6 -6
- package/src/jetpack-compose/Checkbox/index.tsx +4 -4
- package/src/jetpack-compose/Chip/index.tsx +8 -8
- package/src/jetpack-compose/Column/index.tsx +2 -2
- package/src/jetpack-compose/DatePicker/index.tsx +6 -6
- package/src/jetpack-compose/DockedSearchBar/index.tsx +2 -2
- package/src/jetpack-compose/DropdownMenu/DropdownMenuItem.tsx +2 -2
- package/src/jetpack-compose/DropdownMenu/index.tsx +2 -2
- package/src/jetpack-compose/ExposedDropdownMenuBox/ExposedDropdownMenu.tsx +2 -2
- package/src/jetpack-compose/ExposedDropdownMenuBox/index.tsx +2 -2
- package/src/jetpack-compose/FloatingActionButton/index.tsx +6 -6
- package/src/jetpack-compose/FlowRow/index.tsx +2 -2
- package/src/jetpack-compose/HorizontalFloatingToolbar/index.tsx +4 -4
- package/src/jetpack-compose/HorizontalPager/index.tsx +2 -2
- package/src/jetpack-compose/Host/index.tsx +2 -2
- package/src/jetpack-compose/Icon/index.tsx +2 -2
- package/src/jetpack-compose/IconButton/index.tsx +2 -2
- package/src/jetpack-compose/LazyColumn/index.tsx +2 -2
- package/src/jetpack-compose/LazyRow/index.tsx +2 -2
- package/src/jetpack-compose/ListItem/index.tsx +2 -2
- package/src/jetpack-compose/LoadingIndicator/index.tsx +2 -2
- package/src/jetpack-compose/ModalBottomSheet/index.tsx +2 -2
- package/src/jetpack-compose/MultiChoiceSegmentedButtonRow/index.tsx +2 -2
- package/src/jetpack-compose/NavigationBar/index.tsx +4 -4
- package/src/jetpack-compose/Progress/index.tsx +7 -7
- package/src/jetpack-compose/PullToRefreshBox/index.tsx +4 -4
- package/src/jetpack-compose/RadioButton/index.tsx +2 -2
- package/src/jetpack-compose/Row/index.tsx +2 -2
- package/src/jetpack-compose/SearchBar/index.tsx +2 -2
- package/src/jetpack-compose/SegmentedButton/index.tsx +2 -2
- package/src/jetpack-compose/Shape/index.tsx +2 -2
- package/src/jetpack-compose/SingleChoiceSegmentedButtonRow/index.tsx +2 -2
- package/src/jetpack-compose/Slider/index.tsx +2 -2
- package/src/jetpack-compose/Snackbar/index.tsx +4 -4
- package/src/jetpack-compose/Spacer/index.tsx +2 -2
- package/src/jetpack-compose/Surface/index.tsx +2 -2
- package/src/jetpack-compose/Switch/index.tsx +2 -2
- package/src/jetpack-compose/SyncSwitch/index.tsx +2 -2
- package/src/jetpack-compose/Text/index.tsx +2 -2
- package/src/jetpack-compose/TextField/BasicTextField.tsx +2 -2
- package/src/jetpack-compose/TextField/TextField.tsx +4 -4
- package/src/jetpack-compose/ToggleButton/index.tsx +2 -2
- package/src/jetpack-compose/Tooltip/index.tsx +6 -6
- package/src/swift-ui/AccessoryWidgetBackground/index.tsx +1 -1
- package/src/swift-ui/Alert/index.tsx +2 -2
- package/src/swift-ui/BottomSheet/index.tsx +2 -2
- package/src/swift-ui/Button/index.tsx +2 -2
- package/src/swift-ui/Chart/index.tsx +2 -2
- package/src/swift-ui/ColorPicker/index.tsx +2 -2
- package/src/swift-ui/ConfirmationDialog/index.tsx +2 -2
- package/src/swift-ui/ContextMenu/types.ts +4 -4
- package/src/swift-ui/DatePicker/index.tsx +2 -2
- package/src/swift-ui/Divider/index.tsx +1 -1
- package/src/swift-ui/Gauge/index.tsx +2 -2
- package/src/swift-ui/GlassEffectContainer/index.tsx +2 -2
- package/src/swift-ui/Grid/index.tsx +2 -2
- package/src/swift-ui/HStack/index.tsx +2 -2
- package/src/swift-ui/Host/index.tsx +12 -3
- package/src/swift-ui/Label/index.tsx +2 -2
- package/src/swift-ui/LabeledContent/index.tsx +2 -2
- package/src/swift-ui/LazyHStack/index.tsx +2 -2
- package/src/swift-ui/LazyVStack/index.tsx +2 -2
- package/src/swift-ui/Link/index.tsx +2 -2
- package/src/swift-ui/List/ListForEach.tsx +2 -2
- package/src/swift-ui/Mask/index.tsx +2 -2
- package/src/swift-ui/Menu/types.ts +2 -2
- package/src/swift-ui/Namespace.tsx +2 -2
- package/src/swift-ui/Overlay/index.tsx +2 -2
- package/src/swift-ui/Popover/index.tsx +2 -2
- package/src/swift-ui/ProgressView/index.tsx +2 -2
- package/src/swift-ui/RNHostView.tsx +2 -2
- package/src/swift-ui/ScrollView/index.tsx +2 -2
- package/src/swift-ui/Section/index.tsx +2 -2
- package/src/swift-ui/SecureField/index.tsx +2 -2
- package/src/swift-ui/ShareLink/index.tsx +2 -2
- package/src/swift-ui/Slider/index.tsx +2 -2
- package/src/swift-ui/Stepper/index.tsx +2 -2
- package/src/swift-ui/SwipeActions/index.tsx +4 -4
- package/src/swift-ui/SyncToggle/index.tsx +2 -2
- package/src/swift-ui/TabView/Tab.tsx +2 -2
- package/src/swift-ui/TabView/index.tsx +2 -2
- package/src/swift-ui/TextField/index.tsx +2 -2
- package/src/swift-ui/Toggle/index.tsx +2 -2
- package/src/swift-ui/VStack/index.tsx +2 -2
- package/src/swift-ui/ZStack/index.tsx +2 -2
- package/src/swift-ui/modifiers/index.ts +161 -0
- package/src/swift-ui/modifiers/presentationModifiers.ts +22 -0
- package/src/ts-declarations/react-native-web.d.ts +31 -3
- package/src/universal/Button/index.tsx +83 -35
- package/src/universal/Checkbox/index.tsx +85 -30
- package/src/universal/Collapsible/index.tsx +5 -17
- package/src/universal/FieldGroup/FieldGroup.tsx +5 -15
- package/src/universal/FieldGroup/FieldSection.tsx +14 -31
- package/src/universal/Host/index.tsx +44 -30
- package/src/universal/Host/types.ts +17 -2
- package/src/universal/ListItem/ListItem.android.tsx +10 -2
- package/src/universal/ListItem/ListItem.ios.tsx +23 -6
- package/src/universal/ListItem/types.ts +10 -0
- package/src/universal/Picker/Picker.tsx +74 -29
- package/src/universal/Slider/index.tsx +90 -9
- package/src/universal/Switch/index.android.tsx +2 -2
- package/src/universal/Switch/index.tsx +77 -18
- package/src/universal/TextInput/index.tsx +49 -13
- package/src/universal/hooks.ts +25 -1
- package/src/universal/keyboardEvent.fx.ts +28 -0
- package/src/universal/webUtils.ts +245 -0
- package/CLAUDE.md +0 -54
- package/CONTRIBUTING.md +0 -30
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.18/expo.modules.ui-56.0.18.pom.sha512 +0 -1
|
@@ -19,14 +19,22 @@ function wrapStrings(node: ReactNode): ReactNode {
|
|
|
19
19
|
* Delegates to Material 3 `ListItem` and applies `clickable` for tap handling.
|
|
20
20
|
*/
|
|
21
21
|
export function ListItem(props: ListItemProps) {
|
|
22
|
-
const {
|
|
22
|
+
const {
|
|
23
|
+
children,
|
|
24
|
+
onPress,
|
|
25
|
+
leading: leadingProp,
|
|
26
|
+
trailing: trailingProp,
|
|
27
|
+
supportingText,
|
|
28
|
+
modifiers,
|
|
29
|
+
} = props;
|
|
23
30
|
const slots = extractListItemSlots(children);
|
|
24
31
|
const leading = slots.leading ?? leadingProp;
|
|
25
32
|
const trailing = slots.trailing ?? trailingProp;
|
|
26
33
|
const supporting = slots.supporting ?? supportingText;
|
|
34
|
+
const itemModifiers = [...(onPress ? [clickable(onPress)] : []), ...(modifiers ?? [])];
|
|
27
35
|
|
|
28
36
|
return (
|
|
29
|
-
<ComposeListItem modifiers={
|
|
37
|
+
<ComposeListItem modifiers={itemModifiers.length ? itemModifiers : undefined}>
|
|
30
38
|
<ComposeListItem.HeadlineContent>
|
|
31
39
|
<>{wrapStrings(slots.headline)}</>
|
|
32
40
|
</ComposeListItem.HeadlineContent>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Button, HStack, Spacer, Text, VStack } from '@expo/ui/swift-ui';
|
|
1
|
+
import { Button, HStack, RNHostView, Spacer, Text, VStack } from '@expo/ui/swift-ui';
|
|
2
2
|
import { buttonStyle, contentShape, foregroundStyle, shapes } from '@expo/ui/swift-ui/modifiers';
|
|
3
|
-
import { Children, type ReactNode } from 'react';
|
|
3
|
+
import { Children, isValidElement, type ReactNode } from 'react';
|
|
4
4
|
|
|
5
|
+
import { omitUserOverridden } from '../modifierUtils';
|
|
5
6
|
import { extractListItemSlots } from './ListItemSlots';
|
|
6
7
|
import type { ListItemProps } from './types';
|
|
7
8
|
|
|
@@ -22,6 +23,16 @@ function renderSupporting(node: ReactNode): ReactNode {
|
|
|
22
23
|
return node;
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
// A raw RN view (e.g. `<View style={{ width: 20, height: 20 }} />`) has no intrinsic size, so when
|
|
27
|
+
// embedded directly in the SwiftUI row it stretches to fill the available space instead of honoring
|
|
28
|
+
// its layout size. Wrap each accessory in `RNHostView matchContents` so SwiftUI pins it to the RN
|
|
29
|
+
// content's measured size. SwiftUI-native content (e.g. `Text`/`Image`) renders at its natural size.
|
|
30
|
+
function renderAccessory(node: ReactNode): ReactNode {
|
|
31
|
+
const wrapped = wrapStrings(node);
|
|
32
|
+
if (!isValidElement(wrapped)) return wrapped;
|
|
33
|
+
return <RNHostView matchContents>{wrapped}</RNHostView>;
|
|
34
|
+
}
|
|
35
|
+
|
|
25
36
|
/**
|
|
26
37
|
* iOS implementation of `ListItem`.
|
|
27
38
|
* Wraps a plain SwiftUI `Button` and applies `contentShape(.rectangle())` so the full row rectangle registers taps, including the gap between slots.
|
|
@@ -34,22 +45,28 @@ export function ListItem(props: ListItemProps) {
|
|
|
34
45
|
trailing: trailingProp,
|
|
35
46
|
supportingText,
|
|
36
47
|
testID,
|
|
48
|
+
modifiers,
|
|
37
49
|
} = props;
|
|
38
50
|
const slots = extractListItemSlots(children);
|
|
39
51
|
const leading = slots.leading ?? leadingProp;
|
|
40
52
|
const trailing = slots.trailing ?? trailingProp;
|
|
41
53
|
const supporting = slots.supporting ?? supportingText;
|
|
42
54
|
|
|
55
|
+
const buttonModifiers = [
|
|
56
|
+
...omitUserOverridden([buttonStyle('plain')], modifiers),
|
|
57
|
+
...(modifiers ?? []),
|
|
58
|
+
];
|
|
59
|
+
|
|
43
60
|
return (
|
|
44
|
-
<Button onPress={onPress} modifiers={
|
|
45
|
-
<HStack
|
|
46
|
-
{
|
|
61
|
+
<Button onPress={onPress} modifiers={buttonModifiers} testID={testID}>
|
|
62
|
+
<HStack spacing={12} modifiers={[contentShape(shapes.rectangle())]}>
|
|
63
|
+
{renderAccessory(leading)}
|
|
47
64
|
<VStack alignment="leading" spacing={2}>
|
|
48
65
|
<>{wrapStrings(slots.headline)}</>
|
|
49
66
|
{supporting != null ? renderSupporting(supporting) : null}
|
|
50
67
|
</VStack>
|
|
51
68
|
<Spacer />
|
|
52
|
-
{
|
|
69
|
+
{renderAccessory(trailing)}
|
|
53
70
|
</HStack>
|
|
54
71
|
</Button>
|
|
55
72
|
);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
+
import type { ModifierConfig } from '../../types';
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* Props for the [`ListItem.Leading`](#listitemleading) slot marker.
|
|
5
7
|
*/
|
|
@@ -64,4 +66,12 @@ export interface ListItemProps {
|
|
|
64
66
|
* Identifier used to locate the component in end-to-end tests.
|
|
65
67
|
*/
|
|
66
68
|
testID?: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Platform-specific modifier escape hatch. Pass an array of modifier configs
|
|
72
|
+
* from `@expo/ui/swift-ui/modifiers` or `@expo/ui/jetpack-compose/modifiers`.
|
|
73
|
+
* On iOS these are applied to the underlying SwiftUI `Button` and can override
|
|
74
|
+
* its default `buttonStyle(.plain)`.
|
|
75
|
+
*/
|
|
76
|
+
modifiers?: ModifierConfig[];
|
|
67
77
|
}
|
|
@@ -1,11 +1,53 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { StyleSheet, unstable_createElement, type ViewProps } from 'react-native';
|
|
1
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
2
|
|
|
3
|
+
import { colors, createWebComponent, durations, easings, shadows } from '../webUtils';
|
|
4
4
|
import { extractPickerItems } from './PickerItem';
|
|
5
5
|
import type { PickerItemValue, PickerProps } from './types';
|
|
6
|
+
import { useFocusVisible } from '../hooks';
|
|
6
7
|
|
|
7
|
-
const Select = (
|
|
8
|
-
|
|
8
|
+
const Select = createWebComponent('select');
|
|
9
|
+
const Svg = createWebComponent('svg');
|
|
10
|
+
|
|
11
|
+
const styles = StyleSheet.create({
|
|
12
|
+
select: {
|
|
13
|
+
appearance: 'none',
|
|
14
|
+
backgroundColor: colors.background,
|
|
15
|
+
borderColor: colors.gray[200],
|
|
16
|
+
borderRadius: 8,
|
|
17
|
+
borderStyle: 'solid',
|
|
18
|
+
borderWidth: 1,
|
|
19
|
+
boxShadow: shadows.input,
|
|
20
|
+
boxSizing: 'border-box',
|
|
21
|
+
color: colors.gray[900],
|
|
22
|
+
cursor: 'pointer',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
fontFamily:
|
|
25
|
+
'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
|
|
26
|
+
fontSize: 14,
|
|
27
|
+
height: 40,
|
|
28
|
+
outlineStyle: 'solid',
|
|
29
|
+
outlineWidth: 0,
|
|
30
|
+
paddingLeft: 12,
|
|
31
|
+
paddingRight: 36,
|
|
32
|
+
paddingVertical: 0,
|
|
33
|
+
transitionProperty: 'border-color, box-shadow',
|
|
34
|
+
transitionDuration: durations.fast,
|
|
35
|
+
transitionTimingFunction: easings.standard,
|
|
36
|
+
},
|
|
37
|
+
focused: {
|
|
38
|
+
borderColor: colors.primary[500],
|
|
39
|
+
boxShadow: shadows.focus,
|
|
40
|
+
},
|
|
41
|
+
arrow: {
|
|
42
|
+
height: 5,
|
|
43
|
+
width: 9,
|
|
44
|
+
pointerEvents: 'none',
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
right: 12,
|
|
47
|
+
top: '50%',
|
|
48
|
+
transform: 'translateY(-50%)',
|
|
49
|
+
},
|
|
50
|
+
});
|
|
9
51
|
|
|
10
52
|
/**
|
|
11
53
|
* A single-selection input.
|
|
@@ -19,34 +61,37 @@ export function Picker<T extends PickerItemValue>({
|
|
|
19
61
|
testID,
|
|
20
62
|
}: PickerProps<T>) {
|
|
21
63
|
const items = extractPickerItems<T>(children);
|
|
64
|
+
const { focusVisible, onFocus, onBlur } = useFocusVisible();
|
|
22
65
|
|
|
23
66
|
return (
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
67
|
+
<View>
|
|
68
|
+
<Select
|
|
69
|
+
disabled={!enabled}
|
|
70
|
+
value={String(selectedValue)}
|
|
71
|
+
onFocus={onFocus}
|
|
72
|
+
onBlur={onBlur}
|
|
73
|
+
testID={testID}
|
|
74
|
+
onChange={(e) => {
|
|
75
|
+
const index = e.target.selectedIndex;
|
|
76
|
+
const item = items[index];
|
|
77
|
+
if (item) onValueChange(item.value);
|
|
78
|
+
}}
|
|
79
|
+
style={[styles.select, focusVisible && styles.focused]}>
|
|
80
|
+
{items.map((item) => (
|
|
81
|
+
<option key={String(item.value)} value={String(item.value)}>
|
|
82
|
+
{item.label}
|
|
83
|
+
</option>
|
|
84
|
+
))}
|
|
85
|
+
</Select>
|
|
86
|
+
|
|
87
|
+
<Svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 8" style={styles.arrow}>
|
|
88
|
+
<path
|
|
89
|
+
d="M12.293.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6A1 1 0 1 1 1.707.293L7 5.586z"
|
|
90
|
+
fill={colors.gray[500]}
|
|
91
|
+
/>
|
|
92
|
+
</Svg>
|
|
93
|
+
</View>
|
|
40
94
|
);
|
|
41
95
|
}
|
|
42
96
|
|
|
43
|
-
const styles = StyleSheet.create({
|
|
44
|
-
select: {
|
|
45
|
-
fontFamily:
|
|
46
|
-
'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
|
|
47
|
-
fontSize: 14,
|
|
48
|
-
margin: 0,
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
|
|
52
97
|
export * from './types';
|
|
@@ -1,22 +1,95 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { StyleSheet, unstable_createElement, View, type ViewProps } from 'react-native';
|
|
1
|
+
import { StyleSheet, View, type ViewStyle } from 'react-native';
|
|
3
2
|
|
|
3
|
+
import { colors, createWebComponent, css, durations, easings, shadows } from '../webUtils';
|
|
4
4
|
import type { SliderProps } from './types';
|
|
5
5
|
|
|
6
|
+
const Input = createWebComponent('input');
|
|
7
|
+
|
|
6
8
|
const styles = StyleSheet.create({
|
|
7
9
|
view: {
|
|
8
10
|
alignSelf: 'stretch',
|
|
9
11
|
justifyContent: 'center',
|
|
10
12
|
},
|
|
11
13
|
input: {
|
|
12
|
-
|
|
14
|
+
appearance: 'none',
|
|
15
|
+
backgroundColor: 'transparent',
|
|
13
16
|
cursor: 'pointer',
|
|
17
|
+
height: 22,
|
|
18
|
+
margin: 0,
|
|
19
|
+
padding: 0,
|
|
20
|
+
'--_track-bg': colors.gray[200],
|
|
21
|
+
'--_track-fill': colors.primary[500],
|
|
22
|
+
} as ViewStyle,
|
|
23
|
+
disabled: {
|
|
24
|
+
cursor: 'auto',
|
|
25
|
+
opacity: 0.5,
|
|
14
26
|
},
|
|
15
27
|
});
|
|
16
28
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
const sliderCss = css`
|
|
30
|
+
[data-expo-ui-slider]::-webkit-slider-runnable-track {
|
|
31
|
+
height: 4px;
|
|
32
|
+
border-radius: 999px;
|
|
33
|
+
background: linear-gradient(
|
|
34
|
+
to right,
|
|
35
|
+
var(--_track-fill) 0 var(--_pct),
|
|
36
|
+
var(--_track-bg) var(--_pct) 100%
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[data-expo-ui-slider]::-moz-range-track {
|
|
41
|
+
height: 4px;
|
|
42
|
+
border-radius: 999px;
|
|
43
|
+
background: var(--_track-bg);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
[data-expo-ui-slider]::-moz-range-progress {
|
|
47
|
+
height: 4px;
|
|
48
|
+
border-radius: 999px;
|
|
49
|
+
background: var(--_track-fill);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[data-expo-ui-slider]::-webkit-slider-thumb {
|
|
53
|
+
-webkit-appearance: none;
|
|
54
|
+
appearance: none;
|
|
55
|
+
width: 18px;
|
|
56
|
+
height: 18px;
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
background: white;
|
|
59
|
+
border: 1.5px solid ${colors.primary[500]};
|
|
60
|
+
margin-top: -7px;
|
|
61
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
|
|
62
|
+
transition-property: transform, box-shadow;
|
|
63
|
+
transition-duration: ${durations.fast};
|
|
64
|
+
transition-timing-function: ${easings.standard};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
[data-expo-ui-slider]::-moz-range-thumb {
|
|
68
|
+
width: 18px;
|
|
69
|
+
height: 18px;
|
|
70
|
+
border-radius: 50%;
|
|
71
|
+
background: white;
|
|
72
|
+
border: 1.5px solid ${colors.primary[500]};
|
|
73
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
[data-expo-ui-slider]:hover:not(:disabled)::-webkit-slider-thumb {
|
|
77
|
+
transform: scale(1.1);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
[data-expo-ui-slider]:focus-visible {
|
|
81
|
+
outline: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
[data-expo-ui-slider]:focus-visible::-webkit-slider-thumb {
|
|
85
|
+
box-shadow: ${shadows.focus};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-expo-ui-slider]:active:not(:disabled)::-webkit-slider-thumb {
|
|
89
|
+
transform: scale(1.15);
|
|
90
|
+
box-shadow: 0 0 0 6px color-mix(in oklab, ${colors.primary[500]} 18%, transparent);
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
20
93
|
|
|
21
94
|
/**
|
|
22
95
|
* A control for selecting a value from a continuous or stepped range.
|
|
@@ -30,17 +103,25 @@ export function Slider({
|
|
|
30
103
|
disabled = false,
|
|
31
104
|
testID,
|
|
32
105
|
}: SliderProps) {
|
|
106
|
+
const pct = ((value - min) / (max - min)) * 100;
|
|
107
|
+
|
|
33
108
|
return (
|
|
34
109
|
<View style={styles.view}>
|
|
35
|
-
<
|
|
110
|
+
<style href="expo-ui-slider" precedence="expo-ui">
|
|
111
|
+
{sliderCss}
|
|
112
|
+
</style>
|
|
113
|
+
|
|
114
|
+
<Input
|
|
115
|
+
type="range"
|
|
116
|
+
dataSet={{ expoUiSlider: '' }}
|
|
36
117
|
value={value}
|
|
37
118
|
min={min}
|
|
38
119
|
max={max}
|
|
39
120
|
step={step ?? 'any'}
|
|
40
121
|
disabled={disabled}
|
|
41
|
-
onChange={(
|
|
122
|
+
onChange={({ target: { value } }) => onValueChange(Number.parseFloat(value))}
|
|
42
123
|
data-testid={testID}
|
|
43
|
-
style={styles.input}
|
|
124
|
+
style={[styles.input, { '--_pct': `${pct}%` } as ViewStyle, disabled && styles.disabled]}
|
|
44
125
|
/>
|
|
45
126
|
</View>
|
|
46
127
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Row, Switch as ComposeSwitch, Text } from '@expo/ui/jetpack-compose';
|
|
2
|
-
import { testID as testIDModifier } from '@expo/ui/jetpack-compose/modifiers';
|
|
2
|
+
import { testID as testIDModifier, weight } from '@expo/ui/jetpack-compose/modifiers';
|
|
3
3
|
|
|
4
4
|
import type { SwitchProps } from './types';
|
|
5
5
|
|
|
@@ -17,7 +17,7 @@ export function Switch({ value, onValueChange, label, disabled, testID, modifier
|
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
<Row verticalAlignment="center" horizontalArrangement={{ spacedBy: 8 }}>
|
|
20
|
-
<Text>{label}</Text>
|
|
20
|
+
<Text modifiers={[weight(1)]}>{label}</Text>
|
|
21
21
|
{toggle}
|
|
22
22
|
</Row>
|
|
23
23
|
);
|
|
@@ -1,19 +1,66 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
2
2
|
|
|
3
3
|
import type { SwitchProps } from './types';
|
|
4
|
+
import { useFocusVisible } from '../hooks';
|
|
5
|
+
import { colors, createWebComponent, durations, easings, shadows } from '../webUtils';
|
|
6
|
+
|
|
7
|
+
const Input = createWebComponent('input');
|
|
4
8
|
|
|
5
9
|
const styles = StyleSheet.create({
|
|
6
10
|
view: {
|
|
7
|
-
flexDirection: 'row',
|
|
8
11
|
alignItems: 'center',
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
cursor: 'pointer',
|
|
13
|
+
display: 'inline-flex',
|
|
14
|
+
flexDirection: 'row',
|
|
15
|
+
gap: 10,
|
|
11
16
|
},
|
|
12
|
-
|
|
17
|
+
viewDisabled: {
|
|
18
|
+
cursor: 'auto',
|
|
13
19
|
opacity: 0.5,
|
|
14
20
|
},
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
input: {
|
|
22
|
+
position: 'absolute',
|
|
23
|
+
opacity: 0,
|
|
24
|
+
pointerEvents: 'none',
|
|
25
|
+
margin: 0,
|
|
26
|
+
width: 0,
|
|
27
|
+
height: 0,
|
|
28
|
+
},
|
|
29
|
+
text: {
|
|
30
|
+
color: colors.foreground,
|
|
31
|
+
userSelect: 'none',
|
|
32
|
+
},
|
|
33
|
+
track: {
|
|
34
|
+
backgroundColor: colors.gray[300],
|
|
35
|
+
borderRadius: 22 / 2,
|
|
36
|
+
height: 22,
|
|
37
|
+
position: 'relative',
|
|
38
|
+
transitionDuration: durations.base,
|
|
39
|
+
transitionProperty: 'background-color',
|
|
40
|
+
transitionTimingFunction: easings.standard,
|
|
41
|
+
width: 36,
|
|
42
|
+
},
|
|
43
|
+
trackChecked: {
|
|
44
|
+
backgroundColor: colors.primary[500],
|
|
45
|
+
},
|
|
46
|
+
focused: {
|
|
47
|
+
boxShadow: shadows.focus,
|
|
48
|
+
},
|
|
49
|
+
thumb: {
|
|
50
|
+
position: 'absolute',
|
|
51
|
+
top: 2,
|
|
52
|
+
left: 2,
|
|
53
|
+
backgroundColor: '#fff',
|
|
54
|
+
borderRadius: 18 / 2,
|
|
55
|
+
boxShadow: '0 1px 2px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1)',
|
|
56
|
+
height: 18,
|
|
57
|
+
width: 18,
|
|
58
|
+
transitionDuration: durations.base,
|
|
59
|
+
transitionProperty: 'transform',
|
|
60
|
+
transitionTimingFunction: easings.standard,
|
|
61
|
+
},
|
|
62
|
+
thumbChecked: {
|
|
63
|
+
transform: 'translateX(14px)',
|
|
17
64
|
},
|
|
18
65
|
});
|
|
19
66
|
|
|
@@ -21,19 +68,31 @@ const styles = StyleSheet.create({
|
|
|
21
68
|
* A toggle control that switches between on and off states.
|
|
22
69
|
*/
|
|
23
70
|
export function Switch({ value, onValueChange, label, disabled = false, testID }: SwitchProps) {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
if (label) {
|
|
27
|
-
return (
|
|
28
|
-
<View style={[styles.view, disabled && styles.disabled]}>
|
|
29
|
-
<Text style={isDark && styles.darkText}>{label}</Text>
|
|
30
|
-
<RNSwitch value={value} onValueChange={onValueChange} disabled={disabled} testID={testID} />
|
|
31
|
-
</View>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
71
|
+
const { focusVisible, onFocus, onBlur } = useFocusVisible();
|
|
34
72
|
|
|
35
73
|
return (
|
|
36
|
-
<
|
|
74
|
+
<View
|
|
75
|
+
aria-disabled={disabled}
|
|
76
|
+
role="label"
|
|
77
|
+
style={[styles.view, disabled && styles.viewDisabled]}>
|
|
78
|
+
<Input
|
|
79
|
+
type="checkbox"
|
|
80
|
+
role="switch"
|
|
81
|
+
onFocus={onFocus}
|
|
82
|
+
onBlur={onBlur}
|
|
83
|
+
checked={value}
|
|
84
|
+
disabled={disabled}
|
|
85
|
+
testID={testID}
|
|
86
|
+
style={styles.input}
|
|
87
|
+
onChange={({ target: { checked } }) => onValueChange(checked)}
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
{label != null && <Text style={styles.text}>{label}</Text>}
|
|
91
|
+
|
|
92
|
+
<View style={[styles.track, value && styles.trackChecked, focusVisible && styles.focused]}>
|
|
93
|
+
<View style={[styles.thumb, value && styles.thumbChecked]} />
|
|
94
|
+
</View>
|
|
95
|
+
</View>
|
|
37
96
|
);
|
|
38
97
|
}
|
|
39
98
|
|
|
@@ -1,11 +1,39 @@
|
|
|
1
|
-
import { useImperativeHandle, useRef } from 'react';
|
|
2
|
-
import { TextInput as RNTextInput, StyleSheet
|
|
1
|
+
import { useImperativeHandle, useRef, useState } from 'react';
|
|
2
|
+
import { TextInput as RNTextInput, StyleSheet } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { useNativeState } from '../State';
|
|
5
5
|
import type { TextInputProps } from './types';
|
|
6
|
+
import { colors, durations, easings, shadows } from '../webUtils';
|
|
6
7
|
|
|
7
8
|
const styles = StyleSheet.create({
|
|
8
|
-
|
|
9
|
+
input: {
|
|
10
|
+
backgroundColor: colors.background,
|
|
11
|
+
borderColor: colors.gray[200],
|
|
12
|
+
borderRadius: 8,
|
|
13
|
+
borderStyle: 'solid',
|
|
14
|
+
borderWidth: 1,
|
|
15
|
+
boxShadow: shadows.input,
|
|
16
|
+
boxSizing: 'border-box',
|
|
17
|
+
color: colors.gray[900],
|
|
18
|
+
display: 'flex',
|
|
19
|
+
fontSize: 14,
|
|
20
|
+
height: 40,
|
|
21
|
+
outlineStyle: 'solid',
|
|
22
|
+
outlineWidth: 0,
|
|
23
|
+
paddingHorizontal: 12,
|
|
24
|
+
paddingVertical: 0,
|
|
25
|
+
transitionDuration: durations.fast,
|
|
26
|
+
transitionProperty: 'border-color, box-shadow, background-color',
|
|
27
|
+
transitionTimingFunction: easings.standard,
|
|
28
|
+
},
|
|
29
|
+
focused: {
|
|
30
|
+
borderColor: colors.primary[500],
|
|
31
|
+
boxShadow: shadows.focus,
|
|
32
|
+
},
|
|
33
|
+
multiline: {
|
|
34
|
+
height: 'auto',
|
|
35
|
+
paddingVertical: 11,
|
|
36
|
+
},
|
|
9
37
|
});
|
|
10
38
|
|
|
11
39
|
export function TextInput({
|
|
@@ -45,7 +73,7 @@ export function TextInput({
|
|
|
45
73
|
onSelectionChange,
|
|
46
74
|
selectTextOnFocus,
|
|
47
75
|
}: TextInputProps) {
|
|
48
|
-
const
|
|
76
|
+
const [focused, setFocused] = useState(false);
|
|
49
77
|
const initialFallbackRef = useRef(defaultValue ?? '');
|
|
50
78
|
const fallback = useNativeState<string>(initialFallbackRef.current);
|
|
51
79
|
const state = value ?? fallback;
|
|
@@ -79,7 +107,7 @@ export function TextInput({
|
|
|
79
107
|
ref={innerRef}
|
|
80
108
|
value={state.value}
|
|
81
109
|
placeholder={placeholder}
|
|
82
|
-
placeholderTextColor={placeholderTextColor}
|
|
110
|
+
placeholderTextColor={placeholderTextColor ?? colors.gray[500]}
|
|
83
111
|
autoFocus={autoFocus}
|
|
84
112
|
editable={editable}
|
|
85
113
|
readOnly={readOnly}
|
|
@@ -98,15 +126,15 @@ export function TextInput({
|
|
|
98
126
|
returnKeyType={returnKeyType}
|
|
99
127
|
enterKeyHint={enterKeyHint}
|
|
100
128
|
cursorColor={cursorColor}
|
|
101
|
-
style={[
|
|
102
|
-
isDark && styles.darkInput,
|
|
103
|
-
style,
|
|
104
|
-
textStyle,
|
|
105
|
-
textAlign && textAlign !== 'auto' ? { textAlign } : null,
|
|
106
|
-
]}
|
|
107
129
|
onSubmitEditing={onSubmitEditing ? (e) => onSubmitEditing(e.nativeEvent.text) : undefined}
|
|
108
|
-
onFocus={
|
|
109
|
-
|
|
130
|
+
onFocus={() => {
|
|
131
|
+
setFocused(true);
|
|
132
|
+
onFocus?.();
|
|
133
|
+
}}
|
|
134
|
+
onBlur={() => {
|
|
135
|
+
setFocused(false);
|
|
136
|
+
onBlur?.();
|
|
137
|
+
}}
|
|
110
138
|
onChangeText={(text) => {
|
|
111
139
|
state.value = text;
|
|
112
140
|
onChangeText?.(text);
|
|
@@ -129,6 +157,14 @@ export function TextInput({
|
|
|
129
157
|
}
|
|
130
158
|
: undefined
|
|
131
159
|
}
|
|
160
|
+
style={[
|
|
161
|
+
styles.input,
|
|
162
|
+
focused && styles.focused,
|
|
163
|
+
multiline && styles.multiline,
|
|
164
|
+
style,
|
|
165
|
+
textStyle,
|
|
166
|
+
textAlign && textAlign !== 'auto' ? { textAlign } : null,
|
|
167
|
+
]}
|
|
132
168
|
/>
|
|
133
169
|
);
|
|
134
170
|
}
|
package/src/universal/hooks.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { useEffect, useRef } from 'react';
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { wasLastInputKeyboard } from './keyboardEvent.fx';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Shared hook for onAppear/onDisappear lifecycle callbacks.
|
|
@@ -18,3 +20,25 @@ export function useUniversalLifecycle(onAppear?: () => void, onDisappear?: () =>
|
|
|
18
20
|
};
|
|
19
21
|
}, []);
|
|
20
22
|
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Tracks whether the element should display a keyboard focus indicator,
|
|
26
|
+
* mirroring the browser's `:focus-visible` heuristic. Spread the returned
|
|
27
|
+
* `onFocus`/`onBlur` onto a focusable element (e.g. `Pressable`) and read
|
|
28
|
+
* `focusVisible` to conditionally apply focus styles.
|
|
29
|
+
*/
|
|
30
|
+
export function useFocusVisible() {
|
|
31
|
+
const [focusVisible, setFocusVisible] = useState(false);
|
|
32
|
+
|
|
33
|
+
const onFocus = useCallback(() => {
|
|
34
|
+
if (wasLastInputKeyboard()) {
|
|
35
|
+
setFocusVisible(true);
|
|
36
|
+
}
|
|
37
|
+
}, []);
|
|
38
|
+
|
|
39
|
+
const onBlur = useCallback(() => {
|
|
40
|
+
setFocusVisible(false);
|
|
41
|
+
}, []);
|
|
42
|
+
|
|
43
|
+
return { focusVisible, onFocus, onBlur };
|
|
44
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
// Default to true on other platforms than web (native, SSR) so any focus
|
|
4
|
+
// event registers as keyboard-driven there. On web, a pointer event flips this
|
|
5
|
+
// to false before the focus event fires.
|
|
6
|
+
let lastInputWasKeyboard = Platform.OS !== 'web';
|
|
7
|
+
|
|
8
|
+
export const wasLastInputKeyboard = () => lastInputWasKeyboard;
|
|
9
|
+
|
|
10
|
+
if (Platform.OS === 'web' && typeof window !== 'undefined') {
|
|
11
|
+
window.addEventListener(
|
|
12
|
+
'keydown',
|
|
13
|
+
(event) => {
|
|
14
|
+
if (!event.altKey && !event.ctrlKey && !event.metaKey) {
|
|
15
|
+
lastInputWasKeyboard = true;
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
true
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const listener = () => {
|
|
22
|
+
lastInputWasKeyboard = false;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
window.addEventListener('mousedown', listener, true);
|
|
26
|
+
window.addEventListener('pointerdown', listener, true);
|
|
27
|
+
window.addEventListener('touchstart', listener, true);
|
|
28
|
+
}
|