diff --git a/index.js b/index similarity index 97% rename from index.js rename to index index 004e4c9..3c91a66 100644 --- a/index.js +++ b/index @@ -23,6 +23,7 @@ export default class Ripple extends PureComponent { rippleCentered: false, rippleSequential: false, rippleFades: true, + rippleOverflow: false, disabled: false, onRippleAnimation: (animation, callback) => animation.start(callback), @@ -40,6 +41,7 @@ export default class Ripple extends PureComponent { rippleCentered: PropTypes.bool, rippleSequential: PropTypes.bool, rippleFades: PropTypes.bool, + rippleOverflow: PropTypes.bool, disabled: PropTypes.bool, onRippleAnimation: PropTypes.func, @@ -232,6 +234,7 @@ export default class Ripple extends PureComponent { rippleCentered, rippleSequential, rippleFades, + rippleOverflow, ...props } = this.props; @@ -260,6 +263,7 @@ export default class Ripple extends PureComponent { let containerStyle = { borderRadius: rippleContainerBorderRadius, + overflow: rippleOverflow ? 'visible' : 'hidden' }; return ( diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..426d5ae --- /dev/null +++ b/index.d.ts @@ -0,0 +1,32 @@ +declare module 'react-native-material-ripple' { + import React from 'react'; + import { + Animated, + ViewProps, + TouchableWithoutFeedbackProps, + ViewStyle, + } from 'react-native'; + + export type RippleProps = { + rippleColor?: string; + rippleOpacity?: number; + rippleDuration?: number; + rippleSize?: number; + rippleContainerBorderRadius?: number; + rippleCentered?: boolean; + rippleSequential?: boolean; + rippleFades?: boolean; + rippleOverflow?: boolean; + disabled?: boolean; + onRippleAnimation?: ( + animation: Animated.CompositeAnimation, + callback: () => void, + ) => void; + }; + + const Ripple: React.ComponentType | ViewStyle) & + TouchableWithoutFeedbackProps>; + + export default Ripple; +} \ No newline at end of file diff --git a/package.json b/package.json index 5d6bf65..6cc0851 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-material-ripple", - "version": "0.9.1", + "version": "0.9.2", "license": "BSD-3-Clause", "author": "Alexander Nazarov ", diff --git a/readme.md b/readme.md index 8087c8e..eff53c9 100644 --- a/readme.md +++ b/readme.md @@ -62,6 +62,7 @@ class Example extends Component { rippleCentered | Ripple always starts from center | Boolean | false rippleSequential | Ripple should start in sequence | Boolean | false rippleFades | Ripple fades out | Boolean | true + rippleOverflow | Ripple can overflow its container | Boolean | false disabled | Ripple should ignore touches | Boolean | false onPressIn | Touch moved in or started callback | Function | - onPressOut | Touch moved out or terminated callback | Function | -