react-native-platform-components 1.2.0 → 1.4.0

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 (242) hide show
  1. package/README.md +33 -31
  2. package/android/src/main/java/com/platformcomponents/PCButtonGroupView.kt +498 -0
  3. package/android/src/main/java/com/platformcomponents/PCButtonGroupViewManager.kt +191 -0
  4. package/android/src/main/java/com/platformcomponents/PCButtonSupport.kt +127 -0
  5. package/android/src/main/java/com/platformcomponents/PCButtonView.kt +345 -0
  6. package/android/src/main/java/com/platformcomponents/PCButtonViewManager.kt +126 -0
  7. package/android/src/main/java/com/platformcomponents/PCExpressive.kt +107 -0
  8. package/android/src/main/java/com/platformcomponents/PCFloatingToolbarView.kt +115 -0
  9. package/android/src/main/java/com/platformcomponents/PCFloatingToolbarViewManager.kt +65 -0
  10. package/android/src/main/java/com/platformcomponents/PCNativeThemeModule.kt +3 -0
  11. package/android/src/main/java/com/platformcomponents/PCSegmentedControlView.kt +13 -5
  12. package/android/src/main/java/com/platformcomponents/PCSegmentedControlViewManager.kt +6 -1
  13. package/android/src/main/java/com/platformcomponents/PCTextFieldView.kt +1018 -0
  14. package/android/src/main/java/com/platformcomponents/PCTextFieldViewManager.kt +248 -0
  15. package/android/src/main/java/com/platformcomponents/PlatformComponentsPackage.kt +13 -6
  16. package/android/src/main/jni/CMakeLists.txt +13 -1
  17. package/android/src/main/res/values/attrs.xml +13 -0
  18. package/android/src/main/res/values/styles.xml +183 -0
  19. package/ios/PCButton.h +10 -0
  20. package/ios/PCButton.mm +196 -0
  21. package/ios/PCButtonGroup.h +10 -0
  22. package/ios/PCButtonGroup.mm +256 -0
  23. package/ios/PCButtonGroupView.swift +254 -0
  24. package/ios/PCButtonSupport.swift +141 -0
  25. package/ios/PCButtonView.swift +155 -0
  26. package/ios/PCFloatingToolbar.h +10 -0
  27. package/ios/PCFloatingToolbar.mm +76 -0
  28. package/ios/PCFloatingToolbarView.swift +95 -0
  29. package/ios/PCNativeThemeModule.mm +13 -0
  30. package/ios/PCSelectionMenu.swift +9 -1
  31. package/ios/PCTextField.h +10 -0
  32. package/ios/PCTextField.mm +391 -0
  33. package/ios/PCTextFieldView.swift +1012 -0
  34. package/lib/commonjs/Button.js +77 -0
  35. package/lib/commonjs/Button.js.map +1 -0
  36. package/lib/commonjs/ButtonGroup.js +99 -0
  37. package/lib/commonjs/ButtonGroup.js.map +1 -0
  38. package/lib/commonjs/ButtonGroupNativeComponent.ts +121 -0
  39. package/lib/commonjs/ButtonNativeComponent.ts +76 -0
  40. package/lib/commonjs/ContextMenuNativeComponent.ts +5 -4
  41. package/lib/commonjs/DatePickerNativeComponent.ts +17 -11
  42. package/lib/commonjs/FloatingToolbar.js +69 -0
  43. package/lib/commonjs/FloatingToolbar.js.map +1 -0
  44. package/lib/commonjs/FloatingToolbarNativeComponent.ts +31 -0
  45. package/lib/commonjs/LiquidGlass.js +24 -4
  46. package/lib/commonjs/LiquidGlass.js.map +1 -1
  47. package/lib/commonjs/LiquidGlassNativeComponent.ts +6 -5
  48. package/lib/commonjs/NativePlatformComponentsTheme.js.map +1 -1
  49. package/lib/commonjs/SegmentedControl.js +11 -85
  50. package/lib/commonjs/SegmentedControl.js.map +1 -1
  51. package/lib/commonjs/SegmentedControlNativeComponent.ts +15 -11
  52. package/lib/commonjs/SelectionMenuNativeComponent.ts +6 -5
  53. package/lib/commonjs/TextField.js +195 -0
  54. package/lib/commonjs/TextField.js.map +1 -0
  55. package/lib/commonjs/TextFieldNativeComponent.ts +218 -0
  56. package/lib/commonjs/codegenTypes.js +6 -0
  57. package/lib/commonjs/codegenTypes.js.map +1 -0
  58. package/lib/commonjs/focusRegistry.js +78 -0
  59. package/lib/commonjs/focusRegistry.js.map +1 -0
  60. package/lib/commonjs/icons.js +92 -0
  61. package/lib/commonjs/icons.js.map +1 -0
  62. package/lib/commonjs/index.js +66 -0
  63. package/lib/commonjs/index.js.map +1 -1
  64. package/lib/commonjs/index.web.js +32 -2
  65. package/lib/commonjs/index.web.js.map +1 -1
  66. package/lib/commonjs/labelStyle.js +27 -0
  67. package/lib/commonjs/labelStyle.js.map +1 -0
  68. package/lib/commonjs/reactNativeInternals.d.js +2 -0
  69. package/lib/commonjs/reactNativeInternals.d.js.map +1 -0
  70. package/lib/module/Button.js +70 -0
  71. package/lib/module/Button.js.map +1 -0
  72. package/lib/module/ButtonGroup.js +92 -0
  73. package/lib/module/ButtonGroup.js.map +1 -0
  74. package/lib/module/ButtonGroupNativeComponent.ts +121 -0
  75. package/lib/module/ButtonNativeComponent.ts +76 -0
  76. package/lib/module/ContextMenuNativeComponent.ts +5 -4
  77. package/lib/module/DatePickerNativeComponent.ts +17 -11
  78. package/lib/module/FloatingToolbar.js +62 -0
  79. package/lib/module/FloatingToolbar.js.map +1 -0
  80. package/lib/module/FloatingToolbarNativeComponent.ts +31 -0
  81. package/lib/module/LiquidGlass.js +24 -4
  82. package/lib/module/LiquidGlass.js.map +1 -1
  83. package/lib/module/LiquidGlassNativeComponent.ts +6 -5
  84. package/lib/module/NativePlatformComponentsTheme.js.map +1 -1
  85. package/lib/module/SegmentedControl.js +12 -87
  86. package/lib/module/SegmentedControl.js.map +1 -1
  87. package/lib/module/SegmentedControlNativeComponent.ts +15 -11
  88. package/lib/module/SelectionMenuNativeComponent.ts +6 -5
  89. package/lib/module/TextField.js +189 -0
  90. package/lib/module/TextField.js.map +1 -0
  91. package/lib/module/TextFieldNativeComponent.ts +218 -0
  92. package/lib/module/codegenTypes.js +4 -0
  93. package/lib/module/codegenTypes.js.map +1 -0
  94. package/lib/module/focusRegistry.js +74 -0
  95. package/lib/module/focusRegistry.js.map +1 -0
  96. package/lib/module/icons.js +87 -0
  97. package/lib/module/icons.js.map +1 -0
  98. package/lib/module/index.js +6 -0
  99. package/lib/module/index.js.map +1 -1
  100. package/lib/module/index.web.js +28 -0
  101. package/lib/module/index.web.js.map +1 -1
  102. package/lib/module/labelStyle.js +23 -0
  103. package/lib/module/labelStyle.js.map +1 -0
  104. package/lib/module/reactNativeInternals.d.js +2 -0
  105. package/lib/module/reactNativeInternals.d.js.map +1 -0
  106. package/lib/typescript/commonjs/docs/sidebars.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/src/Button.d.ts +76 -0
  108. package/lib/typescript/commonjs/src/Button.d.ts.map +1 -0
  109. package/lib/typescript/commonjs/src/ButtonGroup.d.ts +102 -0
  110. package/lib/typescript/commonjs/src/ButtonGroup.d.ts.map +1 -0
  111. package/lib/typescript/commonjs/src/ButtonGroupNativeComponent.d.ts +93 -0
  112. package/lib/typescript/commonjs/src/ButtonGroupNativeComponent.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/src/ButtonNativeComponent.d.ts +57 -0
  114. package/lib/typescript/commonjs/src/ButtonNativeComponent.d.ts.map +1 -0
  115. package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts +5 -4
  116. package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts +12 -11
  118. package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/src/FloatingToolbar.d.ts +45 -0
  120. package/lib/typescript/commonjs/src/FloatingToolbar.d.ts.map +1 -0
  121. package/lib/typescript/commonjs/src/FloatingToolbarNativeComponent.d.ts +24 -0
  122. package/lib/typescript/commonjs/src/FloatingToolbarNativeComponent.d.ts.map +1 -0
  123. package/lib/typescript/commonjs/src/LiquidGlass.d.ts +4 -3
  124. package/lib/typescript/commonjs/src/LiquidGlass.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts +6 -5
  126. package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/src/NativePlatformComponentsTheme.d.ts +10 -2
  128. package/lib/typescript/commonjs/src/NativePlatformComponentsTheme.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/src/SegmentedControl.d.ts +17 -46
  130. package/lib/typescript/commonjs/src/SegmentedControl.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts +9 -6
  132. package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts +6 -5
  134. package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/src/TextField.d.ts +174 -0
  136. package/lib/typescript/commonjs/src/TextField.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/src/TextFieldNativeComponent.d.ts +162 -0
  138. package/lib/typescript/commonjs/src/TextFieldNativeComponent.d.ts.map +1 -0
  139. package/lib/typescript/commonjs/src/codegenTypes.d.ts +12 -0
  140. package/lib/typescript/commonjs/src/codegenTypes.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/src/focusRegistry.d.ts +13 -0
  142. package/lib/typescript/commonjs/src/focusRegistry.d.ts.map +1 -0
  143. package/lib/typescript/commonjs/src/icons.d.ts +52 -0
  144. package/lib/typescript/commonjs/src/icons.d.ts.map +1 -0
  145. package/lib/typescript/commonjs/src/index.d.ts +6 -0
  146. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  147. package/lib/typescript/commonjs/src/index.web.d.ts +121 -0
  148. package/lib/typescript/commonjs/src/index.web.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/src/labelStyle.d.ts +20 -0
  150. package/lib/typescript/commonjs/src/labelStyle.d.ts.map +1 -0
  151. package/lib/typescript/commonjs/src/sharedTypes.d.ts +8 -3
  152. package/lib/typescript/commonjs/src/sharedTypes.d.ts.map +1 -1
  153. package/lib/typescript/module/docs/sidebars.d.ts.map +1 -1
  154. package/lib/typescript/module/src/Button.d.ts +76 -0
  155. package/lib/typescript/module/src/Button.d.ts.map +1 -0
  156. package/lib/typescript/module/src/ButtonGroup.d.ts +102 -0
  157. package/lib/typescript/module/src/ButtonGroup.d.ts.map +1 -0
  158. package/lib/typescript/module/src/ButtonGroupNativeComponent.d.ts +93 -0
  159. package/lib/typescript/module/src/ButtonGroupNativeComponent.d.ts.map +1 -0
  160. package/lib/typescript/module/src/ButtonNativeComponent.d.ts +57 -0
  161. package/lib/typescript/module/src/ButtonNativeComponent.d.ts.map +1 -0
  162. package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts +5 -4
  163. package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts.map +1 -1
  164. package/lib/typescript/module/src/DatePickerNativeComponent.d.ts +12 -11
  165. package/lib/typescript/module/src/DatePickerNativeComponent.d.ts.map +1 -1
  166. package/lib/typescript/module/src/FloatingToolbar.d.ts +45 -0
  167. package/lib/typescript/module/src/FloatingToolbar.d.ts.map +1 -0
  168. package/lib/typescript/module/src/FloatingToolbarNativeComponent.d.ts +24 -0
  169. package/lib/typescript/module/src/FloatingToolbarNativeComponent.d.ts.map +1 -0
  170. package/lib/typescript/module/src/LiquidGlass.d.ts +4 -3
  171. package/lib/typescript/module/src/LiquidGlass.d.ts.map +1 -1
  172. package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts +6 -5
  173. package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts.map +1 -1
  174. package/lib/typescript/module/src/NativePlatformComponentsTheme.d.ts +10 -2
  175. package/lib/typescript/module/src/NativePlatformComponentsTheme.d.ts.map +1 -1
  176. package/lib/typescript/module/src/SegmentedControl.d.ts +17 -46
  177. package/lib/typescript/module/src/SegmentedControl.d.ts.map +1 -1
  178. package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts +9 -6
  179. package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts.map +1 -1
  180. package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts +6 -5
  181. package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts.map +1 -1
  182. package/lib/typescript/module/src/TextField.d.ts +174 -0
  183. package/lib/typescript/module/src/TextField.d.ts.map +1 -0
  184. package/lib/typescript/module/src/TextFieldNativeComponent.d.ts +162 -0
  185. package/lib/typescript/module/src/TextFieldNativeComponent.d.ts.map +1 -0
  186. package/lib/typescript/module/src/codegenTypes.d.ts +12 -0
  187. package/lib/typescript/module/src/codegenTypes.d.ts.map +1 -0
  188. package/lib/typescript/module/src/focusRegistry.d.ts +13 -0
  189. package/lib/typescript/module/src/focusRegistry.d.ts.map +1 -0
  190. package/lib/typescript/module/src/icons.d.ts +52 -0
  191. package/lib/typescript/module/src/icons.d.ts.map +1 -0
  192. package/lib/typescript/module/src/index.d.ts +6 -0
  193. package/lib/typescript/module/src/index.d.ts.map +1 -1
  194. package/lib/typescript/module/src/index.web.d.ts +121 -0
  195. package/lib/typescript/module/src/index.web.d.ts.map +1 -1
  196. package/lib/typescript/module/src/labelStyle.d.ts +20 -0
  197. package/lib/typescript/module/src/labelStyle.d.ts.map +1 -0
  198. package/lib/typescript/module/src/sharedTypes.d.ts +8 -3
  199. package/lib/typescript/module/src/sharedTypes.d.ts.map +1 -1
  200. package/package.json +28 -6
  201. package/react-native.config.js +3 -0
  202. package/shared/PCButtonComponentDescriptors-custom.h +22 -0
  203. package/shared/PCButtonGroupComponentDescriptors-custom.h +22 -0
  204. package/shared/PCButtonGroupShadowNode-custom.cpp +48 -0
  205. package/shared/PCButtonGroupShadowNode-custom.h +55 -0
  206. package/shared/PCButtonGroupState-custom.h +61 -0
  207. package/shared/PCButtonShadowNode-custom.cpp +48 -0
  208. package/shared/PCButtonShadowNode-custom.h +55 -0
  209. package/shared/PCButtonState-custom.h +61 -0
  210. package/shared/PCDatePickerState-custom.h +2 -2
  211. package/shared/PCSegmentedControlState-custom.h +2 -2
  212. package/shared/PCSelectionMenuState-custom.h +2 -2
  213. package/shared/PCTextFieldComponentDescriptors-custom.h +22 -0
  214. package/shared/PCTextFieldShadowNode-custom.cpp +47 -0
  215. package/shared/PCTextFieldShadowNode-custom.h +55 -0
  216. package/shared/PCTextFieldState-custom.h +61 -0
  217. package/shared/react/renderer/components/PlatformComponentsViewSpec/ComponentDescriptors.h +3 -0
  218. package/src/Button.tsx +144 -0
  219. package/src/ButtonGroup.tsx +233 -0
  220. package/src/ButtonGroupNativeComponent.ts +121 -0
  221. package/src/ButtonNativeComponent.ts +76 -0
  222. package/src/ContextMenuNativeComponent.ts +5 -4
  223. package/src/DatePickerNativeComponent.ts +17 -11
  224. package/src/FloatingToolbar.tsx +113 -0
  225. package/src/FloatingToolbarNativeComponent.ts +31 -0
  226. package/src/LiquidGlass.tsx +24 -5
  227. package/src/LiquidGlassNativeComponent.ts +6 -5
  228. package/src/NativePlatformComponentsTheme.ts +11 -2
  229. package/src/SegmentedControl.tsx +26 -118
  230. package/src/SegmentedControlNativeComponent.ts +15 -11
  231. package/src/SelectionMenuNativeComponent.ts +6 -5
  232. package/src/TextField.tsx +494 -0
  233. package/src/TextFieldNativeComponent.ts +218 -0
  234. package/src/codegenTypes.ts +40 -0
  235. package/src/focusRegistry.ts +89 -0
  236. package/src/icons.ts +116 -0
  237. package/src/index.tsx +6 -0
  238. package/src/index.web.tsx +194 -0
  239. package/src/labelStyle.ts +36 -0
  240. package/src/reactNativeInternals.d.ts +22 -0
  241. package/src/sharedTypes.ts +9 -3
  242. /package/{app.plugin.cjs → app.plugin.js} +0 -0
