react-native-blur-vibe 0.1.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 (52) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +232 -0
  3. package/android/build.gradle +68 -0
  4. package/android/src/main/AndroidManifest.xml +2 -0
  5. package/android/src/main/java/com/blurvibe/BlurVibePackage.kt +12 -0
  6. package/android/src/main/java/com/blurvibe/BlurVibeView.kt +128 -0
  7. package/android/src/main/java/com/blurvibe/BlurVibeViewManager.kt +37 -0
  8. package/ios/BlurVibeView.m +3 -0
  9. package/ios/BlurVibeView.swift +132 -0
  10. package/ios/BlurVibeViewManager.m +9 -0
  11. package/ios/BlurVibeViewManager.swift +17 -0
  12. package/ios/react-native-blur-vibe.podspec +21 -0
  13. package/lib/commonjs/BlurVibeViewNativeComponent.ts +17 -0
  14. package/lib/commonjs/BlurView.js +56 -0
  15. package/lib/commonjs/BlurView.js.map +1 -0
  16. package/lib/commonjs/index.js +14 -0
  17. package/lib/commonjs/index.js.map +1 -0
  18. package/lib/commonjs/package.json +1 -0
  19. package/lib/commonjs/types.js +6 -0
  20. package/lib/commonjs/types.js.map +1 -0
  21. package/lib/module/BlurVibeViewNativeComponent.ts +17 -0
  22. package/lib/module/BlurView.js +53 -0
  23. package/lib/module/BlurView.js.map +1 -0
  24. package/lib/module/index.js +4 -0
  25. package/lib/module/index.js.map +1 -0
  26. package/lib/module/package.json +1 -0
  27. package/lib/module/types.js +4 -0
  28. package/lib/module/types.js.map +1 -0
  29. package/lib/typescript/commonjs/package.json +1 -0
  30. package/lib/typescript/commonjs/src/BlurVibeViewNativeComponent.d.ts +12 -0
  31. package/lib/typescript/commonjs/src/BlurVibeViewNativeComponent.d.ts.map +1 -0
  32. package/lib/typescript/commonjs/src/BlurView.d.ts +24 -0
  33. package/lib/typescript/commonjs/src/BlurView.d.ts.map +1 -0
  34. package/lib/typescript/commonjs/src/index.d.ts +3 -0
  35. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  36. package/lib/typescript/commonjs/src/types.d.ts +40 -0
  37. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  38. package/lib/typescript/module/package.json +1 -0
  39. package/lib/typescript/module/src/BlurVibeViewNativeComponent.d.ts +12 -0
  40. package/lib/typescript/module/src/BlurVibeViewNativeComponent.d.ts.map +1 -0
  41. package/lib/typescript/module/src/BlurView.d.ts +24 -0
  42. package/lib/typescript/module/src/BlurView.d.ts.map +1 -0
  43. package/lib/typescript/module/src/index.d.ts +3 -0
  44. package/lib/typescript/module/src/index.d.ts.map +1 -0
  45. package/lib/typescript/module/src/types.d.ts +40 -0
  46. package/lib/typescript/module/src/types.d.ts.map +1 -0
  47. package/package.json +155 -0
  48. package/react-native.config.js +7 -0
  49. package/src/BlurVibeViewNativeComponent.ts +17 -0
  50. package/src/BlurView.tsx +58 -0
  51. package/src/index.ts +2 -0
  52. package/src/types.ts +65 -0
