react-native-platform-components 1.1.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 (113) hide show
  1. package/README.md +23 -12
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/platformcomponents/PCDatePickerView.kt +46 -2
  4. package/android/src/main/java/com/platformcomponents/PCNativeTheme.kt +174 -0
  5. package/android/src/main/java/com/platformcomponents/PCNativeThemeModule.kt +45 -0
  6. package/android/src/main/java/com/platformcomponents/PCSegmentedControlView.kt +36 -3
  7. package/android/src/main/java/com/platformcomponents/PCSelectionMenuView.kt +14 -0
  8. package/android/src/main/java/com/platformcomponents/PCThemeSupport.kt +40 -5
  9. package/android/src/main/java/com/platformcomponents/PlatformComponentsPackage.kt +25 -5
  10. package/android/src/main/jni/CMakeLists.txt +13 -1
  11. package/android/src/main/res/values/styles.xml +131 -0
  12. package/ios/PCNativeTheme.swift +56 -0
  13. package/ios/PCNativeThemeModule.mm +49 -0
  14. package/ios/PCSelectionMenu.swift +9 -1
  15. package/lib/commonjs/ContextMenuNativeComponent.ts +5 -4
  16. package/lib/commonjs/DatePickerNativeComponent.ts +17 -11
  17. package/lib/commonjs/LiquidGlass.js +24 -4
  18. package/lib/commonjs/LiquidGlass.js.map +1 -1
  19. package/lib/commonjs/LiquidGlassNativeComponent.ts +6 -5
  20. package/lib/commonjs/NativePlatformComponentsTheme.js +10 -0
  21. package/lib/commonjs/NativePlatformComponentsTheme.js.map +1 -0
  22. package/lib/commonjs/NativeTheme.js +51 -0
  23. package/lib/commonjs/NativeTheme.js.map +1 -0
  24. package/lib/commonjs/SegmentedControlNativeComponent.ts +12 -11
  25. package/lib/commonjs/SelectionMenuNativeComponent.ts +6 -5
  26. package/lib/commonjs/codegenTypes.js +6 -0
  27. package/lib/commonjs/codegenTypes.js.map +1 -0
  28. package/lib/commonjs/index.js +11 -0
  29. package/lib/commonjs/index.js.map +1 -1
  30. package/lib/commonjs/index.web.js +10 -1
  31. package/lib/commonjs/index.web.js.map +1 -1
  32. package/lib/module/ContextMenuNativeComponent.ts +5 -4
  33. package/lib/module/DatePickerNativeComponent.ts +17 -11
  34. package/lib/module/LiquidGlass.js +24 -4
  35. package/lib/module/LiquidGlass.js.map +1 -1
  36. package/lib/module/LiquidGlassNativeComponent.ts +6 -5
  37. package/lib/module/NativePlatformComponentsTheme.js +7 -0
  38. package/lib/module/NativePlatformComponentsTheme.js.map +1 -0
  39. package/lib/module/NativeTheme.js +45 -0
  40. package/lib/module/NativeTheme.js.map +1 -0
  41. package/lib/module/SegmentedControlNativeComponent.ts +12 -11
  42. package/lib/module/SelectionMenuNativeComponent.ts +6 -5
  43. package/lib/module/codegenTypes.js +4 -0
  44. package/lib/module/codegenTypes.js.map +1 -0
  45. package/lib/module/index.js +1 -0
  46. package/lib/module/index.js.map +1 -1
  47. package/lib/module/index.web.js +7 -0
  48. package/lib/module/index.web.js.map +1 -1
  49. package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts +5 -4
  50. package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts.map +1 -1
  51. package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts +12 -11
  52. package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts.map +1 -1
  53. package/lib/typescript/commonjs/src/LiquidGlass.d.ts +4 -3
  54. package/lib/typescript/commonjs/src/LiquidGlass.d.ts.map +1 -1
  55. package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts +6 -5
  56. package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts.map +1 -1
  57. package/lib/typescript/commonjs/src/NativePlatformComponentsTheme.d.ts +19 -0
  58. package/lib/typescript/commonjs/src/NativePlatformComponentsTheme.d.ts.map +1 -0
  59. package/lib/typescript/commonjs/src/NativeTheme.d.ts +30 -0
  60. package/lib/typescript/commonjs/src/NativeTheme.d.ts.map +1 -0
  61. package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts +7 -6
  62. package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts +6 -5
  64. package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/src/codegenTypes.d.ts +12 -0
  66. package/lib/typescript/commonjs/src/codegenTypes.d.ts.map +1 -0
  67. package/lib/typescript/commonjs/src/index.d.ts +1 -0
  68. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/src/index.web.d.ts +8 -1
  70. package/lib/typescript/commonjs/src/index.web.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/src/sharedTypes.d.ts +2 -2
  72. package/lib/typescript/commonjs/src/sharedTypes.d.ts.map +1 -1
  73. package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts +5 -4
  74. package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts.map +1 -1
  75. package/lib/typescript/module/src/DatePickerNativeComponent.d.ts +12 -11
  76. package/lib/typescript/module/src/DatePickerNativeComponent.d.ts.map +1 -1
  77. package/lib/typescript/module/src/LiquidGlass.d.ts +4 -3
  78. package/lib/typescript/module/src/LiquidGlass.d.ts.map +1 -1
  79. package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts +6 -5
  80. package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts.map +1 -1
  81. package/lib/typescript/module/src/NativePlatformComponentsTheme.d.ts +19 -0
  82. package/lib/typescript/module/src/NativePlatformComponentsTheme.d.ts.map +1 -0
  83. package/lib/typescript/module/src/NativeTheme.d.ts +30 -0
  84. package/lib/typescript/module/src/NativeTheme.d.ts.map +1 -0
  85. package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts +7 -6
  86. package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts.map +1 -1
  87. package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts +6 -5
  88. package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts.map +1 -1
  89. package/lib/typescript/module/src/codegenTypes.d.ts +12 -0
  90. package/lib/typescript/module/src/codegenTypes.d.ts.map +1 -0
  91. package/lib/typescript/module/src/index.d.ts +1 -0
  92. package/lib/typescript/module/src/index.d.ts.map +1 -1
  93. package/lib/typescript/module/src/index.web.d.ts +8 -1
  94. package/lib/typescript/module/src/index.web.d.ts.map +1 -1
  95. package/lib/typescript/module/src/sharedTypes.d.ts +2 -2
  96. package/lib/typescript/module/src/sharedTypes.d.ts.map +1 -1
  97. package/package.json +8 -4
  98. package/shared/PCDatePickerState-custom.h +2 -2
  99. package/shared/PCSegmentedControlState-custom.h +2 -2
  100. package/shared/PCSelectionMenuState-custom.h +2 -2
  101. package/src/ContextMenuNativeComponent.ts +5 -4
  102. package/src/DatePickerNativeComponent.ts +17 -11
  103. package/src/LiquidGlass.tsx +24 -5
  104. package/src/LiquidGlassNativeComponent.ts +6 -5
  105. package/src/NativePlatformComponentsTheme.ts +22 -0
  106. package/src/NativeTheme.ts +53 -0
  107. package/src/SegmentedControlNativeComponent.ts +12 -11
  108. package/src/SelectionMenuNativeComponent.ts +6 -5
  109. package/src/codegenTypes.ts +40 -0
  110. package/src/index.tsx +1 -0
  111. package/src/index.web.tsx +17 -1
  112. package/src/sharedTypes.ts +2 -2
  113. /package/{app.plugin.cjs → app.plugin.js} +0 -0