@@ -0,0 +1,20 @@
1
+ import type { TextStyle } from 'react-native';
2
+ /**
3
+ * Font for a control's labels. Each field falls back to the platform default.
4
+ */
5
+ export interface LabelStyle {
6
+ fontFamily?: string;
7
+ fontSize?: number;
8
+ fontWeight?: TextStyle['fontWeight'];
9
+ fontStyle?: 'normal' | 'italic';
10
+ }
11
+ /** The flat font fields the native specs expect; empty / 0 = default. */
12
+ export type NativeLabelStyle = {
13
+ fontFamily: string;
14
+ fontSize: number;
15
+ fontWeight: string;
16
+ fontStyle: string;
17
+ };
18
+ /** Normalizes a label font for native; `undefined` keeps the platform font. */
19
+ export declare function normalizeLabelStyle(labelStyle: LabelStyle | undefined): NativeLabelStyle | undefined;
20
+ //# sourceMappingURL=labelStyle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labelStyle.d.ts","sourceRoot":"","sources":["../../../../src/labelStyle.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACjC;AAED,yEAAyE;AACzE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,+EAA+E;AAC/E,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,GAAG,SAAS,GACjC,gBAAgB,GAAG,SAAS,CAS9B"}
@@ -1,12 +1,17 @@
1
- import type { CodegenTypes } from 'react-native';
1
+ import type { BubblingEventHandler } from './codegenTypes.js';
2
2
  /** Shared "open/closed" control state. */
