@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,207 @@
|
|
|
1
|
+
import { requireNativeView } from 'expo';
|
|
2
|
+
import { type ColorValue } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { ModifierConfig, ViewEvent } from '../../types';
|
|
5
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
6
|
+
|
|
7
|
+
type SlotChildProps = {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type NativeSlotViewProps = {
|
|
12
|
+
slotName: string;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Props shared by all `FloatingActionButton` variants.
|
|
18
|
+
*/
|
|
19
|
+
export type FloatingActionButtonProps = {
|
|
20
|
+
/**
|
|
21
|
+
* Slot-based children (use `.Icon` sub-component).
|
|
22
|
+
*/
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The background color of the button container.
|
|
27
|
+
* Defaults to `FloatingActionButtonDefaults.containerColor` (primary container).
|
|
28
|
+
*/
|
|
29
|
+
containerColor?: ColorValue;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Callback invoked when the button is clicked.
|
|
33
|
+
*/
|
|
34
|
+
onClick?: () => void;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Modifiers for the component.
|
|
38
|
+
*/
|
|
39
|
+
modifiers?: ModifierConfig[];
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Props for the `SmallFloatingActionButton` component.
|
|
44
|
+
* Same as {@link FloatingActionButtonProps}.
|
|
45
|
+
*/
|
|
46
|
+
export type SmallFloatingActionButtonProps = FloatingActionButtonProps;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Props for the `LargeFloatingActionButton` component.
|
|
50
|
+
* Same as {@link FloatingActionButtonProps}.
|
|
51
|
+
*/
|
|
52
|
+
export type LargeFloatingActionButtonProps = FloatingActionButtonProps;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Props for the `ExtendedFloatingActionButton` component.
|
|
56
|
+
*/
|
|
57
|
+
export type ExtendedFloatingActionButtonProps = FloatingActionButtonProps & {
|
|
58
|
+
/**
|
|
59
|
+
* Slot-based children (use `.Icon` and `.Text` sub-components).
|
|
60
|
+
*/
|
|
61
|
+
children: React.ReactNode;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Controls whether the label is shown (expanded) or hidden (collapsed).
|
|
65
|
+
* @default true
|
|
66
|
+
*/
|
|
67
|
+
expanded?: boolean;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @hidden
|
|
72
|
+
*/
|
|
73
|
+
type NativeFloatingActionButtonProps = Omit<FloatingActionButtonProps, 'onClick'> &
|
|
74
|
+
ViewEvent<'onButtonPressed', void> & {
|
|
75
|
+
variant: string;
|
|
76
|
+
expanded?: boolean;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const FloatingActionButtonNativeView: React.ComponentType<NativeFloatingActionButtonProps> =
|
|
80
|
+
requireNativeView('ExpoUI', 'FloatingActionButtonView');
|
|
81
|
+
|
|
82
|
+
const SlotNativeView: React.ComponentType<NativeSlotViewProps> = requireNativeView(
|
|
83
|
+
'ExpoUI',
|
|
84
|
+
'SlotView'
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
function FABIcon(props: SlotChildProps) {
|
|
88
|
+
return <SlotNativeView slotName="icon">{props.children}</SlotNativeView>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function FABText(props: SlotChildProps) {
|
|
92
|
+
return <SlotNativeView slotName="text">{props.children}</SlotNativeView>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function transformProps(
|
|
96
|
+
props: FloatingActionButtonProps & { variant: string; expanded?: boolean }
|
|
97
|
+
): NativeFloatingActionButtonProps {
|
|
98
|
+
const { children, onClick, modifiers, ...restProps } = props;
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
modifiers,
|
|
102
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
103
|
+
...restProps,
|
|
104
|
+
children,
|
|
105
|
+
onButtonPressed: onClick,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Renders a Material Design 3 small `FloatingActionButton`.
|
|
111
|
+
*
|
|
112
|
+
* Wraps [`SmallFloatingActionButton`](https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary#SmallFloatingActionButton(kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.material3.FloatingActionButtonElevation,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0)).
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```tsx
|
|
116
|
+
* import { SmallFloatingActionButton, Host, Icon } from '@expo/ui/jetpack-compose';
|
|
117
|
+
*
|
|
118
|
+
* <Host matchContents>
|
|
119
|
+
* <SmallFloatingActionButton onClick={() => console.log('pressed')}>
|
|
120
|
+
* <SmallFloatingActionButton.Icon>
|
|
121
|
+
* <Icon source={require('./assets/add.xml')} />
|
|
122
|
+
* </SmallFloatingActionButton.Icon>
|
|
123
|
+
* </SmallFloatingActionButton>
|
|
124
|
+
* </Host>
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
function SmallFloatingActionButtonComponent(props: SmallFloatingActionButtonProps) {
|
|
128
|
+
return <FloatingActionButtonNativeView {...transformProps({ ...props, variant: 'small' })} />;
|
|
129
|
+
}
|
|
130
|
+
SmallFloatingActionButtonComponent.Icon = FABIcon;
|
|
131
|
+
export { SmallFloatingActionButtonComponent as SmallFloatingActionButton };
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Renders a Material Design 3 standard `FloatingActionButton`.
|
|
135
|
+
*
|
|
136
|
+
* Wraps [`FloatingActionButton`](https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary#FloatingActionButton(kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.material3.FloatingActionButtonElevation,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0)).
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```tsx
|
|
140
|
+
* import { FloatingActionButton, Host, Icon } from '@expo/ui/jetpack-compose';
|
|
141
|
+
*
|
|
142
|
+
* <Host matchContents>
|
|
143
|
+
* <FloatingActionButton onClick={() => console.log('pressed')}>
|
|
144
|
+
* <FloatingActionButton.Icon>
|
|
145
|
+
* <Icon source={require('./assets/add.xml')} />
|
|
146
|
+
* </FloatingActionButton.Icon>
|
|
147
|
+
* </FloatingActionButton>
|
|
148
|
+
* </Host>
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
function FloatingActionButtonComponent(props: FloatingActionButtonProps) {
|
|
152
|
+
return <FloatingActionButtonNativeView {...transformProps({ ...props, variant: 'medium' })} />;
|
|
153
|
+
}
|
|
154
|
+
FloatingActionButtonComponent.Icon = FABIcon;
|
|
155
|
+
export { FloatingActionButtonComponent as FloatingActionButton };
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Renders a Material Design 3 large `FloatingActionButton`.
|
|
159
|
+
*
|
|
160
|
+
* Wraps [`LargeFloatingActionButton`](https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary#LargeFloatingActionButton(kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.material3.FloatingActionButtonElevation,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0)).
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```tsx
|
|
164
|
+
* import { LargeFloatingActionButton, Host, Icon } from '@expo/ui/jetpack-compose';
|
|
165
|
+
*
|
|
166
|
+
* <Host matchContents>
|
|
167
|
+
* <LargeFloatingActionButton onClick={() => console.log('pressed')}>
|
|
168
|
+
* <LargeFloatingActionButton.Icon>
|
|
169
|
+
* <Icon source={require('./assets/add.xml')} />
|
|
170
|
+
* </LargeFloatingActionButton.Icon>
|
|
171
|
+
* </LargeFloatingActionButton>
|
|
172
|
+
* </Host>
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
function LargeFloatingActionButtonComponent(props: LargeFloatingActionButtonProps) {
|
|
176
|
+
return <FloatingActionButtonNativeView {...transformProps({ ...props, variant: 'large' })} />;
|
|
177
|
+
}
|
|
178
|
+
LargeFloatingActionButtonComponent.Icon = FABIcon;
|
|
179
|
+
export { LargeFloatingActionButtonComponent as LargeFloatingActionButton };
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Renders a Material Design 3 `ExtendedFloatingActionButton` with animated label expansion.
|
|
183
|
+
*
|
|
184
|
+
* Wraps [`ExtendedFloatingActionButton`](https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary#ExtendedFloatingActionButton(kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.material3.FloatingActionButtonElevation,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function1)).
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```tsx
|
|
188
|
+
* import { ExtendedFloatingActionButton, Host, Icon, Text } from '@expo/ui/jetpack-compose';
|
|
189
|
+
*
|
|
190
|
+
* <Host matchContents>
|
|
191
|
+
* <ExtendedFloatingActionButton expanded={true} onClick={() => console.log('pressed')}>
|
|
192
|
+
* <ExtendedFloatingActionButton.Icon>
|
|
193
|
+
* <Icon source={require('./assets/edit.xml')} />
|
|
194
|
+
* </ExtendedFloatingActionButton.Icon>
|
|
195
|
+
* <ExtendedFloatingActionButton.Text>
|
|
196
|
+
* <Text>Edit</Text>
|
|
197
|
+
* </ExtendedFloatingActionButton.Text>
|
|
198
|
+
* </ExtendedFloatingActionButton>
|
|
199
|
+
* </Host>
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
function ExtendedFloatingActionButtonComponent(props: ExtendedFloatingActionButtonProps) {
|
|
203
|
+
return <FloatingActionButtonNativeView {...transformProps({ ...props, variant: 'extended' })} />;
|
|
204
|
+
}
|
|
205
|
+
ExtendedFloatingActionButtonComponent.Icon = FABIcon;
|
|
206
|
+
ExtendedFloatingActionButtonComponent.Text = FABText;
|
|
207
|
+
export { ExtendedFloatingActionButtonComponent as ExtendedFloatingActionButton };
|
|
@@ -21,7 +21,7 @@ export type HorizontalFloatingToolbarProps = {
|
|
|
21
21
|
modifiers?: ExpoModifier[];
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
export type
|
|
24
|
+
export type HorizontalFloatingToolbarFloatingActionButtonProps = {
|
|
25
25
|
/**
|
|
26
26
|
* A callback that is called when the button is pressed.
|
|
27
27
|
*/
|
|
@@ -54,7 +54,9 @@ const SlotNativeView: React.ComponentType<NativeSlotViewProps> = requireNativeVi
|
|
|
54
54
|
* FloatingActionButton component for HorizontalFloatingToolbar.
|
|
55
55
|
* This component marks its children to be rendered in the FAB slot.
|
|
56
56
|
*/
|
|
57
|
-
export function HorizontalFloatingToolbarFloatingActionButton(
|
|
57
|
+
export function HorizontalFloatingToolbarFloatingActionButton(
|
|
58
|
+
props: HorizontalFloatingToolbarFloatingActionButtonProps
|
|
59
|
+
) {
|
|
58
60
|
return (
|
|
59
61
|
<SlotNativeView slotName="floatingActionButton" onSlotEvent={props.onPress}>
|
|
60
62
|
{props.children}
|
|
@@ -1,88 +1,81 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { type ColorValue } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
4
|
+
import type { ModifierConfig, ViewEvent } from '../../types';
|
|
5
|
+
import { transformButtonProps } from '../Button';
|
|
6
|
+
import { type ShapeJSXElement, type ShapeRecordProps } from '../Shape';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
|
-
*
|
|
11
|
-
* - `outlined` - A button with an outline.
|
|
12
|
-
* - `elevated` - A filled button with a shadow.
|
|
9
|
+
* Colors for icon button elements.
|
|
13
10
|
*/
|
|
14
|
-
export type
|
|
11
|
+
export type IconButtonColors = {
|
|
12
|
+
containerColor?: ColorValue;
|
|
13
|
+
contentColor?: ColorValue;
|
|
14
|
+
disabledContainerColor?: ColorValue;
|
|
15
|
+
disabledContentColor?: ColorValue;
|
|
16
|
+
};
|
|
15
17
|
|
|
16
18
|
export type IconButtonProps = {
|
|
17
19
|
/**
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
onPress?: () => void;
|
|
21
|
-
/**
|
|
22
|
-
* The button variant.
|
|
20
|
+
* Callback that is called when the icon button is clicked.
|
|
23
21
|
*/
|
|
24
|
-
|
|
22
|
+
onClick?: () => void;
|
|
25
23
|
/**
|
|
26
|
-
*
|
|
24
|
+
* Whether the icon button is enabled for user interaction.
|
|
25
|
+
* @default true
|
|
27
26
|
*/
|
|
28
|
-
|
|
27
|
+
enabled?: boolean;
|
|
29
28
|
/**
|
|
30
|
-
* Colors for button
|
|
29
|
+
* Colors for icon button elements.
|
|
31
30
|
* @platform android
|
|
32
31
|
*/
|
|
33
|
-
|
|
32
|
+
colors?: IconButtonColors;
|
|
34
33
|
/**
|
|
35
|
-
*
|
|
34
|
+
* The shape of the icon button.
|
|
36
35
|
*/
|
|
37
|
-
color?: ColorValue;
|
|
38
36
|
shape?: ShapeJSXElement;
|
|
39
37
|
/**
|
|
40
|
-
*
|
|
38
|
+
* Modifiers for the component.
|
|
41
39
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
modifiers?: ModifierConfig[];
|
|
44
41
|
/**
|
|
45
|
-
*
|
|
42
|
+
* Content to display inside the icon button.
|
|
46
43
|
*/
|
|
47
|
-
|
|
44
|
+
children: React.ReactNode;
|
|
48
45
|
};
|
|
49
46
|
|
|
50
|
-
|
|
51
|
-
* @hidden
|
|
52
|
-
*/
|
|
53
|
-
export type NativeIconButtonProps = Omit<IconButtonProps, 'role' | 'onPress' | 'shape'> & {
|
|
47
|
+
type NativeIconButtonProps = Omit<IconButtonProps, 'onClick' | 'shape' | 'children'> & {
|
|
54
48
|
shape?: ShapeRecordProps;
|
|
49
|
+
children?: React.ReactNode;
|
|
55
50
|
} & ViewEvent<'onButtonPressed', void>;
|
|
56
51
|
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
'ExpoUI',
|
|
60
|
-
'IconButton'
|
|
61
|
-
);
|
|
52
|
+
function createIconButtonComponent(name: string) {
|
|
53
|
+
const NativeView: React.ComponentType<NativeIconButtonProps> = requireNativeView('ExpoUI', name);
|
|
62
54
|
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
...restProps,
|
|
70
|
-
children,
|
|
71
|
-
shape: parseJSXShape(shape),
|
|
72
|
-
onButtonPressed: onPress,
|
|
73
|
-
elementColors: props.elementColors
|
|
74
|
-
? props.elementColors
|
|
75
|
-
: props.color
|
|
76
|
-
? {
|
|
77
|
-
containerColor: props.color,
|
|
78
|
-
}
|
|
79
|
-
: undefined,
|
|
80
|
-
};
|
|
55
|
+
function Component(props: IconButtonProps) {
|
|
56
|
+
const { children, ...restProps } = props;
|
|
57
|
+
return <NativeView {...transformButtonProps(restProps)}>{children}</NativeView>;
|
|
58
|
+
}
|
|
59
|
+
Component.displayName = name;
|
|
60
|
+
return Component;
|
|
81
61
|
}
|
|
82
62
|
|
|
83
63
|
/**
|
|
84
|
-
*
|
|
64
|
+
* A standard icon button with no background.
|
|
85
65
|
*/
|
|
86
|
-
export
|
|
87
|
-
|
|
88
|
-
|
|
66
|
+
export const IconButton = createIconButtonComponent('IconButton');
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* A filled icon button with a solid background.
|
|
70
|
+
*/
|
|
71
|
+
export const FilledIconButton = createIconButtonComponent('FilledIconButton');
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* A filled tonal icon button with a muted background.
|
|
75
|
+
*/
|
|
76
|
+
export const FilledTonalIconButton = createIconButtonComponent('FilledTonalIconButton');
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* An outlined icon button with a border and no fill.
|
|
80
|
+
*/
|
|
81
|
+
export const OutlinedIconButton = createIconButtonComponent('OutlinedIconButton');
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { requireNativeView } from 'expo';
|
|
2
|
+
|
|
3
|
+
import { type ModifierConfig } from '../../types';
|
|
4
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
|
+
|
|
6
|
+
export type MultiChoiceSegmentedButtonRowProps = {
|
|
7
|
+
/**
|
|
8
|
+
* SegmentedButton children.
|
|
9
|
+
*/
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Modifiers for the component.
|
|
13
|
+
*/
|
|
14
|
+
modifiers?: ModifierConfig[];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const MultiChoiceSegmentedButtonRowNativeView: React.ComponentType<MultiChoiceSegmentedButtonRowProps> =
|
|
18
|
+
requireNativeView('ExpoUI', 'MultiChoiceSegmentedButtonRowView');
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A row container for multi-choice `SegmentedButton` children.
|
|
22
|
+
* Maps to Material 3 `MultiChoiceSegmentedButtonRow`.
|
|
23
|
+
*/
|
|
24
|
+
export function MultiChoiceSegmentedButtonRow(props: MultiChoiceSegmentedButtonRowProps) {
|
|
25
|
+
const { children, modifiers, ...restProps } = props;
|
|
26
|
+
return (
|
|
27
|
+
<MultiChoiceSegmentedButtonRowNativeView
|
|
28
|
+
modifiers={modifiers}
|
|
29
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
30
|
+
{...restProps}>
|
|
31
|
+
{children}
|
|
32
|
+
</MultiChoiceSegmentedButtonRowNativeView>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -1,102 +1,160 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import { ColorValue } from 'react-native';
|
|
2
|
+
import { type ColorValue } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { type ModifierConfig } from '../../types';
|
|
5
5
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* @platform android
|
|
12
|
-
*/
|
|
13
|
-
trackColor?: ColorValue;
|
|
14
|
-
};
|
|
7
|
+
/**
|
|
8
|
+
* Stroke cap style for progress indicators.
|
|
9
|
+
*/
|
|
10
|
+
export type StrokeCap = 'round' | 'butt' | 'square';
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Common props shared by all progress indicator variants.
|
|
14
|
+
*/
|
|
15
|
+
type BaseProgressProps = {
|
|
17
16
|
/**
|
|
18
|
-
* The current progress value
|
|
17
|
+
* The current progress value between `0` and `1`. Omit for indeterminate.
|
|
19
18
|
*/
|
|
20
19
|
progress?: number | null;
|
|
21
20
|
/**
|
|
22
|
-
* Progress color.
|
|
21
|
+
* Progress indicator color.
|
|
23
22
|
*/
|
|
24
23
|
color?: ColorValue;
|
|
25
24
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @platform android
|
|
25
|
+
* Track (background) color.
|
|
28
26
|
*/
|
|
29
|
-
|
|
27
|
+
trackColor?: ColorValue;
|
|
30
28
|
/**
|
|
31
29
|
* Modifiers for the component.
|
|
32
30
|
*/
|
|
33
|
-
modifiers?:
|
|
31
|
+
modifiers?: ModifierConfig[];
|
|
34
32
|
};
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
function transformProps<T extends BaseProgressProps>(props: T): T {
|
|
35
|
+
const { modifiers, ...restProps } = props;
|
|
36
|
+
return {
|
|
37
|
+
modifiers,
|
|
38
|
+
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
39
|
+
...restProps,
|
|
40
|
+
} as T;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function createProgressComponent<P extends BaseProgressProps>(
|
|
44
|
+
viewName: string
|
|
45
|
+
): React.ComponentType<P> {
|
|
46
|
+
const NativeView: React.ComponentType<P> = requireNativeView('ExpoUI', viewName);
|
|
47
|
+
return function ProgressComponent(props: P) {
|
|
48
|
+
return <NativeView {...transformProps(props)} />;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// region LinearProgressIndicator
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Configuration for the stop indicator dot at the end of the determinate linear progress track.
|
|
56
|
+
* When provided, draws a stop indicator with the given options. Omit to use the Compose default.
|
|
57
|
+
*/
|
|
58
|
+
export type DrawStopIndicatorConfig = {
|
|
41
59
|
/**
|
|
42
|
-
*
|
|
60
|
+
* Color of the stop indicator. Defaults to the indicator's color.
|
|
43
61
|
*/
|
|
44
62
|
color?: ColorValue;
|
|
45
63
|
/**
|
|
46
|
-
*
|
|
47
|
-
* @platform android
|
|
64
|
+
* Stroke cap style for the stop indicator. Defaults to the indicator's strokeCap.
|
|
48
65
|
*/
|
|
49
|
-
|
|
66
|
+
strokeCap?: StrokeCap;
|
|
50
67
|
/**
|
|
51
|
-
*
|
|
68
|
+
* Size of the stop indicator in dp. Defaults to the Material 3 default.
|
|
52
69
|
*/
|
|
53
|
-
|
|
70
|
+
stopSize?: number;
|
|
54
71
|
};
|
|
55
72
|
|
|
56
|
-
type
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
73
|
+
export type LinearProgressIndicatorProps = BaseProgressProps & {
|
|
74
|
+
/**
|
|
75
|
+
* Stroke cap style for the indicator ends.
|
|
76
|
+
* @default 'round'
|
|
77
|
+
*/
|
|
78
|
+
strokeCap?: StrokeCap;
|
|
79
|
+
/**
|
|
80
|
+
* Gap size between the indicator and track in dp.
|
|
81
|
+
*/
|
|
82
|
+
gapSize?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Configuration for the stop indicator dot at the end of the determinate progress track.
|
|
85
|
+
*/
|
|
86
|
+
drawStopIndicator?: DrawStopIndicatorConfig;
|
|
87
|
+
};
|
|
61
88
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
89
|
+
/**
|
|
90
|
+
* A linear progress indicator that displays progress in a horizontal bar.
|
|
91
|
+
*
|
|
92
|
+
* Matches the Jetpack Compose `LinearProgressIndicator`.
|
|
93
|
+
*/
|
|
94
|
+
export const LinearProgressIndicator = createProgressComponent<LinearProgressIndicatorProps>(
|
|
95
|
+
'LinearProgressIndicatorView'
|
|
65
96
|
);
|
|
66
97
|
|
|
67
|
-
|
|
68
|
-
const { modifiers, ...restProps } = props;
|
|
69
|
-
return {
|
|
70
|
-
modifiers,
|
|
71
|
-
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
72
|
-
...restProps,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
98
|
+
// endregion
|
|
75
99
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
100
|
+
// region CircularProgressIndicator
|
|
101
|
+
|
|
102
|
+
export type CircularProgressIndicatorProps = BaseProgressProps & {
|
|
103
|
+
/**
|
|
104
|
+
* Width of the circular stroke in dp.
|
|
105
|
+
*/
|
|
106
|
+
strokeWidth?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Stroke cap style for the indicator ends.
|
|
109
|
+
* @default 'round'
|
|
110
|
+
*/
|
|
111
|
+
strokeCap?: StrokeCap;
|
|
112
|
+
/**
|
|
113
|
+
* Gap size between the indicator and track in dp.
|
|
114
|
+
*/
|
|
115
|
+
gapSize?: number;
|
|
116
|
+
};
|
|
82
117
|
|
|
83
118
|
/**
|
|
84
|
-
*
|
|
119
|
+
* A circular progress indicator that displays progress in a circular format.
|
|
120
|
+
*
|
|
121
|
+
* Matches the Jetpack Compose `CircularProgressIndicator`.
|
|
85
122
|
*/
|
|
86
|
-
export
|
|
87
|
-
|
|
88
|
-
|
|
123
|
+
export const CircularProgressIndicator = createProgressComponent<CircularProgressIndicatorProps>(
|
|
124
|
+
'CircularProgressIndicatorView'
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
// endregion
|
|
128
|
+
|
|
129
|
+
// region LinearWavyProgressIndicator
|
|
130
|
+
|
|
131
|
+
export type LinearWavyProgressIndicatorProps = BaseProgressProps & {
|
|
132
|
+
/**
|
|
133
|
+
* Size of the stop indicator in dp at the end of the determinate progress track.
|
|
134
|
+
*/
|
|
135
|
+
stopSize?: number;
|
|
136
|
+
};
|
|
89
137
|
|
|
90
138
|
/**
|
|
91
|
-
*
|
|
139
|
+
* A linear progress indicator with wavy animation style.
|
|
140
|
+
*
|
|
141
|
+
* Matches the Jetpack Compose `LinearWavyProgressIndicator`.
|
|
92
142
|
*/
|
|
93
|
-
export
|
|
94
|
-
|
|
95
|
-
|
|
143
|
+
export const LinearWavyProgressIndicator =
|
|
144
|
+
createProgressComponent<LinearWavyProgressIndicatorProps>('LinearWavyProgressIndicatorView');
|
|
145
|
+
|
|
146
|
+
// endregion
|
|
147
|
+
|
|
148
|
+
// region CircularWavyProgressIndicator
|
|
149
|
+
|
|
150
|
+
export type CircularWavyProgressIndicatorProps = BaseProgressProps;
|
|
96
151
|
|
|
97
152
|
/**
|
|
98
|
-
*
|
|
153
|
+
* A circular progress indicator with wavy animation style.
|
|
154
|
+
*
|
|
155
|
+
* Matches the Jetpack Compose `CircularWavyProgressIndicator`.
|
|
99
156
|
*/
|
|
100
|
-
export
|
|
101
|
-
|
|
102
|
-
|
|
157
|
+
export const CircularWavyProgressIndicator =
|
|
158
|
+
createProgressComponent<CircularWavyProgressIndicatorProps>('CircularWavyProgressIndicatorView');
|
|
159
|
+
|
|
160
|
+
// endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
|
|
3
|
-
import { type
|
|
3
|
+
import { type ModifierConfig, type ViewEvent } from '../../types';
|
|
4
4
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
5
|
|
|
6
6
|
export type RadioButtonProps = {
|
|
@@ -15,12 +15,13 @@ export type RadioButtonProps = {
|
|
|
15
15
|
/**
|
|
16
16
|
* Modifiers for the component.
|
|
17
17
|
*/
|
|
18
|
-
modifiers?:
|
|
18
|
+
modifiers?: ModifierConfig[];
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
type NativeRadioButtonProps = Omit<RadioButtonProps, 'onClick'> &
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
type NativeRadioButtonProps = Omit<RadioButtonProps, 'onClick'> &
|
|
22
|
+
ViewEvent<'onButtonPressed', void> & {
|
|
23
|
+
clickable: boolean;
|
|
24
|
+
};
|
|
24
25
|
|
|
25
26
|
const RadioButtonNativeView: React.ComponentType<NativeRadioButtonProps> = requireNativeView(
|
|
26
27
|
'ExpoUI',
|
|
@@ -33,10 +34,8 @@ function transformProps(props: RadioButtonProps): NativeRadioButtonProps {
|
|
|
33
34
|
modifiers,
|
|
34
35
|
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
35
36
|
...restProps,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
onClick?.();
|
|
39
|
-
},
|
|
37
|
+
clickable: onClick != null,
|
|
38
|
+
onButtonPressed: () => onClick?.(),
|
|
40
39
|
};
|
|
41
40
|
}
|
|
42
41
|
|