@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.
Files changed (269) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/CONTRIBUTING.md +30 -0
  3. package/android/build.gradle +2 -2
  4. package/android/src/main/java/expo/modules/ui/AnimatedVisibilityView.kt +130 -0
  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 +302 -31
  9. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +204 -57
  10. package/android/src/main/java/expo/modules/ui/HorizontalFloatingToolbarView.kt +21 -8
  11. package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +149 -40
  12. package/android/src/main/java/expo/modules/ui/ProgressView.kt +189 -89
  13. package/android/src/main/java/expo/modules/ui/RNHostView.kt +204 -50
  14. package/android/src/main/java/expo/modules/ui/RadioButtonView.kt +3 -7
  15. package/android/src/main/java/expo/modules/ui/SegmentedButtonView.kt +115 -0
  16. package/android/src/main/java/expo/modules/ui/SegmentedControlView.kt +35 -0
  17. package/android/src/main/java/expo/modules/ui/SliderView.kt +70 -12
  18. package/android/src/main/java/expo/modules/ui/SwitchView.kt +62 -104
  19. package/android/src/main/java/expo/modules/ui/ToggleButtonView.kt +95 -57
  20. package/android/src/main/java/expo/modules/ui/button/Button.kt +117 -158
  21. package/android/src/main/java/expo/modules/ui/button/FloatingActionButton.kt +92 -0
  22. package/android/src/main/java/expo/modules/ui/button/IconButton.kt +73 -80
  23. package/android/src/main/java/expo/modules/ui/convertibles/AnimatableFloat.kt +26 -0
  24. package/android/src/main/java/expo/modules/ui/convertibles/AnimationSpecParams.kt +93 -0
  25. package/android/src/main/java/expo/modules/ui/convertibles/GraphicsLayerParams.kt +24 -0
  26. package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +39 -0
  27. package/android/src/main/java/expo/modules/ui/menu/DropdownMenuItem.kt +70 -0
  28. package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +18 -0
  29. package/build/jetpack-compose/AnimatedVisibility/index.d.ts +134 -0
  30. package/build/jetpack-compose/AnimatedVisibility/index.d.ts.map +1 -0
  31. package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts +3 -0
  32. package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts.map +1 -0
  33. package/build/jetpack-compose/Button/index.d.ts +65 -51
  34. package/build/jetpack-compose/Button/index.d.ts.map +1 -1
  35. package/build/jetpack-compose/Card/index.d.ts +72 -14
  36. package/build/jetpack-compose/Card/index.d.ts.map +1 -1
  37. package/build/jetpack-compose/Checkbox/index.d.ts +73 -0
  38. package/build/jetpack-compose/Checkbox/index.d.ts.map +1 -0
  39. package/build/jetpack-compose/Chip/index.d.ts +247 -27
  40. package/build/jetpack-compose/Chip/index.d.ts.map +1 -1
  41. package/build/jetpack-compose/DatePicker/index.d.ts +137 -3
  42. package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
  43. package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts +70 -0
  44. package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts.map +1 -0
  45. package/build/jetpack-compose/DropdownMenu/index.d.ts +68 -0
  46. package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -0
  47. package/build/jetpack-compose/FloatingActionButton/index.d.ts +150 -0
  48. package/build/jetpack-compose/FloatingActionButton/index.d.ts.map +1 -0
  49. package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts +2 -2
  50. package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts.map +1 -1
  51. package/build/jetpack-compose/IconButton/index.d.ts +45 -29
  52. package/build/jetpack-compose/IconButton/index.d.ts.map +1 -1
  53. package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts +17 -0
  54. package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts.map +1 -0
  55. package/build/jetpack-compose/Progress/index.d.ts +78 -35
  56. package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
  57. package/build/jetpack-compose/RadioButton/index.d.ts +2 -2
  58. package/build/jetpack-compose/RadioButton/index.d.ts.map +1 -1
  59. package/build/jetpack-compose/SegmentedButton/index.d.ts +74 -0
  60. package/build/jetpack-compose/SegmentedButton/index.d.ts.map +1 -0
  61. package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts +17 -0
  62. package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts.map +1 -0
  63. package/build/jetpack-compose/Slider/index.d.ts +34 -10
  64. package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
  65. package/build/jetpack-compose/Spacer/index.d.ts +2 -2
  66. package/build/jetpack-compose/Switch/index.d.ts +25 -47
  67. package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
  68. package/build/jetpack-compose/ToggleButton/index.d.ts +60 -32
  69. package/build/jetpack-compose/ToggleButton/index.d.ts.map +1 -1
  70. package/build/jetpack-compose/index.d.ts +5 -4
  71. package/build/jetpack-compose/index.d.ts.map +1 -1
  72. package/build/jetpack-compose/modifiers/animation.d.ts +44 -0
  73. package/build/jetpack-compose/modifiers/animation.d.ts.map +1 -0
  74. package/build/jetpack-compose/modifiers/index.d.ts +68 -4
  75. package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
  76. package/build/swift-ui/AccessoryWidgetBackground/index.d.ts +4 -0
  77. package/build/swift-ui/AccessoryWidgetBackground/index.d.ts.map +1 -0
  78. package/build/swift-ui/ConfirmationDialog/index.d.ts.map +1 -1
  79. package/build/swift-ui/ContextMenu/index.d.ts.map +1 -1
  80. package/build/swift-ui/ControlGroup/index.d.ts +29 -0
  81. package/build/swift-ui/ControlGroup/index.d.ts.map +1 -0
  82. package/build/swift-ui/Gauge/index.d.ts.map +1 -1
  83. package/build/swift-ui/Image/index.d.ts +7 -1
  84. package/build/swift-ui/Image/index.d.ts.map +1 -1
  85. package/build/swift-ui/Label/index.d.ts.map +1 -1
  86. package/build/swift-ui/LabeledContent/index.d.ts.map +1 -1
  87. package/build/swift-ui/Menu/index.d.ts.map +1 -1
  88. package/build/swift-ui/Picker/index.d.ts.map +1 -1
  89. package/build/swift-ui/Popover/index.d.ts.map +1 -1
  90. package/build/swift-ui/ProgressView/index.d.ts +1 -5
  91. package/build/swift-ui/ProgressView/index.d.ts.map +1 -1
  92. package/build/swift-ui/Section/index.d.ts.map +1 -1
  93. package/build/swift-ui/Slider/index.d.ts.map +1 -1
  94. package/build/swift-ui/SlotView.d.ts +5 -0
  95. package/build/swift-ui/SlotView.d.ts.map +1 -0
  96. package/build/swift-ui/Stepper/index.d.ts +3 -3
  97. package/build/swift-ui/Stepper/index.d.ts.map +1 -1
  98. package/build/swift-ui/Text/index.d.ts +33 -1
  99. package/build/swift-ui/Text/index.d.ts.map +1 -1
  100. package/build/swift-ui/index.d.ts +2 -0
  101. package/build/swift-ui/index.d.ts.map +1 -1
  102. package/build/swift-ui/modifiers/index.d.ts +54 -1
  103. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  104. package/build/swift-ui/modifiers/shapes/index.d.ts +2 -2
  105. package/build/swift-ui/types.d.ts +7 -0
  106. package/build/swift-ui/types.d.ts.map +1 -1
  107. package/expo-module.config.json +1 -1
  108. package/ios/AccessoryWidgetBackgroundView.swift +27 -0
  109. package/ios/BottomSheetView.swift +1 -6
  110. package/ios/ClosedRangeDateRecord.swift +10 -0
  111. package/ios/ColorPickerView.swift +9 -8
  112. package/ios/ConfirmationDialog/ConfirmationDialog.swift +7 -15
  113. package/ios/ConfirmationDialog/ConfirmationDialogProps.swift +0 -5
  114. package/ios/ContextMenu/ContextMenu.swift +27 -22
  115. package/ios/ContextMenu/ContextMenuRecords.swift +0 -6
  116. package/ios/ControlGroupView.swift +33 -0
  117. package/ios/DatePickerView.swift +7 -5
  118. package/ios/DisclosureGroupView.swift +5 -7
  119. package/ios/ExpoUIModule.swift +10 -32
  120. package/ios/GaugeView.swift +4 -26
  121. package/ios/HostView.swift +1 -2
  122. package/ios/ImageView.swift +22 -11
  123. package/ios/Label.swift +2 -17
  124. package/ios/LabeledContentView.swift +3 -27
  125. package/ios/ListView.swift +6 -14
  126. package/ios/Menu/MenuRecords.swift +0 -2
  127. package/ios/Menu/MenuView.swift +2 -5
  128. package/ios/Modifiers/DefaultScrollAnchorForRoleModifier.swift +32 -0
  129. package/ios/Modifiers/DefaultScrollAnchorModifier.swift +16 -0
  130. package/ios/Modifiers/ResizableModifier.swift +24 -0
  131. package/ios/Modifiers/Rotation3DEffectModifier.swift +20 -0
  132. package/ios/Modifiers/View+ModifierArray.swift +29 -0
  133. package/ios/Modifiers/ViewModifierRegistry.swift +37 -3
  134. package/ios/Modifiers/WidgetModifiers.swift +46 -0
  135. package/ios/Picker/PickerView.swift +8 -16
  136. package/ios/Popover/PopoverProps.swift +0 -4
  137. package/ios/Popover/PopoverView.swift +5 -11
  138. package/ios/ProgressView.swift +0 -5
  139. package/ios/RNHostView.swift +91 -10
  140. package/ios/SectionView.swift +9 -17
  141. package/ios/SecureFieldView.swift +0 -1
  142. package/ios/ShareLink/ShareLinkView.swift +1 -1
  143. package/ios/SliderView.swift +16 -31
  144. package/ios/SlotView.swift +38 -0
  145. package/ios/StepperView.swift +12 -16
  146. package/ios/TextFieldView.swift +0 -1
  147. package/ios/TextView.swift +37 -1
  148. package/ios/Toggle/ToggleView.swift +5 -7
  149. package/ios/UIBaseView.swift +34 -3
  150. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar +0 -0
  151. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.md5 +1 -0
  152. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha1 +1 -0
  153. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha256 +1 -0
  154. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha512 +1 -0
  155. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar +0 -0
  156. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.md5 +1 -0
  157. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha1 +1 -0
  158. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha256 +1 -0
  159. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha512 +1 -0
  160. 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
  161. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.md5 +1 -0
  162. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha1 +1 -0
  163. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha256 +1 -0
  164. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha512 +1 -0
  165. 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
  166. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.md5 +1 -0
  167. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha1 +1 -0
  168. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha256 +1 -0
  169. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha512 +1 -0
  170. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  171. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  172. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  173. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  174. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  175. package/package.json +5 -2
  176. package/src/jetpack-compose/AnimatedVisibility/index.tsx +206 -0
  177. package/src/jetpack-compose/AnimatedVisibility/symbols.ts +8 -0
  178. package/src/jetpack-compose/Button/index.tsx +69 -92
  179. package/src/jetpack-compose/Card/index.tsx +105 -29
  180. package/src/jetpack-compose/Checkbox/index.tsx +126 -0
  181. package/src/jetpack-compose/Chip/index.tsx +391 -51
  182. package/src/jetpack-compose/DatePicker/index.tsx +215 -6
  183. package/src/jetpack-compose/DropdownMenu/DropdownMenuItem.tsx +126 -0
  184. package/src/jetpack-compose/DropdownMenu/index.tsx +107 -0
  185. package/src/jetpack-compose/FloatingActionButton/index.tsx +207 -0
  186. package/src/jetpack-compose/HorizontalFloatingToolbar/index.tsx +4 -2
  187. package/src/jetpack-compose/IconButton/index.tsx +49 -56
  188. package/src/jetpack-compose/MultiChoiceSegmentedButtonRow/index.tsx +34 -0
  189. package/src/jetpack-compose/Progress/index.tsx +120 -62
  190. package/src/jetpack-compose/RadioButton/index.tsx +8 -9
  191. package/src/jetpack-compose/SegmentedButton/index.tsx +109 -0
  192. package/src/jetpack-compose/SingleChoiceSegmentedButtonRow/index.tsx +34 -0
  193. package/src/jetpack-compose/Slider/index.tsx +76 -29
  194. package/src/jetpack-compose/Spacer/index.tsx +2 -2
  195. package/src/jetpack-compose/Switch/index.tsx +32 -84
  196. package/src/jetpack-compose/ToggleButton/index.tsx +67 -43
  197. package/src/jetpack-compose/index.ts +5 -4
  198. package/src/jetpack-compose/modifiers/animation.ts +37 -0
  199. package/src/jetpack-compose/modifiers/index.ts +86 -6
  200. package/src/swift-ui/AccessoryWidgetBackground/index.tsx +12 -0
  201. package/src/swift-ui/ConfirmationDialog/index.tsx +4 -12
  202. package/src/swift-ui/ContextMenu/index.tsx +6 -20
  203. package/src/swift-ui/ControlGroup/index.tsx +59 -0
  204. package/src/swift-ui/Gauge/index.tsx +5 -20
  205. package/src/swift-ui/Image/index.tsx +7 -1
  206. package/src/swift-ui/Label/index.tsx +2 -5
  207. package/src/swift-ui/LabeledContent/index.tsx +3 -12
  208. package/src/swift-ui/Menu/index.tsx +2 -6
  209. package/src/swift-ui/Picker/index.tsx +4 -11
  210. package/src/swift-ui/Popover/index.tsx +3 -12
  211. package/src/swift-ui/ProgressView/index.tsx +1 -3
  212. package/src/swift-ui/Section/index.tsx +4 -9
  213. package/src/swift-ui/Slider/index.tsx +4 -12
  214. package/src/swift-ui/SlotView.tsx +8 -0
  215. package/src/swift-ui/Stepper/index.tsx +7 -7
  216. package/src/swift-ui/Text/index.tsx +66 -2
  217. package/src/swift-ui/index.tsx +2 -0
  218. package/src/swift-ui/modifiers/index.ts +87 -1
  219. package/src/swift-ui/types.ts +5 -0
  220. package/android/src/main/java/expo/modules/ui/FilterChipView.kt +0 -59
  221. package/android/src/main/java/expo/modules/ui/PickerView.kt +0 -161
  222. package/android/src/main/java/expo/modules/ui/TextButtonView.kt +0 -33
  223. package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +0 -183
  224. package/android/src/main/java/expo/modules/ui/menu/ContextMenuRecords.kt +0 -64
  225. package/build/jetpack-compose/Button/types.d.ts +0 -5
  226. package/build/jetpack-compose/Button/types.d.ts.map +0 -1
  227. package/build/jetpack-compose/ContextMenu/Submenu.d.ts +0 -17
  228. package/build/jetpack-compose/ContextMenu/Submenu.d.ts.map +0 -1
  229. package/build/jetpack-compose/ContextMenu/index.d.ts +0 -65
  230. package/build/jetpack-compose/ContextMenu/index.d.ts.map +0 -1
  231. package/build/jetpack-compose/ContextMenu/utils.d.ts +0 -24
  232. package/build/jetpack-compose/ContextMenu/utils.d.ts.map +0 -1
  233. package/build/jetpack-compose/FilterChip/index.d.ts +0 -49
  234. package/build/jetpack-compose/FilterChip/index.d.ts.map +0 -1
  235. package/build/jetpack-compose/Picker/index.d.ts +0 -62
  236. package/build/jetpack-compose/Picker/index.d.ts.map +0 -1
  237. package/build/jetpack-compose/TextButton/index.d.ts +0 -29
  238. package/build/jetpack-compose/TextButton/index.d.ts.map +0 -1
  239. package/ios/ConfirmationDialog/ConfirmationDialogComponents.swift +0 -26
  240. package/ios/ContextMenu/ContextMenuComponents.swift +0 -37
  241. package/ios/Menu/MenuComponents.swift +0 -12
  242. package/ios/Picker/PickerComponents.swift +0 -24
  243. package/ios/Popover/PopoverComponents.swift +0 -18
  244. package/ios/SectionComponents.swift +0 -34
  245. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar +0 -0
  246. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.md5 +0 -1
  247. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha1 +0 -1
  248. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha256 +0 -1
  249. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha512 +0 -1
  250. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar +0 -0
  251. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.md5 +0 -1
  252. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha1 +0 -1
  253. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha256 +0 -1
  254. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha512 +0 -1
  255. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.md5 +0 -1
  256. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha1 +0 -1
  257. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha256 +0 -1
  258. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha512 +0 -1
  259. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.md5 +0 -1
  260. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha1 +0 -1
  261. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha256 +0 -1
  262. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha512 +0 -1
  263. package/src/jetpack-compose/Button/types.ts +0 -57
  264. package/src/jetpack-compose/ContextMenu/Submenu.tsx +0 -21
  265. package/src/jetpack-compose/ContextMenu/index.tsx +0 -149
  266. package/src/jetpack-compose/ContextMenu/utils.ts +0 -144
  267. package/src/jetpack-compose/FilterChip/index.tsx +0 -89
  268. package/src/jetpack-compose/Picker/index.tsx +0 -90
  269. package/src/jetpack-compose/TextButton/index.tsx +0 -55