3
3
  export type Visible = 'open' | 'closed';
4
4
  /** Shared presentation mode for pickers/menus. */
5
5
  export type Presentation = 'modal' | 'embedded';
6
- /** Shared Material preference (Android). */
6
+ /** Shared Material preference (Android): the platform widget or the Material one. */
7
7
  export type AndroidMaterialMode = 'system' | 'm3';
8
+ /**
9
+ * Shared Material style for the Material-only components (Android):
10
+ * Material 3, or Material 3 Expressive (the default).
11
+ */
12
+ export type AndroidMaterialStyle = 'm3' | 'expressive';
8
13
  /** Common event empty payload type. */
9
14
  export type EmptyEvent = Readonly<{}>;
10
15
  /** Convenience alias (optional). */
11
- export type Bubbling<T> = CodegenTypes.BubblingEventHandler<T>;
16
+ export type Bubbling<T> = BubblingEventHandler<T>;
12
17
  //# sourceMappingURL=sharedTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTypes.d.ts","sourceRoot":"","sources":["../../../../src/sharedTypes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,0CAA0C;AAC1C,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAExC,kDAAkD;AAClD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AAEhD,4CAA4C;AAC5C,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,IAAI,CAAC;AAElD,uCAAuC;AACvC,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;AAEtC,oCAAoC;AACpC,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,YAAY,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"sharedTypes.d.ts","sourceRoot":"","sources":["../../../../src/sharedTypes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAgB,CAAC;AAE3D,0CAA0C;AAC1C,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAExC,kDAAkD;AAClD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AAEhD,qFAAqF;AACrF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,IAAI,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,YAAY,CAAC;AAEvD,uCAAuC;AACvC,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;AAEtC,oCAAoC;AACpC,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-platform-components",
