@sbaiahmed1/react-native-blur 4.6.2-beta.0 → 4.6.3-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/README.md +16 -11
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/BlurType.kt +12 -19
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurSwitch.kt +19 -1
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurSwitchManager.kt +5 -0
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurView.kt +98 -135
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurViewManager.kt +25 -0
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeProgressiveBlurView.kt +21 -1
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeProgressiveBlurViewManager.kt +5 -0
- package/ios/Helpers/BlurStyleHelpers.swift +17 -0
- package/ios/Views/AdvancedBlurView.swift +8 -5
- package/ios/Views/BasicColoredView.swift +1 -19
- package/ios/Views/BlurEffectView.swift +19 -19
- package/ios/Views/LiquidGlassContainerView.swift +4 -7
- package/ios/Views/ProgressiveBlurView.swift +8 -3
- package/ios/Views/VariableBlurView.swift +0 -11
- package/ios/Views/VibrancyEffectView.swift +3 -12
- package/lib/module/BlurSwitch.js +11 -6
- package/lib/module/BlurSwitch.js.map +1 -1
- package/lib/module/BlurView.js +2 -0
- package/lib/module/BlurView.js.map +1 -1
- package/lib/module/LiquidGlassContainer.js.map +1 -1
- package/lib/module/LiquidGlassView.js.map +1 -1
- package/lib/module/ProgressiveBlurView.js +3 -0
- package/lib/module/ProgressiveBlurView.js.map +1 -1
- package/lib/module/ReactNativeBlurSwitchNativeComponent.ts +2 -37
- package/lib/module/ReactNativeBlurViewNativeComponent.ts +2 -0
- package/lib/module/ReactNativeLiquidGlassContainerNativeComponent.ts +0 -5
- package/lib/module/ReactNativeLiquidGlassViewNativeComponent.ts +0 -35
- package/lib/module/ReactNativeProgressiveBlurViewNativeComponent.ts +2 -0
- package/lib/typescript/src/BlurSwitch.d.ts +10 -0
- package/lib/typescript/src/BlurSwitch.d.ts.map +1 -1
- package/lib/typescript/src/BlurView.d.ts +11 -2
- package/lib/typescript/src/BlurView.d.ts.map +1 -1
- package/lib/typescript/src/LiquidGlassContainer.d.ts +3 -2
- package/lib/typescript/src/LiquidGlassContainer.d.ts.map +1 -1
- package/lib/typescript/src/LiquidGlassView.d.ts +25 -15
- package/lib/typescript/src/LiquidGlassView.d.ts.map +1 -1
- package/lib/typescript/src/ProgressiveBlurView.d.ts +11 -2
- package/lib/typescript/src/ProgressiveBlurView.d.ts.map +1 -1
- package/lib/typescript/src/ReactNativeBlurSwitchNativeComponent.d.ts +2 -32
- package/lib/typescript/src/ReactNativeBlurSwitchNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/ReactNativeBlurViewNativeComponent.d.ts +2 -1
- package/lib/typescript/src/ReactNativeBlurViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/ReactNativeLiquidGlassContainerNativeComponent.d.ts +0 -5
- package/lib/typescript/src/ReactNativeLiquidGlassContainerNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/ReactNativeLiquidGlassViewNativeComponent.d.ts +0 -30
- package/lib/typescript/src/ReactNativeLiquidGlassViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/ReactNativeProgressiveBlurViewNativeComponent.d.ts +2 -1
- package/lib/typescript/src/ReactNativeProgressiveBlurViewNativeComponent.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/BlurSwitch.tsx +23 -3
- package/src/BlurView.tsx +14 -2
- package/src/LiquidGlassContainer.tsx +3 -2
- package/src/LiquidGlassView.tsx +25 -15
- package/src/ProgressiveBlurView.tsx +15 -2
- package/src/ReactNativeBlurSwitchNativeComponent.ts +2 -37
- package/src/ReactNativeBlurViewNativeComponent.ts +2 -0
- package/src/ReactNativeLiquidGlassContainerNativeComponent.ts +0 -5
- package/src/ReactNativeLiquidGlassViewNativeComponent.ts +0 -35
- package/src/ReactNativeProgressiveBlurViewNativeComponent.ts +2 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerDelegate.java +0 -53
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerInterface.java +0 -25
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassEffectContainerManagerDelegate.java +0 -53
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassEffectContainerManagerInterface.java +0 -25
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassViewManagerDelegate.java +0 -38
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassViewManagerInterface.java +0 -20
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
- package/android/app/build/generated/source/codegen/jni/ReactNativeBlurViewSpec-generated.cpp +0 -22
- package/android/app/build/generated/source/codegen/jni/ReactNativeBlurViewSpec.h +0 -24
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.cpp +0 -23
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.h +0 -25
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.cpp +0 -17
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.h +0 -30
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.cpp +0 -46
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.h +0 -131
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ReactNativeBlurViewSpecJSI-generated.cpp +0 -17
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ReactNativeBlurViewSpecJSI.h +0 -19
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.cpp +0 -18
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.h +0 -43
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/States.cpp +0 -16
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/States.h +0 -41
|
@@ -39,11 +39,36 @@ class ReactNativeBlurViewManager : ViewGroupManager<ReactNativeBlurView>(),
|
|
|
39
39
|
view?.setBlurAmount(blurAmount.toFloat())
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
@ReactProp(name = "blurRounds")
|
|
43
|
+
override fun setBlurRounds(view: ReactNativeBlurView?, blurRounds: Int) {
|
|
44
|
+
view?.setRounds(blurRounds)
|
|
45
|
+
}
|
|
46
|
+
|
|
42
47
|
@ReactProp(name = "borderRadius")
|
|
43
48
|
override fun setBorderRadius(view: ReactNativeBlurView?, borderRadius: Float) {
|
|
44
49
|
view?.setBorderRadius(borderRadius)
|
|
45
50
|
}
|
|
46
51
|
|
|
52
|
+
@ReactProp(name = "borderTopLeftRadius")
|
|
53
|
+
override fun setBorderTopLeftRadius(view: ReactNativeBlurView?, borderTopLeftRadius: Float) {
|
|
54
|
+
view?.setBorderTopLeftRadius(borderTopLeftRadius)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@ReactProp(name = "borderTopRightRadius")
|
|
58
|
+
override fun setBorderTopRightRadius(view: ReactNativeBlurView?, borderTopRightRadius: Float) {
|
|
59
|
+
view?.setBorderTopRightRadius(borderTopRightRadius)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@ReactProp(name = "borderBottomLeftRadius")
|
|
63
|
+
override fun setBorderBottomLeftRadius(view: ReactNativeBlurView?, borderBottomLeftRadius: Float) {
|
|
64
|
+
view?.setBorderBottomLeftRadius(borderBottomLeftRadius)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@ReactProp(name = "borderBottomRightRadius")
|
|
68
|
+
override fun setBorderBottomRightRadius(view: ReactNativeBlurView?, borderBottomRightRadius: Float) {
|
|
69
|
+
view?.setBorderBottomRightRadius(borderBottomRightRadius)
|
|
70
|
+
}
|
|
71
|
+
|
|
47
72
|
@ReactProp(name = "reducedTransparencyFallbackColor")
|
|
48
73
|
override fun setReducedTransparencyFallbackColor(view: ReactNativeBlurView?, reducedTransparencyFallbackColor: String?) {
|
|
49
74
|
// no-op
|
package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeProgressiveBlurView.kt
CHANGED
|
@@ -30,7 +30,9 @@ class ReactNativeProgressiveBlurView : FrameLayout {
|
|
|
30
30
|
private val gradientPaint = Paint(Paint.ANTI_ALIAS_FLAG)
|
|
31
31
|
|
|
32
32
|
private var currentBlurRadius = DEFAULT_BLUR_RADIUS
|
|
33
|
+
private var currentBlurRounds = DEFAULT_BLUR_ROUNDS
|
|
33
34
|
private var currentOverlayColor = Color.TRANSPARENT
|
|
35
|
+
private var currentBlurType = "xlight"
|
|
34
36
|
private var currentDirection = "topToBottom"
|
|
35
37
|
private var currentStartOffset = 0.0f
|
|
36
38
|
private var hasExplicitBackground: Boolean = false
|
|
@@ -42,6 +44,7 @@ class ReactNativeProgressiveBlurView : FrameLayout {
|
|
|
42
44
|
private const val TAG = "ReactNativeProgressiveBlur"
|
|
43
45
|
private const val MAX_BLUR_RADIUS = 100f
|
|
44
46
|
private const val DEFAULT_BLUR_RADIUS = 10f
|
|
47
|
+
private const val DEFAULT_BLUR_ROUNDS = 5
|
|
45
48
|
private const val DEBUG = false
|
|
46
49
|
|
|
47
50
|
// Cross-platform blur amount constants
|
|
@@ -129,7 +132,7 @@ class ReactNativeProgressiveBlurView : FrameLayout {
|
|
|
129
132
|
blurView = BlurView(context, null).apply {
|
|
130
133
|
layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
|
|
131
134
|
setDownsampleFactor(6.0F)
|
|
132
|
-
blurRounds =
|
|
135
|
+
blurRounds = currentBlurRounds
|
|
133
136
|
}
|
|
134
137
|
addView(blurView)
|
|
135
138
|
}
|
|
@@ -447,6 +450,22 @@ class ReactNativeProgressiveBlurView : FrameLayout {
|
|
|
447
450
|
}
|
|
448
451
|
}
|
|
449
452
|
|
|
453
|
+
/**
|
|
454
|
+
* Set the number of blur rounds.
|
|
455
|
+
* @param rounds The number of blur rounds (1-15)
|
|
456
|
+
*/
|
|
457
|
+
fun setRounds(rounds: Int) {
|
|
458
|
+
val blurRounds = rounds.coerceIn(1, 15)
|
|
459
|
+
currentBlurRounds = blurRounds
|
|
460
|
+
logDebug("setRounds: $rounds -> $blurRounds")
|
|
461
|
+
|
|
462
|
+
try {
|
|
463
|
+
blurView?.blurRounds = blurRounds
|
|
464
|
+
} catch (e: Exception) {
|
|
465
|
+
logError("Failed to set blur rounds: ${e.message}", e)
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
450
469
|
/**
|
|
451
470
|
* Set the direction of the progressive blur gradient.
|
|
452
471
|
* @param direction The direction string: "blurredTopClearBottom" or "blurredBottomClearTop"
|
|
@@ -494,6 +513,7 @@ class ReactNativeProgressiveBlurView : FrameLayout {
|
|
|
494
513
|
* @param type The blur type string (case-insensitive)
|
|
495
514
|
*/
|
|
496
515
|
fun setBlurType(type: String) {
|
|
516
|
+
currentBlurType = type
|
|
497
517
|
val blurType = BlurType.fromString(type)
|
|
498
518
|
currentOverlayColor = blurType.overlayColor
|
|
499
519
|
logDebug("setBlurType: $type -> ${blurType.name} -> ${Integer.toHexString(currentOverlayColor)}")
|
|
@@ -45,6 +45,11 @@ class ReactNativeProgressiveBlurViewManager : SimpleViewManager<ReactNativeProgr
|
|
|
45
45
|
view?.setBlurAmount(blurAmount.toFloat())
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
@ReactProp(name = "blurRounds")
|
|
49
|
+
override fun setBlurRounds(view: ReactNativeProgressiveBlurView?, blurRounds: Int) {
|
|
50
|
+
view?.setRounds(blurRounds)
|
|
51
|
+
}
|
|
52
|
+
|
|
48
53
|
@ReactProp(name = "direction")
|
|
49
54
|
override fun setDirection(view: ReactNativeProgressiveBlurView?, direction: String?) {
|
|
50
55
|
// Provide default value if direction is null or empty
|
|
@@ -55,6 +55,23 @@ func blurStyleFromString(_ styleString: String) -> UIBlurEffect.Style {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/// Determines the fixed interface style for a blur type to prevent system adaptation.
|
|
59
|
+
/// Returns nil for ambiguous styles that should inherit from the system.
|
|
60
|
+
func interfaceStyleForBlurType(_ styleString: String) -> UIUserInterfaceStyle? {
|
|
61
|
+
switch styleString {
|
|
62
|
+
case "xlight", "light",
|
|
63
|
+
"systemUltraThinMaterialLight", "systemThinMaterialLight",
|
|
64
|
+
"systemMaterialLight", "systemThickMaterialLight", "systemChromeMaterialLight":
|
|
65
|
+
return .light
|
|
66
|
+
case "dark", "extraDark",
|
|
67
|
+
"systemUltraThinMaterialDark", "systemThinMaterialDark",
|
|
68
|
+
"systemMaterialDark", "systemThickMaterialDark", "systemChromeMaterialDark":
|
|
69
|
+
return .dark
|
|
70
|
+
default:
|
|
71
|
+
return nil
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
58
75
|
/// Maps string glass type names to Glass effect values (iOS 26.0+)
|
|
59
76
|
#if compiler(>=6.2)
|
|
60
77
|
@available(iOS 26.0, *)
|
|
@@ -49,7 +49,6 @@ import UIKit
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
private func setupHostingController() {
|
|
52
|
-
// Completely remove old hosting controller
|
|
53
52
|
if let oldHosting = hostingController {
|
|
54
53
|
oldHosting.view.removeFromSuperview()
|
|
55
54
|
oldHosting.removeFromParent()
|
|
@@ -68,8 +67,10 @@ import UIKit
|
|
|
68
67
|
hosting.view.backgroundColor = .clear
|
|
69
68
|
hosting.view.translatesAutoresizingMaskIntoConstraints = false
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
let interfaceStyle = interfaceStyleForBlurType(blurTypeString) ?? .unspecified
|
|
71
|
+
overrideUserInterfaceStyle = interfaceStyle
|
|
72
|
+
hosting.overrideUserInterfaceStyle = interfaceStyle
|
|
73
|
+
|
|
73
74
|
if !subviews.isEmpty {
|
|
74
75
|
insertSubview(hosting.view, at: 0)
|
|
75
76
|
} else {
|
|
@@ -87,9 +88,11 @@ import UIKit
|
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
private func updateView() {
|
|
91
|
+
let interfaceStyle = interfaceStyleForBlurType(blurTypeString) ?? .unspecified
|
|
92
|
+
overrideUserInterfaceStyle = interfaceStyle
|
|
93
|
+
|
|
90
94
|
if let hosting = hostingController {
|
|
91
|
-
|
|
92
|
-
// This fixes performance bottlenecks and state synchronization issues
|
|
95
|
+
hosting.overrideUserInterfaceStyle = interfaceStyle
|
|
93
96
|
let blurStyle = blurStyleFromString(blurTypeString)
|
|
94
97
|
let swiftUIView = BasicColoredView(
|
|
95
98
|
blurAmount: blurAmount,
|
|
@@ -3,17 +3,12 @@
|
|
|
3
3
|
import SwiftUI
|
|
4
4
|
import UIKit
|
|
5
5
|
|
|
6
|
-
// MARK: - SwiftUI View Component for Blur
|
|
7
|
-
|
|
8
6
|
struct BasicColoredView: View {
|
|
9
7
|
let blurAmount: Double
|
|
10
8
|
let blurStyle: UIBlurEffect.Style
|
|
11
|
-
let reducedTransparencyFallbackColor: UIColor
|
|
12
9
|
let blurIntensity: Double
|
|
13
10
|
let ignoreSafeArea: Bool
|
|
14
11
|
|
|
15
|
-
let isReducedTransparencyEnabled = UIAccessibility.isReduceTransparencyEnabled
|
|
16
|
-
|
|
17
12
|
init(blurAmount: Double,
|
|
18
13
|
blurStyle: UIBlurEffect.Style,
|
|
19
14
|
ignoreSafeArea: Bool,
|
|
@@ -21,28 +16,15 @@ struct BasicColoredView: View {
|
|
|
21
16
|
self.blurAmount = blurAmount
|
|
22
17
|
self.blurStyle = blurStyle
|
|
23
18
|
self.ignoreSafeArea = ignoreSafeArea
|
|
24
|
-
self.reducedTransparencyFallbackColor = reducedTransparencyFallbackColor
|
|
25
19
|
self.blurIntensity = mapBlurAmountToIntensity(blurAmount)
|
|
26
20
|
}
|
|
27
21
|
|
|
28
22
|
var body: some View {
|
|
29
|
-
|
|
23
|
+
regularBlurView
|
|
30
24
|
.ignoresSafeArea(ignoreSafeArea ? .all : [])
|
|
31
25
|
}
|
|
32
26
|
|
|
33
|
-
private var content: some View {
|
|
34
|
-
if isReducedTransparencyEnabled {
|
|
35
|
-
AnyView(
|
|
36
|
-
Rectangle()
|
|
37
|
-
.fill(Color(reducedTransparencyFallbackColor))
|
|
38
|
-
)
|
|
39
|
-
} else {
|
|
40
|
-
AnyView(regularBlurView)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
27
|
private var regularBlurView: some View {
|
|
45
|
-
// Use proper blur intensity control for regular blur
|
|
46
28
|
Rectangle()
|
|
47
29
|
.fill(Color(.clear))
|
|
48
30
|
.background(Blur(style: blurStyle, intensity: blurIntensity))
|
|
@@ -21,26 +21,29 @@ class BlurEffectView: UIVisualEffectView {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
func updateBlur(style: UIBlurEffect.Style, intensity: Double) {
|
|
24
|
-
// Skip expensive animator recreation when nothing changed.
|
|
25
|
-
// During FlashList recycling, updateUIView fires on every layout pass
|
|
26
|
-
// even when props are identical, causing jank (issue #100).
|
|
27
24
|
guard style != self.blurStyle || intensity != self.intensity else { return }
|
|
28
25
|
self.blurStyle = style
|
|
29
26
|
self.intensity = intensity
|
|
30
|
-
setupBlur()
|
|
31
|
-
}
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
if intensity == 1.0 {
|
|
29
|
+
// Fast path: full blur, skip animator entirely
|
|
30
|
+
animator?.stopAnimation(true)
|
|
31
|
+
animator = nil
|
|
32
|
+
effect = UIBlurEffect(style: style)
|
|
33
|
+
} else if intensity == 0.0 {
|
|
34
|
+
// Fast path: no blur
|
|
35
|
+
animator?.stopAnimation(true)
|
|
36
|
+
animator = nil
|
|
37
|
+
effect = nil
|
|
38
|
+
} else {
|
|
39
|
+
// Reuse existing animator if possible, only recreate if style changed
|
|
40
|
+
if let existing = animator,
|
|
41
|
+
existing.state == .active || existing.state == .inactive {
|
|
42
|
+
existing.fractionComplete = intensity
|
|
43
|
+
} else {
|
|
44
|
+
setupBlur()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
private func setupBlur() {
|
|
@@ -55,9 +58,6 @@ class BlurEffectView: UIVisualEffectView {
|
|
|
55
58
|
newAnimator.addAnimations { [weak self] in
|
|
56
59
|
self?.effect = UIBlurEffect(style: self?.blurStyle ?? .systemMaterial)
|
|
57
60
|
}
|
|
58
|
-
// pausesOnCompletion: if UIKit ever resumes and runs this to the end,
|
|
59
|
-
// the animator stays .active (paused at 1.0) instead of going .inactive.
|
|
60
|
-
// This guarantees didMoveToWindow can always call pauseAnimation() safely.
|
|
61
61
|
newAnimator.pausesOnCompletion = true
|
|
62
62
|
newAnimator.startAnimation()
|
|
63
63
|
newAnimator.pauseAnimation()
|
|
@@ -108,14 +108,12 @@ import UIKit
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
private func updateFallback() {
|
|
111
|
-
// If reduce transparency is enabled, show solid color
|
|
112
111
|
if UIAccessibility.isReduceTransparencyEnabled {
|
|
113
112
|
backgroundColor = reducedTransparencyFallbackColor
|
|
114
113
|
glassEffectView?.effect = nil
|
|
115
114
|
} else {
|
|
116
115
|
backgroundColor = .clear
|
|
117
|
-
|
|
118
|
-
// Map glass types to blur styles for fallback
|
|
116
|
+
|
|
119
117
|
let style: UIBlurEffect.Style
|
|
120
118
|
switch glassType {
|
|
121
119
|
case "regular":
|
|
@@ -125,14 +123,13 @@ import UIKit
|
|
|
125
123
|
default:
|
|
126
124
|
style = .regular
|
|
127
125
|
}
|
|
128
|
-
|
|
126
|
+
|
|
129
127
|
let effect = UIBlurEffect(style: style)
|
|
130
128
|
glassEffectView?.effect = effect
|
|
131
|
-
|
|
132
|
-
// Clear any background color on content view
|
|
129
|
+
|
|
133
130
|
glassEffectView?.contentView.backgroundColor = .clear
|
|
134
131
|
}
|
|
135
|
-
|
|
132
|
+
|
|
136
133
|
layer.cornerRadius = allBorderRadius
|
|
137
134
|
glassEffectView?.layer.cornerRadius = allBorderRadius
|
|
138
135
|
glassEffectView?.layer.masksToBounds = true
|
|
@@ -49,7 +49,6 @@ import UIKit
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
private func setupView() {
|
|
52
|
-
// Remove old view if exists
|
|
53
52
|
variableBlurView?.removeFromSuperview()
|
|
54
53
|
|
|
55
54
|
let blurStyle = blurStyleFromString(blurTypeString)
|
|
@@ -74,7 +73,10 @@ import UIKit
|
|
|
74
73
|
|
|
75
74
|
self.variableBlurView = variableBlur
|
|
76
75
|
|
|
77
|
-
|
|
76
|
+
let interfaceStyle = interfaceStyleForBlurType(blurTypeString) ?? .unspecified
|
|
77
|
+
overrideUserInterfaceStyle = interfaceStyle
|
|
78
|
+
variableBlur.overrideUserInterfaceStyle = interfaceStyle
|
|
79
|
+
|
|
78
80
|
if UIAccessibility.isReduceTransparencyEnabled {
|
|
79
81
|
variableBlur.isHidden = true
|
|
80
82
|
backgroundColor = reducedTransparencyFallbackColor
|
|
@@ -100,7 +102,10 @@ import UIKit
|
|
|
100
102
|
blurStyle: blurStyle
|
|
101
103
|
)
|
|
102
104
|
|
|
103
|
-
|
|
105
|
+
let interfaceStyle = interfaceStyleForBlurType(blurTypeString) ?? .unspecified
|
|
106
|
+
overrideUserInterfaceStyle = interfaceStyle
|
|
107
|
+
variableBlurView.overrideUserInterfaceStyle = interfaceStyle
|
|
108
|
+
|
|
104
109
|
if UIAccessibility.isReduceTransparencyEnabled {
|
|
105
110
|
variableBlurView.isHidden = true
|
|
106
111
|
backgroundColor = reducedTransparencyFallbackColor
|
|
@@ -113,17 +113,6 @@ open class VariableBlurView: UIVisualEffectView {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
open override func traitCollectionDidChange(
|
|
117
|
-
_ previousTraitCollection: UITraitCollection?
|
|
118
|
-
) {
|
|
119
|
-
super.traitCollectionDidChange(previousTraitCollection)
|
|
120
|
-
// Re-setup blur if needed when trait collection changes
|
|
121
|
-
if let previousTraitCollection = previousTraitCollection,
|
|
122
|
-
traitCollection.userInterfaceStyle != previousTraitCollection.userInterfaceStyle {
|
|
123
|
-
setupVariableBlur()
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
116
|
private func makeGradientImage(
|
|
128
117
|
width: CGFloat = 100,
|
|
129
118
|
height: CGFloat = 100,
|
|
@@ -53,14 +53,15 @@ import UIKit
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
private func updateEffect() {
|
|
56
|
-
|
|
56
|
+
let interfaceStyle = interfaceStyleForBlurType(blurType) ?? .unspecified
|
|
57
|
+
overrideUserInterfaceStyle = interfaceStyle
|
|
58
|
+
|
|
57
59
|
if let animator = blurAnimator {
|
|
58
60
|
animator.stopAnimation(true)
|
|
59
61
|
animator.finishAnimation(at: .current)
|
|
60
62
|
}
|
|
61
63
|
blurAnimator = nil
|
|
62
64
|
|
|
63
|
-
// Reset effects
|
|
64
65
|
blurEffectView.effect = nil
|
|
65
66
|
vibrancyEffectView.effect = nil
|
|
66
67
|
|
|
@@ -68,28 +69,18 @@ import UIKit
|
|
|
68
69
|
let blurEffect = UIBlurEffect(style: style)
|
|
69
70
|
let vibrancyEffect = UIVibrancyEffect(blurEffect: blurEffect)
|
|
70
71
|
|
|
71
|
-
// Set effects directly first to ensure they are visible
|
|
72
|
-
// Animating them from nil often causes issues with UIVibrancyEffect
|
|
73
72
|
blurEffectView.effect = blurEffect
|
|
74
73
|
vibrancyEffectView.effect = vibrancyEffect
|
|
75
74
|
|
|
76
|
-
// Create animator to adjust intensity
|
|
77
75
|
blurAnimator = UIViewPropertyAnimator(duration: 1, curve: .linear) { [weak self] in
|
|
78
76
|
self?.blurEffectView.effect = nil
|
|
79
77
|
self?.vibrancyEffectView.effect = nil
|
|
80
78
|
}
|
|
81
79
|
|
|
82
|
-
// Convert blurAmount (0-100) to intensity (0.0-1.0)
|
|
83
|
-
// We reverse the logic:
|
|
84
|
-
// fractionComplete = 0.0 -> effects are fully applied (start state)
|
|
85
|
-
// fractionComplete = 1.0 -> effects are removed (end state)
|
|
86
|
-
// So to get desired intensity X, we set fractionComplete to (1 - X)
|
|
87
80
|
let intensity = min(max(blurAmount / 100.0, 0.0), 1.0)
|
|
88
81
|
blurAnimator?.fractionComplete = 1.0 - intensity
|
|
89
82
|
|
|
90
|
-
// Stop the animation at the current state
|
|
91
83
|
DispatchQueue.main.async { [weak self, weak blurAnimator] in
|
|
92
|
-
// Only stop the animator if it's still the current one
|
|
93
84
|
guard let self = self, let currentAnimator = self.blurAnimator, currentAnimator === blurAnimator else { return }
|
|
94
85
|
|
|
95
86
|
currentAnimator.stopAnimation(true)
|
package/lib/module/BlurSwitch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { Platform, Switch } from 'react-native';
|
|
4
|
+
import { Platform, StyleSheet, Switch } from 'react-native';
|
|
5
5
|
import ReactNativeBlurSwitch from './ReactNativeBlurSwitchNativeComponent';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
const toColorString = (color, fallback) => {
|
|
@@ -30,8 +30,9 @@ const toColorString = (color, fallback) => {
|
|
|
30
30
|
*/
|
|
31
31
|
export const BlurSwitch = ({
|
|
32
32
|
value = false,
|
|
33
|
-
onValueChange,
|
|
34
33
|
blurAmount = 10,
|
|
34
|
+
blurRounds = 5,
|
|
35
|
+
onValueChange,
|
|
35
36
|
thumbColor = '#FFFFFF',
|
|
36
37
|
trackColor = {
|
|
37
38
|
false: '#E5E5EA',
|
|
@@ -53,15 +54,13 @@ export const BlurSwitch = ({
|
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
return /*#__PURE__*/_jsx(ReactNativeBlurSwitch, {
|
|
56
|
-
style: [
|
|
57
|
-
width: 65,
|
|
58
|
-
height: 36
|
|
59
|
-
}, style],
|
|
57
|
+
style: [styles.switch, style],
|
|
60
58
|
value: value,
|
|
61
59
|
onValueChange: event => {
|
|
62
60
|
onValueChange?.(event.nativeEvent.value);
|
|
63
61
|
},
|
|
64
62
|
blurAmount: blurAmount,
|
|
63
|
+
blurRounds: blurRounds,
|
|
65
64
|
thumbColor: toColorString(thumbColor, '#FFFFFF'),
|
|
66
65
|
trackColorOff: toColorString(trackColor?.false, '#E5E5EA'),
|
|
67
66
|
trackColorOn: toColorString(trackColor?.true, '#34C759'),
|
|
@@ -69,5 +68,11 @@ export const BlurSwitch = ({
|
|
|
69
68
|
...props
|
|
70
69
|
});
|
|
71
70
|
};
|
|
71
|
+
const styles = StyleSheet.create({
|
|
72
|
+
switch: {
|
|
73
|
+
width: 65,
|
|
74
|
+
height: 36
|
|
75
|
+
}
|
|
76
|
+
});
|
|
72
77
|
export default BlurSwitch;
|
|
73
78
|
//# sourceMappingURL=BlurSwitch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","Switch","ReactNativeBlurSwitch","jsx","_jsx","toColorString","color","fallback","BlurSwitch","value","
|
|
1
|
+
{"version":3,"names":["React","Platform","StyleSheet","Switch","ReactNativeBlurSwitch","jsx","_jsx","toColorString","color","fallback","BlurSwitch","value","blurAmount","blurRounds","onValueChange","thumbColor","trackColor","false","true","disabled","style","props","OS","styles","switch","event","nativeEvent","trackColorOff","trackColorOn","create","width","height"],"sourceRoot":"../../src","sources":["BlurSwitch.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,UAAU,EAAEC,MAAM,QAAQ,cAAc;AAE3D,OAAOC,qBAAqB,MAAM,wCAAwC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3E,MAAMC,aAAa,GAAGA,CACpBC,KAA6B,EAC7BC,QAAgB,KACL;EACX,IAAI,OAAOD,KAAK,KAAK,QAAQ,EAAE,OAAOA,KAAK;EAC3C,OAAOC,QAAQ;AACjB,CAAC;AAyED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAqC,GAAGA,CAAC;EACpDC,KAAK,GAAG,KAAK;EACbC,UAAU,GAAG,EAAE;EACfC,UAAU,GAAG,CAAC;EACdC,aAAa;EACbC,UAAU,GAAG,SAAS;EACtBC,UAAU,GAAG;IAAEC,KAAK,EAAE,SAAS;IAAEC,IAAI,EAAE;EAAU,CAAC;EAClDC,QAAQ,GAAG,KAAK;EAChBC,KAAK;EACL,GAAGC;AACL,CAAC,KAAK;EACJ,IAAIpB,QAAQ,CAACqB,EAAE,KAAK,KAAK,EAAE;IACzB,oBACEhB,IAAA,CAACH,MAAM;MACLQ,KAAK,EAAEA,KAAM;MACbG,aAAa,EAAEA,aAAc;MAC7BC,UAAU,EAAEA,UAAW;MACvBC,UAAU,EAAEA,UAAW;MACvBG,QAAQ,EAAEA,QAAS;MACnBC,KAAK,EAAEA,KAAM;MAAA,GACTC;IAAK,CACV,CAAC;EAEN;EAEA,oBACEf,IAAA,CAACF,qBAAqB;IACpBgB,KAAK,EAAE,CAACG,MAAM,CAACC,MAAM,EAAEJ,KAAK,CAAE;IAC9BT,KAAK,EAAEA,KAAM;IACbG,aAAa,EAAGW,KAAK,IAAK;MACxBX,aAAa,GAAGW,KAAK,CAACC,WAAW,CAACf,KAAK,CAAC;IAC1C,CAAE;IACFC,UAAU,EAAEA,UAAW;IACvBC,UAAU,EAAEA,UAAW;IACvBE,UAAU,EAAER,aAAa,CAACQ,UAAU,EAAE,SAAS,CAAE;IACjDY,aAAa,EAAEpB,aAAa,CAACS,UAAU,EAAEC,KAAK,EAAE,SAAS,CAAE;IAC3DW,YAAY,EAAErB,aAAa,CAACS,UAAU,EAAEE,IAAI,EAAE,SAAS,CAAE;IACzDC,QAAQ,EAAEA,QAAS;IAAA,GACfE;EAAK,CACV,CAAC;AAEN,CAAC;AAED,MAAME,MAAM,GAAGrB,UAAU,CAAC2B,MAAM,CAAC;EAC/BL,MAAM,EAAE;IACNM,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAEF,eAAerB,UAAU","ignoreList":[]}
|
package/lib/module/BlurView.js
CHANGED
|
@@ -29,6 +29,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
29
29
|
export const BlurView = ({
|
|
30
30
|
blurType = 'xlight',
|
|
31
31
|
blurAmount = 10,
|
|
32
|
+
blurRounds = 5,
|
|
32
33
|
reducedTransparencyFallbackColor = '#FFFFFF',
|
|
33
34
|
overlayColor,
|
|
34
35
|
style,
|
|
@@ -42,6 +43,7 @@ export const BlurView = ({
|
|
|
42
43
|
const commonProps = {
|
|
43
44
|
blurType,
|
|
44
45
|
blurAmount,
|
|
46
|
+
blurRounds,
|
|
45
47
|
ignoreSafeArea,
|
|
46
48
|
reducedTransparencyFallbackColor
|
|
47
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Children","Platform","StyleSheet","View","ReactNativeBlurView","jsx","_jsx","jsxs","_jsxs","BlurView","blurType","blurAmount","reducedTransparencyFallbackColor","overlayColor","style","children","ignoreSafeArea","props","overlay","backgroundColor","commonProps","count","OS","absoluteFill","styles","container","create","position","overflow"],"sourceRoot":"../../src","sources":["BlurView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEzD,OAAOC,mBAAmB,MAEnB,sCAAsC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;
|
|
1
|
+
{"version":3,"names":["React","Children","Platform","StyleSheet","View","ReactNativeBlurView","jsx","_jsx","jsxs","_jsxs","BlurView","blurType","blurAmount","blurRounds","reducedTransparencyFallbackColor","overlayColor","style","children","ignoreSafeArea","props","overlay","backgroundColor","commonProps","count","OS","absoluteFill","styles","container","create","position","overflow"],"sourceRoot":"../../src","sources":["BlurView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEzD,OAAOC,mBAAmB,MAEnB,sCAAsC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAiE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAiC,GAAGA,CAAC;EAChDC,QAAQ,GAAG,QAAQ;EACnBC,UAAU,GAAG,EAAE;EACfC,UAAU,GAAG,CAAC;EACdC,gCAAgC,GAAG,SAAS;EAC5CC,YAAY;EACZC,KAAK;EACLC,QAAQ;EACRC,cAAc,GAAG,IAAI;EACrB,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,OAAO,GAAG;IAAEC,eAAe,EAAEN;EAAa,CAAC;EACjD,MAAMO,WAA0B,GAAG;IACjCX,QAAQ;IACRC,UAAU;IACVC,UAAU;IACVK,cAAc;IACdJ;EACF,CAAC;;EAED;EACA,IAAI,CAACb,QAAQ,CAACsB,KAAK,CAACN,QAAQ,CAAC,EAAE;IAC7B,oBACEV,IAAA,CAACF,mBAAmB;MAClBW,KAAK,EAAE,CAACA,KAAK,EAAEI,OAAO,CAAE;MAAA,GACpBE,WAAW;MAAA,GACXH;IAAK,CACV,CAAC;EAEN;;EAEA;EACA,IAAIjB,QAAQ,CAACsB,EAAE,KAAK,SAAS,EAAE;IAC7B,oBACEf,KAAA,CAACJ,mBAAmB;MAACW,KAAK,EAAEA,KAAM;MAAA,GAAKM,WAAW;MAAA,GAAMH,KAAK;MAAAF,QAAA,gBAC3DV,IAAA,CAACH,IAAI;QAACY,KAAK,EAAE,CAACb,UAAU,CAACsB,YAAY,EAAEL,OAAO;MAAE,CAAE,CAAC,EAElDH,QAAQ;IAAA,CACU,CAAC;EAE1B;;EAEA;EACA,oBACER,KAAA,CAACL,IAAI;IAACY,KAAK,EAAE,CAACU,MAAM,CAACC,SAAS,EAAEX,KAAK,EAAEI,OAAO,CAAE;IAAAH,QAAA,gBAE9CV,IAAA,CAACF,mBAAmB;MAClBW,KAAK,EAAEb,UAAU,CAACsB,YAAa;MAAA,GAC3BH,WAAW;MAAA,GACXH;IAAK,CACV,CAAC,EACDF,QAAQ;EAAA,CACL,CAAC;AAEX,CAAC;AAED,eAAeP,QAAQ;AAEvB,MAAMgB,MAAM,GAAGvB,UAAU,CAACyB,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,QAAQ,EAAE,UAAU;IACpBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","View","ReactNativeLiquidGlassContainer","jsx","_jsx","LiquidGlassContainer","spacing","style","children","rest","isCompatibleIOS","OS","parseInt","Version"],"sourceRoot":"../../src","sources":["LiquidGlassContainer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,QAAwB,cAAc;AAC7D,OAAOC,+BAA+B,MAAM,kDAAkD;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["React","Platform","View","ReactNativeLiquidGlassContainer","jsx","_jsx","LiquidGlassContainer","spacing","style","children","rest","isCompatibleIOS","OS","parseInt","Version"],"sourceRoot":"../../src","sources":["LiquidGlassContainer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,QAAwB,cAAc;AAC7D,OAAOC,+BAA+B,MAAM,kDAAkD;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAa/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAyD,GAAGA,CAAC;EACxEC,OAAO,GAAG,CAAC;EACXC,KAAK;EACLC,QAAQ;EACR,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,eAAe,GACnBV,QAAQ,CAACW,EAAE,KAAK,KAAK,IAAIC,QAAQ,CAACZ,QAAQ,CAACa,OAAO,EAAY,EAAE,CAAC,IAAI,EAAE;EAEzE,IAAI,CAACH,eAAe,EAAE;IACpB;IACA,oBACEN,IAAA,CAACH,IAAI;MAACM,KAAK,EAAEA,KAAM;MAAA,GAAKE,IAAI;MAAAD,QAAA,EACzBA;IAAQ,CACL,CAAC;EAEX;EAEA,oBACEJ,IAAA,CAACF,+BAA+B;IAACI,OAAO,EAAEA,OAAQ;IAACC,KAAK,EAAEA,KAAM;IAAA,GAAKE,IAAI;IAAAD,QAAA,EACtEA;EAAQ,CACsB,CAAC;AAEtC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","ReactNativeLiquidGlassView","BlurView","jsx","_jsx","LiquidGlassView","glassType","glassTintColor","glassOpacity","reducedTransparencyFallbackColor","isInteractive","ignoreSafeArea","style","children","props","isIos","OS","Number","parseInt","String","Version","console","warn","overlayColorWithAlpha","Math","floor","toString","padStart","blurAmount","overlayColor"],"sourceRoot":"../../src","sources":["LiquidGlassView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,cAAc;AAEvC,OAAOC,0BAA0B,MAE1B,6CAA6C;AACpD,OAAOC,QAAQ,MAAM,eAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["React","Platform","ReactNativeLiquidGlassView","BlurView","jsx","_jsx","LiquidGlassView","glassType","glassTintColor","glassOpacity","reducedTransparencyFallbackColor","isInteractive","ignoreSafeArea","style","children","props","isIos","OS","Number","parseInt","String","Version","console","warn","overlayColorWithAlpha","Math","floor","toString","padStart","blurAmount","overlayColor"],"sourceRoot":"../../src","sources":["LiquidGlassView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,cAAc;AAEvC,OAAOC,0BAA0B,MAE1B,6CAA6C;AACpD,OAAOC,QAAQ,MAAM,eAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AA0ElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAA+C,GAAGA,CAAC;EAC9DC,SAAS,GAAG,OAAO;EACnBC,cAAc,GAAG,OAAO;EACxBC,YAAY,GAAG,GAAG;EAClBC,gCAAgC,GAAG,SAAS;EAC5CC,aAAa,GAAG,IAAI;EACpBC,cAAc,GAAG,IAAI;EACrBC,KAAK;EACLC,QAAQ;EACR,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,KAAK,GAAGf,QAAQ,CAACgB,EAAE,KAAK,KAAK;;EAEnC;EACA,IAAI,CAACD,KAAK,IAAKA,KAAK,IAAIE,MAAM,CAACC,QAAQ,CAACC,MAAM,CAACnB,QAAQ,CAACoB,OAAO,CAAC,EAAE,EAAE,CAAC,GAAG,EAAG,EAAE;IAC3EC,OAAO,CAACC,IAAI,CACV,oFACF,CAAC;;IAED;IACA,MAAMC,qBAAqB,GACzBhB,cAAc,GACdiB,IAAI,CAACC,KAAK,CAACjB,YAAY,GAAG,GAAG,CAAC,CAC3BkB,QAAQ,CAAC,EAAE,CAAC,CACZC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;IAErB,oBACEvB,IAAA,CAACF,QAAQ;MACP0B,UAAU,EAAE,EAAG;MACfC,YAAY,EAAEN,qBAAsB;MACpCd,gCAAgC,EAAEA,gCAAiC;MACnEE,cAAc,EAAEA,cAAe;MAC/BC,KAAK,EAAEA,KAAM;MAAAC,QAAA,EAEZA;IAAQ,CACD,CAAC;EAEf;;EAEA;EACA,oBACET,IAAA,CAACH,0BAA0B;IACzBK,SAAS,EAAEA,SAAU;IACrBC,cAAc,EAAEA,cAAe;IAC/BC,YAAY,EAAEA,YAAa;IAC3BC,gCAAgC,EAAEA,gCAAiC;IACnEC,aAAa,EAAEA,aAAc;IAC7BC,cAAc,EAAEA,cAAe;IAC/BC,KAAK,EAAEA,KAAM;IAAA,GACTE,KAAK;IAAAD,QAAA,EAERA;EAAQ,CACiB,CAAC;AAEjC,CAAC;AAED,eAAeR,eAAe","ignoreList":[]}
|
|
@@ -47,6 +47,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
47
47
|
export const ProgressiveBlurView = ({
|
|
48
48
|
blurType = 'regular',
|
|
49
49
|
blurAmount = 20,
|
|
50
|
+
blurRounds = 5,
|
|
50
51
|
direction = 'blurredTopClearBottom',
|
|
51
52
|
startOffset = 0.0,
|
|
52
53
|
reducedTransparencyFallbackColor = '#FFFFFF',
|
|
@@ -64,6 +65,7 @@ export const ProgressiveBlurView = ({
|
|
|
64
65
|
return /*#__PURE__*/_jsx(ReactNativeProgressiveBlurView, {
|
|
65
66
|
blurType: blurType,
|
|
66
67
|
blurAmount: blurAmount,
|
|
68
|
+
blurRounds: blurRounds,
|
|
67
69
|
direction: direction,
|
|
68
70
|
startOffset: startOffset,
|
|
69
71
|
reducedTransparencyFallbackColor: reducedTransparencyFallbackColor,
|
|
@@ -78,6 +80,7 @@ export const ProgressiveBlurView = ({
|
|
|
78
80
|
children: [/*#__PURE__*/_jsx(ReactNativeProgressiveBlurView, {
|
|
79
81
|
blurType: blurType,
|
|
80
82
|
blurAmount: blurAmount,
|
|
83
|
+
blurRounds: blurRounds,
|
|
81
84
|
direction: direction,
|
|
82
85
|
startOffset: startOffset,
|
|
83
86
|
reducedTransparencyFallbackColor: reducedTransparencyFallbackColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Children","StyleSheet","View","ReactNativeProgressiveBlurView","jsx","_jsx","jsxs","_jsxs","ProgressiveBlurView","blurType","blurAmount","direction","startOffset","reducedTransparencyFallbackColor","overlayColor","style","children","props","overlay","backgroundColor","count","styles","container","absoluteFill","create","position","overflow"],"sourceRoot":"../../src","sources":["ProgressiveBlurView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,OAAOC,8BAA8B,MAG9B,iDAAiD;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;
|
|
1
|
+
{"version":3,"names":["React","Children","StyleSheet","View","ReactNativeProgressiveBlurView","jsx","_jsx","jsxs","_jsxs","ProgressiveBlurView","blurType","blurAmount","blurRounds","direction","startOffset","reducedTransparencyFallbackColor","overlayColor","style","children","props","overlay","backgroundColor","count","styles","container","absoluteFill","create","position","overflow"],"sourceRoot":"../../src","sources":["ProgressiveBlurView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,OAAOC,8BAA8B,MAG9B,iDAAiD;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA8EzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAuD,GAAGA,CAAC;EACtEC,QAAQ,GAAG,SAAS;EACpBC,UAAU,GAAG,EAAE;EACfC,UAAU,GAAG,CAAC;EACdC,SAAS,GAAG,uBAAuB;EACnCC,WAAW,GAAG,GAAG;EACjBC,gCAAgC,GAAG,SAAS;EAC5CC,YAAY;EACZC,KAAK;EACLC,QAAQ;EACR,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,OAAO,GAAG;IAAEC,eAAe,EAAEL;EAAa,CAAC;;EAEjD;EACA,IAAI,CAACf,QAAQ,CAACqB,KAAK,CAACJ,QAAQ,CAAC,EAAE;IAC7B,oBACEZ,IAAA,CAACF,8BAA8B;MAC7BM,QAAQ,EAAEA,QAAS;MACnBC,UAAU,EAAEA,UAAW;MACvBC,UAAU,EAAEA,UAAW;MACvBC,SAAS,EAAEA,SAAU;MACrBC,WAAW,EAAEA,WAAY;MACzBC,gCAAgC,EAAEA,gCAAiC;MACnEE,KAAK,EAAE,CAACA,KAAK,EAAEG,OAAO,CAAE;MAAA,GACpBD;IAAK,CACV,CAAC;EAEN;;EAEA;EACA,oBACEX,KAAA,CAACL,IAAI;IAACc,KAAK,EAAE,CAACM,MAAM,CAACC,SAAS,EAAEP,KAAK,EAAEG,OAAO,CAAE;IAAAF,QAAA,gBAE9CZ,IAAA,CAACF,8BAA8B;MAC7BM,QAAQ,EAAEA,QAAS;MACnBC,UAAU,EAAEA,UAAW;MACvBC,UAAU,EAAEA,UAAW;MACvBC,SAAS,EAAEA,SAAU;MACrBC,WAAW,EAAEA,WAAY;MACzBC,gCAAgC,EAAEA,gCAAiC;MACnEE,KAAK,EAAEf,UAAU,CAACuB,YAAa;MAAA,GAC3BN;IAAK,CACV,CAAC,EAEDD,QAAQ;EAAA,CACL,CAAC;AAEX,CAAC;AAED,eAAeT,mBAAmB;AAElC,MAAMc,MAAM,GAAGrB,UAAU,CAACwB,MAAM,CAAC;EAC/BF,SAAS,EAAE;IACTG,QAAQ,EAAE,UAAU;IACpBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
WithDefault,
|
|
5
5
|
Double,
|
|
6
6
|
DirectEventHandler,
|
|
7
|
+
Int32,
|
|
7
8
|
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
8
9
|
|
|
9
10
|
export interface ValueChangeEvent {
|
|
@@ -11,49 +12,13 @@ export interface ValueChangeEvent {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
interface NativeProps extends ViewProps {
|
|
14
|
-
/**
|
|
15
|
-
* The current value of the switch
|
|
16
|
-
* @default false
|
|
17
|
-
*/
|
|
18
15
|
value?: WithDefault<boolean, false>;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The intensity of the blur effect (0-100)
|
|
22
|
-
* @default 10.0
|
|
23
|
-
*/
|
|
24
16
|
blurAmount?: WithDefault<Double, 10.0>;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* The color of the switch thumb
|
|
28
|
-
* Note: Not supported by the Android implementation (no-op).
|
|
29
|
-
* Use the native iOS Switch for platform-specific thumb colors.
|
|
30
|
-
* @default '#FFFFFF'
|
|
31
|
-
*/
|
|
17
|
+
blurRounds?: WithDefault<Int32, 5>;
|
|
32
18
|
thumbColor?: WithDefault<string, '#FFFFFF'>;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* The track color when switch is off
|
|
36
|
-
* Note: Not supported by the Android implementation (no-op).
|
|
37
|
-
* Use the native iOS Switch for platform-specific off-state colors.
|
|
38
|
-
* @default '#E5E5EA'
|
|
39
|
-
*/
|
|
40
19
|
trackColorOff?: WithDefault<string, '#E5E5EA'>;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The track color when switch is on
|
|
44
|
-
* @default '#34C759'
|
|
45
|
-
*/
|
|
46
20
|
trackColorOn?: WithDefault<string, '#34C759'>;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Whether the switch is disabled
|
|
50
|
-
* @default false
|
|
51
|
-
*/
|
|
52
21
|
disabled?: WithDefault<boolean, false>;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Callback invoked when the switch value changes
|
|
56
|
-
*/
|
|
57
22
|
onValueChange?: DirectEventHandler<Readonly<ValueChangeEvent>>;
|
|
58
23
|
}
|
|
59
24
|
|
|
@@ -3,6 +3,7 @@ import type { ViewProps } from 'react-native';
|
|
|
3
3
|
import type {
|
|
4
4
|
WithDefault,
|
|
5
5
|
Double,
|
|
6
|
+
Int32,
|
|
6
7
|
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
7
8
|
|
|
8
9
|
export type BlurType =
|
|
@@ -31,6 +32,7 @@ export type BlurType =
|
|
|
31
32
|
interface NativeProps extends ViewProps {
|
|
32
33
|
blurAmount?: WithDefault<Double, 10.0>;
|
|
33
34
|
blurType?: WithDefault<BlurType, 'xlight'>;
|
|
35
|
+
blurRounds?: WithDefault<Int32, 5>;
|
|
34
36
|
reducedTransparencyFallbackColor?: WithDefault<string, '#FFFFFF'>;
|
|
35
37
|
ignoreSafeArea?: WithDefault<boolean, true>;
|
|
36
38
|
}
|
|
@@ -3,11 +3,6 @@ import type { ViewProps } from 'react-native';
|
|
|
3
3
|
import type { Double } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
4
|
|
|
5
5
|
interface NativeProps extends ViewProps {
|
|
6
|
-
/**
|
|
7
|
-
* The spacing value for the glass container effect
|
|
8
|
-
* Platform: iOS only (iOS 26+)
|
|
9
|
-
* @default 0
|
|
10
|
-
*/
|
|
11
6
|
spacing?: Double;
|
|
12
7
|
}
|
|
13
8
|
|