react-native-platform-components 1.1.0 → 1.2.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 (49) hide show
  1. package/README.md +14 -11
  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 +42 -0
  6. package/android/src/main/java/com/platformcomponents/PCSegmentedControlView.kt +34 -1
  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 +22 -5
  10. package/android/src/main/res/values/styles.xml +131 -0
  11. package/ios/PCNativeTheme.swift +56 -0
  12. package/ios/PCNativeThemeModule.mm +36 -0
  13. package/lib/commonjs/NativePlatformComponentsTheme.js +10 -0
  14. package/lib/commonjs/NativePlatformComponentsTheme.js.map +1 -0
  15. package/lib/commonjs/NativeTheme.js +51 -0
  16. package/lib/commonjs/NativeTheme.js.map +1 -0
  17. package/lib/commonjs/index.js +11 -0
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/commonjs/index.web.js +10 -1
  20. package/lib/commonjs/index.web.js.map +1 -1
  21. package/lib/module/NativePlatformComponentsTheme.js +7 -0
  22. package/lib/module/NativePlatformComponentsTheme.js.map +1 -0
  23. package/lib/module/NativeTheme.js +45 -0
  24. package/lib/module/NativeTheme.js.map +1 -0
  25. package/lib/module/index.js +1 -0
  26. package/lib/module/index.js.map +1 -1
  27. package/lib/module/index.web.js +7 -0
  28. package/lib/module/index.web.js.map +1 -1
  29. package/lib/typescript/commonjs/src/NativePlatformComponentsTheme.d.ts +11 -0
  30. package/lib/typescript/commonjs/src/NativePlatformComponentsTheme.d.ts.map +1 -0
  31. package/lib/typescript/commonjs/src/NativeTheme.d.ts +30 -0
  32. package/lib/typescript/commonjs/src/NativeTheme.d.ts.map +1 -0
  33. package/lib/typescript/commonjs/src/index.d.ts +1 -0
  34. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  35. package/lib/typescript/commonjs/src/index.web.d.ts +8 -1
  36. package/lib/typescript/commonjs/src/index.web.d.ts.map +1 -1
  37. package/lib/typescript/module/src/NativePlatformComponentsTheme.d.ts +11 -0
  38. package/lib/typescript/module/src/NativePlatformComponentsTheme.d.ts.map +1 -0
  39. package/lib/typescript/module/src/NativeTheme.d.ts +30 -0
  40. package/lib/typescript/module/src/NativeTheme.d.ts.map +1 -0
  41. package/lib/typescript/module/src/index.d.ts +1 -0
  42. package/lib/typescript/module/src/index.d.ts.map +1 -1
  43. package/lib/typescript/module/src/index.web.d.ts +8 -1
  44. package/lib/typescript/module/src/index.web.d.ts.map +1 -1
  45. package/package.json +5 -2
  46. package/src/NativePlatformComponentsTheme.ts +13 -0
  47. package/src/NativeTheme.ts +53 -0
  48. package/src/index.tsx +1 -0
  49. package/src/index.web.tsx +17 -1
@@ -37,4 +37,135 @@
37
37
  <item name="imageButtonStyle">@style/Widget.Material3.MaterialTimePicker.ImageButton</item>
38
38
  <item name="materialTimePickerTitleStyle">@style/TextAppearance.Material3.MaterialTimePicker.Title</item>
39
39
  </style>