3
- "version": "1.2.0",
4
- "description": "Native UI components for React Native that are native on Android too: DatePicker, ContextMenu, SelectionMenu, SegmentedControl (Material 3) and LiquidGlass (iOS 26). Fabric, typed, Expo config plugin.",
3
+ "version": "1.4.0",
4
+ "description": "Native UI components for React Native, the real platform widgets on both iOS and Android: TextField, DatePicker, ContextMenu, SelectionMenu, SegmentedControl, Button, ButtonGroup, FloatingToolbar and LiquidGlass. UIKit and SwiftUI on iOS, Material 3 Expressive on Android. Fabric, TypeScript, Expo config plugin.",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/module/index.js",
7
7
  "browser": "./lib/module/index.web.js",
@@ -28,7 +28,8 @@
28
28
  }
29
29
  },
30
30
  "./package.json": "./package.json",
31
- "./app.plugin": "./app.plugin.cjs"
31
+ "./app.plugin": "./app.plugin.js",
32
+ "./app.plugin.js": "./app.plugin.js"
32
33
  },
33
34
  "files": [
34
35
  "src",
@@ -40,7 +41,7 @@
40
41
  "plugin",
41
42
  "*.podspec",
42
43
  "react-native.config.js",
43
- "app.plugin.cjs",
44
+ "app.plugin.js",
44
45
  "expo-module.config.json",
45
46
  "!ios/build",
46
47
  "!android/build",
@@ -68,7 +69,8 @@
68
69
  "test": "jest",
69
70
  "upgrade:check": "yarn dlx npm-check-updates",
70
71
  "upgrade:apply": "yarn dlx npm-check-updates -u && rm -rf node_modules && rm -rf package-lock.json && yarn install",
71
- "generate:gifs": "./scripts/generate-readme-gifs.sh"
72
+ "generate:gifs": "./scripts/generate-readme-gifs.sh",
73
+ "generate:visuals": "node scripts/visuals/stills.mjs && node scripts/visuals/showreel.mjs"
72
74
  },