@@ -0,0 +1,93 @@
1
+ package expo.modules.ui.convertibles
2
+
3
+ import androidx.compose.animation.core.AnimationSpec
4
+ import androidx.compose.animation.core.EaseInOut
5
+ import androidx.compose.animation.core.FastOutLinearInEasing
6
+ import androidx.compose.animation.core.FastOutSlowInEasing
7
+ import androidx.compose.animation.core.LinearEasing
8
+ import androidx.compose.animation.core.LinearOutSlowInEasing
9
+ import androidx.compose.animation.core.Spring
10
+ import androidx.compose.animation.core.keyframes
11
+ import androidx.compose.animation.core.snap
12
+ import androidx.compose.animation.core.spring
13
+ import androidx.compose.animation.core.tween
14
+ import expo.modules.kotlin.records.Field
15
+ import expo.modules.kotlin.records.Record
16
+ import expo.modules.kotlin.records.recordFromMap
17
+ import expo.modules.kotlin.types.Enumerable
18
+
19
+ internal enum class EasingType(val value: String) : Enumerable {
20
+ LINEAR("linear"),
21
+ FAST_OUT_SLOW_IN("fastOutSlowIn"),
22
+ FAST_OUT_LINEAR_IN("fastOutLinearIn"),
23
+ LINEAR_OUT_SLOW_IN("linearOutSlowIn"),
24
+ EASE("ease");
25
+
26
+ fun toEasing() = when (this) {
27
+ LINEAR -> LinearEasing
28
+ FAST_OUT_SLOW_IN -> FastOutSlowInEasing
29
+ FAST_OUT_LINEAR_IN -> FastOutLinearInEasing
30
+ LINEAR_OUT_SLOW_IN -> LinearOutSlowInEasing
31
+ EASE -> EaseInOut
32
+ }
33
+ }
34
+
35
+ internal data class SpringSpecParams(
36
+ @Field val dampingRatio: Float = Spring.DampingRatioNoBouncy,
37
+ @Field val stiffness: Float = Spring.StiffnessMedium,
38
+ @Field val visibilityThreshold: Float? = null
39
+ ) : Record {
40
+ fun toAnimationSpec(): AnimationSpec<Float> = spring(
41
+ dampingRatio = dampingRatio,
42
+ stiffness = stiffness,
43
+ visibilityThreshold = visibilityThreshold
44
+ )
45
+ }
46
+
47
+ internal data class TweenSpecParams(
48
+ @Field val durationMillis: Int = 300,
49
+ @Field val delayMillis: Int = 0,
50
+ @Field val easing: EasingType? = null
51
+ ) : Record {
52
+ fun toAnimationSpec(): AnimationSpec<Float> = tween(
53
+ durationMillis = durationMillis,
54
+ delayMillis = delayMillis,
55
+ easing = easing?.toEasing() ?: FastOutSlowInEasing
56
+ )
57
+ }
58
+
59
+ internal data class SnapSpecParams(
60
+ @Field val delayMillis: Int = 0
61
+ ) : Record {
62
+ fun toAnimationSpec(): AnimationSpec<Float> = snap(delayMillis = delayMillis)
63
+ }
64
+
65
+ internal data class KeyframesSpecParams(
66
+ @Field val durationMillis: Int = 300,
67
+ @Field val delayMillis: Int = 0
68
+ ) : Record {
69
+ @Suppress("UNCHECKED_CAST")
70
+ fun toAnimationSpec(raw: Map<*, *>): AnimationSpec<Float> {
71
+ val kf = raw["keyframes"] as? Map<String, Number> ?: emptyMap()
72
+ return keyframes {
73
+ this.durationMillis = this@KeyframesSpecParams.durationMillis
74
+ this.delayMillis = this@KeyframesSpecParams.delayMillis
75
+ for ((time, value) in kf) {
76
+ value.toFloat() at time.toInt()
77
+ }
78
+ }
79
+ }
80
+ }
81
+
82
+ @Suppress("UNCHECKED_CAST")
83
+ internal fun parseAnimationSpec(raw: Any?): AnimationSpec<Float>? {
84
+ if (raw !is Map<*, *>) return null
85
+ val map = raw as Map<String, Any?>
86
+ return when (raw["\$type"]) {
87
+ "spring" -> recordFromMap<SpringSpecParams>(map).toAnimationSpec()
88
+ "tween" -> recordFromMap<TweenSpecParams>(map).toAnimationSpec()
89
+ "snap" -> recordFromMap<SnapSpecParams>(map).toAnimationSpec()
90
+ "keyframes" -> recordFromMap<KeyframesSpecParams>(map).toAnimationSpec(raw)
91
+ else -> null
92
+ }
93
+ }
@@ -0,0 +1,24 @@
1
+ package expo.modules.ui.convertibles
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.ui.BuiltinShapeRecord
8
+
9
+ enum class CompositingStrategyType(val value: String) : Enumerable {
10
+ AUTO("auto"),
11
+ OFFSCREEN("offscreen"),
12
+ MODULATE("modulate")
13
+ }
14
+
15
+ internal data class GraphicsLayerParams(
16
+ @Field val cameraDistance: Float = 8f,
17
+ @Field val transformOriginX: Float = 0.5f,
18
+ @Field val transformOriginY: Float = 0.5f,
19
+ @Field val clip: Boolean = false,
20
+ @Field val shape: BuiltinShapeRecord? = null,
21
+ @Field val ambientShadowColor: Color? = null,
22
+ @Field val spotShadowColor: Color? = null,
23
+ @Field val compositingStrategy: CompositingStrategyType? = null
24
+ ) : Record
@@ -0,0 +1,39 @@
1
+ package expo.modules.ui.menu
2
+
3
+ import androidx.compose.foundation.layout.Box
4
+ import androidx.compose.material3.DropdownMenu
5
+ import androidx.compose.material3.MenuDefaults
6
+ import androidx.compose.runtime.Composable
7
+ import expo.modules.kotlin.views.ComposableScope
8
+ import expo.modules.kotlin.views.FunctionalComposableScope
9
+ import expo.modules.ui.ModifierRegistry
10
+ import expo.modules.ui.composeOrNull
11
+ import expo.modules.ui.findChildSlotView
12
+ import expo.modules.ui.isSlotView
13
+
14
+ @Composable
15
+ fun FunctionalComposableScope.DropdownMenuContent(
16
+ props: DropdownMenuProps,
17
+ onDismissRequest: () -> Unit
18
+ ) {
19
+ val itemsSlotView = findChildSlotView(view, "items")
20
+
21
+ Box(modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)) {
22
+ // Trigger - non-items children
23
+ Children(ComposableScope(), filter = { !isSlotView(it) })
24
+
25
+ DropdownMenu(
26
+ containerColor = props.color?.composeOrNull ?: MenuDefaults.containerColor,
27
+ expanded = props.expanded,
28
+ onDismissRequest = onDismissRequest
29
+ ) {
30
+ itemsSlotView?.let {
31
+ with(ComposableScope()) {
32
+ with(it) {
33
+ Content()
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
@@ -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,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,iBAAiB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAE5E,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EACA,QAAQ,GACR,qBAAqB,GACrB,mBAAmB,GACnB,UAAU,GACV,oBAAoB,GACpB,kBAAkB,GAClB,SAAS,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EACA,SAAS,GACT,sBAAsB,GACtB,oBAAoB,GACpB,WAAW,GACX,oBAAoB,GACpB,kBAAkB,GAClB,UAAU,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,+FAA+F;IAC/F,IAAI,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,mBAAmB,CAAC;IAC1D,CAAC,uBAAuB,CAAC,EA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AC;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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CAAC;AAEvC;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,GAAG,iBAAiB,CAU5F;AAaD;;GAEG;AACH,eAAO,MAAM,MAAM;YAXS,WAAW;;CAWc,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,iBAAiB;YAhBF,WAAW;;CAgBoC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,cAAc;YArBC,WAAW;;CAqB8B,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,cAAc;YA1BC,WAAW;;CA0B8B,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,UAAU;YA/BK,WAAW;;CA+BsB,CAAC"}
@@ -1,40 +1,98 @@
1
1
  import { type ColorValue } from 'react-native';
2
- import { ExpoModifier } from '../../types';
2
+ import { type ModifierConfig } from '../../types';
3
3
  /**
4
4
  * Colors for card's core elements.
5
5
  */
6
- export type CardElementColors = {
6
+ export type CardColors = {
7
7
  containerColor?: ColorValue;
8
8
  contentColor?: ColorValue;
9
9
  };
10
+ /**
11
+ * Border configuration for cards.
12
+ */
13
+ export type CardBorder = {
14
+ /**
15
+ * Border width in dp.
16
+ * @default 1
17
+ */
18
+ width?: number;
19
+ /**
20
+ * Border color.
21
+ */
22
+ color?: ColorValue;
23
+ };
10
24
  export type CardProps = {
11
25
  /**
12
26
  * The content to display inside the card.
13
27
  */
14
28
  children?: React.ReactNode;
15
29
  /**
16
- * The variant of the card.
17
- * - 'default' - A filled card with no outline.
18
- * - 'elevated' - A filled card with elevation/shadow.
19
- * - 'outlined' - A card with an outline border.
20
- * @default 'default'
30
+ * Colors for card's core elements.
21
31
  */
22
- variant?: 'default' | 'elevated' | 'outlined';
32
+ colors?: CardColors;
23
33
  /**
24
- * The background color of the card.
34
+ * Default elevation in dp.
25
35
  */
26
- color?: ColorValue;
36
+ elevation?: number;
37
+ /**
38
+ * Border configuration for the card.
39
+ */
40
+ border?: CardBorder;
41
+ /**
42
+ * Modifiers for the component.
43
+ */
44
+ modifiers?: ModifierConfig[];
45
+ };
46
+ /**
47
+ * A card component that renders a filled card surface for content.
48
+ */
49
+ export declare const Card: import("react").ComponentType<CardProps>;
50
+ export type ElevatedCardProps = {
51
+ /**
52
+ * The content to display inside the card.
53
+ */
54
+ children?: React.ReactNode;
55
+ /**
56
+ * Colors for card's core elements.
57
+ */
58
+ colors?: CardColors;
59
+ /**
60
+ * Default elevation in dp. Material 3 default is 1dp.
61
+ */
62
+ elevation?: number;
63
+ /**
64
+ * Modifiers for the component.
65
+ */
66
+ modifiers?: ModifierConfig[];
67
+ };
68
+ /**
69
+ * An elevated card component that provides a raised surface for content.
70
+ */
71
+ export declare const ElevatedCard: import("react").ComponentType<ElevatedCardProps>;
72
+ export type OutlinedCardProps = {
73
+ /**
74
+ * The content to display inside the card.
75
+ */
76
+ children?: React.ReactNode;
27
77
  /**
28
78
  * Colors for card's core elements.
29
79
  */
30
- elementColors?: CardElementColors;
80
+ colors?: CardColors;
81
+ /**
82
+ * Default elevation in dp.
83
+ */
84
+ elevation?: number;
85
+ /**
86
+ * Border configuration for the outlined card.
87
+ */
88
+ border?: CardBorder;
31
89
  /**
32
90
  * Modifiers for the component.
33
91
  */
34
- modifiers?: ExpoModifier[];
92
+ modifiers?: ModifierConfig[];
35
93
  };
36
94
  /**
37
- * A card component that provides a surface for content.
95
+ * An outlined card component that provides a bordered surface for content.
38
96
  */
39
- export declare function Card(props: CardProps): import("react").JSX.Element;
97
+ export declare const OutlinedCard: import("react").ComponentType<OutlinedCardProps>;
40
98
  //# sourceMappingURL=index.d.ts.map