@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
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core modifier factory and type definitions for SwiftUI view modifiers.
|
|
3
|
+
* This system allows both built-in and 3rd party modifiers to use the same API.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Base interface for all view modifiers.
|
|
8
|
+
* All modifiers must have a type field and can include arbitrary parameters.
|
|
9
|
+
*/
|
|
10
|
+
export interface ModifierConfig {
|
|
11
|
+
$type: string;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
eventListener?: (args: any) => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Factory function to create modifier configuration objects.
|
|
18
|
+
* This is used internally by all modifier functions.
|
|
19
|
+
*/
|
|
20
|
+
function createModifier(type: string, params: Record<string, any> = {}): ModifierConfig {
|
|
21
|
+
return { $type: type, ...params };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Creates a modifier with an event listener.
|
|
26
|
+
*/
|
|
27
|
+
function createModifierWithEventListener(
|
|
28
|
+
type: string,
|
|
29
|
+
eventListener: (args: any) => void,
|
|
30
|
+
params: Record<string, any> = {}
|
|
31
|
+
): ModifierConfig {
|
|
32
|
+
return { $type: type, ...params, eventListener };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// =============================================================================
|
|
36
|
+
// Built-in Modifier Functions
|
|
37
|
+
// =============================================================================
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Sets the background of a view.
|
|
41
|
+
* @param color - The background color (hex string, e.g., '#FF0000')
|
|
42
|
+
*/
|
|
43
|
+
export const background = (color: string) => createModifier('background', { color });
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Applies corner radius to a view.
|
|
47
|
+
* @param radius - The corner radius value
|
|
48
|
+
*/
|
|
49
|
+
export const cornerRadius = (radius: number) => createModifier('cornerRadius', { radius });
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Adds a shadow to a view.
|
|
53
|
+
*/
|
|
54
|
+
export const shadow = (params: { radius: number; x?: number; y?: number; color?: string }) =>
|
|
55
|
+
createModifier('shadow', params);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Sets the frame properties of a view.
|
|
59
|
+
*/
|
|
60
|
+
export const frame = (params: {
|
|
61
|
+
width?: number;
|
|
62
|
+
height?: number;
|
|
63
|
+
minWidth?: number;
|
|
64
|
+
maxWidth?: number;
|
|
65
|
+
minHeight?: number;
|
|
66
|
+
maxHeight?: number;
|
|
67
|
+
idealWidth?: number;
|
|
68
|
+
idealHeight?: number;
|
|
69
|
+
alignment?:
|
|
70
|
+
| 'center'
|
|
71
|
+
| 'leading'
|
|
72
|
+
| 'trailing'
|
|
73
|
+
| 'top'
|
|
74
|
+
| 'bottom'
|
|
75
|
+
| 'topLeading'
|
|
76
|
+
| 'topTrailing'
|
|
77
|
+
| 'bottomLeading'
|
|
78
|
+
| 'bottomTrailing';
|
|
79
|
+
}) => createModifier('frame', params);
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Sets padding on a view.
|
|
83
|
+
* Supports individual edges or shorthand properties.
|
|
84
|
+
*/
|
|
85
|
+
export const padding = (params: {
|
|
86
|
+
top?: number;
|
|
87
|
+
bottom?: number;
|
|
88
|
+
leading?: number;
|
|
89
|
+
trailing?: number;
|
|
90
|
+
horizontal?: number;
|
|
91
|
+
vertical?: number;
|
|
92
|
+
all?: number;
|
|
93
|
+
}) => createModifier('padding', params);
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Controls fixed size behavior.
|
|
97
|
+
* @param enabled - Whether the view should use its natural size
|
|
98
|
+
*/
|
|
99
|
+
export const fixedSize = (enabled: boolean = true) => createModifier('fixedSize', { enabled });
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Adds a tap gesture recognizer.
|
|
103
|
+
* @param handler - Function to call when tapped
|
|
104
|
+
*/
|
|
105
|
+
export const onTapGesture = (handler: () => void) =>
|
|
106
|
+
createModifierWithEventListener('onTapGesture', handler);
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Adds a long press gesture recognizer.
|
|
110
|
+
* @param handler - Function to call when long pressed
|
|
111
|
+
* @param minimumDuration - Minimum duration for long press (default: 0.5s)
|
|
112
|
+
*/
|
|
113
|
+
export const onLongPressGesture = (handler: () => void, minimumDuration?: number) =>
|
|
114
|
+
createModifierWithEventListener('onLongPressGesture', handler, {
|
|
115
|
+
minimumDuration: minimumDuration ?? 0.5,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// Note: Complex gesture modifiers like onDragGesture are not available
|
|
119
|
+
// in the modifier system. Use component-level props instead.
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Sets the opacity of a view.
|
|
123
|
+
* @param value - Opacity value between 0 and 1
|
|
124
|
+
*/
|
|
125
|
+
export const opacity = (value: number) => createModifier('opacity', { value });
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Clips the view to a specific shape.
|
|
129
|
+
* @param shape - The clipping shape
|
|
130
|
+
* @param cornerRadius - Corner radius for rounded rectangle (default: 8)
|
|
131
|
+
*/
|
|
132
|
+
export const clipShape = (
|
|
133
|
+
shape: 'rectangle' | 'circle' | 'roundedRectangle',
|
|
134
|
+
cornerRadius?: number
|
|
135
|
+
) => createModifier('clipShape', { shape, cornerRadius });
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Adds a border to a view.
|
|
139
|
+
*/
|
|
140
|
+
export const border = (params: { color: string; width?: number }) =>
|
|
141
|
+
createModifier('border', params);
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Applies scaling transformation.
|
|
145
|
+
* @param scale - Scale factor (1.0 = normal size)
|
|
146
|
+
*/
|
|
147
|
+
export const scaleEffect = (scale: number) => createModifier('scaleEffect', { scale });
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Applies rotation transformation.
|
|
151
|
+
* @param angle - Rotation angle in degrees
|
|
152
|
+
*/
|
|
153
|
+
export const rotationEffect = (angle: number) => createModifier('rotationEffect', { angle });
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Applies an offset (translation) to a view.
|
|
157
|
+
*/
|
|
158
|
+
export const offset = (params: { x?: number; y?: number }) => createModifier('offset', params);
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Sets the foreground color/tint of a view.
|
|
162
|
+
* @param color - The foreground color (hex string)
|
|
163
|
+
*/
|
|
164
|
+
export const foregroundColor = (color: string) => createModifier('foregroundColor', { color });
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Sets the tint color of a view.
|
|
168
|
+
* @param color - The tint color (hex string)
|
|
169
|
+
*/
|
|
170
|
+
export const tint = (color: string) => createModifier('tint', { color });
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Hides or shows a view.
|
|
174
|
+
* @param hidden - Whether the view should be hidden
|
|
175
|
+
*/
|
|
176
|
+
export const hidden = (hidden: boolean = true) => createModifier('hidden', { hidden });
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Sets the z-index (display order) of a view.
|
|
180
|
+
* @param index - The z-index value
|
|
181
|
+
*/
|
|
182
|
+
export const zIndex = (index: number) => createModifier('zIndex', { index });
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Applies blur to a view.
|
|
186
|
+
* @param radius - The blur radius
|
|
187
|
+
*/
|
|
188
|
+
export const blur = (radius: number) => createModifier('blur', { radius });
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Adjusts the brightness of a view.
|
|
192
|
+
* @param amount - Brightness adjustment (-1 to 1)
|
|
193
|
+
*/
|
|
194
|
+
export const brightness = (amount: number) => createModifier('brightness', { amount });
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Adjusts the contrast of a view.
|
|
198
|
+
* @param amount - Contrast multiplier (0 to infinity, 1 = normal)
|
|
199
|
+
*/
|
|
200
|
+
export const contrast = (amount: number) => createModifier('contrast', { amount });
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Adjusts the saturation of a view.
|
|
204
|
+
* @param amount - Saturation multiplier (0 to infinity, 1 = normal)
|
|
205
|
+
*/
|
|
206
|
+
export const saturation = (amount: number) => createModifier('saturation', { amount });
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Applies a hue rotation to a view.
|
|
210
|
+
* @param angle - Hue rotation angle in degrees
|
|
211
|
+
*/
|
|
212
|
+
export const hueRotation = (angle: number) => createModifier('hueRotation', { angle });
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Inverts the colors of a view.
|
|
216
|
+
* @param inverted - Whether to invert colors
|
|
217
|
+
*/
|
|
218
|
+
export const colorInvert = (inverted: boolean = true) =>
|
|
219
|
+
createModifier('colorInvert', { inverted });
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Makes a view grayscale.
|
|
223
|
+
* @param amount - Grayscale amount (0 to 1)
|
|
224
|
+
*/
|
|
225
|
+
export const grayscale = (amount: number) => createModifier('grayscale', { amount });
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Sets accessibility label for the view.
|
|
229
|
+
* @param label - The accessibility label
|
|
230
|
+
*/
|
|
231
|
+
export const accessibilityLabel = (label: string) =>
|
|
232
|
+
createModifier('accessibilityLabel', { label });
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Sets accessibility hint for the view.
|
|
236
|
+
* @param hint - The accessibility hint
|
|
237
|
+
*/
|
|
238
|
+
export const accessibilityHint = (hint: string) => createModifier('accessibilityHint', { hint });
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Sets accessibility value for the view.
|
|
242
|
+
* @param value - The accessibility value
|
|
243
|
+
*/
|
|
244
|
+
export const accessibilityValue = (value: string) =>
|
|
245
|
+
createModifier('accessibilityValue', { value });
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Sets layout priority for the view.
|
|
249
|
+
* @param priority - Layout priority value
|
|
250
|
+
*/
|
|
251
|
+
export const layoutPriority = (priority: number) => createModifier('layoutPriority', { priority });
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Applies a mask to the view.
|
|
255
|
+
* @param shape - The masking shape
|
|
256
|
+
* @param cornerRadius - Corner radius for rounded rectangle (default: 8)
|
|
257
|
+
*/
|
|
258
|
+
export const mask = (shape: 'rectangle' | 'circle' | 'roundedRectangle', cornerRadius?: number) =>
|
|
259
|
+
createModifier('mask', { shape, cornerRadius });
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Overlays another view on top.
|
|
263
|
+
* @param color - Overlay color
|
|
264
|
+
* @param alignment - Overlay alignment
|
|
265
|
+
*/
|
|
266
|
+
export const overlay = (params: {
|
|
267
|
+
color?: string;
|
|
268
|
+
alignment?: 'center' | 'top' | 'bottom' | 'leading' | 'trailing';
|
|
269
|
+
}) => createModifier('overlay', params);
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Adds a background behind the view.
|
|
273
|
+
* @param color - Background color
|
|
274
|
+
* @param alignment - Background alignment
|
|
275
|
+
*/
|
|
276
|
+
export const backgroundOverlay = (params: {
|
|
277
|
+
color?: string;
|
|
278
|
+
alignment?: 'center' | 'top' | 'bottom' | 'leading' | 'trailing';
|
|
279
|
+
}) => createModifier('backgroundOverlay', params);
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Sets aspect ratio constraint.
|
|
283
|
+
* @param ratio - Width/height aspect ratio
|
|
284
|
+
* @param contentMode - How content fits the aspect ratio
|
|
285
|
+
*/
|
|
286
|
+
export const aspectRatio = (params: { ratio: number; contentMode?: 'fit' | 'fill' }) =>
|
|
287
|
+
createModifier('aspectRatio', params);
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Clips content to bounds.
|
|
291
|
+
* @param clipped - Whether to clip content
|
|
292
|
+
*/
|
|
293
|
+
export const clipped = (clipped: boolean = true) => createModifier('clipped', { clipped });
|
|
294
|
+
|
|
295
|
+
// =============================================================================
|
|
296
|
+
// Type Definitions
|
|
297
|
+
// =============================================================================
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Union type of all built-in modifier return types.
|
|
301
|
+
* This provides type safety for the modifiers array.
|
|
302
|
+
*/
|
|
303
|
+
export type BuiltInModifier =
|
|
304
|
+
| ReturnType<typeof background>
|
|
305
|
+
| ReturnType<typeof cornerRadius>
|
|
306
|
+
| ReturnType<typeof shadow>
|
|
307
|
+
| ReturnType<typeof frame>
|
|
308
|
+
| ReturnType<typeof padding>
|
|
309
|
+
| ReturnType<typeof fixedSize>
|
|
310
|
+
| ReturnType<typeof onTapGesture>
|
|
311
|
+
| ReturnType<typeof onLongPressGesture>
|
|
312
|
+
| ReturnType<typeof opacity>
|
|
313
|
+
| ReturnType<typeof clipShape>
|
|
314
|
+
| ReturnType<typeof border>
|
|
315
|
+
| ReturnType<typeof scaleEffect>
|
|
316
|
+
| ReturnType<typeof rotationEffect>
|
|
317
|
+
| ReturnType<typeof offset>
|
|
318
|
+
| ReturnType<typeof foregroundColor>
|
|
319
|
+
| ReturnType<typeof tint>
|
|
320
|
+
| ReturnType<typeof hidden>
|
|
321
|
+
| ReturnType<typeof zIndex>
|
|
322
|
+
| ReturnType<typeof blur>
|
|
323
|
+
| ReturnType<typeof brightness>
|
|
324
|
+
| ReturnType<typeof contrast>
|
|
325
|
+
| ReturnType<typeof saturation>
|
|
326
|
+
| ReturnType<typeof hueRotation>
|
|
327
|
+
| ReturnType<typeof colorInvert>
|
|
328
|
+
| ReturnType<typeof grayscale>
|
|
329
|
+
| ReturnType<typeof accessibilityLabel>
|
|
330
|
+
| ReturnType<typeof accessibilityHint>
|
|
331
|
+
| ReturnType<typeof accessibilityValue>
|
|
332
|
+
| ReturnType<typeof layoutPriority>
|
|
333
|
+
| ReturnType<typeof mask>
|
|
334
|
+
| ReturnType<typeof overlay>
|
|
335
|
+
| ReturnType<typeof backgroundOverlay>
|
|
336
|
+
| ReturnType<typeof aspectRatio>
|
|
337
|
+
| ReturnType<typeof clipped>;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Main ViewModifier type that supports both built-in and 3rd party modifiers.
|
|
341
|
+
* 3rd party modifiers should return ModifierConfig objects with their own type strings.
|
|
342
|
+
*/
|
|
343
|
+
export type ViewModifier = BuiltInModifier | ModifierConfig;
|
|
344
|
+
|
|
345
|
+
// =============================================================================
|
|
346
|
+
// Utility Functions
|
|
347
|
+
// =============================================================================
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Creates a custom modifier for 3rd party libraries.
|
|
351
|
+
* This function is exported so 3rd party packages can create their own modifiers.
|
|
352
|
+
*
|
|
353
|
+
* @example
|
|
354
|
+
* ```typescript
|
|
355
|
+
* // In a 3rd party package
|
|
356
|
+
* export const blurEffect = (params: { radius: number; style?: string }) =>
|
|
357
|
+
* createModifier('blurEffect', params);
|
|
358
|
+
* ```
|
|
359
|
+
*/
|
|
360
|
+
export { createModifier };
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Type guard to check if a value is a valid modifier.
|
|
364
|
+
*/
|
|
365
|
+
export const isModifier = (value: any): value is ModifierConfig => {
|
|
366
|
+
return typeof value === 'object' && value !== null && typeof value.$type === 'string';
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Filters an array to only include valid modifiers.
|
|
371
|
+
*/
|
|
372
|
+
export const filterModifiers = (modifiers: unknown[]): ModifierConfig[] => {
|
|
373
|
+
return modifiers.filter(isModifier);
|
|
374
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ModifierConfig } from './index';
|
|
2
|
+
|
|
3
|
+
type GlobalEventPayload = {
|
|
4
|
+
[eventName: string]: Record<string, any>;
|
|
5
|
+
};
|
|
6
|
+
type GlobalEvent = {
|
|
7
|
+
onGlobalEvent: (event: { nativeEvent: GlobalEventPayload }) => void;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Create an event listener for a view modifier.
|
|
12
|
+
*/
|
|
13
|
+
export function createViewModifierEventListener(modifiers: ModifierConfig[]): GlobalEvent {
|
|
14
|
+
const eventListeners: Record<string, (args: any) => void> = {};
|
|
15
|
+
for (const modifier of modifiers) {
|
|
16
|
+
if (modifier.eventListener) {
|
|
17
|
+
eventListeners[modifier.$type] = modifier.eventListener;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const onGlobalEvent: GlobalEvent['onGlobalEvent'] = ({ nativeEvent }) => {
|
|
22
|
+
for (const [eventName, params] of Object.entries(nativeEvent)) {
|
|
23
|
+
const listener = eventListeners[eventName];
|
|
24
|
+
if (listener) {
|
|
25
|
+
listener(params);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
onGlobalEvent,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -78,18 +78,41 @@ export interface PaddingProps {
|
|
|
78
78
|
*/
|
|
79
79
|
export interface CommonViewModifierProps {
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
81
|
+
* @deprecated Use `fixedSize()` modifier instead. This prop will be removed in a future version.
|
|
82
|
+
* @example
|
|
83
|
+
* ```tsx
|
|
84
|
+
* // Old way (deprecated)
|
|
85
|
+
* <Text fixedSize={true}>Hello</Text>
|
|
86
|
+
*
|
|
87
|
+
* // New way (recommended)
|
|
88
|
+
* <Text modifiers={[fixedSize(true)]}>Hello</Text>
|
|
89
|
+
* ```
|
|
83
90
|
*/
|
|
84
91
|
fixedSize?: boolean;
|
|
85
92
|
|
|
86
93
|
/**
|
|
87
|
-
*
|
|
94
|
+
* @deprecated Use `frame()` modifier instead. This prop will be removed in a future version.
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* // Old way (deprecated)
|
|
98
|
+
* <Text frame={{ width: 100, height: 50 }}>Hello</Text>
|
|
99
|
+
*
|
|
100
|
+
* // New way (recommended)
|
|
101
|
+
* <Text modifiers={[frame({ width: 100, height: 50 })]}>Hello</Text>
|
|
102
|
+
* ```
|
|
88
103
|
*/
|
|
89
104
|
frame?: FrameProps;
|
|
90
105
|
|
|
91
106
|
/**
|
|
92
|
-
*
|
|
107
|
+
* @deprecated Use `padding()` modifier instead. This prop will be removed in a future version.
|
|
108
|
+
* @example
|
|
109
|
+
* ```tsx
|
|
110
|
+
* // Old way (deprecated)
|
|
111
|
+
* <Text padding={{ all: 16 }}>Hello</Text>
|
|
112
|
+
*
|
|
113
|
+
* // New way (recommended)
|
|
114
|
+
* <Text modifiers={[padding({ all: 16 })]}>Hello</Text>
|
|
115
|
+
* ```
|
|
93
116
|
*/
|
|
94
117
|
padding?: PaddingProps;
|
|
95
118
|
|
|
@@ -97,4 +120,25 @@ export interface CommonViewModifierProps {
|
|
|
97
120
|
* Used to locate this view in end-to-end tests.
|
|
98
121
|
*/
|
|
99
122
|
testID?: string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Array of view modifiers to apply to this view.
|
|
126
|
+
* Modifiers are applied in the order they appear in the array.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```tsx
|
|
130
|
+
* import { background, cornerRadius, shadow, frame, padding, fixedSize } from 'expo-ui/swift-ui/modifiers';
|
|
131
|
+
*
|
|
132
|
+
* <Text modifiers={[
|
|
133
|
+
* background('#FF0000'),
|
|
134
|
+
* cornerRadius(10),
|
|
135
|
+
* padding({ all: 16 }),
|
|
136
|
+
* frame({ width: 200 }),
|
|
137
|
+
* shadow({ radius: 5, x: 0, y: 2 })
|
|
138
|
+
* ]}>
|
|
139
|
+
* Hello World
|
|
140
|
+
* </Text>
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
modifiers?: import('./modifiers').ViewModifier[];
|
|
100
144
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { SharedObject } from 'expo';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @hidden
|
|
3
5
|
*/
|
|
@@ -7,3 +9,5 @@ export type ViewEvent<Name extends string, Data> = Record<
|
|
|
7
9
|
? ((event: { nativeEvent: Data }) => void) | undefined
|
|
8
10
|
: (() => void) | undefined
|
|
9
11
|
>;
|
|
12
|
+
|
|
13
|
+
export declare class ExpoModifier extends SharedObject {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../build/swift-ui';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../build/swift-ui';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../build/swift-ui/modifiers';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../build/swift-ui/modifiers';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContentUnavailableView.d.ts","sourceRoot":"","sources":["../../src/swift-ui-primitives/ContentUnavailableView.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAElD,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;AAKD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,sCAKxE"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { requireNativeView } from 'expo';
|
|
2
|
-
import { Platform } from 'react-native';
|
|
3
|
-
const ContentUnavailableViewNativeView = Platform.OS === 'ios' ? requireNativeView('ExpoUI', 'ContentUnavailableView') : null;
|
|
4
|
-
/**
|
|
5
|
-
* Displays a native Swift UI ContentUnavailableView.
|
|
6
|
-
* @platform ios 17.0+
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
export function ContentUnavailableView(props) {
|
|
10
|
-
if (!ContentUnavailableViewNativeView) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
return <ContentUnavailableViewNativeView {...props}/>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=ContentUnavailableView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContentUnavailableView.js","sourceRoot":"","sources":["../../src/swift-ui-primitives/ContentUnavailableView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAqBxC,MAAM,gCAAgC,GACpC,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAEvF;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAkC;IACvE,IAAI,CAAC,gCAAgC,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,gCAAgC,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACzD,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport { Platform } from 'react-native';\n\nimport { 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> | null =\n Platform.OS === 'ios' ? requireNativeView('ExpoUI', 'ContentUnavailableView') : null;\n\n/**\n * Displays a native Swift UI ContentUnavailableView.\n * @platform ios 17.0+\n *\n */\nexport function ContentUnavailableView(props: ContentUnavailableViewProps) {\n if (!ContentUnavailableViewNativeView) {\n return null;\n }\n return <ContentUnavailableViewNativeView {...props} />;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisclosureGroup.d.ts","sourceRoot":"","sources":["../../src/swift-ui-primitives/DisclosureGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,WAAW,oBAAqB,SAAQ,uBAAuB;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAED,KAAK,gBAAgB,GAAG,SAAS,CAAC,eAAe,EAAE;IAAE,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAE5E,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,oBAAoB,EAAE,eAAe,CAAC,GAClF,gBAAgB,CAAC;AAKnB,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,+BAQ1D"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { requireNativeView } from 'expo';
|
|
2
|
-
const DisclosureGroupNativeView = requireNativeView('ExpoUI', 'DisclosureGroupView');
|
|
3
|
-
export function DisclosureGroup(props) {
|
|
4
|
-
const { onStateChange, ...rest } = props;
|
|
5
|
-
function handleStateChange(event) {
|
|
6
|
-
onStateChange?.(event.nativeEvent.isExpanded);
|
|
7
|
-
}
|
|
8
|
-
return <DisclosureGroupNativeView {...rest} onStateChange={handleStateChange}/>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=DisclosureGroup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisclosureGroup.js","sourceRoot":"","sources":["../../src/swift-ui-primitives/DisclosureGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAuBzC,MAAM,yBAAyB,GAC7B,iBAAiB,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;AAErD,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAEzC,SAAS,iBAAiB,CAAC,KAA+C;QACxE,aAAa,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,CAAC,yBAAyB,CAAC,IAAI,IAAI,CAAC,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,EAAG,CAAC;AACnF,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { type CommonViewModifierProps } from './types';\nimport { type ViewEvent } from '../types';\n\nexport interface DisclosureGroupProps extends CommonViewModifierProps {\n label: string;\n children: React.ReactNode;\n /**\n * Controls whether the disclosure group is expanded.\n */\n isExpanded?: boolean;\n /**\n * A callback that is called when the expansion state changes.\n */\n onStateChange?: (isExpanded: boolean) => void;\n}\n\ntype StateChangeEvent = ViewEvent<'onStateChange', { isExpanded: boolean }>;\n\nexport type NativeDisclosureGroupProps = Omit<DisclosureGroupProps, 'onStateChange'> &\n StateChangeEvent;\n\nconst DisclosureGroupNativeView: React.ComponentType<NativeDisclosureGroupProps> =\n requireNativeView('ExpoUI', 'DisclosureGroupView');\n\nexport function DisclosureGroup(props: DisclosureGroupProps) {\n const { onStateChange, ...rest } = props;\n\n function handleStateChange(event: { nativeEvent: { isExpanded: boolean } }) {\n onStateChange?.(event.nativeEvent.isExpanded);\n }\n\n return <DisclosureGroupNativeView {...rest} onStateChange={handleStateChange} />;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../src/swift-ui-primitives/Form.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,WAAW,SAAU,SAAQ,uBAAuB;IACxD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAID,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,+BAEpC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sourceRoot":"","sources":["../../src/swift-ui-primitives/Form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAezC,MAAM,cAAc,GAAmC,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAE/F,MAAM,UAAU,IAAI,CAAC,KAAgB;IACnC,OAAO,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACvC,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { type CommonViewModifierProps } from './types';\n\nexport interface FormProps extends CommonViewModifierProps {\n children: React.ReactNode;\n\n /**\n * Makes the form scrollable.\n * @default true\n * @platform ios 16.0+\n */\n scrollEnabled?: boolean;\n}\n\nconst FormNativeView: React.ComponentType<FormProps> = requireNativeView('ExpoUI', 'FormView');\n\nexport function Form(props: FormProps) {\n return <FormNativeView {...props} />;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/swift-ui-primitives/Image.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,WAAW,UAAW,SAAQ,uBAAuB;IACzD;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAqBD,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,+BAEtC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../src/swift-ui-primitives/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAiCzC,SAAS,oBAAoB,CAAC,KAAiB;IAC7C,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACxC,OAAO;QACL,GAAG,SAAS;QACZ,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;KACtE,CAAC;AACJ,CAAC;AAED,MAAM,eAAe,GAA0C,iBAAiB,CAC9E,QAAQ,EACR,WAAW,CACZ,CAAC;AAEF,MAAM,UAAU,KAAK,CAAC,KAAiB;IACrC,OAAO,CAAC,eAAe,CAAC,IAAI,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAAG,CAAC;AAC9D,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { ViewEvent } from '../types';\nimport { type CommonViewModifierProps } from './types';\n\nexport interface ImageProps extends CommonViewModifierProps {\n /**\n * The name of the system image (SF Symbol).\n * For example: 'photo', 'heart.fill', 'star.circle'\n */\n systemName: string;\n /**\n * The size of the system image.\n */\n size?: number;\n /**\n * The color of the system image.\n * Can be a color name like '#ff00ff', 'red', 'blue', etc.\n */\n color?: string;\n\n /**\n * Callback triggered when the view is pressed.\n */\n onPress?: () => void;\n}\n\ntype TapEvent = ViewEvent<'onTap', object> & {\n useTapGesture?: boolean;\n};\n\ntype NativeImageProps = Omit<ImageProps, 'onPress'> | TapEvent;\n\nfunction transformNativeProps(props: ImageProps): NativeImageProps {\n const { onPress, ...restProps } = props;\n return {\n ...restProps,\n ...(onPress ? { useTapGesture: true, onTap: () => onPress() } : null),\n };\n}\n\nconst ImageNativeView: React.ComponentType<NativeImageProps> = requireNativeView(\n 'ExpoUI',\n 'ImageView'\n);\n\nexport function Image(props: ImageProps) {\n return <ImageNativeView {...transformNativeProps(props)} />;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../src/swift-ui-primitives/Layout.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,KAAK,QAAQ,GAAG,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG;IAC3C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,UAAU,cAAe,SAAQ,uBAAuB;IACtD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AACD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC;AAW1E,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;CACpF;AAOD,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAExC;AAID,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;CAC/C;AAOD,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAExC;AAID,MAAM,WAAW,UAAW,SAAQ,uBAAuB;IACzD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAQD,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,+BAEtC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../src/swift-ui-primitives/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAqBzC,SAAS,oBAAoB,CAAC,KAAqB;IACjD,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACxC,OAAO;QACL,GAAG,SAAS;QACZ,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;KACtE,CAAC;AACJ,CAAC;AAOD,MAAM,gBAAgB,GAA0C,iBAAiB,CAC/E,QAAQ,EACR,YAAY,CACb,CAAC;AAEF,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,OAAO,CAAC,gBAAgB,CAAC,IAAI,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAAG,CAAC;AAC/D,CAAC;AAQD,MAAM,gBAAgB,GAA0C,iBAAiB,CAC/E,QAAQ,EACR,YAAY,CACb,CAAC;AAEF,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,OAAO,CAAC,gBAAgB,CAAC,IAAI,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAAG,CAAC;AAC/D,CAAC;AAcD,MAAM,eAAe,GAA0C,iBAAiB,CAC9E,QAAQ,EACR,WAAW,CACZ,CAAC;AAEF,MAAM,UAAU,KAAK,CAAC,KAAiB;IACrC,OAAO,CAAC,eAAe,CAAC,IAAI,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAAG,CAAC;AAC9D,CAAC;AACD,YAAY","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { type CommonViewModifierProps } from './types';\nimport { ViewEvent } from '../types';\n\ntype TapEvent = ViewEvent<'onTap', object> & {\n useTapGesture?: boolean;\n};\n\ninterface StackBaseProps extends CommonViewModifierProps {\n children: React.ReactNode;\n spacing?: number;\n backgroundColor?: string;\n\n /**\n * Callback triggered when the view is pressed.\n */\n onPress?: () => void;\n}\nexport type NativeStackProps = Omit<StackBaseProps, 'onPress'> | TapEvent;\n\nfunction transformNativeProps(props: StackBaseProps): NativeStackProps {\n const { onPress, ...restProps } = props;\n return {\n ...restProps,\n ...(onPress ? { useTapGesture: true, onTap: () => onPress() } : null),\n };\n}\n\n//#region HStack Component\nexport interface HStackProps extends StackBaseProps {\n alignment?: 'top' | 'center' | 'bottom' | 'firstTextBaseline' | 'lastTextBaseline';\n}\n\nconst HStackNativeView: React.ComponentType<NativeStackProps> = requireNativeView(\n 'ExpoUI',\n 'HStackView'\n);\n\nexport function HStack(props: HStackProps) {\n return <HStackNativeView {...transformNativeProps(props)} />;\n}\n//#endregion\n\n//#region VStack Component\nexport interface VStackProps extends StackBaseProps {\n alignment?: 'leading' | 'center' | 'trailing';\n}\n\nconst VStackNativeView: React.ComponentType<NativeStackProps> = requireNativeView(\n 'ExpoUI',\n 'VStackView'\n);\n\nexport function VStack(props: VStackProps) {\n return <VStackNativeView {...transformNativeProps(props)} />;\n}\n//#endregion\n\n//#region Group Component\nexport interface GroupProps extends CommonViewModifierProps {\n children: React.ReactNode;\n\n /**\n * Callback triggered when the view is pressed.\n */\n onPress?: () => void;\n}\n\ntype NativeGroupProps = Omit<GroupProps, 'onPress'> | TapEvent;\nconst GroupNativeView: React.ComponentType<NativeGroupProps> = requireNativeView(\n 'ExpoUI',\n 'GroupView'\n);\n\nexport function Group(props: GroupProps) {\n return <GroupNativeView {...transformNativeProps(props)} />;\n}\n//#endregion\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../src/swift-ui-primitives/Section.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAOF,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAE1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Section.js","sourceRoot":"","sources":["../../src/swift-ui-primitives/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAOzC,MAAM,iBAAiB,GAAsC,iBAAiB,CAC5E,QAAQ,EACR,sBAAsB,CACvB,CAAC;AAEF,MAAM,UAAU,OAAO,CAAC,KAAmB;IACzC,OAAO,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC1C,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nexport type SectionProps = {\n title?: string;\n children: React.ReactNode;\n};\n\nconst SectionNativeView: React.ComponentType<SectionProps> = requireNativeView(\n 'ExpoUI',\n 'SectionPrimitiveView'\n);\n\nexport function Section(props: SectionProps) {\n return <SectionNativeView {...props} />;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Spacer.d.ts","sourceRoot":"","sources":["../../src/swift-ui-primitives/Spacer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,WAAW,WAAY,SAAQ,uBAAuB;IAC1D;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AASD,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAExC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Spacer.js","sourceRoot":"","sources":["../../src/swift-ui-primitives/Spacer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAczC,MAAM,gBAAgB,GAA2C,iBAAiB,CAChF,QAAQ,EACR,YAAY,CACb,CAAC;AAEF,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,OAAO,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACzC,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { type CommonViewModifierProps } from './types';\n\nexport interface SpacerProps extends CommonViewModifierProps {\n /**\n * The minimum length of the spacer.\n * This is the minimum amount of space that the spacer will take up.\n */\n minLength?: number;\n}\n\ntype NativeSpacerProps = SpacerProps;\n\nconst SpacerNativeView: React.ComponentType<NativeSpacerProps> = requireNativeView(\n 'ExpoUI',\n 'SpacerView'\n);\n\nexport function Spacer(props: SpacerProps) {\n return <SpacerNativeView {...props} />;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/swift-ui-primitives/Text.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,WAAW,SAAU,SAAQ,uBAAuB;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EACH,YAAY,GACZ,MAAM,GACN,OAAO,GACP,SAAS,GACT,QAAQ,GACR,UAAU,GACV,MAAM,GACN,OAAO,GACP,OAAO,CAAC;IACZ;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,CAAC;IACxD;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiBD,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,+BAEpC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/swift-ui-primitives/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AA2CzC,MAAM,cAAc,GAClB,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAE1C,SAAS,kBAAkB,CAAC,KAAgB;IAC1C,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACzC,OAAO;QACL,GAAG,SAAS;QACZ,IAAI,EAAE,QAAQ,IAAI,EAAE;KACrB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,KAAgB;IACnC,OAAO,CAAC,cAAc,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC,EAAG,CAAC;AAC3D,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { type CommonViewModifierProps } from './types';\n\nexport interface TextProps extends CommonViewModifierProps {\n children: string;\n /**\n * The font weight of the text.\n * Maps to iOS system font weights.\n */\n weight?:\n | 'ultraLight'\n | 'thin'\n | 'light'\n | 'regular'\n | 'medium'\n | 'semibold'\n | 'bold'\n | 'heavy'\n | 'black';\n /**\n * The font design of the text.\n * Maps to iOS system font designs.\n */\n design?: 'default' | 'rounded' | 'serif' | 'monospaced';\n /**\n * The font size of the text.\n */\n size?: number;\n /**\n * The line limit of the text.\n */\n lineLimit?: number;\n /**\n * The color of the text.\n */\n color?: string;\n}\n\ntype NativeTextProps = Omit<TextProps, 'children'> & {\n text: string;\n};\n\nconst TextNativeView: React.ComponentType<Omit<TextProps, 'children'> & { text: string }> =\n requireNativeView('ExpoUI', 'TextView');\n\nfunction transformTextProps(props: TextProps): NativeTextProps {\n const { children, ...restProps } = props;\n return {\n ...restProps,\n text: children ?? '',\n };\n}\n\nexport function Text(props: TextProps) {\n return <TextNativeView {...transformTextProps(props)} />;\n}\n"]}
|