40
+
41
+ <!--
42
+ Native theme (useNativeTheme / setNativeTheme, see PCNativeTheme). DynamicColors
43
+ overrides Material's "personalized" color resources with the scheme generated from
44
+ the brand color and applies ThemeOverlay.Material3.PersonalizedColors to the
45
+ activity. This overlay points the accent attributes that platform and AppCompat
46
+ widgets (DatePicker, TimePicker, Spinner) read at the primary color (the
47
+ personalized control color is a light tone that white labels don't contrast
48
+ with), and is re-applied over the Material 3 fallback contexts, which would
49
+ otherwise reset the colors.
50
+ -->
51
+ <style name="PCNativeThemeOverlay" parent="ThemeOverlay.Material3.PersonalizedColors">
52
+ <item name="colorAccent">?attr/colorPrimary</item>
53
+ <item name="android:colorAccent">?attr/colorPrimary</item>
54
+ <item name="android:colorControlActivated">?attr/colorPrimary</item>
55
+ </style>
56
+
57
+ <!--
58
+ The fallback dialog themes are full themes, so they would also reset the colors;
59
+ these variants carry the PCNativeThemeOverlay items (a style has one parent, so
60
+ they are repeated here).
61
+ -->
62
+ <style name="PCMaterial3CalendarDialogTheme.NativeTheme">
63
+ <item name="colorPrimary">@color/material_personalized_color_primary</item>
64
+ <item name="colorOnPrimary">@color/material_personalized_color_on_primary</item>
65
+ <item name="colorPrimaryInverse">@color/material_personalized_color_primary_inverse</item>
66
+ <item name="colorPrimaryContainer">@color/material_personalized_color_primary_container</item>
67
+ <item name="colorOnPrimaryContainer">@color/material_personalized_color_on_primary_container</item>
68
+ <item name="colorSecondary">@color/material_personalized_color_secondary</item>
69
+ <item name="colorOnSecondary">@color/material_personalized_color_on_secondary</item>
70
+ <item name="colorSecondaryContainer">@color/material_personalized_color_secondary_container</item>
71
+ <item name="colorOnSecondaryContainer">@color/material_personalized_color_on_secondary_container</item>
72
+ <item name="colorTertiary">@color/material_personalized_color_tertiary</item>
73
+ <item name="colorOnTertiary">@color/material_personalized_color_on_tertiary</item>
74
+ <item name="colorTertiaryContainer">@color/material_personalized_color_tertiary_container</item>
75
+ <item name="colorOnTertiaryContainer">@color/material_personalized_color_on_tertiary_container</item>
76
+ <item name="android:colorBackground">@color/material_personalized_color_background</item>
77
+ <item name="colorOnBackground">@color/material_personalized_color_on_background</item>
78
+ <item name="colorSurface">@color/material_personalized_color_surface</item>
79
+ <item name="colorOnSurface">@color/material_personalized_color_on_surface</item>
80
+ <item name="colorSurfaceVariant">@color/material_personalized_color_surface_variant</item>
81
+ <item name="colorOnSurfaceVariant">@color/material_personalized_color_on_surface_variant</item>
82
+ <item name="colorSurfaceInverse">@color/material_personalized_color_surface_inverse</item>
83
+ <item name="colorOnSurfaceInverse">@color/material_personalized_color_on_surface_inverse</item>
84
+ <item name="colorSurfaceBright">@color/material_personalized_color_surface_bright</item>
85
+ <item name="colorSurfaceDim">@color/material_personalized_color_surface_dim</item>
86
+ <item name="colorSurfaceContainer">@color/material_personalized_color_surface_container</item>
87
+ <item name="colorSurfaceContainerLow">@color/material_personalized_color_surface_container_low</item>
88
+ <item name="colorSurfaceContainerHigh">@color/material_personalized_color_surface_container_high</item>
89
+ <item name="colorSurfaceContainerLowest">@color/material_personalized_color_surface_container_lowest</item>
90
+ <item name="colorSurfaceContainerHighest">@color/material_personalized_color_surface_container_highest</item>
91
+ <item name="colorOutline">@color/material_personalized_color_outline</item>
92
+ <item name="colorOutlineVariant">@color/material_personalized_color_outline_variant</item>
93
+ <item name="colorError">@color/material_personalized_color_error</item>
94
+ <item name="colorOnError">@color/material_personalized_color_on_error</item>
95
+ <item name="colorErrorContainer">@color/material_personalized_color_error_container</item>
96
+ <item name="colorOnErrorContainer">@color/material_personalized_color_on_error_container</item>
97
+ <item name="android:textColorPrimary">@color/material_personalized_color_primary_text</item>
98
+ <item name="android:textColorPrimaryInverse">@color/material_personalized_color_primary_text_inverse</item>
99
+ <item name="android:textColorSecondary">@color/material_personalized_color_secondary_text</item>
100
+ <item name="android:textColorSecondaryInverse">@color/material_personalized_color_secondary_text_inverse</item>
101
+ <item name="android:textColorTertiary">@color/material_personalized_color_secondary_text</item>
102
+ <item name="android:textColorTertiaryInverse">@color/material_personalized_color_secondary_text_inverse</item>
103
+ <item name="android:textColorPrimaryDisableOnly">@color/material_personalized_primary_text_disable_only</item>
104
+ <item name="android:textColorPrimaryInverseDisableOnly">@color/material_personalized_primary_inverse_text_disable_only</item>
105
+ <item name="android:textColorHint">@color/material_personalized_hint_foreground</item>
106
+ <item name="android:textColorHintInverse">@color/material_personalized_hint_foreground_inverse</item>
107
+ <item name="android:textColorHighlight">@color/material_personalized__highlighted_text</item>
108
+ <item name="android:textColorHighlightInverse">@color/material_personalized__highlighted_text_inverse</item>
109
+ <item name="android:textColorAlertDialogListItem">@color/material_personalized_color_primary_text</item>
110
+ <item name="android:colorControlNormal">@color/material_personalized_color_control_normal</item>
111
+ <item name="android:colorControlHighlight">@color/material_personalized_color_control_highlight</item>
112
+ <item name="colorAccent">?attr/colorPrimary</item>
113
+ <item name="android:colorAccent">?attr/colorPrimary</item>
114
+ <item name="android:colorControlActivated">?attr/colorPrimary</item>
115
+ </style>
116
+
117
+ <style name="PCMaterial3TimePickerDialogTheme.NativeTheme">
118
+ <item name="colorPrimary">@color/material_personalized_color_primary</item>
119
+ <item name="colorOnPrimary">@color/material_personalized_color_on_primary</item>
120
+ <item name="colorPrimaryInverse">@color/material_personalized_color_primary_inverse</item>
121
+ <item name="colorPrimaryContainer">@color/material_personalized_color_primary_container</item>
122
+ <item name="colorOnPrimaryContainer">@color/material_personalized_color_on_primary_container</item>
123
+ <item name="colorSecondary">@color/material_personalized_color_secondary</item>
124
+ <item name="colorOnSecondary">@color/material_personalized_color_on_secondary</item>
125
+ <item name="colorSecondaryContainer">@color/material_personalized_color_secondary_container</item>
126
+ <item name="colorOnSecondaryContainer">@color/material_personalized_color_on_secondary_container</item>
127
+ <item name="colorTertiary">@color/material_personalized_color_tertiary</item>
128
+ <item name="colorOnTertiary">@color/material_personalized_color_on_tertiary</item>
129
+ <item name="colorTertiaryContainer">@color/material_personalized_color_tertiary_container</item>
130
+ <item name="colorOnTertiaryContainer">@color/material_personalized_color_on_tertiary_container</item>
131
+ <item name="android:colorBackground">@color/material_personalized_color_background</item>
132
+ <item name="colorOnBackground">@color/material_personalized_color_on_background</item>
133
+ <item name="colorSurface">@color/material_personalized_color_surface</item>
134
+ <item name="colorOnSurface">@color/material_personalized_color_on_surface</item>
135
+ <item name="colorSurfaceVariant">@color/material_personalized_color_surface_variant</item>
136
+ <item name="colorOnSurfaceVariant">@color/material_personalized_color_on_surface_variant</item>
137
+ <item name="colorSurfaceInverse">@color/material_personalized_color_surface_inverse</item>
138
+ <item name="colorOnSurfaceInverse">@color/material_personalized_color_on_surface_inverse</item>
139
+ <item name="colorSurfaceBright">@color/material_personalized_color_surface_bright</item>
140
+ <item name="colorSurfaceDim">@color/material_personalized_color_surface_dim</item>
141
+ <item name="colorSurfaceContainer">@color/material_personalized_color_surface_container</item>
142
+ <item name="colorSurfaceContainerLow">@color/material_personalized_color_surface_container_low</item>
143
+ <item name="colorSurfaceContainerHigh">@color/material_personalized_color_surface_container_high</item>
144
+ <item name="colorSurfaceContainerLowest">@color/material_personalized_color_surface_container_lowest</item>
145
+ <item name="colorSurfaceContainerHighest">@color/material_personalized_color_surface_container_highest</item>
146
+ <item name="colorOutline">@color/material_personalized_color_outline</item>
147
+ <item name="colorOutlineVariant">@color/material_personalized_color_outline_variant</item>
148
+ <item name="colorError">@color/material_personalized_color_error</item>
149
+ <item name="colorOnError">@color/material_personalized_color_on_error</item>
150
+ <item name="colorErrorContainer">@color/material_personalized_color_error_container</item>
151
+ <item name="colorOnErrorContainer">@color/material_personalized_color_on_error_container</item>
152
+ <item name="android:textColorPrimary">@color/material_personalized_color_primary_text</item>
153
+ <item name="android:textColorPrimaryInverse">@color/material_personalized_color_primary_text_inverse</item>
154
+ <item name="android:textColorSecondary">@color/material_personalized_color_secondary_text</item>
155
+ <item name="android:textColorSecondaryInverse">@color/material_personalized_color_secondary_text_inverse</item>
156
+ <item name="android:textColorTertiary">@color/material_personalized_color_secondary_text</item>
157
+ <item name="android:textColorTertiaryInverse">@color/material_personalized_color_secondary_text_inverse</item>
158
+ <item name="android:textColorPrimaryDisableOnly">@color/material_personalized_primary_text_disable_only</item>
159
+ <item name="android:textColorPrimaryInverseDisableOnly">@color/material_personalized_primary_inverse_text_disable_only</item>
160
+ <item name="android:textColorHint">@color/material_personalized_hint_foreground</item>
161
+ <item name="android:textColorHintInverse">@color/material_personalized_hint_foreground_inverse</item>
162
+ <item name="android:textColorHighlight">@color/material_personalized__highlighted_text</item>
163
+ <item name="android:textColorHighlightInverse">@color/material_personalized__highlighted_text_inverse</item>
164
+ <item name="android:textColorAlertDialogListItem">@color/material_personalized_color_primary_text</item>
165
+ <item name="android:colorControlNormal">@color/material_personalized_color_control_normal</item>
166
+ <item name="android:colorControlHighlight">@color/material_personalized_color_control_highlight</item>
167
+ <item name="colorAccent">?attr/colorPrimary</item>
168
+ <item name="android:colorAccent">?attr/colorPrimary</item>
169
+ <item name="android:colorControlActivated">?attr/colorPrimary</item>
170
+ </style>
40
171
  </resources>
