react-native-platform-components 1.2.0 → 1.3.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 (77) hide show
  1. package/README.md +9 -1
  2. package/android/src/main/java/com/platformcomponents/PCNativeThemeModule.kt +3 -0
  3. package/android/src/main/java/com/platformcomponents/PCSegmentedControlView.kt +2 -2
  4. package/android/src/main/java/com/platformcomponents/PlatformComponentsPackage.kt +9 -6
  5. package/android/src/main/jni/CMakeLists.txt +13 -1
  6. package/ios/PCNativeThemeModule.mm +13 -0
  7. package/ios/PCSelectionMenu.swift +9 -1
  8. package/lib/commonjs/ContextMenuNativeComponent.ts +5 -4
  9. package/lib/commonjs/DatePickerNativeComponent.ts +17 -11
  10. package/lib/commonjs/LiquidGlass.js +24 -4
  11. package/lib/commonjs/LiquidGlass.js.map +1 -1
  12. package/lib/commonjs/LiquidGlassNativeComponent.ts +6 -5
  13. package/lib/commonjs/NativePlatformComponentsTheme.js.map +1 -1
  14. package/lib/commonjs/SegmentedControlNativeComponent.ts +12 -11
  15. package/lib/commonjs/SelectionMenuNativeComponent.ts +6 -5
  16. package/lib/commonjs/codegenTypes.js +6 -0
  17. package/lib/commonjs/codegenTypes.js.map +1 -0
  18. package/lib/module/ContextMenuNativeComponent.ts +5 -4
  19. package/lib/module/DatePickerNativeComponent.ts +17 -11
  20. package/lib/module/LiquidGlass.js +24 -4
  21. package/lib/module/LiquidGlass.js.map +1 -1
  22. package/lib/module/LiquidGlassNativeComponent.ts +6 -5
  23. package/lib/module/NativePlatformComponentsTheme.js.map +1 -1
  24. package/lib/module/SegmentedControlNativeComponent.ts +12 -11
  25. package/lib/module/SelectionMenuNativeComponent.ts +6 -5
  26. package/lib/module/codegenTypes.js +4 -0
  27. package/lib/module/codegenTypes.js.map +1 -0
  28. package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts +5 -4
  29. package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts.map +1 -1
  30. package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts +12 -11
  31. package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts.map +1 -1
  32. package/lib/typescript/commonjs/src/LiquidGlass.d.ts +4 -3
  33. package/lib/typescript/commonjs/src/LiquidGlass.d.ts.map +1 -1
  34. package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts +6 -5
  35. package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts.map +1 -1
  36. package/lib/typescript/commonjs/src/NativePlatformComponentsTheme.d.ts +10 -2
  37. package/lib/typescript/commonjs/src/NativePlatformComponentsTheme.d.ts.map +1 -1
  38. package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts +7 -6
  39. package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts.map +1 -1
  40. package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts +6 -5
  41. package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts.map +1 -1
  42. package/lib/typescript/commonjs/src/codegenTypes.d.ts +12 -0
  43. package/lib/typescript/commonjs/src/codegenTypes.d.ts.map +1 -0
  44. package/lib/typescript/commonjs/src/sharedTypes.d.ts +2 -2
  45. package/lib/typescript/commonjs/src/sharedTypes.d.ts.map +1 -1
  46. package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts +5 -4
  47. package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts.map +1 -1
  48. package/lib/typescript/module/src/DatePickerNativeComponent.d.ts +12 -11
  49. package/lib/typescript/module/src/DatePickerNativeComponent.d.ts.map +1 -1
  50. package/lib/typescript/module/src/LiquidGlass.d.ts +4 -3
  51. package/lib/typescript/module/src/LiquidGlass.d.ts.map +1 -1
  52. package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts +6 -5
  53. package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts.map +1 -1
  54. package/lib/typescript/module/src/NativePlatformComponentsTheme.d.ts +10 -2
  55. package/lib/typescript/module/src/NativePlatformComponentsTheme.d.ts.map +1 -1
  56. package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts +7 -6
  57. package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts.map +1 -1
  58. package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts +6 -5
  59. package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts.map +1 -1
  60. package/lib/typescript/module/src/codegenTypes.d.ts +12 -0
  61. package/lib/typescript/module/src/codegenTypes.d.ts.map +1 -0
  62. package/lib/typescript/module/src/sharedTypes.d.ts +2 -2
  63. package/lib/typescript/module/src/sharedTypes.d.ts.map +1 -1
  64. package/package.json +4 -3
  65. package/shared/PCDatePickerState-custom.h +2 -2
  66. package/shared/PCSegmentedControlState-custom.h +2 -2
  67. package/shared/PCSelectionMenuState-custom.h +2 -2
  68. package/src/ContextMenuNativeComponent.ts +5 -4
  69. package/src/DatePickerNativeComponent.ts +17 -11
  70. package/src/LiquidGlass.tsx +24 -5
  71. package/src/LiquidGlassNativeComponent.ts +6 -5
  72. package/src/NativePlatformComponentsTheme.ts +11 -2
  73. package/src/SegmentedControlNativeComponent.ts +12 -11
  74. package/src/SelectionMenuNativeComponent.ts +6 -5
  75. package/src/codegenTypes.ts +40 -0
  76. package/src/sharedTypes.ts +2 -2
  77. /package/{app.plugin.cjs → app.plugin.js} +0 -0
