2019-03-27 12:57:24 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import * as React from 'react';
|
|
|
|
import {View} from 'react-native';
|
|
|
|
|
|
|
|
type ViewProps = React.ElementProps<typeof View>;
|
|
|
|
type ViewStyleProp = $PropertyType<ViewProps, 'style'>;
|
|
|
|
|
|
|
|
export type BlurType =
|
|
|
|
| 'xlight'
|
|
|
|
| 'light'
|
|
|
|
| 'dark'
|
2020-01-18 09:00:51 +00:00
|
|
|
// iOS 13+ only
|
|
|
|
| "chromeMaterial"
|
|
|
|
| "material"
|
|
|
|
| "thickMaterial"
|
|
|
|
| "thinMaterial"
|
|
|
|
| "ultraThinMaterial"
|
|
|
|
| "chromeMaterialDark"
|
|
|
|
| "materialDark"
|
|
|
|
| "thickMaterialDark"
|
|
|
|
| "thinMaterialDark"
|
|
|
|
| "ultraThinMaterialDark"
|
|
|
|
| "chromeMaterialLight"
|
|
|
|
| "materialLight"
|
|
|
|
| "thickMaterialLight"
|
|
|
|
| "thinMaterialLight"
|
|
|
|
| "ultraThinMaterialLight"
|
2019-03-27 12:57:24 +00:00
|
|
|
// tvOS and iOS 10+ only
|
|
|
|
| 'regular'
|
|
|
|
| 'prominent'
|
|
|
|
// tvOS only
|
|
|
|
| 'extraDark';
|
|
|
|
|
|
|
|
export type BlurViewProps = {
|
2019-08-21 16:16:06 +00:00
|
|
|
blurType?: BlurType,
|
|
|
|
blurAmount?: number, // 0 - 100,
|
|
|
|
reducedTransparencyFallbackColor?: String,
|
2019-03-27 12:57:24 +00:00
|
|
|
style?: ?ViewStyleProp,
|
|
|
|
};
|
|
|
|
|
|
|
|
export class BlurView extends React.Component<BlurViewProps> {
|
|
|
|
static defaultProps = {
|
|
|
|
blurType: 'dark',
|
|
|
|
blurAmount: 10,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export type VibrancyViewProps = BlurViewProps;
|
|
|
|
|
|
|
|
export class VibrancyView extends React.Component<VibrancyViewProps> {
|
|
|
|
static defaultProps = {
|
|
|
|
blurAmount: 10,
|
|
|
|
};
|
|
|
|
}
|