@razorpay/blade
Version:
The Design System that powers Razorpay
19 lines (16 loc) • 1.4 kB
JavaScript
import 'react';
import styled from 'styled-components/native';
import Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated';
import { getAnimatedChipStyles } from './getAnimatedChipStyles.js';
import { chipMotionTokens } from './chipTokens.js';
import getIn from '../../utils/lodashButBetter/get.js';
import '@gorhom/portal';
import 'react-native-gesture-handler';
import useTheme from '../BladeProvider/useTheme.js';
import 'react-native';
import '@babel/runtime/helpers/slicedToArray';
import '../BottomSheet/BottomSheetStack.js';
import { jsx } from 'react/jsx-runtime';
var StyledAnimatedChip=styled(Animated.View)(function(props){return Object.assign({},getAnimatedChipStyles(props),{alignSelf:'center'});});var AnimatedChip=function AnimatedChip(_ref){var borderColor=_ref.borderColor,children=_ref.children,isPressed=_ref.isPressed,isDisabled=_ref.isDisabled;var _useTheme=useTheme(),theme=_useTheme.theme;var easing=getIn(theme.motion,chipMotionTokens.easing);var duration=getIn(theme.motion,chipMotionTokens.duration);var chipAnimation=useAnimatedStyle(function(){return {transform:[{scale:withTiming(isPressed?0.92:1,{duration:duration,easing:easing})}]};},[isPressed]);return jsx(StyledAnimatedChip,{borderColor:borderColor,isDisabled:isDisabled,style:chipAnimation,children:children});};
export { AnimatedChip };
//# sourceMappingURL=AnimatedChip.native.js.map