@@ -1,4 +1,5 @@
1
- import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ import type { BubblingEventHandler, Int32, WithDefault } from './codegenTypes.js';
2
3
  /**
3
4
  * A single option in the menu.
4
5
  */
@@ -11,7 +12,7 @@ export type SelectionMenuOption = Readonly<{
11
12
  */
12
13
  export type SelectionMenuSelectEvent = Readonly<{
13
14
  /** Selected option index (implementation detail; stable for this render) */
14
- index: CodegenTypes.Int32;
15
+ index: Int32;
15
16
  /** Selected option label */
16
17
  label: string;
17
18
  /** Selected option data payload (source of truth) */
@@ -44,7 +45,7 @@ export interface SelectionMenuProps extends ViewProps {
44
45
  * - Empty string means "no selection".
45
46
  * - Native should treat this as the single source of truth.
46
47
  */
47
- selectedData?: CodegenTypes.WithDefault<string, ''>;
48
+ selectedData?: WithDefault<string, ''>;
48
49
  /**
49
50
  * Enabled / disabled state.
50
51
  */
@@ -65,11 +66,11 @@ export interface SelectionMenuProps extends ViewProps {
65
66
  /**
66
67
  * Fired when the user selects an option.
67
68
  */
68
- onSelect?: CodegenTypes.BubblingEventHandler<SelectionMenuSelectEvent>;
69
+ onSelect?: BubblingEventHandler<SelectionMenuSelectEvent>;
69
70
  /**
70
71
  * Fired when dismissed without selection.
71
72
  */
72
- onRequestClose?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
73
+ onRequestClose?: BubblingEventHandler<Readonly<{}>>;
73
74
  ios?: IOSProps;
74
75
  android?: AndroidProps;
75
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionMenuNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/SelectionMenuNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG3E;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC9C,4EAA4E;IAC5E,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC;IAE1B,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IAEd,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,6CAA6C;AAC7C,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAErD,yCAAyC;AACzC,MAAM,MAAM,0BAA0B,GAAG,SAAS,GA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Ac,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAEpD,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;wBAII,aAAa,CAAC,kBAAkB,CAAC;AAFtC,wBAEuC"}
@@ -0,0 +1,12 @@
1
+ import type { NativeSyntheticEvent } from 'react-native';
2
+ export type BubblingEventHandler<T, _PaperName extends string | never = never> = (event: NativeSyntheticEvent<T>) => void | Promise<void>;
3
+ export type DirectEventHandler<T, _PaperName extends string | never = never> = (event: NativeSyntheticEvent<T>) => void | Promise<void>;
4
+ export type Double = number;
5
+ export type Float = number;
6
+ export type Int32 = number;
7
+ export type UnsafeObject = object;
8
+ export type UnsafeMixed = unknown;
9
+ type DefaultTypes = number | boolean | string | ReadonlyArray<string>;
10
+ export type WithDefault<Type extends DefaultTypes, _Value extends Type | string | undefined | null> = Type | undefined | null;
11
+ export {};
12
+ //# sourceMappingURL=codegenTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codegenTypes.d.ts","sourceRoot":"","sources":["../../../../src/codegenTypes.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAIzD,MAAM,MAAM,oBAAoB,CAC9B,CAAC,EACD,UAAU,SAAS,MAAM,GAAG,KAAK,GAAG,KAAK,IACvC,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE7D,MAAM,MAAM,kBAAkB,CAAC,CAAC,EAAE,UAAU,SAAS,MAAM,GAAG,KAAK,GAAG,KAAK,IAAI,CAC7E,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAG1B,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAC3B,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAC3B,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC;AAElC,KAAK,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,MAAM,WAAW,CACrB,IAAI,SAAS,YAAY,EACzB,MAAM,SAAS,IAAI,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,IAC7C,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC"}
@@ -4,4 +4,5 @@ export * from './ContextMenu.js';
4
4
  export * from './SegmentedControl.js';
5
5
  export * from './LiquidGlass.js';
6
6
  export * from './sharedTypes.js';
7
+ export * from './NativeTheme.js';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,iBAAc,CAAC;AAC7B,cAAc,oBAAiB,CAAC;AAChC,cAAc,kBAAe,CAAC;AAC9B,cAAc,uBAAoB,CAAC;AACnC,cAAc,kBAAe,CAAC;AAC9B,cAAc,kBAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,iBAAc,CAAC;AAC7B,cAAc,oBAAiB,CAAC;AAChC,cAAc,kBAAe,CAAC;AAC9B,cAAc,uBAAoB,CAAC;AACnC,cAAc,kBAAe,CAAC;AAC9B,cAAc,kBAAe,CAAC;AAC9B,cAAc,kBAAe,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { ReactNode } from 'react';
3
- import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
3
+ import type { ColorValue, StyleProp, ViewStyle, ViewProps } from 'react-native';
4
4
  export type Visible = 'open' | 'closed';
5
5
  export type Presentation = 'modal' | 'embedded';
6
6
  export type AndroidMaterialMode = 'system' | 'm3';
@@ -124,4 +124,11 @@ export interface LiquidGlassProps extends ViewProps {
124
124
  }
125
125
  export declare const LiquidGlass: ({ children, }: LiquidGlassProps) => React.ReactElement | null;
126
126
  export declare const isLiquidGlassSupported = false;
127
+ export type NativeTheme = {
128
+ colors: {
129
+ primary: ColorValue;
130
+ };
131
+ };
132
+ export declare const setNativeTheme: (_theme: NativeTheme | null) => void;
133
+ export declare const useNativeTheme: (_theme: NativeTheme | null | undefined) => void;
127
134
  //# sourceMappingURL=index.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/index.web.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpE,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AACxC,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AAChD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,IAAI,CAAC;AAMlD,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,GAAG,gBAAgB,CAAC;IAC1D,YAAY,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACpC,OAAO,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,sBAAsB,QAAQ,CAAC;AAM5C,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE;QACN,OAAO,EAAE,UAAU,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,WAAW,GAAG,IAAI,KAAG,IAAU,CAAC;AAEvE,eAAO,MAAM,cAAc,GACzB,QAAQ,WAAW,GAAG,IAAI,GAAG,SAAS,KACrC,IAAU,CAAC"}
@@ -1,4 +1,4 @@
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. */
@@ -8,5 +8,5 @@ export type AndroidMaterialMode = 'system' | 'm3';
8
8
  /** Common event empty payload type. */
9
9
  export type EmptyEvent = Readonly<{}>;
10
10
  /** Convenience alias (optional). */
11
- export type Bubbling<T> = CodegenTypes.BubblingEventHandler<T>;
11
+ export type Bubbling<T> = BubblingEventHandler<T>;
12
12
  //# 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,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,oBAAoB,CAAC,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-platform-components",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
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.",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/module/index.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",
@@ -188,12 +189,15 @@
188
189
  },
189
190
  "codegenConfig": {
190
191
  "name": "PlatformComponentsViewSpec",
191
- "type": "components",
192
+ "type": "all",
192
193
  "jsSrcsDir": "src",
193
194
  "android": {
194
195
  "javaPackageName": "com.platformcomponents"
195
196
  },
196
197
  "ios": {
198
+ "modulesProvider": {
199
+ "PlatformComponentsTheme": "PCNativeThemeModule"
200
+ },
197
201
  "componentProvider": {
198
202
  "PCSelectionMenu": "PCSelectionMenu",
199
203
  "PCDatePicker": "PCDatePicker",
@@ -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,
@@ -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>(
@@ -7,6 +7,7 @@ import NativeLiquidGlass, {
7
7
  type LiquidGlassEffect,
8
8
  type LiquidGlassPressEvent,
9
9
  } from './LiquidGlassNativeComponent';
10
+ import NativePlatformComponentsTheme from './NativePlatformComponentsTheme';
10
11
 
11
12
  export type {
12
13
  LiquidGlassEffect,
@@ -14,14 +15,32 @@ export type {
14
15
  LiquidGlassPressEvent,
15
16
  };
16
17
 
18
+ function resolveLiquidGlassSupport(): boolean {
19
+ if (Platform.OS !== 'ios') {
20
+ return false;
21
+ }
22
+ try {
23
+ // The native module answers for this build: Liquid Glass is compiled out
24
+ // when the library is built with an Xcode that predates the iOS 26 SDK,
25
+ // and then no device version makes it available.
26
+ const supported = NativePlatformComponentsTheme?.isLiquidGlassSupported();
27
+ if (typeof supported === 'boolean') {
28
+ return supported;
29
+ }
30
+ } catch {
31
+ // Native module not available (web, tests): fall back to the OS version.
32
+ }
33
+ return parseInt(String(Platform.Version), 10) >= 26;
34
+ }
35
+
17
36
  /**
18
- * Whether the LiquidGlass effect is supported on the current device.
19
- * Returns true on iOS 26+ (with Liquid Glass support), false otherwise.
37
+ * Whether the LiquidGlass effect is supported here: iOS 26 or newer, in a
38
+ * build compiled against the iOS 26 SDK. False on Android, on older iOS, and
39
+ * in builds made with an older Xcode, where the views fall back to a blur.
20
40
  *
21
- * Use this to conditionally render fallback UI on unsupported devices.
41
+ * Use this to conditionally render fallback UI.
22
42
  */
23
- export const isLiquidGlassSupported: boolean =
24
- Platform.OS === 'ios' && parseInt(String(Platform.Version), 10) >= 26;
43
+ export const isLiquidGlassSupported: boolean = resolveLiquidGlassSupport();
25
44
 
26
45
  export interface LiquidGlassProps extends ViewProps {
27
46
  /**
@@ -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>(
@@ -0,0 +1,22 @@
1
+ // NativePlatformComponentsTheme.ts
2
+ import type { TurboModule } from 'react-native';
3
+ import { TurboModuleRegistry } from 'react-native';
4
+ import type { UnsafeObject } from './codegenTypes';
5
+
6
+ export interface Spec extends TurboModule {
7
+ /**
8
+ * `{ primary }`, where `primary` is a color from `processColor`. An empty
9
+ * object restores the app's own theme colors.
10
+ */
11
+ setTheme(theme: UnsafeObject): void;
12
+
13
+ /**
14
+ * Whether this build can render Liquid Glass: true only when the library was
15
+ * compiled against the iOS 26 SDK *and* the device runs iOS 26 or newer.
16
+ * Built with an older Xcode, the glass code is compiled out and the views
17
+ * fall back to a blur, so the device version alone cannot answer this.
18
+ */
19
+ isLiquidGlassSupported(): boolean;
20
+ }
21
+
22
+ export default TurboModuleRegistry.get<Spec>('PlatformComponentsTheme');
@@ -0,0 +1,53 @@
1
+ // NativeTheme.ts
2
+ import { useLayoutEffect } from 'react';
3
+ import { processColor, type ColorValue } from 'react-native';
4
+
5
+ import NativePlatformComponentsTheme from './NativePlatformComponentsTheme';
6
+
7
+ /**
8
+ * The part of an app theme that is applied to the native platform theme. A
9
+ * React Navigation theme has this shape, so it can be passed as is.
10
+ */
11
+ export type NativeTheme = {
12
+ colors: {
13
+ /**
14
+ * Brand color. Android generates a Material 3 color scheme from it for
15
+ * light and dark mode (Android 13+); iOS uses it as the tint color.
16
+ */
17
+ primary: ColorValue;
18
+ };
19
+ };
20
+
21
+ function applyProcessedPrimary(primary: unknown): void {
22
+ NativePlatformComponentsTheme?.setTheme(primary == null ? {} : { primary });
23
+ }
24
+
25
+ /**
26
+ * Applies the theme's brand color to the native platform theme, app-wide:
27
+ * these components and other native views that use the theme colors (the
28
+ * window tint color on iOS, the Material theme on Android). Pass `null` to
29
+ * restore the app's own theme colors.
30
+ *
31
+ * Light and dark mode follow the native appearance; use
32
+ * `Appearance.setColorScheme` to change it from JavaScript.
33
+ */
34
+ export function setNativeTheme(theme: NativeTheme | null): void {
35
+ applyProcessedPrimary(theme ? processColor(theme.colors.primary) : null);
36
+ }
37
+
38
+ /**
39
+ * Keeps the native platform theme's brand color in sync with `theme`. Call it
40
+ * once, near the root of the app. See {@link setNativeTheme}.
41
+ */
42
+ export function useNativeTheme(theme: NativeTheme | null | undefined): void {
43
+ // Processed colors are numbers or plain objects (PlatformColor,
44
+ // DynamicColorIOS); compare them by value so a theme object recreated on
45
+ // every render does not re-apply the same color.
46
+ const primary = JSON.stringify(
47
+ theme ? (processColor(theme.colors.primary) ?? null) : null
48
+ );
49
+
50
+ useLayoutEffect(() => {
51
+ applyProcessedPrimary(JSON.parse(primary));
52
+ }, [primary]);
53
+ }
@@ -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,40 @@
1
+ // codegenTypes.ts
2
+ //
3
+ // Local mirror of React Native's `CodegenTypes`.
4
+ //
5
+ // Codegen resolves these names lexically — it matches the identifier used in a
6
+ // spec (`Int32`, `WithDefault`, ...) and never follows the import to its
7
+ // source. Declaring them here therefore produces exactly the same schema as
8
+ // importing them from React Native, while staying parseable by the codegen
9
+ // shipped with older releases: the `CodegenTypes.Int32` namespace form is only
10
+ // understood by React Native 0.80+, and the pre-0.80 deep import
11
+ // (`react-native/Libraries/Types/CodegenTypes`) no longer type-checks on 0.86.
12
+ //
13
+ // Keep these definitions in sync with
14
+ // `react-native/Libraries/Types/CodegenTypesNamespace.d.ts`.
15
+ import type { NativeSyntheticEvent } from 'react-native';
16
+
17
+ // Event types. The `_PaperName` parameter is unused by the New Architecture; it
18
+ // is kept so the signatures match React Native's.
19
+ export type BubblingEventHandler<
20
+ T,
21
+ _PaperName extends string | never = never,
22
+ > = (event: NativeSyntheticEvent<T>) => void | Promise<void>;
23
+
24
+ export type DirectEventHandler<T, _PaperName extends string | never = never> = (
25
+ event: NativeSyntheticEvent<T>
26
+ ) => void | Promise<void>;
27
+
28
+ // Prop types.
29
+ export type Double = number;
30
+ export type Float = number;
31
+ export type Int32 = number;
32
+ export type UnsafeObject = object;
33
+ export type UnsafeMixed = unknown;
34
+
35
+ type DefaultTypes = number | boolean | string | ReadonlyArray<string>;
36
+
37
+ export type WithDefault<
38
+ Type extends DefaultTypes,
39
+ _Value extends Type | string | undefined | null,
40
+ > = Type | undefined | null;
package/src/index.tsx CHANGED
@@ -4,3 +4,4 @@ export * from './ContextMenu';
4
4
  export * from './SegmentedControl';
5
5
  export * from './LiquidGlass';
6
6
  export * from './sharedTypes';
7
+ export * from './NativeTheme';