package/README.md CHANGED
@@ -107,6 +107,9 @@ yarn add react-native-platform-components
107
107
  }
108
108
  ```
109
109
 
110
+ Either form of the reference works: `react-native-platform-components/app.plugin`
111
+ as above, or the bare package name.
112
+
110
113
  ```sh
111
114
  npx expo install react-native-platform-components
112
115
  npx expo prebuild
@@ -122,9 +125,14 @@ The library is built for the New Architecture (Fabric + Codegen) and does not su
122
125
  | React Native | 0.81 with the New Architecture enabled |
123
126
  | Expo SDK | 54, with a dev client or EAS Build (not Expo Go) |
124
127
  | React | 19 |
125
- | iOS | 13 (LiquidGlass needs iOS 26) |
128
+ | iOS | 15.1 (LiquidGlass needs iOS 26) |
126
129
  | Android | API 24 (Android 7.0); Material Components 1.14 is bundled |
127
130
 
131
+ iOS sets that minimum. LiquidGlass uses iOS 26 APIs, so the library has to be
132
+ built with Xcode 26, and React Native's bundled `fmt` only compiles under Xcode
133
+ 26 from 0.81 on. The Android code itself builds against React Native 0.76, and
134
+ CI keeps it that way.
135
+
128
136
  Full details: [Installation](https://jarx-concepts.github.io/react-native-platform-components/installation).
129
137
 
130
138
  ## Documentation
@@ -35,6 +35,9 @@ class PCNativeThemeModule(reactContext: ReactApplicationContext) :
35
35
  }
36
36
  }
37
37
 
