@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,6 +1,8 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { ColorValue, StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { ExpoModifier } from '../../types';
|
|
5
|
+
|
|
4
6
|
export type ProgressElementColors = {
|
|
5
7
|
/**
|
|
6
8
|
* Track color.
|
|
@@ -28,6 +30,8 @@ export type CircularProgressProps = {
|
|
|
28
30
|
* @platform android
|
|
29
31
|
*/
|
|
30
32
|
elementColors?: ProgressElementColors;
|
|
33
|
+
/** Modifiers for the component */
|
|
34
|
+
modifiers?: ExpoModifier[];
|
|
31
35
|
};
|
|
32
36
|
|
|
33
37
|
export type LinearProgressProps = {
|
|
@@ -48,6 +52,8 @@ export type LinearProgressProps = {
|
|
|
48
52
|
* @platform android
|
|
49
53
|
*/
|
|
50
54
|
elementColors?: ProgressElementColors;
|
|
55
|
+
/** Modifiers for the component */
|
|
56
|
+
modifiers?: ExpoModifier[];
|
|
51
57
|
};
|
|
52
58
|
|
|
53
59
|
type NativeProgressProps =
|
|
@@ -65,12 +71,24 @@ const NativeProgressView: React.ComponentType<NativeProgressProps> = requireNati
|
|
|
65
71
|
* Renders a `CircularProgress` component.
|
|
66
72
|
*/
|
|
67
73
|
export function CircularProgress(props: CircularProgressProps) {
|
|
68
|
-
return
|
|
74
|
+
return (
|
|
75
|
+
<NativeProgressView
|
|
76
|
+
{...props} // @ts-expect-error
|
|
77
|
+
modifiers={props.modifiers?.map((m) => m.__expo_shared_object_id__)}
|
|
78
|
+
variant="circular"
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
69
81
|
}
|
|
70
82
|
|
|
71
83
|
/**
|
|
72
84
|
* Renders a `LinearProgress` component.
|
|
73
85
|
*/
|
|
74
86
|
export function LinearProgress(props: LinearProgressProps) {
|
|
75
|
-
return
|
|
87
|
+
return (
|
|
88
|
+
<NativeProgressView
|
|
89
|
+
{...props} // @ts-expect-error
|
|
90
|
+
modifiers={props.modifiers?.map((m) => m.__expo_shared_object_id__)}
|
|
91
|
+
variant="linear"
|
|
92
|
+
/>
|
|
93
|
+
);
|
|
76
94
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { ExpoModifier } from '../../types';
|
|
5
|
+
|
|
4
6
|
export type ShapeProps = {
|
|
5
7
|
/**
|
|
6
8
|
* Corner rounding percentage. Multiplied by the shorter dimension of the view to produce pixel values.
|
|
@@ -31,6 +33,8 @@ export type ShapeProps = {
|
|
|
31
33
|
style?: ViewStyle;
|
|
32
34
|
/** Color of the shape */
|
|
33
35
|
color?: string;
|
|
36
|
+
/** Modifiers for the component */
|
|
37
|
+
modifiers?: ExpoModifier[];
|
|
34
38
|
};
|
|
35
39
|
|
|
36
40
|
const ShapeNativeView: React.ComponentType<any> = requireNativeView('ExpoUI', 'ShapeView');
|
|
@@ -56,9 +60,20 @@ function Rectangle(props: Pick<ShapeProps, 'smoothing' | 'cornerRounding' | 'sty
|
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
function Polygon(
|
|
59
|
-
props: Pick<
|
|
63
|
+
props: Pick<
|
|
64
|
+
ShapeProps,
|
|
65
|
+
'smoothing' | 'cornerRounding' | 'verticesCount' | 'style' | 'color' | 'modifiers'
|
|
66
|
+
>
|
|
60
67
|
) {
|
|
61
|
-
return
|
|
68
|
+
return (
|
|
69
|
+
<ShapeNativeView
|
|
70
|
+
{...props}
|
|
71
|
+
// @ts-expect-error
|
|
72
|
+
modifiers={props.modifiers?.map((m) => m.__expo_shared_object_id__)}
|
|
73
|
+
style={props.style}
|
|
74
|
+
type="polygon"
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
62
77
|
}
|
|
63
78
|
|
|
64
79
|
export const Shape = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { ViewEvent } from '../../types';
|
|
4
|
+
import { ExpoModifier, ViewEvent } from '../../types';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Colors for slider's core elements.
|
|
@@ -53,6 +53,9 @@ export type SliderProps = {
|
|
|
53
53
|
* Callback triggered on dragging along the slider.
|
|
54
54
|
*/
|
|
55
55
|
onValueChange?: (value: number) => void;
|
|
56
|
+
|
|
57
|
+
/** Modifiers for the component */
|
|
58
|
+
modifiers?: ExpoModifier[];
|
|
56
59
|
};
|
|
57
60
|
|
|
58
61
|
type NativeSliderProps = Omit<SliderProps, 'onValueChange'> &
|
|
@@ -86,6 +89,8 @@ export function transformSliderProps(props: SliderProps): NativeSliderProps {
|
|
|
86
89
|
}
|
|
87
90
|
: undefined,
|
|
88
91
|
color: props.color,
|
|
92
|
+
// @ts-expect-error
|
|
93
|
+
modifiers: props.modifiers?.map((m) => m.__expo_shared_object_id__),
|
|
89
94
|
};
|
|
90
95
|
}
|
|
91
96
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { ExpoModifier } from '../../types';
|
|
5
|
+
|
|
4
6
|
// @docsMissing
|
|
5
7
|
/**
|
|
6
8
|
* Only for switch.
|
|
@@ -54,6 +56,9 @@ export type SwitchProps = {
|
|
|
54
56
|
* Picker color. On iOS, it only applies to the `menu` variant.
|
|
55
57
|
*/
|
|
56
58
|
color?: string;
|
|
59
|
+
|
|
60
|
+
/** Modifiers for the component */
|
|
61
|
+
modifiers?: ExpoModifier[];
|
|
57
62
|
} & (SwitchSwitchVariantProps | SwitchCheckboxVariantProps | SwitchButtonVariantProps);
|
|
58
63
|
|
|
59
64
|
export type SwitchSwitchVariantProps = {
|
|
@@ -118,6 +123,8 @@ export function transformSwitchProps(props: SwitchProps): NativeSwitchProps {
|
|
|
118
123
|
onValueChange: ({ nativeEvent: { value } }) => {
|
|
119
124
|
props?.onValueChange?.(value);
|
|
120
125
|
},
|
|
126
|
+
// @ts-expect-error
|
|
127
|
+
modifiers: props.modifiers?.map((m) => m.__expo_shared_object_id__),
|
|
121
128
|
} as NativeSwitchProps;
|
|
122
129
|
}
|
|
123
130
|
|
|
@@ -2,7 +2,7 @@ import { requireNativeView } from 'expo';
|
|
|
2
2
|
import { Ref } from 'react';
|
|
3
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
4
4
|
|
|
5
|
-
import { ViewEvent } from '../../types';
|
|
5
|
+
import { ExpoModifier, ViewEvent } from '../../types';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @hidden Not used anywhere yet.
|
|
@@ -83,6 +83,9 @@ export type TextInputProps = {
|
|
|
83
83
|
* @platform android
|
|
84
84
|
*/
|
|
85
85
|
autoCapitalize?: 'characters' | 'none' | 'sentences' | 'unspecified' | 'words';
|
|
86
|
+
|
|
87
|
+
/** Modifiers for the component */
|
|
88
|
+
modifiers?: ExpoModifier[];
|
|
86
89
|
};
|
|
87
90
|
|
|
88
91
|
export type NativeTextInputProps = Omit<TextInputProps, 'onChangeText'> & {} & ViewEvent<
|
|
@@ -105,6 +108,8 @@ function transformTextInputProps(props: TextInputProps): NativeTextInputProps {
|
|
|
105
108
|
onValueChanged: (event) => {
|
|
106
109
|
props.onChangeText?.(event.nativeEvent.value);
|
|
107
110
|
},
|
|
111
|
+
// @ts-expect-error
|
|
112
|
+
modifiers: props.modifiers?.map((m) => m.__expo_shared_object_id__),
|
|
108
113
|
};
|
|
109
114
|
}
|
|
110
115
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { requireNativeModule } from 'expo';
|
|
2
|
+
|
|
3
|
+
import { ExpoModifier } from '../types';
|
|
4
|
+
|
|
5
|
+
const nativeExpoUIModule = requireNativeModule('ExpoUI');
|
|
6
|
+
|
|
7
|
+
export const padding: (all: number) => ExpoModifier = nativeExpoUIModule.padding;
|
|
8
|
+
export const size: (width: number, height: number) => ExpoModifier = nativeExpoUIModule.size;
|
|
9
|
+
export const fillMaxSize: () => ExpoModifier = nativeExpoUIModule.fillMaxSize;
|
|
10
|
+
export const offset: (x: number, y: number) => ExpoModifier = nativeExpoUIModule.offset;
|
|
11
|
+
export const background: (color: string) => ExpoModifier = nativeExpoUIModule.background;
|
|
12
|
+
export const border: (borderWidth: number, borderColor: string) => ExpoModifier =
|
|
13
|
+
nativeExpoUIModule.border;
|
|
14
|
+
export const shadow: (elevation: number) => ExpoModifier = nativeExpoUIModule.shadow;
|
|
15
|
+
export const alpha: (alpha: number) => ExpoModifier = nativeExpoUIModule.alpha;
|
|
16
|
+
export const blur: (radius: number) => ExpoModifier = nativeExpoUIModule.blur;
|
|
17
|
+
export const clickable: (callback: () => void) => ExpoModifier = nativeExpoUIModule.clickable;
|
|
18
|
+
export const rotate: (degrees: number) => ExpoModifier = nativeExpoUIModule.rotate;
|
|
19
|
+
export const zIndex: (index: number) => ExpoModifier = nativeExpoUIModule.zIndex;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import {
|
|
2
|
+
import { NativeSyntheticEvent } 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 BottomSheetProps = {
|
|
7
8
|
/**
|
|
@@ -16,7 +17,7 @@ export type BottomSheetProps = {
|
|
|
16
17
|
* Callback function that is called when the `BottomSheet` is opened.
|
|
17
18
|
*/
|
|
18
19
|
onIsOpenedChange: (isOpened: boolean) => void;
|
|
19
|
-
};
|
|
20
|
+
} & CommonViewModifierProps;
|
|
20
21
|
|
|
21
22
|
type NativeBottomSheetProps = Omit<BottomSheetProps, 'onIsOpenedChange'> & {
|
|
22
23
|
onIsOpenedChange: (event: NativeSyntheticEvent<{ isOpened: boolean }>) => void;
|
|
@@ -27,28 +28,18 @@ const BottomSheetNativeView: React.ComponentType<NativeBottomSheetProps> = requi
|
|
|
27
28
|
'BottomSheetView'
|
|
28
29
|
);
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
function transformBottomSheetProps(props: BottomSheetProps): NativeBottomSheetProps {
|
|
32
|
+
const { modifiers, ...restProps } = props;
|
|
31
33
|
return {
|
|
32
|
-
|
|
34
|
+
modifiers,
|
|
35
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
36
|
+
...restProps,
|
|
33
37
|
onIsOpenedChange: ({ nativeEvent: { isOpened } }) => {
|
|
34
38
|
props?.onIsOpenedChange?.(isOpened);
|
|
35
39
|
},
|
|
36
40
|
};
|
|
37
41
|
}
|
|
38
42
|
|
|
39
|
-
/**
|
|
40
|
-
* `<BottomSheet>` component without a host view.
|
|
41
|
-
* You should use this with a `Host` component in ancestor.
|
|
42
|
-
*/
|
|
43
|
-
export function BottomSheetPrimitive(props: BottomSheetProps) {
|
|
44
|
-
return <BottomSheetNativeView {...transformBottomSheetProps(props)} />;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
43
|
export function BottomSheet(props: BottomSheetProps) {
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<Host style={{ position: 'absolute', width }}>
|
|
51
|
-
<BottomSheetPrimitive {...props} />
|
|
52
|
-
</Host>
|
|
53
|
-
);
|
|
44
|
+
return <BottomSheetNativeView {...transformBottomSheetProps(props)} />;
|
|
54
45
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
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
7
|
/**
|
|
8
8
|
* The role of the button.
|
|
@@ -76,9 +76,10 @@ export type ButtonProps = {
|
|
|
76
76
|
* Disabled state of the button.
|
|
77
77
|
*/
|
|
78
78
|
disabled?: boolean;
|
|
79
|
-
};
|
|
79
|
+
} & CommonViewModifierProps;
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
+
* exposed for ContextMenu
|
|
82
83
|
* @hidden
|
|
83
84
|
*/
|
|
84
85
|
export type NativeButtonProps = Omit<
|
|
@@ -97,14 +98,17 @@ const ButtonNativeView: React.ComponentType<NativeButtonProps> = requireNativeVi
|
|
|
97
98
|
);
|
|
98
99
|
|
|
99
100
|
/**
|
|
101
|
+
* exposed for ContextMenu
|
|
100
102
|
* @hidden
|
|
101
103
|
*/
|
|
102
104
|
export function transformButtonProps(
|
|
103
105
|
props: Omit<ButtonProps, 'children'>,
|
|
104
106
|
text: string | undefined
|
|
105
107
|
): NativeButtonProps {
|
|
106
|
-
const { role, onPress, systemImage, ...restProps } = props;
|
|
108
|
+
const { role, onPress, systemImage, modifiers, ...restProps } = props;
|
|
107
109
|
return {
|
|
110
|
+
modifiers,
|
|
111
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
108
112
|
...restProps,
|
|
109
113
|
text,
|
|
110
114
|
systemImage,
|
|
@@ -114,10 +118,9 @@ export function transformButtonProps(
|
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
/**
|
|
117
|
-
*
|
|
118
|
-
* You should use this with a `Host` component in ancestor.
|
|
121
|
+
* Displays a native button component.
|
|
119
122
|
*/
|
|
120
|
-
export function
|
|
123
|
+
export function Button(props: ButtonProps) {
|
|
121
124
|
const { children, ...restProps } = props;
|
|
122
125
|
|
|
123
126
|
if (!children && !restProps.systemImage) {
|
|
@@ -136,15 +139,3 @@ export function ButtonPrimitive(props: ButtonProps) {
|
|
|
136
139
|
}
|
|
137
140
|
return <ButtonNativeView {...transformedProps}>{children}</ButtonNativeView>;
|
|
138
141
|
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Displays a native button component.
|
|
142
|
-
*/
|
|
143
|
-
export function Button(props: ButtonProps & { style?: StyleProp<ViewStyle> }) {
|
|
144
|
-
const useViewportSizeMeasurement = props.style == null;
|
|
145
|
-
return (
|
|
146
|
-
<Host style={props.style} matchContents useViewportSizeMeasurement={useViewportSizeMeasurement}>
|
|
147
|
-
<ButtonPrimitive {...props} />
|
|
148
|
-
</Host>
|
|
149
|
-
);
|
|
150
|
-
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
|
-
import { NativeSyntheticEvent, processColor
|
|
3
|
+
import { NativeSyntheticEvent, processColor } from 'react-native';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
6
|
+
import { type CommonViewModifierProps } from '../types';
|
|
6
7
|
|
|
7
8
|
export type ColorPickerProps = {
|
|
8
9
|
/**
|
|
@@ -21,7 +22,7 @@ export type ColorPickerProps = {
|
|
|
21
22
|
* Whether the color picker should support opacity.
|
|
22
23
|
*/
|
|
23
24
|
supportsOpacity?: boolean;
|
|
24
|
-
};
|
|
25
|
+
} & CommonViewModifierProps;
|
|
25
26
|
|
|
26
27
|
type OnValueChangedEvent = NativeSyntheticEvent<{ value: string }>;
|
|
27
28
|
|
|
@@ -33,12 +34,13 @@ const ColorPickerNativeView: React.ComponentType<
|
|
|
33
34
|
> = requireNativeView('ExpoUI', 'ColorPickerView');
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
37
|
+
* Renders a `ColorPicker` component using SwiftUI.
|
|
38
|
+
* @platform ios
|
|
38
39
|
*/
|
|
39
|
-
export function
|
|
40
|
+
export function ColorPicker({
|
|
40
41
|
selection,
|
|
41
42
|
onValueChanged,
|
|
43
|
+
modifiers,
|
|
42
44
|
...restProps
|
|
43
45
|
}: ColorPickerProps) {
|
|
44
46
|
const onNativeValueChanged = useCallback(
|
|
@@ -49,21 +51,11 @@ export function ColorPickerPrimitive({
|
|
|
49
51
|
);
|
|
50
52
|
return (
|
|
51
53
|
<ColorPickerNativeView
|
|
54
|
+
modifiers={modifiers}
|
|
55
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
52
56
|
selection={processColor(selection || '')}
|
|
53
57
|
onValueChanged={onNativeValueChanged}
|
|
54
58
|
{...restProps}
|
|
55
59
|
/>
|
|
56
60
|
);
|
|
57
61
|
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Renders a `ColorPicker` component using SwiftUI.
|
|
61
|
-
* @platform ios
|
|
62
|
-
*/
|
|
63
|
-
export function ColorPicker(props: ColorPickerProps & { style?: StyleProp<ViewStyle> }) {
|
|
64
|
-
return (
|
|
65
|
-
<Host style={props.style} matchContents>
|
|
66
|
-
<ColorPickerPrimitive {...props} />
|
|
67
|
-
</Host>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import { Platform } from 'react-native';
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
4
|
+
import { type CommonViewModifierProps } from '../types';
|
|
5
5
|
|
|
6
6
|
export interface ContentUnavailableViewProps extends CommonViewModifierProps {
|
|
7
7
|
/**
|
|
@@ -20,17 +20,24 @@ export interface ContentUnavailableViewProps extends CommonViewModifierProps {
|
|
|
20
20
|
description?: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
const ContentUnavailableViewNativeView: React.ComponentType<ContentUnavailableViewProps>
|
|
24
|
-
|
|
23
|
+
const ContentUnavailableViewNativeView: React.ComponentType<ContentUnavailableViewProps> =
|
|
24
|
+
requireNativeView('ExpoUI', 'ContentUnavailableView');
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Displays a native Swift UI ContentUnavailableView.
|
|
28
28
|
* @platform ios 17.0+
|
|
29
|
-
*
|
|
30
29
|
*/
|
|
30
|
+
function transformContentUnavailableViewProps(
|
|
31
|
+
props: ContentUnavailableViewProps
|
|
32
|
+
): ContentUnavailableViewProps {
|
|
33
|
+
const { modifiers, ...restProps } = props;
|
|
34
|
+
return {
|
|
35
|
+
modifiers,
|
|
36
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
37
|
+
...restProps,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
export function ContentUnavailableView(props: ContentUnavailableViewProps) {
|
|
32
|
-
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
return <ContentUnavailableViewNativeView {...props} />;
|
|
42
|
+
return <ContentUnavailableViewNativeView {...transformContentUnavailableViewProps(props)} />;
|
|
36
43
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { type ButtonProps } from '../Button';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Props of the `Submenu` component.
|
|
7
|
+
*/
|
|
8
|
+
export type SubmenuProps = {
|
|
9
|
+
/**
|
|
10
|
+
* The button that will be used to expand the submenu. On Android the `text` prop of the `Button` will be used as a section title.
|
|
11
|
+
*/
|
|
12
|
+
button: ReactElement<ButtonProps>;
|
|
13
|
+
/**
|
|
14
|
+
* Children of the submenu. Only `Button`, `Switch`, `Picker` and `Submenu` elements should be used.
|
|
15
|
+
*/
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The `Submenu` component is used to create a nested context menu. Submenus can be infinitely nested.
|
|
21
|
+
* Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple titled sections.
|
|
22
|
+
*/
|
|
23
|
+
export function Submenu(props: SubmenuProps) {
|
|
24
|
+
return <></>;
|
|
25
|
+
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import { ComponentType, Children,
|
|
3
|
-
import { NativeSyntheticEvent
|
|
2
|
+
import { ComponentType, Children, useMemo } from 'react';
|
|
3
|
+
import { NativeSyntheticEvent } from 'react-native';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type ContextMenuProps, type EventHandlers } from './types';
|
|
6
6
|
import { MenuElement, transformChildrenToElementArray } from './utils';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
export * from './Submenu';
|
|
9
|
+
export {
|
|
10
|
+
type ActivationMethod,
|
|
11
|
+
type ContextMenuProps,
|
|
12
|
+
type ContextMenuContentProps,
|
|
13
|
+
} from './types';
|
|
10
14
|
|
|
11
15
|
const MenuNativeView: ComponentType<NativeMenuProps> = requireNativeView('ExpoUI', 'ContextMenu');
|
|
12
16
|
|
|
@@ -20,70 +24,7 @@ const MenuNativePreviewView: ComponentType<object> = requireNativeView(
|
|
|
20
24
|
'ContextMenuPreview'
|
|
21
25
|
);
|
|
22
26
|
|
|
23
|
-
type
|
|
24
|
-
| ReactElement<ButtonProps>
|
|
25
|
-
| ReactElement<SwitchProps>
|
|
26
|
-
| ReactElement<PickerProps>
|
|
27
|
-
| ReactElement<SubmenuProps>;
|
|
28
|
-
|
|
29
|
-
export type ContextMenuContentProps = {
|
|
30
|
-
children: SubmenuElement | SubmenuElement[];
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
|
-
export type EventHandlers = Record<
|
|
37
|
-
string,
|
|
38
|
-
Record<string, (event: NativeSyntheticEvent<any>) => void>
|
|
39
|
-
>;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @hidden
|
|
43
|
-
*/
|
|
44
|
-
export type ContextMenuElementBase = { contextMenuElementID: string };
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Activation method of the context menu.
|
|
48
|
-
* - `singlePress`: The context menu is opened with a single tap. Does not isolate the content.
|
|
49
|
-
* - `longPress`: The context menu is opened with a long press. On iOS additionally Highlights the content by blurring the background.
|
|
50
|
-
*/
|
|
51
|
-
export type ActivationMethod = 'singlePress' | 'longPress';
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Props of the `ContextMenu` component.
|
|
55
|
-
*/
|
|
56
|
-
export type ContextMenuProps = {
|
|
57
|
-
/**
|
|
58
|
-
* Determines how the context menu will be activated.
|
|
59
|
-
*/
|
|
60
|
-
activationMethod?: ActivationMethod;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* The contents of the submenu are used as an anchor for the context menu.
|
|
64
|
-
* The children will be wrapped in a pressable element, which triggers opening of the context menu.
|
|
65
|
-
*/
|
|
66
|
-
children: ReactNode;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Props of the `Submenu` component.
|
|
71
|
-
*/
|
|
72
|
-
export type SubmenuProps = {
|
|
73
|
-
/**
|
|
74
|
-
* The button that will be used to expand the submenu. On Android the `text` prop of the `Button` will be used as a section title.
|
|
75
|
-
*/
|
|
76
|
-
button: ReactElement<ButtonProps>;
|
|
77
|
-
/**
|
|
78
|
-
* Children of the submenu. Only `Button`, `Switch`, `Picker` and `Submenu` elements should be used.
|
|
79
|
-
*/
|
|
80
|
-
children: ReactNode;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @hidden
|
|
85
|
-
*/
|
|
86
|
-
export type NativeMenuProps = ContextMenuProps & {
|
|
27
|
+
type NativeMenuProps = ContextMenuProps & {
|
|
87
28
|
elements: MenuElement[];
|
|
88
29
|
onContextMenuButtonPressed: (
|
|
89
30
|
event: NativeSyntheticEvent<{ contextMenuElementID: string }>
|
|
@@ -103,14 +44,6 @@ export type NativeMenuProps = ContextMenuProps & {
|
|
|
103
44
|
) => void;
|
|
104
45
|
};
|
|
105
46
|
|
|
106
|
-
/**
|
|
107
|
-
* The `Submenu` component is used to create a nested context menu. Submenus can be infinitely nested.
|
|
108
|
-
* Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple titled sections.
|
|
109
|
-
*/
|
|
110
|
-
export function Submenu(props: SubmenuProps) {
|
|
111
|
-
return <></>;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
47
|
/**
|
|
115
48
|
* Items visible inside the context menu. Pass input components as immidiate children of the tag.
|
|
116
49
|
* `Button`, `Switch` and `Submenu` components are supported on both Android and iOS.
|
|
@@ -140,7 +73,17 @@ export function Preview(props: { children: React.ReactNode }) {
|
|
|
140
73
|
* `<ContextMenu>` component without a host view.
|
|
141
74
|
* You should use this with a `Host` component in ancestor.
|
|
142
75
|
*/
|
|
143
|
-
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* `ContextMenu` allows you to create a context menu, which can be used to provide additional options to the user.
|
|
79
|
+
*
|
|
80
|
+
* There are some platform-specific differences in the behavior of the context menu:
|
|
81
|
+
* - On Android, the expansion of the context menu is controlled by the `expanded` prop. iOS, does not allow for manual control of the expansion state.
|
|
82
|
+
* - On iOS, the context menu can be triggered by a single press or a long press. The `activationMethod` prop allows you to choose between these two options.
|
|
83
|
+
* - Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple sections. The `title` prop of the `Button`, which opens the submenu on iOS will be used as a section title.
|
|
84
|
+
* - Android does not support showing a `Picker` element in the context menu.
|
|
85
|
+
*/
|
|
86
|
+
function ContextMenu(props: ContextMenuProps) {
|
|
144
87
|
const eventHandlersMap: EventHandlers = {};
|
|
145
88
|
const initialChildren = Children.map(
|
|
146
89
|
props.children as any,
|
|
@@ -169,28 +112,8 @@ function ContextMenuPrimitive(props: ContextMenuProps) {
|
|
|
169
112
|
);
|
|
170
113
|
}
|
|
171
114
|
|
|
172
|
-
/**
|
|
173
|
-
* `ContextMenuPrimitive` allows you to create a context menu, which can be used to provide additional options to the user.
|
|
174
|
-
*
|
|
175
|
-
* There are some platform-specific differences in the behavior of the context menu:
|
|
176
|
-
* - On Android, the expansion of the context menu is controlled by the `expanded` prop. iOS, does not allow for manual control of the expansion state.
|
|
177
|
-
* - On iOS, the context menu can be triggered by a single press or a long press. The `activationMethod` prop allows you to choose between these two options.
|
|
178
|
-
* - Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple sections. The `title` prop of the `Button`, which opens the submenu on iOS will be used as a section title.
|
|
179
|
-
* - Android does not support showing a `Picker` element in the context menu.
|
|
180
|
-
*/
|
|
181
|
-
function ContextMenu(props: ContextMenuProps & { style?: StyleProp<ViewStyle> }) {
|
|
182
|
-
return (
|
|
183
|
-
<Host style={props.style} matchContents>
|
|
184
|
-
<ContextMenuPrimitive {...props} />
|
|
185
|
-
</Host>
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
ContextMenuPrimitive.Trigger = Trigger;
|
|
190
|
-
ContextMenuPrimitive.Preview = Preview;
|
|
191
|
-
ContextMenuPrimitive.Items = Items;
|
|
192
115
|
ContextMenu.Trigger = Trigger;
|
|
193
116
|
ContextMenu.Preview = Preview;
|
|
194
117
|
ContextMenu.Items = Items;
|
|
195
118
|
|
|
196
|
-
export {
|
|
119
|
+
export { ContextMenu };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { NativeSyntheticEvent } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { type ButtonProps } from '../Button';
|
|
5
|
+
import { type PickerProps } from '../Picker';
|
|
6
|
+
import { type SwitchProps } from '../Switch';
|
|
7
|
+
import { type SubmenuProps } from './Submenu';
|
|
8
|
+
|
|
9
|
+
export type EventHandlers = Record<
|
|
10
|
+
string,
|
|
11
|
+
Record<string, (event: NativeSyntheticEvent<any>) => void>
|
|
12
|
+
>;
|
|
13
|
+
|
|
14
|
+
export type ContextMenuElementBase = { contextMenuElementID: string };
|
|
15
|
+
|
|
16
|
+
type SubmenuElement =
|
|
17
|
+
| ReactElement<ButtonProps>
|
|
18
|
+
| ReactElement<SwitchProps>
|
|
19
|
+
| ReactElement<PickerProps>
|
|
20
|
+
| ReactElement<SubmenuProps>;
|
|
21
|
+
|
|
22
|
+
export type ContextMenuContentProps = {
|
|
23
|
+
children: SubmenuElement | SubmenuElement[];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Activation method of the context menu.
|
|
28
|
+
* - `singlePress`: The context menu is opened with a single tap. Does not isolate the content.
|
|
29
|
+
* - `longPress`: The context menu is opened with a long press. On iOS additionally Highlights the content by blurring the background.
|
|
30
|
+
*/
|
|
31
|
+
export type ActivationMethod = 'singlePress' | 'longPress';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Props of the `ContextMenu` component.
|
|
35
|
+
*/
|
|
36
|
+
export type ContextMenuProps = {
|
|
37
|
+
/**
|
|
38
|
+
* Determines how the context menu will be activated.
|
|
39
|
+
*/
|
|
40
|
+
activationMethod?: ActivationMethod;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The contents of the submenu are used as an anchor for the context menu.
|
|
44
|
+
* The children will be wrapped in a pressable element, which triggers opening of the context menu.
|
|
45
|
+
*/
|
|
46
|
+
children: ReactNode;
|
|
47
|
+
};
|