@@ -0,0 +1,56 @@
1
+ import UIKit
2
+
3
+ /// The native theme set from JS with `useNativeTheme` / `setNativeTheme`.
4
+ ///
5
+ /// The brand color becomes the tint color of every window, which UIKit views inherit:
6
+ /// these components, alerts, text input cursors. Windows that appear later (an alert's
7
+ /// window, for example) are tinted when they become visible. Clearing the color resets
8
+ /// the tinted windows to UIKit's default tint (the app's accent color, if it has one).
9
+ ///
10
+ /// Light and dark mode need nothing here: UIKit views follow the window's appearance,
11
+ /// including `Appearance.setColorScheme`.
12
+ @objc(PCNativeTheme)
13
+ public final class PCNativeTheme: NSObject {
14
+ @objc public static let shared = PCNativeTheme()
15
+
16
+ private var primaryColor: UIColor?
17
+ private var windowObserver: NSObjectProtocol?
18
+ private let tintedWindows = NSHashTable<UIWindow>.weakObjects()
19
+
20
+ /// Main thread only.
21
+ @objc public func setPrimaryColor(_ color: UIColor?) {
22
+ primaryColor = color
23
+
24
+ guard let color else {
25
+ for window in tintedWindows.allObjects {
26
+ window.tintColor = nil
27
+ }
28
+ tintedWindows.removeAllObjects()
29
+ return
30
+ }
31
+
32
+ if windowObserver == nil {
33
+ windowObserver = NotificationCenter.default.addObserver(
34
+ forName: UIWindow.didBecomeVisibleNotification,
35
+ object: nil,
36
+ queue: .main
37
+ ) { [weak self] notification in
38
+ guard let self, let window = notification.object as? UIWindow,
39
+ let color = self.primaryColor else { return }
40
+ self.tint(window, with: color)
41
+ }
42
+ }
43
+
44
+ let windows = UIApplication.shared.connectedScenes
45
+ .compactMap { $0 as? UIWindowScene }
46
+ .flatMap { $0.windows }
47
+ for window in windows {
48
+ tint(window, with: color)
49
+ }
50
+ }
51
+
52
+ private func tint(_ window: UIWindow, with color: UIColor) {
53
+ window.tintColor = color
54
+ tintedWindows.add(window)
55
+ }
56
+ }
@@ -0,0 +1,36 @@
1
+ // ios/PCNativeThemeModule.mm
2
+
3
+ #import <PlatformComponentsViewSpec/PlatformComponentsViewSpec.h>
4
+ #import <React/RCTConvert.h>
5
+
6
+ #if __has_include(<PlatformComponents/PlatformComponents-Swift.h>)
7
+ #import <PlatformComponents/PlatformComponents-Swift.h>
8
+ #else
9
+ #import "PlatformComponents-Swift.h"
10
+ #endif
11
+
12
+ /// `setNativeTheme` / `useNativeTheme` on iOS. See PCNativeTheme.swift.
13
+ @interface PCNativeThemeModule : NSObject <NativePlatformComponentsThemeSpec>
14
+ @end
15
+
16
+ @implementation PCNativeThemeModule
17
+
18
+ RCT_EXPORT_MODULE(PlatformComponentsTheme)
19
+
20
+ - (void)setTheme:(NSDictionary *)theme
21
+ {
22
+ id primary = theme[@"primary"];
23
+ dispatch_async(dispatch_get_main_queue(), ^{
24
+ // Resolves PlatformColor and DynamicColorIOS values as well as plain colors.
25
+ UIColor *color = primary == nil || primary == [NSNull null] ? nil : [RCTConvert UIColor:primary];
26
+ [PCNativeTheme.shared setPrimaryColor:color];
27
+ });
28
+ }
29
+
30
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
31
+ (const facebook::react::ObjCTurboModule::InitParams &)params
32
+ {
33
+ return std::make_shared<facebook::react::NativePlatformComponentsThemeSpecJSI>(params);
34
+ }
35
+
36
+ @end
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ // NativePlatformComponentsTheme.ts
9
+ var _default = exports.default = _reactNative.TurboModuleRegistry.get('PlatformComponentsTheme');
10
+ //# sourceMappingURL=NativePlatformComponentsTheme.js.map
@@ -0,0 +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":[]}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.setNativeTheme = setNativeTheme;
7
+ exports.useNativeTheme = useNativeTheme;
8
+ var _react = require("react");
9
+ var _reactNative = require("react-native");
10
+ var _NativePlatformComponentsTheme = _interopRequireDefault(require("./NativePlatformComponentsTheme"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ // NativeTheme.ts
13
+
14
+ /**
15
+ * The part of an app theme that is applied to the native platform theme. A
16
+ * React Navigation theme has this shape, so it can be passed as is.
17
+ */
18
+
19
+ function applyProcessedPrimary(primary) {
20
+ _NativePlatformComponentsTheme.default?.setTheme(primary == null ? {} : {
21
+ primary
22
+ });
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
+ function setNativeTheme(theme) {
35
+ applyProcessedPrimary(theme ? (0, _reactNative.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
+ function useNativeTheme(theme) {
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(theme ? (0, _reactNative.processColor)(theme.colors.primary) ?? null : null);
47
+ (0, _react.useLayoutEffect)(() => {
48
+ applyProcessedPrimary(JSON.parse(primary));
49
+ }, [primary]);
50
+ }
51
+ //# sourceMappingURL=NativeTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_NativePlatformComponentsTheme","_interopRequireDefault","e","__esModule","default","applyProcessedPrimary","primary","NativePlatformComponentsTheme","setTheme","setNativeTheme","theme","processColor","colors","useNativeTheme","JSON","stringify","useLayoutEffect","parse"],"sourceRoot":"../../src","sources":["NativeTheme.ts"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,8BAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA4E,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAJ5E;;AAMA;AACA;AACA;AACA;;AAWA,SAASG,qBAAqBA,CAACC,OAAgB,EAAQ;EACrDC,sCAA6B,EAAEC,QAAQ,CAACF,OAAO,IAAI,IAAI,GAAG,CAAC,CAAC,GAAG;IAAEA;EAAQ,CAAC,CAAC;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,cAAcA,CAACC,KAAyB,EAAQ;EAC9DL,qBAAqB,CAACK,KAAK,GAAG,IAAAC,yBAAY,EAACD,KAAK,CAACE,MAAM,CAACN,OAAO,CAAC,GAAG,IAAI,CAAC;AAC1E;;AAEA;AACA;AACA;AACA;AACO,SAASO,cAAcA,CAACH,KAAqC,EAAQ;EAC1E;EACA;EACA;EACA,MAAMJ,OAAO,GAAGQ,IAAI,CAACC,SAAS,CAC5BL,KAAK,GAAI,IAAAC,yBAAY,EAACD,KAAK,CAACE,MAAM,CAACN,OAAO,CAAC,IAAI,IAAI,GAAI,IACzD,CAAC;EAED,IAAAU,sBAAe,EAAC,MAAM;IACpBX,qBAAqB,CAACS,IAAI,CAACG,KAAK,CAACX,OAAO,CAAC,CAAC;EAC5C,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;AACf","ignoreList":[]}
@@ -69,4 +69,15 @@ Object.keys(_sharedTypes).forEach(function (key) {
69
69
  }
70
70
  });
71
71
  });
72
+ var _NativeTheme = require("./NativeTheme");
73
+ Object.keys(_NativeTheme).forEach(function (key) {
74
+ if (key === "default" || key === "__esModule") return;
75
+ if (key in exports && exports[key] === _NativeTheme[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _NativeTheme[key];
80
+ }
81
+ });
82
+ });
72
83
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_DatePicker","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_SelectionMenu","_ContextMenu","_SegmentedControl","_LiquidGlass","_sharedTypes"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,cAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,cAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,cAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAA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,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,YAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,YAAA,CAAAT,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_DatePicker","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_SelectionMenu","_ContextMenu","_SegmentedControl","_LiquidGlass","_sharedTypes","_NativeTheme"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,cAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,cAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,cAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,cAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,YAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,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S,YAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,YAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,YAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,YAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,YAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAM,YAAA,CAAAV,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isLiquidGlassSupported = exports.SelectionMenu = exports.SegmentedControl = exports.LiquidGlass = exports.DatePicker = exports.ContextMenu = void 0;
6
+ exports.useNativeTheme = exports.setNativeTheme = exports.isLiquidGlassSupported = exports.SelectionMenu = exports.SegmentedControl = exports.LiquidGlass = exports.DatePicker = exports.ContextMenu = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _jsxRuntime = require("react/jsx-runtime");
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -59,4 +59,13 @@ const LiquidGlass = ({
59
59
  };
60
60
  exports.LiquidGlass = LiquidGlass;
61
61
  const isLiquidGlassSupported = exports.isLiquidGlassSupported = false;
62
+
63
+ // ============================================================================
64
+ // Native theme
65
+ // ============================================================================
66
+
67
+ const setNativeTheme = _theme => {};
68
+ exports.setNativeTheme = setNativeTheme;
69
+ const useNativeTheme = _theme => {};
70
+ exports.useNativeTheme = useNativeTheme;
62
71
  //# sourceMappingURL=index.web.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_jsxRuntime","e","__esModule","default","DatePicker","_props","exports","SelectionMenu","ContextMenu","children","jsx","Fragment","SegmentedControl","LiquidGlass","isLiquidGlassSupported"],"sourceRoot":"../../src","sources":["index.web.tsx"],"mappings":";;;;;;AAKA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAL1B;AACA;AACA;AACA;;AAMA;AACA;AACA;;AAMA;AACA;AACA;;AAoBO,MAAMG,UAAU,GACrBC,MAAuB,IACO,IAAI;;AAEpC;AACA;AACA;AAAAC,OAAA,CAAAF,UAAA,GAAAA,UAAA;AAoBO,MAAMG,aAAa,GACxBF,MAA0B,IACI,IAAI;;AAEpC;AACA;AACA;AAAAC,OAAA,CAAAC,aAAA,GAAAA,aAAA;AAgCO,MAAMC,WAAW,GAAGA,CAAC;EAC1BC;AACgB,CAAC,KAAgC;EACjD,oBAAO,IAAAT,WAAA,CAAAU,GAAA,EAAAV,WAAA,CAAAW,QAAA;IAAAF,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;;AAED;AACA;AACA;AAAAH,OAAA,CAAAE,WAAA,GAAAA,WAAA;AAmDO,MAAMI,gBAAgB,GAC3BP,MAA6B,IACC,IAAI;;AAEpC;AACA;AACA;AAAAC,OAAA,CAAAM,gBAAA,GAAAA,gBAAA;AASO,MAAMC,WAAW,GAAGA,CAAC;EAC1BJ;AACgB,CAAC,KAAgC;EACjD,oBAAO,IAAAT,WAAA,CAAAU,GAAA,EAAAV,WAAA,CAAAW,QAAA;IAAAF,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;AAACH,OAAA,CAAAO,WAAA,GAAAA,WAAA;AAEK,MAAMC,sBAAsB,GAAAR,OAAA,CAAAQ,sBAAA,GAAG,KAAK","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_jsxRuntime","e","__esModule","default","DatePicker","_props","exports","SelectionMenu","ContextMenu","children","jsx","Fragment","SegmentedControl","LiquidGlass","isLiquidGlassSupported","setNativeTheme","_theme","useNativeTheme"],"sourceRoot":"../../src","sources":["index.web.tsx"],"mappings":";;;;;;AAKA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAL1B;AACA;AACA;AACA;;AAMA;AACA;AACA;;AAMA;AACA;AACA;;AAoBO,MAAMG,UAAU,GACrBC,MAAuB,IACO,IAAI;;AAEpC;AACA;AACA;AAAAC,OAAA,CAAAF,UAAA,GAAAA,UAAA;AAoBO,MAAMG,aAAa,GACxBF,MAA0B,IACI,IAAI;;AAEpC;AACA;AACA;AAAAC,OAAA,CAAAC,aAAA,GAAAA,aAAA;AAgCO,MAAMC,WAAW,GAAGA,CAAC;EAC1BC;AACgB,CAAC,KAAgC;EACjD,oBAAO,IAAAT,WAAA,CAAAU,GAAA,EAAAV,WAAA,CAAAW,QAAA;IAAAF,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;;AAED;AACA;AACA;AAAAH,OAAA,CAAAE,WAAA,GAAAA,WAAA;AAmDO,MAAMI,gBAAgB,GAC3BP,MAA6B,IACC,IAAI;;AAEpC;AACA;AACA;AAAAC,OAAA,CAAAM,gBAAA,GAAAA,gBAAA;AASO,MAAMC,WAAW,GAAGA,CAAC;EAC1BJ;AACgB,CAAC,KAAgC;EACjD,oBAAO,IAAAT,WAAA,CAAAU,GAAA,EAAAV,WAAA,CAAAW,QAAA;IAAAF,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;AAACH,OAAA,CAAAO,WAAA,GAAAA,WAAA;AAEK,MAAMC,sBAAsB,GAAAR,OAAA,CAAAQ,sBAAA,GAAG,KAAK;;AAE3C;AACA;AACA;;AAQO,MAAMC,cAAc,GAAIC,MAA0B,IAAW,CAAC,CAAC;AAACV,OAAA,CAAAS,cAAA,GAAAA,cAAA;AAEhE,MAAME,cAAc,GACzBD,MAAsC,IAC7B,CAAC,CAAC;AAACV,OAAA,CAAAW,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ // NativePlatformComponentsTheme.ts
4
+
5
+ import { TurboModuleRegistry } from 'react-native';
6
+ export default TurboModuleRegistry.get('PlatformComponentsTheme');
7
+ //# sourceMappingURL=NativePlatformComponentsTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../src","sources":["NativePlatformComponentsTheme.ts"],"mappings":";;AAAA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;AAUlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,yBAAyB,CAAC","ignoreList":[]}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ // NativeTheme.ts
4
+ import { useLayoutEffect } from 'react';
5
+ import { processColor } from 'react-native';
6
+ import NativePlatformComponentsTheme from "./NativePlatformComponentsTheme.js";
7
+
8
+ /**
9
+ * The part of an app theme that is applied to the native platform theme. A
10
+ * React Navigation theme has this shape, so it can be passed as is.
11
+ */
12
+
13
+ function applyProcessedPrimary(primary) {
14
+ NativePlatformComponentsTheme?.setTheme(primary == null ? {} : {
15
+ primary
16
+ });
17
+ }
18
+
19
+ /**
20
+ * Applies the theme's brand color to the native platform theme, app-wide:
21
+ * these components and other native views that use the theme colors (the
22
+ * window tint color on iOS, the Material theme on Android). Pass `null` to
23
+ * restore the app's own theme colors.
24
+ *
25
+ * Light and dark mode follow the native appearance; use
26
+ * `Appearance.setColorScheme` to change it from JavaScript.
27
+ */
28
+ export function setNativeTheme(theme) {
29
+ applyProcessedPrimary(theme ? processColor(theme.colors.primary) : null);
30
+ }
31
+
32
+ /**
33
+ * Keeps the native platform theme's brand color in sync with `theme`. Call it
34
+ * once, near the root of the app. See {@link setNativeTheme}.
35
+ */
36
+ export function useNativeTheme(theme) {
37
+ // Processed colors are numbers or plain objects (PlatformColor,
38
+ // DynamicColorIOS); compare them by value so a theme object recreated on
39
+ // every render does not re-apply the same color.
40
+ const primary = JSON.stringify(theme ? processColor(theme.colors.primary) ?? null : null);
41
+ useLayoutEffect(() => {
42
+ applyProcessedPrimary(JSON.parse(primary));
43
+ }, [primary]);
44
+ }
45
+ //# sourceMappingURL=NativeTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useLayoutEffect","processColor","NativePlatformComponentsTheme","applyProcessedPrimary","primary","setTheme","setNativeTheme","theme","colors","useNativeTheme","JSON","stringify","parse"],"sourceRoot":"../../src","sources":["NativeTheme.ts"],"mappings":";;AAAA;AACA,SAASA,eAAe,QAAQ,OAAO;AACvC,SAASC,YAAY,QAAyB,cAAc;AAE5D,OAAOC,6BAA6B,MAAM,oCAAiC;;AAE3E;AACA;AACA;AACA;;AAWA,SAASC,qBAAqBA,CAACC,OAAgB,EAAQ;EACrDF,6BAA6B,EAAEG,QAAQ,CAACD,OAAO,IAAI,IAAI,GAAG,CAAC,CAAC,GAAG;IAAEA;EAAQ,CAAC,CAAC;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,cAAcA,CAACC,KAAyB,EAAQ;EAC9DJ,qBAAqB,CAACI,KAAK,GAAGN,YAAY,CAACM,KAAK,CAACC,MAAM,CAACJ,OAAO,CAAC,GAAG,IAAI,CAAC;AAC1E;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASK,cAAcA,CAACF,KAAqC,EAAQ;EAC1E;EACA;EACA;EACA,MAAMH,OAAO,GAAGM,IAAI,CAACC,SAAS,CAC5BJ,KAAK,GAAIN,YAAY,CAACM,KAAK,CAACC,MAAM,CAACJ,OAAO,CAAC,IAAI,IAAI,GAAI,IACzD,CAAC;EAEDJ,eAAe,CAAC,MAAM;IACpBG,qBAAqB,CAACO,IAAI,CAACE,KAAK,CAACR,OAAO,CAAC,CAAC;EAC5C,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;AACf","ignoreList":[]}
@@ -6,4 +6,5 @@ export * from "./ContextMenu.js";
6
6
  export * from "./SegmentedControl.js";
7
7
  export * from "./LiquidGlass.js";
8
8
  export * from "./sharedTypes.js";
9
+ export * from "./NativeTheme.js";
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,cAAc,iBAAc;AAC5B,cAAc,oBAAiB;AAC/B,cAAc,kBAAe;AAC7B,cAAc,uBAAoB;AAClC,cAAc,kBAAe;AAC7B,cAAc,kBAAe","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,cAAc,iBAAc;AAC5B,cAAc,oBAAiB;AAC/B,cAAc,kBAAe;AAC7B,cAAc,uBAAoB;AAClC,cAAc,kBAAe;AAC7B,cAAc,kBAAe;AAC7B,cAAc,kBAAe","ignoreList":[]}
@@ -53,4 +53,11 @@ export const LiquidGlass = ({
53
53
  });
54
54
  };
55
55
  export const isLiquidGlassSupported = false;
56
+
57
+ // ============================================================================
58
+ // Native theme
59
+ // ============================================================================
60
+
61
+ export const setNativeTheme = _theme => {};
62
+ export const useNativeTheme = _theme => {};
56
63
  //# sourceMappingURL=index.web.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Fragment","_Fragment","jsx","_jsx","DatePicker","_props","SelectionMenu","ContextMenu","children","SegmentedControl","LiquidGlass","isLiquidGlassSupported"],"sourceRoot":"../../src","sources":["index.web.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;;AAIzB;AACA;AACA;;AAMA;AACA;AACA;AAAA,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AAoBA,OAAO,MAAMC,UAAU,GACrBC,MAAuB,IACO,IAAI;;AAEpC;AACA;AACA;;AAoBA,OAAO,MAAMC,aAAa,GACxBD,MAA0B,IACI,IAAI;;AAEpC;AACA;AACA;;AAgCA,OAAO,MAAME,WAAW,GAAGA,CAAC;EAC1BC;AACgB,CAAC,KAAgC;EACjD,oBAAOL,IAAA,CAAAF,SAAA;IAAAO,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;;AAED;AACA;AACA;;AAmDA,OAAO,MAAMC,gBAAgB,GAC3BJ,MAA6B,IACC,IAAI;;AAEpC;AACA;AACA;;AASA,OAAO,MAAMK,WAAW,GAAGA,CAAC;EAC1BF;AACgB,CAAC,KAAgC;EACjD,oBAAOL,IAAA,CAAAF,SAAA;IAAAO,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;AAED,OAAO,MAAMG,sBAAsB,GAAG,KAAK","ignoreList":[]}
1
+ {"version":3,"names":["React","Fragment","_Fragment","jsx","_jsx","DatePicker","_props","SelectionMenu","ContextMenu","children","SegmentedControl","LiquidGlass","isLiquidGlassSupported","setNativeTheme","_theme","useNativeTheme"],"sourceRoot":"../../src","sources":["index.web.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;;AAIzB;AACA;AACA;;AAMA;AACA;AACA;AAAA,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AAoBA,OAAO,MAAMC,UAAU,GACrBC,MAAuB,IACO,IAAI;;AAEpC;AACA;AACA;;AAoBA,OAAO,MAAMC,aAAa,GACxBD,MAA0B,IACI,IAAI;;AAEpC;AACA;AACA;;AAgCA,OAAO,MAAME,WAAW,GAAGA,CAAC;EAC1BC;AACgB,CAAC,KAAgC;EACjD,oBAAOL,IAAA,CAAAF,SAAA;IAAAO,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;;AAED;AACA;AACA;;AAmDA,OAAO,MAAMC,gBAAgB,GAC3BJ,MAA6B,IACC,IAAI;;AAEpC;AACA;AACA;;AASA,OAAO,MAAMK,WAAW,GAAGA,CAAC;EAC1BF;AACgB,CAAC,KAAgC;EACjD,oBAAOL,IAAA,CAAAF,SAAA;IAAAO,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;AAED,OAAO,MAAMG,sBAAsB,GAAG,KAAK;;AAE3C;AACA;AACA;;AAQA,OAAO,MAAMC,cAAc,GAAIC,MAA0B,IAAW,CAAC,CAAC;AAEtE,OAAO,MAAMC,cAAc,GACzBD,MAAsC,IAC7B,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ import type { CodegenTypes, TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ /**
4
+ * `{ primary }`, where `primary` is a color from `processColor`. An empty
5
+ * object restores the app's own theme colors.
6
+ */
7
+ setTheme(theme: CodegenTypes.UnsafeObject): void;
8
+ }
9
+ declare const _default: Spec | null | undefined;
10
+ export default _default;
11
+ //# sourceMappingURL=NativePlatformComponentsTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativePlatformComponentsTheme.d.ts","sourceRoot":"","sources":["../../../../src/NativePlatformComponentsTheme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG9D,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC;CAClD;;AAED,wBAAwE"}
@@ -0,0 +1,30 @@
1
+ import { type ColorValue } from 'react-native';
2
+ /**
3
+ * The part of an app theme that is applied to the native platform theme. A
4
+ * React Navigation theme has this shape, so it can be passed as is.
5
+ */
6
+ export type NativeTheme = {
7
+ colors: {
8
+ /**
9
+ * Brand color. Android generates a Material 3 color scheme from it for
10
+ * light and dark mode (Android 13+); iOS uses it as the tint color.
11
+ */
12
+ primary: ColorValue;
13
+ };
14
+ };
15
+ /**
16
+ * Applies the theme's brand color to the native platform theme, app-wide:
17
+ * these components and other native views that use the theme colors (the
18
+ * window tint color on iOS, the Material theme on Android). Pass `null` to
19
+ * restore the app's own theme colors.
20
+ *
21
+ * Light and dark mode follow the native appearance; use
22
+ * `Appearance.setColorScheme` to change it from JavaScript.
23
+ */
24
+ export declare function setNativeTheme(theme: NativeTheme | null): void;
25
+ /**
26
+ * Keeps the native platform theme's brand color in sync with `theme`. Call it
27
+ * once, near the root of the app. See {@link setNativeTheme}.
28
+ */
29
+ export declare function useNativeTheme(theme: NativeTheme | null | undefined): void;
30
+ //# sourceMappingURL=NativeTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeTheme.d.ts","sourceRoot":"","sources":["../../../../src/NativeTheme.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAI7D;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE;QACN;;;WAGG;QACH,OAAO,EAAE,UAAU,CAAC;KACrB,CAAC;CACH,CAAC;AAMF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAE9D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAW1E"}
@@ -4,4 +4,5 @@ export * from './ContextMenu';
4
4
  export * from './SegmentedControl';
5
5
  export * from './LiquidGlass';
6
6
  export * from './sharedTypes';
7
+ export * from './NativeTheme';
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,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,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,M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CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,qBAAqB,KAC5B,KAAK,CAAC,YAAY,GAAG,IAAY,CAAC;AAMrC,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,GAAI,eAEzB,gBAAgB,KAAG,KAAK,CAAC,YAAY,GAAG,IAE1C,CAAC;AAEF,eAAO,MAAM,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"}
@@ -0,0 +1,11 @@
1
+ import type { CodegenTypes, TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ /**
4
+ * `{ primary }`, where `primary` is a color from `processColor`. An empty
5
+ * object restores the app's own theme colors.
6
+ */
7
+ setTheme(theme: CodegenTypes.UnsafeObject): void;
8
+ }
9
+ declare const _default: Spec | null | undefined;
10
+ export default _default;
11
+ //# sourceMappingURL=NativePlatformComponentsTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativePlatformComponentsTheme.d.ts","sourceRoot":"","sources":["../../../../src/NativePlatformComponentsTheme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG9D,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC;CAClD;;AAED,wBAAwE"}
@@ -0,0 +1,30 @@
1
+ import { type ColorValue } from 'react-native';
2
+ /**
3
+ * The part of an app theme that is applied to the native platform theme. A
4
+ * React Navigation theme has this shape, so it can be passed as is.
5
+ */
6
+ export type NativeTheme = {
7
+ colors: {
8
+ /**
9
+ * Brand color. Android generates a Material 3 color scheme from it for
10
+ * light and dark mode (Android 13+); iOS uses it as the tint color.
11
+ */
12
+ primary: ColorValue;
13
+ };
14
+ };
15
+ /**
16
+ * Applies the theme's brand color to the native platform theme, app-wide:
17
+ * these components and other native views that use the theme colors (the
18
+ * window tint color on iOS, the Material theme on Android). Pass `null` to
19
+ * restore the app's own theme colors.
20
+ *
21
+ * Light and dark mode follow the native appearance; use
22
+ * `Appearance.setColorScheme` to change it from JavaScript.
23
+ */
24
+ export declare function setNativeTheme(theme: NativeTheme | null): void;
25
+ /**
26
+ * Keeps the native platform theme's brand color in sync with `theme`. Call it
27
+ * once, near the root of the app. See {@link setNativeTheme}.
28
+ */
29
+ export declare function useNativeTheme(theme: NativeTheme | null | undefined): void;
30
+ //# sourceMappingURL=NativeTheme.d.ts.map