@expo/ui 55.0.1 → 55.0.3
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 +58 -0
- package/CONTRIBUTING.md +30 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/AnimatedVisibilityView.kt +130 -0
- package/android/src/main/java/expo/modules/ui/CardView.kt +138 -34
- package/android/src/main/java/expo/modules/ui/CheckboxView.kt +98 -0
- package/android/src/main/java/expo/modules/ui/ChipView.kt +267 -142
- package/android/src/main/java/expo/modules/ui/DatePickerView.kt +302 -31
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +204 -57
- package/android/src/main/java/expo/modules/ui/HorizontalFloatingToolbarView.kt +21 -8
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +149 -40
- package/android/src/main/java/expo/modules/ui/ProgressView.kt +189 -89
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +204 -50
- package/android/src/main/java/expo/modules/ui/RadioButtonView.kt +3 -7
- package/android/src/main/java/expo/modules/ui/SegmentedButtonView.kt +115 -0
- package/android/src/main/java/expo/modules/ui/SegmentedControlView.kt +35 -0
- package/android/src/main/java/expo/modules/ui/SliderView.kt +70 -12
- package/android/src/main/java/expo/modules/ui/SwitchView.kt +62 -104
- package/android/src/main/java/expo/modules/ui/ToggleButtonView.kt +95 -57
- package/android/src/main/java/expo/modules/ui/button/Button.kt +117 -158
- package/android/src/main/java/expo/modules/ui/button/FloatingActionButton.kt +92 -0
- package/android/src/main/java/expo/modules/ui/button/IconButton.kt +73 -80
- package/android/src/main/java/expo/modules/ui/convertibles/AnimatableFloat.kt +26 -0
- package/android/src/main/java/expo/modules/ui/convertibles/AnimationSpecParams.kt +93 -0
- package/android/src/main/java/expo/modules/ui/convertibles/GraphicsLayerParams.kt +24 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +39 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuItem.kt +70 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +18 -0
- package/build/jetpack-compose/AnimatedVisibility/index.d.ts +134 -0
- package/build/jetpack-compose/AnimatedVisibility/index.d.ts.map +1 -0
- package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts +3 -0
- package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts.map +1 -0
- package/build/jetpack-compose/Button/index.d.ts +65 -51
- package/build/jetpack-compose/Button/index.d.ts.map +1 -1
- package/build/jetpack-compose/Card/index.d.ts +72 -14
- package/build/jetpack-compose/Card/index.d.ts.map +1 -1
- package/build/jetpack-compose/Checkbox/index.d.ts +73 -0
- package/build/jetpack-compose/Checkbox/index.d.ts.map +1 -0
- package/build/jetpack-compose/Chip/index.d.ts +247 -27
- package/build/jetpack-compose/Chip/index.d.ts.map +1 -1
- package/build/jetpack-compose/DatePicker/index.d.ts +137 -3
- package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts +70 -0
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts.map +1 -0
- package/build/jetpack-compose/DropdownMenu/index.d.ts +68 -0
- package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -0
- package/build/jetpack-compose/FloatingActionButton/index.d.ts +150 -0
- package/build/jetpack-compose/FloatingActionButton/index.d.ts.map +1 -0
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts +2 -2
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts.map +1 -1
- package/build/jetpack-compose/IconButton/index.d.ts +45 -29
- package/build/jetpack-compose/IconButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts +17 -0
- package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts.map +1 -0
- package/build/jetpack-compose/Progress/index.d.ts +78 -35
- package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
- package/build/jetpack-compose/RadioButton/index.d.ts +2 -2
- package/build/jetpack-compose/RadioButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/SegmentedButton/index.d.ts +74 -0
- package/build/jetpack-compose/SegmentedButton/index.d.ts.map +1 -0
- package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts +17 -0
- package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts.map +1 -0
- package/build/jetpack-compose/Slider/index.d.ts +34 -10
- package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
- package/build/jetpack-compose/Spacer/index.d.ts +2 -2
- package/build/jetpack-compose/Switch/index.d.ts +25 -47
- package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
- package/build/jetpack-compose/ToggleButton/index.d.ts +60 -32
- package/build/jetpack-compose/ToggleButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/index.d.ts +5 -4
- package/build/jetpack-compose/index.d.ts.map +1 -1
- package/build/jetpack-compose/modifiers/animation.d.ts +44 -0
- package/build/jetpack-compose/modifiers/animation.d.ts.map +1 -0
- package/build/jetpack-compose/modifiers/index.d.ts +68 -4
- package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/AccessoryWidgetBackground/index.d.ts +4 -0
- package/build/swift-ui/AccessoryWidgetBackground/index.d.ts.map +1 -0
- package/build/swift-ui/ConfirmationDialog/index.d.ts.map +1 -1
- package/build/swift-ui/ContextMenu/index.d.ts.map +1 -1
- package/build/swift-ui/ControlGroup/index.d.ts +29 -0
- package/build/swift-ui/ControlGroup/index.d.ts.map +1 -0
- package/build/swift-ui/Gauge/index.d.ts.map +1 -1
- package/build/swift-ui/Image/index.d.ts +7 -1
- package/build/swift-ui/Image/index.d.ts.map +1 -1
- package/build/swift-ui/Label/index.d.ts.map +1 -1
- package/build/swift-ui/LabeledContent/index.d.ts.map +1 -1
- package/build/swift-ui/Menu/index.d.ts.map +1 -1
- package/build/swift-ui/Picker/index.d.ts.map +1 -1
- package/build/swift-ui/Popover/index.d.ts.map +1 -1
- package/build/swift-ui/ProgressView/index.d.ts +1 -5
- package/build/swift-ui/ProgressView/index.d.ts.map +1 -1
- package/build/swift-ui/Section/index.d.ts.map +1 -1
- package/build/swift-ui/Slider/index.d.ts.map +1 -1
- package/build/swift-ui/SlotView.d.ts +5 -0
- package/build/swift-ui/SlotView.d.ts.map +1 -0
- package/build/swift-ui/Stepper/index.d.ts +3 -3
- package/build/swift-ui/Stepper/index.d.ts.map +1 -1
- package/build/swift-ui/Text/index.d.ts +33 -1
- package/build/swift-ui/Text/index.d.ts.map +1 -1
- package/build/swift-ui/index.d.ts +2 -0
- package/build/swift-ui/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +54 -1
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/shapes/index.d.ts +2 -2
- package/build/swift-ui/types.d.ts +7 -0
- package/build/swift-ui/types.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/AccessoryWidgetBackgroundView.swift +27 -0
- package/ios/BottomSheetView.swift +1 -6
- package/ios/ClosedRangeDateRecord.swift +10 -0
- package/ios/ColorPickerView.swift +9 -8
- package/ios/ConfirmationDialog/ConfirmationDialog.swift +7 -15
- package/ios/ConfirmationDialog/ConfirmationDialogProps.swift +0 -5
- package/ios/ContextMenu/ContextMenu.swift +27 -22
- package/ios/ContextMenu/ContextMenuRecords.swift +0 -6
- package/ios/ControlGroupView.swift +33 -0
- package/ios/DatePickerView.swift +7 -5
- package/ios/DisclosureGroupView.swift +5 -7
- package/ios/ExpoUIModule.swift +10 -32
- package/ios/GaugeView.swift +4 -26
- package/ios/HostView.swift +1 -2
- package/ios/ImageView.swift +22 -11
- package/ios/Label.swift +2 -17
- package/ios/LabeledContentView.swift +3 -27
- package/ios/ListView.swift +6 -14
- package/ios/Menu/MenuRecords.swift +0 -2
- package/ios/Menu/MenuView.swift +2 -5
- package/ios/Modifiers/DefaultScrollAnchorForRoleModifier.swift +32 -0
- package/ios/Modifiers/DefaultScrollAnchorModifier.swift +16 -0
- package/ios/Modifiers/ResizableModifier.swift +24 -0
- package/ios/Modifiers/Rotation3DEffectModifier.swift +20 -0
- package/ios/Modifiers/View+ModifierArray.swift +29 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +37 -3
- package/ios/Modifiers/WidgetModifiers.swift +46 -0
- package/ios/Picker/PickerView.swift +8 -16
- package/ios/Popover/PopoverProps.swift +0 -4
- package/ios/Popover/PopoverView.swift +5 -11
- package/ios/ProgressView.swift +0 -5
- package/ios/RNHostView.swift +91 -10
- package/ios/SectionView.swift +9 -17
- package/ios/SecureFieldView.swift +0 -1
- package/ios/ShareLink/ShareLinkView.swift +1 -1
- package/ios/SliderView.swift +16 -31
- package/ios/SlotView.swift +38 -0
- package/ios/StepperView.swift +12 -16
- package/ios/TextFieldView.swift +0 -1
- package/ios/TextView.swift +37 -1
- package/ios/Toggle/ToggleView.swift +5 -7
- package/ios/UIBaseView.swift +34 -3
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.1/expo.modules.ui-55.0.1.module → 55.0.3/expo.modules.ui-55.0.3.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.1/expo.modules.ui-55.0.1.pom → 55.0.3/expo.modules.ui-55.0.3.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.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 +5 -2
- package/src/jetpack-compose/AnimatedVisibility/index.tsx +206 -0
- package/src/jetpack-compose/AnimatedVisibility/symbols.ts +8 -0
- package/src/jetpack-compose/Button/index.tsx +69 -92
- package/src/jetpack-compose/Card/index.tsx +105 -29
- package/src/jetpack-compose/Checkbox/index.tsx +126 -0
- package/src/jetpack-compose/Chip/index.tsx +391 -51
- package/src/jetpack-compose/DatePicker/index.tsx +215 -6
- package/src/jetpack-compose/DropdownMenu/DropdownMenuItem.tsx +126 -0
- package/src/jetpack-compose/DropdownMenu/index.tsx +107 -0
- package/src/jetpack-compose/FloatingActionButton/index.tsx +207 -0
- package/src/jetpack-compose/HorizontalFloatingToolbar/index.tsx +4 -2
- package/src/jetpack-compose/IconButton/index.tsx +49 -56
- package/src/jetpack-compose/MultiChoiceSegmentedButtonRow/index.tsx +34 -0
- package/src/jetpack-compose/Progress/index.tsx +120 -62
- package/src/jetpack-compose/RadioButton/index.tsx +8 -9
- package/src/jetpack-compose/SegmentedButton/index.tsx +109 -0
- package/src/jetpack-compose/SingleChoiceSegmentedButtonRow/index.tsx +34 -0
- package/src/jetpack-compose/Slider/index.tsx +76 -29
- package/src/jetpack-compose/Spacer/index.tsx +2 -2
- package/src/jetpack-compose/Switch/index.tsx +32 -84
- package/src/jetpack-compose/ToggleButton/index.tsx +67 -43
- package/src/jetpack-compose/index.ts +5 -4
- package/src/jetpack-compose/modifiers/animation.ts +37 -0
- package/src/jetpack-compose/modifiers/index.ts +86 -6
- package/src/swift-ui/AccessoryWidgetBackground/index.tsx +12 -0
- package/src/swift-ui/ConfirmationDialog/index.tsx +4 -12
- package/src/swift-ui/ContextMenu/index.tsx +6 -20
- package/src/swift-ui/ControlGroup/index.tsx +59 -0
- package/src/swift-ui/Gauge/index.tsx +5 -20
- package/src/swift-ui/Image/index.tsx +7 -1
- package/src/swift-ui/Label/index.tsx +2 -5
- package/src/swift-ui/LabeledContent/index.tsx +3 -12
- package/src/swift-ui/Menu/index.tsx +2 -6
- package/src/swift-ui/Picker/index.tsx +4 -11
- package/src/swift-ui/Popover/index.tsx +3 -12
- package/src/swift-ui/ProgressView/index.tsx +1 -3
- package/src/swift-ui/Section/index.tsx +4 -9
- package/src/swift-ui/Slider/index.tsx +4 -12
- package/src/swift-ui/SlotView.tsx +8 -0
- package/src/swift-ui/Stepper/index.tsx +7 -7
- package/src/swift-ui/Text/index.tsx +66 -2
- package/src/swift-ui/index.tsx +2 -0
- package/src/swift-ui/modifiers/index.ts +87 -1
- package/src/swift-ui/types.ts +5 -0
- package/android/src/main/java/expo/modules/ui/FilterChipView.kt +0 -59
- package/android/src/main/java/expo/modules/ui/PickerView.kt +0 -161
- package/android/src/main/java/expo/modules/ui/TextButtonView.kt +0 -33
- package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +0 -183
- package/android/src/main/java/expo/modules/ui/menu/ContextMenuRecords.kt +0 -64
- package/build/jetpack-compose/Button/types.d.ts +0 -5
- package/build/jetpack-compose/Button/types.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/Submenu.d.ts +0 -17
- package/build/jetpack-compose/ContextMenu/Submenu.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/index.d.ts +0 -65
- package/build/jetpack-compose/ContextMenu/index.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/utils.d.ts +0 -24
- package/build/jetpack-compose/ContextMenu/utils.d.ts.map +0 -1
- package/build/jetpack-compose/FilterChip/index.d.ts +0 -49
- package/build/jetpack-compose/FilterChip/index.d.ts.map +0 -1
- package/build/jetpack-compose/Picker/index.d.ts +0 -62
- package/build/jetpack-compose/Picker/index.d.ts.map +0 -1
- package/build/jetpack-compose/TextButton/index.d.ts +0 -29
- package/build/jetpack-compose/TextButton/index.d.ts.map +0 -1
- package/ios/ConfirmationDialog/ConfirmationDialogComponents.swift +0 -26
- package/ios/ContextMenu/ContextMenuComponents.swift +0 -37
- package/ios/Menu/MenuComponents.swift +0 -12
- package/ios/Picker/PickerComponents.swift +0 -24
- package/ios/Popover/PopoverComponents.swift +0 -18
- package/ios/SectionComponents.swift +0 -34
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha512 +0 -1
- package/src/jetpack-compose/Button/types.ts +0 -57
- package/src/jetpack-compose/ContextMenu/Submenu.tsx +0 -21
- package/src/jetpack-compose/ContextMenu/index.tsx +0 -149
- package/src/jetpack-compose/ContextMenu/utils.ts +0 -144
- package/src/jetpack-compose/FilterChip/index.tsx +0 -89
- package/src/jetpack-compose/Picker/index.tsx +0 -90
- package/src/jetpack-compose/TextButton/index.tsx +0 -55
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// AnimationSpec factories — return typed JSON matching Compose's AnimationSpec subtypes
|
|
2
|
+
|
|
3
|
+
export const spring = (params?: {
|
|
4
|
+
dampingRatio?: number;
|
|
5
|
+
stiffness?: number;
|
|
6
|
+
visibilityThreshold?: number;
|
|
7
|
+
}) => ({ $type: 'spring' as const, ...params });
|
|
8
|
+
|
|
9
|
+
export const tween = (params?: {
|
|
10
|
+
durationMillis?: number;
|
|
11
|
+
delayMillis?: number;
|
|
12
|
+
easing?: 'linear' | 'fastOutSlowIn' | 'fastOutLinearIn' | 'linearOutSlowIn' | 'ease';
|
|
13
|
+
}) => ({ $type: 'tween' as const, ...params });
|
|
14
|
+
|
|
15
|
+
export const snap = (params?: { delayMillis?: number }) => ({
|
|
16
|
+
$type: 'snap' as const,
|
|
17
|
+
...params,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const keyframes = (params: {
|
|
21
|
+
durationMillis: number;
|
|
22
|
+
delayMillis?: number;
|
|
23
|
+
keyframes: Record<number, number>;
|
|
24
|
+
}) => ({ $type: 'keyframes' as const, ...params });
|
|
25
|
+
|
|
26
|
+
export type AnimationSpec = ReturnType<
|
|
27
|
+
typeof spring | typeof tween | typeof snap | typeof keyframes
|
|
28
|
+
>;
|
|
29
|
+
|
|
30
|
+
// animated() wrapper — wraps a target value with an animation spec
|
|
31
|
+
export const animated = (targetValue: number, spec: AnimationSpec = spring()) => ({
|
|
32
|
+
$animated: true as const,
|
|
33
|
+
targetValue,
|
|
34
|
+
animationSpec: spec,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export type AnimatedValue = ReturnType<typeof animated>;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { type ColorValue } from 'react-native';
|
|
2
2
|
|
|
3
|
+
import { type AnimatedValue } from './animation';
|
|
3
4
|
import { createModifier, createModifierWithEventListener } from './createModifier';
|
|
4
5
|
export { type ExpoModifier } from '../../types';
|
|
6
|
+
export {
|
|
7
|
+
animated,
|
|
8
|
+
spring,
|
|
9
|
+
tween,
|
|
10
|
+
snap,
|
|
11
|
+
keyframes,
|
|
12
|
+
type AnimationSpec,
|
|
13
|
+
type AnimatedValue,
|
|
14
|
+
} from './animation';
|
|
5
15
|
|
|
6
16
|
export type Alignment =
|
|
7
17
|
// 2D Alignments
|
|
@@ -151,6 +161,48 @@ export const blur = (radius: number) => createModifier('blur', { radius });
|
|
|
151
161
|
*/
|
|
152
162
|
export const rotate = (degrees: number) => createModifier('rotate', { degrees });
|
|
153
163
|
|
|
164
|
+
/**
|
|
165
|
+
* Applies a graphics layer transformation with animation support.
|
|
166
|
+
* @param params - Transform and visual effect parameters.
|
|
167
|
+
* @see [Compose graphicsLayer documentation](https://developer.android.com/develop/ui/compose/graphics/draw/modifiers).
|
|
168
|
+
*/
|
|
169
|
+
export const graphicsLayer = (params: {
|
|
170
|
+
/** Rotation around the X axis in degrees. */
|
|
171
|
+
rotationX?: number | AnimatedValue;
|
|
172
|
+
/** Rotation around the Y axis in degrees. */
|
|
173
|
+
rotationY?: number | AnimatedValue;
|
|
174
|
+
/** Rotation around the Z axis in degrees. */
|
|
175
|
+
rotationZ?: number | AnimatedValue;
|
|
176
|
+
/** Horizontal scale factor (1.0 = no change). */
|
|
177
|
+
scaleX?: number | AnimatedValue;
|
|
178
|
+
/** Vertical scale factor (1.0 = no change). */
|
|
179
|
+
scaleY?: number | AnimatedValue;
|
|
180
|
+
/** Opacity (0.0 = transparent, 1.0 = opaque). */
|
|
181
|
+
alpha?: number | AnimatedValue;
|
|
182
|
+
/** Horizontal translation in dp. */
|
|
183
|
+
translationX?: number | AnimatedValue;
|
|
184
|
+
/** Vertical translation in dp. */
|
|
185
|
+
translationY?: number | AnimatedValue;
|
|
186
|
+
/** Distance from the camera in dp. Affects 3D rotation perspective. */
|
|
187
|
+
cameraDistance?: number;
|
|
188
|
+
/** Shadow elevation in dp. */
|
|
189
|
+
shadowElevation?: number | AnimatedValue;
|
|
190
|
+
/** Horizontal pivot point for transforms (0.0 = left, 0.5 = center, 1.0 = right). */
|
|
191
|
+
transformOriginX?: number;
|
|
192
|
+
/** Vertical pivot point for transforms (0.0 = top, 0.5 = center, 1.0 = bottom). */
|
|
193
|
+
transformOriginY?: number;
|
|
194
|
+
/** Whether to clip content to the shape. */
|
|
195
|
+
clip?: boolean;
|
|
196
|
+
/** Shape for clipping and shadow. Uses the same shapes as the `clip` modifier. */
|
|
197
|
+
shape?: BuiltinShape;
|
|
198
|
+
/** Color of the ambient shadow. */
|
|
199
|
+
ambientShadowColor?: ColorValue;
|
|
200
|
+
/** Color of the spot shadow. */
|
|
201
|
+
spotShadowColor?: ColorValue;
|
|
202
|
+
/** Compositing strategy: 'auto', 'offscreen', or 'modulate'. */
|
|
203
|
+
compositingStrategy?: 'auto' | 'offscreen' | 'modulate';
|
|
204
|
+
}) => createModifier('graphicsLayer', params);
|
|
205
|
+
|
|
154
206
|
/**
|
|
155
207
|
* Sets the z-index for layering.
|
|
156
208
|
* @param index - Z-index value.
|
|
@@ -163,8 +215,8 @@ export const zIndex = (index: number) => createModifier('zIndex', { index });
|
|
|
163
215
|
|
|
164
216
|
/**
|
|
165
217
|
* Animates size changes with spring animation.
|
|
166
|
-
* @param dampingRatio - Spring damping ratio. Default is DampingRatioNoBouncy
|
|
167
|
-
* @param stiffness - Spring stiffness. Default is StiffnessMedium
|
|
218
|
+
* @param dampingRatio - Spring damping ratio. Default is `DampingRatioNoBouncy`.
|
|
219
|
+
* @param stiffness - Spring stiffness. Default is `StiffnessMedium`.
|
|
168
220
|
*/
|
|
169
221
|
export const animateContentSize = (dampingRatio?: number, stiffness?: number) =>
|
|
170
222
|
createModifier('animateContentSize', { dampingRatio, stiffness });
|
|
@@ -198,17 +250,45 @@ export const matchParentSize = () => createModifier('matchParentSize');
|
|
|
198
250
|
/**
|
|
199
251
|
* Makes the view clickable.
|
|
200
252
|
* @param handler - Function to call when clicked.
|
|
253
|
+
* @param options - Optional configuration.
|
|
254
|
+
* @param options.indication - Whether to show a ripple indication. Defaults to `true`.
|
|
201
255
|
*/
|
|
202
|
-
export const clickable = (handler: () => void) =>
|
|
203
|
-
createModifierWithEventListener('clickable', handler
|
|
256
|
+
export const clickable = (handler: () => void, options?: { indication?: boolean }) =>
|
|
257
|
+
createModifierWithEventListener('clickable', handler, {
|
|
258
|
+
indication: options?.indication ?? true,
|
|
259
|
+
});
|
|
204
260
|
|
|
205
261
|
/**
|
|
206
262
|
* Makes the view selectable, like a radio button row.
|
|
207
263
|
* @param selected - Whether the item is currently selected.
|
|
208
264
|
* @param handler - Function to call when the item is clicked.
|
|
265
|
+
* @param role - Optional semantic role for accessibility: 'radioButton', 'checkbox', 'switch', or 'tab'.
|
|
266
|
+
*/
|
|
267
|
+
export const selectable = (
|
|
268
|
+
selected: boolean,
|
|
269
|
+
handler: () => void,
|
|
270
|
+
role?: 'radioButton' | 'checkbox' | 'switch' | 'tab'
|
|
271
|
+
) => createModifierWithEventListener('selectable', handler, { selected, role });
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Marks a column/row as a selectable group for accessibility.
|
|
275
|
+
* Screen readers will treat the children as a group of selectable items.
|
|
276
|
+
*/
|
|
277
|
+
export const selectableGroup = () => createModifier('selectableGroup');
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Makes the view toggleable with accessibility semantics.
|
|
281
|
+
* Use this to make a row containing a checkbox or switch tappable as a whole.
|
|
282
|
+
* @param value - The current toggle state.
|
|
283
|
+
* @param handler - Function to call when toggled.
|
|
284
|
+
* @param options - Optional configuration.
|
|
285
|
+
* @param options.role - The semantic role for accessibility: `'checkbox'`, `'radioButton'`, `'switch'`, or `'tab'`.
|
|
209
286
|
*/
|
|
210
|
-
export const
|
|
211
|
-
|
|
287
|
+
export const toggleable = (
|
|
288
|
+
value: boolean,
|
|
289
|
+
handler: () => void,
|
|
290
|
+
options?: { role?: 'checkbox' | 'radioButton' | 'switch' | 'tab' }
|
|
291
|
+
) => createModifierWithEventListener('toggleable', handler, { value, role: options?.role });
|
|
212
292
|
|
|
213
293
|
// =============================================================================
|
|
214
294
|
// Utility Modifiers
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { requireNativeView } from 'expo';
|
|
2
|
+
|
|
3
|
+
import { type CommonViewModifierProps } from '../types';
|
|
4
|
+
|
|
5
|
+
export type AccessoryWidgetBackgroundProps = CommonViewModifierProps;
|
|
6
|
+
|
|
7
|
+
const AccessoryWidgetBackgroundNativeView: React.ComponentType<AccessoryWidgetBackgroundProps> =
|
|
8
|
+
requireNativeView('ExpoUI', 'AccessoryWidgetBackgroundView');
|
|
9
|
+
|
|
10
|
+
export function AccessoryWidgetBackground(props: AccessoryWidgetBackgroundProps) {
|
|
11
|
+
return <AccessoryWidgetBackgroundNativeView {...props} />;
|
|
12
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { NativeSyntheticEvent } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { Slot } from '../SlotView';
|
|
4
5
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
6
|
import { type CommonViewModifierProps } from '../types';
|
|
6
7
|
|
|
@@ -39,34 +40,25 @@ type NativeConfirmationDialogProps = Omit<ConfirmationDialogProps, 'onIsPresente
|
|
|
39
40
|
const ConfirmationDialogNativeView: React.ComponentType<NativeConfirmationDialogProps> =
|
|
40
41
|
requireNativeView('ExpoUI', 'ConfirmationDialogView');
|
|
41
42
|
|
|
42
|
-
const ConfirmationDialogNativeTrigger: React.ComponentType<{ children: React.ReactNode }> =
|
|
43
|
-
requireNativeView('ExpoUI', 'ConfirmationDialogTrigger');
|
|
44
|
-
|
|
45
|
-
const ConfirmationDialogNativeActions: React.ComponentType<{ children: React.ReactNode }> =
|
|
46
|
-
requireNativeView('ExpoUI', 'ConfirmationDialogActions');
|
|
47
|
-
|
|
48
|
-
const ConfirmationDialogNativeMessage: React.ComponentType<{ children: React.ReactNode }> =
|
|
49
|
-
requireNativeView('ExpoUI', 'ConfirmationDialogMessage');
|
|
50
|
-
|
|
51
43
|
/**
|
|
52
44
|
* The component visible all the time that triggers the confirmation dialog presentation.
|
|
53
45
|
*/
|
|
54
46
|
function Trigger(props: { children: React.ReactNode }) {
|
|
55
|
-
return <
|
|
47
|
+
return <Slot name="trigger">{props.children}</Slot>;
|
|
56
48
|
}
|
|
57
49
|
|
|
58
50
|
/**
|
|
59
51
|
* The action buttons displayed in the confirmation dialog. Use `Button` components from `@expo/ui/swift-ui` as children.
|
|
60
52
|
*/
|
|
61
53
|
function Actions(props: { children: React.ReactNode }) {
|
|
62
|
-
return <
|
|
54
|
+
return <Slot name="actions">{props.children}</Slot>;
|
|
63
55
|
}
|
|
64
56
|
|
|
65
57
|
/**
|
|
66
58
|
* An optional message displayed below the title in the confirmation dialog.
|
|
67
59
|
*/
|
|
68
60
|
function Message(props: { children: React.ReactNode }) {
|
|
69
|
-
return <
|
|
61
|
+
return <Slot name="message">{props.children}</Slot>;
|
|
70
62
|
}
|
|
71
63
|
|
|
72
64
|
/**
|
|
@@ -2,47 +2,33 @@ import { requireNativeView } from 'expo';
|
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
3
|
|
|
4
4
|
import { type ContextMenuProps } from './types';
|
|
5
|
+
import { Slot } from '../SlotView';
|
|
5
6
|
|
|
6
7
|
export { type ContextMenuProps } from './types';
|
|
7
8
|
|
|
8
|
-
const MenuNativeView: ComponentType<NativeMenuProps> = requireNativeView('ExpoUI', 'ContextMenu');
|
|
9
|
-
|
|
10
|
-
const MenuNativeTriggerView: ComponentType<object> = requireNativeView(
|
|
11
|
-
'ExpoUI',
|
|
12
|
-
'ContextMenuActivationElement'
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
const MenuNativePreviewView: ComponentType<object> = requireNativeView(
|
|
16
|
-
'ExpoUI',
|
|
17
|
-
'ContextMenuPreview'
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const MenuNativeItemsView: ComponentType<object> = requireNativeView(
|
|
21
|
-
'ExpoUI',
|
|
22
|
-
'ContextMenuContent'
|
|
23
|
-
);
|
|
24
|
-
|
|
25
9
|
type NativeMenuProps = ContextMenuProps;
|
|
26
10
|
|
|
11
|
+
const MenuNativeView: ComponentType<NativeMenuProps> = requireNativeView('ExpoUI', 'ContextMenu');
|
|
12
|
+
|
|
27
13
|
/**
|
|
28
14
|
* Items visible inside the context menu. It could be `Section`, `Divider`, `Button`, `Toggle`, `Picker` or even `ContextMenu` itself for nested menus. Remember to use components from the `@expo/ui/swift-ui` library.
|
|
29
15
|
*/
|
|
30
16
|
export function Items(props: { children: React.ReactNode }) {
|
|
31
|
-
return <
|
|
17
|
+
return <Slot name="items">{props.children}</Slot>;
|
|
32
18
|
}
|
|
33
19
|
|
|
34
20
|
/**
|
|
35
21
|
* The component visible all the time that triggers the context menu when long-pressed.
|
|
36
22
|
*/
|
|
37
23
|
export function Trigger(props: { children: React.ReactNode }) {
|
|
38
|
-
return <
|
|
24
|
+
return <Slot name="trigger">{props.children}</Slot>;
|
|
39
25
|
}
|
|
40
26
|
|
|
41
27
|
/**
|
|
42
28
|
* The component visible above the menu when it is opened.
|
|
43
29
|
*/
|
|
44
30
|
export function Preview(props: { children: React.ReactNode }) {
|
|
45
|
-
return <
|
|
31
|
+
return <Slot name="preview">{props.children}</Slot>;
|
|
46
32
|
}
|
|
47
33
|
|
|
48
34
|
/**
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { requireNativeView } from 'expo';
|
|
2
|
+
import { type ReactNode, type ComponentType } from 'react';
|
|
3
|
+
import { type SFSymbol } from 'sf-symbols-typescript';
|
|
4
|
+
|
|
5
|
+
import { Slot } from '../SlotView';
|
|
6
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
7
|
+
import { type CommonViewModifierProps } from '../types';
|
|
8
|
+
|
|
9
|
+
export interface ControlGroupProps extends CommonViewModifierProps {
|
|
10
|
+
/**
|
|
11
|
+
* The label for the control group. Can be a string for simple text labels,
|
|
12
|
+
* or a `Label` component for custom label content. When omitted, the control group
|
|
13
|
+
* has no label.
|
|
14
|
+
* @platform iOS 16.0+
|
|
15
|
+
* @platform tvOS 17.0+
|
|
16
|
+
*/
|
|
17
|
+
label?: string | ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* An SF Symbol name to display alongside the label.
|
|
20
|
+
* Only used when `label` is a string.
|
|
21
|
+
* @platform iOS 16.0+
|
|
22
|
+
* @platform tvOS 17.0+
|
|
23
|
+
*/
|
|
24
|
+
systemImage?: SFSymbol;
|
|
25
|
+
/**
|
|
26
|
+
* The control group's content.
|
|
27
|
+
* Can contain `Button`, `Toggle`, `Picker`, or other interactive controls.
|
|
28
|
+
* @platform iOS
|
|
29
|
+
* @platform tvOS 17.0+
|
|
30
|
+
*/
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
type NativeControlGroupProps = Omit<ControlGroupProps, 'label'> & {
|
|
35
|
+
label?: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const ControlGroupNativeView: ComponentType<NativeControlGroupProps> = requireNativeView(
|
|
39
|
+
'ExpoUI',
|
|
40
|
+
'ControlGroupView'
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
export function ControlGroup(props: ControlGroupProps) {
|
|
44
|
+
const { label, children, systemImage, modifiers, ...rest } = props;
|
|
45
|
+
|
|
46
|
+
const isStringLabel = typeof label === 'string';
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<ControlGroupNativeView
|
|
50
|
+
label={isStringLabel ? label : undefined}
|
|
51
|
+
systemImage={systemImage}
|
|
52
|
+
modifiers={modifiers}
|
|
53
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
54
|
+
{...rest}>
|
|
55
|
+
{!isStringLabel && label != null ? <Slot name="label">{label}</Slot> : null}
|
|
56
|
+
{children}
|
|
57
|
+
</ControlGroupNativeView>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
|
|
3
|
+
import { Slot } from '../SlotView';
|
|
3
4
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
4
5
|
import { type CommonViewModifierProps } from '../types';
|
|
5
6
|
|
|
6
|
-
/**
|
|
7
|
-
* The type of gauge label.
|
|
8
|
-
*/
|
|
9
|
-
type GaugeLabelKind = 'label' | 'currentValue' | 'minimumValue' | 'maximumValue';
|
|
10
|
-
|
|
11
7
|
export type GaugeProps = {
|
|
12
8
|
/**
|
|
13
9
|
* The current value of the gauge.
|
|
@@ -53,11 +49,6 @@ const GaugeNativeView: React.ComponentType<NativeGaugeProps> = requireNativeView
|
|
|
53
49
|
'GaugeView'
|
|
54
50
|
);
|
|
55
51
|
|
|
56
|
-
const GaugeLabelNativeView: React.ComponentType<{
|
|
57
|
-
kind: GaugeLabelKind;
|
|
58
|
-
children?: React.ReactNode;
|
|
59
|
-
}> = requireNativeView('ExpoUI', 'GaugeLabelView');
|
|
60
|
-
|
|
61
52
|
/**
|
|
62
53
|
* Renders a SwiftUI `Gauge` component.
|
|
63
54
|
*/
|
|
@@ -76,16 +67,10 @@ export function Gauge(props: GaugeProps) {
|
|
|
76
67
|
modifiers={modifiers}
|
|
77
68
|
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
78
69
|
{...restProps}>
|
|
79
|
-
{children && <
|
|
80
|
-
{currentValueLabel &&
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{minimumValueLabel && (
|
|
84
|
-
<GaugeLabelNativeView kind="minimumValue">{minimumValueLabel}</GaugeLabelNativeView>
|
|
85
|
-
)}
|
|
86
|
-
{maximumValueLabel && (
|
|
87
|
-
<GaugeLabelNativeView kind="maximumValue">{maximumValueLabel}</GaugeLabelNativeView>
|
|
88
|
-
)}
|
|
70
|
+
{children && <Slot name="label">{children}</Slot>}
|
|
71
|
+
{currentValueLabel && <Slot name="currentValue">{currentValueLabel}</Slot>}
|
|
72
|
+
{minimumValueLabel && <Slot name="minimumValue">{minimumValueLabel}</Slot>}
|
|
73
|
+
{maximumValueLabel && <Slot name="maximumValue">{maximumValueLabel}</Slot>}
|
|
89
74
|
</GaugeNativeView>
|
|
90
75
|
);
|
|
91
76
|
}
|
|
@@ -11,7 +11,13 @@ export interface ImageProps extends CommonViewModifierProps {
|
|
|
11
11
|
* The name of the system image (SF Symbol).
|
|
12
12
|
* For example: 'photo', 'heart.fill', 'star.circle'
|
|
13
13
|
*/
|
|
14
|
-
systemName
|
|
14
|
+
systemName?: SFSymbol;
|
|
15
|
+
/**
|
|
16
|
+
* The URI of the local image file to display.
|
|
17
|
+
* For example: 'file:///path/to/image.jpg'
|
|
18
|
+
* Performs a synchronous read operation that blocks the main thread.
|
|
19
|
+
*/
|
|
20
|
+
uiImage?: string;
|
|
15
21
|
/**
|
|
16
22
|
* The size of the system image.
|
|
17
23
|
*/
|
|
@@ -2,6 +2,7 @@ import { requireNativeView } from 'expo';
|
|
|
2
2
|
import type { ColorValue } from 'react-native';
|
|
3
3
|
import { type SFSymbol } from 'sf-symbols-typescript';
|
|
4
4
|
|
|
5
|
+
import { Slot } from '../SlotView';
|
|
5
6
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
6
7
|
import { type CommonViewModifierProps } from '../types';
|
|
7
8
|
|
|
@@ -31,10 +32,6 @@ export type LabelProps = {
|
|
|
31
32
|
|
|
32
33
|
const LabelNativeView: React.ComponentType<LabelProps & { children?: React.ReactNode }> =
|
|
33
34
|
requireNativeView('ExpoUI', 'LabelView');
|
|
34
|
-
const LabelIconNativeView: React.ComponentType<{ children?: React.ReactNode }> = requireNativeView(
|
|
35
|
-
'ExpoUI',
|
|
36
|
-
'LabelIcon'
|
|
37
|
-
);
|
|
38
35
|
|
|
39
36
|
/**
|
|
40
37
|
* Renders a native label view, which could be used in a list or section.
|
|
@@ -49,7 +46,7 @@ export function Label(props: LabelProps) {
|
|
|
49
46
|
modifiers={modifiers}
|
|
50
47
|
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
51
48
|
{...restProps}>
|
|
52
|
-
{icon && <
|
|
49
|
+
{icon && <Slot name="icon">{icon}</Slot>}
|
|
53
50
|
</LabelNativeView>
|
|
54
51
|
);
|
|
55
52
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
|
|
3
|
+
import { Slot } from '../SlotView';
|
|
3
4
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
4
5
|
import { type CommonViewModifierProps } from '../types';
|
|
5
6
|
|
|
@@ -16,16 +17,6 @@ const LabeledContentNativeView: React.ComponentType<LabeledContentProps> = requi
|
|
|
16
17
|
'LabeledContentView'
|
|
17
18
|
);
|
|
18
19
|
|
|
19
|
-
const LabeledContentLabel: React.ComponentType<object> = requireNativeView(
|
|
20
|
-
'ExpoUI',
|
|
21
|
-
'LabeledContentLabel'
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
const LabeledContentContent: React.ComponentType<object> = requireNativeView(
|
|
25
|
-
'ExpoUI',
|
|
26
|
-
'LabeledContentContent'
|
|
27
|
-
);
|
|
28
|
-
|
|
29
20
|
/**
|
|
30
21
|
* LabeledContent component uses the native [LabeledContent](https://developer.apple.com/documentation/swiftui/labeledcontent) component.
|
|
31
22
|
* A container for attaching a label to a value-bearing view.
|
|
@@ -43,8 +34,8 @@ export function LabeledContent(props: LabeledContentProps) {
|
|
|
43
34
|
label={isLabelString ? label : undefined}
|
|
44
35
|
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
45
36
|
{...restProps}>
|
|
46
|
-
{label && !isLabelString && <
|
|
47
|
-
<
|
|
37
|
+
{label && !isLabelString && <Slot name="label">{label}</Slot>}
|
|
38
|
+
<Slot name="content">{children}</Slot>
|
|
48
39
|
</LabeledContentNativeView>
|
|
49
40
|
);
|
|
50
41
|
}
|
|
@@ -2,6 +2,7 @@ import { requireNativeView } from 'expo';
|
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
3
|
|
|
4
4
|
import { type MenuProps } from './types';
|
|
5
|
+
import { Slot } from '../SlotView';
|
|
5
6
|
|
|
6
7
|
export { type MenuProps } from './types';
|
|
7
8
|
|
|
@@ -13,11 +14,6 @@ type NativeMenuProps = Omit<MenuProps, 'label' | 'onPrimaryAction'> & {
|
|
|
13
14
|
|
|
14
15
|
const MenuNativeView: ComponentType<NativeMenuProps> = requireNativeView('ExpoUI', 'MenuView');
|
|
15
16
|
|
|
16
|
-
const MenuNativeLabelView: ComponentType<{ children: React.ReactNode }> = requireNativeView(
|
|
17
|
-
'ExpoUI',
|
|
18
|
-
'MenuLabel'
|
|
19
|
-
);
|
|
20
|
-
|
|
21
17
|
/**
|
|
22
18
|
* Displays a dropdown menu when tapped.
|
|
23
19
|
*/
|
|
@@ -33,7 +29,7 @@ export function Menu(props: MenuProps) {
|
|
|
33
29
|
hasPrimaryAction={onPrimaryAction != null}
|
|
34
30
|
onPrimaryAction={onPrimaryAction}
|
|
35
31
|
{...rest}>
|
|
36
|
-
{!isStringLabel && <
|
|
32
|
+
{!isStringLabel && <Slot name="label">{label}</Slot>}
|
|
37
33
|
{children}
|
|
38
34
|
</MenuNativeView>
|
|
39
35
|
);
|
|
@@ -2,6 +2,7 @@ import { requireNativeView } from 'expo';
|
|
|
2
2
|
import type { NativeSyntheticEvent } from 'react-native';
|
|
3
3
|
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
4
4
|
|
|
5
|
+
import { Slot } from '../SlotView';
|
|
5
6
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
6
7
|
import { type CommonViewModifierProps } from '../types';
|
|
7
8
|
|
|
@@ -42,14 +43,6 @@ const PickerNativeView: React.ComponentType<NativePickerProps> = requireNativeVi
|
|
|
42
43
|
'PickerView'
|
|
43
44
|
);
|
|
44
45
|
|
|
45
|
-
const PickerContentNativeView: React.ComponentType<{ children: React.ReactNode }> =
|
|
46
|
-
requireNativeView('ExpoUI', 'PickerContentView');
|
|
47
|
-
|
|
48
|
-
const PickerLabelNativeView: React.ComponentType<{ children: React.ReactNode }> = requireNativeView(
|
|
49
|
-
'ExpoUI',
|
|
50
|
-
'PickerLabelView'
|
|
51
|
-
);
|
|
52
|
-
|
|
53
46
|
function transformPickerProps<T extends SelectionValueType>(
|
|
54
47
|
props: PickerProps<T>
|
|
55
48
|
): NativePickerProps {
|
|
@@ -81,14 +74,14 @@ export function Picker<T extends SelectionValueType>(props: PickerProps<T>) {
|
|
|
81
74
|
if (typeof label === 'string') {
|
|
82
75
|
return (
|
|
83
76
|
<PickerNativeView {...restProps} label={label}>
|
|
84
|
-
<
|
|
77
|
+
<Slot name="content">{children}</Slot>
|
|
85
78
|
</PickerNativeView>
|
|
86
79
|
);
|
|
87
80
|
} else {
|
|
88
81
|
return (
|
|
89
82
|
<PickerNativeView {...restProps}>
|
|
90
|
-
<
|
|
91
|
-
<
|
|
83
|
+
<Slot name="label">{label}</Slot>
|
|
84
|
+
<Slot name="content">{children}</Slot>
|
|
92
85
|
</PickerNativeView>
|
|
93
86
|
);
|
|
94
87
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { NativeSyntheticEvent } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { Slot } from '../SlotView';
|
|
4
5
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
6
|
import { type CommonViewModifierProps } from '../types';
|
|
6
7
|
|
|
@@ -34,22 +35,12 @@ const PopoverNativeView: React.ComponentType<NativePopoverViewProps> = requireNa
|
|
|
34
35
|
'PopoverView'
|
|
35
36
|
);
|
|
36
37
|
|
|
37
|
-
const PopoverViewContent: React.ComponentType<object> = requireNativeView(
|
|
38
|
-
'ExpoUI',
|
|
39
|
-
'PopoverViewContent'
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
const PopoverViewPopContent: React.ComponentType<object> = requireNativeView(
|
|
43
|
-
'ExpoUI',
|
|
44
|
-
'PopoverViewPopContent'
|
|
45
|
-
);
|
|
46
|
-
|
|
47
38
|
function PopoverTrigger(props: { children: React.ReactNode }) {
|
|
48
|
-
return <
|
|
39
|
+
return <Slot name="trigger">{props.children}</Slot>;
|
|
49
40
|
}
|
|
50
41
|
|
|
51
42
|
function PopoverContent(props: { children: React.ReactNode }) {
|
|
52
|
-
return <
|
|
43
|
+
return <Slot name="popover">{props.children}</Slot>;
|
|
53
44
|
}
|
|
54
45
|
|
|
55
46
|
Popover.Trigger = PopoverTrigger;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
|
|
3
3
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
4
|
-
import { type CommonViewModifierProps } from '../types';
|
|
5
|
-
|
|
6
|
-
export type ClosedRangeDate = { lower: Date; upper: Date };
|
|
4
|
+
import { type ClosedRangeDate, type CommonViewModifierProps } from '../types';
|
|
7
5
|
|
|
8
6
|
export type ProgressViewProps = {
|
|
9
7
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
|
|
3
|
+
import { Slot } from '../SlotView';
|
|
3
4
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
4
5
|
import { type CommonViewModifierProps } from '../types';
|
|
5
6
|
|
|
@@ -45,12 +46,6 @@ const SectionNativeView: React.ComponentType<SectionNativeProps> = requireNative
|
|
|
45
46
|
'SectionView'
|
|
46
47
|
);
|
|
47
48
|
|
|
48
|
-
const SectionHeader: React.ComponentType<object> = requireNativeView('ExpoUI', 'SectionHeader');
|
|
49
|
-
|
|
50
|
-
const SectionFooter: React.ComponentType<object> = requireNativeView('ExpoUI', 'SectionFooter');
|
|
51
|
-
|
|
52
|
-
const SectionContent: React.ComponentType<object> = requireNativeView('ExpoUI', 'SectionContent');
|
|
53
|
-
|
|
54
49
|
/**
|
|
55
50
|
* Section component uses the native [Section](https://developer.apple.com/documentation/swiftui/section) component.
|
|
56
51
|
*/
|
|
@@ -65,9 +60,9 @@ export function Section(props: SectionProps) {
|
|
|
65
60
|
onIsExpandedChange(e.nativeEvent.isExpanded),
|
|
66
61
|
})}
|
|
67
62
|
{...restProps}>
|
|
68
|
-
{header && <
|
|
69
|
-
{footer && <
|
|
70
|
-
<
|
|
63
|
+
{header && <Slot name="header">{header}</Slot>}
|
|
64
|
+
{footer && <Slot name="footer">{footer}</Slot>}
|
|
65
|
+
<Slot name="content">{children}</Slot>
|
|
71
66
|
</SectionNativeView>
|
|
72
67
|
);
|
|
73
68
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import type { NativeSyntheticEvent } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { Slot } from '../SlotView';
|
|
4
5
|
import { type CommonViewModifierProps } from '../types';
|
|
5
6
|
|
|
6
7
|
export type SliderProps = {
|
|
@@ -56,11 +57,6 @@ const SliderNativeView: React.ComponentType<NativeSliderProps> = requireNativeVi
|
|
|
56
57
|
'SliderView'
|
|
57
58
|
);
|
|
58
59
|
|
|
59
|
-
const SliderValueLabelNativeView: React.ComponentType<{
|
|
60
|
-
kind: 'label' | 'minimum' | 'maximum';
|
|
61
|
-
children?: React.ReactNode;
|
|
62
|
-
}> = requireNativeView('ExpoUI', 'SliderLabelView');
|
|
63
|
-
|
|
64
60
|
function transformSliderProps(props: SliderProps): NativeSliderProps {
|
|
65
61
|
const {
|
|
66
62
|
label,
|
|
@@ -90,13 +86,9 @@ export function Slider(props: SliderProps) {
|
|
|
90
86
|
|
|
91
87
|
return (
|
|
92
88
|
<SliderNativeView {...transformSliderProps(props)}>
|
|
93
|
-
{label && <
|
|
94
|
-
{minimumValueLabel &&
|
|
95
|
-
|
|
96
|
-
)}
|
|
97
|
-
{maximumValueLabel && (
|
|
98
|
-
<SliderValueLabelNativeView kind="maximum">{maximumValueLabel}</SliderValueLabelNativeView>
|
|
99
|
-
)}
|
|
89
|
+
{label && <Slot name="label">{label}</Slot>}
|
|
90
|
+
{minimumValueLabel && <Slot name="minimum">{minimumValueLabel}</Slot>}
|
|
91
|
+
{maximumValueLabel && <Slot name="maximum">{maximumValueLabel}</Slot>}
|
|
100
92
|
</SliderNativeView>
|
|
101
93
|
);
|
|
102
94
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { requireNativeView } from 'expo';
|
|
2
|
+
|
|
3
|
+
const SlotNativeView: React.ComponentType<{ name: string; children?: React.ReactNode }> =
|
|
4
|
+
requireNativeView('ExpoUI', 'SlotView');
|
|
5
|
+
|
|
6
|
+
export function Slot({ name, children }: { name: string; children?: React.ReactNode }) {
|
|
7
|
+
return <SlotNativeView name={name}>{children}</SlotNativeView>;
|
|
8
|
+
}
|