@expo/ui 55.0.2 → 55.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/CHANGELOG.md +31 -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/CardView.kt +138 -34
  5. package/android/src/main/java/expo/modules/ui/CheckboxView.kt +98 -0
  6. package/android/src/main/java/expo/modules/ui/ChipView.kt +267 -142
  7. package/android/src/main/java/expo/modules/ui/DatePickerView.kt +258 -70
  8. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +204 -57
  9. package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +44 -1
  10. package/android/src/main/java/expo/modules/ui/ProgressView.kt +189 -89
  11. package/android/src/main/java/expo/modules/ui/RadioButtonView.kt +3 -7
  12. package/android/src/main/java/expo/modules/ui/SegmentedButtonView.kt +115 -0
  13. package/android/src/main/java/expo/modules/ui/SegmentedControlView.kt +35 -0
  14. package/android/src/main/java/expo/modules/ui/SliderView.kt +70 -12
  15. package/android/src/main/java/expo/modules/ui/SwitchView.kt +53 -161
  16. package/android/src/main/java/expo/modules/ui/ToggleButtonView.kt +95 -57
  17. package/android/src/main/java/expo/modules/ui/button/Button.kt +117 -158
  18. package/android/src/main/java/expo/modules/ui/button/FloatingActionButton.kt +92 -0
  19. package/android/src/main/java/expo/modules/ui/button/IconButton.kt +73 -86
  20. package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +39 -0
  21. package/android/src/main/java/expo/modules/ui/menu/DropdownMenuItem.kt +70 -0
  22. package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +18 -0
  23. package/build/jetpack-compose/AnimatedVisibility/index.d.ts +134 -0
  24. package/build/jetpack-compose/AnimatedVisibility/index.d.ts.map +1 -0
  25. package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts +3 -0
  26. package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts.map +1 -0
  27. package/build/jetpack-compose/Button/index.d.ts +65 -51
  28. package/build/jetpack-compose/Button/index.d.ts.map +1 -1
  29. package/build/jetpack-compose/Card/index.d.ts +72 -14
  30. package/build/jetpack-compose/Card/index.d.ts.map +1 -1
  31. package/build/jetpack-compose/Checkbox/index.d.ts +73 -0
  32. package/build/jetpack-compose/Checkbox/index.d.ts.map +1 -0
  33. package/build/jetpack-compose/Chip/index.d.ts +247 -27
  34. package/build/jetpack-compose/Chip/index.d.ts.map +1 -1
  35. package/build/jetpack-compose/DatePicker/index.d.ts +38 -3
  36. package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
  37. package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts +70 -0
  38. package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts.map +1 -0
  39. package/build/jetpack-compose/DropdownMenu/index.d.ts +68 -0
  40. package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -0
  41. package/build/jetpack-compose/FloatingActionButton/index.d.ts +150 -0
  42. package/build/jetpack-compose/FloatingActionButton/index.d.ts.map +1 -0
  43. package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts +2 -2
  44. package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts.map +1 -1
  45. package/build/jetpack-compose/IconButton/index.d.ts +45 -29
  46. package/build/jetpack-compose/IconButton/index.d.ts.map +1 -1
  47. package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts +17 -0
  48. package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts.map +1 -0
  49. package/build/jetpack-compose/Progress/index.d.ts +78 -35
  50. package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
  51. package/build/jetpack-compose/RadioButton/index.d.ts +2 -2
  52. package/build/jetpack-compose/RadioButton/index.d.ts.map +1 -1
  53. package/build/jetpack-compose/SegmentedButton/index.d.ts +74 -0
  54. package/build/jetpack-compose/SegmentedButton/index.d.ts.map +1 -0
  55. package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts +17 -0
  56. package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts.map +1 -0
  57. package/build/jetpack-compose/Slider/index.d.ts +34 -10
  58. package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
  59. package/build/jetpack-compose/Switch/index.d.ts +10 -50
  60. package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
  61. package/build/jetpack-compose/ToggleButton/index.d.ts +60 -32
  62. package/build/jetpack-compose/ToggleButton/index.d.ts.map +1 -1
  63. package/build/jetpack-compose/index.d.ts +5 -4
  64. package/build/jetpack-compose/index.d.ts.map +1 -1
  65. package/build/jetpack-compose/modifiers/index.d.ts +18 -1
  66. package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
  67. package/build/swift-ui/ProgressView/index.d.ts +1 -5
  68. package/build/swift-ui/ProgressView/index.d.ts.map +1 -1
  69. package/build/swift-ui/Stepper/index.d.ts +3 -3
  70. package/build/swift-ui/Stepper/index.d.ts.map +1 -1
  71. package/build/swift-ui/Text/index.d.ts +33 -1
  72. package/build/swift-ui/Text/index.d.ts.map +1 -1
  73. package/build/swift-ui/modifiers/index.d.ts +22 -1
  74. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  75. package/build/swift-ui/modifiers/shapes/index.d.ts +2 -2
  76. package/build/swift-ui/types.d.ts +7 -0
  77. package/build/swift-ui/types.d.ts.map +1 -1
  78. package/expo-module.config.json +1 -1
  79. package/ios/BottomSheetView.swift +1 -6
  80. package/ios/ClosedRangeDateRecord.swift +10 -0
  81. package/ios/ColorPickerView.swift +9 -8
  82. package/ios/ConfirmationDialog/ConfirmationDialog.swift +4 -6
  83. package/ios/DatePickerView.swift +7 -5
  84. package/ios/DisclosureGroupView.swift +5 -7
  85. package/ios/ListView.swift +6 -14
  86. package/ios/Modifiers/DefaultScrollAnchorForRoleModifier.swift +32 -0
  87. package/ios/Modifiers/DefaultScrollAnchorModifier.swift +16 -0
  88. package/ios/Modifiers/ViewModifierRegistry.swift +8 -0
  89. package/ios/Picker/PickerView.swift +6 -10
  90. package/ios/Popover/PopoverView.swift +3 -5
  91. package/ios/ProgressView.swift +0 -5
  92. package/ios/SectionView.swift +3 -5
  93. package/ios/SliderView.swift +8 -6
  94. package/ios/StepperView.swift +12 -16
  95. package/ios/TextView.swift +37 -1
  96. package/ios/Toggle/ToggleView.swift +5 -7
  97. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar +0 -0
  98. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.md5 +1 -0
  99. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha1 +1 -0
  100. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha256 +1 -0
  101. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha512 +1 -0
  102. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar +0 -0
  103. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.md5 +1 -0
  104. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha1 +1 -0
  105. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha256 +1 -0
  106. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha512 +1 -0
  107. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.2/expo.modules.ui-55.0.2.module → 55.0.3/expo.modules.ui-55.0.3.module} +22 -22
  108. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.md5 +1 -0
  109. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha1 +1 -0
  110. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha256 +1 -0
  111. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha512 +1 -0
  112. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.2/expo.modules.ui-55.0.2.pom → 55.0.3/expo.modules.ui-55.0.3.pom} +1 -1
  113. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.md5 +1 -0
  114. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha1 +1 -0
  115. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha256 +1 -0
  116. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha512 +1 -0
  117. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  118. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  119. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  120. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  121. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  122. package/package.json +5 -2
  123. package/src/jetpack-compose/AnimatedVisibility/index.tsx +206 -0
  124. package/src/jetpack-compose/AnimatedVisibility/symbols.ts +8 -0
  125. package/src/jetpack-compose/Button/index.tsx +69 -92
  126. package/src/jetpack-compose/Card/index.tsx +105 -29
  127. package/src/jetpack-compose/Checkbox/index.tsx +126 -0
  128. package/src/jetpack-compose/Chip/index.tsx +391 -51
  129. package/src/jetpack-compose/DatePicker/index.tsx +112 -7
  130. package/src/jetpack-compose/DropdownMenu/DropdownMenuItem.tsx +126 -0
  131. package/src/jetpack-compose/DropdownMenu/index.tsx +107 -0
  132. package/src/jetpack-compose/FloatingActionButton/index.tsx +207 -0
  133. package/src/jetpack-compose/HorizontalFloatingToolbar/index.tsx +4 -2
  134. package/src/jetpack-compose/IconButton/index.tsx +49 -56
  135. package/src/jetpack-compose/MultiChoiceSegmentedButtonRow/index.tsx +34 -0
  136. package/src/jetpack-compose/Progress/index.tsx +120 -62
  137. package/src/jetpack-compose/RadioButton/index.tsx +8 -9
  138. package/src/jetpack-compose/SegmentedButton/index.tsx +109 -0
  139. package/src/jetpack-compose/SingleChoiceSegmentedButtonRow/index.tsx +34 -0
  140. package/src/jetpack-compose/Slider/index.tsx +76 -29
  141. package/src/jetpack-compose/Switch/index.tsx +17 -87
  142. package/src/jetpack-compose/ToggleButton/index.tsx +67 -43
  143. package/src/jetpack-compose/index.ts +5 -4
  144. package/src/jetpack-compose/modifiers/index.ts +26 -2
  145. package/src/swift-ui/ProgressView/index.tsx +1 -3
  146. package/src/swift-ui/Stepper/index.tsx +7 -7
  147. package/src/swift-ui/Text/index.tsx +66 -2
  148. package/src/swift-ui/modifiers/index.ts +40 -0
  149. package/src/swift-ui/types.ts +5 -0
  150. package/android/src/main/java/expo/modules/ui/FilterChipView.kt +0 -59
  151. package/android/src/main/java/expo/modules/ui/PickerView.kt +0 -161
  152. package/android/src/main/java/expo/modules/ui/TextButtonView.kt +0 -33
  153. package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +0 -183
  154. package/android/src/main/java/expo/modules/ui/menu/ContextMenuRecords.kt +0 -64
  155. package/build/jetpack-compose/Button/types.d.ts +0 -5
  156. package/build/jetpack-compose/Button/types.d.ts.map +0 -1
  157. package/build/jetpack-compose/ContextMenu/Submenu.d.ts +0 -17
  158. package/build/jetpack-compose/ContextMenu/Submenu.d.ts.map +0 -1
  159. package/build/jetpack-compose/ContextMenu/index.d.ts +0 -65
  160. package/build/jetpack-compose/ContextMenu/index.d.ts.map +0 -1
  161. package/build/jetpack-compose/ContextMenu/utils.d.ts +0 -24
  162. package/build/jetpack-compose/ContextMenu/utils.d.ts.map +0 -1
  163. package/build/jetpack-compose/FilterChip/index.d.ts +0 -49
  164. package/build/jetpack-compose/FilterChip/index.d.ts.map +0 -1
  165. package/build/jetpack-compose/Picker/index.d.ts +0 -62
  166. package/build/jetpack-compose/Picker/index.d.ts.map +0 -1
  167. package/build/jetpack-compose/TextButton/index.d.ts +0 -29
  168. package/build/jetpack-compose/TextButton/index.d.ts.map +0 -1
  169. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar +0 -0
  170. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.md5 +0 -1
  171. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha1 +0 -1
  172. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha256 +0 -1
  173. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha512 +0 -1
  174. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar +0 -0
  175. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.md5 +0 -1
  176. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha1 +0 -1
  177. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha256 +0 -1
  178. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha512 +0 -1
  179. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.md5 +0 -1
  180. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha1 +0 -1
  181. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha256 +0 -1
  182. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha512 +0 -1
  183. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.md5 +0 -1
  184. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha1 +0 -1
  185. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha256 +0 -1
  186. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha512 +0 -1
  187. package/src/jetpack-compose/Button/types.ts +0 -57
  188. package/src/jetpack-compose/ContextMenu/Submenu.tsx +0 -21
  189. package/src/jetpack-compose/ContextMenu/index.tsx +0 -149
  190. package/src/jetpack-compose/ContextMenu/utils.ts +0 -144
  191. package/src/jetpack-compose/FilterChip/index.tsx +0 -89
  192. package/src/jetpack-compose/Picker/index.tsx +0 -90
  193. package/src/jetpack-compose/TextButton/index.tsx +0 -55
