@expo/ui 55.0.2 → 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 +31 -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 +258 -70
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +204 -57
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +44 -1
- package/android/src/main/java/expo/modules/ui/ProgressView.kt +189 -89
- 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 +53 -161
- 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 -86
- 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 +38 -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/Switch/index.d.ts +10 -50
- 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/index.d.ts +18 -1
- package/build/jetpack-compose/modifiers/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/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/modifiers/index.d.ts +22 -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/BottomSheetView.swift +1 -6
- package/ios/ClosedRangeDateRecord.swift +10 -0
- package/ios/ColorPickerView.swift +9 -8
- package/ios/ConfirmationDialog/ConfirmationDialog.swift +4 -6
- package/ios/DatePickerView.swift +7 -5
- package/ios/DisclosureGroupView.swift +5 -7
- package/ios/ListView.swift +6 -14
- package/ios/Modifiers/DefaultScrollAnchorForRoleModifier.swift +32 -0
- package/ios/Modifiers/DefaultScrollAnchorModifier.swift +16 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +8 -0
- package/ios/Picker/PickerView.swift +6 -10
- package/ios/Popover/PopoverView.swift +3 -5
- package/ios/ProgressView.swift +0 -5
- package/ios/SectionView.swift +3 -5
- package/ios/SliderView.swift +8 -6
- package/ios/StepperView.swift +12 -16
- package/ios/TextView.swift +37 -1
- package/ios/Toggle/ToggleView.swift +5 -7
- 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.2/expo.modules.ui-55.0.2.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.2/expo.modules.ui-55.0.2.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 +112 -7
- 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/Switch/index.tsx +17 -87
- package/src/jetpack-compose/ToggleButton/index.tsx +67 -43
- package/src/jetpack-compose/index.ts +5 -4
- package/src/jetpack-compose/modifiers/index.ts +26 -2
- package/src/swift-ui/ProgressView/index.tsx +1 -3
- package/src/swift-ui/Stepper/index.tsx +7 -7
- package/src/swift-ui/Text/index.tsx +66 -2
- package/src/swift-ui/modifiers/index.ts +40 -0
- 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/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.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
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
package expo.modules.ui
|
|
2
|
-
|
|
3
|
-
import android.graphics.Color
|
|
4
|
-
import androidx.compose.foundation.layout.Column
|
|
5
|
-
import androidx.compose.foundation.layout.Row
|
|
6
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
7
|
-
import androidx.compose.foundation.layout.height
|
|
8
|
-
import androidx.compose.foundation.layout.padding
|
|
9
|
-
import androidx.compose.foundation.selection.selectable
|
|
10
|
-
import androidx.compose.foundation.selection.selectableGroup
|
|
11
|
-
import androidx.compose.material3.RadioButton
|
|
12
|
-
import androidx.compose.material3.SegmentedButton
|
|
13
|
-
import androidx.compose.material3.SegmentedButtonDefaults
|
|
14
|
-
import androidx.compose.material3.SingleChoiceSegmentedButtonRow
|
|
15
|
-
import androidx.compose.material3.Text
|
|
16
|
-
import androidx.compose.runtime.Composable
|
|
17
|
-
import androidx.compose.ui.Alignment
|
|
18
|
-
import androidx.compose.ui.Modifier
|
|
19
|
-
import androidx.compose.ui.semantics.Role
|
|
20
|
-
import androidx.compose.ui.unit.dp
|
|
21
|
-
import expo.modules.kotlin.records.Field
|
|
22
|
-
import expo.modules.kotlin.records.Record
|
|
23
|
-
import expo.modules.kotlin.views.ComposeProps
|
|
24
|
-
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
25
|
-
|
|
26
|
-
class PickerColors : Record {
|
|
27
|
-
@Field
|
|
28
|
-
val activeBorderColor: Color? = null
|
|
29
|
-
|
|
30
|
-
@Field
|
|
31
|
-
val activeContentColor: Color? = null
|
|
32
|
-
|
|
33
|
-
@Field
|
|
34
|
-
val inactiveBorderColor: Color? = null
|
|
35
|
-
|
|
36
|
-
@Field
|
|
37
|
-
val inactiveContentColor: Color? = null
|
|
38
|
-
|
|
39
|
-
@Field
|
|
40
|
-
val disabledActiveBorderColor: Color? = null
|
|
41
|
-
|
|
42
|
-
@Field
|
|
43
|
-
val disabledActiveContentColor: Color? = null
|
|
44
|
-
|
|
45
|
-
@Field
|
|
46
|
-
val disabledInactiveBorderColor: Color? = null
|
|
47
|
-
|
|
48
|
-
@Field
|
|
49
|
-
val disabledInactiveContentColor: Color? = null
|
|
50
|
-
|
|
51
|
-
@Field
|
|
52
|
-
val activeContainerColor: Color? = null
|
|
53
|
-
|
|
54
|
-
@Field
|
|
55
|
-
val inactiveContainerColor: Color? = null
|
|
56
|
-
|
|
57
|
-
@Field
|
|
58
|
-
val disabledActiveContainerColor: Color? = null
|
|
59
|
-
|
|
60
|
-
@Field
|
|
61
|
-
val disabledInactiveContainerColor: Color? = null
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
data class PickerProps(
|
|
65
|
-
val options: Array<String> = emptyArray(),
|
|
66
|
-
val selectedIndex: Int? = null,
|
|
67
|
-
val elementColors: PickerColors = PickerColors(),
|
|
68
|
-
val variant: String = "segmented",
|
|
69
|
-
val buttonModifiers: List<ModifierType> = emptyList(),
|
|
70
|
-
val modifiers: ModifierList = emptyList()
|
|
71
|
-
) : ComposeProps
|
|
72
|
-
|
|
73
|
-
data class PickerOptionSelectedEvent(
|
|
74
|
-
@Field val index: Int,
|
|
75
|
-
@Field val label: String
|
|
76
|
-
) : Record
|
|
77
|
-
|
|
78
|
-
@Composable
|
|
79
|
-
fun FunctionalComposableScope.PickerContent(
|
|
80
|
-
props: PickerProps,
|
|
81
|
-
onOptionSelected: (PickerOptionSelectedEvent) -> Unit
|
|
82
|
-
) {
|
|
83
|
-
val selectedIndex = props.selectedIndex
|
|
84
|
-
val options = props.options
|
|
85
|
-
val colors = props.elementColors
|
|
86
|
-
val variant = props.variant
|
|
87
|
-
|
|
88
|
-
@Composable
|
|
89
|
-
fun SegmentedComposable() {
|
|
90
|
-
SingleChoiceSegmentedButtonRow(
|
|
91
|
-
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
92
|
-
) {
|
|
93
|
-
options.forEachIndexed { index, label ->
|
|
94
|
-
SegmentedButton(
|
|
95
|
-
shape = SegmentedButtonDefaults.itemShape(
|
|
96
|
-
index = index,
|
|
97
|
-
count = options.size
|
|
98
|
-
),
|
|
99
|
-
onClick = {
|
|
100
|
-
onOptionSelected(PickerOptionSelectedEvent(index, label))
|
|
101
|
-
},
|
|
102
|
-
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher),
|
|
103
|
-
selected = index == selectedIndex,
|
|
104
|
-
label = { Text(label) },
|
|
105
|
-
colors = SegmentedButtonDefaults.colors(
|
|
106
|
-
activeBorderColor = colors.activeBorderColor.compose,
|
|
107
|
-
activeContentColor = colors.activeContentColor.compose,
|
|
108
|
-
inactiveBorderColor = colors.inactiveBorderColor.compose,
|
|
109
|
-
inactiveContentColor = colors.inactiveContentColor.compose,
|
|
110
|
-
disabledActiveBorderColor = colors.disabledActiveBorderColor.compose,
|
|
111
|
-
disabledActiveContentColor = colors.disabledActiveContentColor.compose,
|
|
112
|
-
disabledInactiveBorderColor = colors.disabledInactiveBorderColor.compose,
|
|
113
|
-
disabledInactiveContentColor = colors.disabledInactiveContentColor.compose,
|
|
114
|
-
activeContainerColor = colors.activeContainerColor.compose,
|
|
115
|
-
inactiveContainerColor = colors.inactiveContainerColor.compose,
|
|
116
|
-
disabledActiveContainerColor = colors.disabledActiveContainerColor.compose,
|
|
117
|
-
disabledInactiveContainerColor = colors.disabledInactiveContainerColor.compose
|
|
118
|
-
)
|
|
119
|
-
)
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
@Composable
|
|
125
|
-
fun RadioComposable() {
|
|
126
|
-
Column(Modifier.selectableGroup()) {
|
|
127
|
-
options.forEachIndexed { index, label ->
|
|
128
|
-
Row(
|
|
129
|
-
Modifier.fillMaxWidth()
|
|
130
|
-
.height(28.dp)
|
|
131
|
-
.selectable(
|
|
132
|
-
selected = index == selectedIndex,
|
|
133
|
-
onClick = {
|
|
134
|
-
onOptionSelected(PickerOptionSelectedEvent(index, label))
|
|
135
|
-
},
|
|
136
|
-
role = Role.RadioButton
|
|
137
|
-
),
|
|
138
|
-
verticalAlignment = Alignment.CenterVertically
|
|
139
|
-
) {
|
|
140
|
-
RadioButton(
|
|
141
|
-
selected = index == selectedIndex,
|
|
142
|
-
onClick = null
|
|
143
|
-
)
|
|
144
|
-
Text(
|
|
145
|
-
text = label,
|
|
146
|
-
modifier = Modifier.padding(start = 12.dp)
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (variant == "segmented") {
|
|
154
|
-
SegmentedComposable()
|
|
155
|
-
} else if (variant == "radio") {
|
|
156
|
-
RadioComposable()
|
|
157
|
-
} else {
|
|
158
|
-
// Default to segmented picker
|
|
159
|
-
SegmentedComposable()
|
|
160
|
-
}
|
|
161
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
package expo.modules.ui
|
|
2
|
-
|
|
3
|
-
import android.graphics.Color
|
|
4
|
-
import androidx.compose.material3.Text
|
|
5
|
-
import androidx.compose.material3.TextButton
|
|
6
|
-
import androidx.compose.runtime.Composable
|
|
7
|
-
import expo.modules.kotlin.views.ComposeProps
|
|
8
|
-
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
9
|
-
import expo.modules.ui.button.ButtonPressedEvent
|
|
10
|
-
|
|
11
|
-
data class TextButtonProps(
|
|
12
|
-
val text: String = "",
|
|
13
|
-
val color: Color? = null,
|
|
14
|
-
val disabled: Boolean = false,
|
|
15
|
-
val modifiers: ModifierList = emptyList()
|
|
16
|
-
) : ComposeProps
|
|
17
|
-
|
|
18
|
-
@Composable
|
|
19
|
-
fun FunctionalComposableScope.TextButtonContent(
|
|
20
|
-
props: TextButtonProps,
|
|
21
|
-
onButtonPressed: (ButtonPressedEvent) -> Unit
|
|
22
|
-
) {
|
|
23
|
-
TextButton(
|
|
24
|
-
onClick = { onButtonPressed(ButtonPressedEvent()) },
|
|
25
|
-
enabled = !props.disabled,
|
|
26
|
-
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
27
|
-
) {
|
|
28
|
-
Text(
|
|
29
|
-
text = props.text,
|
|
30
|
-
color = props.color.composeOrNull ?: androidx.compose.ui.graphics.Color.Unspecified
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
package expo.modules.ui.menu
|
|
2
|
-
|
|
3
|
-
import androidx.compose.foundation.background
|
|
4
|
-
import androidx.compose.foundation.layout.Arrangement
|
|
5
|
-
import androidx.compose.foundation.layout.Box
|
|
6
|
-
import androidx.compose.foundation.layout.Row
|
|
7
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
8
|
-
import androidx.compose.foundation.layout.padding
|
|
9
|
-
import androidx.compose.foundation.layout.wrapContentSize
|
|
10
|
-
import androidx.compose.material3.DropdownMenu
|
|
11
|
-
import androidx.compose.material3.DropdownMenuItem
|
|
12
|
-
import androidx.compose.material3.HorizontalDivider
|
|
13
|
-
import androidx.compose.material3.Icon
|
|
14
|
-
import androidx.compose.material3.MaterialTheme
|
|
15
|
-
import androidx.compose.material3.MenuDefaults
|
|
16
|
-
import androidx.compose.material3.MenuItemColors
|
|
17
|
-
import androidx.compose.material3.Text
|
|
18
|
-
import androidx.compose.runtime.Composable
|
|
19
|
-
import androidx.compose.runtime.CompositionLocalProvider
|
|
20
|
-
import androidx.compose.runtime.MutableState
|
|
21
|
-
import androidx.compose.runtime.compositionLocalOf
|
|
22
|
-
import androidx.compose.runtime.mutableStateOf
|
|
23
|
-
import androidx.compose.runtime.remember
|
|
24
|
-
import androidx.compose.ui.Alignment
|
|
25
|
-
import androidx.compose.ui.Modifier
|
|
26
|
-
import androidx.compose.ui.unit.dp
|
|
27
|
-
import expo.modules.kotlin.viewevent.ViewEventCallback
|
|
28
|
-
import expo.modules.kotlin.views.ComposableScope
|
|
29
|
-
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
30
|
-
import expo.modules.ui.ModifierRegistry
|
|
31
|
-
import expo.modules.ui.ThemedHybridSwitch
|
|
32
|
-
import expo.modules.ui.compose
|
|
33
|
-
import expo.modules.ui.composeOrNull
|
|
34
|
-
import expo.modules.ui.getImageVector
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* CompositionLocal that allows child composables (like Button) to trigger ContextMenu expansion.
|
|
38
|
-
* When a Button is inside a ContextMenu, it can use this to open the menu on click.
|
|
39
|
-
*/
|
|
40
|
-
val LocalContextMenuExpanded = compositionLocalOf<MutableState<Boolean>?> { null }
|
|
41
|
-
|
|
42
|
-
@Composable
|
|
43
|
-
private fun SectionTitle(text: String) {
|
|
44
|
-
Text(
|
|
45
|
-
text = text,
|
|
46
|
-
style = MaterialTheme.typography.labelSmall,
|
|
47
|
-
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
|
48
|
-
modifier = Modifier
|
|
49
|
-
.fillMaxWidth()
|
|
50
|
-
.padding(start = 16.dp, top = 8.dp, end = 16.dp, bottom = 4.dp)
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@Composable
|
|
55
|
-
fun FlatMenu(elements: Array<ContextMenuElement>, sectionTitle: String?, dispatchers: ContextMenuDispatchers, expanded: MutableState<Boolean>) {
|
|
56
|
-
sectionTitle?.takeIf { !it.isEmpty() }?.let {
|
|
57
|
-
SectionTitle(it)
|
|
58
|
-
}
|
|
59
|
-
elements.forEachIndexed { index, element ->
|
|
60
|
-
val id = element.contextMenuElementID
|
|
61
|
-
element.button?.let {
|
|
62
|
-
DropdownMenuItem(
|
|
63
|
-
colors = MenuItemColors(
|
|
64
|
-
textColor = it.elementColors.contentColor.compose,
|
|
65
|
-
leadingIconColor = it.elementColors.contentColor.compose,
|
|
66
|
-
trailingIconColor = it.elementColors.contentColor.compose,
|
|
67
|
-
disabledTextColor = it.elementColors.disabledContentColor.compose,
|
|
68
|
-
disabledLeadingIconColor = it.elementColors.disabledContentColor.compose,
|
|
69
|
-
disabledTrailingIconColor = it.elementColors.disabledContentColor.compose
|
|
70
|
-
),
|
|
71
|
-
enabled = !it.disabled,
|
|
72
|
-
modifier = Modifier.background(it.elementColors.containerColor.compose),
|
|
73
|
-
text = { Text(it.text) },
|
|
74
|
-
leadingIcon = it.leadingIcon?.let { iconName ->
|
|
75
|
-
{
|
|
76
|
-
getImageVector(iconName)?.let { imageVector ->
|
|
77
|
-
Icon(
|
|
78
|
-
imageVector = imageVector,
|
|
79
|
-
contentDescription = iconName
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
trailingIcon = it.trailingIcon?.let { iconName ->
|
|
85
|
-
{
|
|
86
|
-
getImageVector(iconName)?.let { imageVector ->
|
|
87
|
-
Icon(
|
|
88
|
-
imageVector = imageVector,
|
|
89
|
-
contentDescription = iconName
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
onClick = {
|
|
95
|
-
dispatchers.buttonPressed(ContextMenuButtonPressedEvent(id))
|
|
96
|
-
expanded.value = false
|
|
97
|
-
}
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
element.switch?.let {
|
|
102
|
-
DropdownMenuItem(
|
|
103
|
-
text = {
|
|
104
|
-
Row(verticalAlignment = Alignment.CenterVertically) {
|
|
105
|
-
Text(it.label)
|
|
106
|
-
Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.End) {
|
|
107
|
-
ThemedHybridSwitch(
|
|
108
|
-
variant = it.variant,
|
|
109
|
-
checked = it.value,
|
|
110
|
-
onCheckedChange = null,
|
|
111
|
-
colors = it.elementColors,
|
|
112
|
-
modifier = Modifier
|
|
113
|
-
.padding(horizontal = 5.dp)
|
|
114
|
-
.wrapContentSize(Alignment.CenterEnd)
|
|
115
|
-
)
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
modifier = Modifier.wrapContentSize(Alignment.Center),
|
|
120
|
-
onClick = {
|
|
121
|
-
dispatchers.switchCheckedChanged(
|
|
122
|
-
ContextMenuSwitchValueChangeEvent(!it.value, id)
|
|
123
|
-
)
|
|
124
|
-
expanded.value = false
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
element.submenu?.let {
|
|
130
|
-
HorizontalDivider()
|
|
131
|
-
FlatMenu(it.elements, it.button.text, dispatchers, expanded)
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
data class ContextMenuDispatchers(
|
|
137
|
-
val buttonPressed: ViewEventCallback<ContextMenuButtonPressedEvent>,
|
|
138
|
-
val switchCheckedChanged: ViewEventCallback<ContextMenuSwitchValueChangeEvent>
|
|
139
|
-
)
|
|
140
|
-
|
|
141
|
-
@Composable
|
|
142
|
-
fun FunctionalComposableScope.ContextMenuContent(
|
|
143
|
-
props: ContextMenuProps,
|
|
144
|
-
onContextMenuButtonPressed: (ContextMenuButtonPressedEvent) -> Unit,
|
|
145
|
-
onContextMenuSwitchValueChanged: (ContextMenuSwitchValueChangeEvent) -> Unit,
|
|
146
|
-
onExpandedChanged: (ExpandedChangedEvent) -> Unit
|
|
147
|
-
) {
|
|
148
|
-
val expanded = remember { mutableStateOf(false) }
|
|
149
|
-
val elements = props.elements
|
|
150
|
-
val color = props.color
|
|
151
|
-
|
|
152
|
-
// Provide expanded state to children via CompositionLocal
|
|
153
|
-
// This allows Button children to trigger menu expansion
|
|
154
|
-
CompositionLocalProvider(LocalContextMenuExpanded provides expanded) {
|
|
155
|
-
Box(modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)) {
|
|
156
|
-
// Trigger button - Button will automatically expand menu when clicked
|
|
157
|
-
Children(ComposableScope())
|
|
158
|
-
|
|
159
|
-
DropdownMenu(
|
|
160
|
-
containerColor = color?.composeOrNull ?: MenuDefaults.containerColor,
|
|
161
|
-
expanded = expanded.value,
|
|
162
|
-
onDismissRequest = {
|
|
163
|
-
expanded.value = false
|
|
164
|
-
onExpandedChanged(ExpandedChangedEvent(false))
|
|
165
|
-
}
|
|
166
|
-
) {
|
|
167
|
-
FlatMenu(
|
|
168
|
-
elements,
|
|
169
|
-
null,
|
|
170
|
-
dispatchers = ContextMenuDispatchers(
|
|
171
|
-
buttonPressed = onContextMenuButtonPressed,
|
|
172
|
-
switchCheckedChanged = onContextMenuSwitchValueChanged
|
|
173
|
-
),
|
|
174
|
-
expanded = expanded
|
|
175
|
-
)
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
data class ExpandedChangedEvent(
|
|
182
|
-
@expo.modules.kotlin.records.Field val expanded: Boolean
|
|
183
|
-
) : expo.modules.kotlin.records.Record
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
package expo.modules.ui.menu
|
|
2
|
-
|
|
3
|
-
import android.graphics.Color
|
|
4
|
-
import expo.modules.kotlin.records.Field
|
|
5
|
-
import expo.modules.kotlin.records.Record
|
|
6
|
-
import expo.modules.kotlin.types.Enumerable
|
|
7
|
-
import expo.modules.kotlin.views.ComposeProps
|
|
8
|
-
import expo.modules.ui.ModifierList
|
|
9
|
-
import expo.modules.ui.SwitchColors
|
|
10
|
-
import expo.modules.ui.ValueChangeEvent
|
|
11
|
-
import expo.modules.ui.button.ButtonColors
|
|
12
|
-
import expo.modules.ui.button.ButtonPressedEvent
|
|
13
|
-
import expo.modules.ui.button.ButtonVariant
|
|
14
|
-
import java.io.Serializable
|
|
15
|
-
|
|
16
|
-
enum class ActivationMethod(val value: String) : Enumerable {
|
|
17
|
-
SINGLE_PRESS("singlePress"),
|
|
18
|
-
LONG_PRESS("longPress")
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
data class Submenu(
|
|
22
|
-
@Field val elements: Array<ContextMenuElement> = emptyArray(),
|
|
23
|
-
@Field val button: ContextMenuButtonProps
|
|
24
|
-
) : Record, Serializable
|
|
25
|
-
|
|
26
|
-
data class ContextMenuElement(
|
|
27
|
-
@Field var button: ContextMenuButtonProps? = null,
|
|
28
|
-
@Field var switch: ContextMenuSwitchProps? = null,
|
|
29
|
-
@Field var submenu: Submenu? = null,
|
|
30
|
-
@Field var contextMenuElementID: String
|
|
31
|
-
) : Record, Serializable
|
|
32
|
-
|
|
33
|
-
data class ContextMenuProps(
|
|
34
|
-
val text: String = "",
|
|
35
|
-
val elements: Array<ContextMenuElement> = emptyArray(),
|
|
36
|
-
val activationMethod: ActivationMethod = ActivationMethod.SINGLE_PRESS,
|
|
37
|
-
val color: Color? = null,
|
|
38
|
-
val modifiers: ModifierList = emptyList()
|
|
39
|
-
) : ComposeProps
|
|
40
|
-
|
|
41
|
-
class ContextMenuButtonProps(
|
|
42
|
-
@Field val text: String = "",
|
|
43
|
-
@Field val variant: ButtonVariant? = ButtonVariant.DEFAULT,
|
|
44
|
-
@Field val elementColors: ButtonColors = ButtonColors(),
|
|
45
|
-
@Field val leadingIcon: String? = null,
|
|
46
|
-
@Field val trailingIcon: String? = null,
|
|
47
|
-
@Field val disabled: Boolean = false
|
|
48
|
-
) : Record, Serializable
|
|
49
|
-
|
|
50
|
-
class ContextMenuSwitchProps(
|
|
51
|
-
@Field val value: Boolean = false,
|
|
52
|
-
@Field val label: String = "",
|
|
53
|
-
@Field var variant: String = "",
|
|
54
|
-
@Field var elementColors: SwitchColors = SwitchColors()
|
|
55
|
-
) : Record, Serializable
|
|
56
|
-
|
|
57
|
-
open class ContextMenuButtonPressedEvent(
|
|
58
|
-
@Field val contextMenuElementID: String
|
|
59
|
-
) : ButtonPressedEvent()
|
|
60
|
-
|
|
61
|
-
class ContextMenuSwitchValueChangeEvent(
|
|
62
|
-
@Field override val value: Boolean = false,
|
|
63
|
-
@Field val contextMenuElementID: String
|
|
64
|
-
) : ValueChangeEvent()
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
type Variant = 'rounded' | 'twotone' | 'outlined' | 'filled' | 'sharp';
|
|
2
|
-
type Icon = 'AccountBox' | 'AccountCircle' | 'Add' | 'AddCircle' | 'ArrowBack' | 'ArrowDropDown' | 'ArrowForward' | 'Build' | 'Call' | 'Check' | 'CheckCircle' | 'Clear' | 'Close' | 'Contrast' | 'Create' | 'DarkMode' | 'DateRange' | 'Delete' | 'Done' | 'Edit' | 'Email' | 'ExitToApp' | 'Face' | 'Favorite' | 'FavoriteBorder' | 'Home' | 'Info' | 'KeyboardArrowDown' | 'KeyboardArrowLeft' | 'KeyboardArrowRight' | 'KeyboardArrowUp' | 'LightMode' | 'List' | 'LocationOn' | 'Lock' | 'MailOutline' | 'Menu' | 'MoreVert' | 'Notifications' | 'Person' | 'Phone' | 'Place' | 'PlayArrow' | 'Refresh' | 'Search' | 'Send' | 'Settings' | 'Share' | 'ShoppingCart' | 'Star' | 'ThumbUp' | 'Warning';
|
|
3
|
-
export type MaterialIcon = `${Variant}.${Icon}`;
|
|
4
|
-
export {};
|
|
5
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/Button/types.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEvE,KAAK,IAAI,GACL,YAAY,GACZ,eAAe,GACf,KAAK,GACL,WAAW,GACX,WAAW,GACX,eAAe,GACf,cAAc,GACd,OAAO,GACP,MAAM,GACN,OAAO,GACP,aAAa,GACb,OAAO,GACP,OAAO,GACP,UAAU,GACV,QAAQ,GACR,UAAU,GACV,WAAW,GACX,QAAQ,GACR,MAAM,GACN,MAAM,GACN,OAAO,GACP,WAAW,GACX,MAAM,GACN,UAAU,GACV,gBAAgB,GAChB,MAAM,GACN,MAAM,GACN,mBAAmB,GACnB,mBAAmB,GACnB,oBAAoB,GACpB,iBAAiB,GACjB,WAAW,GACX,MAAM,GACN,YAAY,GACZ,MAAM,GACN,aAAa,GACb,MAAM,GACN,UAAU,GACV,eAAe,GACf,QAAQ,GACR,OAAO,GACP,OAAO,GACP,WAAW,GACX,SAAS,GACT,QAAQ,GACR,MAAM,GACN,UAAU,GACV,OAAO,GACP,cAAc,GACd,MAAM,GACN,SAAS,GACT,SAAS,CAAC;AAEd,MAAM,MAAM,YAAY,GAAG,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { ButtonProps } from '../Button';
|
|
3
|
-
/**
|
|
4
|
-
* Props of the `Submenu` component.
|
|
5
|
-
*/
|
|
6
|
-
export type SubmenuProps = {
|
|
7
|
-
/**
|
|
8
|
-
* The button that will be used to expand the submenu. On Android the `text` prop of the `Button` will be used as a section title.
|
|
9
|
-
*/
|
|
10
|
-
button: ReactElement<ButtonProps>;
|
|
11
|
-
/**
|
|
12
|
-
* Children of the submenu. Only `Button`, `Switch`, `Picker` and `Submenu` elements should be used.
|
|
13
|
-
*/
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
};
|
|
16
|
-
export declare function Submenu(props: SubmenuProps): import("react").JSX.Element;
|
|
17
|
-
//# sourceMappingURL=Submenu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Submenu.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/ContextMenu/Submenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAClC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAE1C"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { NativeSyntheticEvent, StyleProp, ViewStyle, type ColorValue } from 'react-native';
|
|
3
|
-
import { SubmenuProps } from './Submenu';
|
|
4
|
-
import { ModifierConfig } from '../../types';
|
|
5
|
-
import { ButtonProps } from '../Button';
|
|
6
|
-
import { PickerProps } from '../Picker';
|
|
7
|
-
import { SwitchProps } from '../Switch';
|
|
8
|
-
type SubmenuElement = ReactElement<ButtonProps> | ReactElement<SwitchProps> | ReactElement<PickerProps> | ReactElement<SubmenuProps>;
|
|
9
|
-
export type ContextMenuContentProps = {
|
|
10
|
-
children: SubmenuElement | SubmenuElement[];
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* @hidden
|
|
14
|
-
*/
|
|
15
|
-
export type EventHandlers = Record<string, Record<string, (event: NativeSyntheticEvent<any>) => void>>;
|
|
16
|
-
/**
|
|
17
|
-
* @hidden
|
|
18
|
-
*/
|
|
19
|
-
export type ContextMenuElementBase = {
|
|
20
|
-
contextMenuElementID: string;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Props of the `ContextMenu` component.
|
|
24
|
-
*/
|
|
25
|
-
export type ContextMenuProps = {
|
|
26
|
-
/**
|
|
27
|
-
* The contents of the submenu are used as an anchor for the context menu.
|
|
28
|
-
* The children will be wrapped in a pressable element, which triggers opening of the context menu.
|
|
29
|
-
*/
|
|
30
|
-
children: ReactNode;
|
|
31
|
-
/**
|
|
32
|
-
* The color of the container holding the context menu items.
|
|
33
|
-
*/
|
|
34
|
-
color?: ColorValue;
|
|
35
|
-
/**
|
|
36
|
-
* Optional styles to apply to the `ContextMenu`.
|
|
37
|
-
*/
|
|
38
|
-
style?: StyleProp<ViewStyle>;
|
|
39
|
-
/**
|
|
40
|
-
* Modifiers for the component.
|
|
41
|
-
*/
|
|
42
|
-
modifiers?: ModifierConfig[];
|
|
43
|
-
};
|
|
44
|
-
export declare function Items(props: ContextMenuContentProps): import("react").JSX.Element;
|
|
45
|
-
export declare namespace Items {
|
|
46
|
-
var tag: string;
|
|
47
|
-
}
|
|
48
|
-
export declare function Trigger(props: {
|
|
49
|
-
children: React.ReactNode;
|
|
50
|
-
}): import("react").JSX.Element;
|
|
51
|
-
export declare namespace Trigger {
|
|
52
|
-
var tag: string;
|
|
53
|
-
}
|
|
54
|
-
export declare function Preview(props: {
|
|
55
|
-
children: React.ReactNode;
|
|
56
|
-
}): import("react").JSX.Element;
|
|
57
|
-
declare function ContextMenu(props: ContextMenuProps): import("react").JSX.Element;
|
|
58
|
-
declare namespace ContextMenu {
|
|
59
|
-
var Trigger: typeof import(".").Trigger;
|
|
60
|
-
var Preview: typeof import(".").Preview;
|
|
61
|
-
var Items: typeof import(".").Items;
|
|
62
|
-
}
|
|
63
|
-
export { ContextMenu };
|
|
64
|
-
export { Submenu } from './Submenu';
|
|
65
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/ContextMenu/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,YAAY,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE3F,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAQxC,KAAK,cAAc,GACf,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,YAAY,CAAC,CAAC;AAE/B,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,cAAc,GAAG,cAAc,EAAE,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAChC,MAAM,EACN,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,CAC3D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IAAE,oBAAoB,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;CAC9B,CAAC;AAyBF,wBAAgB,KAAK,CAAC,KAAK,EAAE,uBAAuB,+BAEnD;yBAFe,KAAK;;;AAKrB,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAE3D;yBAFe,OAAO;;;AAKvB,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAE3D;AAED,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAsC3C;kBAtCQ,WAAW;;;;;AA4CpB,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ContextMenuElementBase, EventHandlers } from './index';
|
|
3
|
-
import { NativeButtonProps } from '../Button';
|
|
4
|
-
import { PickerProps } from '../Picker';
|
|
5
|
-
import { SwitchProps } from '../Switch';
|
|
6
|
-
type ButtonMenuElement = {
|
|
7
|
-
button: NativeButtonProps;
|
|
8
|
-
} & ContextMenuElementBase;
|
|
9
|
-
type SwitchMenuElement = {
|
|
10
|
-
switch: SwitchProps;
|
|
11
|
-
} & ContextMenuElementBase;
|
|
12
|
-
type PickerMenuElement = {
|
|
13
|
-
picker: PickerProps;
|
|
14
|
-
} & ContextMenuElementBase;
|
|
15
|
-
type SubmenuElement = {
|
|
16
|
-
submenu: {
|
|
17
|
-
elements: MenuElement[];
|
|
18
|
-
button: NativeButtonProps;
|
|
19
|
-
};
|
|
20
|
-
} & ContextMenuElementBase;
|
|
21
|
-
export type MenuElement = ButtonMenuElement | SwitchMenuElement | PickerMenuElement | SubmenuElement;
|
|
22
|
-
export declare function transformChildrenToElementArray(children: ReactNode, eventHandlersMap: EventHandlers): MenuElement[];
|
|
23
|
-
export {};
|
|
24
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/ContextMenu/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,SAAS,EAAE,MAAM,OAAO,CAAC;AAI1E,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAuB,iBAAiB,EAAwB,MAAM,WAAW,CAAC;AACzF,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;AAGhD,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,iBAAiB,CAAC;CAC3B,GAAG,sBAAsB,CAAC;AAE3B,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,WAAW,CAAC;CACrB,GAAG,sBAAsB,CAAC;AAE3B,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,WAAW,CAAC;CACrB,GAAG,sBAAsB,CAAC;AAE3B,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE;QACP,QAAQ,EAAE,WAAW,EAAE,CAAC;QACxB,MAAM,EAAE,iBAAiB,CAAC;KAC3B,CAAC;CACH,GAAG,sBAAsB,CAAC;AAE3B,MAAM,MAAM,WAAW,GACnB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,cAAc,CAAC;AAInB,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,SAAS,EACnB,gBAAgB,EAAE,aAAa,GAC9B,WAAW,EAAE,CAIf"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ExpoModifier } from '../../types';
|
|
2
|
-
export type FilterChipProps = {
|
|
3
|
-
/**
|
|
4
|
-
* Whether the chip is currently selected.
|
|
5
|
-
*/
|
|
6
|
-
selected: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* The text label to display on the chip.
|
|
9
|
-
*/
|
|
10
|
-
label: string;
|
|
11
|
-
/**
|
|
12
|
-
* Whether the chip is enabled and can be interacted with.
|
|
13
|
-
*/
|
|
14
|
-
enabled?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Callback fired when the chip is clicked.
|
|
17
|
-
*/
|
|
18
|
-
onPress?: () => void;
|
|
19
|
-
/**
|
|
20
|
-
* Modifiers for the component.
|
|
21
|
-
*/
|
|
22
|
-
modifiers?: ExpoModifier[];
|
|
23
|
-
/**
|
|
24
|
-
* Children containing LeadingIcon and TrailingIcon slots.
|
|
25
|
-
*/
|
|
26
|
-
children?: React.ReactNode;
|
|
27
|
-
};
|
|
28
|
-
type SlotChildProps = {
|
|
29
|
-
children: React.ReactNode;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Leading icon slot for FilterChip.
|
|
33
|
-
*/
|
|
34
|
-
declare function FilterChipLeadingIcon(props: SlotChildProps): import("react").JSX.Element;
|
|
35
|
-
/**
|
|
36
|
-
* Trailing icon slot for FilterChip.
|
|
37
|
-
*/
|
|
38
|
-
declare function FilterChipTrailingIcon(props: SlotChildProps): import("react").JSX.Element;
|
|
39
|
-
/**
|
|
40
|
-
* A filter chip component following Material 3 design guidelines.
|
|
41
|
-
* Supports slot-based `LeadingIcon` and `TrailingIcon` children.
|
|
42
|
-
*/
|
|
43
|
-
declare function FilterChipComponent(props: FilterChipProps): import("react").JSX.Element;
|
|
44
|
-
declare namespace FilterChipComponent {
|
|
45
|
-
var LeadingIcon: typeof FilterChipLeadingIcon;
|
|
46
|
-
var TrailingIcon: typeof FilterChipTrailingIcon;
|
|
47
|
-
}
|
|
48
|
-
export { FilterChipComponent as FilterChip };
|
|
49
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/FilterChip/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAmBF;;GAEG;AACH,iBAAS,qBAAqB,CAAC,KAAK,EAAE,cAAc,+BAEnD;AAED;;GAEG;AACH,iBAAS,sBAAsB,CAAC,KAAK,EAAE,cAAc,+BAEpD;AAED;;;GAGG;AACH,iBAAS,mBAAmB,CAAC,KAAK,EAAE,eAAe,+BAYlD;kBAZQ,mBAAmB;;;;AAiB5B,OAAO,EAAE,mBAAmB,IAAI,UAAU,EAAE,CAAC"}
|