@expo/ui 0.2.0-alpha.0 → 0.2.0-alpha.2
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 +15 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/AlertDialogView.kt +3 -1
- package/android/src/main/java/expo/modules/ui/ComposeViews.kt +6 -6
- package/android/src/main/java/expo/modules/ui/DatePickerView.kt +4 -3
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +88 -0
- package/android/src/main/java/expo/modules/ui/Modifiers.kt +15 -0
- package/android/src/main/java/expo/modules/ui/PickerView.kt +7 -2
- package/android/src/main/java/expo/modules/ui/ProgressView.kt +8 -4
- package/android/src/main/java/expo/modules/ui/ShapeView.kt +3 -2
- package/android/src/main/java/expo/modules/ui/SliderView.kt +4 -2
- package/android/src/main/java/expo/modules/ui/SwitchView.kt +3 -2
- package/android/src/main/java/expo/modules/ui/TextInputView.kt +4 -2
- package/android/src/main/java/expo/modules/ui/button/Button.kt +17 -8
- package/build/jetpack-compose/AlertDialog/index.d.ts +3 -0
- package/build/jetpack-compose/AlertDialog/index.d.ts.map +1 -1
- package/build/jetpack-compose/AlertDialog/index.js +3 -1
- package/build/jetpack-compose/AlertDialog/index.js.map +1 -1
- package/build/jetpack-compose/Button/index.d.ts +3 -1
- package/build/jetpack-compose/Button/index.d.ts.map +1 -1
- package/build/jetpack-compose/Button/index.js +2 -0
- package/build/jetpack-compose/Button/index.js.map +1 -1
- package/build/jetpack-compose/ContextMenu/index.d.ts +3 -0
- package/build/jetpack-compose/ContextMenu/index.d.ts.map +1 -1
- package/build/jetpack-compose/ContextMenu/index.js +3 -1
- package/build/jetpack-compose/ContextMenu/index.js.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/DatePicker/index.js +2 -0
- package/build/jetpack-compose/DatePicker/index.js.map +1 -1
- package/build/jetpack-compose/Picker/index.d.ts +5 -0
- package/build/jetpack-compose/Picker/index.d.ts.map +1 -1
- package/build/jetpack-compose/Picker/index.js +4 -0
- package/build/jetpack-compose/Picker/index.js.map +1 -1
- package/build/jetpack-compose/Progress/index.d.ts +5 -0
- package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
- package/build/jetpack-compose/Progress/index.js +4 -2
- package/build/jetpack-compose/Progress/index.js.map +1 -1
- package/build/jetpack-compose/Shape/index.d.ts +4 -1
- package/build/jetpack-compose/Shape/index.d.ts.map +1 -1
- package/build/jetpack-compose/Shape/index.js +3 -1
- package/build/jetpack-compose/Shape/index.js.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/Slider/index.js +2 -0
- package/build/jetpack-compose/Slider/index.js.map +1 -1
- package/build/jetpack-compose/Switch/index.d.ts +3 -0
- package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
- package/build/jetpack-compose/Switch/index.js +2 -0
- package/build/jetpack-compose/Switch/index.js.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/TextInput/index.js +2 -0
- package/build/jetpack-compose/TextInput/index.js.map +1 -1
- package/build/jetpack-compose/index.d.ts +1 -0
- package/build/jetpack-compose/index.d.ts.map +1 -1
- package/build/jetpack-compose/index.js +1 -0
- package/build/jetpack-compose/index.js.map +1 -1
- package/build/jetpack-compose/modifiers.d.ts +14 -0
- package/build/jetpack-compose/modifiers.d.ts.map +1 -0
- package/build/jetpack-compose/modifiers.js +15 -0
- package/build/jetpack-compose/modifiers.js.map +1 -0
- package/build/swift-ui/BottomSheet/index.d.ts +2 -14
- package/build/swift-ui/BottomSheet/index.d.ts.map +1 -1
- package/build/swift-ui/BottomSheet/index.js +7 -15
- package/build/swift-ui/BottomSheet/index.js.map +1 -1
- package/build/swift-ui/Button/index.d.ts +6 -11
- package/build/swift-ui/Button/index.d.ts.map +1 -1
- package/build/swift-ui/Button/index.js +7 -14
- package/build/swift-ui/Button/index.js.map +1 -1
- package/build/swift-ui/ColorPicker/index.d.ts +3 -10
- package/build/swift-ui/ColorPicker/index.d.ts.map +1 -1
- package/build/swift-ui/ColorPicker/index.js +5 -14
- package/build/swift-ui/ColorPicker/index.js.map +1 -1
- package/build/{swift-ui-primitives/ContentUnavailableView.d.ts → swift-ui/ContentUnavailableView/index.d.ts} +3 -8
- package/build/swift-ui/ContentUnavailableView/index.d.ts.map +1 -0
- package/build/swift-ui/ContentUnavailableView/index.js +19 -0
- package/build/swift-ui/ContentUnavailableView/index.js.map +1 -0
- package/build/swift-ui/ContextMenu/Submenu.d.ts +21 -0
- package/build/swift-ui/ContextMenu/Submenu.d.ts.map +1 -0
- package/build/swift-ui/ContextMenu/Submenu.js +8 -0
- package/build/swift-ui/ContextMenu/Submenu.js.map +1 -0
- package/build/swift-ui/ContextMenu/index.d.ts +6 -87
- package/build/swift-ui/ContextMenu/index.d.ts.map +1 -1
- package/build/swift-ui/ContextMenu/index.js +11 -26
- package/build/swift-ui/ContextMenu/index.js.map +1 -1
- package/build/swift-ui/ContextMenu/types.d.ts +36 -0
- package/build/swift-ui/ContextMenu/types.d.ts.map +1 -0
- package/build/swift-ui/ContextMenu/types.js.map +1 -0
- package/build/swift-ui/ContextMenu/utils.d.ts +4 -4
- package/build/swift-ui/ContextMenu/utils.d.ts.map +1 -1
- package/build/swift-ui/ContextMenu/utils.js +7 -7
- package/build/swift-ui/ContextMenu/utils.js.map +1 -1
- package/build/swift-ui/DatePicker/index.d.ts +3 -21
- package/build/swift-ui/DatePicker/index.d.ts.map +1 -1
- package/build/swift-ui/DatePicker/index.js +6 -28
- package/build/swift-ui/DatePicker/index.js.map +1 -1
- package/build/{swift-ui-primitives/DisclosureGroup.d.ts → swift-ui/DisclosureGroup/index.d.ts} +2 -8
- package/build/swift-ui/DisclosureGroup/index.d.ts.map +1 -0
- package/build/swift-ui/DisclosureGroup/index.js +16 -0
- package/build/swift-ui/DisclosureGroup/index.js.map +1 -0
- package/build/{swift-ui-primitives/Form.d.ts → swift-ui/Form/index.d.ts} +2 -2
- package/build/swift-ui/Form/index.d.ts.map +1 -0
- package/build/swift-ui/Form/index.js +15 -0
- package/build/swift-ui/Form/index.js.map +1 -0
- package/build/swift-ui/Gauge/index.d.ts +4 -10
- package/build/swift-ui/Gauge/index.d.ts.map +1 -1
- package/build/swift-ui/Gauge/index.js +4 -20
- package/build/swift-ui/Gauge/index.js.map +1 -1
- package/build/swift-ui/Host/index.d.ts +2 -1
- package/build/swift-ui/Host/index.d.ts.map +1 -1
- package/build/swift-ui/Host/index.js +3 -2
- package/build/swift-ui/Host/index.js.map +1 -1
- package/build/{swift-ui-primitives/Image.d.ts → swift-ui/Image/index.d.ts} +2 -2
- package/build/swift-ui/Image/index.d.ts.map +1 -0
- package/build/{swift-ui-primitives/Image.js → swift-ui/Image/index.js} +5 -2
- package/build/swift-ui/Image/index.js.map +1 -0
- package/build/swift-ui/Label/index.d.ts +3 -10
- package/build/swift-ui/Label/index.d.ts.map +1 -1
- package/build/swift-ui/Label/index.js +3 -11
- package/build/swift-ui/Label/index.js.map +1 -1
- package/build/{swift-ui-primitives/Layout.d.ts → swift-ui/Layout/index.d.ts} +3 -3
- package/build/swift-ui/Layout/index.d.ts.map +1 -0
- package/build/{swift-ui-primitives/Layout.js → swift-ui/Layout/index.js} +15 -3
- package/build/swift-ui/Layout/index.js.map +1 -0
- package/build/swift-ui/List/index.d.ts +3 -34
- package/build/swift-ui/List/index.d.ts.map +1 -1
- package/build/swift-ui/List/index.js +7 -16
- package/build/swift-ui/List/index.js.map +1 -1
- package/build/swift-ui/Picker/index.d.ts +3 -16
- package/build/swift-ui/Picker/index.d.ts.map +1 -1
- package/build/swift-ui/Picker/index.js +7 -16
- package/build/swift-ui/Picker/index.js.map +1 -1
- package/build/swift-ui/Progress/index.d.ts +6 -19
- package/build/swift-ui/Progress/index.d.ts.map +1 -1
- package/build/swift-ui/Progress/index.js +5 -21
- package/build/swift-ui/Progress/index.js.map +1 -1
- package/build/swift-ui/Section/index.d.ts +4 -11
- package/build/swift-ui/Section/index.d.ts.map +1 -1
- package/build/swift-ui/Section/index.js +3 -11
- package/build/swift-ui/Section/index.js.map +1 -1
- package/build/swift-ui/SecureField/index.d.ts +3 -14
- package/build/swift-ui/SecureField/index.d.ts.map +1 -1
- package/build/swift-ui/SecureField/index.js +5 -14
- package/build/swift-ui/SecureField/index.js.map +1 -1
- package/build/swift-ui/ShareLink/index.d.ts +3 -10
- package/build/swift-ui/ShareLink/index.d.ts.map +1 -1
- package/build/swift-ui/ShareLink/index.js +3 -11
- package/build/swift-ui/ShareLink/index.js.map +1 -1
- package/build/swift-ui/Slider/index.d.ts +3 -15
- package/build/swift-ui/Slider/index.d.ts.map +1 -1
- package/build/swift-ui/Slider/index.js +7 -12
- package/build/swift-ui/Slider/index.js.map +1 -1
- package/build/{swift-ui-primitives/Spacer.d.ts → swift-ui/Spacer/index.d.ts} +2 -2
- package/build/swift-ui/Spacer/index.d.ts.map +1 -0
- package/build/swift-ui/Spacer/index.js +15 -0
- package/build/swift-ui/Spacer/index.js.map +1 -0
- package/build/swift-ui/Switch/index.d.ts +3 -20
- package/build/swift-ui/Switch/index.d.ts.map +1 -1
- package/build/swift-ui/Switch/index.js +7 -16
- package/build/swift-ui/Switch/index.js.map +1 -1
- package/build/{swift-ui-primitives/Text.d.ts → swift-ui/Text/index.d.ts} +2 -2
- package/build/swift-ui/Text/index.d.ts.map +1 -0
- package/build/{swift-ui-primitives/Text.js → swift-ui/Text/index.js} +5 -2
- package/build/swift-ui/Text/index.js.map +1 -0
- package/build/swift-ui/TextField/index.d.ts +4 -11
- package/build/swift-ui/TextField/index.d.ts.map +1 -1
- package/build/swift-ui/TextField/index.js +5 -14
- package/build/swift-ui/TextField/index.js.map +1 -1
- package/build/swift-ui/index.d.ts +7 -0
- package/build/swift-ui/index.d.ts.map +1 -1
- package/build/swift-ui/index.js +7 -0
- package/build/swift-ui/index.js.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +259 -0
- package/build/swift-ui/modifiers/index.d.ts.map +1 -0
- package/build/swift-ui/modifiers/index.js +224 -0
- package/build/swift-ui/modifiers/index.js.map +1 -0
- package/build/swift-ui/modifiers/utils.d.ts +15 -0
- package/build/swift-ui/modifiers/utils.d.ts.map +1 -0
- package/build/swift-ui/modifiers/utils.js +23 -0
- package/build/swift-ui/modifiers/utils.js.map +1 -0
- package/build/{swift-ui-primitives → swift-ui}/types.d.ts +47 -4
- package/build/swift-ui/types.d.ts.map +1 -0
- package/build/swift-ui/types.js +2 -0
- package/build/swift-ui/types.js.map +1 -0
- package/build/types.d.ts +3 -0
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/BottomSheetView.swift +9 -1
- package/ios/Button/Button.swift +1 -0
- package/ios/Button/ButtonProps.swift +7 -2
- package/ios/ColorPickerView.swift +8 -1
- package/ios/ContentUnavailableView.swift +3 -1
- package/ios/ContextMenu/ContextMenu.swift +5 -0
- package/ios/ContextMenu/ContextMenuRecords.swift +19 -3
- package/ios/DateTimePickerView.swift +8 -1
- package/ios/DisclosureGroupView.swift +4 -2
- package/ios/ExpoUIModule.swift +25 -28
- package/ios/FormView.swift +3 -1
- package/ios/Gauge/Gauge.swift +1 -0
- package/ios/Gauge/GaugeProps.swift +7 -1
- package/ios/GroupView.swift +3 -1
- package/ios/HStackView.swift +3 -1
- package/ios/HostView.swift +1 -1
- package/ios/ImageView.swift +3 -1
- package/ios/Label.swift +9 -2
- package/ios/List.swift +8 -2
- package/ios/Modifiers/CommonViewModifiers.swift +6 -3
- package/ios/Modifiers/View+ModifierArray.swift +27 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +718 -0
- package/ios/PickerView.swift +8 -1
- package/ios/ProgressView.swift +8 -1
- package/ios/SectionView.swift +9 -20
- package/ios/SecureField/SecureFieldView.swift +10 -2
- package/ios/ShareLinkView.swift +9 -1
- package/ios/SliderView.swift +8 -1
- package/ios/SpacerView.swift +3 -1
- package/ios/SwitchView.swift +8 -1
- package/ios/TextField/TextFieldView.swift +8 -1
- package/ios/TextView.swift +3 -1
- package/ios/VStackView.swift +3 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.module → 0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.pom → 0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.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 +4 -4
- package/src/jetpack-compose/AlertDialog/index.tsx +12 -1
- package/src/jetpack-compose/Button/index.tsx +6 -1
- package/src/jetpack-compose/ContextMenu/index.tsx +6 -0
- package/src/jetpack-compose/DatePicker/index.tsx +5 -1
- package/src/jetpack-compose/Picker/index.tsx +10 -0
- package/src/jetpack-compose/Progress/index.tsx +20 -2
- package/src/jetpack-compose/Shape/index.tsx +17 -2
- package/src/jetpack-compose/Slider/index.tsx +6 -1
- package/src/jetpack-compose/Switch/index.tsx +7 -0
- package/src/jetpack-compose/TextInput/index.tsx +6 -1
- package/src/jetpack-compose/{index.tsx → index.ts} +1 -0
- package/src/jetpack-compose/modifiers.ts +19 -0
- package/src/swift-ui/BottomSheet/index.tsx +10 -19
- package/src/swift-ui/Button/index.tsx +11 -20
- package/src/swift-ui/ColorPicker/index.tsx +10 -18
- package/src/{swift-ui-primitives/ContentUnavailableView.tsx → swift-ui/ContentUnavailableView/index.tsx} +16 -9
- package/src/swift-ui/ContextMenu/Submenu.tsx +25 -0
- package/src/swift-ui/ContextMenu/index.tsx +23 -100
- package/src/swift-ui/ContextMenu/types.ts +47 -0
- package/src/swift-ui/ContextMenu/utils.ts +8 -13
- package/src/swift-ui/DatePicker/index.tsx +10 -40
- package/src/{swift-ui-primitives/DisclosureGroup.tsx → swift-ui/DisclosureGroup/index.tsx} +12 -6
- package/src/swift-ui/Form/index.tsx +30 -0
- package/src/swift-ui/Gauge/index.tsx +12 -23
- package/src/swift-ui/Host/index.tsx +7 -2
- package/src/{swift-ui-primitives/Image.tsx → swift-ui/Image/index.tsx} +6 -3
- package/src/swift-ui/Label/index.tsx +10 -15
- package/src/{swift-ui-primitives/Layout.tsx → swift-ui/Layout/index.tsx} +17 -4
- package/src/swift-ui/List/index.tsx +16 -28
- package/src/swift-ui/Picker/index.tsx +10 -22
- package/src/swift-ui/Progress/index.tsx +21 -28
- package/src/swift-ui/Section/index.tsx +11 -16
- package/src/swift-ui/SecureField/index.tsx +10 -22
- package/src/swift-ui/ShareLink/index.tsx +10 -15
- package/src/swift-ui/Slider/index.tsx +10 -18
- package/src/{swift-ui-primitives/Spacer.tsx → swift-ui/Spacer/index.tsx} +12 -2
- package/src/swift-ui/Switch/index.tsx +12 -22
- package/src/{swift-ui-primitives/Text.tsx → swift-ui/Text/index.tsx} +6 -2
- package/src/swift-ui/TextField/index.tsx +9 -21
- package/src/swift-ui/index.tsx +7 -0
- package/src/swift-ui/modifiers/index.ts +374 -0
- package/src/swift-ui/modifiers/utils.ts +33 -0
- package/src/{swift-ui-primitives → swift-ui}/types.ts +48 -4
- package/src/types.ts +4 -0
- package/swift-ui/index.d.ts +1 -0
- package/swift-ui/index.js +1 -0
- package/swift-ui/modifiers.d.ts +1 -0
- package/swift-ui/modifiers.js +1 -0
- package/build/swift-ui-primitives/ContentUnavailableView.d.ts.map +0 -1
- package/build/swift-ui-primitives/ContentUnavailableView.js +0 -15
- package/build/swift-ui-primitives/ContentUnavailableView.js.map +0 -1
- package/build/swift-ui-primitives/DisclosureGroup.d.ts.map +0 -1
- package/build/swift-ui-primitives/DisclosureGroup.js +0 -10
- package/build/swift-ui-primitives/DisclosureGroup.js.map +0 -1
- package/build/swift-ui-primitives/Form.d.ts.map +0 -1
- package/build/swift-ui-primitives/Form.js +0 -6
- package/build/swift-ui-primitives/Form.js.map +0 -1
- package/build/swift-ui-primitives/Image.d.ts.map +0 -1
- package/build/swift-ui-primitives/Image.js.map +0 -1
- package/build/swift-ui-primitives/Layout.d.ts.map +0 -1
- package/build/swift-ui-primitives/Layout.js.map +0 -1
- package/build/swift-ui-primitives/Section.d.ts +0 -6
- package/build/swift-ui-primitives/Section.d.ts.map +0 -1
- package/build/swift-ui-primitives/Section.js +0 -6
- package/build/swift-ui-primitives/Section.js.map +0 -1
- package/build/swift-ui-primitives/Spacer.d.ts.map +0 -1
- package/build/swift-ui-primitives/Spacer.js +0 -6
- package/build/swift-ui-primitives/Spacer.js.map +0 -1
- package/build/swift-ui-primitives/Text.d.ts.map +0 -1
- package/build/swift-ui-primitives/Text.js.map +0 -1
- package/build/swift-ui-primitives/index.d.ts +0 -24
- package/build/swift-ui-primitives/index.d.ts.map +0 -1
- package/build/swift-ui-primitives/index.js +0 -24
- package/build/swift-ui-primitives/index.js.map +0 -1
- package/build/swift-ui-primitives/types.d.ts.map +0 -1
- package/build/swift-ui-primitives/types.js.map +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.pom.sha512 +0 -1
- package/src/swift-ui-primitives/Form.tsx +0 -20
- package/src/swift-ui-primitives/Section.tsx +0 -15
- package/src/swift-ui-primitives/index.tsx +0 -27
- package/swift-ui-primitives.d.ts +0 -1
- package/swift-ui-primitives.js +0 -1
- package/swift-ui.d.ts +0 -1
- package/swift-ui.js +0 -1
- /package/build/{swift-ui-primitives → swift-ui/ContextMenu}/types.js +0 -0
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import { Children, isValidElement, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { NativeSyntheticEvent } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { ContextMenuElementBase, EventHandlers
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
NativeButtonProps,
|
|
10
|
-
transformButtonProps,
|
|
11
|
-
} from '../Button';
|
|
12
|
-
import { Picker, PickerPrimitive, PickerProps } from '../Picker';
|
|
13
|
-
import { Switch, SwitchPrimitive, SwitchProps } from '../Switch';
|
|
4
|
+
import { type ContextMenuElementBase, type EventHandlers } from './types';
|
|
5
|
+
import { Button, transformButtonProps, type ButtonProps, type NativeButtonProps } from '../Button';
|
|
6
|
+
import { Picker, type PickerProps } from '../Picker';
|
|
7
|
+
import { Switch, type SwitchProps } from '../Switch';
|
|
8
|
+
import { Submenu, type SubmenuProps } from './Submenu';
|
|
14
9
|
|
|
15
10
|
// We use this slightly odd typing for the elements to make unpacking the elements easier on the native side
|
|
16
11
|
type ButtonMenuElement = {
|
|
@@ -57,17 +52,17 @@ function processChildElement(
|
|
|
57
52
|
|
|
58
53
|
const uuid = expo.uuidv4();
|
|
59
54
|
|
|
60
|
-
if (child.type === Button
|
|
55
|
+
if (child.type === Button) {
|
|
61
56
|
// @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps
|
|
62
57
|
return createButtonElement(uuid, child.props, eventHandlersMap);
|
|
63
58
|
}
|
|
64
59
|
|
|
65
|
-
if (child.type === Switch
|
|
60
|
+
if (child.type === Switch) {
|
|
66
61
|
// @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps
|
|
67
62
|
return createSwitchElement(uuid, child.props, eventHandlersMap);
|
|
68
63
|
}
|
|
69
64
|
|
|
70
|
-
if (child.type === Picker
|
|
65
|
+
if (child.type === Picker) {
|
|
71
66
|
// @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps
|
|
72
67
|
return createPickerElement(uuid, child.props, eventHandlersMap);
|
|
73
68
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import { StyleProp, ViewStyle, StyleSheet, PixelRatio } from 'react-native';
|
|
3
2
|
|
|
4
|
-
import { ViewEvent } from '../../types';
|
|
5
|
-
import {
|
|
3
|
+
import { type ViewEvent } from '../../types';
|
|
4
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
|
+
import { type CommonViewModifierProps } from '../types';
|
|
6
6
|
|
|
7
7
|
export type IOSVariant = 'wheel' | 'automatic' | 'graphical' | 'compact';
|
|
8
8
|
|
|
@@ -37,18 +37,17 @@ export type DateTimePickerProps = {
|
|
|
37
37
|
* The tint color to use on the picker elements.
|
|
38
38
|
*/
|
|
39
39
|
color?: string;
|
|
40
|
-
};
|
|
40
|
+
} & CommonViewModifierProps;
|
|
41
41
|
|
|
42
42
|
type NativeDatePickerProps = Omit<DateTimePickerProps, 'variant' | 'onDateSelected'> & {
|
|
43
43
|
variant?: IOSVariant;
|
|
44
44
|
} & ViewEvent<'onDateSelected', { date: Date }>;
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
*/
|
|
49
|
-
export function transformDateTimePickerProps(props: DateTimePickerProps): NativeDatePickerProps {
|
|
50
|
-
const { variant, ...rest } = props;
|
|
46
|
+
function transformDateTimePickerProps(props: DateTimePickerProps): NativeDatePickerProps {
|
|
47
|
+
const { variant, modifiers, ...rest } = props;
|
|
51
48
|
return {
|
|
49
|
+
modifiers,
|
|
50
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
52
51
|
...rest,
|
|
53
52
|
onDateSelected: ({ nativeEvent: { date } }) => {
|
|
54
53
|
props?.onDateSelected?.(new Date(date));
|
|
@@ -57,43 +56,14 @@ export function transformDateTimePickerProps(props: DateTimePickerProps): Native
|
|
|
57
56
|
};
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
function transformDateTimePickerStyle(
|
|
61
|
-
style: StyleProp<ViewStyle> | undefined
|
|
62
|
-
): StyleProp<ViewStyle> {
|
|
63
|
-
const { minWidth, minHeight, ...restStyle } = StyleSheet.flatten(style) || {};
|
|
64
|
-
|
|
65
|
-
// On Android, the picker’s minWidth and minHeight must be 12dp.
|
|
66
|
-
// Otherwise, the picker will crash the app.
|
|
67
|
-
const minSize = PixelRatio.getPixelSizeForLayoutSize(12);
|
|
68
|
-
|
|
69
|
-
// However, when users pass the minWidth and minHeight props, we trust that they know what they are doing.
|
|
70
|
-
const parsedMinWidth = minWidth ? minSize : undefined;
|
|
71
|
-
const parsedMinHeight = minHeight ? minSize : undefined;
|
|
72
|
-
|
|
73
|
-
return [restStyle, { minWidth: parsedMinWidth, minHeight: parsedMinHeight }];
|
|
74
|
-
}
|
|
75
|
-
|
|
76
59
|
const DatePickerNativeView: React.ComponentType<NativeDatePickerProps> = requireNativeView(
|
|
77
60
|
'ExpoUI',
|
|
78
61
|
'DateTimePickerView'
|
|
79
62
|
);
|
|
80
63
|
|
|
81
|
-
/**
|
|
82
|
-
* `<DateTimePicker>` component without a host view.
|
|
83
|
-
* You should use this with a `Host` component in ancestor.
|
|
84
|
-
*/
|
|
85
|
-
export function DateTimePickerPrimitive(props: DateTimePickerProps) {
|
|
86
|
-
return <DatePickerNativeView {...transformDateTimePickerProps(props)} />;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
64
|
/**
|
|
90
65
|
* Renders a `DateTimePicker` component.
|
|
91
66
|
*/
|
|
92
|
-
export function DateTimePicker(props: DateTimePickerProps
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<Host style={transformedStyle} matchContents>
|
|
96
|
-
<DateTimePickerPrimitive {...props} />
|
|
97
|
-
</Host>
|
|
98
|
-
);
|
|
67
|
+
export function DateTimePicker(props: DateTimePickerProps) {
|
|
68
|
+
return <DatePickerNativeView {...transformDateTimePickerProps(props)} />;
|
|
99
69
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
|
|
3
|
-
import { type
|
|
4
|
-
import {
|
|
3
|
+
import { type ViewEvent } from '../../types';
|
|
4
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
|
+
import { type CommonViewModifierProps } from '../types';
|
|
5
6
|
|
|
6
7
|
export interface DisclosureGroupProps extends CommonViewModifierProps {
|
|
7
8
|
label: string;
|
|
@@ -18,18 +19,23 @@ export interface DisclosureGroupProps extends CommonViewModifierProps {
|
|
|
18
19
|
|
|
19
20
|
type StateChangeEvent = ViewEvent<'onStateChange', { isExpanded: boolean }>;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
StateChangeEvent;
|
|
22
|
+
type NativeDisclosureGroupProps = Omit<DisclosureGroupProps, 'onStateChange'> & StateChangeEvent;
|
|
23
23
|
|
|
24
24
|
const DisclosureGroupNativeView: React.ComponentType<NativeDisclosureGroupProps> =
|
|
25
25
|
requireNativeView('ExpoUI', 'DisclosureGroupView');
|
|
26
26
|
|
|
27
27
|
export function DisclosureGroup(props: DisclosureGroupProps) {
|
|
28
|
-
const { onStateChange, ...rest } = props;
|
|
28
|
+
const { onStateChange, modifiers, ...rest } = props;
|
|
29
29
|
|
|
30
30
|
function handleStateChange(event: { nativeEvent: { isExpanded: boolean } }) {
|
|
31
31
|
onStateChange?.(event.nativeEvent.isExpanded);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
const transformedProps = {
|
|
35
|
+
modifiers,
|
|
36
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
37
|
+
...rest,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return <DisclosureGroupNativeView {...transformedProps} onStateChange={handleStateChange} />;
|
|
35
41
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { requireNativeView } from 'expo';
|
|
2
|
+
|
|
3
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
4
|
+
import { type CommonViewModifierProps } from '../types';
|
|
5
|
+
|
|
6
|
+
export interface FormProps extends CommonViewModifierProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Makes the form scrollable.
|
|
11
|
+
* @default true
|
|
12
|
+
* @platform ios 16.0+
|
|
13
|
+
*/
|
|
14
|
+
scrollEnabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const FormNativeView: React.ComponentType<FormProps> = requireNativeView('ExpoUI', 'FormView');
|
|
18
|
+
|
|
19
|
+
function transformFormProps(props: FormProps): FormProps {
|
|
20
|
+
const { modifiers, ...restProps } = props;
|
|
21
|
+
return {
|
|
22
|
+
modifiers,
|
|
23
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
24
|
+
...restProps,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function Form(props: FormProps) {
|
|
29
|
+
return <FormNativeView {...transformFormProps(props)} />;
|
|
30
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import { ColorValue
|
|
2
|
+
import { ColorValue } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
|
+
import { type CommonViewModifierProps } from '../types';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* The type of `Gauge`.
|
|
@@ -57,33 +58,21 @@ export type GaugeProps = {
|
|
|
57
58
|
* Color (or array of colors for gradient) of the `Gauge`.
|
|
58
59
|
*/
|
|
59
60
|
color?: ColorValue | ColorValue[];
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
let GaugeNativeView: React.ComponentType<GaugeProps> | null;
|
|
63
|
-
|
|
64
|
-
if (Platform.OS === 'ios') {
|
|
65
|
-
GaugeNativeView = requireNativeView('ExpoUI', 'GaugeView');
|
|
66
|
-
}
|
|
61
|
+
} & CommonViewModifierProps;
|
|
67
62
|
|
|
68
|
-
|
|
69
|
-
* `<Gauge>` component without a host view.
|
|
70
|
-
* You should use this with a `Host` component in ancestor.
|
|
71
|
-
*/
|
|
72
|
-
export function GaugePrimitive({ type = 'default', ...props }: GaugeProps) {
|
|
73
|
-
if (!GaugeNativeView) {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
return <GaugeNativeView type={type} {...props} />;
|
|
77
|
-
}
|
|
63
|
+
const GaugeNativeView: React.ComponentType<GaugeProps> = requireNativeView('ExpoUI', 'GaugeView');
|
|
78
64
|
|
|
79
65
|
/**
|
|
80
66
|
* Renders a native `Gauge` component.
|
|
81
67
|
* @platform ios
|
|
82
68
|
*/
|
|
83
|
-
export function Gauge(
|
|
69
|
+
export function Gauge({ type = 'default', modifiers, ...props }: GaugeProps) {
|
|
84
70
|
return (
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
71
|
+
<GaugeNativeView
|
|
72
|
+
modifiers={modifiers}
|
|
73
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
74
|
+
type={type}
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
88
77
|
);
|
|
89
78
|
}
|
|
@@ -2,6 +2,9 @@ import { requireNativeView } from 'expo';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { StyleProp, ViewStyle, type ColorSchemeName } from 'react-native';
|
|
4
4
|
|
|
5
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
6
|
+
import { type CommonViewModifierProps } from '../types';
|
|
7
|
+
|
|
5
8
|
export type HostProps = {
|
|
6
9
|
/**
|
|
7
10
|
* When true, the host view will update its size in the React Native view tree to match the content's layout from SwiftUI.
|
|
@@ -29,7 +32,7 @@ export type HostProps = {
|
|
|
29
32
|
|
|
30
33
|
children: React.ReactNode;
|
|
31
34
|
style?: StyleProp<ViewStyle>;
|
|
32
|
-
};
|
|
35
|
+
} & CommonViewModifierProps;
|
|
33
36
|
|
|
34
37
|
const HostNativeView: React.ComponentType<HostProps> = requireNativeView('ExpoUI', 'HostView');
|
|
35
38
|
|
|
@@ -37,11 +40,13 @@ const HostNativeView: React.ComponentType<HostProps> = requireNativeView('ExpoUI
|
|
|
37
40
|
* A hosting component for SwiftUI views.
|
|
38
41
|
*/
|
|
39
42
|
export function Host(props: HostProps) {
|
|
40
|
-
const { matchContents, onLayoutContent, style, ...restProps } = props;
|
|
43
|
+
const { matchContents, onLayoutContent, style, modifiers, ...restProps } = props;
|
|
41
44
|
const [containerStyle, setContainerStyle] = useState<ViewStyle | null>(null);
|
|
42
45
|
|
|
43
46
|
return (
|
|
44
47
|
<HostNativeView
|
|
48
|
+
modifiers={modifiers}
|
|
49
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
45
50
|
style={[style, containerStyle]}
|
|
46
51
|
onLayoutContent={(e) => {
|
|
47
52
|
onLayoutContent?.(e);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
|
|
3
|
-
import { ViewEvent } from '
|
|
4
|
-
import {
|
|
3
|
+
import { type ViewEvent } from '../../types';
|
|
4
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
|
+
import { type CommonViewModifierProps } from '../types';
|
|
5
6
|
|
|
6
7
|
export interface ImageProps extends CommonViewModifierProps {
|
|
7
8
|
/**
|
|
@@ -32,8 +33,10 @@ type TapEvent = ViewEvent<'onTap', object> & {
|
|
|
32
33
|
type NativeImageProps = Omit<ImageProps, 'onPress'> | TapEvent;
|
|
33
34
|
|
|
34
35
|
function transformNativeProps(props: ImageProps): NativeImageProps {
|
|
35
|
-
const { onPress, ...restProps } = props;
|
|
36
|
+
const { onPress, modifiers, ...restProps } = props;
|
|
36
37
|
return {
|
|
38
|
+
modifiers,
|
|
39
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
37
40
|
...restProps,
|
|
38
41
|
...(onPress ? { useTapGesture: true, onTap: () => onPress() } : null),
|
|
39
42
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
4
|
+
import { type CommonViewModifierProps } from '../types';
|
|
5
5
|
|
|
6
6
|
export type LabelProps = {
|
|
7
7
|
/**
|
|
@@ -18,18 +18,10 @@ export type LabelProps = {
|
|
|
18
18
|
* The color of the label icon.
|
|
19
19
|
*/
|
|
20
20
|
color?: string;
|
|
21
|
-
};
|
|
21
|
+
} & CommonViewModifierProps;
|
|
22
22
|
|
|
23
23
|
const LabelNativeView: React.ComponentType<LabelProps> = requireNativeView('ExpoUI', 'LabelView');
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
* `<Label>` component without a host view.
|
|
27
|
-
* You should use this with a `Host` component in ancestor.
|
|
28
|
-
*/
|
|
29
|
-
export function LabelPrimitive(props: LabelProps) {
|
|
30
|
-
return <LabelNativeView {...props} />;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
25
|
/**
|
|
34
26
|
* Renders a native label view, which could be used in a list or section.
|
|
35
27
|
*
|
|
@@ -37,10 +29,13 @@ export function LabelPrimitive(props: LabelProps) {
|
|
|
37
29
|
* @returns {JSX.Element} The rendered native Label component.
|
|
38
30
|
* @platform ios
|
|
39
31
|
*/
|
|
40
|
-
export function Label(props: LabelProps
|
|
32
|
+
export function Label(props: LabelProps) {
|
|
33
|
+
const { modifiers, ...restProps } = props;
|
|
41
34
|
return (
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
<LabelNativeView
|
|
36
|
+
modifiers={modifiers}
|
|
37
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
38
|
+
{...restProps}
|
|
39
|
+
/>
|
|
45
40
|
);
|
|
46
41
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
|
|
3
|
-
import { type
|
|
4
|
-
import {
|
|
3
|
+
import { type ViewEvent } from '../../types';
|
|
4
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
|
+
import { type CommonViewModifierProps } from '../types';
|
|
5
6
|
|
|
6
7
|
type TapEvent = ViewEvent<'onTap', object> & {
|
|
7
8
|
useTapGesture?: boolean;
|
|
@@ -20,8 +21,10 @@ interface StackBaseProps extends CommonViewModifierProps {
|
|
|
20
21
|
export type NativeStackProps = Omit<StackBaseProps, 'onPress'> | TapEvent;
|
|
21
22
|
|
|
22
23
|
function transformNativeProps(props: StackBaseProps): NativeStackProps {
|
|
23
|
-
const { onPress, ...restProps } = props;
|
|
24
|
+
const { onPress, modifiers, ...restProps } = props;
|
|
24
25
|
return {
|
|
26
|
+
modifiers,
|
|
27
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
25
28
|
...restProps,
|
|
26
29
|
...(onPress ? { useTapGesture: true, onTap: () => onPress() } : null),
|
|
27
30
|
};
|
|
@@ -73,7 +76,17 @@ const GroupNativeView: React.ComponentType<NativeGroupProps> = requireNativeView
|
|
|
73
76
|
'GroupView'
|
|
74
77
|
);
|
|
75
78
|
|
|
79
|
+
function transformGroupProps(props: GroupProps): NativeGroupProps {
|
|
80
|
+
const { onPress, modifiers, ...restProps } = props;
|
|
81
|
+
return {
|
|
82
|
+
modifiers,
|
|
83
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
84
|
+
...restProps,
|
|
85
|
+
...(onPress ? { useTapGesture: true, onTap: () => onPress() } : null),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
76
89
|
export function Group(props: GroupProps) {
|
|
77
|
-
return <GroupNativeView {...
|
|
90
|
+
return <GroupNativeView {...transformGroupProps(props)} />;
|
|
78
91
|
}
|
|
79
92
|
//#endregion
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
|
|
4
|
-
import { ViewEvent } from '../../types';
|
|
5
|
-
import {
|
|
3
|
+
import { type ViewEvent } from '../../types';
|
|
4
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
|
+
import { type CommonViewModifierProps } from '../types';
|
|
6
6
|
|
|
7
|
-
const ListNativeView: React.ComponentType<NativeListProps>
|
|
8
|
-
|
|
7
|
+
const ListNativeView: React.ComponentType<NativeListProps> = requireNativeView<NativeListProps>(
|
|
8
|
+
'ExpoUI',
|
|
9
|
+
'ListView'
|
|
10
|
+
);
|
|
9
11
|
|
|
10
12
|
function transformListProps(props: Omit<ListProps, 'children'>): Omit<NativeListProps, 'children'> {
|
|
13
|
+
const { modifiers, ...restProps } = props;
|
|
11
14
|
return {
|
|
12
|
-
|
|
15
|
+
modifiers,
|
|
16
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
17
|
+
...restProps,
|
|
13
18
|
onDeleteItem: ({ nativeEvent: { index } }) => props?.onDeleteItem?.(index),
|
|
14
19
|
onMoveItem: ({ nativeEvent: { from, to } }) => props?.onMoveItem?.(from, to),
|
|
15
20
|
onSelectionChange: ({ nativeEvent: { selection } }) => props?.onSelectionChange?.(selection),
|
|
@@ -18,7 +23,7 @@ function transformListProps(props: Omit<ListProps, 'children'>): Omit<NativeList
|
|
|
18
23
|
|
|
19
24
|
export type ListStyle = 'automatic' | 'plain' | 'inset' | 'insetGrouped' | 'grouped' | 'sidebar';
|
|
20
25
|
|
|
21
|
-
export interface ListProps {
|
|
26
|
+
export interface ListProps extends CommonViewModifierProps {
|
|
22
27
|
/**
|
|
23
28
|
* One of the predefined ListStyle types in SwiftUI.
|
|
24
29
|
* @default 'automatic'
|
|
@@ -90,37 +95,20 @@ type MoveItemEvent = ViewEvent<'onMoveItem', { from: number; to: number }>;
|
|
|
90
95
|
*/
|
|
91
96
|
type SelectItemEvent = ViewEvent<'onSelectionChange', { selection: number[] }>;
|
|
92
97
|
|
|
93
|
-
|
|
98
|
+
type NativeListProps = Omit<ListProps, 'onDeleteItem' | 'onMoveItem' | 'onSelectionChange'> &
|
|
94
99
|
DeleteItemEvent &
|
|
95
100
|
MoveItemEvent &
|
|
96
101
|
SelectItemEvent & {
|
|
97
102
|
children: React.ReactNode;
|
|
98
103
|
};
|
|
99
104
|
|
|
100
|
-
/**
|
|
101
|
-
* `<List>` component without a host view.
|
|
102
|
-
* You should use this with a `Host` component in ancestor.
|
|
103
|
-
*/
|
|
104
|
-
export function ListPrimitive(props: ListProps) {
|
|
105
|
-
const { children, ...nativeProps } = props;
|
|
106
|
-
|
|
107
|
-
if (!ListNativeView) {
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return <ListNativeView {...transformListProps(nativeProps)}>{children}</ListNativeView>;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
105
|
/**
|
|
115
106
|
* A list component that renders its children using a native SwiftUI list.
|
|
116
107
|
* @param {ListProps} props - The properties for the list component.
|
|
117
108
|
* @returns {JSX.Element | null} The rendered list with its children or null if the platform is unsupported.
|
|
118
109
|
* @platform ios
|
|
119
110
|
*/
|
|
120
|
-
export function List(props: ListProps
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
<ListPrimitive {...props} />
|
|
124
|
-
</Host>
|
|
125
|
-
);
|
|
111
|
+
export function List(props: ListProps) {
|
|
112
|
+
const { children, ...nativeProps } = props;
|
|
113
|
+
return <ListNativeView {...transformListProps(nativeProps)}>{children}</ListNativeView>;
|
|
126
114
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
4
|
+
import { type CommonViewModifierProps } from '../types';
|
|
5
5
|
|
|
6
6
|
export type PickerProps = {
|
|
7
7
|
/**
|
|
@@ -30,7 +30,7 @@ export type PickerProps = {
|
|
|
30
30
|
* Picker color. On iOS it only applies to the `'menu'` variant.
|
|
31
31
|
*/
|
|
32
32
|
color?: string;
|
|
33
|
-
};
|
|
33
|
+
} & CommonViewModifierProps;
|
|
34
34
|
|
|
35
35
|
const PickerNativeView: React.ComponentType<PickerProps> = requireNativeView(
|
|
36
36
|
'ExpoUI',
|
|
@@ -39,32 +39,20 @@ const PickerNativeView: React.ComponentType<PickerProps> = requireNativeView(
|
|
|
39
39
|
|
|
40
40
|
type NativePickerProps = PickerProps;
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*/
|
|
45
|
-
export function transformPickerProps(props: PickerProps): NativePickerProps {
|
|
42
|
+
function transformPickerProps(props: PickerProps): NativePickerProps {
|
|
43
|
+
const { modifiers, ...restProps } = props;
|
|
46
44
|
return {
|
|
47
|
-
|
|
45
|
+
modifiers,
|
|
46
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
47
|
+
...restProps,
|
|
48
48
|
variant: props.variant ?? 'segmented',
|
|
49
49
|
color: props.color,
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
/**
|
|
54
|
-
* `<Picker>` component without a host view.
|
|
55
|
-
* You should use this with a `Host` component in ancestor.
|
|
56
|
-
*/
|
|
57
|
-
export function PickerPrimitive(props: PickerProps) {
|
|
58
|
-
return <PickerNativeView {...transformPickerProps(props)} />;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
53
|
/**
|
|
62
54
|
* Displays a native picker component. Depending on the variant it can be a segmented button, an inline picker, a list of choices or a radio button.
|
|
63
55
|
*/
|
|
64
|
-
export function Picker(props: PickerProps
|
|
65
|
-
return (
|
|
66
|
-
<Host style={props.style} matchContents>
|
|
67
|
-
<PickerPrimitive {...props} />
|
|
68
|
-
</Host>
|
|
69
|
-
);
|
|
56
|
+
export function Picker(props: PickerProps) {
|
|
57
|
+
return <PickerNativeView {...transformPickerProps(props)} />;
|
|
70
58
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import { ColorValue
|
|
2
|
+
import { ColorValue } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
|
+
import { type CommonViewModifierProps } from '../types';
|
|
5
6
|
|
|
6
7
|
export type CircularProgressProps = {
|
|
7
8
|
/**
|
|
@@ -12,7 +13,7 @@ export type CircularProgressProps = {
|
|
|
12
13
|
* Progress color.
|
|
13
14
|
*/
|
|
14
15
|
color?: ColorValue;
|
|
15
|
-
};
|
|
16
|
+
} & CommonViewModifierProps;
|
|
16
17
|
|
|
17
18
|
export type LinearProgressProps = {
|
|
18
19
|
/**
|
|
@@ -23,7 +24,7 @@ export type LinearProgressProps = {
|
|
|
23
24
|
* Progress color.
|
|
24
25
|
*/
|
|
25
26
|
color?: ColorValue;
|
|
26
|
-
};
|
|
27
|
+
} & CommonViewModifierProps;
|
|
27
28
|
|
|
28
29
|
type NativeProgressProps =
|
|
29
30
|
| CircularProgressProps
|
|
@@ -36,40 +37,32 @@ const NativeProgressView: React.ComponentType<NativeProgressProps> = requireNati
|
|
|
36
37
|
'ProgressView'
|
|
37
38
|
);
|
|
38
39
|
|
|
39
|
-
/**
|
|
40
|
-
* `<CircularProgress>` component without a host view.
|
|
41
|
-
* You should use this with a `Host` component in ancestor.
|
|
42
|
-
*/
|
|
43
|
-
export function CircularProgressPrimitive(props: CircularProgressProps) {
|
|
44
|
-
return <NativeProgressView {...props} variant="circular" />;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* `<LinearProgress>` component without a host view.
|
|
49
|
-
* You should use this with a `Host` component in ancestor.
|
|
50
|
-
*/
|
|
51
|
-
export function LinearProgressPrimitive(props: LinearProgressProps) {
|
|
52
|
-
return <NativeProgressView {...props} variant="linear" />;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
40
|
/**
|
|
56
41
|
* Renders a `CircularProgress` component.
|
|
57
42
|
*/
|
|
58
|
-
export function CircularProgress(props: CircularProgressProps
|
|
43
|
+
export function CircularProgress(props: CircularProgressProps) {
|
|
44
|
+
const { modifiers, ...restProps } = props;
|
|
59
45
|
return (
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
46
|
+
<NativeProgressView
|
|
47
|
+
modifiers={modifiers}
|
|
48
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
49
|
+
{...restProps}
|
|
50
|
+
variant="circular"
|
|
51
|
+
/>
|
|
63
52
|
);
|
|
64
53
|
}
|
|
65
54
|
|
|
66
55
|
/**
|
|
67
56
|
* Renders a `LinearProgress` component.
|
|
68
57
|
*/
|
|
69
|
-
export function LinearProgress(props: LinearProgressProps
|
|
58
|
+
export function LinearProgress(props: LinearProgressProps) {
|
|
59
|
+
const { modifiers, ...restProps } = props;
|
|
70
60
|
return (
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
61
|
+
<NativeProgressView
|
|
62
|
+
modifiers={modifiers}
|
|
63
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
64
|
+
{...restProps}
|
|
65
|
+
variant="linear"
|
|
66
|
+
/>
|
|
74
67
|
);
|
|
75
68
|
}
|
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
4
|
+
import { type CommonViewModifierProps } from '../types';
|
|
5
5
|
|
|
6
6
|
export type SectionProps = {
|
|
7
7
|
/**
|
|
8
8
|
* On iOS, section titles are usually capitalized for consistency with platform conventions.
|
|
9
9
|
*/
|
|
10
10
|
title?: string;
|
|
11
|
-
children:
|
|
12
|
-
};
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
} & CommonViewModifierProps;
|
|
13
13
|
|
|
14
14
|
const SectionNativeView: React.ComponentType<SectionProps> = requireNativeView(
|
|
15
15
|
'ExpoUI',
|
|
16
16
|
'SectionView'
|
|
17
17
|
);
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* `<Section>` component without a host view.
|
|
21
|
-
* You should use this with a `Host` component in ancestor.
|
|
22
|
-
*/
|
|
23
|
-
export function SectionPrimitive(props: SectionProps) {
|
|
24
|
-
return <SectionNativeView {...props} />;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
19
|
/**
|
|
28
20
|
* Section component uses the native [Section](https://developer.apple.com/documentation/swiftui/section) component.
|
|
29
21
|
* It has no intrinsic dimensions, so it needs explicit height or flex set to display content (like ScrollView).
|
|
30
22
|
* @platform ios
|
|
31
23
|
*/
|
|
32
|
-
export function Section(props: SectionProps
|
|
24
|
+
export function Section(props: SectionProps) {
|
|
25
|
+
const { modifiers, ...restProps } = props;
|
|
33
26
|
return (
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
<SectionNativeView
|
|
28
|
+
modifiers={modifiers}
|
|
29
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
30
|
+
{...restProps}
|
|
31
|
+
/>
|
|
37
32
|
);
|
|
38
33
|
}
|