@expo/ui 55.0.2 → 55.0.4

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.
Files changed (232) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/AnimatedVisibilityView.kt +130 -0
  4. package/android/src/main/java/expo/modules/ui/BottomSheetView.kt +91 -13
  5. package/android/src/main/java/expo/modules/ui/CardView.kt +138 -34
  6. package/android/src/main/java/expo/modules/ui/CheckboxView.kt +98 -0
  7. package/android/src/main/java/expo/modules/ui/ChipView.kt +267 -142
  8. package/android/src/main/java/expo/modules/ui/DatePickerView.kt +258 -70
  9. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +209 -61
  10. package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +44 -1
  11. package/android/src/main/java/expo/modules/ui/ProgressView.kt +189 -89
  12. package/android/src/main/java/expo/modules/ui/RadioButtonView.kt +3 -7
  13. package/android/src/main/java/expo/modules/ui/SegmentedButtonView.kt +115 -0
  14. package/android/src/main/java/expo/modules/ui/SegmentedControlView.kt +35 -0
  15. package/android/src/main/java/expo/modules/ui/SliderView.kt +70 -12
  16. package/android/src/main/java/expo/modules/ui/SwitchView.kt +53 -161
  17. package/android/src/main/java/expo/modules/ui/TextInputView.kt +39 -15
  18. package/android/src/main/java/expo/modules/ui/ToggleButtonView.kt +95 -57
  19. package/android/src/main/java/expo/modules/ui/button/Button.kt +117 -158
  20. package/android/src/main/java/expo/modules/ui/button/FloatingActionButton.kt +92 -0
  21. package/android/src/main/java/expo/modules/ui/button/IconButton.kt +73 -86
  22. package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +39 -0
  23. package/android/src/main/java/expo/modules/ui/menu/DropdownMenuItem.kt +70 -0
  24. package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +18 -0
  25. package/build/datetime-picker/DateTimePicker.android.d.ts +3 -0
  26. package/build/datetime-picker/DateTimePicker.android.d.ts.map +1 -0
  27. package/build/datetime-picker/DateTimePicker.d.ts +3 -0
  28. package/build/datetime-picker/DateTimePicker.d.ts.map +1 -0
  29. package/build/datetime-picker/DateTimePicker.web.d.ts +3 -0
  30. package/build/datetime-picker/DateTimePicker.web.d.ts.map +1 -0
  31. package/build/datetime-picker/index.d.ts +5 -0
  32. package/build/datetime-picker/index.d.ts.map +1 -0
  33. package/build/datetime-picker/types.d.ts +128 -0
  34. package/build/datetime-picker/types.d.ts.map +1 -0
  35. package/build/jetpack-compose/AnimatedVisibility/index.d.ts +134 -0
  36. package/build/jetpack-compose/AnimatedVisibility/index.d.ts.map +1 -0
  37. package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts +3 -0
  38. package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts.map +1 -0
  39. package/build/jetpack-compose/Button/index.d.ts +65 -51
  40. package/build/jetpack-compose/Button/index.d.ts.map +1 -1
  41. package/build/jetpack-compose/Card/index.d.ts +72 -14
  42. package/build/jetpack-compose/Card/index.d.ts.map +1 -1
  43. package/build/jetpack-compose/Checkbox/index.d.ts +73 -0
  44. package/build/jetpack-compose/Checkbox/index.d.ts.map +1 -0
  45. package/build/jetpack-compose/Chip/index.d.ts +247 -27
  46. package/build/jetpack-compose/Chip/index.d.ts.map +1 -1
  47. package/build/jetpack-compose/DatePicker/index.d.ts +38 -3
  48. package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
  49. package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts +70 -0
  50. package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts.map +1 -0
  51. package/build/jetpack-compose/DropdownMenu/index.d.ts +68 -0
  52. package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -0
  53. package/build/jetpack-compose/FloatingActionButton/index.d.ts +150 -0
  54. package/build/jetpack-compose/FloatingActionButton/index.d.ts.map +1 -0
  55. package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts +2 -2
  56. package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts.map +1 -1
  57. package/build/jetpack-compose/IconButton/index.d.ts +45 -29
  58. package/build/jetpack-compose/IconButton/index.d.ts.map +1 -1
  59. package/build/jetpack-compose/ModalBottomSheet/index.d.ts +65 -13
  60. package/build/jetpack-compose/ModalBottomSheet/index.d.ts.map +1 -1
  61. package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts +17 -0
  62. package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts.map +1 -0
  63. package/build/jetpack-compose/Progress/index.d.ts +78 -35
  64. package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
  65. package/build/jetpack-compose/RadioButton/index.d.ts +2 -2
  66. package/build/jetpack-compose/RadioButton/index.d.ts.map +1 -1
  67. package/build/jetpack-compose/SegmentedButton/index.d.ts +74 -0
  68. package/build/jetpack-compose/SegmentedButton/index.d.ts.map +1 -0
  69. package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts +17 -0
  70. package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts.map +1 -0
  71. package/build/jetpack-compose/Slider/index.d.ts +34 -10
  72. package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
  73. package/build/jetpack-compose/Switch/index.d.ts +10 -50
  74. package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
  75. package/build/jetpack-compose/TextInput/index.d.ts +9 -0
  76. package/build/jetpack-compose/TextInput/index.d.ts.map +1 -1
  77. package/build/jetpack-compose/ToggleButton/index.d.ts +60 -32
  78. package/build/jetpack-compose/ToggleButton/index.d.ts.map +1 -1
  79. package/build/jetpack-compose/index.d.ts +5 -4
  80. package/build/jetpack-compose/index.d.ts.map +1 -1
  81. package/build/jetpack-compose/modifiers/index.d.ts +18 -1
  82. package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
  83. package/build/swift-ui/Link/index.d.ts +36 -0
  84. package/build/swift-ui/Link/index.d.ts.map +1 -0
  85. package/build/swift-ui/ProgressView/index.d.ts +1 -5
  86. package/build/swift-ui/ProgressView/index.d.ts.map +1 -1
  87. package/build/swift-ui/Stepper/index.d.ts +3 -3
  88. package/build/swift-ui/Stepper/index.d.ts.map +1 -1
  89. package/build/swift-ui/Text/index.d.ts +33 -1
  90. package/build/swift-ui/Text/index.d.ts.map +1 -1
  91. package/build/swift-ui/index.d.ts +1 -0
  92. package/build/swift-ui/index.d.ts.map +1 -1
  93. package/build/swift-ui/modifiers/environment.d.ts +16 -1
  94. package/build/swift-ui/modifiers/environment.d.ts.map +1 -1
  95. package/build/swift-ui/modifiers/index.d.ts +24 -7
  96. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  97. package/build/swift-ui/modifiers/shapes/index.d.ts +2 -2
  98. package/build/swift-ui/modifiers/widgets.d.ts +14 -0
  99. package/build/swift-ui/modifiers/widgets.d.ts.map +1 -0
  100. package/build/swift-ui/types.d.ts +7 -0
  101. package/build/swift-ui/types.d.ts.map +1 -1
  102. package/expo-module.config.json +1 -1
  103. package/ios/BottomSheetView.swift +1 -6
  104. package/ios/ClosedRangeDateRecord.swift +10 -0
  105. package/ios/ColorPickerView.swift +9 -8
  106. package/ios/ConfirmationDialog/ConfirmationDialog.swift +4 -6
  107. package/ios/DatePickerView.swift +7 -5
  108. package/ios/DisclosureGroupView.swift +5 -7
  109. package/ios/ExpoUIModule.swift +1 -0
  110. package/ios/LinkView.swift +29 -0
  111. package/ios/ListView.swift +6 -14
  112. package/ios/Modifiers/DefaultScrollAnchorForRoleModifier.swift +32 -0
  113. package/ios/Modifiers/DefaultScrollAnchorModifier.swift +16 -0
  114. package/ios/Modifiers/EnvironmentModifier.swift +14 -0
  115. package/ios/Modifiers/ViewModifierRegistry.swift +12 -0
  116. package/ios/Modifiers/WidgetModifiers.swift +12 -0
  117. package/ios/Picker/PickerView.swift +6 -10
  118. package/ios/Popover/PopoverView.swift +3 -5
  119. package/ios/ProgressView.swift +0 -5
  120. package/ios/SectionView.swift +3 -5
  121. package/ios/SliderView.swift +8 -6
  122. package/ios/StepperView.swift +12 -16
  123. package/ios/TextView.swift +37 -1
  124. package/ios/Toggle/ToggleView.swift +5 -7
  125. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4-sources.jar +0 -0
  126. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4-sources.jar.md5 +1 -0
  127. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4-sources.jar.sha1 +1 -0
  128. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4-sources.jar.sha256 +1 -0
  129. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4-sources.jar.sha512 +1 -0
  130. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.aar +0 -0
  131. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.aar.md5 +1 -0
  132. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.aar.sha1 +1 -0
  133. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.aar.sha256 +1 -0
  134. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.aar.sha512 +1 -0
  135. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.2/expo.modules.ui-55.0.2.module → 55.0.4/expo.modules.ui-55.0.4.module} +22 -22
  136. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.module.md5 +1 -0
  137. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.module.sha1 +1 -0
  138. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.module.sha256 +1 -0
  139. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.module.sha512 +1 -0
  140. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.2/expo.modules.ui-55.0.2.pom → 55.0.4/expo.modules.ui-55.0.4.pom} +1 -1
  141. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.pom.md5 +1 -0
  142. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.pom.sha1 +1 -0
  143. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.pom.sha256 +1 -0
  144. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.pom.sha512 +1 -0
  145. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  146. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  147. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  148. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  149. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  150. package/package.json +9 -2
  151. package/src/datetime-picker/DateTimePicker.android.tsx +126 -0
  152. package/src/datetime-picker/DateTimePicker.tsx +94 -0
  153. package/src/datetime-picker/DateTimePicker.web.tsx +5 -0
  154. package/src/datetime-picker/index.tsx +11 -0
  155. package/src/datetime-picker/types.tsx +147 -0
  156. package/src/jetpack-compose/AnimatedVisibility/index.tsx +206 -0
  157. package/src/jetpack-compose/AnimatedVisibility/symbols.ts +8 -0
  158. package/src/jetpack-compose/Button/index.tsx +69 -92
  159. package/src/jetpack-compose/Card/index.tsx +105 -29
  160. package/src/jetpack-compose/Checkbox/index.tsx +126 -0
  161. package/src/jetpack-compose/Chip/index.tsx +391 -51
  162. package/src/jetpack-compose/DatePicker/index.tsx +112 -7
  163. package/src/jetpack-compose/DropdownMenu/DropdownMenuItem.tsx +126 -0
  164. package/src/jetpack-compose/DropdownMenu/index.tsx +107 -0
  165. package/src/jetpack-compose/FloatingActionButton/index.tsx +207 -0
  166. package/src/jetpack-compose/HorizontalFloatingToolbar/index.tsx +4 -2
  167. package/src/jetpack-compose/IconButton/index.tsx +49 -56
  168. package/src/jetpack-compose/ModalBottomSheet/index.tsx +85 -15
  169. package/src/jetpack-compose/MultiChoiceSegmentedButtonRow/index.tsx +34 -0
  170. package/src/jetpack-compose/Progress/index.tsx +120 -62
  171. package/src/jetpack-compose/RadioButton/index.tsx +8 -9
  172. package/src/jetpack-compose/SegmentedButton/index.tsx +109 -0
  173. package/src/jetpack-compose/SingleChoiceSegmentedButtonRow/index.tsx +34 -0
  174. package/src/jetpack-compose/Slider/index.tsx +76 -29
  175. package/src/jetpack-compose/Switch/index.tsx +17 -87
  176. package/src/jetpack-compose/TextInput/index.tsx +10 -0
  177. package/src/jetpack-compose/ToggleButton/index.tsx +67 -43
  178. package/src/jetpack-compose/index.ts +5 -4
  179. package/src/jetpack-compose/modifiers/index.ts +26 -2
  180. package/src/swift-ui/Link/index.tsx +52 -0
  181. package/src/swift-ui/ProgressView/index.tsx +1 -3
  182. package/src/swift-ui/Stepper/index.tsx +7 -7
  183. package/src/swift-ui/Text/index.tsx +66 -2
  184. package/src/swift-ui/index.tsx +1 -0
  185. package/src/swift-ui/modifiers/environment.ts +17 -4
  186. package/src/swift-ui/modifiers/index.ts +44 -10
  187. package/src/swift-ui/modifiers/widgets.ts +18 -0
  188. package/src/swift-ui/types.ts +5 -0
  189. package/android/src/main/java/expo/modules/ui/FilterChipView.kt +0 -59
  190. package/android/src/main/java/expo/modules/ui/PickerView.kt +0 -161
  191. package/android/src/main/java/expo/modules/ui/TextButtonView.kt +0 -33
  192. package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +0 -183
  193. package/android/src/main/java/expo/modules/ui/menu/ContextMenuRecords.kt +0 -64
  194. package/build/jetpack-compose/Button/types.d.ts +0 -5
  195. package/build/jetpack-compose/Button/types.d.ts.map +0 -1
  196. package/build/jetpack-compose/ContextMenu/Submenu.d.ts +0 -17
  197. package/build/jetpack-compose/ContextMenu/Submenu.d.ts.map +0 -1
  198. package/build/jetpack-compose/ContextMenu/index.d.ts +0 -65
  199. package/build/jetpack-compose/ContextMenu/index.d.ts.map +0 -1
  200. package/build/jetpack-compose/ContextMenu/utils.d.ts +0 -24
  201. package/build/jetpack-compose/ContextMenu/utils.d.ts.map +0 -1
  202. package/build/jetpack-compose/FilterChip/index.d.ts +0 -49
  203. package/build/jetpack-compose/FilterChip/index.d.ts.map +0 -1
  204. package/build/jetpack-compose/Picker/index.d.ts +0 -62
  205. package/build/jetpack-compose/Picker/index.d.ts.map +0 -1
  206. package/build/jetpack-compose/TextButton/index.d.ts +0 -29
  207. package/build/jetpack-compose/TextButton/index.d.ts.map +0 -1
  208. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar +0 -0
  209. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.md5 +0 -1
  210. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha1 +0 -1
  211. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha256 +0 -1
  212. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha512 +0 -1
  213. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar +0 -0
  214. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.md5 +0 -1
  215. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha1 +0 -1
  216. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha256 +0 -1
  217. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha512 +0 -1
  218. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.md5 +0 -1
  219. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha1 +0 -1
  220. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha256 +0 -1
  221. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha512 +0 -1
  222. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.md5 +0 -1
  223. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha1 +0 -1
  224. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha256 +0 -1
  225. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha512 +0 -1
  226. package/src/jetpack-compose/Button/types.ts +0 -57
  227. package/src/jetpack-compose/ContextMenu/Submenu.tsx +0 -21
  228. package/src/jetpack-compose/ContextMenu/index.tsx +0 -149
  229. package/src/jetpack-compose/ContextMenu/utils.ts +0 -144
  230. package/src/jetpack-compose/FilterChip/index.tsx +0 -89
  231. package/src/jetpack-compose/Picker/index.tsx +0 -90
  232. package/src/jetpack-compose/TextButton/index.tsx +0 -55
