@expo/ui 0.2.0-beta.6 → 0.2.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -14
- package/android/build.gradle +8 -8
- package/android/src/main/java/expo/modules/ui/AlertDialogView.kt +3 -2
- package/android/src/main/java/expo/modules/ui/BottomSheetView.kt +67 -0
- package/android/src/main/java/expo/modules/ui/CarouselView.kt +151 -0
- package/android/src/main/java/expo/modules/ui/ChipView.kt +4 -3
- package/android/src/main/java/expo/modules/ui/ComposeViews.kt +33 -13
- package/android/src/main/java/expo/modules/ui/DatePickerView.kt +3 -2
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +55 -4
- package/android/src/main/java/expo/modules/ui/Modifiers.kt +35 -6
- package/android/src/main/java/expo/modules/ui/PickerView.kt +3 -2
- package/android/src/main/java/expo/modules/ui/ProgressView.kt +3 -2
- package/android/src/main/java/expo/modules/ui/ShapeView.kt +66 -11
- package/android/src/main/java/expo/modules/ui/SliderView.kt +3 -2
- package/android/src/main/java/expo/modules/ui/SwitchView.kt +4 -3
- package/android/src/main/java/expo/modules/ui/TextInputView.kt +3 -2
- package/android/src/main/java/expo/modules/ui/button/Button.kt +30 -9
- package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +2 -1
- package/build/jetpack-compose/AlertDialog/index.d.ts +3 -1
- package/build/jetpack-compose/AlertDialog/index.d.ts.map +1 -1
- package/build/jetpack-compose/BottomSheet/index.d.ts +21 -0
- package/build/jetpack-compose/BottomSheet/index.d.ts.map +1 -0
- package/build/jetpack-compose/Button/index.d.ts +8 -3
- package/build/jetpack-compose/Button/index.d.ts.map +1 -1
- package/build/jetpack-compose/Carousel/index.d.ts +38 -0
- package/build/jetpack-compose/Carousel/index.d.ts.map +1 -0
- package/build/jetpack-compose/Chip/index.d.ts +4 -4
- package/build/jetpack-compose/ContextMenu/index.d.ts +3 -15
- package/build/jetpack-compose/ContextMenu/index.d.ts.map +1 -1
- package/build/jetpack-compose/DatePicker/index.d.ts +3 -1
- package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
- package/build/jetpack-compose/Host/index.d.ts +8 -0
- package/build/jetpack-compose/Host/index.d.ts.map +1 -0
- package/build/jetpack-compose/Picker/index.d.ts +3 -2
- package/build/jetpack-compose/Picker/index.d.ts.map +1 -1
- package/build/jetpack-compose/Progress/index.d.ts +6 -2
- package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
- package/build/jetpack-compose/Shape/index.d.ts +13 -7
- package/build/jetpack-compose/Shape/index.d.ts.map +1 -1
- package/build/jetpack-compose/Slider/index.d.ts +3 -1
- package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
- package/build/jetpack-compose/Switch/index.d.ts +5 -3
- package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
- package/build/jetpack-compose/TextInput/index.d.ts +3 -1
- package/build/jetpack-compose/TextInput/index.d.ts.map +1 -1
- package/build/jetpack-compose/index.d.ts +4 -0
- package/build/jetpack-compose/index.d.ts.map +1 -1
- package/build/{jetpack-compose-primitives/index.d.ts → jetpack-compose/layout.d.ts} +14 -11
- package/build/jetpack-compose/layout.d.ts.map +1 -0
- package/build/jetpack-compose/modifiers.d.ts +8 -1
- package/build/jetpack-compose/modifiers.d.ts.map +1 -1
- package/build/swift-ui/BottomSheet/index.d.ts +6 -6
- package/build/swift-ui/Button/index.d.ts +22 -7
- package/build/swift-ui/Button/index.d.ts.map +1 -1
- package/build/swift-ui/Chart/index.d.ts +41 -5
- package/build/swift-ui/Chart/index.d.ts.map +1 -1
- package/build/swift-ui/ContentUnavailableView/index.d.ts +5 -0
- package/build/swift-ui/ContentUnavailableView/index.d.ts.map +1 -1
- package/build/swift-ui/ContextMenu/index.d.ts +8 -21
- package/build/swift-ui/ContextMenu/index.d.ts.map +1 -1
- package/build/swift-ui/ContextMenu/types.d.ts +17 -16
- 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 +8 -0
- package/build/swift-ui/Divider/index.d.ts.map +1 -0
- package/build/swift-ui/Form/index.d.ts +1 -0
- package/build/swift-ui/Form/index.d.ts.map +1 -1
- package/build/swift-ui/Gauge/index.d.ts +1 -3
- package/build/swift-ui/Gauge/index.d.ts.map +1 -1
- package/build/swift-ui/Grid/index.d.ts +27 -0
- package/build/swift-ui/Grid/index.d.ts.map +1 -0
- package/build/swift-ui/Host/index.d.ts +6 -1
- package/build/swift-ui/Host/index.d.ts.map +1 -1
- package/build/swift-ui/Image/index.d.ts +2 -1
- package/build/swift-ui/Image/index.d.ts.map +1 -1
- package/build/swift-ui/Label/index.d.ts +3 -2
- package/build/swift-ui/Label/index.d.ts.map +1 -1
- package/build/swift-ui/LabeledContent/index.d.ts +3 -3
- package/build/swift-ui/LabeledContent/index.d.ts.map +1 -1
- package/build/swift-ui/Layout/index.d.ts +2 -1
- package/build/swift-ui/Layout/index.d.ts.map +1 -1
- package/build/swift-ui/List/index.d.ts +1 -1
- package/build/swift-ui/List/index.d.ts.map +1 -1
- package/build/swift-ui/Picker/index.d.ts +4 -2
- package/build/swift-ui/Picker/index.d.ts.map +1 -1
- package/build/swift-ui/Popover/index.d.ts +32 -0
- package/build/swift-ui/Popover/index.d.ts.map +1 -0
- package/build/swift-ui/Section/index.d.ts +15 -2
- package/build/swift-ui/Section/index.d.ts.map +1 -1
- package/build/swift-ui/SecureField/index.d.ts +16 -1
- package/build/swift-ui/SecureField/index.d.ts.map +1 -1
- package/build/swift-ui/ShareLink/index.d.ts +8 -2
- package/build/swift-ui/ShareLink/index.d.ts.map +1 -1
- package/build/swift-ui/Slider/index.d.ts +2 -1
- package/build/swift-ui/Slider/index.d.ts.map +1 -1
- package/build/swift-ui/Stepper/index.d.ts +29 -0
- package/build/swift-ui/Stepper/index.d.ts.map +1 -0
- package/build/swift-ui/Switch/index.d.ts +8 -2
- package/build/swift-ui/Switch/index.d.ts.map +1 -1
- package/build/swift-ui/Text/index.d.ts +10 -2
- package/build/swift-ui/Text/index.d.ts.map +1 -1
- package/build/swift-ui/TextField/index.d.ts +44 -5
- package/build/swift-ui/TextField/index.d.ts.map +1 -1
- package/build/swift-ui/index.d.ts +4 -0
- package/build/swift-ui/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/background.d.ts +10 -0
- package/build/swift-ui/modifiers/background.d.ts.map +1 -0
- package/build/swift-ui/modifiers/containerShape.d.ts +4 -7
- package/build/swift-ui/modifiers/containerShape.d.ts.map +1 -1
- package/build/swift-ui/modifiers/createModifier.d.ts +1 -0
- package/build/swift-ui/modifiers/createModifier.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +331 -55
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/shapes/index.d.ts +35 -0
- package/build/swift-ui/modifiers/shapes/index.d.ts.map +1 -0
- package/build/swift-ui/modifiers/types.d.ts +5 -0
- package/build/swift-ui/modifiers/types.d.ts.map +1 -0
- package/build/utils/index.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/BottomSheetView.swift +1 -9
- package/ios/Button/Button.swift +2 -1
- package/ios/Button/ButtonProps.swift +32 -7
- package/ios/CapsuleView.swift +1 -8
- package/ios/ChartView.swift +64 -25
- package/ios/CircleView.swift +1 -7
- package/ios/ColorPickerView.swift +1 -8
- package/ios/ConcentricRectangleView.swift +1 -8
- package/ios/ContentUnavailableView.swift +1 -8
- package/ios/ContextMenu/ContextMenu.swift +20 -114
- package/ios/ContextMenu/ContextMenuComponents.swift +37 -0
- package/ios/ContextMenu/ContextMenuRecords.swift +5 -40
- package/ios/DateTimePickerView.swift +1 -8
- package/ios/DisclosureGroupView.swift +1 -8
- package/ios/DividerView.swift +15 -0
- package/ios/EllipseView.swift +1 -7
- package/ios/ExpoUIModule.swift +88 -37
- package/ios/FormView.swift +1 -8
- package/ios/Gauge/Gauge.swift +0 -1
- package/ios/Gauge/GaugeProps.swift +1 -7
- package/ios/GlassEffectContainerView.swift +1 -7
- package/ios/GridView.swift +44 -0
- package/ios/GroupView.swift +1 -8
- package/ios/HStackView.swift +1 -8
- package/ios/HostView.swift +46 -4
- package/ios/ImageView.swift +1 -8
- package/ios/Label.swift +16 -13
- package/ios/LabeledContentView.swift +55 -10
- package/ios/List.swift +1 -8
- package/ios/Modifiers/BackgroundModifier.swift +37 -0
- package/ios/Modifiers/ContainerShapeModifier.swift +27 -0
- package/ios/Modifiers/FontModifier.swift +65 -0
- package/ios/Modifiers/GlassEffectModifier.swift +92 -0
- package/ios/Modifiers/RefreshableModifier.swift +59 -0
- package/ios/Modifiers/ShapeTypes.swift +62 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +651 -95
- package/ios/PickerView.swift +1 -8
- package/ios/Popover/PopoverComponents.swift +18 -0
- package/ios/Popover/PopoverProps.swift +59 -0
- package/ios/Popover/PopoverView.swift +64 -0
- package/ios/ProgressView.swift +1 -8
- package/ios/RectangleView.swift +1 -7
- package/ios/RoundedRectangleView.swift +1 -8
- package/ios/SectionView.swift +86 -10
- package/ios/SecureField/SecureFieldView.swift +31 -9
- package/ios/ShareLink/AsyncShareableItemUtils.swift +79 -0
- package/ios/ShareLink/ShareLinkView.swift +112 -0
- package/ios/SliderView.swift +1 -8
- package/ios/SpacerView.swift +1 -8
- package/ios/StepperView.swift +45 -0
- package/ios/SwitchView.swift +12 -9
- package/ios/TextField/TextFieldView.swift +102 -15
- package/ios/TextView.swift +16 -38
- package/ios/UIBaseView.swift +57 -0
- package/ios/UIBaseViewProps.swift +25 -0
- package/ios/UnevenRoundedRectangleView.swift +1 -8
- package/ios/VStackView.swift +1 -8
- package/ios/ZStackView.swift +1 -8
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.module → 0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.module} +29 -29
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.pom → 0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.pom} +7 -7
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.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 +3 -7
- package/src/jetpack-compose/AlertDialog/index.tsx +3 -1
- package/src/jetpack-compose/BottomSheet/index.tsx +46 -0
- package/src/jetpack-compose/Button/index.tsx +11 -4
- package/src/jetpack-compose/Carousel/index.tsx +57 -0
- package/src/jetpack-compose/Chip/index.tsx +4 -4
- package/src/jetpack-compose/ContextMenu/index.tsx +3 -17
- package/src/jetpack-compose/DatePicker/index.tsx +3 -1
- package/src/jetpack-compose/Host/index.tsx +25 -0
- package/src/jetpack-compose/Picker/index.tsx +3 -2
- package/src/jetpack-compose/Progress/index.tsx +6 -2
- package/src/jetpack-compose/Shape/index.tsx +65 -12
- package/src/jetpack-compose/Slider/index.tsx +3 -1
- package/src/jetpack-compose/Switch/index.tsx +5 -3
- package/src/jetpack-compose/TextInput/index.tsx +3 -1
- package/src/jetpack-compose/index.ts +5 -0
- package/src/{jetpack-compose-primitives/index.tsx → jetpack-compose/layout.tsx} +56 -24
- package/src/jetpack-compose/modifiers.ts +11 -1
- package/src/swift-ui/BottomSheet/index.tsx +6 -6
- package/src/swift-ui/Button/index.tsx +23 -7
- package/src/swift-ui/Chart/index.tsx +43 -5
- package/src/swift-ui/ContentUnavailableView/index.tsx +5 -4
- package/src/swift-ui/ContextMenu/index.tsx +26 -73
- package/src/swift-ui/ContextMenu/types.ts +18 -24
- package/src/swift-ui/DatePicker/index.tsx +2 -2
- package/src/swift-ui/Divider/index.tsx +18 -0
- package/src/swift-ui/Form/index.tsx +1 -0
- package/src/swift-ui/Gauge/index.tsx +1 -3
- package/src/swift-ui/Grid/index.tsx +65 -0
- package/src/swift-ui/Host/index.tsx +11 -2
- package/src/swift-ui/Image/index.tsx +2 -1
- package/src/swift-ui/Label/index.tsx +3 -2
- package/src/swift-ui/LabeledContent/index.tsx +22 -6
- package/src/swift-ui/Layout/index.tsx +2 -1
- package/src/swift-ui/List/index.tsx +1 -1
- package/src/swift-ui/Picker/index.tsx +4 -2
- package/src/swift-ui/Popover/index.tsx +71 -0
- package/src/swift-ui/Section/index.tsx +27 -5
- package/src/swift-ui/SecureField/index.tsx +26 -3
- package/src/swift-ui/ShareLink/index.tsx +37 -7
- package/src/swift-ui/Slider/index.tsx +2 -1
- package/src/swift-ui/Stepper/index.tsx +56 -0
- package/src/swift-ui/Switch/index.tsx +9 -2
- package/src/swift-ui/Text/index.tsx +13 -4
- package/src/swift-ui/TextField/index.tsx +50 -9
- package/src/swift-ui/index.tsx +4 -0
- package/src/swift-ui/modifiers/background.ts +12 -0
- package/src/swift-ui/modifiers/containerShape.ts +4 -9
- package/src/swift-ui/modifiers/createModifier.ts +1 -0
- package/src/swift-ui/modifiers/index.ts +408 -75
- package/src/swift-ui/modifiers/shapes/index.ts +32 -0
- package/src/swift-ui/modifiers/types.ts +23 -0
- package/src/utils/index.ts +3 -0
- package/build/jetpack-compose-primitives/index.d.ts.map +0 -1
- package/build/swift-ui/ContextMenu/Submenu.d.ts +0 -21
- package/build/swift-ui/ContextMenu/Submenu.d.ts.map +0 -1
- package/build/swift-ui/ContextMenu/utils.d.ts +0 -24
- package/build/swift-ui/ContextMenu/utils.d.ts.map +0 -1
- package/ios/Modifiers/CommonViewModifiers.swift +0 -29
- package/ios/ShareLinkView.swift +0 -111
- package/jetpack-compose-primitives.d.ts +0 -1
- package/jetpack-compose-primitives.js +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.pom.sha512 +0 -1
- package/src/swift-ui/ContextMenu/Submenu.tsx +0 -25
- package/src/swift-ui/ContextMenu/utils.ts +0 -149
package/CHANGELOG.md
CHANGED
|
@@ -10,23 +10,82 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
-
## 0.2.0-beta.
|
|
13
|
+
## 0.2.0-beta.8 — 2025-11-06
|
|
14
|
+
|
|
15
|
+
### 🛠 Breaking changes
|
|
16
|
+
|
|
17
|
+
- [Android] Move all `jetpack-compose-primitives` components to `jetpack-compose` namespace. ([#40272](https://github.com/expo/expo/pull/40272) by [@aleqsio](https://github.com/aleqsio))
|
|
18
|
+
|
|
19
|
+
### 🎉 New features
|
|
20
|
+
|
|
21
|
+
- [iOS] Add `refreshable` modifier. ([#40201](https://github.com/expo/expo/pull/40201) by [@christianwooldridge](https://github.com/christianwooldridge))
|
|
22
|
+
- [iOS] Add RTL support in swiftui. ([#40335](https://github.com/expo/expo/pull/40335) by [@kfirfitousi](https://github.com/kfirfitousi))
|
|
23
|
+
- [Android] Add Carousel component. ([#40325](https://github.com/expo/expo/pull/40325) by [@aleqsio](https://github.com/aleqsio))
|
|
24
|
+
- [iOS] Add `scrollDismissesKeyboard` modifier. ([#40201](https://github.com/expo/expo/pull/40201) by [@christianwooldridge](https://github.com/christianwooldridge))
|
|
25
|
+
- [Android] Add Android BottomSheet ([#37553](https://github.com/expo/expo/pull/37553) by [@Jeroen-G](https://github.com/Jeroen-G))
|
|
26
|
+
- [Android] Move all components to use Host ([#40244](https://github.com/expo/expo/pull/40244) by [@aleqsio](https://github.com/aleqsio))
|
|
27
|
+
- [Android] Add support for modifiers in primitives, add clip modifier. ([#40164](https://github.com/expo/expo/pull/40164) by [@aleqsio](https://github.com/aleqsio))
|
|
28
|
+
- Add scoped compose modifiers, move testID to modifiers. ([#39155](https://github.com/expo/expo/pull/39155) by [@aleqsio](https://github.com/aleqsio))
|
|
29
|
+
- [Android] Add custom button shapes. ([#40163](https://github.com/expo/expo/pull/40163) by [@aleqsio](https://github.com/aleqsio))
|
|
30
|
+
- [iOS] Add ref methods and onChangeFocus to TextField and SecureField. ([#39898](https://github.com/expo/expo/pull/39898) by [@aleqsio](https://github.com/aleqsio))
|
|
31
|
+
- [iOS] Add SF symbol typings ([#39802](https://github.com/expo/expo/pull/39802) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
32
|
+
- [iOS] Add `scrollContentBackground` and `listRowBackground` modifier. ([#40195](https://github.com/expo/expo/pull/40195) by [@doombladeoff](https://github.com/doombladeoff))
|
|
33
|
+
- Added `onAppear` and `onDisappear` modifiers to `swift-ui`. ([#40056](https://github.com/expo/expo/pull/40056) by [@kudo](https://github.com/kudo))
|
|
34
|
+
- [iOS] Add Stepper component. ([#39813](https://github.com/expo/expo/pull/39813) by [@hryhoriiK97](https://github.com/hryhoriiK97))
|
|
35
|
+
- [ios] Add text modifiers (`truncationMode`, `kerning`, `allowsTightening`, `textCase`, `underline`, `strikethrough`, `multilineTextAlignment`,`textSelection` and `lineSpacing`) ([#40282](https://github.com/expo/expo/pull/40282) by [@doombladeoff](https://github.com/doombladeoff))
|
|
36
|
+
- [iOS] Added `header` and `footer` props for sections, support for collapsible sections, and headerProminence modifier ([#40340](https://github.com/expo/expo/pull/40340) by [@doombladeoff](https://github.com/doombladeoff))
|
|
37
|
+
- [iOS] Add new modifiers (`listRowInsets`, `listSectionMargins`, `badgeProminence`, `badge`) ([#40329](https://github.com/expo/expo/pull/40329) by [@doombladeoff](https://github.com/doombladeoff))
|
|
38
|
+
- Add Interpolated string support in button ([#40416](https://github.com/expo/expo/pull/40416) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
39
|
+
- [iOS] Added Popover component ([#40454](https://github.com/expo/expo/pull/40454) by [@doombladeoff](https://github.com/doombladeoff))
|
|
40
|
+
- [iOS] Add RectangleMark and RuleMark support to Chart component ([#40046](https://github.com/expo/expo/pull/40046) by [@hryhoriiK97](https://github.com/hryhoriiK97))
|
|
41
|
+
- Adds selection API in text field, autoFocus, onSubmit event and rounded rectangle (squircle) support in glassEffect. ([#40455](https://github.com/expo/expo/pull/40455) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
42
|
+
- [iOS] Add `font` modifier ([#40553](https://github.com/expo/expo/pull/40553) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
43
|
+
- [iOS] Add `getItemAsync` to `ShareLink` ([#40391](https://github.com/expo/expo/pull/40391) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
44
|
+
- [iOS] Add Grid component and modifiers `gridCellUnsizedAxes`, `gridCellColumns`, `gridColumnAlignment`, `gridCellAnchor` ([#40485](https://github.com/expo/expo/pull/40485) by [@doombladeoff](https://github.com/doombladeoff))
|
|
45
|
+
- [iOS] Add `labelView` to LabeledContent component ([#40798](https://github.com/expo/expo/pull/40798) by [@focux](https://github.com/focux))
|
|
46
|
+
- [iOS] - Add shape in `background` modifier and fix `foregroundStyle` modifer in `Label` ([#40748](https://github.com/expo/expo/pull/40748) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
47
|
+
- [iOS] - Add `systemImage` property to `Switch` component ([#40838](https://github.com/expo/expo/pull/40838) by [@focux](https://github.com/focux))
|
|
14
48
|
|
|
15
49
|
### 🐛 Bug fixes
|
|
16
50
|
|
|
17
|
-
- [iOS]
|
|
51
|
+
- [iOS] remove empty section header spacing when no title provided ([#40296](https://github.com/expo/expo/pull/40296) by [@dylancom](https://github.com/dylancom))
|
|
52
|
+
- [iOS] Merge edge and axis paddings correctly in PaddingModifier ([#40414](https://github.com/expo/expo/pull/40414) by [@lucabc2000](https://github.com/lucabc2000))
|
|
53
|
+
- [iOS] Enhance PaddingModifier to support default SwiftUI padding when no custom values are provided ([#40715](https://github.com/expo/expo/pull/40715) by [@betomoedano](https://github.com/betomoedano))
|
|
18
54
|
|
|
19
|
-
|
|
55
|
+
### 💡 Others
|
|
56
|
+
|
|
57
|
+
- [docs] Improve consistency and remove invalid platform checks. ([#40362](https://github.com/expo/expo/pull/40362) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
58
|
+
- Refactored `CommonViewProps` to `UIBaseViewProps` and reduced duplicated code. ([#40492](https://github.com/expo/expo/pull/40492) by [@kudo](https://github.com/kudo))
|
|
59
|
+
|
|
60
|
+
## 0.2.0-beta.7 - 2025-10-09
|
|
61
|
+
|
|
62
|
+
### 🎉 New features
|
|
63
|
+
|
|
64
|
+
- [iOS] Adds `controlSize` prop to Button([#40030](https://github.com/expo/expo/pull/40030) by [@betomoedano](https://github.com/betomoedano))
|
|
65
|
+
- [iOS] Add Divider component. ([#40283](https://github.com/expo/expo/pull/40283) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
66
|
+
|
|
67
|
+
### 💡 Others
|
|
68
|
+
|
|
69
|
+
- [iOS] Make `ContextMenu` more composable. ([#40254](https://github.com/expo/expo/pull/40254) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
70
|
+
|
|
71
|
+
## 0.2.0-beta.6 - 2025-10-01
|
|
72
|
+
|
|
73
|
+
### 🐛 Bug fixes
|
|
74
|
+
|
|
75
|
+
- [iOS] Add `buttonStyle` modifier. ([#40119](https://github.com/expo/expo/pull/40119) by [@nishan](https://github.com/intergalacticspacehighway)) ([#40119](https://github.com/expo/expo/pull/40119) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
76
|
+
|
|
77
|
+
## 0.2.0-beta.5 - 2025-10-01
|
|
20
78
|
|
|
21
79
|
### 🎉 New features
|
|
22
80
|
|
|
23
81
|
- [iOS] Add `variableValue` prop to Image component for SF Symbols with variable color support ([#39852](https://github.com/expo/expo/pull/39852) by [@morellodev](https://github.com/morellodev))
|
|
24
|
-
- [iOS] Adds `Rectangle`, `RoundedRectangle`, `UnevenRoundedRectangle`, `Circle`, `Ellipse`, `Capsule` shape components and `fill` modifier ([#39793](https://github.com/expo/expo/pull/39793) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
25
|
-
- [iOS] Add `ignoreSafeArea` modifier ([#39804](https://github.com/expo/expo/pull/39804) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
26
|
-
- [iOS] Add `presentationDetents`, `presentationDragIndicator`, `interactiveDismissDisabled` props to `BottomSheet`. ([#39952](https://github.com/expo/expo/pull/39952) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
27
|
-
- [iOS] Add `ConcentricRectangle` shape ([#39907](https://github.com/expo/expo/pull/39907) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
82
|
+
- [iOS] Adds `Rectangle`, `RoundedRectangle`, `UnevenRoundedRectangle`, `Circle`, `Ellipse`, `Capsule` shape components and `fill` modifier ([#39793](https://github.com/expo/expo/pull/39793) by [@nishan](https://github.com/intergalacticspacehighway)) ([#39793](https://github.com/expo/expo/pull/39793) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
83
|
+
- [iOS] Add `ignoreSafeArea` modifier ([#39804](https://github.com/expo/expo/pull/39804) by [@nishan](https://github.com/intergalacticspacehighway)) ([#39804](https://github.com/expo/expo/pull/39804) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
84
|
+
- [iOS] Add `presentationDetents`, `presentationDragIndicator`, `interactiveDismissDisabled` props to `BottomSheet`. ([#39952](https://github.com/expo/expo/pull/39952) by [@nishan](https://github.com/intergalacticspacehighway)) ([#39952](https://github.com/expo/expo/pull/39952) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
85
|
+
- [iOS] Add `ConcentricRectangle` shape ([#39907](https://github.com/expo/expo/pull/39907) by [@nishan](https://github.com/intergalacticspacehighway)) ([#39907](https://github.com/expo/expo/pull/39907) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
28
86
|
- [iOS] Add disabled modifier for swiftui. ([#39864](https://github.com/expo/expo/pull/39864) by [@hryhoriiK97](https://github.com/hryhoriiK97))
|
|
29
|
-
- Add Interpolated string support in button ([#39932](https://github.com/expo/expo/pull/39932) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
87
|
+
- Add Interpolated string support in button ([#39932](https://github.com/expo/expo/pull/39932) by [@nishan](https://github.com/intergalacticspacehighway)) ([#39932](https://github.com/expo/expo/pull/39932) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
88
|
+
- [iOS] list section spacing modifier ([#40291](https://github.com/expo/expo/pull/40291) by [@dylancom](https://github.com/dylancom))
|
|
30
89
|
|
|
31
90
|
### 🐛 Bug fixes
|
|
32
91
|
|
|
@@ -34,16 +93,13 @@
|
|
|
34
93
|
|
|
35
94
|
### 💡 Others
|
|
36
95
|
|
|
37
|
-
- [ios] - Set host dimension synchronously on native ([#40017](https://github.com/expo/expo/pull/40017) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
38
|
-
|
|
39
|
-
## 0.2.0-beta.4 — 2025-09-22
|
|
40
|
-
|
|
41
|
-
### 🎉 New features
|
|
96
|
+
- [ios] - Set host dimension synchronously on native ([#40017](https://github.com/expo/expo/pull/40017) by [@nishan](https://github.com/intergalacticspacehighway)) ([#40017](https://github.com/expo/expo/pull/40017) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
42
97
|
|
|
43
|
-
|
|
98
|
+
## 0.2.0-beta.4 - 2025-09-22
|
|
44
99
|
|
|
45
100
|
### 🐛 Bug fixes
|
|
46
101
|
|
|
102
|
+
- [iOS] Add correct color value types. ([#39899](https://github.com/expo/expo/pull/39899) by [@EvanBacon](https://github.com/EvanBacon))
|
|
47
103
|
- [iOS] Updated description for glass button styles availability ([#39736](https://github.com/expo/expo/pull/39736) by [@terijaki](https://github.com/terijaki))
|
|
48
104
|
|
|
49
105
|
## 0.2.0-beta.3 — 2025-09-16
|
package/android/build.gradle
CHANGED
|
@@ -12,13 +12,13 @@ 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 = '0.2.0-beta.
|
|
15
|
+
version = '0.2.0-beta.8'
|
|
16
16
|
|
|
17
17
|
android {
|
|
18
18
|
namespace "expo.modules.ui"
|
|
19
19
|
defaultConfig {
|
|
20
20
|
versionCode 1
|
|
21
|
-
versionName "0.2.0-beta.
|
|
21
|
+
versionName "0.2.0-beta.8"
|
|
22
22
|
}
|
|
23
23
|
buildFeatures {
|
|
24
24
|
compose true
|
|
@@ -29,11 +29,11 @@ android {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
dependencies {
|
|
32
|
-
implementation 'androidx.compose.foundation:foundation-android:1.
|
|
33
|
-
implementation 'androidx.compose.ui:ui-android:1.
|
|
34
|
-
implementation "androidx.compose.material3:material3:1.3.
|
|
35
|
-
implementation 'androidx.lifecycle:lifecycle-runtime:2.
|
|
36
|
-
implementation 'androidx.fragment:fragment-ktx:1.8.
|
|
37
|
-
implementation 'androidx.compose.material3:material3-android:1.3.
|
|
32
|
+
implementation 'androidx.compose.foundation:foundation-android:1.9.1'
|
|
33
|
+
implementation 'androidx.compose.ui:ui-android:1.9.1'
|
|
34
|
+
implementation "androidx.compose.material3:material3:1.3.2"
|
|
35
|
+
implementation 'androidx.lifecycle:lifecycle-runtime:2.9.3'
|
|
36
|
+
implementation 'androidx.fragment:fragment-ktx:1.8.9'
|
|
37
|
+
implementation 'androidx.compose.material3:material3-android:1.3.2'
|
|
38
38
|
implementation "androidx.graphics:graphics-shapes:1.0.1"
|
|
39
39
|
}
|
|
@@ -13,6 +13,7 @@ import androidx.compose.ui.Modifier
|
|
|
13
13
|
import expo.modules.kotlin.views.ExpoComposeView
|
|
14
14
|
import expo.modules.kotlin.viewevent.EventDispatcher
|
|
15
15
|
import expo.modules.kotlin.records.Record
|
|
16
|
+
import expo.modules.kotlin.views.ComposableScope
|
|
16
17
|
import java.io.Serializable
|
|
17
18
|
|
|
18
19
|
open class AlertDialogButtonPressedEvent() : Record, Serializable
|
|
@@ -27,13 +28,13 @@ data class AlertDialogProps(
|
|
|
27
28
|
) : ComposeProps
|
|
28
29
|
|
|
29
30
|
class AlertDialogView(context: Context, appContext: AppContext) :
|
|
30
|
-
ExpoComposeView<AlertDialogProps>(context, appContext
|
|
31
|
+
ExpoComposeView<AlertDialogProps>(context, appContext) {
|
|
31
32
|
override val props = AlertDialogProps()
|
|
32
33
|
private val onDismissPressed by EventDispatcher<AlertDialogButtonPressedEvent>()
|
|
33
34
|
private val onConfirmPressed by EventDispatcher<AlertDialogButtonPressedEvent>()
|
|
34
35
|
|
|
35
36
|
@Composable
|
|
36
|
-
override fun Content(
|
|
37
|
+
override fun ComposableScope.Content() {
|
|
37
38
|
val (title) = props.title
|
|
38
39
|
val (text) = props.text
|
|
39
40
|
val (confirmButtonText) = props.confirmButtonText
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
package expo.modules.ui
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import androidx.compose.foundation.layout.Box
|
|
5
|
+
import androidx.compose.foundation.layout.fillMaxHeight
|
|
6
|
+
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
7
|
+
import androidx.compose.material3.ModalBottomSheet
|
|
8
|
+
import androidx.compose.material3.rememberModalBottomSheetState
|
|
9
|
+
import androidx.compose.runtime.Composable
|
|
10
|
+
import androidx.compose.runtime.MutableState
|
|
11
|
+
import androidx.compose.runtime.mutableStateOf
|
|
12
|
+
import androidx.compose.ui.Modifier
|
|
13
|
+
import expo.modules.kotlin.AppContext
|
|
14
|
+
import expo.modules.kotlin.records.Field
|
|
15
|
+
import expo.modules.kotlin.records.Record
|
|
16
|
+
import expo.modules.kotlin.viewevent.EventDispatcher
|
|
17
|
+
import expo.modules.kotlin.views.ComposableScope
|
|
18
|
+
import expo.modules.kotlin.views.ComposeProps
|
|
19
|
+
import expo.modules.kotlin.views.ExpoComposeView
|
|
20
|
+
import java.io.Serializable
|
|
21
|
+
|
|
22
|
+
open class IsOpenedChangeEvent(
|
|
23
|
+
@Field open val isOpened: Boolean = false
|
|
24
|
+
) : Record, Serializable
|
|
25
|
+
|
|
26
|
+
data class BottomSheetProps(
|
|
27
|
+
val isOpened: MutableState<Boolean> = mutableStateOf(false),
|
|
28
|
+
val skipPartiallyExpanded: MutableState<Boolean> = mutableStateOf(false)
|
|
29
|
+
) : ComposeProps
|
|
30
|
+
|
|
31
|
+
@OptIn(ExperimentalMaterial3Api::class)
|
|
32
|
+
@Composable
|
|
33
|
+
fun BottomSheetComposable(skipPartiallyExpanded: Boolean, isOpened: Boolean, onIsOpenedChange: (Boolean) -> Unit, content: @Composable () -> Unit) {
|
|
34
|
+
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded)
|
|
35
|
+
|
|
36
|
+
if (isOpened) {
|
|
37
|
+
ModalBottomSheet(
|
|
38
|
+
sheetState = sheetState,
|
|
39
|
+
modifier = Modifier.fillMaxHeight(),
|
|
40
|
+
onDismissRequest = { onIsOpenedChange(false) }
|
|
41
|
+
) {
|
|
42
|
+
content()
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
class BottomSheetView(context: Context, appContext: AppContext) :
|
|
48
|
+
ExpoComposeView<BottomSheetProps>(context, appContext) {
|
|
49
|
+
override val props = BottomSheetProps()
|
|
50
|
+
private val onIsOpenedChange by EventDispatcher<IsOpenedChangeEvent>()
|
|
51
|
+
|
|
52
|
+
@Composable
|
|
53
|
+
override fun ComposableScope.Content() {
|
|
54
|
+
val (isOpened) = props.isOpened
|
|
55
|
+
val (skipPartiallyExpanded) = props.skipPartiallyExpanded
|
|
56
|
+
|
|
57
|
+
Box {
|
|
58
|
+
BottomSheetComposable(
|
|
59
|
+
skipPartiallyExpanded,
|
|
60
|
+
isOpened,
|
|
61
|
+
onIsOpenedChange = { value -> onIsOpenedChange(IsOpenedChangeEvent(value)) }
|
|
62
|
+
) {
|
|
63
|
+
Children(ComposableScope())
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
@file:OptIn(EitherType::class)
|
|
2
|
+
|
|
3
|
+
package expo.modules.ui
|
|
4
|
+
|
|
5
|
+
import android.content.Context
|
|
6
|
+
import androidx.compose.foundation.gestures.TargetedFlingBehavior
|
|
7
|
+
import androidx.compose.foundation.layout.PaddingValues
|
|
8
|
+
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
9
|
+
import androidx.compose.material3.carousel.HorizontalMultiBrowseCarousel
|
|
10
|
+
import androidx.compose.material3.carousel.HorizontalUncontainedCarousel
|
|
11
|
+
import androidx.compose.material3.carousel.rememberCarouselState
|
|
12
|
+
import androidx.compose.material3.carousel.CarouselDefaults
|
|
13
|
+
import androidx.compose.runtime.Composable
|
|
14
|
+
import androidx.compose.runtime.MutableState
|
|
15
|
+
import androidx.compose.runtime.mutableStateOf
|
|
16
|
+
import androidx.compose.ui.Modifier
|
|
17
|
+
import androidx.compose.ui.unit.dp
|
|
18
|
+
import androidx.core.view.size
|
|
19
|
+
import expo.modules.kotlin.AppContext
|
|
20
|
+
import expo.modules.kotlin.apifeatures.EitherType
|
|
21
|
+
import expo.modules.kotlin.types.Enumerable
|
|
22
|
+
import expo.modules.kotlin.records.Field
|
|
23
|
+
import expo.modules.kotlin.records.Record
|
|
24
|
+
import expo.modules.kotlin.types.Either
|
|
25
|
+
import expo.modules.kotlin.views.ComposeProps
|
|
26
|
+
import expo.modules.kotlin.views.ExpoComposeView
|
|
27
|
+
import expo.modules.kotlin.views.ComposableScope
|
|
28
|
+
|
|
29
|
+
enum class CarouselVariant(val value: String) : Enumerable {
|
|
30
|
+
MULTI_BROWSE("multiBrowse"),
|
|
31
|
+
UNCONSTRAINED("unconstrained")
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
enum class FlingBehaviorType(val value: String) : Enumerable {
|
|
35
|
+
SINGLE_ADVANCE("singleAdvance"),
|
|
36
|
+
NO_SNAP("noSnap")
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
class PaddingValuesRecord : Record {
|
|
40
|
+
@Field
|
|
41
|
+
val start: Float? = null
|
|
42
|
+
|
|
43
|
+
@Field
|
|
44
|
+
val top: Float? = null
|
|
45
|
+
|
|
46
|
+
@Field
|
|
47
|
+
val end: Float? = null
|
|
48
|
+
|
|
49
|
+
@Field
|
|
50
|
+
val bottom: Float? = null
|
|
51
|
+
|
|
52
|
+
fun toPaddingValues(): PaddingValues {
|
|
53
|
+
return PaddingValues(
|
|
54
|
+
start?.dp ?: 0.dp,
|
|
55
|
+
top?.dp ?: 0.dp,
|
|
56
|
+
end?.dp ?: 0.dp,
|
|
57
|
+
bottom?.dp ?: 0.dp
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
fun paddingValuesFromEither(either: Either<Float, PaddingValuesRecord>?): PaddingValues {
|
|
63
|
+
if (either == null) {
|
|
64
|
+
return PaddingValues(0.dp)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return when {
|
|
68
|
+
either.`is`(Float::class) -> PaddingValues(either.get(Float::class).dp)
|
|
69
|
+
either.`is`(PaddingValuesRecord::class) -> either.get(PaddingValuesRecord::class).toPaddingValues()
|
|
70
|
+
else -> throw IllegalStateException()
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
data class CarouselProps(
|
|
75
|
+
val variant: MutableState<CarouselVariant?> = mutableStateOf(null),
|
|
76
|
+
val modifiers: MutableState<List<ExpoModifier>?> = mutableStateOf(null),
|
|
77
|
+
val itemSpacing: MutableState<Float?> = mutableStateOf(null),
|
|
78
|
+
val contentPadding: MutableState<Either<Float, PaddingValuesRecord>?> = mutableStateOf(null),
|
|
79
|
+
val minSmallItemWidth: MutableState<Float?> = mutableStateOf(null),
|
|
80
|
+
val maxSmallItemWidth: MutableState<Float?> = mutableStateOf(null),
|
|
81
|
+
val flingBehavior: MutableState<FlingBehaviorType?> = mutableStateOf(null),
|
|
82
|
+
val preferredItemWidth: MutableState<Float?> = mutableStateOf(null),
|
|
83
|
+
val itemWidth: MutableState<Float?> = mutableStateOf(null)
|
|
84
|
+
) : ComposeProps
|
|
85
|
+
|
|
86
|
+
const val DEFAULT_MIN_SMALL_ITEM_WIDTH = 40f
|
|
87
|
+
const val DEFAULT_MAX_SMALL_ITEM_WIDTH = 56f
|
|
88
|
+
const val DEFAULT_PREFERRED_ITEM_WIDTH = 200f
|
|
89
|
+
const val DEFAULT_ITEM_WIDTH = 200f
|
|
90
|
+
|
|
91
|
+
class CarouselView(context: Context, appContext: AppContext) : ExpoComposeView<CarouselProps>(context, appContext) {
|
|
92
|
+
override val props = CarouselProps()
|
|
93
|
+
|
|
94
|
+
@OptIn(ExperimentalMaterial3Api::class)
|
|
95
|
+
@Composable
|
|
96
|
+
override fun ComposableScope.Content() {
|
|
97
|
+
val variant = props.variant.value ?: CarouselVariant.MULTI_BROWSE
|
|
98
|
+
val modifiers = props.modifiers.value ?: emptyList()
|
|
99
|
+
val itemSpacing = (props.itemSpacing.value ?: 0f).dp
|
|
100
|
+
val minSmallItemWidth = (props.minSmallItemWidth.value ?: DEFAULT_MIN_SMALL_ITEM_WIDTH).dp
|
|
101
|
+
|
|
102
|
+
// we need to constrain maxSmallItemWidth to be at least minSmallItemWidth or the app will crash
|
|
103
|
+
val maxSmallItemWidth = minSmallItemWidth.coerceAtLeast((props.maxSmallItemWidth.value ?: DEFAULT_MAX_SMALL_ITEM_WIDTH).dp)
|
|
104
|
+
val preferredItemWidth = (props.preferredItemWidth.value ?: DEFAULT_PREFERRED_ITEM_WIDTH).dp
|
|
105
|
+
val itemWidth = (props.itemWidth.value ?: DEFAULT_ITEM_WIDTH).dp
|
|
106
|
+
val flingBehaviorType = props.flingBehavior.value ?: FlingBehaviorType.SINGLE_ADVANCE
|
|
107
|
+
val contentPadding = paddingValuesFromEither(props.contentPadding.value)
|
|
108
|
+
|
|
109
|
+
val carouselState = rememberCarouselState(0) { size }
|
|
110
|
+
|
|
111
|
+
val flingBehavior: TargetedFlingBehavior = when (flingBehaviorType) {
|
|
112
|
+
FlingBehaviorType.SINGLE_ADVANCE -> CarouselDefaults.singleAdvanceFlingBehavior(state = carouselState)
|
|
113
|
+
FlingBehaviorType.NO_SNAP -> CarouselDefaults.noSnapFlingBehavior()
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@Composable
|
|
117
|
+
fun MultiBrowseCarouselComposable() {
|
|
118
|
+
HorizontalMultiBrowseCarousel(
|
|
119
|
+
state = carouselState,
|
|
120
|
+
preferredItemWidth = preferredItemWidth,
|
|
121
|
+
modifier = Modifier.fromExpoModifiers(modifiers, this@Content),
|
|
122
|
+
itemSpacing = itemSpacing,
|
|
123
|
+
flingBehavior = flingBehavior,
|
|
124
|
+
minSmallItemWidth = minSmallItemWidth,
|
|
125
|
+
maxSmallItemWidth = maxSmallItemWidth,
|
|
126
|
+
contentPadding = contentPadding
|
|
127
|
+
) { itemIndex ->
|
|
128
|
+
Child(ComposableScope(), itemIndex)
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@Composable
|
|
133
|
+
fun UnconstrainedCarouselComposable() {
|
|
134
|
+
HorizontalUncontainedCarousel(
|
|
135
|
+
state = carouselState,
|
|
136
|
+
itemWidth = itemWidth,
|
|
137
|
+
modifier = Modifier.fromExpoModifiers(modifiers, this@Content),
|
|
138
|
+
itemSpacing = itemSpacing,
|
|
139
|
+
flingBehavior = flingBehavior,
|
|
140
|
+
contentPadding = contentPadding
|
|
141
|
+
) { itemIndex ->
|
|
142
|
+
Child(ComposableScope(), itemIndex)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
when (variant) {
|
|
147
|
+
CarouselVariant.MULTI_BROWSE -> MultiBrowseCarouselComposable()
|
|
148
|
+
CarouselVariant.UNCONSTRAINED -> UnconstrainedCarouselComposable()
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -12,6 +12,7 @@ import androidx.compose.ui.unit.dp
|
|
|
12
12
|
import expo.modules.kotlin.AppContext
|
|
13
13
|
import expo.modules.kotlin.records.Record
|
|
14
14
|
import expo.modules.kotlin.viewevent.EventDispatcher
|
|
15
|
+
import expo.modules.kotlin.views.ComposableScope
|
|
15
16
|
import expo.modules.kotlin.views.ComposeProps
|
|
16
17
|
import expo.modules.kotlin.views.ExpoComposeView
|
|
17
18
|
import java.io.Serializable
|
|
@@ -30,7 +31,7 @@ data class ChipProps(
|
|
|
30
31
|
) : ComposeProps
|
|
31
32
|
|
|
32
33
|
class ChipView(context: Context, appContext: AppContext) :
|
|
33
|
-
ExpoComposeView<ChipProps>(context, appContext
|
|
34
|
+
ExpoComposeView<ChipProps>(context, appContext) {
|
|
34
35
|
|
|
35
36
|
override val props = ChipProps()
|
|
36
37
|
|
|
@@ -39,7 +40,7 @@ class ChipView(context: Context, appContext: AppContext) :
|
|
|
39
40
|
|
|
40
41
|
@OptIn(ExperimentalMaterial3Api::class)
|
|
41
42
|
@Composable
|
|
42
|
-
override fun Content(
|
|
43
|
+
override fun ComposableScope.Content() {
|
|
43
44
|
val variant by props.variant
|
|
44
45
|
val label by props.label
|
|
45
46
|
val leadingIcon by props.leadingIcon
|
|
@@ -49,7 +50,7 @@ class ChipView(context: Context, appContext: AppContext) :
|
|
|
49
50
|
val enabled by props.enabled
|
|
50
51
|
val selected by props.selected
|
|
51
52
|
|
|
52
|
-
val chipModifier =
|
|
53
|
+
val chipModifier = Modifier
|
|
53
54
|
.padding(4.dp)
|
|
54
55
|
.wrapContentSize(Alignment.Center)
|
|
55
56
|
|
|
@@ -3,6 +3,7 @@ package expo.modules.ui
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import android.graphics.Color as AndroidColor
|
|
5
5
|
import androidx.compose.foundation.layout.Arrangement
|
|
6
|
+
import androidx.compose.foundation.layout.Box
|
|
6
7
|
import androidx.compose.foundation.layout.Column
|
|
7
8
|
import androidx.compose.foundation.layout.Row
|
|
8
9
|
import androidx.compose.material3.Text
|
|
@@ -20,6 +21,8 @@ import expo.modules.kotlin.AppContext
|
|
|
20
21
|
import expo.modules.kotlin.types.Enumerable
|
|
21
22
|
import expo.modules.kotlin.views.ComposeProps
|
|
22
23
|
import expo.modules.kotlin.views.ExpoComposeView
|
|
24
|
+
import expo.modules.kotlin.views.ComposableScope
|
|
25
|
+
import expo.modules.kotlin.views.with
|
|
23
26
|
|
|
24
27
|
enum class HorizontalArrangement(val value: String) : Enumerable {
|
|
25
28
|
START("start"),
|
|
@@ -94,20 +97,20 @@ data class LayoutProps(
|
|
|
94
97
|
val verticalArrangement: MutableState<VerticalArrangement> = mutableStateOf(VerticalArrangement.TOP),
|
|
95
98
|
val horizontalAlignment: MutableState<HorizontalAlignment> = mutableStateOf(HorizontalAlignment.START),
|
|
96
99
|
val verticalAlignment: MutableState<VerticalAlignment> = mutableStateOf(VerticalAlignment.TOP),
|
|
97
|
-
val modifiers: MutableState<List<ExpoModifier
|
|
100
|
+
val modifiers: MutableState<List<ExpoModifier>?> = mutableStateOf(emptyList())
|
|
98
101
|
) : ComposeProps
|
|
99
102
|
|
|
100
103
|
class RowView(context: Context, appContext: AppContext) : ExpoComposeView<LayoutProps>(context, appContext) {
|
|
101
104
|
override val props = LayoutProps()
|
|
102
105
|
|
|
103
106
|
@Composable
|
|
104
|
-
override fun Content(
|
|
107
|
+
override fun ComposableScope.Content() {
|
|
105
108
|
Row(
|
|
106
109
|
horizontalArrangement = props.horizontalArrangement.value.toComposeArrangement(),
|
|
107
110
|
verticalAlignment = props.verticalAlignment.value.toComposeAlignment(),
|
|
108
|
-
modifier =
|
|
111
|
+
modifier = Modifier.fromExpoModifiers(props.modifiers.value, this@Content)
|
|
109
112
|
) {
|
|
110
|
-
Children()
|
|
113
|
+
Children(this@Content.with(rowScope = this@Row))
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
}
|
|
@@ -116,13 +119,26 @@ class ColumnView(context: Context, appContext: AppContext) : ExpoComposeView<Lay
|
|
|
116
119
|
override val props = LayoutProps()
|
|
117
120
|
|
|
118
121
|
@Composable
|
|
119
|
-
override fun Content(
|
|
122
|
+
override fun ComposableScope.Content() {
|
|
120
123
|
Column(
|
|
121
124
|
verticalArrangement = props.verticalArrangement.value.toComposeArrangement(),
|
|
122
125
|
horizontalAlignment = props.horizontalAlignment.value.toComposeAlignment(),
|
|
123
|
-
modifier =
|
|
126
|
+
modifier = Modifier.fromExpoModifiers(props.modifiers.value, this@Content)
|
|
127
|
+
) {
|
|
128
|
+
Children(this@Content.with(columnScope = this@Column))
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
class BoxView(context: Context, appContext: AppContext) : ExpoComposeView<LayoutProps>(context, appContext) {
|
|
134
|
+
override val props = LayoutProps()
|
|
135
|
+
|
|
136
|
+
@Composable
|
|
137
|
+
override fun ComposableScope.Content() {
|
|
138
|
+
Box(
|
|
139
|
+
modifier = Modifier.fromExpoModifiers(props.modifiers.value, this@Content)
|
|
124
140
|
) {
|
|
125
|
-
Children()
|
|
141
|
+
Children(this@Content.with(boxScope = this@Box))
|
|
126
142
|
}
|
|
127
143
|
}
|
|
128
144
|
}
|
|
@@ -169,10 +185,10 @@ class TextView(context: Context, appContext: AppContext) : ExpoComposeView<TextP
|
|
|
169
185
|
override val props = TextProps()
|
|
170
186
|
|
|
171
187
|
@Composable
|
|
172
|
-
override fun Content(
|
|
188
|
+
override fun ComposableScope.Content() {
|
|
173
189
|
Text(
|
|
174
190
|
text = props.text.value,
|
|
175
|
-
modifier =
|
|
191
|
+
modifier = Modifier.fromExpoModifiers(props.modifiers.value),
|
|
176
192
|
color = colorToComposeColor(props.color.value),
|
|
177
193
|
style = TextStyle(
|
|
178
194
|
fontSize = props.fontSize.value.sp,
|
|
@@ -182,13 +198,17 @@ class TextView(context: Context, appContext: AppContext) : ExpoComposeView<TextP
|
|
|
182
198
|
}
|
|
183
199
|
}
|
|
184
200
|
|
|
185
|
-
class
|
|
201
|
+
class HostView(context: Context, appContext: AppContext) :
|
|
186
202
|
ExpoComposeView<ComposeProps>(context, appContext, withHostingView = true) {
|
|
187
203
|
@Composable
|
|
188
|
-
override fun Content(
|
|
189
|
-
for (index in 0..<this.size) {
|
|
204
|
+
override fun ComposableScope.Content() {
|
|
205
|
+
for (index in 0..<this@HostView.size) {
|
|
190
206
|
val child = getChildAt(index) as? ExpoComposeView<*> ?: continue
|
|
191
|
-
|
|
207
|
+
with(this) {
|
|
208
|
+
with(child) {
|
|
209
|
+
Content()
|
|
210
|
+
}
|
|
211
|
+
}
|
|
192
212
|
}
|
|
193
213
|
}
|
|
194
214
|
}
|
|
@@ -25,6 +25,7 @@ import expo.modules.kotlin.types.Enumerable
|
|
|
25
25
|
import expo.modules.kotlin.viewevent.EventDispatcher
|
|
26
26
|
import expo.modules.kotlin.views.ComposeProps
|
|
27
27
|
import expo.modules.kotlin.views.ExpoComposeView
|
|
28
|
+
import expo.modules.kotlin.views.ComposableScope
|
|
28
29
|
import java.util.Calendar
|
|
29
30
|
import java.util.Date
|
|
30
31
|
import android.graphics.Color as AndroidColor
|
|
@@ -68,12 +69,12 @@ data class DateTimePickerProps(
|
|
|
68
69
|
@SuppressLint("ViewConstructor")
|
|
69
70
|
@OptIn(ExperimentalMaterial3Api::class)
|
|
70
71
|
class DateTimePickerView(context: Context, appContext: AppContext) :
|
|
71
|
-
ExpoComposeView<DateTimePickerProps>(context, appContext
|
|
72
|
+
ExpoComposeView<DateTimePickerProps>(context, appContext) {
|
|
72
73
|
override val props = DateTimePickerProps()
|
|
73
74
|
private val onDateSelected by EventDispatcher<DatePickerResult>()
|
|
74
75
|
|
|
75
76
|
@Composable
|
|
76
|
-
override fun Content(
|
|
77
|
+
override fun ComposableScope.Content() {
|
|
77
78
|
if (props.displayedComponents.value == DisplayedComponents.HOUR_AND_MINUTE) {
|
|
78
79
|
ExpoTimePicker(props = props, modifier = Modifier.fromExpoModifiers(props.modifiers.value)) {
|
|
79
80
|
onDateSelected(it)
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
package expo.modules.ui
|
|
2
2
|
|
|
3
3
|
import android.graphics.Color
|
|
4
|
+
import androidx.compose.animation.animateContentSize
|
|
5
|
+
import androidx.compose.animation.core.Spring
|
|
6
|
+
import androidx.compose.animation.core.spring
|
|
4
7
|
import androidx.compose.foundation.BorderStroke
|
|
5
8
|
import androidx.compose.foundation.background
|
|
6
9
|
import androidx.compose.foundation.border
|
|
@@ -12,9 +15,9 @@ import androidx.compose.foundation.layout.size
|
|
|
12
15
|
import androidx.compose.ui.Modifier
|
|
13
16
|
import androidx.compose.ui.draw.alpha
|
|
14
17
|
import androidx.compose.ui.draw.blur
|
|
18
|
+
import androidx.compose.ui.draw.clip
|
|
15
19
|
import androidx.compose.ui.draw.rotate
|
|
16
20
|
import androidx.compose.ui.draw.shadow
|
|
17
|
-
import androidx.compose.ui.unit.Dp
|
|
18
21
|
import androidx.compose.ui.unit.dp
|
|
19
22
|
import androidx.compose.ui.zIndex
|
|
20
23
|
import expo.modules.kotlin.jni.JavaScriptFunction
|
|
@@ -39,6 +42,10 @@ class ExpoUIModule : Module() {
|
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
View(BottomSheetView::class) {
|
|
46
|
+
Events("onIsOpenedChange")
|
|
47
|
+
}
|
|
48
|
+
|
|
42
49
|
// Defines a single view for now – a single choice segmented control
|
|
43
50
|
View(PickerView::class) {
|
|
44
51
|
Events("onOptionSelected")
|
|
@@ -85,10 +92,12 @@ class ExpoUIModule : Module() {
|
|
|
85
92
|
}
|
|
86
93
|
}
|
|
87
94
|
|
|
95
|
+
View(BoxView::class)
|
|
88
96
|
View(RowView::class)
|
|
89
97
|
View(ColumnView::class)
|
|
90
|
-
View(
|
|
98
|
+
View(HostView::class)
|
|
91
99
|
View(TextView::class)
|
|
100
|
+
View(CarouselView::class)
|
|
92
101
|
|
|
93
102
|
View(AlertDialogView::class) {
|
|
94
103
|
Events(
|
|
@@ -104,8 +113,12 @@ class ExpoUIModule : Module() {
|
|
|
104
113
|
)
|
|
105
114
|
}
|
|
106
115
|
|
|
107
|
-
Function("
|
|
108
|
-
return@Function ExpoModifier(Modifier.padding(
|
|
116
|
+
Function("paddingAll") { all: Int ->
|
|
117
|
+
return@Function ExpoModifier(Modifier.padding(all.dp))
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
Function("padding") { start: Int, top: Int, end: Int, bottom: Int ->
|
|
121
|
+
return@Function ExpoModifier(Modifier.padding(start.dp, top.dp, end.dp, bottom.dp))
|
|
109
122
|
}
|
|
110
123
|
|
|
111
124
|
Function("size") { width: Int, height: Int ->
|
|
@@ -160,6 +173,44 @@ class ExpoUIModule : Module() {
|
|
|
160
173
|
return@Function ExpoModifier(Modifier.zIndex(index))
|
|
161
174
|
}
|
|
162
175
|
|
|
176
|
+
Function("animateContentSize") { dampingRatio: Float?, stiffness: Float? ->
|
|
177
|
+
return@Function ExpoModifier(
|
|
178
|
+
Modifier.animateContentSize(
|
|
179
|
+
spring(dampingRatio = dampingRatio ?: Spring.DampingRatioNoBouncy, stiffness = stiffness ?: Spring.StiffnessMedium)
|
|
180
|
+
)
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
Function("weight") { weight: Float ->
|
|
185
|
+
val scopedExpoModifier = ExpoModifier {
|
|
186
|
+
it.rowScope?.run {
|
|
187
|
+
Modifier.weight(weight)
|
|
188
|
+
} ?: it.columnScope?.run {
|
|
189
|
+
Modifier.weight(weight)
|
|
190
|
+
} ?: Modifier
|
|
191
|
+
}
|
|
192
|
+
return@Function scopedExpoModifier
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
Function("matchParentSize") {
|
|
196
|
+
val scopedExpoModifier = ExpoModifier {
|
|
197
|
+
it.boxScope?.run {
|
|
198
|
+
Modifier.matchParentSize()
|
|
199
|
+
} ?: Modifier
|
|
200
|
+
}
|
|
201
|
+
return@Function scopedExpoModifier
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
Function("testID") { testID: String ->
|
|
205
|
+
return@Function ExpoModifier(Modifier.applyTestTag(testID))
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
Function("clip") { shapeRecord: ShapeRecord ->
|
|
209
|
+
val shape = shapeFromShapeRecord(shapeRecord)
|
|
210
|
+
?: return@Function Modifier
|
|
211
|
+
return@Function ExpoModifier(Modifier.clip(shape))
|
|
212
|
+
}
|
|
213
|
+
|
|
163
214
|
// TODO: Consider implementing semantics, layoutId, clip, navigationBarsPadding, systemBarsPadding
|
|
164
215
|
}
|
|
165
216
|
}
|