@expo/ui 55.0.1 → 55.0.3
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 +58 -0
- package/CONTRIBUTING.md +30 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/AnimatedVisibilityView.kt +130 -0
- package/android/src/main/java/expo/modules/ui/CardView.kt +138 -34
- package/android/src/main/java/expo/modules/ui/CheckboxView.kt +98 -0
- package/android/src/main/java/expo/modules/ui/ChipView.kt +267 -142
- package/android/src/main/java/expo/modules/ui/DatePickerView.kt +302 -31
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +204 -57
- package/android/src/main/java/expo/modules/ui/HorizontalFloatingToolbarView.kt +21 -8
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +149 -40
- package/android/src/main/java/expo/modules/ui/ProgressView.kt +189 -89
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +204 -50
- package/android/src/main/java/expo/modules/ui/RadioButtonView.kt +3 -7
- package/android/src/main/java/expo/modules/ui/SegmentedButtonView.kt +115 -0
- package/android/src/main/java/expo/modules/ui/SegmentedControlView.kt +35 -0
- package/android/src/main/java/expo/modules/ui/SliderView.kt +70 -12
- package/android/src/main/java/expo/modules/ui/SwitchView.kt +62 -104
- package/android/src/main/java/expo/modules/ui/ToggleButtonView.kt +95 -57
- package/android/src/main/java/expo/modules/ui/button/Button.kt +117 -158
- package/android/src/main/java/expo/modules/ui/button/FloatingActionButton.kt +92 -0
- package/android/src/main/java/expo/modules/ui/button/IconButton.kt +73 -80
- package/android/src/main/java/expo/modules/ui/convertibles/AnimatableFloat.kt +26 -0
- package/android/src/main/java/expo/modules/ui/convertibles/AnimationSpecParams.kt +93 -0
- package/android/src/main/java/expo/modules/ui/convertibles/GraphicsLayerParams.kt +24 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +39 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuItem.kt +70 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +18 -0
- package/build/jetpack-compose/AnimatedVisibility/index.d.ts +134 -0
- package/build/jetpack-compose/AnimatedVisibility/index.d.ts.map +1 -0
- package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts +3 -0
- package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts.map +1 -0
- package/build/jetpack-compose/Button/index.d.ts +65 -51
- package/build/jetpack-compose/Button/index.d.ts.map +1 -1
- package/build/jetpack-compose/Card/index.d.ts +72 -14
- package/build/jetpack-compose/Card/index.d.ts.map +1 -1
- package/build/jetpack-compose/Checkbox/index.d.ts +73 -0
- package/build/jetpack-compose/Checkbox/index.d.ts.map +1 -0
- package/build/jetpack-compose/Chip/index.d.ts +247 -27
- package/build/jetpack-compose/Chip/index.d.ts.map +1 -1
- package/build/jetpack-compose/DatePicker/index.d.ts +137 -3
- package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts +70 -0
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts.map +1 -0
- package/build/jetpack-compose/DropdownMenu/index.d.ts +68 -0
- package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -0
- package/build/jetpack-compose/FloatingActionButton/index.d.ts +150 -0
- package/build/jetpack-compose/FloatingActionButton/index.d.ts.map +1 -0
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts +2 -2
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts.map +1 -1
- package/build/jetpack-compose/IconButton/index.d.ts +45 -29
- package/build/jetpack-compose/IconButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts +17 -0
- package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts.map +1 -0
- package/build/jetpack-compose/Progress/index.d.ts +78 -35
- package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
- package/build/jetpack-compose/RadioButton/index.d.ts +2 -2
- package/build/jetpack-compose/RadioButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/SegmentedButton/index.d.ts +74 -0
- package/build/jetpack-compose/SegmentedButton/index.d.ts.map +1 -0
- package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts +17 -0
- package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts.map +1 -0
- package/build/jetpack-compose/Slider/index.d.ts +34 -10
- package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
- package/build/jetpack-compose/Spacer/index.d.ts +2 -2
- package/build/jetpack-compose/Switch/index.d.ts +25 -47
- package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
- package/build/jetpack-compose/ToggleButton/index.d.ts +60 -32
- package/build/jetpack-compose/ToggleButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/index.d.ts +5 -4
- package/build/jetpack-compose/index.d.ts.map +1 -1
- package/build/jetpack-compose/modifiers/animation.d.ts +44 -0
- package/build/jetpack-compose/modifiers/animation.d.ts.map +1 -0
- package/build/jetpack-compose/modifiers/index.d.ts +68 -4
- package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/AccessoryWidgetBackground/index.d.ts +4 -0
- package/build/swift-ui/AccessoryWidgetBackground/index.d.ts.map +1 -0
- package/build/swift-ui/ConfirmationDialog/index.d.ts.map +1 -1
- package/build/swift-ui/ContextMenu/index.d.ts.map +1 -1
- package/build/swift-ui/ControlGroup/index.d.ts +29 -0
- package/build/swift-ui/ControlGroup/index.d.ts.map +1 -0
- package/build/swift-ui/Gauge/index.d.ts.map +1 -1
- package/build/swift-ui/Image/index.d.ts +7 -1
- package/build/swift-ui/Image/index.d.ts.map +1 -1
- package/build/swift-ui/Label/index.d.ts.map +1 -1
- package/build/swift-ui/LabeledContent/index.d.ts.map +1 -1
- package/build/swift-ui/Menu/index.d.ts.map +1 -1
- package/build/swift-ui/Picker/index.d.ts.map +1 -1
- package/build/swift-ui/Popover/index.d.ts.map +1 -1
- package/build/swift-ui/ProgressView/index.d.ts +1 -5
- package/build/swift-ui/ProgressView/index.d.ts.map +1 -1
- package/build/swift-ui/Section/index.d.ts.map +1 -1
- package/build/swift-ui/Slider/index.d.ts.map +1 -1
- package/build/swift-ui/SlotView.d.ts +5 -0
- package/build/swift-ui/SlotView.d.ts.map +1 -0
- package/build/swift-ui/Stepper/index.d.ts +3 -3
- package/build/swift-ui/Stepper/index.d.ts.map +1 -1
- package/build/swift-ui/Text/index.d.ts +33 -1
- package/build/swift-ui/Text/index.d.ts.map +1 -1
- 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 +54 -1
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/shapes/index.d.ts +2 -2
- package/build/swift-ui/types.d.ts +7 -0
- package/build/swift-ui/types.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/AccessoryWidgetBackgroundView.swift +27 -0
- package/ios/BottomSheetView.swift +1 -6
- package/ios/ClosedRangeDateRecord.swift +10 -0
- package/ios/ColorPickerView.swift +9 -8
- package/ios/ConfirmationDialog/ConfirmationDialog.swift +7 -15
- package/ios/ConfirmationDialog/ConfirmationDialogProps.swift +0 -5
- package/ios/ContextMenu/ContextMenu.swift +27 -22
- package/ios/ContextMenu/ContextMenuRecords.swift +0 -6
- package/ios/ControlGroupView.swift +33 -0
- package/ios/DatePickerView.swift +7 -5
- package/ios/DisclosureGroupView.swift +5 -7
- package/ios/ExpoUIModule.swift +10 -32
- package/ios/GaugeView.swift +4 -26
- package/ios/HostView.swift +1 -2
- package/ios/ImageView.swift +22 -11
- package/ios/Label.swift +2 -17
- package/ios/LabeledContentView.swift +3 -27
- package/ios/ListView.swift +6 -14
- package/ios/Menu/MenuRecords.swift +0 -2
- package/ios/Menu/MenuView.swift +2 -5
- package/ios/Modifiers/DefaultScrollAnchorForRoleModifier.swift +32 -0
- package/ios/Modifiers/DefaultScrollAnchorModifier.swift +16 -0
- package/ios/Modifiers/ResizableModifier.swift +24 -0
- package/ios/Modifiers/Rotation3DEffectModifier.swift +20 -0
- package/ios/Modifiers/View+ModifierArray.swift +29 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +37 -3
- package/ios/Modifiers/WidgetModifiers.swift +46 -0
- package/ios/Picker/PickerView.swift +8 -16
- package/ios/Popover/PopoverProps.swift +0 -4
- package/ios/Popover/PopoverView.swift +5 -11
- package/ios/ProgressView.swift +0 -5
- package/ios/RNHostView.swift +91 -10
- package/ios/SectionView.swift +9 -17
- package/ios/SecureFieldView.swift +0 -1
- package/ios/ShareLink/ShareLinkView.swift +1 -1
- package/ios/SliderView.swift +16 -31
- package/ios/SlotView.swift +38 -0
- package/ios/StepperView.swift +12 -16
- package/ios/TextFieldView.swift +0 -1
- package/ios/TextView.swift +37 -1
- package/ios/Toggle/ToggleView.swift +5 -7
- package/ios/UIBaseView.swift +34 -3
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.1/expo.modules.ui-55.0.1.module → 55.0.3/expo.modules.ui-55.0.3.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.1/expo.modules.ui-55.0.1.pom → 55.0.3/expo.modules.ui-55.0.3.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.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 -2
- package/src/jetpack-compose/AnimatedVisibility/index.tsx +206 -0
- package/src/jetpack-compose/AnimatedVisibility/symbols.ts +8 -0
- package/src/jetpack-compose/Button/index.tsx +69 -92
- package/src/jetpack-compose/Card/index.tsx +105 -29
- package/src/jetpack-compose/Checkbox/index.tsx +126 -0
- package/src/jetpack-compose/Chip/index.tsx +391 -51
- package/src/jetpack-compose/DatePicker/index.tsx +215 -6
- package/src/jetpack-compose/DropdownMenu/DropdownMenuItem.tsx +126 -0
- package/src/jetpack-compose/DropdownMenu/index.tsx +107 -0
- package/src/jetpack-compose/FloatingActionButton/index.tsx +207 -0
- package/src/jetpack-compose/HorizontalFloatingToolbar/index.tsx +4 -2
- package/src/jetpack-compose/IconButton/index.tsx +49 -56
- package/src/jetpack-compose/MultiChoiceSegmentedButtonRow/index.tsx +34 -0
- package/src/jetpack-compose/Progress/index.tsx +120 -62
- package/src/jetpack-compose/RadioButton/index.tsx +8 -9
- package/src/jetpack-compose/SegmentedButton/index.tsx +109 -0
- package/src/jetpack-compose/SingleChoiceSegmentedButtonRow/index.tsx +34 -0
- package/src/jetpack-compose/Slider/index.tsx +76 -29
- package/src/jetpack-compose/Spacer/index.tsx +2 -2
- package/src/jetpack-compose/Switch/index.tsx +32 -84
- package/src/jetpack-compose/ToggleButton/index.tsx +67 -43
- package/src/jetpack-compose/index.ts +5 -4
- package/src/jetpack-compose/modifiers/animation.ts +37 -0
- package/src/jetpack-compose/modifiers/index.ts +86 -6
- package/src/swift-ui/AccessoryWidgetBackground/index.tsx +12 -0
- package/src/swift-ui/ConfirmationDialog/index.tsx +4 -12
- package/src/swift-ui/ContextMenu/index.tsx +6 -20
- package/src/swift-ui/ControlGroup/index.tsx +59 -0
- package/src/swift-ui/Gauge/index.tsx +5 -20
- package/src/swift-ui/Image/index.tsx +7 -1
- package/src/swift-ui/Label/index.tsx +2 -5
- package/src/swift-ui/LabeledContent/index.tsx +3 -12
- package/src/swift-ui/Menu/index.tsx +2 -6
- package/src/swift-ui/Picker/index.tsx +4 -11
- package/src/swift-ui/Popover/index.tsx +3 -12
- package/src/swift-ui/ProgressView/index.tsx +1 -3
- package/src/swift-ui/Section/index.tsx +4 -9
- package/src/swift-ui/Slider/index.tsx +4 -12
- package/src/swift-ui/SlotView.tsx +8 -0
- package/src/swift-ui/Stepper/index.tsx +7 -7
- package/src/swift-ui/Text/index.tsx +66 -2
- package/src/swift-ui/index.tsx +2 -0
- package/src/swift-ui/modifiers/index.ts +87 -1
- package/src/swift-ui/types.ts +5 -0
- package/android/src/main/java/expo/modules/ui/FilterChipView.kt +0 -59
- package/android/src/main/java/expo/modules/ui/PickerView.kt +0 -161
- package/android/src/main/java/expo/modules/ui/TextButtonView.kt +0 -33
- package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +0 -183
- package/android/src/main/java/expo/modules/ui/menu/ContextMenuRecords.kt +0 -64
- package/build/jetpack-compose/Button/types.d.ts +0 -5
- package/build/jetpack-compose/Button/types.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/Submenu.d.ts +0 -17
- package/build/jetpack-compose/ContextMenu/Submenu.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/index.d.ts +0 -65
- package/build/jetpack-compose/ContextMenu/index.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/utils.d.ts +0 -24
- package/build/jetpack-compose/ContextMenu/utils.d.ts.map +0 -1
- package/build/jetpack-compose/FilterChip/index.d.ts +0 -49
- package/build/jetpack-compose/FilterChip/index.d.ts.map +0 -1
- package/build/jetpack-compose/Picker/index.d.ts +0 -62
- package/build/jetpack-compose/Picker/index.d.ts.map +0 -1
- package/build/jetpack-compose/TextButton/index.d.ts +0 -29
- package/build/jetpack-compose/TextButton/index.d.ts.map +0 -1
- package/ios/ConfirmationDialog/ConfirmationDialogComponents.swift +0 -26
- package/ios/ContextMenu/ContextMenuComponents.swift +0 -37
- package/ios/Menu/MenuComponents.swift +0 -12
- package/ios/Picker/PickerComponents.swift +0 -24
- package/ios/Popover/PopoverComponents.swift +0 -18
- package/ios/SectionComponents.swift +0 -34
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha512 +0 -1
- package/src/jetpack-compose/Button/types.ts +0 -57
- package/src/jetpack-compose/ContextMenu/Submenu.tsx +0 -21
- package/src/jetpack-compose/ContextMenu/index.tsx +0 -149
- package/src/jetpack-compose/ContextMenu/utils.ts +0 -144
- package/src/jetpack-compose/FilterChip/index.tsx +0 -89
- package/src/jetpack-compose/Picker/index.tsx +0 -90
- package/src/jetpack-compose/TextButton/index.tsx +0 -55
|
@@ -13,10 +13,9 @@ internal final class ToggleProps: UIBaseViewProps {
|
|
|
13
13
|
internal struct ToggleView: ExpoSwiftUI.View {
|
|
14
14
|
@ObservedObject var props: ToggleProps
|
|
15
15
|
@State var checked: Bool = false
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
init(props: ToggleProps) {
|
|
18
18
|
self.props = props
|
|
19
|
-
_checked = State(initialValue: props.isOn ?? false)
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
var body: some View {
|
|
@@ -30,11 +29,10 @@ internal struct ToggleView: ExpoSwiftUI.View {
|
|
|
30
29
|
])
|
|
31
30
|
}
|
|
32
31
|
.onChange(of: props.isOn) { newValue in
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
checked = newValue
|
|
32
|
+
checked = newValue ?? false
|
|
33
|
+
}
|
|
34
|
+
.onAppear {
|
|
35
|
+
checked = props.isOn ?? false
|
|
38
36
|
}
|
|
39
37
|
}
|
|
40
38
|
|
package/ios/UIBaseView.swift
CHANGED
|
@@ -8,22 +8,24 @@ import SwiftUI
|
|
|
8
8
|
*/
|
|
9
9
|
public struct UIBaseView<Props: UIBaseViewProps, Content: ExpoSwiftUI.View<Props>>: ExpoSwiftUI.View {
|
|
10
10
|
@ObservedObject public var props: Props
|
|
11
|
+
let innerView: Content
|
|
11
12
|
|
|
12
13
|
public init(props: Props) {
|
|
13
14
|
self.props = props
|
|
15
|
+
self.innerView = Content(props: props)
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
public var body: some View {
|
|
17
|
-
|
|
19
|
+
innerView
|
|
18
20
|
.applyAccessibilityIdentifier(props.testID)
|
|
19
21
|
.applyModifiers(props.modifiers, appContext: props.appContext, globalEventDispatcher: props.globalEventDispatcher)
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
|
-
|
|
25
|
-
This is useful for View with AsyncFunctions that cannot use the `ExpoUIView` builder.
|
|
26
|
+
Deprecated. Use `applyModifiers` method directly instead.
|
|
26
27
|
*/
|
|
28
|
+
@available(*, deprecated, message: "Use applyModifiers method directly on the content view instead.")
|
|
27
29
|
public struct UIBaseViewModifier<Props: UIBaseViewProps>: ViewModifier {
|
|
28
30
|
@ObservedObject var props: Props
|
|
29
31
|
var defaultFrameAlignment = Alignment.center
|
|
@@ -35,6 +37,21 @@ public struct UIBaseViewModifier<Props: UIBaseViewProps>: ViewModifier {
|
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
// MARK: - ViewWrapper
|
|
41
|
+
|
|
42
|
+
extension UIBaseView: ExpoSwiftUI.ViewWrapper {
|
|
43
|
+
public func getWrappedView() -> Any {
|
|
44
|
+
return innerView
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// MARK: - FocusableView forwarding
|
|
49
|
+
extension UIBaseView: ExpoSwiftUI.FocusableView where Content: ExpoSwiftUI.FocusableView {
|
|
50
|
+
public func forceResignFirstResponder() {
|
|
51
|
+
innerView.forceResignFirstResponder()
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
38
55
|
/**
|
|
39
56
|
Common UI Builder in expo-ui.
|
|
40
57
|
This is similar to expo-modules-core's View builder but further supports common base view props and modifiers
|
|
@@ -49,3 +66,17 @@ public func ExpoUIView<Content: ExpoSwiftUI.View>(
|
|
|
49
66
|
ViewName(contentName)
|
|
50
67
|
}
|
|
51
68
|
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
ExpoUIView overload that accepts a `@ViewDefinitionBuilder` closure for registering
|
|
72
|
+
AsyncFunctions and other view definition elements.
|
|
73
|
+
*/
|
|
74
|
+
public func ExpoUIView<Content: ExpoSwiftUI.View>(
|
|
75
|
+
_ contentType: Content.Type,
|
|
76
|
+
@ExpoSwiftUI.ViewDefinitionBuilder<Content> _ elements: @escaping () -> [AnyViewDefinitionElement]
|
|
77
|
+
) -> ExpoSwiftUI.ViewDefinition<Content.Props, UIBaseView<Content.Props, Content>> where Content.Props: UIBaseViewProps {
|
|
78
|
+
let wrappedType = UIBaseView<Content.Props, Content>.self
|
|
79
|
+
let contentName = String(describing: contentType)
|
|
80
|
+
|
|
81
|
+
return ExpoSwiftUI.ViewDefinition(wrappedType, name: contentName, elements: elements())
|
|
82
|
+
}
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar
ADDED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0a032184d0eac4ef04d3f10fe2ee4bbd
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
946e37bf3649dc1cd162039cb8a8f09dda746589
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c57afb701286b9952b45654e012a91a385a29294de33d0513f8d198f304e2469
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
17c66704e0a4a36020c483c7fa57c36e3a00859c0ec6a021f4c05d265d211fc861c7181e5ae44d2982418c3e463da8b3bec84ecd26da1361513712e77b5ba479
|
|
Binary file
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e71e2dd13981dbfb7885feb0b0bfe390
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cfdba1b98a6054184b39f6b71d33c18f385c26d2
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b28fefc8ae185432f8d8988a2701d0f38bab89a15eebeb60a3e27462ad814be6
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1cadb83d41093807cf37e093484e7f8206f11e856e6eebb3d77c679800b75b9ad8dbfa074cc2f4ff75c60b9de7cba4099d76c37c11158a7551fb827b4808e615
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "expo.modules.ui",
|
|
5
5
|
"module": "expo.modules.ui",
|
|
6
|
-
"version": "55.0.
|
|
6
|
+
"version": "55.0.3",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.ui-55.0.
|
|
28
|
-
"url": "expo.modules.ui-55.0.
|
|
29
|
-
"size":
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
27
|
+
"name": "expo.modules.ui-55.0.3.aar",
|
|
28
|
+
"url": "expo.modules.ui-55.0.3.aar",
|
|
29
|
+
"size": 926327,
|
|
30
|
+
"sha512": "1cadb83d41093807cf37e093484e7f8206f11e856e6eebb3d77c679800b75b9ad8dbfa074cc2f4ff75c60b9de7cba4099d76c37c11158a7551fb827b4808e615",
|
|
31
|
+
"sha256": "b28fefc8ae185432f8d8988a2701d0f38bab89a15eebeb60a3e27462ad814be6",
|
|
32
|
+
"sha1": "cfdba1b98a6054184b39f6b71d33c18f385c26d2",
|
|
33
|
+
"md5": "e71e2dd13981dbfb7885feb0b0bfe390"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -120,13 +120,13 @@
|
|
|
120
120
|
],
|
|
121
121
|
"files": [
|
|
122
122
|
{
|
|
123
|
-
"name": "expo.modules.ui-55.0.
|
|
124
|
-
"url": "expo.modules.ui-55.0.
|
|
125
|
-
"size":
|
|
126
|
-
"sha512": "
|
|
127
|
-
"sha256": "
|
|
128
|
-
"sha1": "
|
|
129
|
-
"md5": "
|
|
123
|
+
"name": "expo.modules.ui-55.0.3.aar",
|
|
124
|
+
"url": "expo.modules.ui-55.0.3.aar",
|
|
125
|
+
"size": 926327,
|
|
126
|
+
"sha512": "1cadb83d41093807cf37e093484e7f8206f11e856e6eebb3d77c679800b75b9ad8dbfa074cc2f4ff75c60b9de7cba4099d76c37c11158a7551fb827b4808e615",
|
|
127
|
+
"sha256": "b28fefc8ae185432f8d8988a2701d0f38bab89a15eebeb60a3e27462ad814be6",
|
|
128
|
+
"sha1": "cfdba1b98a6054184b39f6b71d33c18f385c26d2",
|
|
129
|
+
"md5": "e71e2dd13981dbfb7885feb0b0bfe390"
|
|
130
130
|
}
|
|
131
131
|
]
|
|
132
132
|
},
|
|
@@ -140,13 +140,13 @@
|
|
|
140
140
|
},
|
|
141
141
|
"files": [
|
|
142
142
|
{
|
|
143
|
-
"name": "expo.modules.ui-55.0.
|
|
144
|
-
"url": "expo.modules.ui-55.0.
|
|
145
|
-
"size":
|
|
146
|
-
"sha512": "
|
|
147
|
-
"sha256": "
|
|
148
|
-
"sha1": "
|
|
149
|
-
"md5": "
|
|
143
|
+
"name": "expo.modules.ui-55.0.3-sources.jar",
|
|
144
|
+
"url": "expo.modules.ui-55.0.3-sources.jar",
|
|
145
|
+
"size": 59533,
|
|
146
|
+
"sha512": "17c66704e0a4a36020c483c7fa57c36e3a00859c0ec6a021f4c05d265d211fc861c7181e5ae44d2982418c3e463da8b3bec84ecd26da1361513712e77b5ba479",
|
|
147
|
+
"sha256": "c57afb701286b9952b45654e012a91a385a29294de33d0513f8d198f304e2469",
|
|
148
|
+
"sha1": "946e37bf3649dc1cd162039cb8a8f09dda746589",
|
|
149
|
+
"md5": "0a032184d0eac4ef04d3f10fe2ee4bbd"
|
|
150
150
|
}
|
|
151
151
|
]
|
|
152
152
|
}
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fc4fc4dd0ecfb0dc5b0541f32d7c4219
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4d309366193fb9e93dfc2f528d842ef199d9356f
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8538fc44dce117d85e63175555983fbe9c41be3e21c0c1a38bd8284538348cfb
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9b945333e9fabb773714dc66ccfd5556156ad6804aa63126a4d8db3351df53287def6a225bda7c5822ed780b7aaddbd36cac41fd31094df091b99b2c4cc75780
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>expo.modules.ui</groupId>
|
|
11
11
|
<artifactId>expo.modules.ui</artifactId>
|
|
12
|
-
<version>55.0.
|
|
12
|
+
<version>55.0.3</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.ui</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a3df23f7e9d010b71fdfe87e96789d6d
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3296958fe9f35c69d8d5c4b2557dc5a71c45935f
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7c81267db605b109cc861c92c6c76b415dd5c7387766652b399877e6cd485481
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
20a8aefc780090feeeffd634b020ce55a5288bd2c12ba66ef0c19e81b78633cb13916d8dd5fea9b4cf1b3a07c00dbeb0599c4f283800bfe7bf44c90570841e07
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>expo.modules.ui</groupId>
|
|
4
4
|
<artifactId>expo.modules.ui</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>55.0.
|
|
7
|
-
<release>55.0.
|
|
6
|
+
<latest>55.0.3</latest>
|
|
7
|
+
<release>55.0.3</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>55.0.
|
|
9
|
+
<version>55.0.3</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260317165330</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ba5645a93d7825372e7e0f45563e1cfd
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4f2050a563003a387527564b35508ee311916fae
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
0ea5ca4c5502f8f61efb4a7c56f5bd0f744abef7ed58d4388d54bab48fc602df
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
f9f75a9f46b1a6ac2ebe41af9e8973f7fb40aa23ed7861b2ffc6a025b80dd888c25d8be8d8748473ec14243a753892d9865db99c8304416d0e63610f50f7d8ff
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/ui",
|
|
3
|
-
"version": "55.0.
|
|
3
|
+
"version": "55.0.3",
|
|
4
4
|
"description": "A collection of UI components",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.fx.js"
|
|
@@ -55,10 +55,13 @@
|
|
|
55
55
|
"@types/react": "~19.2.0",
|
|
56
56
|
"expo-module-scripts": "^55.0.2"
|
|
57
57
|
},
|
|
58
|
+
"jest": {
|
|
59
|
+
"preset": "expo-module-scripts"
|
|
60
|
+
},
|
|
58
61
|
"peerDependencies": {
|
|
59
62
|
"expo": "*",
|
|
60
63
|
"react": "*",
|
|
61
64
|
"react-native": "*"
|
|
62
65
|
},
|
|
63
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "9260ae10a08271027d85792b7128e0d4883dca4d"
|
|
64
67
|
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AnimatedVisibility — a React wrapper around Jetpack Compose's AnimatedVisibility.
|
|
3
|
+
*
|
|
4
|
+
* Architecture overview:
|
|
5
|
+
*
|
|
6
|
+
* 1. **Public API** — `EnterTransition` / `ExitTransition` factory objects produce
|
|
7
|
+
* chainable transition descriptors via `.plus()`, mirroring Compose's `+` operator.
|
|
8
|
+
*
|
|
9
|
+
* 2. **Internal records** — Each factory call creates an `EnterTransitionRecord` or
|
|
10
|
+
* `ExitTransitionRecord`, a plain JSON object with a `type` discriminator and optional
|
|
11
|
+
* parameters. These records are the format passed to the native Android view.
|
|
12
|
+
*
|
|
13
|
+
* 3. **Symbol-based encapsulation** — The record arrays are stored behind unique Symbols
|
|
14
|
+
* (`ENTER_TRANSITION_SYMBOL` / `EXIT_TRANSITION_SYMBOL`). This prevents consumers from
|
|
15
|
+
* accessing or constructing raw records directly, ensuring transitions are only built
|
|
16
|
+
* through the factory API.
|
|
17
|
+
*
|
|
18
|
+
* 4. **Chaining** — `.plus(other)` concatenates the current record array with `other`'s
|
|
19
|
+
* records into a new transition object. The result is a flat list, not a tree.
|
|
20
|
+
* e.g. `fadeIn().plus(expandIn())` → `[{ type: 'fadeIn' }, { type: 'expandIn' }]`
|
|
21
|
+
*
|
|
22
|
+
* 5. **Component** — `<AnimatedVisibility>` extracts the record arrays from the chainable
|
|
23
|
+
* types via their Symbols and passes them as plain JSON arrays to the native view.
|
|
24
|
+
*/
|
|
25
|
+
import { requireNativeView } from 'expo';
|
|
26
|
+
|
|
27
|
+
import { PrimitiveBaseProps, transformProps } from '../layout-types';
|
|
28
|
+
import { ENTER_TRANSITION_SYMBOL, EXIT_TRANSITION_SYMBOL } from './symbols';
|
|
29
|
+
|
|
30
|
+
type EnterTransitionRecord = {
|
|
31
|
+
type:
|
|
32
|
+
| 'fadeIn'
|
|
33
|
+
| 'slideInHorizontally'
|
|
34
|
+
| 'slideInVertically'
|
|
35
|
+
| 'expandIn'
|
|
36
|
+
| 'expandHorizontally'
|
|
37
|
+
| 'expandVertically'
|
|
38
|
+
| 'scaleIn';
|
|
39
|
+
initialAlpha?: number;
|
|
40
|
+
/** Fraction of width: -1.0 = full width left, 1.0 = full width right */
|
|
41
|
+
initialOffsetX?: number;
|
|
42
|
+
/** Fraction of height: -1.0 = full height top, 1.0 = full height bottom */
|
|
43
|
+
initialOffsetY?: number;
|
|
44
|
+
initialScale?: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type ExitTransitionRecord = {
|
|
48
|
+
type:
|
|
49
|
+
| 'fadeOut'
|
|
50
|
+
| 'slideOutHorizontally'
|
|
51
|
+
| 'slideOutVertically'
|
|
52
|
+
| 'shrinkOut'
|
|
53
|
+
| 'shrinkHorizontally'
|
|
54
|
+
| 'shrinkVertically'
|
|
55
|
+
| 'scaleOut';
|
|
56
|
+
targetAlpha?: number;
|
|
57
|
+
/** Fraction of width: -1.0 = full width left, 1.0 = full width right */
|
|
58
|
+
targetOffsetX?: number;
|
|
59
|
+
/** Fraction of height: -1.0 = full height top, 1.0 = full height bottom */
|
|
60
|
+
targetOffsetY?: number;
|
|
61
|
+
targetScale?: number;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Represents an enter transition that can be combined with other enter transitions using `.plus()`.
|
|
66
|
+
*/
|
|
67
|
+
export type EnterTransitionType = {
|
|
68
|
+
/** Combines this transition with another enter transition (mirrors Compose's `+` operator). */
|
|
69
|
+
plus: (other: EnterTransitionType) => EnterTransitionType;
|
|
70
|
+
[ENTER_TRANSITION_SYMBOL]: () => EnterTransitionRecord[];
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Represents an exit transition that can be combined with other exit transitions using `.plus()`.
|
|
75
|
+
*/
|
|
76
|
+
export type ExitTransitionType = {
|
|
77
|
+
/** Combines this transition with another exit transition (mirrors Compose's `+` operator). */
|
|
78
|
+
plus: (other: ExitTransitionType) => ExitTransitionType;
|
|
79
|
+
[EXIT_TRANSITION_SYMBOL]: () => ExitTransitionRecord[];
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
function createEnterTransition(records: EnterTransitionRecord[]): EnterTransitionType {
|
|
83
|
+
return {
|
|
84
|
+
plus: (other) => createEnterTransition([...records, ...other[ENTER_TRANSITION_SYMBOL]()]),
|
|
85
|
+
[ENTER_TRANSITION_SYMBOL]: () => records,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function createExitTransition(records: ExitTransitionRecord[]): ExitTransitionType {
|
|
90
|
+
return {
|
|
91
|
+
plus: (other) => createExitTransition([...records, ...other[EXIT_TRANSITION_SYMBOL]()]),
|
|
92
|
+
[EXIT_TRANSITION_SYMBOL]: () => records,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Factory for enter transitions used with `AnimatedVisibility`.
|
|
98
|
+
* Transitions can be combined using `.plus()`.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```tsx
|
|
102
|
+
* // Single transition
|
|
103
|
+
* EnterTransition.fadeIn()
|
|
104
|
+
*
|
|
105
|
+
* // Combined transitions
|
|
106
|
+
* EnterTransition.fadeIn({ initialAlpha: 0.3 })
|
|
107
|
+
* .plus(EnterTransition.slideInHorizontally({ initialOffsetX: 1.0 }))
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export const EnterTransition = {
|
|
111
|
+
/** Fades the content in. */
|
|
112
|
+
fadeIn: (params?: { initialAlpha?: number }) =>
|
|
113
|
+
createEnterTransition([{ type: 'fadeIn', ...params }]),
|
|
114
|
+
/** Slides the content in horizontally. */
|
|
115
|
+
slideInHorizontally: (params?: { initialOffsetX?: number }) =>
|
|
116
|
+
createEnterTransition([{ type: 'slideInHorizontally', ...params }]),
|
|
117
|
+
/** Slides the content in vertically. */
|
|
118
|
+
slideInVertically: (params?: { initialOffsetY?: number }) =>
|
|
119
|
+
createEnterTransition([{ type: 'slideInVertically', ...params }]),
|
|
120
|
+
/** Expands the content from the center. */
|
|
121
|
+
expandIn: () => createEnterTransition([{ type: 'expandIn' }]),
|
|
122
|
+
/** Expands the content horizontally from the center. */
|
|
123
|
+
expandHorizontally: () => createEnterTransition([{ type: 'expandHorizontally' }]),
|
|
124
|
+
/** Expands the content vertically from the center. */
|
|
125
|
+
expandVertically: () => createEnterTransition([{ type: 'expandVertically' }]),
|
|
126
|
+
/** Scales the content in from a smaller size. */
|
|
127
|
+
scaleIn: (params?: { initialScale?: number }) =>
|
|
128
|
+
createEnterTransition([{ type: 'scaleIn', ...params }]),
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Factory for exit transitions used with `AnimatedVisibility`.
|
|
133
|
+
* Transitions can be combined using `.plus()`.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```tsx
|
|
137
|
+
* // Single transition
|
|
138
|
+
* ExitTransition.fadeOut()
|
|
139
|
+
*
|
|
140
|
+
* // Combined transitions
|
|
141
|
+
* ExitTransition.fadeOut()
|
|
142
|
+
* .plus(ExitTransition.slideOutHorizontally({ targetOffsetX: 1.0 }))
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
export const ExitTransition = {
|
|
146
|
+
/** Fades the content out. */
|
|
147
|
+
fadeOut: (params?: { targetAlpha?: number }) =>
|
|
148
|
+
createExitTransition([{ type: 'fadeOut', ...params }]),
|
|
149
|
+
/** Slides the content out horizontally. */
|
|
150
|
+
slideOutHorizontally: (params?: { targetOffsetX?: number }) =>
|
|
151
|
+
createExitTransition([{ type: 'slideOutHorizontally', ...params }]),
|
|
152
|
+
/** Slides the content out vertically. */
|
|
153
|
+
slideOutVertically: (params?: { targetOffsetY?: number }) =>
|
|
154
|
+
createExitTransition([{ type: 'slideOutVertically', ...params }]),
|
|
155
|
+
/** Shrinks the content towards the center. */
|
|
156
|
+
shrinkOut: () => createExitTransition([{ type: 'shrinkOut' }]),
|
|
157
|
+
/** Shrinks the content horizontally towards the center. */
|
|
158
|
+
shrinkHorizontally: () => createExitTransition([{ type: 'shrinkHorizontally' }]),
|
|
159
|
+
/** Shrinks the content vertically towards the center. */
|
|
160
|
+
shrinkVertically: () => createExitTransition([{ type: 'shrinkVertically' }]),
|
|
161
|
+
/** Scales the content out to a smaller size. */
|
|
162
|
+
scaleOut: (params?: { targetScale?: number }) =>
|
|
163
|
+
createExitTransition([{ type: 'scaleOut', ...params }]),
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export type AnimatedVisibilityProps = {
|
|
167
|
+
children?: React.ReactNode;
|
|
168
|
+
/**
|
|
169
|
+
* Whether the content is visible. When changed, the content will animate in or out.
|
|
170
|
+
*/
|
|
171
|
+
visible: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* The enter transition to use when `visible` changes to `true`.
|
|
174
|
+
* Use `EnterTransition` factory methods and combine with `.plus()`.
|
|
175
|
+
* Defaults to Compose's `fadeIn + expandIn` when not specified.
|
|
176
|
+
*/
|
|
177
|
+
enterTransition?: EnterTransitionType;
|
|
178
|
+
/**
|
|
179
|
+
* The exit transition to use when `visible` changes to `false`.
|
|
180
|
+
* Use `ExitTransition` factory methods and combine with `.plus()`.
|
|
181
|
+
* Defaults to Compose's `fadeOut + shrinkOut` when not specified.
|
|
182
|
+
*/
|
|
183
|
+
exitTransition?: ExitTransitionType;
|
|
184
|
+
} & PrimitiveBaseProps;
|
|
185
|
+
|
|
186
|
+
type AnimatedVisibilityNativeProps = Omit<
|
|
187
|
+
AnimatedVisibilityProps,
|
|
188
|
+
'enterTransition' | 'exitTransition'
|
|
189
|
+
> & {
|
|
190
|
+
enterTransition?: EnterTransitionRecord[];
|
|
191
|
+
exitTransition?: ExitTransitionRecord[];
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const AnimatedVisibilityNativeView: React.ComponentType<AnimatedVisibilityNativeProps> =
|
|
195
|
+
requireNativeView('ExpoUI', 'AnimatedVisibilityView');
|
|
196
|
+
|
|
197
|
+
export function AnimatedVisibility(props: AnimatedVisibilityProps) {
|
|
198
|
+
const { enterTransition, exitTransition, ...rest } = props;
|
|
199
|
+
return (
|
|
200
|
+
<AnimatedVisibilityNativeView
|
|
201
|
+
{...transformProps(rest)}
|
|
202
|
+
enterTransition={enterTransition?.[ENTER_TRANSITION_SYMBOL]()}
|
|
203
|
+
exitTransition={exitTransition?.[EXIT_TRANSITION_SYMBOL]()}
|
|
204
|
+
/>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Unique Symbols used as private keys on transition objects. They act as a sealed accessor:
|
|
2
|
+
// only this module and the component can read the underlying record arrays from an
|
|
3
|
+
// EnterTransitionType or ExitTransitionType, preventing consumers from bypassing the factory API.
|
|
4
|
+
//
|
|
5
|
+
// Exported from this file for internal use (component + tests), but NOT re-exported from
|
|
6
|
+
// the package's public index.
|
|
7
|
+
export const ENTER_TRANSITION_SYMBOL = Symbol('enterTransition');
|
|
8
|
+
export const EXIT_TRANSITION_SYMBOL = Symbol('exitTransition');
|