73
75
  "keywords": [
74
76
  "react-native",
@@ -80,6 +82,12 @@
80
82
  "new-architecture",
81
83
  "native-ui",
82
84
  "ui-components",
85
+ "textfield",
86
+ "text-field",
87
+ "textinput",
88
+ "text-input",
89
+ "textinputlayout",
90
+ "uitextfield",
83
91
  "datepicker",
84
92
  "date-picker",
85
93
  "time-picker",
@@ -100,6 +108,16 @@
100
108
  "segmentedbuttons",
101
109
  "uisegmentedcontrol",
102
110
  "tabs",
111
+ "button",
112
+ "buttons",
113
+ "button-group",
114
+ "toggle-buttons",
115
+ "floating-toolbar",
116
+ "toolbar",
117
+ "uibutton",
118
+ "material3-expressive",
119
+ "material-3-expressive",
120
+ "expressive",
103
121
  "liquid-glass",
104
122
  "liquidglass",
105
123
  "glass-effect",
@@ -202,7 +220,11 @@
202
220
  "PCDatePicker": "PCDatePicker",
203
221
  "PCContextMenu": "PCContextMenu",
204
222
  "PCSegmentedControl": "PCSegmentedControl",
205
- "PCLiquidGlass": "PCLiquidGlass"
223
+ "PCButton": "PCButton",
224
+ "PCButtonGroup": "PCButtonGroup",
225
+ "PCFloatingToolbar": "PCFloatingToolbar",
226
+ "PCLiquidGlass": "PCLiquidGlass",
227
+ "PCTextField": "PCTextField"
206
228
  }
207
229
  }
208
230
  },
@@ -6,6 +6,9 @@ module.exports = {
6
6
  'MeasuringPCSelectionMenuComponentDescriptor',
7
7
  'MeasuringPCDatePickerComponentDescriptor',
8
8
  'MeasuringPCSegmentedControlComponentDescriptor',
9
+ 'MeasuringPCButtonComponentDescriptor',
10
+ 'MeasuringPCButtonGroupComponentDescriptor',
11
+ 'MeasuringPCTextFieldComponentDescriptor',
9
12
  ],
10
13
  cmakeListsPath: 'src/main/jni/CMakeLists.txt',
11
14
  },
