expo-blur
Advanced tools
Comparing version 8.0.0 to 8.1.0
import PropTypes from 'prop-types'; | ||
import * as React from 'react'; | ||
import { BlurTint, Props } from './BlurView.types'; | ||
export default class BlurView extends React.Component<Props> { | ||
import { BlurTint, BlurProps } from './BlurView.types'; | ||
export default class BlurView extends React.Component<BlurProps> { | ||
static propTypes: { | ||
@@ -6,0 +6,0 @@ tint: PropTypes.Validator<BlurTint>; |
import PropTypes from 'prop-types'; | ||
import * as React from 'react'; | ||
import { BlurTint, ComponentOrHandle, Props } from './BlurView.types'; | ||
export default class BlurView extends React.Component<Props> { | ||
import { BlurTint, ComponentOrHandle, BlurProps } from './BlurView.types'; | ||
export default class BlurView extends React.Component<BlurProps> { | ||
static propTypes: { | ||
@@ -6,0 +6,0 @@ tint: PropTypes.Validator<BlurTint>; |
import { View } from 'react-native'; | ||
export declare type Props = { | ||
export declare type BlurProps = { | ||
tint: BlurTint; | ||
@@ -4,0 +4,0 @@ intensity: number; |
import PropTypes from 'prop-types'; | ||
import * as React from 'react'; | ||
import { BlurTint, Props } from './BlurView.types'; | ||
export default class BlurView extends React.Component<Props> { | ||
import { BlurTint, BlurProps } from './BlurView.types'; | ||
export default class BlurView extends React.Component<BlurProps> { | ||
static propTypes: { | ||
@@ -6,0 +6,0 @@ hitSlop?: PropTypes.Validator<import("react-native").Insets | undefined> | undefined; |
@@ -28,19 +28,10 @@ import PropTypes from 'prop-types'; | ||
function getBlurStyle({ intensity, tint }) { | ||
const style = { | ||
backgroundColor: getBackgroundColor(intensity, tint), | ||
}; | ||
if (isBlurSupported()) { | ||
let backdropFilter = `blur(${intensity * 0.25}px)`; | ||
if (tint === 'dark') { | ||
backdropFilter += ' brightness(50%)'; | ||
} | ||
else if (tint === 'light') { | ||
backdropFilter += ' brightness(150%)'; | ||
} | ||
return { | ||
backdropFilter, | ||
}; | ||
style.backdropFilter = `blur(${intensity * 0.8}px)`; | ||
} | ||
else { | ||
let backgroundColor = getBackgroundColor(intensity, tint); | ||
return { backgroundColor }; | ||
} | ||
return style; | ||
} | ||
//# sourceMappingURL=BlurView.web.js.map |
@@ -5,7 +5,7 @@ export default function getBackgroundColor(intensity, tint) { | ||
case 'dark': | ||
return `rgba(0,0,0,${opacity * 0.5})`; | ||
return `rgba(28,28,28,${opacity * 0.73})`; | ||
case 'light': | ||
return `rgba(255,255,255,${opacity * 0.7})`; | ||
return `rgba(247,247,247,${opacity * 0.8})`; | ||
case 'default': | ||
return `rgba(255,255,255,${opacity * 0.4})`; | ||
return `rgba(255,255,255,${opacity * 0.3})`; | ||
} | ||
@@ -12,0 +12,0 @@ throw new Error(`Unsupported tint provided: ${tint}`); |
import BlurView from './BlurView'; | ||
export { BlurView }; | ||
export { BlurTint, BlurProps } from './BlurView.types'; |
{ | ||
"name": "expo-blur", | ||
"version": "8.0.0", | ||
"version": "8.1.0", | ||
"description": "A component that renders a native blur view on iOS and falls back to a semi-transparent view on Android. A common usage of this is for navigation bars, tab bars, and modals.", | ||
@@ -40,3 +40,3 @@ "main": "build/index.js", | ||
"devDependencies": { | ||
"expo-module-scripts": "~1.1.1" | ||
"expo-module-scripts": "~1.2.0" | ||
}, | ||
@@ -46,3 +46,3 @@ "unimodulePeerDependencies": { | ||
}, | ||
"gitHead": "ec7878b9ce54f2537721218ae0fe4017e4004806" | ||
"gitHead": "3ad68bbd9847ebc8a55272c263b17d998a92f64f" | ||
} |
import { View } from 'react-native'; | ||
export type Props = { | ||
export type BlurProps = { | ||
tint: BlurTint; | ||
@@ -5,0 +5,0 @@ intensity: number; |
@@ -7,9 +7,9 @@ import { BlurTint } from './BlurView.types'; | ||
case 'dark': | ||
return `rgba(0,0,0,${opacity * 0.5})`; | ||
return `rgba(28,28,28,${opacity * 0.73})`; | ||
case 'light': | ||
return `rgba(255,255,255,${opacity * 0.7})`; | ||
return `rgba(247,247,247,${opacity * 0.8})`; | ||
case 'default': | ||
return `rgba(255,255,255,${opacity * 0.4})`; | ||
return `rgba(255,255,255,${opacity * 0.3})`; | ||
} | ||
throw new Error(`Unsupported tint provided: ${tint}`); | ||
} |
import BlurView from './BlurView'; | ||
export { BlurView }; | ||
export { BlurTint, BlurProps } from './BlurView.types'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39
48451
530
1