@@ -1,62 +0,0 @@
1
- import { type ColorValue } from 'react-native';
2
- import { ExpoModifier } from '../../types';
3
- /**
4
- * Colors for picker's core elements.
5
- */
6
- export type PickerElementColors = {
7
- activeBorderColor?: ColorValue;
8
- activeContentColor?: ColorValue;
9
- inactiveBorderColor?: ColorValue;
10
- inactiveContentColor?: ColorValue;
11
- disabledActiveBorderColor?: ColorValue;
12
- disabledActiveContentColor?: ColorValue;
13
- disabledInactiveBorderColor?: ColorValue;
14
- disabledInactiveContentColor?: ColorValue;
15
- activeContainerColor?: ColorValue;
16
- inactiveContainerColor?: ColorValue;
17
- disabledActiveContainerColor?: ColorValue;
18
- disabledInactiveContainerColor?: ColorValue;
19
- };
20
- export type PickerProps = {
21
- /**
22
- * An array of options to be displayed in the picker.
23
- */
24
- options: string[];
25
- /**
26
- * The index of the currently selected option.
27
- */
28
- selectedIndex: number | null;
29
- /**
30
- * Callback function that is called when an option is selected.
31
- */
32
- onOptionSelected?: (event: {
33
- nativeEvent: {
34
- index: number;
35
- label: string;
36
- };
37
- }) => void;
38
- /**
39
- * The variant of the picker, which determines its appearance and behavior.
40
- * @default 'segmented'
41
- */
42
- variant?: 'segmented' | 'radio';
43
- /**
44
- * Colors for picker's core elements.
45
- */
46
- elementColors?: PickerElementColors;
47
- /**
48
- * Picker color.
49
- */
50
- color?: ColorValue;
51
- /**
52
- * Modifiers for the component.
53
- */
54
- modifiers?: ExpoModifier[];
55
- /** Modifiers for the individual buttons */
56
- buttonModifiers?: ExpoModifier[];
57
- };
58
- /**
59
- * Displays a native picker component. Depending on the variant it can be a segmented button, an inline picker, a list of choices or a radio button.
60
- */
61
- export declare function Picker(props: PickerProps): import("react").JSX.Element;
62
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/Picker/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B,kBAAkB,CAAC,EAAE,UAAU,CAAC;IAChC,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACjC,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,yBAAyB,CAAC,EAAE,UAAU,CAAC;IACvC,0BAA0B,CAAC,EAAE,UAAU,CAAC;IACxC,2BAA2B,CAAC,EAAE,UAAU,CAAC;IACzC,4BAA4B,CAAC,EAAE,UAAU,CAAC;IAC1C,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,sBAAsB,CAAC,EAAE,UAAU,CAAC;IACpC,4BAA4B,CAAC,EAAE,UAAU,CAAC;IAC1C,8BAA8B,CAAC,EAAE,UAAU,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IACtF;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IAEhC;;OAEG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;IAC3B,2CAA2C;IAC3C,eAAe,CAAC,EAAE,YAAY,EAAE,CAAC;CAClC,CAAC;AA2BF;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAExC"}
@@ -1,29 +0,0 @@
1
- import { type ColorValue } from 'react-native';
2
- import { ExpoModifier } from '../../types';
3
- export type TextButtonProps = {
4
- /**
5
- * The text content to display in the button.
6
- */
7
- children?: string | string[] | React.JSX.Element;
8
- /**
9
- * The color of the button text.
10
- */
11
- color?: ColorValue;
12
- /**
13
- * Whether the button is disabled.
14
- */
15
- disabled?: boolean;
16
- /**
17
- * Callback that is called when the button is pressed.
18
- */
19
- onPress?: () => void;
20
- /**
21
- * Modifiers for the component.
22
- */
23
- modifiers?: ExpoModifier[];
24
- };
25
- /**
26
- * A text button component that displays a clickable text label.
27
- */
28
- export declare function TextButton(props: TextButtonProps): import("react").JSX.Element;
29
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/TextButton/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAa,MAAM,aAAa,CAAC;AAItD,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IACjD;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;CAC5B,CAAC;AAqBF;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAEhD"}
@@ -1 +0,0 @@
1
- a34da0ffd5b373d346c39f45a5a61ec09f5c1b7b
@@ -1 +0,0 @@
1
- 2b50088dab0279da8a113fe0396237a4525f8a9fb130d4b1cd15b5072f866a53
@@ -1 +0,0 @@
1
- 588744d4be57b3e7ed22bcccd40222dcb365367cd3bb72fd0aeb4c0f1925229f986b58712f477a0eebdeb0e8d887b09e0aab21764dc372a5755e622118d88d7b
@@ -1 +0,0 @@
1
- c2ddc40af222d8ef304b15d13a112399
@@ -1 +0,0 @@
1
- d9837c255bb0284a69d6b234195055a11d9bd98f
@@ -1 +0,0 @@
1
- 9a82f1f77a7ee3f302982361eb41e2bb8b86cbd430061a07cce8c4511b40cbf4
@@ -1 +0,0 @@
1
- 8a56aa5f1a198809e7bd3601605ec9e5ae7414b7834d6d6a44c024991f27de1cd744ed4b575b23b6b537e3e759c39309b220ca9fe57ec76c42b4130326c331fb
@@ -1 +0,0 @@
1
- 30dbf6a3d9ec32bd3d35dcaa054f871c6aef4572
@@ -1 +0,0 @@
1
- 776b37606fc84b29d80f4fad1667670284ba5424ef5463d07ddf9349a91092aa
@@ -1 +0,0 @@
1
- 4ea7791e17643fc75674cebb245364eb7da0375f5f07bcba12d71021fbd53524280e0e41ab6aada44304126083e1ae4bdb554b0b5cbc81f8141e32200f8aea51
@@ -1 +0,0 @@
1
- 98b60e39733fa3716c6c6f1716b17c9e
@@ -1 +0,0 @@
1
- 785a21c06743ebd45e830929302eacfed1a02577
@@ -1 +0,0 @@
1
- eb010d0e31664cc2341979943ef6419479f3fa3a34db9596c4662860ad70ba79
@@ -1 +0,0 @@
1
- af7c2dbb1d6562a281f052003f7040abe11d3675d03857f5c7d3519b28a1a8be54a73ccc7f2fab909b7edbfd864d888936d71a737737fac71ff13783d969229d
@@ -1,57 +0,0 @@
1
- type Variant = 'rounded' | 'twotone' | 'outlined' | 'filled' | 'sharp';
2
-
3
- type Icon =
4
- | 'AccountBox'
5
- | 'AccountCircle'
6
- | 'Add'
7
- | 'AddCircle'
8
- | 'ArrowBack'
9
- | 'ArrowDropDown'
10
- | 'ArrowForward'
11
- | 'Build'
12
- | 'Call'
13
- | 'Check'
14
- | 'CheckCircle'
15
- | 'Clear'
16
- | 'Close'
17
- | 'Contrast'
18
- | 'Create'
19
- | 'DarkMode'
20
- | 'DateRange'
21
- | 'Delete'
22
- | 'Done'
23
- | 'Edit'
24
- | 'Email'
25
- | 'ExitToApp'
26
- | 'Face'
27
- | 'Favorite'
28
- | 'FavoriteBorder'
29
- | 'Home'
30
- | 'Info'
31
- | 'KeyboardArrowDown'
32
- | 'KeyboardArrowLeft'
33
- | 'KeyboardArrowRight'
34
- | 'KeyboardArrowUp'
35
- | 'LightMode'
36
- | 'List'
37
- | 'LocationOn'
38
- | 'Lock'
39
- | 'MailOutline'
40
- | 'Menu'
41
- | 'MoreVert'
42
- | 'Notifications'
43
- | 'Person'
44
- | 'Phone'
45
- | 'Place'
46
- | 'PlayArrow'
47
- | 'Refresh'
48
- | 'Search'
49
- | 'Send'
50
- | 'Settings'
51
- | 'Share'
52
- | 'ShoppingCart'
53
- | 'Star'
54
- | 'ThumbUp'
55
- | 'Warning';
56
-
57
- export type MaterialIcon = `${Variant}.${Icon}`;
@@ -1,21 +0,0 @@
1
- import { ReactElement, ReactNode } from 'react';
2
-
3
- import { ButtonProps } from '../Button';
4
-
5
- /**
6
- * Props of the `Submenu` component.
7
- */
8
- export type SubmenuProps = {
9
- /**
10
- * The button that will be used to expand the submenu. On Android the `text` prop of the `Button` will be used as a section title.
11
- */
12
- button: ReactElement<ButtonProps>;
13
- /**
14
- * Children of the submenu. Only `Button`, `Switch`, `Picker` and `Submenu` elements should be used.
15
- */
16
- children: ReactNode;
17
- };
18
-
19
- export function Submenu(props: SubmenuProps) {
20
- return <></>;
21
- }
@@ -1,149 +0,0 @@
1
- import { requireNativeView } from 'expo';
2
- import { Children, ReactElement, ReactNode, useMemo } from 'react';
3
- import { NativeSyntheticEvent, StyleProp, ViewStyle, type ColorValue } from 'react-native';
4
-
5
- import { SubmenuProps } from './Submenu';
6
- import { MenuElement, transformChildrenToElementArray } from './utils';
7
- import { ModifierConfig } from '../../types';
8
- import { ButtonProps } from '../Button';
9
- import { PickerProps } from '../Picker';
10
- import { SwitchProps } from '../Switch';
11
- import { createViewModifierEventListener } from '../modifiers/utils';
12
-
13
- const MenuNativeView: React.ComponentType<NativeMenuProps> = requireNativeView(
14
- 'ExpoUI',
15
- 'ContextMenuView'
16
- );
17
-
18
- type SubmenuElement =
19
- | ReactElement<ButtonProps>
20
- | ReactElement<SwitchProps>
21
- | ReactElement<PickerProps>
22
- | ReactElement<SubmenuProps>;
23
-
24
- export type ContextMenuContentProps = {
25
- children: SubmenuElement | SubmenuElement[];
26
- };
27
-
28
- /**
29
- * @hidden
30
- */
31
- export type EventHandlers = Record<
32
- string,
33
- Record<string, (event: NativeSyntheticEvent<any>) => void>
34
- >;
35
-
36
- /**
37
- * @hidden
38
- */
39
- export type ContextMenuElementBase = { contextMenuElementID: string };
40
-
41
- /**
42
- * Props of the `ContextMenu` component.
43
- */
44
- export type ContextMenuProps = {
45
- /**
46
- * The contents of the submenu are used as an anchor for the context menu.
47
- * The children will be wrapped in a pressable element, which triggers opening of the context menu.
48
- */
49
- children: ReactNode;
50
-
51
- /**
52
- * The color of the container holding the context menu items.
53
- */
54
- color?: ColorValue;
55
-
56
- /**
57
- * Optional styles to apply to the `ContextMenu`.
58
- */
59
- style?: StyleProp<ViewStyle>;
60
-
61
- /**
62
- * Modifiers for the component.
63
- */
64
- modifiers?: ModifierConfig[];
65
- };
66
-
67
- /**
68
- * @hidden
69
- */
70
- type NativeMenuProps = ContextMenuProps & {
71
- elements: MenuElement[];
72
- onContextMenuButtonPressed: (
73
- event: NativeSyntheticEvent<{ contextMenuElementID: string }>
74
- ) => void;
75
- onContextMenuSwitchValueChanged: (
76
- event: NativeSyntheticEvent<{
77
- contextMenuElementID: string;
78
- value: boolean;
79
- }>
80
- ) => void;
81
- onContextMenuPickerOptionSelected: (
82
- event: NativeSyntheticEvent<{
83
- index: number;
84
- label: string;
85
- contextMenuElementID: string;
86
- }>
87
- ) => void;
88
- };
89
-
90
- export function Items(props: ContextMenuContentProps) {
91
- return <></>;
92
- }
93
- Items.tag = 'Items';
94
-
95
- export function Trigger(props: { children: React.ReactNode }) {
96
- return <></>;
97
- }
98
- Trigger.tag = 'Trigger';
99
-
100
- export function Preview(props: { children: React.ReactNode }) {
101
- return <></>;
102
- }
103
-
104
- function ContextMenu(props: ContextMenuProps) {
105
- const { modifiers, ...restProps } = props;
106
- const eventHandlersMap: EventHandlers = {};
107
- const initialChildren = Children.map(
108
- props.children as any,
109
- (c: { type: { tag: string }; props: { children: React.ReactNode } }) =>
110
- c.type.tag === Items.tag ? c.props.children : null
111
- );
112
- const processedElements = useMemo(
113
- () => transformChildrenToElementArray(initialChildren, eventHandlersMap),
114
- [initialChildren]
115
- );
116
-
117
- const activationElement = Children.map(
118
- props.children as any,
119
- (c: { type: { tag: string }; props: { children: React.ReactNode } }) =>
120
- c.type.tag === Trigger.tag ? c.props.children : null
121
- );
122
-
123
- const createEventHandler =
124
- (handlerType: string) => (e: NativeSyntheticEvent<{ contextMenuElementID: string }>) => {
125
- const handler = eventHandlersMap[e.nativeEvent.contextMenuElementID]?.[handlerType];
126
- handler?.(e);
127
- };
128
-
129
- return (
130
- <MenuNativeView
131
- style={props.style}
132
- elements={processedElements}
133
- onContextMenuButtonPressed={createEventHandler('onPress')}
134
- onContextMenuSwitchValueChanged={createEventHandler('onValueChange')}
135
- onContextMenuPickerOptionSelected={createEventHandler('onOptionSelected')}
136
- modifiers={modifiers}
137
- {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
138
- {...restProps}>
139
- {activationElement}
140
- </MenuNativeView>
141
- );
142
- }
143
-
144
- ContextMenu.Trigger = Trigger;
145
- ContextMenu.Preview = Preview;
146
- ContextMenu.Items = Items;
147
-
148
- export { ContextMenu };
149
- export { Submenu } from './Submenu';
@@ -1,144 +0,0 @@
1
- import { Children, isValidElement, ReactElement, ReactNode } from 'react';
2
- import { NativeSyntheticEvent } from 'react-native';
3
-
4
- import { Submenu, SubmenuProps } from './Submenu';
5
- import { ContextMenuElementBase, EventHandlers } from './index';
6
- import { Button, ButtonProps, NativeButtonProps, transformButtonProps } from '../Button';
7
- import { Picker, PickerProps } from '../Picker';
8
- import { Switch, SwitchProps } from '../Switch';
9
-
10
- // We use this slightly odd typing for the elements to make unpacking the elements easier on the native side
11
- type ButtonMenuElement = {
12
- button: NativeButtonProps;
13
- } & ContextMenuElementBase;
14
-
15
- type SwitchMenuElement = {
16
- switch: SwitchProps;
17
- } & ContextMenuElementBase;
18
-
19
- type PickerMenuElement = {
20
- picker: PickerProps;
21
- } & ContextMenuElementBase;
22
-
23
- type SubmenuElement = {
24
- submenu: {
25
- elements: MenuElement[];
26
- button: NativeButtonProps;
27
- };
28
- } & ContextMenuElementBase;
29
-
30
- export type MenuElement =
31
- | ButtonMenuElement
32
- | SwitchMenuElement
33
- | PickerMenuElement
34
- | SubmenuElement;
35
-
36
- // Maps the react children to NativeMenuElement[] which is used to render out the native menu
37
- // TODO: Ideally we want to pass the children directly to the native side without having to do this
38
- export function transformChildrenToElementArray(
39
- children: ReactNode,
40
- eventHandlersMap: EventHandlers
41
- ): MenuElement[] {
42
- return Children.toArray(children)
43
- .map((child) => processChildElement(child, eventHandlersMap))
44
- .filter((el): el is MenuElement => el !== null);
45
- }
46
-
47
- function processChildElement(
48
- child: ReactNode,
49
- eventHandlersMap: EventHandlers
50
- ): MenuElement | null {
51
- if (!isValidElement(child)) return null;
52
-
53
- const uuid = expo.uuidv4();
54
-
55
- if (child.type === Button) {
56
- // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps
57
- return createButtonElement(uuid, child.props, eventHandlersMap);
58
- }
59
-
60
- if (child.type === Switch) {
61
- // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps
62
- return createSwitchElement(uuid, child.props, eventHandlersMap);
63
- }
64
-
65
- if (child.type === Picker) {
66
- // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps
67
- return createPickerElement(uuid, child.props, eventHandlersMap);
68
- }
69
-
70
- if (isSubmenuComponent(child)) {
71
- // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps
72
- return createSubmenuElement(uuid, child.props, eventHandlersMap);
73
- }
74
-
75
- console.warn('Unsupported child type in Menu: ', child.type);
76
- return null;
77
- }
78
-
79
- function createButtonElement(
80
- uuid: string,
81
- props: ButtonProps,
82
- handlers: EventHandlers
83
- ): MenuElement {
84
- if (props.onPress) {
85
- handlers[uuid] = { onPress: props.onPress };
86
- }
87
-
88
- return {
89
- contextMenuElementID: uuid,
90
- button: transformButtonProps(props),
91
- };
92
- }
93
-
94
- function createSwitchElement(
95
- uuid: string,
96
- props: SwitchProps,
97
- handlers: EventHandlers
98
- ): MenuElement {
99
- if (props.onValueChange) {
100
- handlers[uuid] = {
101
- onValueChange: ({ nativeEvent: { value } }: NativeSyntheticEvent<{ value: boolean }>) => {
102
- props.onValueChange?.(value);
103
- },
104
- };
105
- }
106
-
107
- return {
108
- contextMenuElementID: uuid,
109
- switch: props,
110
- };
111
- }
112
-
113
- function createPickerElement(
114
- uuid: string,
115
- props: PickerProps,
116
- handlers: EventHandlers
117
- ): MenuElement {
118
- if (props.onOptionSelected) {
119
- handlers[uuid] = { onOptionSelected: props.onOptionSelected };
120
- }
121
-
122
- return {
123
- contextMenuElementID: uuid,
124
- picker: props,
125
- };
126
- }
127
-
128
- function createSubmenuElement(
129
- uuid: string,
130
- props: SubmenuProps,
131
- handlers: EventHandlers
132
- ): MenuElement {
133
- return {
134
- contextMenuElementID: uuid,
135
- submenu: {
136
- button: transformButtonProps(props.button.props),
137
- elements: transformChildrenToElementArray(props.children, handlers),
138
- },
139
- };
140
- }
141
-
142
- function isSubmenuComponent(child: ReactElement): boolean {
143
- return child.type === Submenu;
144
- }
@@ -1,89 +0,0 @@
1
- import { requireNativeView } from 'expo';
2
-
3
- import { ExpoModifier } from '../../types';
4
- import { createViewModifierEventListener } from '../modifiers/utils';
5
-
6
- export type FilterChipProps = {
7
- /**
8
- * Whether the chip is currently selected.
9
- */
10
- selected: boolean;
11
- /**
12
- * The text label to display on the chip.
13
- */
14
- label: string;
15
- /**
16
- * Whether the chip is enabled and can be interacted with.
17
- */
18
- enabled?: boolean;
19
- /**
20
- * Callback fired when the chip is clicked.
21
- */
22
- onPress?: () => void;
23
- /**
24
- * Modifiers for the component.
25
- */
26
- modifiers?: ExpoModifier[];
27
- /**
28
- * Children containing LeadingIcon and TrailingIcon slots.
29
- */
30
- children?: React.ReactNode;
31
- };
32
-
33
- type SlotChildProps = {
34
- children: React.ReactNode;
35
- };
36
-
37
- type NativeFilterChipProps = FilterChipProps;
38
-
39
- type NativeSlotViewProps = {
40
- slotName: string;
41
- children: React.ReactNode;
42
- };
43
-
44
- const FilterChipNativeView: React.ComponentType<NativeFilterChipProps> = requireNativeView(
45
- 'ExpoUI',
46
- 'FilterChipView'
47
- );
48
-
49
- const SlotNativeView: React.ComponentType<NativeSlotViewProps> = requireNativeView(
50
- 'ExpoUI',
51
- 'SlotView'
52
- );
53
-
54
- /**
55
- * Leading icon slot for FilterChip.
56
- */
57
- function FilterChipLeadingIcon(props: SlotChildProps) {
58
- return <SlotNativeView slotName="leadingIcon">{props.children}</SlotNativeView>;
59
- }
60
-
61
- /**
62
- * Trailing icon slot for FilterChip.
63
- */
64
- function FilterChipTrailingIcon(props: SlotChildProps) {
65
- return <SlotNativeView slotName="trailingIcon">{props.children}</SlotNativeView>;
66
- }
67
-
68
- /**
69
- * A filter chip component following Material 3 design guidelines.
70
- * Supports slot-based `LeadingIcon` and `TrailingIcon` children.
71
- */
72
- function FilterChipComponent(props: FilterChipProps) {
73
- const { children, modifiers, onPress, ...restProps } = props;
74
-
75
- return (
76
- <FilterChipNativeView
77
- modifiers={modifiers}
78
- {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
79
- {...restProps}
80
- onPress={onPress}>
81
- {children}
82
- </FilterChipNativeView>
83
- );
84
- }
85
-
86
- FilterChipComponent.LeadingIcon = FilterChipLeadingIcon;
87
- FilterChipComponent.TrailingIcon = FilterChipTrailingIcon;
88
-
89
- export { FilterChipComponent as FilterChip };