@@ -0,0 +1,22 @@
1
+ #pragma once
2
+
3
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
4
+
5
+ // Forward declaration to avoid circular includes
6
+ namespace facebook::react {
7
+ class MeasuringPCButtonShadowNode;
8
+ }
9
+
10
+ // Include the actual shadow node definition
11
+ #include "PCButtonShadowNode-custom.h"
12
+
13
+ namespace facebook::react {
14
+
15
+ /**
16
+ * Custom component descriptor that uses our measuring shadow node
17
+ * instead of the generated one.
18
+ */
19
+ using MeasuringPCButtonComponentDescriptor =
20
+ ConcreteComponentDescriptor<MeasuringPCButtonShadowNode>;
21
+
22
+ } // namespace facebook::react
@@ -0,0 +1,22 @@
1
+ #pragma once
2
+
3
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
4
+
5
+ // Forward declaration to avoid circular includes
6
+ namespace facebook::react {
7
+ class MeasuringPCButtonGroupShadowNode;
8
+ }
9
+
10
+ // Include the actual shadow node definition
11
+ #include "PCButtonGroupShadowNode-custom.h"
12
+
13
+ namespace facebook::react {
14
+
15
+ /**
16
+ * Custom component descriptor that uses our measuring shadow node
17
+ * instead of the generated one.
18
+ */
19
+ using MeasuringPCButtonGroupComponentDescriptor =
20
+ ConcreteComponentDescriptor<MeasuringPCButtonGroupShadowNode>;
21
+
22
+ } // namespace facebook::react
@@ -0,0 +1,48 @@
1
+ #include "PCButtonGroupShadowNode-custom.h"
2
+
3
+ #include <react/renderer/core/LayoutConstraints.h>
4
+ #include <algorithm>
5
+
6
+ namespace facebook::react {
7
+
8
+ Size MeasuringPCButtonGroupShadowNode::measureContent(
9
+ const LayoutContext& /*layoutContext*/,
10
+ const LayoutConstraints& layoutConstraints) const {
11
+
12
+ // Native measures the actual group and reports its intrinsic size
13
+ const auto& stateData = this->getStateData();
14
+ Float measuredW = stateData.frameSize.width;
15
+ Float measuredH = stateData.frameSize.height;
16
+
17
+ const Float fallbackHeight =
18
+ #ifdef __ANDROID__
19
+ static_cast<Float>(kFallbackHeightAndroid);
20
+ #else
21
+ static_cast<Float>(kFallbackHeightIOS);
22
+ #endif
23
+
24
+ const bool usingFallback = (measuredH <= 0);
25
+ if (usingFallback) {
26
+ measuredH = fallbackHeight;
27
+ }
28
+ if (measuredW <= 0) {
29
+ measuredW = static_cast<Float>(kFallbackWidth);
30
+ }
31
+
32
+ const Float kHuge = static_cast<Float>(1.0e9);
33
+
34
+ measuredW = std::max<Float>(measuredW, layoutConstraints.minimumSize.width);
35
+ if (layoutConstraints.maximumSize.width > 0 && layoutConstraints.maximumSize.width < kHuge) {
36
+ measuredW = std::min<Float>(measuredW, layoutConstraints.maximumSize.width);
37
+ }
38
+
39
+ measuredH = std::max<Float>(measuredH, layoutConstraints.minimumSize.height);
40
+ // Only clamp to max height if we have real measured data (not fallback)
41
+ if (!usingFallback && layoutConstraints.maximumSize.height > 0 && layoutConstraints.maximumSize.height < kHuge) {
42
+ measuredH = std::min<Float>(measuredH, layoutConstraints.maximumSize.height);
43
+ }
44
+
45
+ return Size{measuredW, measuredH};
46
+ }
47
+
48
+ } // namespace facebook::react
@@ -0,0 +1,55 @@
1
+ #pragma once
2
+
3
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
4
+
5
+ // Only include what we need for the shadow node definition
6
+ // Do NOT include ComponentDescriptors.h here to avoid circular dependency
7
+ #include <react/renderer/components/PlatformComponentsViewSpec/EventEmitters.h>
8
+ #include <react/renderer/components/PlatformComponentsViewSpec/Props.h>
9
+
10
+ #include "PCButtonGroupState-custom.h"
11
+
12
+ namespace facebook::react {
13
+
14
+ extern const char PCButtonGroupComponentName[];
15
+
16
+ /**
17
+ * Custom ShadowNode for ButtonGroup that supports Yoga measurement.
18
+ *
19
+ * - Native measures the actual group and updates state with frameSize
20
+ * - measureContent() returns the size from state for proper Yoga layout
21
+ * - Falls back to platform-specific defaults if state hasn't been set yet
22
+ */
23
+ class MeasuringPCButtonGroupShadowNode final : public ConcreteViewShadowNode<
24
+ PCButtonGroupComponentName,
25
+ PCButtonGroupProps,
26
+ PCButtonGroupEventEmitter,
27
+ PCButtonGroupStateFrameSize> {
28
+ public:
29
+ using ConcreteViewShadowNode::ConcreteViewShadowNode;
30
+
31
+ // Fallback sizes used when native hasn't reported measurements yet
32
+ // iOS: a row of small UIButtons
33
+ static constexpr float kFallbackHeightIOS = 34.0f;
34
+
35
+ // Android: small Material 3 buttons (40dp) plus their 4dp touch insets
36
+ static constexpr float kFallbackHeightAndroid = 48.0f;
37
+
38
+ static constexpr float kFallbackWidth = 160.0f;
39
+
40
+ static ShadowNodeTraits BaseTraits() {
41
+ auto traits = ConcreteViewShadowNode::BaseTraits();
42
+ traits.set(ShadowNodeTraits::Trait::LeafYogaNode);
43
+ traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode);
44
+ return traits;
45
+ }
46
+
47
+ /**
48
+ * Called by Yoga when it needs the intrinsic size of the component.
49
+ */
50
+ Size measureContent(
51
+ const LayoutContext& layoutContext,
52
+ const LayoutConstraints& layoutConstraints) const override;
53
+ };
54
+
55
+ } // namespace facebook::react
@@ -0,0 +1,61 @@
1
+ #pragma once
2
+
3
+ #include <react/renderer/core/LayoutPrimitives.h>
4
+ #include <memory>
5
+
6
+ #if defined(RN_SERIALIZABLE_STATE) || defined(ANDROID)
7
+ #include <folly/dynamic.h>
8
+ #include <react/renderer/mapbuffer/MapBuffer.h>
9
+ #include <react/renderer/mapbuffer/MapBufferBuilder.h>
10
+ #endif
11
+
12
+ namespace facebook::react {
13
+
14
+ /**
15
+ * Custom state for ButtonGroup that holds the measured frame size from native.
16
+ * The native side measures the actual group and communicates the size to
17
+ * the shadow node for proper Yoga layout.
18
+ */
19
+ struct PCButtonGroupStateFrameSize {
20
+ using Shared = std::shared_ptr<const PCButtonGroupStateFrameSize>;
21
+
22
+ Size frameSize{}; // {width, height} in points
23
+
24
+ PCButtonGroupStateFrameSize() = default;
25
+
26
+ explicit PCButtonGroupStateFrameSize(Size size) : frameSize(size) {}
27
+
28
+ bool operator==(const PCButtonGroupStateFrameSize& other) const {
29
+ return frameSize.width == other.frameSize.width &&
30
+ frameSize.height == other.frameSize.height;
31
+ }
32
+
33
+ bool operator!=(const PCButtonGroupStateFrameSize& other) const {
34
+ return !(*this == other);
35
+ }
36
+
37
+ #if defined(RN_SERIALIZABLE_STATE) || defined(ANDROID)
38
+ // Required for Android state serialization
39
+ PCButtonGroupStateFrameSize(
40
+ const PCButtonGroupStateFrameSize& previousState,
41
+ folly::dynamic data)
42
+ : frameSize(previousState.frameSize) {
43
+ if (data.isObject()) {
44
+ if (data.count("width") && data.count("height")) {
45
+ frameSize.width = static_cast<Float>(data["width"].asDouble());
46
+ frameSize.height = static_cast<Float>(data["height"].asDouble());
47
+ }
48
+ }
49
+ }
50
+
51
+ folly::dynamic getDynamic() const {
52
+ return folly::dynamic::object("width", frameSize.width)("height", frameSize.height);
53
+ }
54
+
55
+ MapBuffer getMapBuffer() const {
56
+ return MapBufferBuilder::EMPTY();
57
+ }
58
+ #endif
59
+ };
60
+
61
+ } // namespace facebook::react
@@ -0,0 +1,48 @@
1
+ #include "PCButtonShadowNode-custom.h"
2
+
3
+ #include <react/renderer/core/LayoutConstraints.h>
4
+ #include <algorithm>
5
+
6
+ namespace facebook::react {
7
+
8
+ Size MeasuringPCButtonShadowNode::measureContent(
9
+ const LayoutContext& /*layoutContext*/,
10
+ const LayoutConstraints& layoutConstraints) const {
11
+
12
+ // Native measures the actual button and reports its intrinsic size
13
+ const auto& stateData = this->getStateData();
14
+ Float measuredW = stateData.frameSize.width;
15
+ Float measuredH = stateData.frameSize.height;
16
+
17
+ const Float fallbackHeight =
18
+ #ifdef __ANDROID__
19
+ static_cast<Float>(kFallbackHeightAndroid);
20
+ #else
21
+ static_cast<Float>(kFallbackHeightIOS);
22
+ #endif
23
+
24
+ const bool usingFallback = (measuredH <= 0);
25
+ if (usingFallback) {
26
+ measuredH = fallbackHeight;
27
+ }
28
+ if (measuredW <= 0) {
29
+ measuredW = static_cast<Float>(kFallbackWidth);
30
+ }
31
+
32
+ const Float kHuge = static_cast<Float>(1.0e9);
33
+
34
+ measuredW = std::max<Float>(measuredW, layoutConstraints.minimumSize.width);
35
+ if (layoutConstraints.maximumSize.width > 0 && layoutConstraints.maximumSize.width < kHuge) {
36
+ measuredW = std::min<Float>(measuredW, layoutConstraints.maximumSize.width);
37
+ }
38
+
39
+ measuredH = std::max<Float>(measuredH, layoutConstraints.minimumSize.height);
40
+ // Only clamp to max height if we have real measured data (not fallback)
41
+ if (!usingFallback && layoutConstraints.maximumSize.height > 0 && layoutConstraints.maximumSize.height < kHuge) {
42
+ measuredH = std::min<Float>(measuredH, layoutConstraints.maximumSize.height);
43
+ }
44
+
45
+ return Size{measuredW, measuredH};
46
+ }
47
+
48
+ } // namespace facebook::react
@@ -0,0 +1,55 @@
1
+ #pragma once
2
+
3
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
4
+
5
+ // Only include what we need for the shadow node definition
6
+ // Do NOT include ComponentDescriptors.h here to avoid circular dependency
7
+ #include <react/renderer/components/PlatformComponentsViewSpec/EventEmitters.h>
8
+ #include <react/renderer/components/PlatformComponentsViewSpec/Props.h>
9
+
10
+ #include "PCButtonState-custom.h"
11
+
12
+ namespace facebook::react {
13
+
14
+ extern const char PCButtonComponentName[];
15
+
16
+ /**
17
+ * Custom ShadowNode for Button that supports Yoga measurement.
18
+ *
19
+ * - Native measures the actual button and updates state with frameSize
20
+ * - measureContent() returns the size from state for proper Yoga layout
21
+ * - Falls back to platform-specific defaults if state hasn't been set yet
22
+ */
23
+ class MeasuringPCButtonShadowNode final : public ConcreteViewShadowNode<
24
+ PCButtonComponentName,
25
+ PCButtonProps,
26
+ PCButtonEventEmitter,
27
+ PCButtonStateFrameSize> {
28
+ public:
29
+ using ConcreteViewShadowNode::ConcreteViewShadowNode;
30
+
31
+ // Fallback sizes used when native hasn't reported measurements yet
32
+ // iOS UIButton.Configuration small size
33
+ static constexpr float kFallbackHeightIOS = 34.0f;
34
+
35
+ // Android Material 3 small button (40dp) plus its 4dp touch insets
36
+ static constexpr float kFallbackHeightAndroid = 48.0f;
37
+
38
+ static constexpr float kFallbackWidth = 64.0f;
39
+
40
+ static ShadowNodeTraits BaseTraits() {
41
+ auto traits = ConcreteViewShadowNode::BaseTraits();
42
+ traits.set(ShadowNodeTraits::Trait::LeafYogaNode);
43
+ traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode);
44
+ return traits;
45
+ }
46
+
47
+ /**
48
+ * Called by Yoga when it needs the intrinsic size of the component.
49
+ */
50
+ Size measureContent(
51
+ const LayoutContext& layoutContext,
52
+ const LayoutConstraints& layoutConstraints) const override;
53
+ };
54
+
55
+ } // namespace facebook::react
@@ -0,0 +1,61 @@
1
+ #pragma once
2
+
3
+ #include <react/renderer/core/LayoutPrimitives.h>
4
+ #include <memory>
5
+
6
+ #if defined(RN_SERIALIZABLE_STATE) || defined(ANDROID)
7
+ #include <folly/dynamic.h>
8
+ #include <react/renderer/mapbuffer/MapBuffer.h>
9
+ #include <react/renderer/mapbuffer/MapBufferBuilder.h>
10
+ #endif
11
+
12
+ namespace facebook::react {
13
+
14
+ /**
15
+ * Custom state for Button that holds the measured frame size from native.
16
+ * The native side measures the actual button and communicates the size to
17
+ * the shadow node for proper Yoga layout.
18
+ */
19
+ struct PCButtonStateFrameSize {
20
+ using Shared = std::shared_ptr<const PCButtonStateFrameSize>;
21
+
22
+ Size frameSize{}; // {width, height} in points
23
+
24
+ PCButtonStateFrameSize() = default;
25
+
26
+ explicit PCButtonStateFrameSize(Size size) : frameSize(size) {}
27
+
28
+ bool operator==(const PCButtonStateFrameSize& other) const {
29
+ return frameSize.width == other.frameSize.width &&
30
+ frameSize.height == other.frameSize.height;
31
+ }
32
+
33
+ bool operator!=(const PCButtonStateFrameSize& other) const {
34
+ return !(*this == other);
35
+ }
36
+
37
+ #if defined(RN_SERIALIZABLE_STATE) || defined(ANDROID)
38
+ // Required for Android state serialization
39
+ PCButtonStateFrameSize(
40
+ const PCButtonStateFrameSize& previousState,
41
+ folly::dynamic data)
42
+ : frameSize(previousState.frameSize) {
43
+ if (data.isObject()) {
44
+ if (data.count("width") && data.count("height")) {
45
+ frameSize.width = static_cast<Float>(data["width"].asDouble());
46
+ frameSize.height = static_cast<Float>(data["height"].asDouble());
47
+ }
48
+ }
49
+ }
50
+
51
+ folly::dynamic getDynamic() const {
52
+ return folly::dynamic::object("width", frameSize.width)("height", frameSize.height);
53
+ }
54
+
55
+ MapBuffer getMapBuffer() const {
56
+ return MapBufferBuilder::EMPTY();
57
+ }
58
+ #endif
59
+ };
60
+
61
+ } // namespace facebook::react
@@ -3,7 +3,7 @@
3
3
  #include <react/renderer/core/LayoutPrimitives.h>
