@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
@@ -1,62 +1,138 @@
1
1
  import { requireNativeView } from 'expo';
2
2
  import { type ColorValue } from 'react-native';
3
3
 
4
- import { ExpoModifier } from '../../types';
4
+ import { type ModifierConfig } from '../../types';
5
5
  import { createViewModifierEventListener } from '../modifiers/utils';
6
6
 
7
7
  /**
8
8
  * Colors for card's core elements.
9
9
  */
10
- export type CardElementColors = {
10
+ export type CardColors = {
11
11
  containerColor?: ColorValue;
12
12
  contentColor?: ColorValue;
13
13
  };
14
14
 
15
+ /**
16
+ * Border configuration for cards.
17
+ */
18
+ export type CardBorder = {
19
+ /**
20
+ * Border width in dp.
21
+ * @default 1
22
+ */
23
+ width?: number;
24
+ /**
25
+ * Border color.
26
+ */
27
+ color?: ColorValue;
28
+ };
29
+
30
+ function transformProps<T extends { modifiers?: ModifierConfig[] }>(props: T): T {
31
+ const { modifiers, ...restProps } = props;
32
+ return {
33
+ modifiers,
34
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
35
+ ...restProps,
36
+ } as T;
37
+ }
38
+
39
+ function createCardComponent<P extends { modifiers?: ModifierConfig[] }>(
40
+ viewName: string
41
+ ): React.ComponentType<P> {
42
+ const NativeView: React.ComponentType<P> = requireNativeView('ExpoUI', viewName);
43
+ return function CardComponent(props: P) {
44
+ return <NativeView {...transformProps(props)} />;
45
+ };
46
+ }
47
+
48
+ // region Card
49
+
15
50
  export type CardProps = {
16
51
  /**
17
52
  * The content to display inside the card.
18
53
  */
19
54
  children?: React.ReactNode;
20
55
  /**
21
- * The variant of the card.
22
- * - 'default' - A filled card with no outline.
23
- * - 'elevated' - A filled card with elevation/shadow.
24
- * - 'outlined' - A card with an outline border.
25
- * @default 'default'
56
+ * Colors for card's core elements.
26
57
  */
27
- variant?: 'default' | 'elevated' | 'outlined';
58
+ colors?: CardColors;
28
59
  /**
29
- * The background color of the card.
60
+ * Default elevation in dp.
30
61
  */
31
- color?: ColorValue;
62
+ elevation?: number;
63
+ /**
64
+ * Border configuration for the card.
65
+ */
66
+ border?: CardBorder;
67
+ /**
68
+ * Modifiers for the component.
69
+ */
70
+ modifiers?: ModifierConfig[];
71
+ };
72
+
73
+ /**
74
+ * A card component that renders a filled card surface for content.
75
+ */
76
+ export const Card = createCardComponent<CardProps>('CardView');
77
+
78
+ // endregion
79
+
80
+ // region ElevatedCard
81
+
82
+ export type ElevatedCardProps = {
83
+ /**
84
+ * The content to display inside the card.
85
+ */
86
+ children?: React.ReactNode;
32
87
  /**
33
88
  * Colors for card's core elements.
34
89
  */
35
- elementColors?: CardElementColors;
90
+ colors?: CardColors;
91
+ /**
92
+ * Default elevation in dp. Material 3 default is 1dp.
93
+ */
94
+ elevation?: number;
36
95
  /**
37
96
  * Modifiers for the component.
38
97
  */
39
- modifiers?: ExpoModifier[];
98
+ modifiers?: ModifierConfig[];
40
99
  };
41
100
 
42
- type NativeCardProps = CardProps;
43
- const CardNativeView: React.ComponentType<NativeCardProps> = requireNativeView(
44
- 'ExpoUI',
45
- 'CardView'
46
- );
101
+ /**
102
+ * An elevated card component that provides a raised surface for content.
103
+ */
104
+ export const ElevatedCard = createCardComponent<ElevatedCardProps>('ElevatedCardView');
47
105
 
48
- function transformProps(props: CardProps): NativeCardProps {
49
- const { modifiers, ...restProps } = props;
50
- return {
51
- modifiers,
52
- ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
53
- ...restProps,
54
- };
55
- }
106
+ // endregion
107
+
108
+ // region OutlinedCard
109
+
110
+ export type OutlinedCardProps = {
111
+ /**
112
+ * The content to display inside the card.
113
+ */
114
+ children?: React.ReactNode;
115
+ /**
116
+ * Colors for card's core elements.
117
+ */
118
+ colors?: CardColors;
119
+ /**
120
+ * Default elevation in dp.
121
+ */
122
+ elevation?: number;
123
+ /**
124
+ * Border configuration for the outlined card.
125
+ */
126
+ border?: CardBorder;
127
+ /**
128
+ * Modifiers for the component.
129
+ */
130
+ modifiers?: ModifierConfig[];
131
+ };
56
132
 
57
133
  /**
58
- * A card component that provides a surface for content.
134
+ * An outlined card component that provides a bordered surface for content.
59
135
  */
60
- export function Card(props: CardProps) {
61
- return <CardNativeView {...transformProps(props)} />;
62
- }
136
+ export const OutlinedCard = createCardComponent<OutlinedCardProps>('OutlinedCardView');
137
+
138
+ // endregion
@@ -0,0 +1,126 @@
1
+ import { requireNativeView } from 'expo';
2
+ import { NativeSyntheticEvent, type ColorValue } from 'react-native';
3
+
4
+ import { type ModifierConfig, ViewEvent } from '../../types';
5
+ import { createViewModifierEventListener } from '../modifiers/utils';
6
+
7
+ /**
8
+ * Colors for checkbox core elements.
9
+ */
10
+ export type CheckboxColors = {
11
+ checkedColor?: ColorValue;
12
+ disabledCheckedColor?: ColorValue;
13
+ uncheckedColor?: ColorValue;
14
+ disabledUncheckedColor?: ColorValue;
15
+ checkmarkColor?: ColorValue;
16
+ disabledIndeterminateColor?: ColorValue;
17
+ };
18
+
19
+ export type CheckboxProps = {
20
+ /**
21
+ * Indicates whether the checkbox is checked.
22
+ */
23
+ value: boolean;
24
+ /**
25
+ * Whether the checkbox is enabled.
26
+ * @default true
27
+ */
28
+ enabled?: boolean;
29
+ /**
30
+ * Callback function that is called when the checked state changes.
31
+ */
32
+ onCheckedChange?: (value: boolean) => void;
33
+ /**
34
+ * Colors for checkbox core elements.
35
+ */
36
+ colors?: CheckboxColors;
37
+ /**
38
+ * Modifiers for the component.
39
+ */
40
+ modifiers?: ModifierConfig[];
41
+ };
42
+
43
+ type NativeCheckboxProps = Omit<CheckboxProps, 'onCheckedChange'> & {
44
+ nativeClickable: boolean;
45
+ onCheckedChange: (event: NativeSyntheticEvent<{ value: boolean }>) => void;
46
+ };
47
+
48
+ const CheckboxNativeView: React.ComponentType<NativeCheckboxProps> = requireNativeView(
49
+ 'ExpoUI',
50
+ 'CheckboxView'
51
+ );
52
+
53
+ function transformCheckboxProps(props: CheckboxProps): NativeCheckboxProps {
54
+ const { modifiers, onCheckedChange, ...restProps } = props;
55
+ return {
56
+ modifiers,
57
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
58
+ ...restProps,
59
+ nativeClickable: onCheckedChange != null,
60
+ onCheckedChange: ({ nativeEvent: { value } }) => {
61
+ onCheckedChange?.(value);
62
+ },
63
+ };
64
+ }
65
+
66
+ /**
67
+ * A checkbox component.
68
+ */
69
+ export function Checkbox(props: CheckboxProps) {
70
+ return <CheckboxNativeView {...transformCheckboxProps(props)} />;
71
+ }
72
+
73
+ /**
74
+ * The toggleable state of a tri-state checkbox.
75
+ */
76
+ export type ToggleableState = 'on' | 'off' | 'indeterminate';
77
+
78
+ export type TriStateCheckboxProps = {
79
+ /**
80
+ * The toggleable state of the checkbox: `'on'`, `'off'`, or `'indeterminate'`.
81
+ */
82
+ state: ToggleableState;
83
+ /**
84
+ * Whether the checkbox is enabled.
85
+ * @default true
86
+ */
87
+ enabled?: boolean;
88
+ /**
89
+ * Callback function that is called when the checkbox is clicked.
90
+ */
91
+ onClick?: () => void;
92
+ /**
93
+ * Colors for checkbox core elements.
94
+ */
95
+ colors?: CheckboxColors;
96
+ /**
97
+ * Modifiers for the component.
98
+ */
99
+ modifiers?: ModifierConfig[];
100
+ };
101
+
102
+ type NativeTriStateCheckboxProps = Omit<TriStateCheckboxProps, 'onClick'> & {
103
+ nativeClickable: boolean;
104
+ } & ViewEvent<'onNativeClick', void>;
105
+
106
+ const TriStateCheckboxNativeView: React.ComponentType<NativeTriStateCheckboxProps> =
107
+ requireNativeView('ExpoUI', 'TriStateCheckboxView');
108
+
109
+ function transformTriStateCheckboxProps(props: TriStateCheckboxProps): NativeTriStateCheckboxProps {
110
+ const { modifiers, onClick, ...restProps } = props;
111
+ return {
112
+ modifiers,
113
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
114
+ ...restProps,
115
+ nativeClickable: onClick != null,
116
+ onNativeClick: onClick ? () => onClick() : undefined,
117
+ };
118
+ }
119
+
120
+ /**
121
+ * A tri-state checkbox component that supports `'on'`, `'off'`, and `'indeterminate'` states.
122
+ * Useful for "select all" patterns where the parent checkbox reflects the state of its children.
123
+ */
124
+ export function TriStateCheckbox(props: TriStateCheckboxProps) {
125
+ return <TriStateCheckboxNativeView {...transformTriStateCheckboxProps(props)} />;
126
+ }