react-native-inner-shadow
Version:
react native inner shadows with linear gradient design UI
92 lines • 3.37 kB
TypeScript
import type { AnimatedProp, Color } from '@shopify/react-native-skia';
import type { ReactNode } from 'react';
import type { PressableProps, ViewProps, ViewStyle } from 'react-native';
export type ShadowViewProps = InnerShadowProps | LinearInnerShadowProps;
export type ShadowProps = {
inset?: boolean;
shadowColor?: string;
shadowOffset?: {
width: number;
height: number;
};
shadowBlur?: number;
shadowRadius?: number;
shadowOpacity?: number;
boxShadow?: string;
reflectedLightColor?: string;
reflectedLightOffset?: {
width: number;
height: number;
};
reflectedLightBlur?: number;
};
export interface InnerShadowProps extends ViewProps, ShadowProps {
children?: ReactNode;
isReflectedLightEnabled?: boolean;
width?: number;
height?: number;
backgroundColor?: string;
}
export type LINEAR_DIRECTION = 'top' | 'bottom' | 'left' | 'right' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
export type GradientLinearProps = {
from?: LINEAR_DIRECTION;
to?: LINEAR_DIRECTION;
colors: AnimatedProp<Color[]>;
};
export type RadialGradientProps = {
center?: {
x: number;
y: number;
};
radius?: number;
colors: AnimatedProp<Color[]>;
};
export interface LinearInnerShadowProps extends InnerShadowProps, GradientLinearProps {
}
export interface RadialInnerShadowProps extends InnerShadowProps, RadialGradientProps {
}
export type ShadowPressableProps = PressableProps & Omit<InnerShadowProps, 'inset'> & {
shadowSpace?: number;
initialDepth?: number;
duration?: number;
damping?: number;
};
export type LinearShadowPressableProps = ShadowPressableProps & GradientLinearProps;
export type RadialShadowPressableProps = ShadowPressableProps & RadialGradientProps;
export type ShadowToggleProps = ShadowPressableProps & {
isActive?: boolean;
activeColor?: string;
};
export type LinearShadowToggleProps = ShadowToggleProps & GradientLinearProps;
export type RadialShadowToggleProps = ShadowToggleProps & RadialGradientProps;
export type GetBackgroundColorProps = {
backgroundColor?: string;
styleBackground?: ViewStyle['backgroundColor'];
};
export type GetBorderRadiusProps = {
borderRadius?: ViewStyle['borderRadius'];
borderTopStartRadius?: ViewStyle['borderTopStartRadius'];
borderTopLeftRadius?: ViewStyle['borderTopLeftRadius'];
borderTopEndRadius?: ViewStyle['borderTopEndRadius'];
borderTopRightRadius?: ViewStyle['borderTopRightRadius'];
borderBottomStartRadius?: ViewStyle['borderBottomStartRadius'];
borderBottomLeftRadius?: ViewStyle['borderBottomLeftRadius'];
borderBottomEndRadius?: ViewStyle['borderBottomEndRadius'];
borderBottomRightRadius?: ViewStyle['borderBottomRightRadius'];
};
export type ShadowPropertyConfig = Omit<ShadowProps, 'boxShadow' | 'shadowRadius' | 'shadowOpacity'>;
export type ReflectedLightPositionConfig = {
inset?: boolean;
reflectedLightScale?: number;
baseShadowOffset: number;
};
export type GetOuterShadowOffsetProps = {
elevation?: number;
} & Omit<ShadowProps, 'reflectedLightColor' | 'reflectedLightOffset' | 'reflectedLightBlur'>;
export type GetLinearDirectionProps = {
width: number;
height: number;
from: LINEAR_DIRECTION;
to: LINEAR_DIRECTION;
};
//# sourceMappingURL=types.d.ts.map