@expo/ui 55.0.0-preview.6 → 55.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/android/build.gradle +27 -8
- package/android/src/main/java/expo/modules/ui/BasicAlertDialogView.kt +26 -0
- package/android/src/main/java/expo/modules/ui/BottomSheetView.kt +12 -37
- package/android/src/main/java/expo/modules/ui/CardView.kt +72 -0
- package/android/src/main/java/expo/modules/ui/CarouselView.kt +2 -5
- package/android/src/main/java/expo/modules/ui/ComposeViews.kt +91 -130
- package/android/src/main/java/expo/modules/ui/DatePickerView.kt +2 -2
- package/android/src/main/java/expo/modules/ui/DividerView.kt +1 -1
- package/android/src/main/java/expo/modules/ui/DockedSearchBarView.kt +53 -0
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +136 -17
- package/android/src/main/java/expo/modules/ui/FilterChipView.kt +59 -0
- package/android/src/main/java/expo/modules/ui/HorizontalFloatingToolbarView.kt +63 -0
- package/android/src/main/java/expo/modules/ui/LazyColumnView.kt +95 -0
- package/android/src/main/java/expo/modules/ui/ListItemView.kt +89 -0
- package/android/src/main/java/expo/modules/ui/MaterialShapes.kt +77 -0
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +168 -30
- package/android/src/main/java/expo/modules/ui/PickerView.kt +2 -2
- package/android/src/main/java/expo/modules/ui/ProgressView.kt +1 -1
- package/android/src/main/java/expo/modules/ui/PullToRefreshBoxView.kt +40 -0
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +87 -0
- package/android/src/main/java/expo/modules/ui/RadioButtonView.kt +28 -0
- package/android/src/main/java/expo/modules/ui/SearchBarView.kt +60 -0
- package/android/src/main/java/expo/modules/ui/ShapeView.kt +36 -5
- package/android/src/main/java/expo/modules/ui/SliderView.kt +1 -1
- package/android/src/main/java/expo/modules/ui/SlotView.kt +53 -0
- package/android/src/main/java/expo/modules/ui/SpacerView.kt +15 -0
- package/android/src/main/java/expo/modules/ui/SurfaceView.kt +36 -0
- package/android/src/main/java/expo/modules/ui/SwitchView.kt +24 -4
- package/android/src/main/java/expo/modules/ui/TextButtonView.kt +33 -0
- package/android/src/main/java/expo/modules/ui/TextInputView.kt +1 -2
- package/android/src/main/java/expo/modules/ui/TextView.kt +194 -0
- package/android/src/main/java/expo/modules/ui/ToggleButtonView.kt +96 -0
- package/android/src/main/java/expo/modules/ui/Utils.kt +6 -0
- package/android/src/main/java/expo/modules/ui/button/Button.kt +1 -1
- package/android/src/main/java/expo/modules/ui/button/IconButton.kt +2 -6
- package/android/src/main/java/expo/modules/ui/convertibles/Alignment.kt +112 -0
- package/android/src/main/java/expo/modules/ui/convertibles/Arrangement.kt +72 -0
- package/android/src/main/java/expo/modules/ui/icon/IconView.kt +159 -0
- package/android/src/main/java/expo/modules/ui/icon/ResourceIdHelper.kt +47 -0
- package/android/src/main/java/expo/modules/ui/icon/VectorIconLoader.kt +369 -0
- package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +1 -1
- package/build/jetpack-compose/AlertDialog/index.d.ts.map +1 -1
- package/build/jetpack-compose/BasicAlertDialog/index.d.ts +22 -0
- package/build/jetpack-compose/BasicAlertDialog/index.d.ts.map +1 -0
- package/build/jetpack-compose/Button/index.d.ts.map +1 -1
- package/build/jetpack-compose/Card/index.d.ts +40 -0
- package/build/jetpack-compose/Card/index.d.ts.map +1 -0
- package/build/jetpack-compose/Carousel/index.d.ts.map +1 -1
- package/build/jetpack-compose/Chip/index.d.ts +0 -4
- package/build/jetpack-compose/Chip/index.d.ts.map +1 -1
- package/build/jetpack-compose/ContextMenu/index.d.ts.map +1 -1
- package/build/jetpack-compose/DatePicker/index.d.ts +1 -12
- package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
- package/build/jetpack-compose/Divider/index.d.ts.map +1 -1
- package/build/jetpack-compose/DockedSearchBar/index.d.ts +30 -0
- package/build/jetpack-compose/DockedSearchBar/index.d.ts.map +1 -0
- package/build/jetpack-compose/ExpoUIModule.d.ts +2 -0
- package/build/jetpack-compose/ExpoUIModule.d.ts.map +1 -0
- package/build/jetpack-compose/FilterChip/index.d.ts +49 -0
- package/build/jetpack-compose/FilterChip/index.d.ts.map +1 -0
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts +41 -0
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts.map +1 -0
- package/build/jetpack-compose/Icon/index.d.ts +112 -0
- package/build/jetpack-compose/Icon/index.d.ts.map +1 -0
- package/build/jetpack-compose/IconButton/index.d.ts +0 -4
- package/build/jetpack-compose/IconButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/LazyColumn/index.d.ts +55 -0
- package/build/jetpack-compose/LazyColumn/index.d.ts.map +1 -0
- package/build/jetpack-compose/ListItem/index.d.ts +81 -0
- package/build/jetpack-compose/ListItem/index.d.ts.map +1 -0
- package/build/jetpack-compose/MaterialSymbolsAssetsTransformer.fx.d.ts +2 -0
- package/build/jetpack-compose/MaterialSymbolsAssetsTransformer.fx.d.ts.map +1 -0
- package/build/jetpack-compose/ModalBottomSheet/index.d.ts +34 -0
- package/build/jetpack-compose/ModalBottomSheet/index.d.ts.map +1 -0
- package/build/jetpack-compose/Picker/index.d.ts +0 -6
- package/build/jetpack-compose/Picker/index.d.ts.map +1 -1
- package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
- package/build/jetpack-compose/PullToRefreshBox/index.d.ts +31 -0
- package/build/jetpack-compose/PullToRefreshBox/index.d.ts.map +1 -0
- package/build/jetpack-compose/RNHostView/index.d.ts +28 -0
- package/build/jetpack-compose/RNHostView/index.d.ts.map +1 -0
- package/build/jetpack-compose/RadioButton/index.d.ts +20 -0
- package/build/jetpack-compose/RadioButton/index.d.ts.map +1 -0
- package/build/jetpack-compose/SearchBar/index.d.ts +47 -0
- package/build/jetpack-compose/SearchBar/index.d.ts.map +1 -0
- package/build/jetpack-compose/Shape/index.d.ts +29 -2
- package/build/jetpack-compose/Shape/index.d.ts.map +1 -1
- package/build/jetpack-compose/Slider/index.d.ts +1 -9
- package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
- package/build/jetpack-compose/Spacer/index.d.ts +22 -0
- package/build/jetpack-compose/Spacer/index.d.ts.map +1 -0
- package/build/jetpack-compose/Surface/index.d.ts +44 -0
- package/build/jetpack-compose/Surface/index.d.ts.map +1 -0
- package/build/jetpack-compose/Switch/index.d.ts +17 -9
- package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
- package/build/jetpack-compose/Text/index.d.ts +182 -0
- package/build/jetpack-compose/Text/index.d.ts.map +1 -0
- package/build/jetpack-compose/TextButton/index.d.ts +29 -0
- package/build/jetpack-compose/TextButton/index.d.ts.map +1 -0
- package/build/jetpack-compose/TextInput/index.d.ts.map +1 -1
- package/build/jetpack-compose/ToggleButton/index.d.ts +54 -0
- package/build/jetpack-compose/ToggleButton/index.d.ts.map +1 -0
- package/build/jetpack-compose/index.d.ts +20 -1
- package/build/jetpack-compose/index.d.ts.map +1 -1
- package/build/jetpack-compose/layout.d.ts +16 -19
- package/build/jetpack-compose/layout.d.ts.map +1 -1
- package/build/jetpack-compose/modifiers/createModifier.d.ts +18 -0
- package/build/jetpack-compose/modifiers/createModifier.d.ts.map +1 -0
- package/build/jetpack-compose/modifiers/index.d.ts +133 -41
- package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
- package/build/jetpack-compose/modifiers/utils.d.ts +15 -0
- package/build/jetpack-compose/modifiers/utils.d.ts.map +1 -0
- package/build/swift-ui/ConfirmationDialog/index.d.ts +47 -0
- package/build/swift-ui/ConfirmationDialog/index.d.ts.map +1 -0
- package/build/swift-ui/ScrollView/index.d.ts +16 -0
- package/build/swift-ui/ScrollView/index.d.ts.map +1 -0
- package/build/swift-ui/index.d.ts +2 -0
- package/build/swift-ui/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +12 -3
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/expo-module.config.json +2 -1
- package/ios/ColorPickerView.swift +2 -2
- package/ios/ConfirmationDialog/ConfirmationDialog.swift +65 -0
- package/ios/ConfirmationDialog/ConfirmationDialogComponents.swift +26 -0
- package/ios/ConfirmationDialog/ConfirmationDialogProps.swift +15 -0
- package/ios/Convertibles/VisibilityOptions.swift +19 -0
- package/ios/ExpoUIModule.swift +5 -0
- package/ios/Modifiers/ForegroundStyleModifier.swift +124 -0
- package/ios/Modifiers/PresentationModifiers.swift +1 -18
- package/ios/Modifiers/ViewModifierRegistry.swift +30 -121
- package/ios/ScrollViewComponent.swift +23 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.module → 55.0.0/expo.modules.ui-55.0.0.module} +46 -28
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.pom → 55.0.0/expo.modules.ui-55.0.0.pom} +36 -7
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0/expo.modules.ui-55.0.0.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 -3
- package/src/jetpack-compose/AlertDialog/index.tsx +11 -1
- package/src/jetpack-compose/BasicAlertDialog/index.tsx +51 -0
- package/src/jetpack-compose/Button/index.tsx +13 -1
- package/src/jetpack-compose/Card/index.tsx +62 -0
- package/src/jetpack-compose/Carousel/index.tsx +7 -1
- package/src/jetpack-compose/Chip/index.tsx +14 -7
- package/src/jetpack-compose/ContextMenu/index.tsx +5 -2
- package/src/jetpack-compose/DatePicker/index.tsx +5 -5
- package/src/jetpack-compose/Divider/index.tsx +13 -2
- package/src/jetpack-compose/DockedSearchBar/index.tsx +78 -0
- package/src/jetpack-compose/ExpoUIModule.ts +3 -0
- package/src/jetpack-compose/FilterChip/index.tsx +89 -0
- package/src/jetpack-compose/HorizontalFloatingToolbar/index.tsx +90 -0
- package/src/jetpack-compose/Icon/index.tsx +144 -0
- package/src/jetpack-compose/IconButton/index.tsx +5 -5
- package/src/jetpack-compose/LazyColumn/index.tsx +82 -0
- package/src/jetpack-compose/ListItem/index.tsx +129 -0
- package/src/jetpack-compose/MaterialSymbolsAssetsTransformer.fx.ts +22 -0
- package/src/jetpack-compose/ModalBottomSheet/index.tsx +61 -0
- package/src/jetpack-compose/Picker/index.tsx +6 -5
- package/src/jetpack-compose/Progress/index.tsx +14 -4
- package/src/jetpack-compose/PullToRefreshBox/index.tsx +66 -0
- package/src/jetpack-compose/RNHostView/index.tsx +56 -0
- package/src/jetpack-compose/RadioButton/index.tsx +48 -0
- package/src/jetpack-compose/SearchBar/index.tsx +96 -0
- package/src/jetpack-compose/Shape/index.tsx +65 -22
- package/src/jetpack-compose/Slider/index.tsx +6 -5
- package/src/jetpack-compose/Spacer/index.tsx +43 -0
- package/src/jetpack-compose/Surface/index.tsx +66 -0
- package/src/jetpack-compose/Switch/index.tsx +43 -8
- package/src/jetpack-compose/Text/index.tsx +274 -0
- package/src/jetpack-compose/TextButton/index.tsx +55 -0
- package/src/jetpack-compose/TextInput/index.tsx +5 -4
- package/src/jetpack-compose/ToggleButton/index.tsx +83 -0
- package/src/jetpack-compose/index.ts +21 -1
- package/src/jetpack-compose/layout.tsx +55 -70
- package/src/jetpack-compose/modifiers/createModifier.ts +27 -0
- package/src/jetpack-compose/modifiers/index.ts +204 -83
- package/src/jetpack-compose/modifiers/utils.ts +30 -0
- package/src/swift-ui/ConfirmationDialog/index.tsx +98 -0
- package/src/swift-ui/ScrollView/index.tsx +34 -0
- package/src/swift-ui/index.tsx +2 -0
- package/src/swift-ui/modifiers/index.ts +19 -3
- package/src/ts-declarations/react-native-assets.d.ts +31 -0
- package/build/jetpack-compose/BottomSheet/index.d.ts +0 -21
- package/build/jetpack-compose/BottomSheet/index.d.ts.map +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.0-preview.6/expo.modules.ui-55.0.0-preview.6.pom.sha512 +0 -1
- package/src/jetpack-compose/BottomSheet/index.tsx +0 -46
package/CHANGELOG.md
CHANGED
|
@@ -10,19 +10,39 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 55.0.0 — 2026-02-25
|
|
14
|
+
|
|
15
|
+
### 🎉 New features
|
|
16
|
+
|
|
17
|
+
- [iOS] Added `ConfirmationDialog` component. ([#43366](https://github.com/expo/expo/pull/43366) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
18
|
+
- [iOS] Added `monospacedDigit` modifier. ([#43328](https://github.com/expo/expo/pull/43328) by [@axeelz](https://github.com/axeelz))
|
|
19
|
+
|
|
20
|
+
## 55.0.0-preview.7 — 2026-02-20
|
|
21
|
+
|
|
22
|
+
### 🎉 New features
|
|
23
|
+
|
|
24
|
+
- [iOS] Added per-axis `scaleEffect` support (`{ x, y }`) to view modifiers. ([#43228](https://github.com/expo/expo/pull/43228) by [@ramonclaudio](https://github.com/ramonclaudio))
|
|
25
|
+
|
|
26
|
+
### 💡 Others
|
|
27
|
+
|
|
28
|
+
- [jetpack-compose] Added more views and modifiers. ([#42734](https://github.com/expo/expo/pull/42734) by [@kudo](https://github.com/kudo))
|
|
29
|
+
|
|
13
30
|
## 55.0.0-preview.6 — 2026-02-16
|
|
14
31
|
|
|
15
32
|
### 🎉 New features
|
|
16
33
|
|
|
17
34
|
- [iOS] - Support `Section` `footer` prop with `title` prop. ([#42966](https://github.com/expo/expo/pull/42966) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
18
35
|
- [iOS] Added `contentTransition` modifier. ([#42980](https://github.com/expo/expo/pull/42980) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
36
|
+
- [iOS] Added `ScrollView` component. ([#43162](https://github.com/expo/expo/pull/43162) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
19
37
|
- [iOS] Added `selection` and `onSelectionChange` to `presentationDetents` modifier for programmatic control of bottom sheet detents. ([#42910](https://github.com/expo/expo/pull/42910) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
20
38
|
|
|
21
39
|
### 🐛 Bug fixes
|
|
22
40
|
|
|
41
|
+
- [iOS] Fix `ColorPicker` `onSelectionChange` callback never firing due to native event name mismatch. ([#43180](https://github.com/expo/expo/pull/43180) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
23
42
|
- [iOS] Fix `clipShape` and `mask` modifiers silently falling through to `Rectangle()` for `capsule` and `ellipse` shapes. ([#43158](https://github.com/expo/expo/pull/43158) by [@ramonclaudio](https://github.com/ramonclaudio))
|
|
24
43
|
- [iOS] Fix rendering `0` in SwiftUI Text. ([#43036](https://github.com/expo/expo/pull/43036) by [@jakex7](https://github.com/jakex7))
|
|
25
44
|
- [iOS] Set initial state in `init` instead of `onAppear` in `DatePicker`, `Section`, `DisclosureGroup`, `Popover`, and `ColorPicker` components. ([#42933](https://github.com/expo/expo/pull/42933) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
45
|
+
- [iOS] Fix `foregroundStyle` hierarchical style not being applied correctly. ([#43233](https://github.com/expo/expo/pull/43233) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
26
46
|
|
|
27
47
|
## 55.0.0-preview.5 — 2026-02-08
|
|
28
48
|
|
package/android/build.gradle
CHANGED
|
@@ -12,13 +12,14 @@ apply plugin: 'expo-module-gradle-plugin'
|
|
|
12
12
|
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
|
|
13
13
|
|
|
14
14
|
group = 'expo.modules.ui'
|
|
15
|
-
version = '55.0.0
|
|
15
|
+
version = '55.0.0'
|
|
16
16
|
|
|
17
17
|
android {
|
|
18
18
|
namespace "expo.modules.ui"
|
|
19
19
|
defaultConfig {
|
|
20
20
|
versionCode 1
|
|
21
|
-
versionName "55.0.0
|
|
21
|
+
versionName "55.0.0"
|
|
22
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
22
23
|
}
|
|
23
24
|
buildFeatures {
|
|
24
25
|
compose true
|
|
@@ -26,14 +27,32 @@ android {
|
|
|
26
27
|
lintOptions {
|
|
27
28
|
abortOnError false
|
|
28
29
|
}
|
|
30
|
+
testOptions {
|
|
31
|
+
unitTests {
|
|
32
|
+
includeAndroidResources = true
|
|
33
|
+
}
|
|
34
|
+
}
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
dependencies {
|
|
32
|
-
implementation '
|
|
33
|
-
|
|
34
|
-
implementation
|
|
35
|
-
implementation 'androidx.compose.
|
|
36
|
-
implementation
|
|
38
|
+
implementation 'com.facebook.react:react-android'
|
|
39
|
+
|
|
40
|
+
implementation 'androidx.compose.foundation:foundation-android:1.10.2'
|
|
41
|
+
implementation 'androidx.compose.ui:ui-android:1.10.2'
|
|
42
|
+
implementation "androidx.compose.material3:material3:1.5.0-alpha13"
|
|
43
|
+
implementation 'androidx.compose.material3:material3-android:1.5.0-alpha13'
|
|
44
|
+
implementation 'androidx.lifecycle:lifecycle-runtime:2.10.0'
|
|
37
45
|
implementation 'androidx.fragment:fragment-ktx:1.8.9'
|
|
38
|
-
implementation "androidx.graphics:graphics-shapes:1.0
|
|
46
|
+
implementation "androidx.graphics:graphics-shapes:1.1.0"
|
|
47
|
+
implementation "com.squareup.okhttp3:okhttp:4.9.2"
|
|
48
|
+
implementation "androidx.core:core-ktx:1.17.0"
|
|
49
|
+
|
|
50
|
+
// Testing
|
|
51
|
+
testImplementation 'junit:junit:4.13.2'
|
|
52
|
+
testImplementation 'com.google.truth:truth:1.4.5'
|
|
53
|
+
testImplementation 'org.robolectric:robolectric:4.16.1'
|
|
54
|
+
testImplementation 'androidx.test:core:1.7.0'
|
|
55
|
+
testImplementation 'androidx.test:runner:1.7.0'
|
|
56
|
+
testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.2'
|
|
57
|
+
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2'
|
|
39
58
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
package expo.modules.ui
|
|
2
|
+
|
|
3
|
+
import androidx.compose.material3.BasicAlertDialog
|
|
4
|
+
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
5
|
+
import androidx.compose.runtime.Composable
|
|
6
|
+
import expo.modules.kotlin.views.ComposableScope
|
|
7
|
+
import expo.modules.kotlin.views.ComposeProps
|
|
8
|
+
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
9
|
+
|
|
10
|
+
data class BasicAlertDialogProps(
|
|
11
|
+
val modifiers: ModifierList = emptyList()
|
|
12
|
+
) : ComposeProps
|
|
13
|
+
|
|
14
|
+
@OptIn(ExperimentalMaterial3Api::class)
|
|
15
|
+
@Composable
|
|
16
|
+
fun FunctionalComposableScope.BasicAlertDialogContent(
|
|
17
|
+
props: BasicAlertDialogProps,
|
|
18
|
+
onDismissRequest: () -> Unit
|
|
19
|
+
) {
|
|
20
|
+
BasicAlertDialog(
|
|
21
|
+
onDismissRequest = { onDismissRequest() },
|
|
22
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
23
|
+
) {
|
|
24
|
+
Children(ComposableScope())
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,54 +1,29 @@
|
|
|
1
|
+
@file:OptIn(ExperimentalMaterial3Api::class)
|
|
2
|
+
|
|
1
3
|
package expo.modules.ui
|
|
2
4
|
|
|
3
|
-
import androidx.compose.foundation.layout.Box
|
|
4
|
-
import androidx.compose.foundation.layout.fillMaxHeight
|
|
5
5
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
6
6
|
import androidx.compose.material3.ModalBottomSheet
|
|
7
7
|
import androidx.compose.material3.rememberModalBottomSheetState
|
|
8
8
|
import androidx.compose.runtime.Composable
|
|
9
|
-
import androidx.compose.ui.Modifier
|
|
10
|
-
import expo.modules.kotlin.records.Field
|
|
11
|
-
import expo.modules.kotlin.records.Record
|
|
12
9
|
import expo.modules.kotlin.views.ComposableScope
|
|
13
10
|
import expo.modules.kotlin.views.ComposeProps
|
|
14
11
|
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
15
|
-
import java.io.Serializable
|
|
16
|
-
|
|
17
|
-
open class IsOpenedChangeEvent(
|
|
18
|
-
@Field open val isOpened: Boolean = false
|
|
19
|
-
) : Record, Serializable
|
|
20
|
-
|
|
21
|
-
@OptIn(ExperimentalMaterial3Api::class)
|
|
22
|
-
@Composable
|
|
23
|
-
fun BottomSheetComposable(skipPartiallyExpanded: Boolean, isOpened: Boolean, onIsOpenedChange: (Boolean) -> Unit, content: @Composable () -> Unit) {
|
|
24
|
-
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded)
|
|
25
12
|
|
|
26
|
-
|
|
27
|
-
ModalBottomSheet(
|
|
28
|
-
sheetState = sheetState,
|
|
29
|
-
modifier = Modifier.fillMaxHeight(),
|
|
30
|
-
onDismissRequest = { onIsOpenedChange(false) }
|
|
31
|
-
) {
|
|
32
|
-
content()
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
data class BottomSheetProps(
|
|
38
|
-
val isOpened: Boolean = false,
|
|
13
|
+
data class ModalBottomSheetProps(
|
|
39
14
|
val skipPartiallyExpanded: Boolean = false,
|
|
40
15
|
val modifiers: ModifierList = emptyList()
|
|
41
16
|
) : ComposeProps
|
|
42
17
|
|
|
43
18
|
@Composable
|
|
44
|
-
fun FunctionalComposableScope.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
|
|
19
|
+
fun FunctionalComposableScope.ModalBottomSheetContent(props: ModalBottomSheetProps, onDismissRequest: () -> Unit) {
|
|
20
|
+
val sheetState = rememberModalBottomSheetState(props.skipPartiallyExpanded)
|
|
21
|
+
|
|
22
|
+
ModalBottomSheet(
|
|
23
|
+
sheetState = sheetState,
|
|
24
|
+
onDismissRequest = { onDismissRequest() },
|
|
25
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
26
|
+
) {
|
|
27
|
+
Children(ComposableScope())
|
|
53
28
|
}
|
|
54
29
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
package expo.modules.ui
|
|
2
|
+
|
|
3
|
+
import android.graphics.Color
|
|
4
|
+
import androidx.compose.foundation.layout.ColumnScope
|
|
5
|
+
import androidx.compose.material3.Card
|
|
6
|
+
import androidx.compose.material3.CardDefaults
|
|
7
|
+
import androidx.compose.material3.ElevatedCard
|
|
8
|
+
import androidx.compose.material3.OutlinedCard
|
|
9
|
+
import androidx.compose.runtime.Composable
|
|
10
|
+
import expo.modules.kotlin.records.Field
|
|
11
|
+
import expo.modules.kotlin.records.Record
|
|
12
|
+
import expo.modules.kotlin.views.ComposableScope
|
|
13
|
+
import expo.modules.kotlin.views.ComposeProps
|
|
14
|
+
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
15
|
+
import expo.modules.kotlin.views.with
|
|
16
|
+
|
|
17
|
+
data class CardElementColors(
|
|
18
|
+
@Field val containerColor: Color? = null,
|
|
19
|
+
@Field val contentColor: Color? = null
|
|
20
|
+
) : Record
|
|
21
|
+
|
|
22
|
+
data class CardProps(
|
|
23
|
+
val variant: String = "default",
|
|
24
|
+
val color: Color? = null,
|
|
25
|
+
val elementColors: CardElementColors? = null,
|
|
26
|
+
val modifiers: ModifierList = emptyList()
|
|
27
|
+
) : ComposeProps
|
|
28
|
+
|
|
29
|
+
@Composable
|
|
30
|
+
fun FunctionalComposableScope.CardContent(props: CardProps) {
|
|
31
|
+
val modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
32
|
+
|
|
33
|
+
val colors = when {
|
|
34
|
+
props.elementColors != null -> CardDefaults.cardColors(
|
|
35
|
+
containerColor = props.elementColors.containerColor?.compose ?: androidx.compose.ui.graphics.Color.Unspecified,
|
|
36
|
+
contentColor = props.elementColors.contentColor?.compose ?: androidx.compose.ui.graphics.Color.Unspecified
|
|
37
|
+
)
|
|
38
|
+
props.color != null -> CardDefaults.cardColors(
|
|
39
|
+
containerColor = props.color.compose
|
|
40
|
+
)
|
|
41
|
+
else -> CardDefaults.cardColors()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
val content: @Composable ColumnScope.() -> Unit = {
|
|
45
|
+
val scope = ComposableScope().with(columnScope = this)
|
|
46
|
+
Children(scope)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
when (props.variant) {
|
|
50
|
+
"elevated" -> {
|
|
51
|
+
ElevatedCard(
|
|
52
|
+
modifier = modifier,
|
|
53
|
+
colors = colors,
|
|
54
|
+
content = content
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
"outlined" -> {
|
|
58
|
+
OutlinedCard(
|
|
59
|
+
modifier = modifier,
|
|
60
|
+
colors = colors,
|
|
61
|
+
content = content
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
else -> {
|
|
65
|
+
Card(
|
|
66
|
+
modifier = modifier,
|
|
67
|
+
colors = colors,
|
|
68
|
+
content = content
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
@file:OptIn(EitherType::class)
|
|
2
|
-
|
|
3
1
|
package expo.modules.ui
|
|
4
2
|
|
|
5
3
|
import androidx.compose.foundation.gestures.TargetedFlingBehavior
|
|
@@ -12,7 +10,6 @@ import androidx.compose.material3.carousel.rememberCarouselState
|
|
|
12
10
|
import androidx.compose.runtime.Composable
|
|
13
11
|
import androidx.compose.ui.unit.dp
|
|
14
12
|
import androidx.core.view.size
|
|
15
|
-
import expo.modules.kotlin.apifeatures.EitherType
|
|
16
13
|
import expo.modules.kotlin.records.Field
|
|
17
14
|
import expo.modules.kotlin.records.Record
|
|
18
15
|
import expo.modules.kotlin.types.Either
|
|
@@ -110,7 +107,7 @@ fun FunctionalComposableScope.CarouselContent(props: CarouselProps) {
|
|
|
110
107
|
HorizontalMultiBrowseCarousel(
|
|
111
108
|
state = carouselState,
|
|
112
109
|
preferredItemWidth = preferredItemWidth,
|
|
113
|
-
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope),
|
|
110
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher),
|
|
114
111
|
itemSpacing = itemSpacing,
|
|
115
112
|
flingBehavior = flingBehavior,
|
|
116
113
|
minSmallItemWidth = minSmallItemWidth,
|
|
@@ -126,7 +123,7 @@ fun FunctionalComposableScope.CarouselContent(props: CarouselProps) {
|
|
|
126
123
|
HorizontalUncontainedCarousel(
|
|
127
124
|
state = carouselState,
|
|
128
125
|
itemWidth = itemWidth,
|
|
129
|
-
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope),
|
|
126
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher),
|
|
130
127
|
itemSpacing = itemSpacing,
|
|
131
128
|
flingBehavior = flingBehavior,
|
|
132
129
|
contentPadding = contentPadding
|
|
@@ -1,176 +1,137 @@
|
|
|
1
|
+
@file:OptIn(ExperimentalMaterial3ExpressiveApi::class, ExperimentalLayoutApi::class)
|
|
2
|
+
|
|
1
3
|
package expo.modules.ui
|
|
2
4
|
|
|
3
5
|
import androidx.compose.foundation.layout.Arrangement
|
|
4
6
|
import androidx.compose.foundation.layout.Box
|
|
5
7
|
import androidx.compose.foundation.layout.Column
|
|
8
|
+
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
|
9
|
+
import androidx.compose.foundation.layout.FlowRow
|
|
6
10
|
import androidx.compose.foundation.layout.Row
|
|
7
|
-
import androidx.compose.material3.
|
|
11
|
+
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
|
12
|
+
import androidx.compose.material3.FloatingToolbarDefaults
|
|
13
|
+
import androidx.compose.material3.FloatingToolbarExitDirection
|
|
8
14
|
import androidx.compose.runtime.Composable
|
|
9
15
|
import androidx.compose.ui.Alignment
|
|
10
|
-
import androidx.compose.ui.
|
|
11
|
-
import androidx.compose.ui.
|
|
12
|
-
import androidx.compose.ui.unit.sp
|
|
16
|
+
import androidx.compose.ui.Modifier
|
|
17
|
+
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
|
13
18
|
import expo.modules.kotlin.types.Enumerable
|
|
14
19
|
import expo.modules.kotlin.views.ComposableScope
|
|
15
20
|
import expo.modules.kotlin.views.ComposeProps
|
|
16
21
|
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
17
22
|
import expo.modules.kotlin.views.with
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
fun toComposeArrangement(): Arrangement.Horizontal {
|
|
29
|
-
return when (this) {
|
|
30
|
-
START -> Arrangement.Start
|
|
31
|
-
END -> Arrangement.End
|
|
32
|
-
CENTER -> Arrangement.Center
|
|
33
|
-
SPACE_BETWEEN -> Arrangement.SpaceBetween
|
|
34
|
-
SPACE_AROUND -> Arrangement.SpaceAround
|
|
35
|
-
SPACE_EVENLY -> Arrangement.SpaceEvenly
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
enum class VerticalArrangement(val value: String) : Enumerable {
|
|
23
|
+
import expo.modules.kotlin.views.withIf
|
|
24
|
+
import expo.modules.ui.convertibles.HorizontalAlignment
|
|
25
|
+
import expo.modules.ui.convertibles.HorizontalArrangement
|
|
26
|
+
import expo.modules.ui.convertibles.VerticalAlignment
|
|
27
|
+
import expo.modules.ui.convertibles.ContentAlignment
|
|
28
|
+
import expo.modules.ui.convertibles.VerticalArrangement
|
|
29
|
+
import expo.modules.ui.convertibles.toComposeArrangement
|
|
30
|
+
|
|
31
|
+
enum class FloatingToolbarExitAlwaysScrollBehavior(val value: String) : Enumerable {
|
|
41
32
|
TOP("top"),
|
|
42
33
|
BOTTOM("bottom"),
|
|
43
|
-
CENTER("center"),
|
|
44
|
-
SPACE_BETWEEN("spaceBetween"),
|
|
45
|
-
SPACE_AROUND("spaceAround"),
|
|
46
|
-
SPACE_EVENLY("spaceEvenly");
|
|
47
|
-
|
|
48
|
-
fun toComposeArrangement(): Arrangement.Vertical {
|
|
49
|
-
return when (this) {
|
|
50
|
-
TOP -> Arrangement.Top
|
|
51
|
-
BOTTOM -> Arrangement.Bottom
|
|
52
|
-
CENTER -> Arrangement.Center
|
|
53
|
-
SPACE_BETWEEN -> Arrangement.SpaceBetween
|
|
54
|
-
SPACE_AROUND -> Arrangement.SpaceAround
|
|
55
|
-
SPACE_EVENLY -> Arrangement.SpaceEvenly
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
enum class HorizontalAlignment(val value: String) : Enumerable {
|
|
61
34
|
START("start"),
|
|
62
|
-
END("end")
|
|
63
|
-
CENTER("center");
|
|
35
|
+
END("end");
|
|
64
36
|
|
|
65
|
-
fun
|
|
37
|
+
fun toComposeExitDirection(): FloatingToolbarExitDirection {
|
|
66
38
|
return when (this) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
enum class VerticalAlignment(val value: String) : Enumerable {
|
|
75
|
-
TOP("top"),
|
|
76
|
-
BOTTOM("bottom"),
|
|
77
|
-
CENTER("center");
|
|
78
|
-
|
|
79
|
-
fun toComposeAlignment(): Alignment.Vertical {
|
|
80
|
-
return when (this) {
|
|
81
|
-
TOP -> Alignment.Top
|
|
82
|
-
BOTTOM -> Alignment.Bottom
|
|
83
|
-
CENTER -> Alignment.CenterVertically
|
|
39
|
+
TOP -> FloatingToolbarExitDirection.Top
|
|
40
|
+
BOTTOM -> FloatingToolbarExitDirection.Bottom
|
|
41
|
+
START -> FloatingToolbarExitDirection.Start
|
|
42
|
+
END -> FloatingToolbarExitDirection.End
|
|
84
43
|
}
|
|
85
44
|
}
|
|
86
45
|
}
|
|
87
46
|
|
|
88
47
|
data class LayoutProps(
|
|
89
|
-
val horizontalArrangement: HorizontalArrangement =
|
|
90
|
-
val verticalArrangement: VerticalArrangement =
|
|
91
|
-
val horizontalAlignment: HorizontalAlignment =
|
|
92
|
-
val verticalAlignment: VerticalAlignment =
|
|
48
|
+
val horizontalArrangement: HorizontalArrangement? = null,
|
|
49
|
+
val verticalArrangement: VerticalArrangement? = null,
|
|
50
|
+
val horizontalAlignment: HorizontalAlignment? = null,
|
|
51
|
+
val verticalAlignment: VerticalAlignment? = null,
|
|
52
|
+
val contentAlignment: ContentAlignment? = null,
|
|
53
|
+
val floatingToolbarExitAlwaysScrollBehavior: FloatingToolbarExitAlwaysScrollBehavior? = null,
|
|
93
54
|
val modifiers: ModifierList = emptyList()
|
|
94
55
|
) : ComposeProps
|
|
95
56
|
|
|
96
57
|
@Composable
|
|
97
58
|
internal fun FunctionalComposableScope.RowContent(props: LayoutProps) {
|
|
59
|
+
val scrollBehavior = props.floatingToolbarExitAlwaysScrollBehavior
|
|
60
|
+
?.toComposeExitDirection()
|
|
61
|
+
?.let {
|
|
62
|
+
FloatingToolbarDefaults.exitAlwaysScrollBehavior(exitDirection = it)
|
|
63
|
+
}
|
|
98
64
|
Row(
|
|
99
|
-
horizontalArrangement = props.horizontalArrangement
|
|
100
|
-
verticalAlignment = props.verticalAlignment
|
|
101
|
-
modifier = ModifierRegistry
|
|
65
|
+
horizontalArrangement = props.horizontalArrangement?.toComposeArrangement() ?: Arrangement.Start,
|
|
66
|
+
verticalAlignment = props.verticalAlignment?.toComposeAlignment() ?: Alignment.Top,
|
|
67
|
+
modifier = ModifierRegistry
|
|
68
|
+
.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
69
|
+
.then(if (scrollBehavior != null) Modifier.nestedScroll(scrollBehavior) else Modifier)
|
|
102
70
|
) {
|
|
103
|
-
|
|
71
|
+
val scope = ComposableScope()
|
|
72
|
+
.with(rowScope = this@Row)
|
|
73
|
+
.withIf(scrollBehavior != null) {
|
|
74
|
+
with(nestedScrollConnection = scrollBehavior)
|
|
75
|
+
}
|
|
76
|
+
Children(scope)
|
|
104
77
|
}
|
|
105
78
|
}
|
|
106
79
|
|
|
107
80
|
@Composable
|
|
108
|
-
internal fun FunctionalComposableScope.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
modifier = ModifierRegistry
|
|
81
|
+
internal fun FunctionalComposableScope.FlowRowContent(props: LayoutProps) {
|
|
82
|
+
FlowRow(
|
|
83
|
+
horizontalArrangement = props.horizontalArrangement?.toComposeArrangement() ?: Arrangement.Start,
|
|
84
|
+
verticalArrangement = props.verticalArrangement?.toComposeArrangement() ?: Arrangement.Top,
|
|
85
|
+
modifier = ModifierRegistry
|
|
86
|
+
.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
113
87
|
) {
|
|
114
|
-
|
|
88
|
+
val scope = ComposableScope()
|
|
89
|
+
.with(rowScope = this@FlowRow)
|
|
90
|
+
Children(scope)
|
|
115
91
|
}
|
|
116
92
|
}
|
|
117
93
|
|
|
118
94
|
@Composable
|
|
119
|
-
fun FunctionalComposableScope.
|
|
120
|
-
|
|
121
|
-
|
|
95
|
+
internal fun FunctionalComposableScope.ColumnContent(props: LayoutProps) {
|
|
96
|
+
val scrollBehavior = props.floatingToolbarExitAlwaysScrollBehavior
|
|
97
|
+
?.toComposeExitDirection()
|
|
98
|
+
?.let {
|
|
99
|
+
FloatingToolbarDefaults.exitAlwaysScrollBehavior(exitDirection = it)
|
|
100
|
+
}
|
|
101
|
+
Column(
|
|
102
|
+
verticalArrangement = props.verticalArrangement?.toComposeArrangement() ?: Arrangement.Top,
|
|
103
|
+
horizontalAlignment = props.horizontalAlignment?.toComposeAlignment() ?: Alignment.Start,
|
|
104
|
+
modifier = ModifierRegistry
|
|
105
|
+
.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
106
|
+
.then(if (scrollBehavior != null) Modifier.nestedScroll(scrollBehavior) else Modifier)
|
|
122
107
|
) {
|
|
123
|
-
|
|
108
|
+
val scope = ComposableScope()
|
|
109
|
+
.with(columnScope = this@Column)
|
|
110
|
+
.withIf(scrollBehavior != null) {
|
|
111
|
+
with(nestedScrollConnection = scrollBehavior)
|
|
112
|
+
}
|
|
113
|
+
Children(scope)
|
|
124
114
|
}
|
|
125
115
|
}
|
|
126
116
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
W400("400"),
|
|
134
|
-
W500("500"),
|
|
135
|
-
W600("600"),
|
|
136
|
-
W700("700"),
|
|
137
|
-
W800("800"),
|
|
138
|
-
W900("900");
|
|
139
|
-
|
|
140
|
-
fun toComposeFontWeight(): FontWeight {
|
|
141
|
-
return when (this) {
|
|
142
|
-
NORMAL -> FontWeight.Normal
|
|
143
|
-
BOLD -> FontWeight.Bold
|
|
144
|
-
W100 -> FontWeight.W100
|
|
145
|
-
W200 -> FontWeight.W200
|
|
146
|
-
W300 -> FontWeight.W300
|
|
147
|
-
W400 -> FontWeight.W400
|
|
148
|
-
W500 -> FontWeight.W500
|
|
149
|
-
W600 -> FontWeight.W600
|
|
150
|
-
W700 -> FontWeight.W700
|
|
151
|
-
W800 -> FontWeight.W800
|
|
152
|
-
W900 -> FontWeight.W900
|
|
117
|
+
@Composable
|
|
118
|
+
fun FunctionalComposableScope.BoxContent(props: LayoutProps) {
|
|
119
|
+
val scrollBehavior = props.floatingToolbarExitAlwaysScrollBehavior
|
|
120
|
+
?.toComposeExitDirection()
|
|
121
|
+
?.let {
|
|
122
|
+
FloatingToolbarDefaults.exitAlwaysScrollBehavior(exitDirection = it)
|
|
153
123
|
}
|
|
124
|
+
Box(
|
|
125
|
+
contentAlignment = props.contentAlignment?.toComposeAlignment() ?: Alignment.TopStart,
|
|
126
|
+
modifier = ModifierRegistry
|
|
127
|
+
.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
128
|
+
.then(if (scrollBehavior != null) Modifier.nestedScroll(scrollBehavior) else Modifier)
|
|
129
|
+
) {
|
|
130
|
+
val scope = ComposableScope()
|
|
131
|
+
.with(boxScope = this@Box)
|
|
132
|
+
.withIf(scrollBehavior != null) {
|
|
133
|
+
with(nestedScrollConnection = scrollBehavior)
|
|
134
|
+
}
|
|
135
|
+
Children(scope)
|
|
154
136
|
}
|
|
155
137
|
}
|
|
156
|
-
|
|
157
|
-
data class TextProps(
|
|
158
|
-
val text: String = "",
|
|
159
|
-
val color: AndroidColor? = null,
|
|
160
|
-
val fontSize: Float = 16f,
|
|
161
|
-
val fontWeight: TextFontWeight = TextFontWeight.NORMAL,
|
|
162
|
-
val modifiers: ModifierList = emptyList()
|
|
163
|
-
) : ComposeProps
|
|
164
|
-
|
|
165
|
-
@Composable
|
|
166
|
-
fun FunctionalComposableScope.TextContent(props: TextProps) {
|
|
167
|
-
Text(
|
|
168
|
-
text = props.text,
|
|
169
|
-
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope),
|
|
170
|
-
color = colorToComposeColor(props.color),
|
|
171
|
-
style = TextStyle(
|
|
172
|
-
fontSize = props.fontSize.sp,
|
|
173
|
-
fontWeight = props.fontWeight.toComposeFontWeight()
|
|
174
|
-
)
|
|
175
|
-
)
|
|
176
|
-
}
|
|
@@ -62,11 +62,11 @@ data class DateTimePickerProps(
|
|
|
62
62
|
@Composable
|
|
63
63
|
fun FunctionalComposableScope.DateTimePickerContent(props: DateTimePickerProps, onDateSelected: (DatePickerResult) -> Unit) {
|
|
64
64
|
if (props.displayedComponents == DisplayedComponents.HOUR_AND_MINUTE) {
|
|
65
|
-
ExpoTimePicker(props = props, modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope)) {
|
|
65
|
+
ExpoTimePicker(props = props, modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)) {
|
|
66
66
|
onDateSelected(it)
|
|
67
67
|
}
|
|
68
68
|
} else {
|
|
69
|
-
ExpoDatePicker(props = props, modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope)) {
|
|
69
|
+
ExpoDatePicker(props = props, modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)) {
|
|
70
70
|
onDateSelected(it)
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -11,5 +11,5 @@ data class DividerProps(
|
|
|
11
11
|
|
|
12
12
|
@Composable
|
|
13
13
|
fun FunctionalComposableScope.DividerContent(props: DividerProps) {
|
|
14
|
-
HorizontalDivider(modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope))
|
|
14
|
+
HorizontalDivider(modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher))
|
|
15
15
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@file:OptIn(ExperimentalMaterial3Api::class)
|
|
2
|
+
|
|
3
|
+
package expo.modules.ui
|
|
4
|
+
|
|
5
|
+
import androidx.compose.foundation.text.input.rememberTextFieldState
|
|
6
|
+
import androidx.compose.material3.DockedSearchBar
|
|
7
|
+
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
8
|
+
import androidx.compose.material3.SearchBarDefaults
|
|
9
|
+
import androidx.compose.material3.rememberSearchBarState
|
|
10
|
+
import androidx.compose.runtime.Composable
|
|
11
|
+
import androidx.compose.runtime.LaunchedEffect
|
|
12
|
+
import androidx.compose.runtime.getValue
|
|
13
|
+
import androidx.compose.runtime.snapshotFlow
|
|
14
|
+
import expo.modules.kotlin.views.ComposableScope
|
|
15
|
+
import expo.modules.kotlin.views.ComposeProps
|
|
16
|
+
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
17
|
+
|
|
18
|
+
data class DockedSearchBarProps(
|
|
19
|
+
val modifiers: ModifierList = emptyList()
|
|
20
|
+
) : ComposeProps
|
|
21
|
+
|
|
22
|
+
@Composable
|
|
23
|
+
fun FunctionalComposableScope.DockedSearchBarContent(
|
|
24
|
+
props: DockedSearchBarProps,
|
|
25
|
+
onQueryChange: (GenericEventPayload1<String>) -> Unit
|
|
26
|
+
) {
|
|
27
|
+
val searchBarState = rememberSearchBarState()
|
|
28
|
+
val textFieldState = rememberTextFieldState()
|
|
29
|
+
|
|
30
|
+
LaunchedEffect(Unit) {
|
|
31
|
+
snapshotFlow { textFieldState.text.toString() }
|
|
32
|
+
.collect { onQueryChange(GenericEventPayload1(it)) }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
DockedSearchBar(
|
|
36
|
+
expanded = false,
|
|
37
|
+
onExpandedChange = {},
|
|
38
|
+
inputField = @Composable {
|
|
39
|
+
SearchBarDefaults.InputField(
|
|
40
|
+
searchBarState = searchBarState,
|
|
41
|
+
textFieldState = textFieldState,
|
|
42
|
+
onSearch = {},
|
|
43
|
+
placeholder = {
|
|
44
|
+
Children(ComposableScope(), filter = { isSlotWithName(it, "placeholder") })
|
|
45
|
+
},
|
|
46
|
+
leadingIcon = {
|
|
47
|
+
Children(ComposableScope(), filter = { isSlotWithName(it, "leadingIcon") })
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
},
|
|
51
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
52
|
+
) {}
|
|
53
|
+
}
|