@@ -0,0 +1,58 @@
1
+ import { Platform, StyleSheet } from 'react-native';
2
+ import type { BlurViewProps } from './types';
3
+ import NativeBlurVibeView from './BlurVibeViewNativeComponent';
4
+
5
+ /**
6
+ * BlurView — react-native-blur-vibe
7
+ *
8
+ * Cross-platform blur view for React Native.
9
+ * iOS: UIVisualEffectView | Android: RenderEffect (API 31+) / RenderScript fallback
10
+ *
11
+ * overlayColor works on BOTH platforms — composites a color on top of the blur,
12
+ * exactly like CSS: backdrop-filter: blur(Xpx) + background-color: overlayColor
13
+ *
14
+ * @example
15
+ * <BlurView
16
+ * blurAmount={15}
17
+ * blurType="systemMaterial"
18
+ * overlayColor="#00000040"
19
+ * style={StyleSheet.absoluteFill}
20
+ * />
21
+ */
22
+ const BlurView = ({
23
+ blurAmount = 10,
24
+ blurType = 'light',
25
+ overlayColor,
26
+ reducedTransparencyFallbackColor = '#F2F2F2',
27
+ blurRadius = 4,
28
+ style,
29
+ children,
30
+ ...rest
31
+ }: BlurViewProps) => {
32
+ const resolvedOverlayColor =
33
+ overlayColor ?? (Platform.OS === 'android' ? '#00000030' : 'transparent');
34
+
35
+ return (
36
+ <NativeBlurVibeView
37
+ blurAmount={blurAmount}
38
+ blurType={blurType}
39
+ overlayColor={resolvedOverlayColor}
40
+ reducedTransparencyFallbackColor={reducedTransparencyFallbackColor}
41
+ blurRadius={blurRadius}
42
+ style={[styles.transparent, style]}
43
+ {...rest}
44
+ >
45
+ {children}
46
+ </NativeBlurVibeView>
47
+ );
48
+ };
49
+
50
+ BlurView.displayName = 'BlurView';
51
+
52
+ const styles = StyleSheet.create({
53
+ transparent: {
54
+ backgroundColor: 'transparent',
55
+ },
56
+ });
57
+
58
+ export default BlurView;
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { default as BlurView } from './BlurView';
2
+ export type { BlurViewProps, BlurType } from './types';
package/src/types.ts ADDED
@@ -0,0 +1,65 @@
1
+ import type { ViewProps } from 'react-native';
2
+
3
+ export type BlurType =
4
+ | 'light'
5
+ | 'dark'
6
+ | 'extraLight'
7
+ | 'regular'
8
+ | 'prominent'
9
+ | 'systemUltraThinMaterial'
10
+ | 'systemThinMaterial'
11
+ | 'systemMaterial'
12
+ | 'systemThickMaterial'
13
+ | 'systemChromeMaterial'
14
+ | 'systemUltraThinMaterialLight'
15
+ | 'systemThinMaterialLight'
16
+ | 'systemMaterialLight'
17
+ | 'systemThickMaterialLight'
18
+ | 'systemChromeMaterialLight'
19
+ | 'systemUltraThinMaterialDark'
20
+ | 'systemThinMaterialDark'
21
+ | 'systemMaterialDark'
22
+ | 'systemThickMaterialDark'
23
+ | 'systemChromeMaterialDark';
24
+
25
+ export interface BlurViewProps extends ViewProps {
26
+ /**
27
+ * Blur intensity from 0 to 100.
28
+ * @default 10
29
+ */
30
+ blurAmount?: number;
31
+
32
+ /**
33
+ * iOS only — maps to UIBlurEffectStyle.
34
+ * @default 'light'
35
+ */
36
+ blurType?: BlurType;
37
+
38
+ /**
39
+ * Overlay color composited ON TOP of the blur layer. Works on iOS AND Android.
40
+ *
41
+ * Alpha channel controls how much blur is visible — like CSS:
42
+ * backdrop-filter: blur(Xpx) + background-color: overlayColor
43
+ *
44
+ * "#00000000" → transparent overlay = pure blur
45
+ * "#00000080" → semi-transparent black tint over blur
46
+ * "#FFFFFFFF" → fully opaque = blur hidden
47
+ *
48
+ * @default "transparent" on iOS | "#00000030" on Android
49
+ */
50
+ overlayColor?: string;
51
+
52
+ /**
53
+ * Fallback color when blur is unavailable.
54
+ * (Reduce Transparency on iOS, API < 21 on Android)
55
+ * @default "#F2F2F2"
56
+ */
57
+ reducedTransparencyFallbackColor?: string;
58
+
59
+ /**
60
+ * Android only — downscale factor for RenderScript blur path (API 21-30).
61
+ * Higher = faster performance, slightly softer blur. Range: 1–8.
62
+ * @default 4
63
+ */
64
+ blurRadius?: number;
65
+ }