@@ -0,0 +1,70 @@
1
+ package expo.modules.ui.menu
2
+
3
+ import android.graphics.Color
4
+ import androidx.compose.material3.DropdownMenuItem
5
+ import androidx.compose.material3.MenuDefaults
6
+ import androidx.compose.material3.Text
7
+ import androidx.compose.runtime.Composable
8
+ import expo.modules.kotlin.records.Field
9
+ import expo.modules.kotlin.records.Record
10
+ import expo.modules.kotlin.views.ComposableScope
11
+ import expo.modules.kotlin.views.ComposeProps
12
+ import expo.modules.kotlin.views.FunctionalComposableScope
13
+ import expo.modules.ui.ModifierList
14
+ import expo.modules.ui.ModifierRegistry
15
+ import expo.modules.ui.composeOrNull
16
+ import expo.modules.ui.findChildSlotView
17
+ import java.io.Serializable
18
+
19
+ class ItemPressedEvent : Record, Serializable
20
+
21
+ class DropdownMenuItemColors : Record {
22
+ @Field val textColor: Color? = null
23
+ @Field val leadingIconColor: Color? = null
24
+ @Field val trailingIconColor: Color? = null
25
+ @Field val disabledTextColor: Color? = null
26
+ @Field val disabledLeadingIconColor: Color? = null
27
+ @Field val disabledTrailingIconColor: Color? = null
28
+ }
29
+
30
+ data class DropdownMenuItemProps(
31
+ val enabled: Boolean = true,
32
+ val elementColors: DropdownMenuItemColors = DropdownMenuItemColors(),
33
+ val modifiers: ModifierList = emptyList()
34
+ ) : ComposeProps
35
+
36
+ @Composable
37
+ fun FunctionalComposableScope.DropdownMenuItemContent(
38
+ props: DropdownMenuItemProps,
39
+ onItemPressed: (ItemPressedEvent) -> Unit
40
+ ) {
41
+ val textSlotView = findChildSlotView(view, "text")
42
+ val leadingSlotView = findChildSlotView(view, "leadingIcon")
43
+ val trailingSlotView = findChildSlotView(view, "trailingIcon")
44
+
45
+ val colors = props.elementColors
46
+ val defaultColors = MenuDefaults.itemColors()
47
+
48
+ DropdownMenuItem(
49
+ text = { textSlotView?.let { with(ComposableScope()) { with(it) { Content() } } } ?: Unit },
50
+ enabled = props.enabled,
51
+ modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher),
52
+ colors = MenuDefaults.itemColors(
53
+ textColor = colors.textColor.composeOrNull ?: defaultColors.textColor,
54
+ leadingIconColor = colors.leadingIconColor.composeOrNull ?: defaultColors.leadingIconColor,
55
+ trailingIconColor = colors.trailingIconColor.composeOrNull ?: defaultColors.trailingIconColor,
56
+ disabledTextColor = colors.disabledTextColor.composeOrNull ?: defaultColors.disabledTextColor,
57
+ disabledLeadingIconColor = colors.disabledLeadingIconColor.composeOrNull ?: defaultColors.disabledLeadingIconColor,
58
+ disabledTrailingIconColor = colors.disabledTrailingIconColor.composeOrNull ?: defaultColors.disabledTrailingIconColor
59
+ ),
60
+ leadingIcon = leadingSlotView?.let {
61
+ { with(ComposableScope()) { with(it) { Content() } } }
62
+ },
63
+ trailingIcon = trailingSlotView?.let {
64
+ { with(ComposableScope()) { with(it) { Content() } } }
65
+ },
66
+ onClick = {
67
+ onItemPressed(ItemPressedEvent())
68
+ }
69
+ )
70
+ }
@@ -0,0 +1,18 @@
1
+ package expo.modules.ui.menu
2
+
3
+ import android.graphics.Color
4
+ import expo.modules.kotlin.types.Enumerable
5
+ import expo.modules.kotlin.views.ComposeProps
6
+ import expo.modules.ui.ModifierList
7
+
8
+ enum class ActivationMethod(val value: String) : Enumerable {
9
+ SINGLE_PRESS("singlePress"),
10
+ LONG_PRESS("longPress")
11
+ }
12
+
13
+ data class DropdownMenuProps(
14
+ val activationMethod: ActivationMethod = ActivationMethod.SINGLE_PRESS,
15
+ val expanded: Boolean = false,
16
+ val color: Color? = null,
17
+ val modifiers: ModifierList = emptyList()
18
+ ) : ComposeProps
@@ -0,0 +1,3 @@
1
+ import { type DateTimePickerProps } from './types';
2
+ export declare function DateTimePicker(props: DateTimePickerProps): import("react").JSX.Element;
3
+ //# sourceMappingURL=DateTimePicker.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimePicker.android.d.ts","sourceRoot":"","sources":["../../src/datetime-picker/DateTimePicker.android.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAmCjF,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,+BA0FxD"}
@@ -0,0 +1,3 @@
1
+ import { type DateTimePickerProps } from './types';
2
+ export declare function DateTimePicker(props: DateTimePickerProps): import("react").JSX.Element;
3
+ //# sourceMappingURL=DateTimePicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../src/datetime-picker/DateTimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAoCjF,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,+BAyDxD"}
@@ -0,0 +1,3 @@
1
+ import type { DateTimePickerProps } from './types';
2
+ export declare function DateTimePicker(_props: DateTimePickerProps): null;
3
+ //# sourceMappingURL=DateTimePicker.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimePicker.web.d.ts","sourceRoot":"","sources":["../../src/datetime-picker/DateTimePicker.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,wBAAgB,cAAc,CAAC,MAAM,EAAE,mBAAmB,QAEzD"}
@@ -0,0 +1,5 @@
1
+ import { DateTimePicker } from './DateTimePicker';
2
+ export { type DateTimePickerEvent, type DateTimePickerChangeEvent, type DateTimePickerProps, } from './types';
3
+ export default DateTimePicker;
4
+ export { DateTimePicker };
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/datetime-picker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,GACzB,MAAM,SAAS,CAAC;AAEjB,eAAe,cAAc,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,128 @@
1
+ import type { ViewProps } from 'react-native';
2
+ /**
3
+ * @deprecated used with the deprecated `onChange` prop
4
+ * */
5
+ export type DateTimePickerEvent = {
6
+ /**
7
+ * `'set'` when the user selects a date. `'dismissed'` when the user cancels
8
+ * an Android dialog picker. iOS never fires `'dismissed'`.
9
+ */
10
+ type: 'set' | 'dismissed';
11
+ nativeEvent: {
12
+ timestamp: number;
13
+ utcOffset: number;
14
+ };
15
+ };
16
+ export type DateTimePickerChangeEvent = {
17
+ nativeEvent: {
18
+ timestamp: number;
19
+ utcOffset: number;
20
+ };
21
+ };
22
+ export type DateTimePickerProps = {
23
+ /**
24
+ * The current date value (controlled).
25
+ */
26
+ value: Date;
27
+ /**
28
+ * @deprecated Use `onValueChange` and `onDismiss` instead.
29
+ *
30
+ * Called when the user changes the date/time or dismisses the picker.
31
+ * The event type is encoded in `event.type`.
32
+ * If the new specific listeners are provided, they take precedence.
33
+ */
34
+ onChange?: (event: DateTimePickerEvent, date?: Date) => void;
35
+ /**
36
+ * Called when the user selects a date or time.
37
+ */
38
+ onValueChange?: (event: DateTimePickerChangeEvent, date: Date) => void;
39
+ /**
40
+ * Called when the picker is dismissed without selecting a value.
41
+ * @platform android
42
+ */
43
+ onDismiss?: () => void;
44
+ /**
45
+ * The picker mode.
46
+ * @default 'date'
47
+ */
48
+ mode?: 'date' | 'time' | 'datetime';
49
+ /**
50
+ * The earliest selectable date.
51
+ */
52
+ minimumDate?: Date;
53
+ /**
54
+ * The latest selectable date.
55
+ */
56
+ maximumDate?: Date;
57
+ /**
58
+ * A test ID forwarded to the native view.
59
+ * Note: on Android dialog presentation, the test ID is not forwarded.
60
+ */
61
+ testID?: string;
62
+ /**
63
+ * Display style. Android supports `'default' | 'spinner'` — `'spinner'` shows a text input
64
+ * rather than a scroll wheel (Material 3 does not have a wheel-style picker).
65
+ * iOS supports `'default' | 'spinner' | 'compact' | 'inline'`.
66
+ * @default 'default'
67
+ */
68
+ display?: 'default' | 'spinner' | 'compact' | 'inline' | 'calendar' | 'clock';
69
+ /**
70
+ * Use 24-hour format.
71
+ * @platform android
72
+ */
73
+ is24Hour?: boolean;
74
+ /**
75
+ * Accent/tint color applied to the picker.
76
+ * Maps to `color` on Android and `tint` on iOS.
77
+ */
78
+ accentColor?: string;
79
+ /**
80
+ * Whether the picker is disabled.
81
+ * @platform ios
82
+ */
83
+ disabled?: boolean;
84
+ /**
85
+ * Locale identifier (e.g. 'en_US', 'fr_FR') for the picker display.
86
+ * @platform ios
87
+ */
88
+ locale?: string;
89
+ /**
90
+ * Force a specific color scheme on the picker.
91
+ * @platform ios
92
+ */
93
+ themeVariant?: 'dark' | 'light';
94
+ /**
95
+ * IANA time zone name (e.g. 'America/New_York') for the picker display.
96
+ * @platform ios
97
+ */
98
+ timeZoneName?: string;
99
+ /**
100
+ * How the picker is presented.
101
+ * - `'inline'` renders the picker directly in the view hierarchy.
102
+ * - `'dialog'` shows a modal dialog that opens on mount. Fires `onValueChange` on confirmation, `onDismiss` on cancel. The caller should
103
+ * unmount the component in response.
104
+ *
105
+ * On iOS this prop is accepted but ignored (always inline).
106
+ * On Android the default is `'dialog'`.
107
+ * @default 'dialog'
108
+ * @platform android
109
+ */
110
+ presentation?: 'inline' | 'dialog';
111
+ /**
112
+ * Set the positive (confirm) button label.
113
+ * @platform android
114
+ */
115
+ positiveButton?: {
116
+ label?: string;
117
+ };
118
+ /**
119
+ * Set the negative (cancel) button label.
120
+ * @platform android
121
+ */
122
+ negativeButton?: {
123
+ label?: string;
124
+ };
125
+ } & Pick<ViewProps, 'style'>;
126
+ export declare function buildEvent(date: Date): DateTimePickerEvent;
127
+ export declare function buildChangeEvent(date: Date): DateTimePickerChangeEvent;
128
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/datetime-picker/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C;;KAEK;AACL,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,IAAI,EAAE,KAAK,GAAG,WAAW,CAAC;IAC1B,WAAW,EAAE;QACX,SAAS,EAAE,MAAM,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,QAAQ,GAAG,QAAQ,CAAC;IACnC;;;OAGG;IACH,cAAc,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC;;;OAGG;IACH,cAAc,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrC,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAI7B,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,mBAAmB,CAQ1D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,yBAAyB,CAOtE"}
@@ -0,0 +1,134 @@
1
+ import { PrimitiveBaseProps } from '../layout-types';
2
+ import { ENTER_TRANSITION_SYMBOL, EXIT_TRANSITION_SYMBOL } from './symbols';
3
+ type EnterTransitionRecord = {
4
+ type: 'fadeIn' | 'slideInHorizontally' | 'slideInVertically' | 'expandIn' | 'expandHorizontally' | 'expandVertically' | 'scaleIn';
5
+ initialAlpha?: number;
6
+ /** Fraction of width: -1.0 = full width left, 1.0 = full width right */
7
+ initialOffsetX?: number;
8
+ /** Fraction of height: -1.0 = full height top, 1.0 = full height bottom */
9
+ initialOffsetY?: number;
10
+ initialScale?: number;
11
+ };
12
+ type ExitTransitionRecord = {
13
+ type: 'fadeOut' | 'slideOutHorizontally' | 'slideOutVertically' | 'shrinkOut' | 'shrinkHorizontally' | 'shrinkVertically' | 'scaleOut';
14
+ targetAlpha?: number;
15
+ /** Fraction of width: -1.0 = full width left, 1.0 = full width right */
16
+ targetOffsetX?: number;
17
+ /** Fraction of height: -1.0 = full height top, 1.0 = full height bottom */
18
+ targetOffsetY?: number;
19
+ targetScale?: number;
20
+ };
21
+ /**
22
+ * Represents an enter transition that can be combined with other enter transitions using `.plus()`.
23
+ */
24
+ export type EnterTransitionType = {
25
+ /** Combines this transition with another enter transition (mirrors Compose's `+` operator). */
26
+ plus: (other: EnterTransitionType) => EnterTransitionType;
27
+ [ENTER_TRANSITION_SYMBOL]: () => EnterTransitionRecord[];
28
+ };
29
+ /**
30
+ * Represents an exit transition that can be combined with other exit transitions using `.plus()`.
31
+ */
32
+ export type ExitTransitionType = {
33
+ /** Combines this transition with another exit transition (mirrors Compose's `+` operator). */
34
+ plus: (other: ExitTransitionType) => ExitTransitionType;
35
+ [EXIT_TRANSITION_SYMBOL]: () => ExitTransitionRecord[];
36
+ };
37
+ /**
38
+ * Factory for enter transitions used with `AnimatedVisibility`.
39
+ * Transitions can be combined using `.plus()`.
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * // Single transition
44
+ * EnterTransition.fadeIn()
45
+ *
46
+ * // Combined transitions
47
+ * EnterTransition.fadeIn({ initialAlpha: 0.3 })
48
+ * .plus(EnterTransition.slideInHorizontally({ initialOffsetX: 1.0 }))
49
+ * ```
50
+ */
51
+ export declare const EnterTransition: {
52
+ /** Fades the content in. */
53
+ fadeIn: (params?: {
54
+ initialAlpha?: number;
55
+ }) => EnterTransitionType;
56
+ /** Slides the content in horizontally. */
57
+ slideInHorizontally: (params?: {
58
+ initialOffsetX?: number;
59
+ }) => EnterTransitionType;
60
+ /** Slides the content in vertically. */
61
+ slideInVertically: (params?: {
62
+ initialOffsetY?: number;
63
+ }) => EnterTransitionType;
64
+ /** Expands the content from the center. */
65
+ expandIn: () => EnterTransitionType;
66
+ /** Expands the content horizontally from the center. */
67
+ expandHorizontally: () => EnterTransitionType;
68
+ /** Expands the content vertically from the center. */
69
+ expandVertically: () => EnterTransitionType;
70
+ /** Scales the content in from a smaller size. */
71
+ scaleIn: (params?: {
72
+ initialScale?: number;
73
+ }) => EnterTransitionType;
74
+ };
75
+ /**
76
+ * Factory for exit transitions used with `AnimatedVisibility`.
77
+ * Transitions can be combined using `.plus()`.
78
+ *
79
+ * @example
80
+ * ```tsx
81
+ * // Single transition
82
+ * ExitTransition.fadeOut()
83
+ *
84
+ * // Combined transitions
85
+ * ExitTransition.fadeOut()
86
+ * .plus(ExitTransition.slideOutHorizontally({ targetOffsetX: 1.0 }))
87
+ * ```
88
+ */
89
+ export declare const ExitTransition: {
90
+ /** Fades the content out. */
91
+ fadeOut: (params?: {
92
+ targetAlpha?: number;
93
+ }) => ExitTransitionType;
94
+ /** Slides the content out horizontally. */
95
+ slideOutHorizontally: (params?: {
96
+ targetOffsetX?: number;
97
+ }) => ExitTransitionType;
98
+ /** Slides the content out vertically. */
99
+ slideOutVertically: (params?: {
100
+ targetOffsetY?: number;
101
+ }) => ExitTransitionType;
102
+ /** Shrinks the content towards the center. */
103
+ shrinkOut: () => ExitTransitionType;
104
+ /** Shrinks the content horizontally towards the center. */
105
+ shrinkHorizontally: () => ExitTransitionType;
106
+ /** Shrinks the content vertically towards the center. */
107
+ shrinkVertically: () => ExitTransitionType;
108
+ /** Scales the content out to a smaller size. */
109
+ scaleOut: (params?: {
110
+ targetScale?: number;
111
+ }) => ExitTransitionType;
112
+ };
113
+ export type AnimatedVisibilityProps = {
114
+ children?: React.ReactNode;
115
+ /**
116
+ * Whether the content is visible. When changed, the content will animate in or out.
117
+ */
118
+ visible: boolean;
119
+ /**
120
+ * The enter transition to use when `visible` changes to `true`.
121
+ * Use `EnterTransition` factory methods and combine with `.plus()`.
122
+ * Defaults to Compose's `fadeIn + expandIn` when not specified.
123
+ */
124
+ enterTransition?: EnterTransitionType;
125
+ /**
126
+ * The exit transition to use when `visible` changes to `false`.
127
+ * Use `ExitTransition` factory methods and combine with `.plus()`.
128
+ * Defaults to Compose's `fadeOut + shrinkOut` when not specified.
129
+ */
130
+ exitTransition?: ExitTransitionType;
131
+ } & PrimitiveBaseProps;
132
+ export declare function AnimatedVisibility(props: AnimatedVisibilityProps): import("react").JSX.Element;
133
+ export {};
134
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/AnimatedVisibility/index.tsx"],"names":[],"mappings":"AA0BA,OAAO,EAAE,kBAAkB,EAAkB,MAAM,iBAA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E3C,0CAA0C;mCACX;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE;IAE1D,wCAAwC;iCACX;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE;IAExD,2CAA2C;;IAE3C,wDAAwD;;IAExD,sDAAsD;;IAEtD,iDAAiD;uBAC9B;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE;CAE7C,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc;IACzB,6BAA6B;uBACV;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE;IAE3C,2CAA2C;oCACX;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE;IAE1D,yCAAyC;kCACX;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE;IAExD,8CAA8C;;IAE9C,2DAA2D;;IAE3D,yDAAyD;;IAEzD,gDAAgD;wBAC5B;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE;CAE7C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC;;;;OAIG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACrC,GAAG,kBAAkB,CAAC;AAavB,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,+BAShE"}
@@ -0,0 +1,3 @@
1
+ export declare const ENTER_TRANSITION_SYMBOL: unique symbol;
2
+ export declare const EXIT_TRANSITION_SYMBOL: unique symbol;
3
+ //# sourceMappingURL=symbols.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/AnimatedVisibility/symbols.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,uBAAuB,eAA4B,CAAC;AACjE,eAAO,MAAM,sBAAsB,eAA2B,CAAC"}
@@ -1,85 +1,99 @@
1
1
  import { type ColorValue } from 'react-native';