4
4
  #include <memory>
5
5
 
6
- #ifdef RN_SERIALIZABLE_STATE
6
+ #if defined(RN_SERIALIZABLE_STATE) || defined(ANDROID)
7
7
  #include <folly/dynamic.h>
8
8
  #include <react/renderer/mapbuffer/MapBuffer.h>
9
9
  #include <react/renderer/mapbuffer/MapBufferBuilder.h>
@@ -37,7 +37,7 @@ struct PCDatePickerStateFrameSize {
37
37
  return !(*this == other);
38
38
  }
39
39
 
40
- #ifdef RN_SERIALIZABLE_STATE
40
+ #if defined(RN_SERIALIZABLE_STATE) || defined(ANDROID)
41
41
  // Required for Android state serialization
42
42
  PCDatePickerStateFrameSize(
43
43
  const PCDatePickerStateFrameSize& previousState,
@@ -3,7 +3,7 @@
3
3
  #include <react/renderer/core/LayoutPrimitives.h>
4
4
  #include <memory>
5
5
 
6
- #ifdef RN_SERIALIZABLE_STATE
6
+ #if defined(RN_SERIALIZABLE_STATE) || defined(ANDROID)
7
7
  #include <folly/dynamic.h>
8
8
  #include <react/renderer/mapbuffer/MapBuffer.h>
9
9
  #include <react/renderer/mapbuffer/MapBufferBuilder.h>
@@ -34,7 +34,7 @@ struct PCSegmentedControlStateFrameSize {
34
34
  return !(*this == other);
35
35
  }
36
36
 
37
- #ifdef RN_SERIALIZABLE_STATE
37
+ #if defined(RN_SERIALIZABLE_STATE) || defined(ANDROID)
38
38
  // Required for Android state serialization
39
39
  PCSegmentedControlStateFrameSize(
40
40
  const PCSegmentedControlStateFrameSize& previousState,
@@ -3,7 +3,7 @@
3
3
  #include <react/renderer/core/LayoutPrimitives.h>
4
4
  #include <memory>
5
5
 
6
- #ifdef RN_SERIALIZABLE_STATE
6
+ #if defined(RN_SERIALIZABLE_STATE) || defined(ANDROID)
7
7
  #include <folly/dynamic.h>
8
8
  #include <react/renderer/mapbuffer/MapBuffer.h>
9
9
  #include <react/renderer/mapbuffer/MapBufferBuilder.h>
@@ -37,7 +37,7 @@ struct PCSelectionMenuStateFrameSize {
37
37
  return !(*this == other);
38
38
  }
39
39
 
40
- #ifdef RN_SERIALIZABLE_STATE
40
+ #if defined(RN_SERIALIZABLE_STATE) || defined(ANDROID)
41
41
  // Required for Android state serialization
42
42
  PCSelectionMenuStateFrameSize(
43
43
  const PCSelectionMenuStateFrameSize& previousState,
@@ -0,0 +1,22 @@
1
+ #pragma once
2
+
3
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
4
+
5
+ // Forward declaration to avoid circular includes
6
+ namespace facebook::react {
7
+ class MeasuringPCTextFieldShadowNode;
8
+ }
9
+
10
+ // Include the actual shadow node definition
11
+ #include "PCTextFieldShadowNode-custom.h"
12
+
13
+ namespace facebook::react {
14
+
15
+ /**
16
+ * Custom component descriptor that uses our measuring shadow node
17
+ * instead of the generated one.
18
+ */
19
+ using MeasuringPCTextFieldComponentDescriptor =
20
+ ConcreteComponentDescriptor<MeasuringPCTextFieldShadowNode>;
21
+
22
+ } // namespace facebook::react
@@ -0,0 +1,47 @@
1
+ #include "PCTextFieldShadowNode-custom.h"
2
+
3
+ #include <react/renderer/core/LayoutConstraints.h>
4
+ #include <algorithm>
5
+
6
+ namespace facebook::react {
7
+
8
+ Size MeasuringPCTextFieldShadowNode::measureContent(
9
+ const LayoutContext& /*layoutContext*/,
10
+ const LayoutConstraints& layoutConstraints) const {
11
+
12
+ const auto& stateData = this->getStateData();
13
+ Float measuredW = stateData.frameSize.width;
14
+ Float measuredH = stateData.frameSize.height;
15
+
16
+ const Float kHuge = static_cast<Float>(1.0e9);
17
+
18
+ // A text field fills the width it is offered; only an unbounded row (no
19
+ // width at all) gets a fixed fallback.
20
+ if (measuredW <= 0) {
21
+ const Float maxW = layoutConstraints.maximumSize.width;
22
+ measuredW = (maxW > 0 && maxW < kHuge) ? maxW : static_cast<Float>(kFallbackWidth);
23
+ }
24
+
25
+ const bool usingFallback = (measuredH <= 0);
26
+ if (usingFallback) {
27
+ #ifdef __ANDROID__
28
+ measuredH = static_cast<Float>(kFallbackHeightAndroid);
29
+ #else
30
+ measuredH = static_cast<Float>(kFallbackHeightIOS);
31
+ #endif
32
+ }
33
+
34
+ measuredW = std::max<Float>(measuredW, layoutConstraints.minimumSize.width);
35
+ measuredW = std::min<Float>(measuredW, layoutConstraints.maximumSize.width);
36
+
37
+ measuredH = std::max<Float>(measuredH, layoutConstraints.minimumSize.height);
38
+ // Only clamp to max height if we have real measured data (not fallback)
39
+ if (!usingFallback && layoutConstraints.maximumSize.height > 0 &&
40
+ layoutConstraints.maximumSize.height < kHuge) {
41
+ measuredH = std::min<Float>(measuredH, layoutConstraints.maximumSize.height);
42
+ }
43
+
44
+ return Size{measuredW, measuredH};
45
+ }
46
+
47
+ } // namespace facebook::react