@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,26 +1,18 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import {
|
|
3
|
-
import { Host } from '../Host';
|
|
2
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
4
3
|
const BottomSheetNativeView = requireNativeView('ExpoUI', 'BottomSheetView');
|
|
5
|
-
|
|
4
|
+
function transformBottomSheetProps(props) {
|
|
5
|
+
const { modifiers, ...restProps } = props;
|
|
6
6
|
return {
|
|
7
|
-
|
|
7
|
+
modifiers,
|
|
8
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
9
|
+
...restProps,
|
|
8
10
|
onIsOpenedChange: ({ nativeEvent: { isOpened } }) => {
|
|
9
11
|
props?.onIsOpenedChange?.(isOpened);
|
|
10
12
|
},
|
|
11
13
|
};
|
|
12
14
|
}
|
|
13
|
-
/**
|
|
14
|
-
* `<BottomSheet>` component without a host view.
|
|
15
|
-
* You should use this with a `Host` component in ancestor.
|
|
16
|
-
*/
|
|
17
|
-
export function BottomSheetPrimitive(props) {
|
|
18
|
-
return <BottomSheetNativeView {...transformBottomSheetProps(props)}/>;
|
|
19
|
-
}
|
|
20
15
|
export function BottomSheet(props) {
|
|
21
|
-
|
|
22
|
-
return (<Host style={{ position: 'absolute', width }}>
|
|
23
|
-
<BottomSheetPrimitive {...props}/>
|
|
24
|
-
</Host>);
|
|
16
|
+
return <BottomSheetNativeView {...transformBottomSheetProps(props)}/>;
|
|
25
17
|
}
|
|
26
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/BottomSheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/BottomSheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAGzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAsBrE,MAAM,qBAAqB,GAAgD,iBAAiB,CAC1F,QAAQ,EACR,iBAAiB,CAClB,CAAC;AAEF,SAAS,yBAAyB,CAAC,KAAuB;IACxD,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAC1C,OAAO;QACL,SAAS;QACT,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACvE,GAAG,SAAS;QACZ,gBAAgB,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE;YAClD,KAAK,EAAE,gBAAgB,EAAE,CAAC,QAAQ,CAAC,CAAC;QACtC,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,OAAO,CAAC,qBAAqB,CAAC,IAAI,yBAAyB,CAAC,KAAK,CAAC,CAAC,EAAG,CAAC;AACzE,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport { NativeSyntheticEvent } from 'react-native';\n\nimport { createViewModifierEventListener } from '../modifiers/utils';\nimport { type CommonViewModifierProps } from '../types';\n\nexport type BottomSheetProps = {\n /**\n * The children of the `BottomSheet` component.\n */\n children: any;\n /**\n * Whether the `BottomSheet` is opened.\n */\n isOpened: boolean;\n /**\n * Callback function that is called when the `BottomSheet` is opened.\n */\n onIsOpenedChange: (isOpened: boolean) => void;\n} & CommonViewModifierProps;\n\ntype NativeBottomSheetProps = Omit<BottomSheetProps, 'onIsOpenedChange'> & {\n onIsOpenedChange: (event: NativeSyntheticEvent<{ isOpened: boolean }>) => void;\n};\n\nconst BottomSheetNativeView: React.ComponentType<NativeBottomSheetProps> = requireNativeView(\n 'ExpoUI',\n 'BottomSheetView'\n);\n\nfunction transformBottomSheetProps(props: BottomSheetProps): NativeBottomSheetProps {\n const { modifiers, ...restProps } = props;\n return {\n modifiers,\n ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),\n ...restProps,\n onIsOpenedChange: ({ nativeEvent: { isOpened } }) => {\n props?.onIsOpenedChange?.(isOpened);\n },\n };\n}\n\nexport function BottomSheet(props: BottomSheetProps) {\n return <BottomSheetNativeView {...transformBottomSheetProps(props)} />;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type ViewEvent } from '../../types';
|
|
2
|
+
import { type CommonViewModifierProps } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* The role of the button.
|
|
5
5
|
* - `default` - The default button role.
|
|
@@ -57,8 +57,9 @@ export type ButtonProps = {
|
|
|
57
57
|
* Disabled state of the button.
|
|
58
58
|
*/
|
|
59
59
|
disabled?: boolean;
|
|
60
|
-
};
|
|
60
|
+
} & CommonViewModifierProps;
|
|
61
61
|
/**
|
|
62
|
+
* exposed for ContextMenu
|
|
62
63
|
* @hidden
|
|
63
64
|
*/
|
|
64
65
|
export type NativeButtonProps = Omit<ButtonProps, 'role' | 'onPress' | 'children' | 'systemImage'> & {
|
|
@@ -67,18 +68,12 @@ export type NativeButtonProps = Omit<ButtonProps, 'role' | 'onPress' | 'children
|
|
|
67
68
|
systemImage?: string;
|
|
68
69
|
} & ViewEvent<'onButtonPressed', void>;
|
|
69
70
|
/**
|
|
71
|
+
* exposed for ContextMenu
|
|
70
72
|
* @hidden
|
|
71
73
|
*/
|
|
72
74
|
export declare function transformButtonProps(props: Omit<ButtonProps, 'children'>, text: string | undefined): NativeButtonProps;
|
|
73
|
-
/**
|
|
74
|
-
* `<Button>` component without a host view.
|
|
75
|
-
* You should use this with a `Host` component in ancestor.
|
|
76
|
-
*/
|
|
77
|
-
export declare function ButtonPrimitive(props: ButtonProps): import("react").JSX.Element;
|
|
78
75
|
/**
|
|
79
76
|
* Displays a native button component.
|
|
80
77
|
*/
|
|
81
|
-
export declare function Button(props: ButtonProps
|
|
82
|
-
style?: StyleProp<ViewStyle>;
|
|
83
|
-
}): import("react").JSX.Element;
|
|
78
|
+
export declare function Button(props: ButtonProps): import("react").JSX.Element;
|
|
84
79
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Button/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Button/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,aAAa,GAErB,SAAS,GACT,UAAU,GACV,OAAO,GACP,OAAO,GACP,gBAAgB,GAChB,mBAAmB,GACnB,YAAY,GAEZ,cAAc,GACd,oBAAoB,GACpB,MAAM,GACN,MAAM,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,uBAAuB,CAAC;AAE5B;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,WAAW,EACX,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAChD,GAAG;IACF,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;AAQvC;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,EACpC,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,iBAAiB,CAWnB;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAkBxC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import {
|
|
2
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
3
3
|
// We have to work around the `role` and `onPress` props being reserved by React Native.
|
|
4
4
|
const ButtonNativeView = requireNativeView('ExpoUI', 'Button');
|
|
5
5
|
/**
|
|
6
|
+
* exposed for ContextMenu
|
|
6
7
|
* @hidden
|
|
7
8
|
*/
|
|
8
9
|
export function transformButtonProps(props, text) {
|
|
9
|
-
const { role, onPress, systemImage, ...restProps } = props;
|
|
10
|
+
const { role, onPress, systemImage, modifiers, ...restProps } = props;
|
|
10
11
|
return {
|
|
12
|
+
modifiers,
|
|
13
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
11
14
|
...restProps,
|
|
12
15
|
text,
|
|
13
16
|
systemImage,
|
|
@@ -16,10 +19,9 @@ export function transformButtonProps(props, text) {
|
|
|
16
19
|
};
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
|
-
*
|
|
20
|
-
* You should use this with a `Host` component in ancestor.
|
|
22
|
+
* Displays a native button component.
|
|
21
23
|
*/
|
|
22
|
-
export function
|
|
24
|
+
export function Button(props) {
|
|
23
25
|
const { children, ...restProps } = props;
|
|
24
26
|
if (!children && !restProps.systemImage) {
|
|
25
27
|
throw new Error('Button without systemImage prop should have React children');
|
|
@@ -33,13 +35,4 @@ export function ButtonPrimitive(props) {
|
|
|
33
35
|
}
|
|
34
36
|
return <ButtonNativeView {...transformedProps}>{children}</ButtonNativeView>;
|
|
35
37
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Displays a native button component.
|
|
38
|
-
*/
|
|
39
|
-
export function Button(props) {
|
|
40
|
-
const useViewportSizeMeasurement = props.style == null;
|
|
41
|
-
return (<Host style={props.style} matchContents useViewportSizeMeasurement={useViewportSizeMeasurement}>
|
|
42
|
-
<ButtonPrimitive {...props}/>
|
|
43
|
-
</Host>);
|
|
44
|
-
}
|
|
45
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAGzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AA0FrE,wFAAwF;AACxF,MAAM,gBAAgB,GAA2C,iBAAiB,CAChF,QAAQ,EACR,QAAQ,CACT,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAoC,EACpC,IAAwB;IAExB,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACtE,OAAO;QACL,SAAS;QACT,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACvE,GAAG,SAAS;QACZ,IAAI;QACJ,WAAW;QACX,UAAU,EAAE,IAAI;QAChB,eAAe,EAAE,OAAO;KACzB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAEzC,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IAEjE,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAE/D,4DAA4D;IAC5D,MAAM,oBAAoB,GAAG,IAAI,IAAI,IAAI,IAAI,QAAQ,IAAI,IAAI,CAAC;IAE9D,IAAI,oBAAoB,EAAE,CAAC;QACzB,OAAO,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,CAAC,EAAG,CAAC;IACpD,CAAC;IACD,OAAO,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { type ViewEvent } from '../../types';\nimport { createViewModifierEventListener } from '../modifiers/utils';\nimport { type CommonViewModifierProps } from '../types';\n\n/**\n * The role of the button.\n * - `default` - The default button role.\n * - `cancel` - A button that cancels the current operation.\n * - `destructive` - A button that deletes data or performs a destructive action.\n */\nexport type ButtonRole = 'default' | 'cancel' | 'destructive';\n\n/**\n * The built-in button styles available on iOS.\n *\n * Common styles:\n * - `default` - The default system button style.\n * - `bordered` - A button with a light fill. On Android, equivalent to `FilledTonalButton`.\n * - `borderless` - A button with no background or border. On Android, equivalent to `TextButton`.\n * - `borderedProminent` - A bordered button with a prominent appearance.\n * - `plain` - A button with no border or background and a less prominent text.\n * macOS-only styles:\n * - `glass` – A liquid glass button effect – (available only since iOS 26, for now only when built with beta version of Xcode)\n * - `glassProminent` – A liquid glass button effect – (available only since iOS 26, for now only when built with beta 3 version of Xcode)\n * - `accessoryBar` - A button style for accessory bars.\n * - `accessoryBarAction` - A button style for accessory bar actions.\n * - `card` - A button style for cards.\n * - `link` - A button style for links.\n */\nexport type ButtonVariant =\n // Common\n | 'default'\n | 'bordered'\n | 'plain'\n | 'glass'\n | 'glassProminent'\n | 'borderedProminent'\n | 'borderless'\n // MacOS-only;\n | 'accessoryBar'\n | 'accessoryBarAction'\n | 'card'\n | 'link';\n\nexport type ButtonProps = {\n /**\n * A callback that is called when the button is pressed.\n */\n onPress?: () => void;\n /**\n * A string describing the system image to display in the button.\n * This is only used if `children` is a string.\n * Uses Material Icons on Android and SF Symbols on iOS.\n */\n systemImage?: string;\n /**\n * Indicated the role of the button.\n * @platform ios\n */\n role?: ButtonRole;\n /**\n * The button variant.\n */\n variant?: ButtonVariant;\n /**\n * The text or React node to display inside the button.\n */\n children?: string | React.ReactNode;\n /**\n * Button color.\n */\n color?: string;\n /**\n * Disabled state of the button.\n */\n disabled?: boolean;\n} & CommonViewModifierProps;\n\n/**\n * exposed for ContextMenu\n * @hidden\n */\nexport type NativeButtonProps = Omit<\n ButtonProps,\n 'role' | 'onPress' | 'children' | 'systemImage'\n> & {\n buttonRole?: ButtonRole;\n text: string | undefined;\n systemImage?: string;\n} & ViewEvent<'onButtonPressed', void>;\n\n// We have to work around the `role` and `onPress` props being reserved by React Native.\nconst ButtonNativeView: React.ComponentType<NativeButtonProps> = requireNativeView(\n 'ExpoUI',\n 'Button'\n);\n\n/**\n * exposed for ContextMenu\n * @hidden\n */\nexport function transformButtonProps(\n props: Omit<ButtonProps, 'children'>,\n text: string | undefined\n): NativeButtonProps {\n const { role, onPress, systemImage, modifiers, ...restProps } = props;\n return {\n modifiers,\n ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),\n ...restProps,\n text,\n systemImage,\n buttonRole: role,\n onButtonPressed: onPress,\n };\n}\n\n/**\n * Displays a native button component.\n */\nexport function Button(props: ButtonProps) {\n const { children, ...restProps } = props;\n\n if (!children && !restProps.systemImage) {\n throw new Error('Button without systemImage prop should have React children');\n }\n\n const text = typeof children === 'string' ? children : undefined;\n\n const transformedProps = transformButtonProps(restProps, text);\n\n // Render without children wrapper if text-only or icon-only\n const shouldRenderDirectly = text != null || children == null;\n\n if (shouldRenderDirectly) {\n return <ButtonNativeView {...transformedProps} />;\n }\n return <ButtonNativeView {...transformedProps}>{children}</ButtonNativeView>;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type CommonViewModifierProps } from '../types';
|
|
2
2
|
export type ColorPickerProps = {
|
|
3
3
|
/**
|
|
4
4
|
* The currently selected color in the format `#RRGGBB` or `#RRGGBBAA`.
|
|
@@ -16,17 +16,10 @@ export type ColorPickerProps = {
|
|
|
16
16
|
* Whether the color picker should support opacity.
|
|
17
17
|
*/
|
|
18
18
|
supportsOpacity?: boolean;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* `<ColorPicker>` component without a host view.
|
|
22
|
-
* You should use this with a `Host` component in ancestor.
|
|
23
|
-
*/
|
|
24
|
-
export declare function ColorPickerPrimitive({ selection, onValueChanged, ...restProps }: ColorPickerProps): import("react").JSX.Element;
|
|
19
|
+
} & CommonViewModifierProps;
|
|
25
20
|
/**
|
|
26
21
|
* Renders a `ColorPicker` component using SwiftUI.
|
|
27
22
|
* @platform ios
|
|
28
23
|
*/
|
|
29
|
-
export declare function ColorPicker(
|
|
30
|
-
style?: StyleProp<ViewStyle>;
|
|
31
|
-
}): import("react").JSX.Element;
|
|
24
|
+
export declare function ColorPicker({ selection, onValueChanged, modifiers, ...restProps }: ColorPickerProps): import("react").JSX.Element;
|
|
32
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/ColorPicker/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/ColorPicker/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,uBAAuB,CAAC;AAW5B;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,cAAc,EACd,SAAS,EACT,GAAG,SAAS,EACb,EAAE,gBAAgB,+BAgBlB"}
|
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import { processColor } from 'react-native';
|
|
4
|
-
import {
|
|
4
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
5
|
const ColorPickerNativeView = requireNativeView('ExpoUI', 'ColorPickerView');
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Renders a `ColorPicker` component using SwiftUI.
|
|
8
|
+
* @platform ios
|
|
9
9
|
*/
|
|
10
|
-
export function
|
|
10
|
+
export function ColorPicker({ selection, onValueChanged, modifiers, ...restProps }) {
|
|
11
11
|
const onNativeValueChanged = useCallback((event) => {
|
|
12
12
|
onValueChanged?.(event.nativeEvent.value);
|
|
13
13
|
}, [onValueChanged]);
|
|
14
|
-
return (<ColorPickerNativeView selection={processColor(selection || '')} onValueChanged={onNativeValueChanged} {...restProps}/>);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Renders a `ColorPicker` component using SwiftUI.
|
|
18
|
-
* @platform ios
|
|
19
|
-
*/
|
|
20
|
-
export function ColorPicker(props) {
|
|
21
|
-
return (<Host style={props.style} matchContents>
|
|
22
|
-
<ColorPickerPrimitive {...props}/>
|
|
23
|
-
</Host>);
|
|
14
|
+
return (<ColorPickerNativeView modifiers={modifiers} {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)} selection={processColor(selection || '')} onValueChanged={onNativeValueChanged} {...restProps}/>);
|
|
24
15
|
}
|
|
25
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/ColorPicker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAwB,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/ColorPicker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAwB,YAAY,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAwBrE,MAAM,qBAAqB,GAKvB,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AAEnD;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,EACT,cAAc,EACd,SAAS,EACT,GAAG,SAAS,EACK;IACjB,MAAM,oBAAoB,GAAG,WAAW,CACtC,CAAC,KAA0B,EAAE,EAAE;QAC7B,cAAc,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC,EACD,CAAC,cAAc,CAAC,CACjB,CAAC;IACF,OAAO,CACL,CAAC,qBAAqB,CACpB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CACzE,SAAS,CAAC,CAAC,YAAY,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CACzC,cAAc,CAAC,CAAC,oBAAoB,CAAC,CACrC,IAAI,SAAS,CAAC,EACd,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport { useCallback } from 'react';\nimport { NativeSyntheticEvent, processColor } from 'react-native';\n\nimport { createViewModifierEventListener } from '../modifiers/utils';\nimport { type CommonViewModifierProps } from '../types';\n\nexport type ColorPickerProps = {\n /**\n * The currently selected color in the format `#RRGGBB` or `#RRGGBBAA`.\n */\n selection: string | null;\n /**\n * A label displayed on the `ColorPicker`.\n */\n label?: string;\n /**\n * Callback function that is called when a new color is selected.\n */\n onValueChanged?: (value: string) => void;\n /**\n * Whether the color picker should support opacity.\n */\n supportsOpacity?: boolean;\n} & CommonViewModifierProps;\n\ntype OnValueChangedEvent = NativeSyntheticEvent<{ value: string }>;\n\nconst ColorPickerNativeView: React.ComponentType<\n Omit<ColorPickerProps, 'selection' | 'onValueChanged'> & {\n selection: ReturnType<typeof processColor>;\n onValueChanged: (event: OnValueChangedEvent) => void;\n }\n> = requireNativeView('ExpoUI', 'ColorPickerView');\n\n/**\n * Renders a `ColorPicker` component using SwiftUI.\n * @platform ios\n */\nexport function ColorPicker({\n selection,\n onValueChanged,\n modifiers,\n ...restProps\n}: ColorPickerProps) {\n const onNativeValueChanged = useCallback(\n (event: OnValueChangedEvent) => {\n onValueChanged?.(event.nativeEvent.value);\n },\n [onValueChanged]\n );\n return (\n <ColorPickerNativeView\n modifiers={modifiers}\n {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}\n selection={processColor(selection || '')}\n onValueChanged={onNativeValueChanged}\n {...restProps}\n />\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonViewModifierProps } from '
|
|
1
|
+
import { type CommonViewModifierProps } from '../types';
|
|
2
2
|
export interface ContentUnavailableViewProps extends CommonViewModifierProps {
|
|
3
3
|
/**
|
|
4
4
|
* A short title that describes why the content is not available.
|
|
@@ -13,10 +13,5 @@ export interface ContentUnavailableViewProps extends CommonViewModifierProps {
|
|
|
13
13
|
*/
|
|
14
14
|
description?: string;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* @platform ios 17.0+
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
export declare function ContentUnavailableView(props: ContentUnavailableViewProps): import("react").JSX.Element | null;
|
|
22
|
-
//# sourceMappingURL=ContentUnavailableView.d.ts.map
|
|
16
|
+
export declare function ContentUnavailableView(props: ContentUnavailableViewProps): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/ContentUnavailableView/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,WAAW,2BAA4B,SAAQ,uBAAuB;IAC1E;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAoBD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,+BAExE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { requireNativeView } from 'expo';
|
|
2
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
3
|
+
const ContentUnavailableViewNativeView = requireNativeView('ExpoUI', 'ContentUnavailableView');
|
|
4
|
+
/**
|
|
5
|
+
* Displays a native Swift UI ContentUnavailableView.
|
|
6
|
+
* @platform ios 17.0+
|
|
7
|
+
*/
|
|
8
|
+
function transformContentUnavailableViewProps(props) {
|
|
9
|
+
const { modifiers, ...restProps } = props;
|
|
10
|
+
return {
|
|
11
|
+
modifiers,
|
|
12
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
13
|
+
...restProps,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function ContentUnavailableView(props) {
|
|
17
|
+
return <ContentUnavailableViewNativeView {...transformContentUnavailableViewProps(props)}/>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/ContentUnavailableView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAoBrE,MAAM,gCAAgC,GACpC,iBAAiB,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;AAExD;;;GAGG;AACH,SAAS,oCAAoC,CAC3C,KAAkC;IAElC,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAC1C,OAAO;QACL,SAAS;QACT,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACvE,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAAkC;IACvE,OAAO,CAAC,gCAAgC,CAAC,IAAI,oCAAoC,CAAC,KAAK,CAAC,CAAC,EAAG,CAAC;AAC/F,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { createViewModifierEventListener } from '../modifiers/utils';\nimport { type CommonViewModifierProps } from '../types';\n\nexport interface ContentUnavailableViewProps extends CommonViewModifierProps {\n /**\n * A short title that describes why the content is not available.\n */\n title?: string;\n\n /**\n * SF Symbol indicating why the content is not available.\n */\n systemImage?: string;\n\n /**\n * Description of why the content is not available.\n */\n description?: string;\n}\n\nconst ContentUnavailableViewNativeView: React.ComponentType<ContentUnavailableViewProps> =\n requireNativeView('ExpoUI', 'ContentUnavailableView');\n\n/**\n * Displays a native Swift UI ContentUnavailableView.\n * @platform ios 17.0+\n */\nfunction transformContentUnavailableViewProps(\n props: ContentUnavailableViewProps\n): ContentUnavailableViewProps {\n const { modifiers, ...restProps } = props;\n return {\n modifiers,\n ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),\n ...restProps,\n };\n}\n\nexport function ContentUnavailableView(props: ContentUnavailableViewProps) {\n return <ContentUnavailableViewNativeView {...transformContentUnavailableViewProps(props)} />;\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import { type ButtonProps } from '../Button';
|
|
3
|
+
/**
|
|
4
|
+
* Props of the `Submenu` component.
|
|
5
|
+
*/
|
|
6
|
+
export type SubmenuProps = {
|
|
7
|
+
/**
|
|
8
|
+
* 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.
|
|
9
|
+
*/
|
|
10
|
+
button: ReactElement<ButtonProps>;
|
|
11
|
+
/**
|
|
12
|
+
* Children of the submenu. Only `Button`, `Switch`, `Picker` and `Submenu` elements should be used.
|
|
13
|
+
*/
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The `Submenu` component is used to create a nested context menu. Submenus can be infinitely nested.
|
|
18
|
+
* Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple titled sections.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Submenu(props: SubmenuProps): import("react").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=Submenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Submenu.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/ContextMenu/Submenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAClC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAE1C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `Submenu` component is used to create a nested context menu. Submenus can be infinitely nested.
|
|
3
|
+
* Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple titled sections.
|
|
4
|
+
*/
|
|
5
|
+
export function Submenu(props) {
|
|
6
|
+
return <></>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=Submenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Submenu.js","sourceRoot":"","sources":["../../../src/swift-ui/ContextMenu/Submenu.tsx"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,KAAmB;IACzC,OAAO,EAAE,GAAG,CAAC;AACf,CAAC","sourcesContent":["import { type ReactElement, type ReactNode } from 'react';\n\nimport { type ButtonProps } from '../Button';\n\n/**\n * Props of the `Submenu` component.\n */\nexport type SubmenuProps = {\n /**\n * 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.\n */\n button: ReactElement<ButtonProps>;\n /**\n * Children of the submenu. Only `Button`, `Switch`, `Picker` and `Submenu` elements should be used.\n */\n children: ReactNode;\n};\n\n/**\n * The `Submenu` component is used to create a nested context menu. Submenus can be infinitely nested.\n * Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple titled sections.\n */\nexport function Submenu(props: SubmenuProps) {\n return <></>;\n}\n"]}
|
|
@@ -1,79 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { ButtonProps } from '../Button';
|
|
5
|
-
import { PickerProps } from '../Picker';
|
|
6
|
-
import { SwitchProps } from '../Switch';
|
|
7
|
-
type SubmenuElement = ReactElement<ButtonProps> | ReactElement<SwitchProps> | ReactElement<PickerProps> | ReactElement<SubmenuProps>;
|
|
8
|
-
export type ContextMenuContentProps = {
|
|
9
|
-
children: SubmenuElement | SubmenuElement[];
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
export type EventHandlers = Record<string, Record<string, (event: NativeSyntheticEvent<any>) => void>>;
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*/
|
|
18
|
-
export type ContextMenuElementBase = {
|
|
19
|
-
contextMenuElementID: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Activation method of the context menu.
|
|
23
|
-
* - `singlePress`: The context menu is opened with a single tap. Does not isolate the content.
|
|
24
|
-
* - `longPress`: The context menu is opened with a long press. On iOS additionally Highlights the content by blurring the background.
|
|
25
|
-
*/
|
|
26
|
-
export type ActivationMethod = 'singlePress' | 'longPress';
|
|
27
|
-
/**
|
|
28
|
-
* Props of the `ContextMenu` component.
|
|
29
|
-
*/
|
|
30
|
-
export type ContextMenuProps = {
|
|
31
|
-
/**
|
|
32
|
-
* Determines how the context menu will be activated.
|
|
33
|
-
*/
|
|
34
|
-
activationMethod?: ActivationMethod;
|
|
35
|
-
/**
|
|
36
|
-
* The contents of the submenu are used as an anchor for the context menu.
|
|
37
|
-
* The children will be wrapped in a pressable element, which triggers opening of the context menu.
|
|
38
|
-
*/
|
|
39
|
-
children: ReactNode;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Props of the `Submenu` component.
|
|
43
|
-
*/
|
|
44
|
-
export type SubmenuProps = {
|
|
45
|
-
/**
|
|
46
|
-
* 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.
|
|
47
|
-
*/
|
|
48
|
-
button: ReactElement<ButtonProps>;
|
|
49
|
-
/**
|
|
50
|
-
* Children of the submenu. Only `Button`, `Switch`, `Picker` and `Submenu` elements should be used.
|
|
51
|
-
*/
|
|
52
|
-
children: ReactNode;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* @hidden
|
|
56
|
-
*/
|
|
57
|
-
export type NativeMenuProps = ContextMenuProps & {
|
|
58
|
-
elements: MenuElement[];
|
|
59
|
-
onContextMenuButtonPressed: (event: NativeSyntheticEvent<{
|
|
60
|
-
contextMenuElementID: string;
|
|
61
|
-
}>) => void;
|
|
62
|
-
onContextMenuSwitchValueChanged: (event: NativeSyntheticEvent<{
|
|
63
|
-
contextMenuElementID: string;
|
|
64
|
-
value: boolean;
|
|
65
|
-
}>) => void;
|
|
66
|
-
onContextMenuPickerOptionSelected: (event: NativeSyntheticEvent<{
|
|
67
|
-
index: number;
|
|
68
|
-
label: string;
|
|
69
|
-
contextMenuElementID: string;
|
|
70
|
-
}>) => void;
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* The `Submenu` component is used to create a nested context menu. Submenus can be infinitely nested.
|
|
74
|
-
* Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple titled sections.
|
|
75
|
-
*/
|
|
76
|
-
export declare function Submenu(props: SubmenuProps): import("react").JSX.Element;
|
|
1
|
+
import { type ContextMenuProps } from './types';
|
|
2
|
+
export * from './Submenu';
|
|
3
|
+
export { type ActivationMethod, type ContextMenuProps, type ContextMenuContentProps, } from './types';
|
|
77
4
|
/**
|
|
78
5
|
* Items visible inside the context menu. Pass input components as immidiate children of the tag.
|
|
79
6
|
* `Button`, `Switch` and `Submenu` components are supported on both Android and iOS.
|
|
@@ -102,14 +29,8 @@ export declare function Preview(props: {
|
|
|
102
29
|
* `<ContextMenu>` component without a host view.
|
|
103
30
|
* You should use this with a `Host` component in ancestor.
|
|
104
31
|
*/
|
|
105
|
-
declare function ContextMenuPrimitive(props: ContextMenuProps): import("react").JSX.Element;
|
|
106
|
-
declare namespace ContextMenuPrimitive {
|
|
107
|
-
var Trigger: typeof import(".").Trigger;
|
|
108
|
-
var Preview: typeof import(".").Preview;
|
|
109
|
-
var Items: typeof import(".").Items;
|
|
110
|
-
}
|
|
111
32
|
/**
|
|
112
|
-
* `
|
|
33
|
+
* `ContextMenu` allows you to create a context menu, which can be used to provide additional options to the user.
|
|
113
34
|
*
|
|
114
35
|
* There are some platform-specific differences in the behavior of the context menu:
|
|
115
36
|
* - 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.
|
|
@@ -117,13 +38,11 @@ declare namespace ContextMenuPrimitive {
|
|
|
117
38
|
* - 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.
|
|
118
39
|
* - Android does not support showing a `Picker` element in the context menu.
|
|
119
40
|
*/
|
|
120
|
-
declare function ContextMenu(props: ContextMenuProps
|
|
121
|
-
style?: StyleProp<ViewStyle>;
|
|
122
|
-
}): import("react").JSX.Element;
|
|
41
|
+
declare function ContextMenu(props: ContextMenuProps): import("react").JSX.Element;
|
|
123
42
|
declare namespace ContextMenu {
|
|
124
43
|
var Trigger: typeof import(".").Trigger;
|
|
125
44
|
var Preview: typeof import(".").Preview;
|
|
126
45
|
var Items: typeof import(".").Items;
|
|
127
46
|
}
|
|
128
|
-
export {
|
|
47
|
+
export { ContextMenu };
|
|
129
48
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/ContextMenu/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/ContextMenu/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAsB,MAAM,SAAS,CAAC;AAGpE,cAAc,WAAW,CAAC;AAC1B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,GAC7B,MAAM,SAAS,CAAC;AAkCjB;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAEzD;yBAFe,KAAK;;;AAKrB;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAE3D;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAE3D;AAED;;;GAGG;AAEH;;;;;;;;GAQG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BA2B3C;kBA3BQ,WAAW;;;;;AAiCpB,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { Children, useMemo } from 'react';
|
|
3
|
-
import { Host } from '../Host';
|
|
4
3
|
import { transformChildrenToElementArray } from './utils';
|
|
4
|
+
export * from './Submenu';
|
|
5
5
|
const MenuNativeView = requireNativeView('ExpoUI', 'ContextMenu');
|
|
6
6
|
const MenuNativeTriggerView = requireNativeView('ExpoUI', 'ContextMenuActivationElement');
|
|
7
7
|
const MenuNativePreviewView = requireNativeView('ExpoUI', 'ContextMenuPreview');
|
|
8
|
-
/**
|
|
9
|
-
* The `Submenu` component is used to create a nested context menu. Submenus can be infinitely nested.
|
|
10
|
-
* Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple titled sections.
|
|
11
|
-
*/
|
|
12
|
-
export function Submenu(props) {
|
|
13
|
-
return <></>;
|
|
14
|
-
}
|
|
15
8
|
/**
|
|
16
9
|
* Items visible inside the context menu. Pass input components as immidiate children of the tag.
|
|
17
10
|
* `Button`, `Switch` and `Submenu` components are supported on both Android and iOS.
|
|
@@ -38,18 +31,8 @@ export function Preview(props) {
|
|
|
38
31
|
* `<ContextMenu>` component without a host view.
|
|
39
32
|
* You should use this with a `Host` component in ancestor.
|
|
40
33
|
*/
|
|
41
|
-
function ContextMenuPrimitive(props) {
|
|
42
|
-
const eventHandlersMap = {};
|
|
43
|
-
const initialChildren = Children.map(props.children, (c) => c.type.tag === Items.tag ? c.props.children : null);
|
|
44
|
-
const processedElements = useMemo(() => transformChildrenToElementArray(initialChildren, eventHandlersMap), [initialChildren]);
|
|
45
|
-
const createEventHandler = (handlerType) => (event) => {
|
|
46
|
-
const handler = eventHandlersMap[event.nativeEvent.contextMenuElementID]?.[handlerType];
|
|
47
|
-
handler?.(event);
|
|
48
|
-
};
|
|
49
|
-
return (<MenuNativeView elements={processedElements} onContextMenuButtonPressed={createEventHandler('onPress')} onContextMenuSwitchValueChanged={createEventHandler('onValueChange')} onContextMenuPickerOptionSelected={createEventHandler('onOptionSelected')} {...props}/>);
|
|
50
|
-
}
|
|
51
34
|
/**
|
|
52
|
-
* `
|
|
35
|
+
* `ContextMenu` allows you to create a context menu, which can be used to provide additional options to the user.
|
|
53
36
|
*
|
|
54
37
|
* There are some platform-specific differences in the behavior of the context menu:
|
|
55
38
|
* - 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.
|
|
@@ -58,15 +41,17 @@ function ContextMenuPrimitive(props) {
|
|
|
58
41
|
* - Android does not support showing a `Picker` element in the context menu.
|
|
59
42
|
*/
|
|
60
43
|
function ContextMenu(props) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
44
|
+
const eventHandlersMap = {};
|
|
45
|
+
const initialChildren = Children.map(props.children, (c) => c.type.tag === Items.tag ? c.props.children : null);
|
|
46
|
+
const processedElements = useMemo(() => transformChildrenToElementArray(initialChildren, eventHandlersMap), [initialChildren]);
|
|
47
|
+
const createEventHandler = (handlerType) => (event) => {
|
|
48
|
+
const handler = eventHandlersMap[event.nativeEvent.contextMenuElementID]?.[handlerType];
|
|
49
|
+
handler?.(event);
|
|
50
|
+
};
|
|
51
|
+
return (<MenuNativeView elements={processedElements} onContextMenuButtonPressed={createEventHandler('onPress')} onContextMenuSwitchValueChanged={createEventHandler('onValueChange')} onContextMenuPickerOptionSelected={createEventHandler('onOptionSelected')} {...props}/>);
|
|
64
52
|
}
|
|
65
|
-
ContextMenuPrimitive.Trigger = Trigger;
|
|
66
|
-
ContextMenuPrimitive.Preview = Preview;
|
|
67
|
-
ContextMenuPrimitive.Items = Items;
|
|
68
53
|
ContextMenu.Trigger = Trigger;
|
|
69
54
|
ContextMenu.Preview = Preview;
|
|
70
55
|
ContextMenu.Items = Items;
|
|
71
|
-
export {
|
|
56
|
+
export { ContextMenu };
|
|
72
57
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/ContextMenu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAiB,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/ContextMenu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAiB,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAIzD,OAAO,EAAe,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAEvE,cAAc,WAAW,CAAC;AAO1B,MAAM,cAAc,GAAmC,iBAAiB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAElG,MAAM,qBAAqB,GAA0B,iBAAiB,CACpE,QAAQ,EACR,8BAA8B,CAC/B,CAAC;AAEF,MAAM,qBAAqB,GAA0B,iBAAiB,CACpE,QAAQ,EACR,oBAAoB,CACrB,CAAC;AAsBF;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,KAAoC;IACxD,OAAO,EAAE,GAAG,CAAC;AACf,CAAC;AACD,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC;AAEpB;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,KAAoC;IAC1D,OAAO,CAAC,qBAAqB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC9C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,KAAoC;IAC1D,OAAO,CAAC,qBAAqB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC9C,CAAC;AAED;;;GAGG;AAEH;;;;;;;;GAQG;AACH,SAAS,WAAW,CAAC,KAAuB;IAC1C,MAAM,gBAAgB,GAAkB,EAAE,CAAC;IAC3C,MAAM,eAAe,GAAG,QAAQ,CAAC,GAAG,CAClC,KAAK,CAAC,QAAe,EACrB,CAAC,CAAkE,EAAE,EAAE,CACrE,CAAC,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CACrD,CAAC;IACF,MAAM,iBAAiB,GAAG,OAAO,CAC/B,GAAG,EAAE,CAAC,+BAA+B,CAAC,eAAe,EAAE,gBAAgB,CAAC,EACxE,CAAC,eAAe,CAAC,CAClB,CAAC;IAEF,MAAM,kBAAkB,GACtB,CAAC,WAAmB,EAAE,EAAE,CAAC,CAAC,KAA6D,EAAE,EAAE;QACzF,MAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,oBAAoB,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;QACxF,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC;IAEJ,OAAO,CACL,CAAC,cAAc,CACb,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAC5B,0BAA0B,CAAC,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAC1D,+BAA+B,CAAC,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC,CACrE,iCAAiC,CAAC,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC,CAC1E,IAAI,KAAK,CAAC,EACV,CACH,CAAC;AACJ,CAAC;AAED,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC;AAC9B,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC;AAC9B,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport { ComponentType, Children, useMemo } from 'react';\nimport { NativeSyntheticEvent } from 'react-native';\n\nimport { type ContextMenuProps, type EventHandlers } from './types';\nimport { MenuElement, transformChildrenToElementArray } from './utils';\n\nexport * from './Submenu';\nexport {\n type ActivationMethod,\n type ContextMenuProps,\n type ContextMenuContentProps,\n} from './types';\n\nconst MenuNativeView: ComponentType<NativeMenuProps> = requireNativeView('ExpoUI', 'ContextMenu');\n\nconst MenuNativeTriggerView: ComponentType<object> = requireNativeView(\n 'ExpoUI',\n 'ContextMenuActivationElement'\n);\n\nconst MenuNativePreviewView: ComponentType<object> = requireNativeView(\n 'ExpoUI',\n 'ContextMenuPreview'\n);\n\ntype NativeMenuProps = ContextMenuProps & {\n elements: MenuElement[];\n onContextMenuButtonPressed: (\n event: NativeSyntheticEvent<{ contextMenuElementID: string }>\n ) => void;\n onContextMenuSwitchValueChanged: (\n event: NativeSyntheticEvent<{\n contextMenuElementID: string;\n value: boolean;\n }>\n ) => void;\n onContextMenuPickerOptionSelected: (\n event: NativeSyntheticEvent<{\n index: number;\n label: string;\n contextMenuElementID: string;\n }>\n ) => void;\n};\n\n/**\n * Items visible inside the context menu. Pass input components as immidiate children of the tag.\n * `Button`, `Switch` and `Submenu` components are supported on both Android and iOS.\n * The `Picker` component is supported only on iOS. Remember to use components from the `@expo/ui` library.\n */\nexport function Items(props: { children: React.ReactNode }) {\n return <></>;\n}\nItems.tag = 'Items';\n\n/**\n * The component visible all the time that triggers the menu when tapped or long-pressed.\n */\nexport function Trigger(props: { children: React.ReactNode }) {\n return <MenuNativeTriggerView {...props} />;\n}\n\n/**\n * The component visible above the menu when it is opened.\n * @platform ios\n */\nexport function Preview(props: { children: React.ReactNode }) {\n return <MenuNativePreviewView {...props} />;\n}\n\n/**\n * `<ContextMenu>` component without a host view.\n * You should use this with a `Host` component in ancestor.\n */\n\n/**\n * `ContextMenu` allows you to create a context menu, which can be used to provide additional options to the user.\n *\n * There are some platform-specific differences in the behavior of the context menu:\n * - 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.\n * - 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.\n * - 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.\n * - Android does not support showing a `Picker` element in the context menu.\n */\nfunction ContextMenu(props: ContextMenuProps) {\n const eventHandlersMap: EventHandlers = {};\n const initialChildren = Children.map(\n props.children as any,\n (c: { type: { tag: string }; props: { children: React.ReactNode } }) =>\n c.type.tag === Items.tag ? c.props.children : null\n );\n const processedElements = useMemo(\n () => transformChildrenToElementArray(initialChildren, eventHandlersMap),\n [initialChildren]\n );\n\n const createEventHandler =\n (handlerType: string) => (event: NativeSyntheticEvent<{ contextMenuElementID: string }>) => {\n const handler = eventHandlersMap[event.nativeEvent.contextMenuElementID]?.[handlerType];\n handler?.(event);\n };\n\n return (\n <MenuNativeView\n elements={processedElements}\n onContextMenuButtonPressed={createEventHandler('onPress')}\n onContextMenuSwitchValueChanged={createEventHandler('onValueChange')}\n onContextMenuPickerOptionSelected={createEventHandler('onOptionSelected')}\n {...props}\n />\n );\n}\n\nContextMenu.Trigger = Trigger;\nContextMenu.Preview = Preview;\nContextMenu.Items = Items;\n\nexport { ContextMenu };\n"]}
|