2
- import { MaterialIcon } from './types';
3
- import { ExpoModifier, ViewEvent } from '../../types';
2
+ import type { ModifierConfig, ViewEvent } from '../../types';
4
3
  import { ShapeJSXElement, ShapeRecordProps } from '../Shape';
5
4
  /**
6
- * The built-in button styles available on Android.
7
- * - `outlined` - A button with an outline.
8
- * - `elevated` - A filled button with a shadow.
5
+ * Colors for button elements.
9
6
  */
10
- export type ButtonVariant = 'default' | 'bordered' | 'borderless' | 'outlined' | 'elevated';
11
- /**
12
- * Colors for button's core elements.
13
- */
14
- export type ButtonElementColors = {
7
+ export type ButtonColors = {
15
8
  containerColor?: ColorValue;
16
9
  contentColor?: ColorValue;
17
10
  disabledContainerColor?: ColorValue;
18
11
  disabledContentColor?: ColorValue;
19
12
  };
13
+ /**
14
+ * Content padding for the button's inner content.
15
+ * All values are in density-independent pixels (dp).
16
+ */
17
+ export type ButtonContentPadding = {
18
+ start?: number;
19
+ top?: number;
20
+ end?: number;
21
+ bottom?: number;
22
+ };
20
23
  export type ButtonProps = {
21
24
  /**
22
- * A callback that is called when the button is pressed.
23
- */
24
- onPress?: () => void;
25
- /**
26
- * A string describing the leading icon to display in the button.
27
- * Uses Material Icons on Android.
25
+ * Callback that is called when the button is clicked.
28
26
  */
29
- leadingIcon?: MaterialIcon;
27
+ onClick?: () => void;
30
28
  /**
31
- * A string describing the trailing icon to display in the button.
32
- * Uses Material Icons on Android.
29
+ * Whether the button is enabled for user interaction.
30
+ * @default true
33
31
  */
34
- trailingIcon?: MaterialIcon;
32
+ enabled?: boolean;
35
33
  /**
36
- * A string describing the system image to display in the button.
37
- * Uses Material Icons on Android.
38
- * @deprecated Use `leadingIcon` instead.
34
+ * Colors for button elements.
39
35
  */
40
- systemImage?: MaterialIcon;
36
+ colors?: ButtonColors;
41
37
  /**
42
- * The button variant.
38
+ * The padding between the button container and its content.
39
+ * Use this to adjust internal spacing, for example when adding a leading icon
43
40
  */
44
- variant?: ButtonVariant;
41
+ contentPadding?: ButtonContentPadding;
45
42
  /**
46
- * The text to display inside the button.
43
+ * The shape of the button.
47
44
  */
48
- children?: string | string[] | React.JSX.Element;
49
- /**
50
- * Colors for button's core elements.
51
- * @platform android
52
- */
53
- elementColors?: ButtonElementColors;
54
- /**
55
- * Button color.
56
- */
57
- color?: ColorValue;
58
45
  shape?: ShapeJSXElement;
59
46
  /**
60
- * Disabled state of the button.
47
+ * Modifiers for the component.
61
48
  */
62
- disabled?: boolean;
49
+ modifiers?: ModifierConfig[];
63
50
  /**
64
- * Modifiers for the component.
51
+ * Content to display inside the button.
65
52
  */
66
- modifiers?: ExpoModifier[];
53
+ children: React.ReactNode;
67
54
  };
68
- /**
69
- * @hidden
70
- */
71
- export type NativeButtonProps = Omit<ButtonProps, 'role' | 'onPress' | 'leadingIcon' | 'trailingIcon' | 'systemImage' | 'shape'> & {
72
- text: string;
73
- leadingIcon?: string;
74
- trailingIcon?: string;
55
+ type NativeButtonProps = Omit<ButtonProps, 'onClick' | 'shape' | 'children'> & {
75
56
  shape?: ShapeRecordProps;
57
+ children?: React.ReactNode;
76
58
  } & ViewEvent<'onButtonPressed', void>;
77
59
  /**
78
60
  * @hidden
79
61
  */
80
- export declare function transformButtonProps(props: ButtonProps): NativeButtonProps;
62
+ export declare function transformButtonProps(props: Omit<ButtonProps, 'children'>): NativeButtonProps;
63
+ /**
64
+ * A filled button component.
65
+ */
66
+ export declare const Button: {
67
+ (props: ButtonProps): import("react").JSX.Element;
68
+ displayName: string;
69
+ };
70
+ /**
71
+ * A filled tonal button component.
72
+ */
73
+ export declare const FilledTonalButton: {
74
+ (props: ButtonProps): import("react").JSX.Element;
75
+ displayName: string;
76
+ };
77
+ /**
78
+ * An outlined button component.
79
+ */
80
+ export declare const OutlinedButton: {
81
+ (props: ButtonProps): import("react").JSX.Element;
82
+ displayName: string;
83
+ };
81
84
  /**
82
- * Displays a native button component.
85
+ * An elevated button component.
83
86
  */
84
- export declare function Button(props: ButtonProps): import("react").JSX.Element;
87
+ export declare const ElevatedButton: {
88
+ (props: ButtonProps): import("react").JSX.Element;
89
+ displayName: string;
90
+ };
91
+ /**
92
+ * A text button component.
93
+ */
94
+ export declare const TextButton: {
95
+ (props: ButtonProps): import("react").JSX.Element;
96
+ displayName: string;
97
+ };
98
+ export {};
85
99
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/Button/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAiB,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5F;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,sBAAsB,CAAC,EAAE,UAAU,CAAC;IACpC,oBAAoB,CAAC,EAAE,UAAU,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAA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