@sbaiahmed1/react-native-blur 0.2.1 → 0.3.0-beta.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.
package/src/BlurView.tsx CHANGED
@@ -4,11 +4,12 @@ import type { ViewStyle, StyleProp } from 'react-native';
4
4
  import ReactNativeBlurView, {
5
5
  type BlurType,
6
6
  } from './ReactNativeBlurViewNativeComponent';
7
+ import type { GlassType } from '../src/ReactNativeBlurViewNativeComponent';
7
8
 
8
9
  export interface BlurViewProps {
9
10
  /**
10
11
  * The type of blur effect to apply
11
- * @default 'light'
12
+ * @default 'xlight'
12
13
  */
13
14
  blurType?: BlurType;
14
15
 
@@ -21,6 +22,7 @@ export interface BlurViewProps {
21
22
  /**
22
23
  * Fallback color when reduced transparency is enabled
23
24
  * Accepts hex color strings like '#FFFFFF'
25
+ * @default '#FFFFFF'
24
26
  */
25
27
  reducedTransparencyFallbackColor?: string;
26
28
 
@@ -33,6 +35,37 @@ export interface BlurViewProps {
33
35
  * Child components to render inside the blur view
34
36
  */
35
37
  children?: React.ReactNode;
38
+
39
+ /**
40
+ * Platform: iOS only
41
+ * The type of glass effect to apply
42
+ * @default 'clear'
43
+ */
44
+ glassType?: GlassType;
45
+
46
+ /**
47
+ * Platform: iOS only
48
+ * The tint color of the glass effect
49
+ * accepts hex color strings like '#FFFFFF'
50
+ * accepts color names like 'white', 'clear', 'black', 'red', 'green', 'blue', 'yellow', 'cyan', 'magenta'
51
+ * @default 'clear'
52
+ */
53
+ glassTintColor?: string;
54
+
55
+ /**
56
+ * Platform: iOS only
57
+ * The opacity of the glass effect (0-1)
58
+ * @default 1.0
59
+ */
60
+ glassOpacity?: number;
61
+
62
+ /**
63
+ * The type of blur effect to apply
64
+ * liquidGlass = iOS Only
65
+ * blur = Android | iOS
66
+ * @default 'blur'
67
+ */
68
+ type?: 'blur' | 'liquidGlass';
36
69
  }
37
70
 
38
71
  /**
@@ -58,11 +91,15 @@ export interface BlurViewProps {
58
91
  * ```
59
92
  */
60
93
  export const BlurView: React.FC<BlurViewProps> = ({
61
- blurType = 'light',
94
+ blurType = 'xlight',
62
95
  blurAmount = 10,
63
- reducedTransparencyFallbackColor,
96
+ reducedTransparencyFallbackColor = '#FFFFFF',
64
97
  style,
65
98
  children,
99
+ type = 'blur',
100
+ glassType = 'clear',
101
+ glassTintColor = 'clear',
102
+ glassOpacity = 1.0,
66
103
  ...props
67
104
  }) => {
68
105
  // If no children, render the blur view directly (for background use)
@@ -71,6 +108,10 @@ export const BlurView: React.FC<BlurViewProps> = ({
71
108
  <ReactNativeBlurView
72
109
  blurType={blurType}
73
110
  blurAmount={blurAmount}
111
+ glassType={glassType}
112
+ glassTintColor={glassTintColor}
113
+ glassOpacity={glassOpacity}
114
+ type={type}
74
115
  reducedTransparencyFallbackColor={reducedTransparencyFallbackColor}
75
116
  style={style}
76
117
  {...props}
@@ -85,6 +126,10 @@ export const BlurView: React.FC<BlurViewProps> = ({
85
126
  <ReactNativeBlurView
86
127
  blurType={blurType}
87
128
  blurAmount={blurAmount}
129
+ glassType={glassType}
130
+ glassTintColor={glassTintColor}
131
+ glassOpacity={glassOpacity}
132
+ type={type}
88
133
  reducedTransparencyFallbackColor={reducedTransparencyFallbackColor}
89
134
  style={{
90
135
  position: 'absolute',
@@ -18,10 +18,16 @@ export type BlurType =
18
18
  | 'systemThickMaterial'
19
19
  | 'systemChromeMaterial';
20
20
 
21
+ export type GlassType = 'clear' | 'regular';
22
+
21
23
  interface NativeProps extends ViewProps {
22
- blurType?: WithDefault<BlurType, 'light'>;
23
- blurAmount?: WithDefault<Double, 10>;
24
- reducedTransparencyFallbackColor?: string;
24
+ glassTintColor?: WithDefault<string, 'clear'>;
25
+ glassOpacity?: WithDefault<Double, 1.0>;
26
+ blurAmount?: WithDefault<Double, 10.0>;
27
+ type?: WithDefault<'blur' | 'liquidGlass', 'blur'>;
28
+ blurType?: WithDefault<BlurType, 'xlight'>;
29
+ glassType?: WithDefault<GlassType, 'clear'>;
30
+ reducedTransparencyFallbackColor?: WithDefault<string, '#FFFFFF'>;
25
31
  }
26
32
 
27
33
  export default codegenNativeComponent<NativeProps>('ReactNativeBlurView');
@@ -1,23 +0,0 @@
1
- #import <React/RCTViewManager.h>
2
- #import <React/RCTUIManager.h>
3
- #import "RCTBridge.h"
4
- #import "ReactNativeBlurView.h"
5
-
6
- @interface ReactNativeBlurViewManager : RCTViewManager
7
- @end
8
-
9
- @implementation ReactNativeBlurViewManager
10
-
11
- RCT_EXPORT_MODULE(ReactNativeBlurView)
12
-
13
- - (UIView *)view
14
- {
15
- return [[ReactNativeBlurView alloc] init];
16
- }
17
-
18
- // Legacy view manager - properties are now handled by Fabric
19
- RCT_EXPORT_VIEW_PROPERTY(blurType, NSString)
20
- RCT_EXPORT_VIEW_PROPERTY(blurAmount, NSNumber)
21
- RCT_EXPORT_VIEW_PROPERTY(reducedTransparencyFallbackColor, NSString)
22
-
23
- @end