38
+ /** Liquid Glass is an iOS effect; Android renders the fallback View. */
39
+ override fun isLiquidGlassSupported(): Boolean = false
40
+
38
41
  companion object {
39
42
  const val NAME = "PlatformComponentsTheme"
40
43
  private const val TAG = "PlatformComponents"
@@ -319,13 +319,13 @@ class PCSegmentedControlView(context: Context) :
319
319
 
320
320
  when (segment.iconType) {
321
321
  "drawable" -> {
322
- button.icon = ResourceDrawableIdHelper.getResourceDrawable(context, segment.iconName)
322
+ button.icon = ResourceDrawableIdHelper.instance.getResourceDrawable(context, segment.iconName)
323
323
  }
324
324
  "image" -> {
325
325
  val uri = segment.iconUri
326
326
  val isResourceName = !uri.contains(':')
327
327
  if (isResourceName) {
328
- button.icon = ResourceDrawableIdHelper.getResourceDrawable(context, uri)
328
+ button.icon = ResourceDrawableIdHelper.instance.getResourceDrawable(context, uri)
329
329
  } else {
330
330
  PCImageLoader.load(context, uri, segment.iconScale) { bitmap ->
331
331
  if (bitmap == null || generation != rebuildGeneration) return@load
@@ -29,13 +29,16 @@ class PlatformComponentsViewPackage : BaseReactPackage() {
29
29
  override fun getReactModuleInfoProvider(): ReactModuleInfoProvider = ReactModuleInfoProvider {
30
30
  mapOf(
31
31
  PCNativeThemeModule.NAME to
32
+ // Positional arguments on purpose: React Native 0.76 names the
33
+ // parameters of this constructor `_name` / `_className`, so named
34
+ // arguments only compile against newer releases.
32
35
  ReactModuleInfo(
33
- name = PCNativeThemeModule.NAME,
34
- className = PCNativeThemeModule::class.java.name,
35
- canOverrideExistingModule = false,
36
- needsEagerInit = false,
37
- isCxxModule = false,
38
- isTurboModule = true,
36
+ PCNativeThemeModule.NAME,
37
+ PCNativeThemeModule::class.java.name,
38
+ /* canOverrideExistingModule = */ false,
39
+ /* needsEagerInit = */ false,
40
+ /* isCxxModule = */ false,
41
+ /* isTurboModule = */ true,
39
42
  )
40
43
  )
41
44
  }
@@ -44,4 +44,16 @@ target_link_libraries(
44
44
  reactnative
45
45
  )
46
46
 
47
- target_compile_reactnative_options(react_codegen_PlatformComponentsViewSpec PRIVATE)
47
+ # target_compile_reactnative_options() arrived in React Native 0.80. On older
48
+ # releases, apply the equivalent flags directly so the library still builds.
49
+ if(COMMAND target_compile_reactnative_options)
50
+ target_compile_reactnative_options(react_codegen_PlatformComponentsViewSpec PRIVATE)
51
+ else()
52
+ target_compile_options(react_codegen_PlatformComponentsViewSpec PRIVATE
53
+ -DLOG_TAG=\"ReactNative\"
54
+ -fexceptions
55
+ -frtti
56
+ -std=c++20
57
+ -Wall
58
+ )
59
+ endif()
@@ -27,6 +27,19 @@ RCT_EXPORT_MODULE(PlatformComponentsTheme)
27
27
  });
28
28
  }
29
29
 
30
+ /// Reports what this *build* can do, not just what the device runs: with an
31
+ /// older Xcode the glass code is compiled out (see PCLiquidGlass.swift), so
32
+ /// the iOS version alone would be a false positive.
33
+ - (NSNumber *)isLiquidGlassSupported
34
+ {
35
+ #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
36
+ if (@available(iOS 26.0, *)) {
37
+ return @(PCLiquidGlassView.isSupported);
38
+ }
39
+ #endif
40
+ return @NO;
41
+ }
42
+
30
43
  - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
31
44
  (const facebook::react::ObjCTurboModule::InitParams &)params
32
45
  {
@@ -473,8 +473,12 @@ private class PCMenuViewController: UIViewController, UITableViewDelegate, UITab
473
473
  menuContainer.clipsToBounds = true
474
474
  view.addSubview(menuContainer)
475
475
 
476
- // Use liquid glass on iOS 26+, fall back to system material blur on older versions
476
+ // Use liquid glass on iOS 26+, fall back to system material blur on older
477
+ // versions. UIGlassEffect only exists in the iOS 26 SDK, so the branch is
478
+ // compiled out entirely on older toolchains — same guard as
479
+ // PCLiquidGlass.swift, which keeps the library buildable without Xcode 26.
477
480
  let effectView: UIVisualEffectView
481
+ #if compiler(>=6.2)
478
482
  if #available(iOS 26, *) {
479
483
  let glassEffect = UIGlassEffect()
480
484
  glassEffect.isInteractive = true
@@ -483,6 +487,10 @@ private class PCMenuViewController: UIViewController, UITableViewDelegate, UITab
483
487
  let blurEffect = UIBlurEffect(style: .systemMaterial)
484
488
  effectView = UIVisualEffectView(effect: blurEffect)
485
489
  }
490
+ #else
491
+ let blurEffect = UIBlurEffect(style: .systemMaterial)
492
+ effectView = UIVisualEffectView(effect: blurEffect)
493
+ #endif
486
494
  effectView.frame = menuContainer.bounds
487
495
  effectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
488
496
  menuContainer.addSubview(effectView)
@@ -1,6 +1,7 @@
1
1
  // ContextMenuNativeComponent.ts
2
- import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
2
+ import type { HostComponent, ViewProps } from 'react-native';
3
3
  import { codegenNativeComponent } from 'react-native';
4
+ import type { BubblingEventHandler } from './codegenTypes';
4
5
 
5
6
  /**
6
7
  * Attributes for a context menu action.
@@ -120,17 +121,17 @@ export interface ContextMenuProps extends ViewProps {
120
121
  /**
121
122
  * Fired when user presses an action.
122
123
  */
123
- onPressAction?: CodegenTypes.BubblingEventHandler<ContextMenuPressActionEvent>;
124
+ onPressAction?: BubblingEventHandler<ContextMenuPressActionEvent>;
124
125
 
125
126
  /**
126
127
  * Fired when menu opens.
127
128
  */
128
- onMenuOpen?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
129
+ onMenuOpen?: BubblingEventHandler<Readonly<{}>>;
129
130
 
130
131
  /**
131
132
  * Fired when menu closes.
132
133
  */
133
- onMenuClose?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
134
+ onMenuClose?: BubblingEventHandler<Readonly<{}>>;
134
135
 
135
136
  ios?: IOSProps;
136
137
  android?: AndroidProps;
@@ -1,11 +1,17 @@
1
1
  // DatePickerNativeComponent.ts
2
- import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
2
+ import type { HostComponent, ViewProps } from 'react-native';
3
3
  import { codegenNativeComponent } from 'react-native';
4
+ import type {
5
+ BubblingEventHandler,
6
+ Double,
7
+ Int32,
8
+ WithDefault,
9
+ } from './codegenTypes';
4
10
 
5
- export type TimestampMs = CodegenTypes.Double;
11
+ export type TimestampMs = Double;
6
12
 
7
13
  export type DateChangeEvent = {
8
- timestampMs: CodegenTypes.Double;
14
+ timestampMs: Double;
9
15
  confirmed: boolean;
10
16
  };
11
17
 
@@ -18,14 +24,14 @@ export type IOSConfirmToolbar = 'show' | 'hide';
18
24
 
19
25
  export type IOSProps = {
20
26
  preferredStyle?: string; // IOSDatePickerStyle
21
- countDownDurationSeconds?: CodegenTypes.Double;
22
- minuteInterval?: CodegenTypes.Int32;
27
+ countDownDurationSeconds?: Double;
28
+ minuteInterval?: Int32;
23
29
  roundsToMinuteInterval?: string; // IOSRoundsToMinuteInterval
24
30
  confirmToolbar?: string; // IOSConfirmToolbar
25
31
  };
26
32
 
27
33
  export type AndroidProps = {
28
- firstDayOfWeek?: CodegenTypes.Int32;
34
+ firstDayOfWeek?: Int32;
29
35
  material?: string; // AndroidMaterialMode
30
36
  dialogTitle?: string;
31
37
  positiveButtonTitle?: string;
@@ -44,9 +50,9 @@ export type MacOSProps = Readonly<{}>;
44
50
  export type CommonProps = {
45
51
  mode?: string; // DatePickerMode
46
52
 
47
- dateMs?: CodegenTypes.WithDefault<TimestampMs, -9007199254740991>;
48
- minDateMs?: CodegenTypes.WithDefault<TimestampMs, -9007199254740991>;
49
- maxDateMs?: CodegenTypes.WithDefault<TimestampMs, -9007199254740991>;
53
+ dateMs?: WithDefault<TimestampMs, -9007199254740991>;
54
+ minDateMs?: WithDefault<TimestampMs, -9007199254740991>;
55
+ maxDateMs?: WithDefault<TimestampMs, -9007199254740991>;
50
56
 
51
57
  locale?: string;
52
58
  timeZoneName?: string;
@@ -65,8 +71,8 @@ export interface NativeProps extends ViewProps, CommonProps {
65
71
  ios?: IOSProps;
66
72
  android?: AndroidProps;
67
73
 
68
- onConfirm?: CodegenTypes.BubblingEventHandler<DateChangeEvent>;
69
- onClosed?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
74
+ onConfirm?: BubblingEventHandler<DateChangeEvent>;
75
+ onClosed?: BubblingEventHandler<Readonly<{}>>;
70
76
  }
71
77
 
72
78
  export default codegenNativeComponent<NativeProps>(
@@ -8,18 +8,38 @@ exports.isLiquidGlassSupported = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _reactNative = require("react-native");
10
10
  var _LiquidGlassNativeComponent = _interopRequireDefault(require("./LiquidGlassNativeComponent"));
11
+ var _NativePlatformComponentsTheme = _interopRequireDefault(require("./NativePlatformComponentsTheme"));
11
12
  var _jsxRuntime = require("react/jsx-runtime");
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
14
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
15
  // LiquidGlass.tsx
15
16
 
17
+ function resolveLiquidGlassSupport() {
18
+ if (_reactNative.Platform.OS !== 'ios') {
19
+ return false;
20
+ }
21
+ try {
22
+ // The native module answers for this build: Liquid Glass is compiled out
23
+ // when the library is built with an Xcode that predates the iOS 26 SDK,
24
+ // and then no device version makes it available.
25
+ const supported = _NativePlatformComponentsTheme.default?.isLiquidGlassSupported();
26
+ if (typeof supported === 'boolean') {
27
+ return supported;
28
+ }
29
+ } catch {
30
+ // Native module not available (web, tests): fall back to the OS version.
31
+ }
32
+ return parseInt(String(_reactNative.Platform.Version), 10) >= 26;
33
+ }
34
+
16
35
  /**
17
- * Whether the LiquidGlass effect is supported on the current device.
18
- * Returns true on iOS 26+ (with Liquid Glass support), false otherwise.
36
+ * Whether the LiquidGlass effect is supported here: iOS 26 or newer, in a
37
+ * build compiled against the iOS 26 SDK. False on Android, on older iOS, and
38
+ * in builds made with an older Xcode, where the views fall back to a blur.
19
39
  *
20
- * Use this to conditionally render fallback UI on unsupported devices.
40
+ * Use this to conditionally render fallback UI.
21
41
  */
22
- const isLiquidGlassSupported = exports.isLiquidGlassSupported = _reactNative.Platform.OS === 'ios' && parseInt(String(_reactNative.Platform.Version), 10) >= 26;
42
+ const isLiquidGlassSupported = exports.isLiquidGlassSupported = resolveLiquidGlassSupport();
23
43
  function LiquidGlass(props) {
24
44
  const {
25
45
  style,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_LiquidGlassNativeComponent","_interopRequireDefault","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","isLiquidGlassSupported","exports","Platform","OS","parseInt","String","Version","LiquidGlass","props","style","cornerRadius","ios","android","children","onPress","viewProps","nativeIos","useMemo","undefined","effect","interactive","tintColor","colorScheme","nativeAndroid","fallbackBackgroundColor","handlePress","useCallback","event","x","nativeEvent","y","jsx","onGlassPress"],"sourceRoot":"../../src","sources":["LiquidGlass.tsx"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA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rD,2BAAA,CAAAK,OAAiB;IAChB0B,KAAK,EAAEA,KAAM;IACbC,YAAY,EAAEA,YAAa;IAC3BC,GAAG,EAAEK,SAAU;IACfJ,OAAO,EAAEW,aAAc;IACvBS,YAAY,EAAElB,OAAO,GAAGW,WAAW,GAAGP,SAAU;IAAA,GAC5CH,SAAS;IAAAF,QAAA,EAEZA;EAAQ,CACQ,CAAC;AAExB","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_LiquidGlassNativeComponent","_interopRequireDefault","_NativePlatformComponentsTheme","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","resolveLiquidGlassSupport","Platform","OS","supported","NativePlatformComponentsTheme","isLiquidGlassSupported","parseInt","String","Version","exports","LiquidGlass","props","style","cornerRadius","ios","android","children","onPress","viewProps","nativeIos","useMemo","undefined","effect","interactive","tintColor","colorScheme","nativeAndroid","fallbackBackgroundColor","handlePress","useCallback","event","x","nativeEvent","y","jsx","onGlassPress"],"sourceRoot":"../../src","sources":["LiquidGlass.tsx"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,2BAAA,GAAAC,sBAAA,CAAAH,OAAA;AAKA,IAAAI,8BAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA4E,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAO,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,C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IACfJ,OAAO,EAAEW,aAAc;IACvBS,YAAY,EAAElB,OAAO,GAAGW,WAAW,GAAGP,SAAU;IAAA,GAC5CH,SAAS;IAAAF,QAAA,EAEZA;EAAQ,CACQ,CAAC;AAExB","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  // LiquidGlassNativeComponent.ts
2
- import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
2
+ import type { HostComponent, ViewProps } from 'react-native';
3
3
  import { codegenNativeComponent } from 'react-native';
4
+ import type { DirectEventHandler, Float, WithDefault } from './codegenTypes';
4
5
 
5
6
  /**
6
7
  * Glass effect intensity/style.
@@ -64,9 +65,9 @@ export type LiquidGlassAndroidProps = Readonly<{
64
65
  */
65
66
  export type LiquidGlassPressEvent = Readonly<{
66
67
  /** X coordinate of touch relative to view bounds */
67
- x: CodegenTypes.Float;
68
+ x: Float;
68
69
  /** Y coordinate of touch relative to view bounds */
69
- y: CodegenTypes.Float;
70
+ y: Float;
70
71
  }>;
71
72
 
72
73
  export interface LiquidGlassNativeProps extends ViewProps {
@@ -75,7 +76,7 @@ export interface LiquidGlassNativeProps extends ViewProps {
75
76
  * Applied uniformly to all corners.
76
77
  * @default 0
77
78
  */
78
- cornerRadius?: CodegenTypes.WithDefault<CodegenTypes.Float, 0>;
79
+ cornerRadius?: WithDefault<Float, 0>;
79
80
 
80
81
  /**
81
82
  * iOS-specific props.
@@ -91,7 +92,7 @@ export interface LiquidGlassNativeProps extends ViewProps {
91
92
  * Fired when the glass view is pressed.
92
93
  * Includes touch coordinates relative to view bounds.
93
94
  */
94
- onGlassPress?: CodegenTypes.DirectEventHandler<LiquidGlassPressEvent>;
95
+ onGlassPress?: DirectEventHandler<LiquidGlassPressEvent>;
95
96
  }
96
97
 
97
98
  export default codegenNativeComponent<LiquidGlassNativeProps>(
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../src","sources":["NativePlatformComponentsTheme.ts"],"mappings":";;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AAFA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAYeC,gCAAmB,CAACC,GAAG,CAAO,yBAAyB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../src","sources":["NativePlatformComponentsTheme.ts"],"mappings":";;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AAFA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAqBeC,gCAAmB,CAACC,GAAG,CAAO,yBAAyB,CAAC","ignoreList":[]}
@@ -1,11 +1,12 @@
1
1
  // SegmentedControlNativeComponent.ts
2
- import type {
3
- CodegenTypes,
4
- ColorValue,
5
- HostComponent,
6
- ViewProps,
7
- } from 'react-native';
2
+ import type { ColorValue, HostComponent, ViewProps } from 'react-native';
8
3
  import { codegenNativeComponent } from 'react-native';
4
+ import type {
5
+ BubblingEventHandler,
6
+ Double,
7
+ Int32,
8
+ WithDefault,
9
+ } from './codegenTypes';
9
10
 
10
11
  /**
11
12
  * A single segment in the control.
@@ -21,7 +22,7 @@ export type SegmentedControlSegment = Readonly<{
21
22
  iconType: string; // '' | 'sfSymbol' | 'drawable' | 'image'
22
23
  iconName: string; // SF Symbol (iOS) or drawable resource name (Android)
23
24
  iconUri: string; // Resolved image URI when iconType === 'image'
24
- iconScale: CodegenTypes.Double; // Resolved image scale when iconType === 'image'
25
+ iconScale: Double; // Resolved image scale when iconType === 'image'
25
26
  iconTinted: string; // 'true' | 'false' — draw the image as a tinted template
26
27
  badge: string; // Badge text, empty = no badge
27
28
  accessibilityLabel: string; // Screen-reader label, empty = use label
@@ -32,7 +33,7 @@ export type SegmentedControlSegment = Readonly<{
32
33
  */
33
34
  export type SegmentedControlSelectEvent = Readonly<{
34
35
  /** Selected segment index. -1 means the selection was cleared. */
35
- index: CodegenTypes.Int32;
36
+ index: Int32;
36
37
 
37
38
  /** Selected segment value. Empty when the selection was cleared. */
38
39
  value: string;
@@ -49,7 +50,7 @@ export type SegmentedControlLabelVisibility = 'auto' | 'labeled' | 'unlabeled';
49
50
  */
50
51
  export type LabelStyleProps = Readonly<{
51
52
  fontFamily?: string;
52
- fontSize?: CodegenTypes.Double;
53
+ fontSize?: Double;
53
54
  fontWeight?: string; // 'normal' | 'bold' | '100'..'900'
54
55
  fontStyle?: string; // 'normal' | 'italic'
55
56
  }>;
@@ -83,7 +84,7 @@ export interface SegmentedControlProps extends ViewProps {
83
84
  * Controlled selection by `value`.
84
85
  * Empty string means "no selection".
85
86
  */
86
- selectedValue?: CodegenTypes.WithDefault<string, ''>;
87
+ selectedValue?: WithDefault<string, ''>;
87
88
 
88
89
  /**
89
90
  * Enabled / disabled state.
@@ -122,7 +123,7 @@ export interface SegmentedControlProps extends ViewProps {
122
123
  /**
123
124
  * Fired when the user selects a segment.
124
125
  */
125
- onSelect?: CodegenTypes.BubblingEventHandler<SegmentedControlSelectEvent>;
126
+ onSelect?: BubblingEventHandler<SegmentedControlSelectEvent>;
126
127
 
127
128
  ios?: IOSProps;
128
129
  android?: AndroidProps;
@@ -1,6 +1,7 @@
1
1
  // SelectionMenuNativeComponent.ts
2
- import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
2
+ import type { HostComponent, ViewProps } from 'react-native';
3
3
  import { codegenNativeComponent } from 'react-native';
4
+ import type { BubblingEventHandler, Int32, WithDefault } from './codegenTypes';
4
5
 
5
6
  /**
6
7
  * A single option in the menu.
@@ -15,7 +16,7 @@ export type SelectionMenuOption = Readonly<{
15
16
  */
16
17
  export type SelectionMenuSelectEvent = Readonly<{
17
18
  /** Selected option index (implementation detail; stable for this render) */
18
- index: CodegenTypes.Int32;
19
+ index: Int32;
19
20
 
20
21
  /** Selected option label */
21
22
  label: string;
@@ -57,7 +58,7 @@ export interface SelectionMenuProps extends ViewProps {
57
58
  * - Empty string means "no selection".
58
59
  * - Native should treat this as the single source of truth.
59
60
  */
60
- selectedData?: CodegenTypes.WithDefault<string, ''>;
61
+ selectedData?: WithDefault<string, ''>;
61
62
 
62
63
  /**
63
64
  * Enabled / disabled state.
@@ -83,12 +84,12 @@ export interface SelectionMenuProps extends ViewProps {
83
84
  /**
84
85
  * Fired when the user selects an option.
85
86
  */
86
- onSelect?: CodegenTypes.BubblingEventHandler<SelectionMenuSelectEvent>;
87
+ onSelect?: BubblingEventHandler<SelectionMenuSelectEvent>;
87
88
 
88
89
  /**
89
90
  * Fired when dismissed without selection.
90
91
  */
91
- onRequestClose?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
92
+ onRequestClose?: BubblingEventHandler<Readonly<{}>>;
92
93
 
93
94
  ios?: IOSProps;
94
95
  android?: AndroidProps;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=codegenTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["codegenTypes.ts"],"mappings":"","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  // ContextMenuNativeComponent.ts
2
- import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
2
+ import type { HostComponent, ViewProps } from 'react-native';
3
3
  import { codegenNativeComponent } from 'react-native';
4
+ import type { BubblingEventHandler } from './codegenTypes';
4
5
 
5
6
  /**
6
7
  * Attributes for a context menu action.
@@ -120,17 +121,17 @@ export interface ContextMenuProps extends ViewProps {
120
121
  /**
121
122
  * Fired when user presses an action.
122
123
  */
123
- onPressAction?: CodegenTypes.BubblingEventHandler<ContextMenuPressActionEvent>;
124
+ onPressAction?: BubblingEventHandler<ContextMenuPressActionEvent>;
124
125
 
125
126
  /**
126
127
  * Fired when menu opens.
127
128
  */
128
- onMenuOpen?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
129
+ onMenuOpen?: BubblingEventHandler<Readonly<{}>>;
129
130
 
130
131
  /**
131
132
  * Fired when menu closes.
132
133
  */
133
- onMenuClose?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
134
+ onMenuClose?: BubblingEventHandler<Readonly<{}>>;
134
135
 
135
136
  ios?: IOSProps;
136
137
  android?: AndroidProps;
@@ -1,11 +1,17 @@
1
1
  // DatePickerNativeComponent.ts
2
- import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
2
+ import type { HostComponent, ViewProps } from 'react-native';
3
3
  import { codegenNativeComponent } from 'react-native';
4
+ import type {
5
+ BubblingEventHandler,
6
+ Double,
7
+ Int32,
8
+ WithDefault,
9
+ } from './codegenTypes';
4
10
 
5
- export type TimestampMs = CodegenTypes.Double;
11
+ export type TimestampMs = Double;
6
12
 
7
13
  export type DateChangeEvent = {
8
- timestampMs: CodegenTypes.Double;
14
+ timestampMs: Double;
9
15
  confirmed: boolean;
10
16
  };
11
17
 
@@ -18,14 +24,14 @@ export type IOSConfirmToolbar = 'show' | 'hide';
18
24
 
19
25
  export type IOSProps = {
20
26
  preferredStyle?: string; // IOSDatePickerStyle
21
- countDownDurationSeconds?: CodegenTypes.Double;
22
- minuteInterval?: CodegenTypes.Int32;
27
+ countDownDurationSeconds?: Double;
28
+ minuteInterval?: Int32;
23
29
  roundsToMinuteInterval?: string; // IOSRoundsToMinuteInterval
24
30
  confirmToolbar?: string; // IOSConfirmToolbar
25
31
  };
26
32
 
27
33
  export type AndroidProps = {
28
- firstDayOfWeek?: CodegenTypes.Int32;
34
+ firstDayOfWeek?: Int32;
29
35
  material?: string; // AndroidMaterialMode
30
36
  dialogTitle?: string;
31
37
  positiveButtonTitle?: string;
@@ -44,9 +50,9 @@ export type MacOSProps = Readonly<{}>;
44
50
  export type CommonProps = {
45
51
  mode?: string; // DatePickerMode
46
52
 
47
- dateMs?: CodegenTypes.WithDefault<TimestampMs, -9007199254740991>;
48
- minDateMs?: CodegenTypes.WithDefault<TimestampMs, -9007199254740991>;
49
- maxDateMs?: CodegenTypes.WithDefault<TimestampMs, -9007199254740991>;
53
+ dateMs?: WithDefault<TimestampMs, -9007199254740991>;
54
+ minDateMs?: WithDefault<TimestampMs, -9007199254740991>;
55
+ maxDateMs?: WithDefault<TimestampMs, -9007199254740991>;
50
56
 
51
57
  locale?: string;
52
58
  timeZoneName?: string;
@@ -65,8 +71,8 @@ export interface NativeProps extends ViewProps, CommonProps {
65
71
  ios?: IOSProps;
66
72
  android?: AndroidProps;
67
73
 
68
- onConfirm?: CodegenTypes.BubblingEventHandler<DateChangeEvent>;
69
- onClosed?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
74
+ onConfirm?: BubblingEventHandler<DateChangeEvent>;
75
+ onClosed?: BubblingEventHandler<Readonly<{}>>;
70
76
  }
71
77
 
72
78
  export default codegenNativeComponent<NativeProps>(
@@ -4,14 +4,34 @@
4
4
  import React, { useCallback, useMemo } from 'react';
5
5
  import { Platform } from 'react-native';
6
6
  import NativeLiquidGlass from './LiquidGlassNativeComponent';
7
+ import NativePlatformComponentsTheme from "./NativePlatformComponentsTheme.js";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
+ function resolveLiquidGlassSupport() {
10
+ if (Platform.OS !== 'ios') {
11
+ return false;
12
+ }
13
+ try {
14
+ // The native module answers for this build: Liquid Glass is compiled out
15
+ // when the library is built with an Xcode that predates the iOS 26 SDK,
16
+ // and then no device version makes it available.
17
+ const supported = NativePlatformComponentsTheme?.isLiquidGlassSupported();
18
+ if (typeof supported === 'boolean') {
19
+ return supported;
20
+ }
21
+ } catch {
22
+ // Native module not available (web, tests): fall back to the OS version.
23
+ }
24
+ return parseInt(String(Platform.Version), 10) >= 26;
25
+ }
26
+
8
27
  /**
9
- * Whether the LiquidGlass effect is supported on the current device.
10
- * Returns true on iOS 26+ (with Liquid Glass support), false otherwise.
28
+ * Whether the LiquidGlass effect is supported here: iOS 26 or newer, in a
29
+ * build compiled against the iOS 26 SDK. False on Android, on older iOS, and
30
+ * in builds made with an older Xcode, where the views fall back to a blur.
11
31
  *
12
- * Use this to conditionally render fallback UI on unsupported devices.
32
+ * Use this to conditionally render fallback UI.
13
33
  */
14
- export const isLiquidGlassSupported = Platform.OS === 'ios' && parseInt(String(Platform.Version), 10) >= 26;
34
+ export const isLiquidGlassSupported = resolveLiquidGlassSupport();
15
35
  export function LiquidGlass(props) {
16
36
  const {
17
37
  style,
@@ -1 +1 @@
1
- {"version":3,"names":["React","useCallback","useMemo","Platform","NativeLiquidGlass","jsx","_jsx","isLiquidGlassSupported","OS","parseInt","String","Version","LiquidGlass","props","style","cornerRadius","ios","android","children","onPress","viewProps","nativeIos","undefined","effect","interactive","tintColor","colorScheme","nativeAndroid","fallbackBackgroundColor","handlePress","event","x","nativeEvent","y","onGlassPress"],"sourceRoot":"../../src","sources":["LiquidGlass.tsx"],"mappings":";;AAAA;AACA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACnD,SAASC,QAAQ,QAAwB,cAAc;AAEvD,OAAOC,iBAAiB,MAIjB,8BAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQtC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAA+B,GAC1CJ,QAAQ,CAACK,EAAE,KAAK,KAAK,IAAIC,QAAQ,CAACC,MAAM,CAACP,QAAQ,CAACQ,OAAO,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE;AA+EvE,OAAO,SAASC,WAAWA,CAACC,KAAuB,EAAsB;EACvE,MAAM;IACJC,KAAK;IACLC,YAAY,GAAG,CAAC;IAChBC,GAAG;IACHC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACP,GAAGC;EACL,CAAC,GAAGP,KAAK;;EAET;EACA,MAAMQ,SAAS,GAAGnB,OAAO,CAAC,MAAM;IAC9B,IAAIC,QAAQ,CAACK,EAAE,KAAK,KAAK,IAAI,CAACQ,GAAG,EAAE,OAAOM,SAAS;IACnD,OAAO;MACLC,MAAM,EAAEP,GAAG,CAACO,MAAM;MAClBC,WAAW,EAAER,GAAG,CAACQ,WAAW,GAAG,MAAM,GAAG,OAAO;MAC/CC,SAAS,EAAET,GAAG,CAACS,SAAS;MACxBC,WAAW,EAAEV,GAAG,CAACU;IACnB,CAAC;EACH,CAAC,EAAE,CAACV,GAAG,CAAC,CAAC;;EAET;EACA,MAAMW,aAAa,GAAGzB,OAAO,CAAC,MAAM;IAClC,IAAIC,QAAQ,CAACK,EAAE,KAAK,SAAS,IAAI,CAACS,OAAO,EAAE,OAAOK,SAAS;IAC3D,OAAO;MACLM,uBAAuB,EAAEX,OAAO,CAACW;IACnC,CAAC;EACH,CAAC,EAAE,CAACX,OAAO,CAAC,CAAC;;EAEb;EACA,MAAMY,WAAW,GAAG5B,WAAW,CAC5B6B,KAAgD,IAAK;IACpDX,OAAO,GAAG;MAAEY,CAAC,EAAED,KAAK,CAACE,WAAW,CAACD,CAAC;MAAEE,CAAC,EAAEH,KAAK,CAACE,WAAW,CAACC;IAAE,CAAC,CAAC;EAC/D,CAAC,EACD,CAACd,OAAO,CACV,CAAC;EAED,oBACEb,IAAA,CAACF,iBAAiB;IAChBU,KAAK,EAAEA,KAAM;IACbC,YAAY,EAAEA,YAAa;IAC3BC,GAAG,EAAEK,SAAU;IACfJ,OAAO,EAAEU,aAAc;IACvBO,YAAY,EAAEf,OAAO,GAAGU,WAAW,GAAGP,SAAU;IAAA,GAC5CF,SAAS;IAAAF,QAAA,EAEZA;EAAQ,CACQ,CAAC;AAExB","ignoreList":[]}
1
+ {"version":3,"names":["React","useCallback","useMemo","Platform","NativeLiquidGlass","NativePlatformComponentsTheme","jsx","_jsx","resolveLiquidGlassSupport","OS","supported","isLiquidGlassSupported","parseInt","String","Version","LiquidGlass","props","style","cornerRadius","ios","android","children","onPress","viewProps","nativeIos","undefined","effect","interactive","tintColor","colorScheme","nativeAndroid","fallbackBackgroundColor","handlePress","event","x","nativeEvent","y","onGlassPress"],"sourceRoot":"../../src","sources":["LiquidGlass.tsx"],"mappings":";;AAAA;AACA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,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B,OAAO,CAAC,MAAM;IAClC,IAAIC,QAAQ,CAACM,EAAE,KAAK,SAAS,IAAI,CAACW,OAAO,EAAE,OAAOK,SAAS;IAC3D,OAAO;MACLM,uBAAuB,EAAEX,OAAO,CAACW;IACnC,CAAC;EACH,CAAC,EAAE,CAACX,OAAO,CAAC,CAAC;;EAEb;EACA,MAAMY,WAAW,GAAG/B,WAAW,CAC5BgC,KAAgD,IAAK;IACpDX,OAAO,GAAG;MAAEY,CAAC,EAAED,KAAK,CAACE,WAAW,CAACD,CAAC;MAAEE,CAAC,EAAEH,KAAK,CAACE,WAAW,CAACC;IAAE,CAAC,CAAC;EAC/D,CAAC,EACD,CAACd,OAAO,CACV,CAAC;EAED,oBACEf,IAAA,CAACH,iBAAiB;IAChBa,KAAK,EAAEA,KAAM;IACbC,YAAY,EAAEA,YAAa;IAC3BC,GAAG,EAAEK,SAAU;IACfJ,OAAO,EAAEU,aAAc;IACvBO,YAAY,EAAEf,OAAO,GAAGU,WAAW,GAAGP,SAAU;IAAA,GAC5CF,SAAS;IAAAF,QAAA,EAEZA;EAAQ,CACQ,CAAC;AAExB","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  // LiquidGlassNativeComponent.ts
2
- import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
2
+ import type { HostComponent, ViewProps } from 'react-native';
3
3
  import { codegenNativeComponent } from 'react-native';
4
+ import type { DirectEventHandler, Float, WithDefault } from './codegenTypes';
4
5
 
5
6
  /**
6
7
  * Glass effect intensity/style.
@@ -64,9 +65,9 @@ export type LiquidGlassAndroidProps = Readonly<{
64
65
  */
65
66
  export type LiquidGlassPressEvent = Readonly<{
66
67
  /** X coordinate of touch relative to view bounds */
67
- x: CodegenTypes.Float;
68
+ x: Float;
68
69
  /** Y coordinate of touch relative to view bounds */
69
- y: CodegenTypes.Float;
70
+ y: Float;
70
71
  }>;
71
72
 
72
73
  export interface LiquidGlassNativeProps extends ViewProps {
@@ -75,7 +76,7 @@ export interface LiquidGlassNativeProps extends ViewProps {
75
76
  * Applied uniformly to all corners.
76
77
  * @default 0
77
78
  */
78
- cornerRadius?: CodegenTypes.WithDefault<CodegenTypes.Float, 0>;
79
+ cornerRadius?: WithDefault<Float, 0>;
79
80
 
80
81
  /**
81
82
  * iOS-specific props.
@@ -91,7 +92,7 @@ export interface LiquidGlassNativeProps extends ViewProps {
91
92
  * Fired when the glass view is pressed.
92
93
  * Includes touch coordinates relative to view bounds.
93
94
  */
94
- onGlassPress?: CodegenTypes.DirectEventHandler<LiquidGlassPressEvent>;
95
+ onGlassPress?: DirectEventHandler<LiquidGlassPressEvent>;
95
96
  }
96
97
 
97
98
  export default codegenNativeComponent<LiquidGlassNativeProps>(