@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
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,20 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.2.0-alpha.2 — 2025-08-16
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 0.2.0-alpha.1 — 2025-08-15
|
|
18
|
+
|
|
19
|
+
### 🛠 Breaking changes
|
|
20
|
+
|
|
21
|
+
- Merged `swift-ui-primitives` to `swift-ui` and now every component should explicitly wrap with a `<Host>`. ([#38866](https://github.com/expo/expo/pull/38866) by [@kudo](https://github.com/kudo))
|
|
22
|
+
|
|
23
|
+
### 🎉 New features
|
|
24
|
+
|
|
25
|
+
- [Android] Add compose modifier support. ([#38630](https://github.com/expo/expo/pull/38630) by [@aleqsio](https://github.com/aleqsio))
|
|
26
|
+
|
|
13
27
|
## 0.2.0-alpha.0 — 2025-08-13
|
|
14
28
|
|
|
15
29
|
### 🎉 New features
|
|
@@ -27,6 +41,7 @@
|
|
|
27
41
|
- [iOS] Add `testID` property to views. ([#37919](https://github.com/expo/expo/pull/37919) by [@mateoguzmana](https://github.com/mateoguzmana))
|
|
28
42
|
- Add `SecureField` component. ([#37642](https://github.com/expo/expo/pull/37642) by [@aleqsio](https://github.com/aleqsio))
|
|
29
43
|
- [Android] Add `AlertDialog` component. ([#38266](https://github.com/expo/expo/pull/38266) by [@mateoguzmana](https://github.com/mateoguzmana))
|
|
44
|
+
- Added SwiftUI view modifiers support. ([#38543](https://github.com/expo/expo/pull/38543) by [@kudo](https://github.com/kudo))
|
|
30
45
|
|
|
31
46
|
### 🐛 Bug fixes
|
|
32
47
|
|
package/android/build.gradle
CHANGED
|
@@ -12,13 +12,13 @@ apply plugin: 'expo-module-gradle-plugin'
|
|
|
12
12
|
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
|
|
13
13
|
|
|
14
14
|
group = 'expo.modules.ui'
|
|
15
|
-
version = '0.2.0-alpha.
|
|
15
|
+
version = '0.2.0-alpha.2'
|
|
16
16
|
|
|
17
17
|
android {
|
|
18
18
|
namespace "expo.modules.ui"
|
|
19
19
|
defaultConfig {
|
|
20
20
|
versionCode 1
|
|
21
|
-
versionName "0.2.0-alpha.
|
|
21
|
+
versionName "0.2.0-alpha.2"
|
|
22
22
|
}
|
|
23
23
|
buildFeatures {
|
|
24
24
|
compose true
|
|
@@ -22,7 +22,8 @@ data class AlertDialogProps(
|
|
|
22
22
|
val text: MutableState<String?> = mutableStateOf(null),
|
|
23
23
|
val confirmButtonText: MutableState<String?> = mutableStateOf(null),
|
|
24
24
|
val dismissButtonText: MutableState<String?> = mutableStateOf(null),
|
|
25
|
-
val visible: MutableState<Boolean> = mutableStateOf(false)
|
|
25
|
+
val visible: MutableState<Boolean> = mutableStateOf(false),
|
|
26
|
+
val modifiers: MutableState<List<ExpoModifier>> = mutableStateOf(emptyList())
|
|
26
27
|
) : ComposeProps
|
|
27
28
|
|
|
28
29
|
class AlertDialogView(context: Context, appContext: AppContext) :
|
|
@@ -44,6 +45,7 @@ class AlertDialogView(context: Context, appContext: AppContext) :
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
AlertDialog(
|
|
48
|
+
modifier = Modifier.fromExpoModifiers(props.modifiers.value),
|
|
47
49
|
confirmButton = {
|
|
48
50
|
confirmButtonText?.let {
|
|
49
51
|
TextButton(onClick = { onConfirmPressed.invoke(AlertDialogButtonPressedEvent()) }) {
|
|
@@ -94,7 +94,7 @@ data class LayoutProps(
|
|
|
94
94
|
val verticalArrangement: MutableState<VerticalArrangement> = mutableStateOf(VerticalArrangement.TOP),
|
|
95
95
|
val horizontalAlignment: MutableState<HorizontalAlignment> = mutableStateOf(HorizontalAlignment.START),
|
|
96
96
|
val verticalAlignment: MutableState<VerticalAlignment> = mutableStateOf(VerticalAlignment.TOP),
|
|
97
|
-
val
|
|
97
|
+
val modifiers: MutableState<List<ExpoModifier>> = mutableStateOf(emptyList())
|
|
98
98
|
) : ComposeProps
|
|
99
99
|
|
|
100
100
|
class RowView(context: Context, appContext: AppContext) : ExpoComposeView<LayoutProps>(context, appContext) {
|
|
@@ -105,7 +105,7 @@ class RowView(context: Context, appContext: AppContext) : ExpoComposeView<Layout
|
|
|
105
105
|
Row(
|
|
106
106
|
horizontalArrangement = props.horizontalArrangement.value.toComposeArrangement(),
|
|
107
107
|
verticalAlignment = props.verticalAlignment.value.toComposeAlignment(),
|
|
108
|
-
modifier = modifier.then(props.
|
|
108
|
+
modifier = modifier.then(Modifier.fromExpoModifiers(props.modifiers.value))
|
|
109
109
|
) {
|
|
110
110
|
Children()
|
|
111
111
|
}
|
|
@@ -120,7 +120,7 @@ class ColumnView(context: Context, appContext: AppContext) : ExpoComposeView<Lay
|
|
|
120
120
|
Column(
|
|
121
121
|
verticalArrangement = props.verticalArrangement.value.toComposeArrangement(),
|
|
122
122
|
horizontalAlignment = props.horizontalAlignment.value.toComposeAlignment(),
|
|
123
|
-
modifier = modifier.then(props.
|
|
123
|
+
modifier = modifier.then(Modifier.fromExpoModifiers(props.modifiers.value))
|
|
124
124
|
) {
|
|
125
125
|
Children()
|
|
126
126
|
}
|
|
@@ -162,7 +162,7 @@ data class TextProps(
|
|
|
162
162
|
val color: MutableState<AndroidColor?> = mutableStateOf(null),
|
|
163
163
|
val fontSize: MutableState<Float> = mutableFloatStateOf(16f),
|
|
164
164
|
val fontWeight: MutableState<TextFontWeight> = mutableStateOf(TextFontWeight.NORMAL),
|
|
165
|
-
val
|
|
165
|
+
val modifiers: MutableState<List<ExpoModifier>> = mutableStateOf(emptyList())
|
|
166
166
|
) : ComposeProps
|
|
167
167
|
|
|
168
168
|
class TextView(context: Context, appContext: AppContext) : ExpoComposeView<TextProps>(context, appContext) {
|
|
@@ -172,12 +172,12 @@ class TextView(context: Context, appContext: AppContext) : ExpoComposeView<TextP
|
|
|
172
172
|
override fun Content(modifier: Modifier) {
|
|
173
173
|
Text(
|
|
174
174
|
text = props.text.value,
|
|
175
|
+
modifier = modifier.then(Modifier.fromExpoModifiers(props.modifiers.value)),
|
|
175
176
|
color = colorToComposeColor(props.color.value),
|
|
176
177
|
style = TextStyle(
|
|
177
178
|
fontSize = props.fontSize.value.sp,
|
|
178
179
|
fontWeight = props.fontWeight.value.toComposeFontWeight()
|
|
179
|
-
)
|
|
180
|
-
modifier = modifier.then(props.modifier.value)
|
|
180
|
+
)
|
|
181
181
|
)
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -61,7 +61,8 @@ data class DateTimePickerProps(
|
|
|
61
61
|
val displayedComponents: MutableState<DisplayedComponents> = mutableStateOf(DisplayedComponents.DATE),
|
|
62
62
|
val showVariantToggle: MutableState<Boolean> = mutableStateOf(true),
|
|
63
63
|
val is24Hour: MutableState<Boolean> = mutableStateOf(true),
|
|
64
|
-
val color: MutableState<AndroidColor?> = mutableStateOf(null)
|
|
64
|
+
val color: MutableState<AndroidColor?> = mutableStateOf(null),
|
|
65
|
+
val modifiers: MutableState<List<ExpoModifier>> = mutableStateOf(emptyList())
|
|
65
66
|
) : ComposeProps
|
|
66
67
|
|
|
67
68
|
@SuppressLint("ViewConstructor")
|
|
@@ -74,11 +75,11 @@ class DateTimePickerView(context: Context, appContext: AppContext) :
|
|
|
74
75
|
@Composable
|
|
75
76
|
override fun Content(modifier: Modifier) {
|
|
76
77
|
if (props.displayedComponents.value == DisplayedComponents.HOUR_AND_MINUTE) {
|
|
77
|
-
ExpoTimePicker(props = props) {
|
|
78
|
+
ExpoTimePicker(props = props, modifier = Modifier.fromExpoModifiers(props.modifiers.value)) {
|
|
78
79
|
onDateSelected(it)
|
|
79
80
|
}
|
|
80
81
|
} else {
|
|
81
|
-
ExpoDatePicker(props = props) {
|
|
82
|
+
ExpoDatePicker(props = props, modifier = Modifier.fromExpoModifiers(props.modifiers.value)) {
|
|
82
83
|
onDateSelected(it)
|
|
83
84
|
}
|
|
84
85
|
}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
package expo.modules.ui
|
|
2
2
|
|
|
3
|
+
import android.graphics.Color
|
|
4
|
+
import androidx.compose.foundation.BorderStroke
|
|
5
|
+
import androidx.compose.foundation.background
|
|
6
|
+
import androidx.compose.foundation.border
|
|
7
|
+
import androidx.compose.foundation.clickable
|
|
8
|
+
import androidx.compose.foundation.layout.fillMaxSize
|
|
9
|
+
import androidx.compose.foundation.layout.offset
|
|
10
|
+
import androidx.compose.foundation.layout.padding
|
|
11
|
+
import androidx.compose.foundation.layout.size
|
|
12
|
+
import androidx.compose.ui.Modifier
|
|
13
|
+
import androidx.compose.ui.draw.alpha
|
|
14
|
+
import androidx.compose.ui.draw.blur
|
|
15
|
+
import androidx.compose.ui.draw.rotate
|
|
16
|
+
import androidx.compose.ui.draw.shadow
|
|
17
|
+
import androidx.compose.ui.unit.Dp
|
|
18
|
+
import androidx.compose.ui.unit.dp
|
|
19
|
+
import androidx.compose.ui.zIndex
|
|
20
|
+
import expo.modules.kotlin.jni.JavaScriptFunction
|
|
3
21
|
import expo.modules.kotlin.modules.Module
|
|
4
22
|
import expo.modules.kotlin.modules.ModuleDefinition
|
|
5
23
|
import expo.modules.ui.button.Button
|
|
@@ -9,6 +27,18 @@ class ExpoUIModule : Module() {
|
|
|
9
27
|
override fun definition() = ModuleDefinition {
|
|
10
28
|
Name("ExpoUI")
|
|
11
29
|
|
|
30
|
+
Class("ExpoModifier", ExpoModifier::class) {
|
|
31
|
+
Constructor {
|
|
32
|
+
// Create an instance of ExpoModifier with a null reference
|
|
33
|
+
ExpoModifier(null)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
Function("toString") { ref: ExpoModifier ->
|
|
37
|
+
// Return a string representation of the modifier
|
|
38
|
+
"ExpoModifier(ref=${ref.ref})"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
12
42
|
// Defines a single view for now – a single choice segmented control
|
|
13
43
|
View(PickerView::class) {
|
|
14
44
|
Events("onOptionSelected")
|
|
@@ -66,5 +96,63 @@ class ExpoUIModule : Module() {
|
|
|
66
96
|
"onConfirmPressed"
|
|
67
97
|
)
|
|
68
98
|
}
|
|
99
|
+
|
|
100
|
+
Function("padding") { all: Int ->
|
|
101
|
+
return@Function ExpoModifier(Modifier.padding(Dp(all.toFloat())))
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
Function("size") { width: Int, height: Int ->
|
|
105
|
+
return@Function ExpoModifier(Modifier.size(width.dp, height.dp))
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
Function("fillMaxSize") {
|
|
109
|
+
return@Function ExpoModifier(Modifier.fillMaxSize())
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
Function("offset") { x: Int, y: Int ->
|
|
113
|
+
return@Function ExpoModifier(Modifier.offset(x.dp, y.dp))
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
Function("background") { color: Color ->
|
|
117
|
+
return@Function ExpoModifier(Modifier.background(color.compose))
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
Function("border") { borderWidth: Int, borderColor: Color ->
|
|
121
|
+
return@Function ExpoModifier(Modifier.border(BorderStroke(borderWidth.dp, borderColor.compose)))
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
Function("shadow") { elevation: Int ->
|
|
125
|
+
return@Function ExpoModifier(Modifier.shadow(elevation.dp)) // TODO: Support more options
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
Function("alpha") { alpha: Float ->
|
|
129
|
+
return@Function ExpoModifier(Modifier.alpha(alpha))
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
Function("blur") { radius: Int ->
|
|
133
|
+
return@Function ExpoModifier(Modifier.blur(radius.dp))
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
Function("clickable") { callback: JavaScriptFunction<Any?> ->
|
|
137
|
+
return@Function ExpoModifier(
|
|
138
|
+
Modifier.clickable(
|
|
139
|
+
onClick = {
|
|
140
|
+
appContext.executeOnJavaScriptThread {
|
|
141
|
+
callback.invoke()
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
Function("rotate") { degrees: Float ->
|
|
149
|
+
return@Function ExpoModifier(Modifier.rotate(degrees))
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
Function("zIndex") { index: Float ->
|
|
153
|
+
return@Function ExpoModifier(Modifier.zIndex(index))
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// TODO: Consider implementing semantics, layoutId, clip, navigationBarsPadding, systemBarsPadding
|
|
69
157
|
}
|
|
70
158
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
package expo.modules.ui
|
|
2
|
+
|
|
3
|
+
import androidx.compose.ui.Modifier
|
|
4
|
+
import expo.modules.kotlin.sharedobjects.SharedRef
|
|
5
|
+
|
|
6
|
+
class ExpoModifier(ref: Modifier?) : SharedRef<Modifier?>(ref)
|
|
7
|
+
|
|
8
|
+
fun Modifier.fromExpoModifiers(
|
|
9
|
+
modifiers: List<ExpoModifier>
|
|
10
|
+
): Modifier {
|
|
11
|
+
return modifiers.fold(this) { acc, modifier ->
|
|
12
|
+
val ref = modifier.ref
|
|
13
|
+
ref?.let { acc.then(it) } ?: acc
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -72,7 +72,9 @@ data class PickerProps(
|
|
|
72
72
|
val options: MutableState<Array<String>> = mutableStateOf(emptyArray()),
|
|
73
73
|
val selectedIndex: MutableState<Int?> = mutableStateOf(null),
|
|
74
74
|
val elementColors: MutableState<PickerColors> = mutableStateOf(PickerColors()),
|
|
75
|
-
val variant: MutableState<String> = mutableStateOf("segmented")
|
|
75
|
+
val variant: MutableState<String> = mutableStateOf("segmented"),
|
|
76
|
+
val modifiers: MutableState<List<ExpoModifier>> = mutableStateOf(emptyList()),
|
|
77
|
+
val buttonModifiers: MutableState<List<ExpoModifier>> = mutableStateOf(emptyList())
|
|
76
78
|
) : ComposeProps
|
|
77
79
|
|
|
78
80
|
class PickerView(context: Context, appContext: AppContext) :
|
|
@@ -91,7 +93,9 @@ class PickerView(context: Context, appContext: AppContext) :
|
|
|
91
93
|
fun SegmentedComposable() {
|
|
92
94
|
DynamicTheme {
|
|
93
95
|
AutoSizingComposable(shadowNodeProxy) {
|
|
94
|
-
SingleChoiceSegmentedButtonRow
|
|
96
|
+
SingleChoiceSegmentedButtonRow(
|
|
97
|
+
modifier = Modifier.fromExpoModifiers(props.modifiers.value)
|
|
98
|
+
) {
|
|
95
99
|
options.forEachIndexed { index, label ->
|
|
96
100
|
SegmentedButton(
|
|
97
101
|
shape = SegmentedButtonDefaults.itemShape(
|
|
@@ -101,6 +105,7 @@ class PickerView(context: Context, appContext: AppContext) :
|
|
|
101
105
|
onClick = {
|
|
102
106
|
onOptionSelected(mapOf("index" to index, "label" to label))
|
|
103
107
|
},
|
|
108
|
+
modifier = Modifier.fromExpoModifiers(props.buttonModifiers.value),
|
|
104
109
|
selected = index == selectedIndex,
|
|
105
110
|
label = { Text(label) },
|
|
106
111
|
colors = SegmentedButtonDefaults.colors(
|
|
@@ -33,7 +33,8 @@ data class ProgressProps(
|
|
|
33
33
|
val variant: MutableState<ProgressVariant> = mutableStateOf(ProgressVariant.CIRCULAR),
|
|
34
34
|
val progress: MutableState<Float?> = mutableStateOf(null),
|
|
35
35
|
val color: MutableState<Color?> = mutableStateOf(null),
|
|
36
|
-
val elementColors: MutableState<ProgressColors> = mutableStateOf(ProgressColors())
|
|
36
|
+
val elementColors: MutableState<ProgressColors> = mutableStateOf(ProgressColors()),
|
|
37
|
+
val modifiers: MutableState<List<ExpoModifier>> = mutableStateOf(emptyList())
|
|
37
38
|
) : ComposeProps
|
|
38
39
|
|
|
39
40
|
class ProgressView(context: Context, appContext: AppContext) :
|
|
@@ -57,7 +58,8 @@ class ProgressView(context: Context, appContext: AppContext) :
|
|
|
57
58
|
progress = { progress },
|
|
58
59
|
color = composeColor,
|
|
59
60
|
trackColor = trackColor,
|
|
60
|
-
drawStopIndicator = {}
|
|
61
|
+
drawStopIndicator = {},
|
|
62
|
+
modifier = Modifier.fromExpoModifiers(props.modifiers.value)
|
|
61
63
|
)
|
|
62
64
|
} else {
|
|
63
65
|
LinearProgressIndicator(color = composeColor, trackColor = trackColor)
|
|
@@ -70,12 +72,14 @@ class ProgressView(context: Context, appContext: AppContext) :
|
|
|
70
72
|
CircularProgressIndicator(
|
|
71
73
|
progress = { progress },
|
|
72
74
|
color = composeColor,
|
|
73
|
-
trackColor = colors.trackColor.composeOrNull ?: ProgressIndicatorDefaults.circularDeterminateTrackColor
|
|
75
|
+
trackColor = colors.trackColor.composeOrNull ?: ProgressIndicatorDefaults.circularDeterminateTrackColor,
|
|
76
|
+
modifier = Modifier.fromExpoModifiers(props.modifiers.value)
|
|
74
77
|
)
|
|
75
78
|
} else {
|
|
76
79
|
CircularProgressIndicator(
|
|
77
80
|
color = composeColor,
|
|
78
|
-
trackColor = colors.trackColor.composeOrNull ?: ProgressIndicatorDefaults.circularIndeterminateTrackColor
|
|
81
|
+
trackColor = colors.trackColor.composeOrNull ?: ProgressIndicatorDefaults.circularIndeterminateTrackColor,
|
|
82
|
+
modifier = Modifier.fromExpoModifiers(props.modifiers.value)
|
|
79
83
|
)
|
|
80
84
|
}
|
|
81
85
|
}
|
|
@@ -44,7 +44,8 @@ data class ShapeProps(
|
|
|
44
44
|
val innerRadius: MutableState<Float> = mutableFloatStateOf(0.0f),
|
|
45
45
|
val radius: MutableState<Float> = mutableFloatStateOf(0.0f),
|
|
46
46
|
val type: MutableState<ShapeType> = mutableStateOf(ShapeType.CIRCLE),
|
|
47
|
-
val color: MutableState<GraphicsColor?> = mutableStateOf(null)
|
|
47
|
+
val color: MutableState<GraphicsColor?> = mutableStateOf(null),
|
|
48
|
+
val modifiers: MutableState<List<ExpoModifier>> = mutableStateOf(emptyList())
|
|
48
49
|
) : ComposeProps
|
|
49
50
|
|
|
50
51
|
private fun Size.centerX() = this.width / 2
|
|
@@ -129,7 +130,7 @@ class ShapeView(context: Context, appContext: AppContext) : ExpoComposeView<Shap
|
|
|
129
130
|
val (verticesCount) = props.verticesCount
|
|
130
131
|
val (color) = props.color
|
|
131
132
|
Box(
|
|
132
|
-
modifier = Modifier
|
|
133
|
+
modifier = Modifier.fromExpoModifiers(props.modifiers.value)
|
|
133
134
|
.drawWithCache {
|
|
134
135
|
val path = when (shapeType) {
|
|
135
136
|
ShapeType.STAR -> createStarPath(size = size, cornerRounding = cornerRounding, smoothing = smoothing, innerRadius = innerRadius, radius = radius, verticesCount = verticesCount)
|
|
@@ -39,7 +39,8 @@ data class SliderProps(
|
|
|
39
39
|
val min: MutableState<Float> = mutableFloatStateOf(0.0f),
|
|
40
40
|
val max: MutableState<Float> = mutableFloatStateOf(1.0f),
|
|
41
41
|
val steps: MutableState<Int> = mutableIntStateOf(0),
|
|
42
|
-
val elementColors: MutableState<SliderColors> = mutableStateOf(SliderColors())
|
|
42
|
+
val elementColors: MutableState<SliderColors> = mutableStateOf(SliderColors()),
|
|
43
|
+
val modifiers: MutableState<List<ExpoModifier>> = mutableStateOf(emptyList())
|
|
43
44
|
) : ComposeProps
|
|
44
45
|
|
|
45
46
|
class SliderView(context: Context, appContext: AppContext) :
|
|
@@ -68,7 +69,8 @@ class SliderView(context: Context, appContext: AppContext) :
|
|
|
68
69
|
inactiveTrackColor = colors.inactiveTrackColor.compose,
|
|
69
70
|
activeTickColor = colors.activeTickColor.compose,
|
|
70
71
|
inactiveTickColor = colors.inactiveTickColor.compose
|
|
71
|
-
)
|
|
72
|
+
),
|
|
73
|
+
modifier = Modifier.fromExpoModifiers(props.modifiers.value)
|
|
72
74
|
)
|
|
73
75
|
}
|
|
74
76
|
}
|
|
@@ -58,7 +58,8 @@ class SwitchColors : Record {
|
|
|
58
58
|
data class SwitchProps(
|
|
59
59
|
val value: MutableState<Boolean> = mutableStateOf(false),
|
|
60
60
|
val variant: MutableState<String> = mutableStateOf("switch"),
|
|
61
|
-
val elementColors: MutableState<SwitchColors> = mutableStateOf(SwitchColors())
|
|
61
|
+
val elementColors: MutableState<SwitchColors> = mutableStateOf(SwitchColors()),
|
|
62
|
+
val modifiers: MutableState<List<ExpoModifier>> = mutableStateOf(emptyList())
|
|
62
63
|
) : ComposeProps
|
|
63
64
|
|
|
64
65
|
@Composable
|
|
@@ -129,7 +130,7 @@ class SwitchView(context: Context, appContext: AppContext) :
|
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
AutoSizingComposable(shadowNodeProxy) {
|
|
132
|
-
ThemedHybridSwitch(variant, checked, onCheckedChange, colors)
|
|
133
|
+
ThemedHybridSwitch(variant, checked, onCheckedChange, colors, modifier.fromExpoModifiers(props.modifiers.value))
|
|
133
134
|
}
|
|
134
135
|
}
|
|
135
136
|
}
|
|
@@ -31,7 +31,8 @@ data class TextInputProps(
|
|
|
31
31
|
val numberOfLines: MutableState<Int?> = mutableStateOf(null),
|
|
32
32
|
val keyboardType: MutableState<String> = mutableStateOf("default"),
|
|
33
33
|
val autocorrection: MutableState<Boolean> = mutableStateOf(true),
|
|
34
|
-
val autoCapitalize: MutableState<String> = mutableStateOf("none")
|
|
34
|
+
val autoCapitalize: MutableState<String> = mutableStateOf("none"),
|
|
35
|
+
val modifiers: MutableState<List<ExpoModifier>> = mutableStateOf(emptyList())
|
|
35
36
|
) : ComposeProps
|
|
36
37
|
|
|
37
38
|
private fun String.keyboardType(): KeyboardType {
|
|
@@ -90,7 +91,8 @@ class TextInputView(context: Context, appContext: AppContext) :
|
|
|
90
91
|
keyboardType = props.keyboardType.value.keyboardType(),
|
|
91
92
|
autoCorrectEnabled = props.autocorrection.value,
|
|
92
93
|
capitalization = props.autoCapitalize.value.autoCapitalize()
|
|
93
|
-
)
|
|
94
|
+
),
|
|
95
|
+
modifier = Modifier.fromExpoModifiers(props.modifiers.value)
|
|
94
96
|
)
|
|
95
97
|
}
|
|
96
98
|
}
|
|
@@ -27,7 +27,9 @@ import expo.modules.kotlin.views.ComposeProps
|
|
|
27
27
|
import java.io.Serializable
|
|
28
28
|
import expo.modules.kotlin.types.Enumerable
|
|
29
29
|
import expo.modules.ui.DynamicTheme
|
|
30
|
+
import expo.modules.ui.ExpoModifier
|
|
30
31
|
import expo.modules.ui.compose
|
|
32
|
+
import expo.modules.ui.fromExpoModifiers
|
|
31
33
|
import expo.modules.ui.getImageVector
|
|
32
34
|
|
|
33
35
|
open class ButtonPressedEvent() : Record, Serializable
|
|
@@ -59,11 +61,12 @@ data class ButtonProps(
|
|
|
59
61
|
val variant: MutableState<ButtonVariant?> = mutableStateOf(ButtonVariant.DEFAULT),
|
|
60
62
|
val elementColors: MutableState<ButtonColors> = mutableStateOf(ButtonColors()),
|
|
61
63
|
val systemImage: MutableState<String?> = mutableStateOf(null),
|
|
62
|
-
val disabled: MutableState<Boolean> = mutableStateOf(false)
|
|
64
|
+
val disabled: MutableState<Boolean> = mutableStateOf(false),
|
|
65
|
+
val modifiers: MutableState<List<ExpoModifier>> = mutableStateOf(emptyList())
|
|
63
66
|
) : ComposeProps
|
|
64
67
|
|
|
65
68
|
@Composable
|
|
66
|
-
fun StyledButton(variant: ButtonVariant, colors: ButtonColors, disabled: Boolean, onPress: () -> Unit, content: @Composable (RowScope.() -> Unit)) {
|
|
69
|
+
fun StyledButton(variant: ButtonVariant, colors: ButtonColors, disabled: Boolean, onPress: () -> Unit, modifier: Modifier = Modifier, content: @Composable (RowScope.() -> Unit)) {
|
|
67
70
|
when (variant) {
|
|
68
71
|
ButtonVariant.BORDERED -> FilledTonalButton(
|
|
69
72
|
onPress,
|
|
@@ -74,7 +77,8 @@ fun StyledButton(variant: ButtonVariant, colors: ButtonColors, disabled: Boolean
|
|
|
74
77
|
contentColor = colors.contentColor.compose,
|
|
75
78
|
disabledContainerColor = colors.disabledContainerColor.compose,
|
|
76
79
|
disabledContentColor = colors.disabledContentColor.compose
|
|
77
|
-
)
|
|
80
|
+
),
|
|
81
|
+
modifier = modifier
|
|
78
82
|
)
|
|
79
83
|
|
|
80
84
|
ButtonVariant.BORDERLESS -> TextButton(
|
|
@@ -86,7 +90,8 @@ fun StyledButton(variant: ButtonVariant, colors: ButtonColors, disabled: Boolean
|
|
|
86
90
|
contentColor = colors.contentColor.compose,
|
|
87
91
|
disabledContainerColor = colors.disabledContainerColor.compose,
|
|
88
92
|
disabledContentColor = colors.disabledContentColor.compose
|
|
89
|
-
)
|
|
93
|
+
),
|
|
94
|
+
modifier = modifier
|
|
90
95
|
)
|
|
91
96
|
|
|
92
97
|
ButtonVariant.OUTLINED -> OutlinedButton(
|
|
@@ -98,7 +103,8 @@ fun StyledButton(variant: ButtonVariant, colors: ButtonColors, disabled: Boolean
|
|
|
98
103
|
contentColor = colors.contentColor.compose,
|
|
99
104
|
disabledContainerColor = colors.disabledContainerColor.compose,
|
|
100
105
|
disabledContentColor = colors.disabledContentColor.compose
|
|
101
|
-
)
|
|
106
|
+
),
|
|
107
|
+
modifier = modifier
|
|
102
108
|
)
|
|
103
109
|
|
|
104
110
|
ButtonVariant.ELEVATED -> ElevatedButton(
|
|
@@ -110,7 +116,8 @@ fun StyledButton(variant: ButtonVariant, colors: ButtonColors, disabled: Boolean
|
|
|
110
116
|
contentColor = colors.contentColor.compose,
|
|
111
117
|
disabledContainerColor = colors.disabledContainerColor.compose,
|
|
112
118
|
disabledContentColor = colors.disabledContentColor.compose
|
|
113
|
-
)
|
|
119
|
+
),
|
|
120
|
+
modifier = modifier
|
|
114
121
|
)
|
|
115
122
|
|
|
116
123
|
else -> androidx.compose.material3.Button(
|
|
@@ -122,7 +129,8 @@ fun StyledButton(variant: ButtonVariant, colors: ButtonColors, disabled: Boolean
|
|
|
122
129
|
contentColor = colors.contentColor.compose,
|
|
123
130
|
disabledContainerColor = colors.disabledContainerColor.compose,
|
|
124
131
|
disabledContentColor = colors.disabledContentColor.compose
|
|
125
|
-
)
|
|
132
|
+
),
|
|
133
|
+
modifier = modifier
|
|
126
134
|
)
|
|
127
135
|
}
|
|
128
136
|
}
|
|
@@ -149,7 +157,8 @@ class Button(context: Context, appContext: AppContext) :
|
|
|
149
157
|
variant ?: ButtonVariant.DEFAULT,
|
|
150
158
|
colors,
|
|
151
159
|
disabled,
|
|
152
|
-
{ onButtonPressed.invoke(ButtonPressedEvent()) }
|
|
160
|
+
onPress = { onButtonPressed.invoke(ButtonPressedEvent()) },
|
|
161
|
+
modifier = Modifier.fromExpoModifiers(props.modifiers.value)
|
|
153
162
|
) {
|
|
154
163
|
if (systemImage != null) {
|
|
155
164
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ExpoModifier } from '../../types';
|
|
1
2
|
export type AlertDialogProps = {
|
|
2
3
|
/**
|
|
3
4
|
* The title of the alert dialog.
|
|
@@ -29,6 +30,8 @@ export type AlertDialogProps = {
|
|
|
29
30
|
* Callback that is called when the user tries to dismiss the dialog.
|
|
30
31
|
*/
|
|
31
32
|
onDismissPressed?: () => void;
|
|
33
|
+
/** Modifiers for the component */
|
|
34
|
+
modifiers?: ExpoModifier[];
|
|
32
35
|
};
|
|
33
36
|
export type NativeAlertDialogProps = AlertDialogProps;
|
|
34
37
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/AlertDialog/index.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/AlertDialog/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAE9B,kCAAkC;IAClC,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAOtD;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAQlD"}
|
|
@@ -4,6 +4,8 @@ const AlertDialogNativeView = requireNativeView('ExpoUI', 'AlertDialogView');
|
|
|
4
4
|
* Renders an `AlertDialog` component.
|
|
5
5
|
*/
|
|
6
6
|
export function AlertDialog(props) {
|
|
7
|
-
return <AlertDialogNativeView {...props}
|
|
7
|
+
return (<AlertDialogNativeView {...props}
|
|
8
|
+
// @ts-expect-error
|
|
9
|
+
modifiers={props.modifiers?.map((m) => m.__expo_shared_object_id__)}/>);
|
|
8
10
|
}
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/jetpack-compose/AlertDialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/jetpack-compose/AlertDialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AA0CzC,MAAM,qBAAqB,GAAgD,iBAAiB,CAC1F,QAAQ,EACR,iBAAiB,CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,OAAO,CACL,CAAC,qBAAqB,CACpB,IAAI,KAAK,CAAC;IACV,mBAAmB;IACnB,SAAS,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,EACpE,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { ExpoModifier } from '../../types';\n\nexport type AlertDialogProps = {\n /**\n * The title of the alert dialog.\n */\n title?: string;\n /**\n * The text of the alert dialog.\n */\n text?: string;\n /**\n * The text of the confirm button of the alert dialog.\n */\n confirmButtonText?: string;\n /**\n * The text of the dismiss button of the alert dialog.\n */\n dismissButtonText?: string;\n /**\n * Whether the alert dialog is visible.\n *\n * @default false\n */\n visible?: boolean;\n /**\n * Callback that is called when the user tries to confirm the dialog.\n */\n onConfirmPressed?: () => void;\n /**\n * Callback that is called when the user tries to dismiss the dialog.\n */\n onDismissPressed?: () => void;\n\n /** Modifiers for the component */\n modifiers?: ExpoModifier[];\n};\n\nexport type NativeAlertDialogProps = AlertDialogProps;\n\nconst AlertDialogNativeView: React.ComponentType<NativeAlertDialogProps> = requireNativeView(\n 'ExpoUI',\n 'AlertDialogView'\n);\n\n/**\n * Renders an `AlertDialog` component.\n */\nexport function AlertDialog(props: AlertDialogProps) {\n return (\n <AlertDialogNativeView\n {...props}\n // @ts-expect-error\n modifiers={props.modifiers?.map((m) => m.__expo_shared_object_id__)}\n />\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
2
|
import { MaterialIcon } from './types';
|
|
3
|
-
import { ViewEvent } from '../../types';
|
|
3
|
+
import { ExpoModifier, ViewEvent } from '../../types';
|
|
4
4
|
/**
|
|
5
5
|
* The built-in button styles available on Android.
|
|
6
6
|
* - `outlined` - A button with an outline.
|
|
@@ -51,6 +51,8 @@ export type ButtonProps = {
|
|
|
51
51
|
* Disabled state of the button.
|
|
52
52
|
*/
|
|
53
53
|
disabled?: boolean;
|
|
54
|
+
/** Modifiers for the component */
|
|
55
|
+
modifiers?: ExpoModifier[];
|
|
54
56
|
};
|
|
55
57
|
/**
|
|
56
58
|
* @hidden
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/Button/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAc,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/Button/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAc,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtD;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5F;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,kCAAkC;IAClC,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,WAAW,EACX,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAChD,GAAG;IACF,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;AAQvC;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,iBAAiB,CAiB1E;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAQxC"}
|
|
@@ -12,6 +12,8 @@ export function transformButtonProps(props) {
|
|
|
12
12
|
text: children ?? '',
|
|
13
13
|
systemImage,
|
|
14
14
|
onButtonPressed: onPress,
|
|
15
|
+
// @ts-expect-error
|
|
16
|
+
modifiers: props.modifiers?.map((m) => m.__expo_shared_object_id__),
|
|
15
17
|
elementColors: props.elementColors
|
|
16
18
|
? props.elementColors
|
|
17
19
|
: props.color
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/jetpack-compose/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAa,UAAU,EAAa,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/jetpack-compose/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAa,UAAU,EAAa,MAAM,cAAc,CAAC;AAyEhE,wFAAwF;AACxF,MAAM,gBAAgB,GAA2C,iBAAiB,CAChF,QAAQ,EACR,QAAQ,CACT,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAkB;IACrD,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAC/D,OAAO;QACL,GAAG,SAAS;QACZ,IAAI,EAAE,QAAQ,IAAI,EAAE;QACpB,WAAW;QACX,eAAe,EAAE,OAAO;QACxB,mBAAmB;QACnB,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,yBAAyB,CAAC;QACnE,aAAa,EAAE,KAAK,CAAC,aAAa;YAChC,CAAC,CAAC,KAAK,CAAC,aAAa;YACrB,CAAC,CAAC,KAAK,CAAC,KAAK;gBACX,CAAC,CAAC;oBACE,cAAc,EAAE,KAAK,CAAC,KAAK;iBAC5B;gBACH,CAAC,CAAC,SAAS;KAChB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,4EAA4E;IAC5E,OAAO,CACL,CAAC,gBAAgB,CACf,IAAI,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAChC,KAAK,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EACxE,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport { StyleProp, StyleSheet, ViewStyle } from 'react-native';\n\nimport { MaterialIcon } from './types';\nimport { ExpoModifier, ViewEvent } from '../../types';\n\n/**\n * The built-in button styles available on Android.\n * - `outlined` - A button with an outline.\n * - `elevated` - A filled button with a shadow.\n */\nexport type ButtonVariant = 'default' | 'bordered' | 'borderless' | 'outlined' | 'elevated';\n\n/**\n * Colors for button's core elements.\n */\nexport type ButtonElementColors = {\n containerColor?: string;\n contentColor?: string;\n disabledContainerColor?: string;\n disabledContentColor?: string;\n};\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 * Uses Material Icons on Android.\n */\n systemImage?: MaterialIcon;\n /**\n * The button variant.\n */\n variant?: ButtonVariant;\n /**\n * Additional styles to apply to the button.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * The text to display inside the button.\n */\n children: string;\n /**\n * Colors for button's core elements.\n * @platform android\n */\n elementColors?: ButtonElementColors;\n /**\n * Button color.\n */\n color?: string;\n /**\n * Disabled state of the button.\n */\n disabled?: boolean;\n\n /** Modifiers for the component */\n modifiers?: ExpoModifier[];\n};\n\n/**\n * @hidden\n */\nexport type NativeButtonProps = Omit<\n ButtonProps,\n 'role' | 'onPress' | 'children' | 'systemImage'\n> & {\n text: string;\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 * @hidden\n */\nexport function transformButtonProps(props: ButtonProps): NativeButtonProps {\n const { children, onPress, systemImage, ...restProps } = props;\n return {\n ...restProps,\n text: children ?? '',\n systemImage,\n onButtonPressed: onPress,\n // @ts-expect-error\n modifiers: props.modifiers?.map((m) => m.__expo_shared_object_id__),\n elementColors: props.elementColors\n ? props.elementColors\n : props.color\n ? {\n containerColor: props.color,\n }\n : undefined,\n };\n}\n\n/**\n * Displays a native button component.\n */\nexport function Button(props: ButtonProps) {\n // Min height from https://m3.material.io/components/buttons/specs, minWidth\n return (\n <ButtonNativeView\n {...transformButtonProps(props)}\n style={StyleSheet.compose({ minWidth: 80, minHeight: 40 }, props.style)}\n />\n );\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { ExpoModifier } from '../../types';
|
|
3
4
|
import { ButtonProps } from '../Button';
|
|
4
5
|
import { PickerProps } from '../Picker';
|
|
5
6
|
import { SwitchProps } from '../Switch';
|
|
@@ -48,6 +49,8 @@ export type ContextMenuProps = {
|
|
|
48
49
|
* Optional styles to apply to the `ContextMenu`.
|
|
49
50
|
*/
|
|
50
51
|
style?: StyleProp<ViewStyle>;
|
|
52
|
+
/** Modifiers for the component */
|
|
53
|
+
modifiers?: ExpoModifier[];
|
|
51
54
|
};
|
|
52
55
|
/**
|
|
53
56
|
* Props of the `Submenu` component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/ContextMenu/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,YAAY,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG1E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAOxC,KAAK,cAAc,GACf,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,YAAY,CAAC,CAAC;AAE/B,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,cAAc,GAAG,cAAc,EAAE,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAChC,MAAM,EACN,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,CAC3D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IAAE,oBAAoB,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,WAAW,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/ContextMenu/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,YAAY,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG1E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAOxC,KAAK,cAAc,GACf,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,YAAY,CAAC,CAAC;AAE/B,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,cAAc,GAAG,cAAc,EAAE,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAChC,MAAM,EACN,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,CAC3D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IAAE,oBAAoB,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,WAAW,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B,kCAAkC;IAClC,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;CAC5B,CAAC;AAEF;;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;AAyBF,wBAAgB,OAAO,gCAEtB;AAED,wBAAgB,KAAK,gCAEpB;yBAFe,KAAK;;;AAKrB,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAE3D;yBAFe,OAAO;;;AAKvB,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAE3D;AAED,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAqC3C;kBArCQ,WAAW;;;;;AA2CpB,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -25,7 +25,9 @@ function ContextMenu(props) {
|
|
|
25
25
|
const handler = eventHandlersMap[e.nativeEvent.contextMenuElementID]?.[handlerType];
|
|
26
26
|
handler?.(e);
|
|
27
27
|
};
|
|
28
|
-
return (<MenuNativeView style={props.style} elements={processedElements} onContextMenuButtonPressed={createEventHandler('onPress')} onContextMenuSwitchValueChanged={createEventHandler('onValueChange')} onContextMenuPickerOptionSelected={createEventHandler('onOptionSelected')}
|
|
28
|
+
return (<MenuNativeView style={props.style} elements={processedElements} onContextMenuButtonPressed={createEventHandler('onPress')} onContextMenuSwitchValueChanged={createEventHandler('onValueChange')} onContextMenuPickerOptionSelected={createEventHandler('onOptionSelected')}
|
|
29
|
+
// @ts-expect-error
|
|
30
|
+
modifiers={props.modifiers?.map((m) => m.__expo_shared_object_id__)} {...props}>
|
|
29
31
|
{activationElement}
|
|
30
32
|
</MenuNativeView>);
|
|
31
33
|
}
|