@bigbinary/neetoui-rn 0.0.186 → 0.0.189
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2 -1
- package/lib/components/BottomTabBar.js +1 -1
- package/lib/components/FlashList.js +1 -1
- package/lib/components/Input.js +1 -1
- package/lib/components/ListItem.js +1 -1
- package/package.json +1 -1
- package/src/components/BottomTabBar.js +25 -23
- package/src/components/FlashList.js +19 -8
- package/src/components/Input.js +31 -24
- package/src/components/ListItem.js +1 -1
package/index.d.ts
CHANGED
|
@@ -246,7 +246,7 @@ interface FabProps extends TouchableProps {
|
|
|
246
246
|
|
|
247
247
|
interface FlashListProps extends RNFlashListProps {
|
|
248
248
|
SkeletonComponent?: React.FC;
|
|
249
|
-
|
|
249
|
+
animationDuration?: number;
|
|
250
250
|
data: Array<any>;
|
|
251
251
|
isLoading?: boolean;
|
|
252
252
|
placeHolderItemCount?: number;
|
|
@@ -266,6 +266,7 @@ type InputProps = {
|
|
|
266
266
|
autoFocus?: boolean;
|
|
267
267
|
disabled?: boolean;
|
|
268
268
|
noBorder?: boolean;
|
|
269
|
+
showInputAccessoryView?: boolean;
|
|
269
270
|
inputProps?: RNTextInputProps;
|
|
270
271
|
};
|
|
271
272
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.BottomTabBar=void 0;var _react=_interopRequireWildcard(require("react"));var _reactNativeRemixIcon=_interopRequireDefault(require("react-native-remix-icon"));var _propTypes=_interopRequireDefault(require("prop-types"));var _reactNative=require("react-native");var _reactNativeReanimated=_interopRequireWildcard(require("react-native-reanimated"));var _=require("./");var _native=require("styled-components/native");var _jsxFileName="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/BottomTabBar.js",_this=this;function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}function TabElement(_ref){var isFocused=_ref.isFocused,onPress=_ref.onPress,name=_ref.name,tabBarActiveTintColor=_ref.tabBarActiveTintColor,tabBarInactiveTintColor=_ref.tabBarInactiveTintColor,icon=_ref.icon,size=_ref.size;var theme=(0,_react.useContext)(_native.ThemeContext);var offset=(0,_reactNativeReanimated.useSharedValue)(isFocused?1:0);(0,_react.useEffect)(function(){if(isFocused){offset.value=(0,_reactNativeReanimated.withTiming)(1,{duration:500});}else{offset.value=(0,_reactNativeReanimated.withTiming)(0,{duration:0});}},[isFocused]);var animatedStyles=(0,_reactNativeReanimated.useAnimatedStyle)(function(){var _f=function _f(){return{opacity:(0,_reactNativeReanimated.interpolate)(offset.value,[0,1],[1,0],{extrapolateRight:_reactNativeReanimated.Extrapolation.CLAMP})};};_f._closure={interpolate:_reactNativeReanimated.interpolate,offset:offset,Extrapolation:{CLAMP:_reactNativeReanimated.Extrapolation.CLAMP}};_f.asString="function _f(){const{interpolate,offset,Extrapolation}=jsThis._closure;{return{opacity:interpolate(offset.value,[0,1],[1,0],{extrapolateRight:Extrapolation.CLAMP})};}}";_f.__workletHash=10271988492931;_f.__location="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/BottomTabBar.js (
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.BottomTabBar=void 0;var _react=_interopRequireWildcard(require("react"));var _reactNativeRemixIcon=_interopRequireDefault(require("react-native-remix-icon"));var _propTypes=_interopRequireDefault(require("prop-types"));var _reactNative=require("react-native");var _reactNativeReanimated=_interopRequireWildcard(require("react-native-reanimated"));var _=require("./");var _native=require("styled-components/native");var _jsxFileName="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/BottomTabBar.js",_this=this;function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}function TabElement(_ref){var isFocused=_ref.isFocused,onPress=_ref.onPress,name=_ref.name,tabBarActiveTintColor=_ref.tabBarActiveTintColor,tabBarInactiveTintColor=_ref.tabBarInactiveTintColor,icon=_ref.icon,size=_ref.size;var theme=(0,_react.useContext)(_native.ThemeContext);var offset=(0,_reactNativeReanimated.useSharedValue)(isFocused?1:0);(0,_react.useEffect)(function(){if(isFocused){offset.value=(0,_reactNativeReanimated.withTiming)(1,{duration:500});}else{offset.value=(0,_reactNativeReanimated.withTiming)(0,{duration:0});}},[isFocused]);var animatedStyles=(0,_reactNativeReanimated.useAnimatedStyle)(function(){var _f=function _f(){return{opacity:(0,_reactNativeReanimated.interpolate)(offset.value,[0,1],[1,0],{extrapolateRight:_reactNativeReanimated.Extrapolation.CLAMP})};};_f._closure={interpolate:_reactNativeReanimated.interpolate,offset:offset,Extrapolation:{CLAMP:_reactNativeReanimated.Extrapolation.CLAMP}};_f.asString="function _f(){const{interpolate,offset,Extrapolation}=jsThis._closure;{return{opacity:interpolate(offset.value,[0,1],[1,0],{extrapolateRight:Extrapolation.CLAMP})};}}";_f.__workletHash=10271988492931;_f.__location="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/BottomTabBar.js (93:42)";_f.__optimalization=3;return _f;}());var animatedStyles2=(0,_reactNativeReanimated.useAnimatedStyle)(function(){var _f=function _f(){return{opacity:(0,_reactNativeReanimated.interpolate)(offset.value,[0,0.9,1],[0,0.5,1],{extrapolateRight:_reactNativeReanimated.Extrapolation.CLAMP}),transform:[{scale:(0,_reactNativeReanimated.interpolate)(offset.value,[0,0.8,1],[1,1.2,1],{extrapolateRight:_reactNativeReanimated.Extrapolation.CLAMP})}]};};_f._closure={interpolate:_reactNativeReanimated.interpolate,offset:offset,Extrapolation:{CLAMP:_reactNativeReanimated.Extrapolation.CLAMP}};_f.asString="function _f(){const{interpolate,offset,Extrapolation}=jsThis._closure;{return{opacity:interpolate(offset.value,[0,0.9,1],[0,0.5,1],{extrapolateRight:Extrapolation.CLAMP}),transform:[{scale:interpolate(offset.value,[0,0.8,1],[1,1.2,1],{extrapolateRight:Extrapolation.CLAMP})}]};}}";_f.__workletHash=9420491443699;_f.__location="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/BottomTabBar.js (101:43)";_f.__optimalization=3;return _f;}());return _react.default.createElement(_reactNative.TouchableWithoutFeedback,{onPress:onPress,__self:this,__source:{fileName:_jsxFileName,lineNumber:117,columnNumber:5}},_react.default.createElement(_.Container,{flex:1,alignItems:"center",borderTopWidth:1,borderColor:"background.grey200",__self:this,__source:{fileName:_jsxFileName,lineNumber:118,columnNumber:7}},_react.default.createElement(_.Container,{height:35,width:48,alignItems:"center",mb:1,__self:this,__source:{fileName:_jsxFileName,lineNumber:124,columnNumber:9}},_react.default.createElement(_reactNativeReanimated.default.View,{style:[styles.iconContainer,animatedStyles],__self:this,__source:{fileName:_jsxFileName,lineNumber:125,columnNumber:11}},_react.default.createElement(_reactNativeRemixIcon.default,{size:size,color:theme.colors.font.grey500,name:icon,__self:this,__source:{fileName:_jsxFileName,lineNumber:126,columnNumber:13}})),_react.default.createElement(_reactNativeReanimated.default.View,{style:[styles.iconContainer,animatedStyles2],__self:this,__source:{fileName:_jsxFileName,lineNumber:128,columnNumber:11}},_react.default.createElement(_reactNativeRemixIcon.default,{size:size,color:theme.colors.font.base,name:icon,__self:this,__source:{fileName:_jsxFileName,lineNumber:129,columnNumber:13}}))),_react.default.createElement(_.Typography,{color:isFocused?tabBarActiveTintColor:tabBarInactiveTintColor,fontFamily:"sf500",fontSize:"4xs",__self:this,__source:{fileName:_jsxFileName,lineNumber:132,columnNumber:9}},name)));}var styles=_reactNative.StyleSheet.create({iconContainer:{position:"absolute",margin:10}});var BottomTabBar=function BottomTabBar(_ref2){var state=_ref2.state,descriptors=_ref2.descriptors,navigation=_ref2.navigation;return _react.default.createElement(_.Container,{flexDirection:"row",height:_reactNative.Platform.OS==="android"?63:83,bg:"background.white",__self:_this,__source:{fileName:_jsxFileName,lineNumber:153,columnNumber:5}},state.routes.map(function(_ref3,index){var key=_ref3.key,name=_ref3.name;var options=descriptors[key].options;var isFocused=state.index===index;var _options$customTabBar=options==null?void 0:options.customTabBarProps,icon=_options$customTabBar.icon,size=_options$customTabBar.size;var tabBarActiveTintColor=options.tabBarActiveTintColor,tabBarInactiveTintColor=options.tabBarInactiveTintColor;var onPress=function onPress(){var event=navigation.emit({type:"tabPress",target:key,canPreventDefault:true});if(!isFocused&&!event.defaultPrevented){navigation.navigate({name:name,merge:true});}};return _react.default.createElement(TabElement,{key:index,onPress:onPress,isFocused:isFocused,name:name,tabBarActiveTintColor:tabBarActiveTintColor,tabBarInactiveTintColor:tabBarInactiveTintColor,icon:icon,size:size,__self:_this,__source:{fileName:_jsxFileName,lineNumber:176,columnNumber:11}});}));};exports.BottomTabBar=BottomTabBar;TabElement.propTypes={isFocused:_propTypes.default.bool,onPress:_propTypes.default.func,name:_propTypes.default.string,tabBarActiveTintColor:_propTypes.default.string,tabBarInactiveTintColor:_propTypes.default.string,icon:_propTypes.default.string,size:_propTypes.default.number};BottomTabBar.propTypes={state:_propTypes.default.object,descriptors:_propTypes.default.object,navigation:_propTypes.default.object};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.FlashList=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _flashList=require("@shopify/flash-list");var _reactNativeReanimated=_interopRequireWildcard(require("react-native-reanimated"));var _propTypes=_interopRequireDefault(require("prop-types"));var _native=_interopRequireWildcard(require("react-content-loader/native"));var _native2=require("styled-components/native");var _reactNative=require("react-native");var _hooks=require("../hooks");var _excluded=["
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.FlashList=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _flashList=require("@shopify/flash-list");var _reactNativeReanimated=_interopRequireWildcard(require("react-native-reanimated"));var _propTypes=_interopRequireDefault(require("prop-types"));var _native=_interopRequireWildcard(require("react-content-loader/native"));var _native2=require("styled-components/native");var _reactNative=require("react-native");var _hooks=require("../hooks");var _excluded=["animationDuration","SkeletonComponent","placeHolderItemCount","isLoading","data","onRefresh","onEndReached","keyExtractor"],_excluded2=["renderItem","animationDuration","isLoading","SkeletonComponent"];var _this=this,_jsxFileName="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/FlashList.js";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var _Dimensions$get=_reactNative.Dimensions.get("screen"),width=_Dimensions$get.width;var Placeholder=function Placeholder(){var theme=(0,_react.useContext)(_native2.ThemeContext);return _react.default.createElement(_native.default,{marginHorizontal:15,height:"60",width:400,viewBox:"0 0 400 50",backgroundColor:theme.colors.lightgrey,foregroundColor:theme.colors.grey300,__self:_this,__source:{fileName:_jsxFileName,lineNumber:24,columnNumber:5}},_react.default.createElement(_native.Rect,{x:"0",rx:"5",ry:"5",width:width-30,height:"50",__self:_this,__source:{fileName:_jsxFileName,lineNumber:32,columnNumber:7}}));};var FlashList=function FlashList(_ref){var _ref$animationDuratio=_ref.animationDuration,animationDuration=_ref$animationDuratio===void 0?2000:_ref$animationDuratio,SkeletonComponent=_ref.SkeletonComponent,_ref$placeHolderItemC=_ref.placeHolderItemCount,placeHolderItemCount=_ref$placeHolderItemC===void 0?10:_ref$placeHolderItemC,_ref$isLoading=_ref.isLoading,isLoading=_ref$isLoading===void 0?false:_ref$isLoading,_ref$data=_ref.data,data=_ref$data===void 0?[]:_ref$data,_ref$onRefresh=_ref.onRefresh,onRefresh=_ref$onRefresh===void 0?function(){}:_ref$onRefresh,_ref$onEndReached=_ref.onEndReached,onEndReached=_ref$onEndReached===void 0?function(){}:_ref$onEndReached,_keyExtractor=_ref.keyExtractor,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var dummyData=Array.apply(null,Array(placeHolderItemCount));var _useRefreshByUser=(0,_hooks.useRefreshByUser)(onRefresh),isRefetchingByUser=_useRefreshByUser.isRefetchingByUser,refetchByUser=_useRefreshByUser.refetchByUser;return _react.default.createElement(FadeInFlatList,(0,_extends2.default)({key:isLoading,animationDuration:animationDuration,SkeletonComponent:SkeletonComponent,isLoading:isLoading,extraData:{isLoading:isLoading,placeHolderItemCount:placeHolderItemCount},data:isLoading?dummyData:data,refreshControl:onRefresh&&_react.default.createElement(_reactNative.RefreshControl,{refreshing:isRefetchingByUser,onRefresh:refetchByUser,__self:_this,__source:{fileName:_jsxFileName,lineNumber:62,columnNumber:11}}),placeHolderItemCount:placeHolderItemCount,keyExtractor:function keyExtractor(item,index){return isLoading||!_keyExtractor?index.toString():_keyExtractor(item,index);}},rest,{onEndReached:isLoading?undefined:onEndReached,__self:_this,__source:{fileName:_jsxFileName,lineNumber:53,columnNumber:5}}));};exports.FlashList=FlashList;var FadeInFlatList=function FadeInFlatList(_ref2){var originalRenderItem=_ref2.renderItem,animationDuration=_ref2.animationDuration,_ref2$isLoading=_ref2.isLoading,isLoading=_ref2$isLoading===void 0?false:_ref2$isLoading,SkeletonComponent=_ref2.SkeletonComponent,props=(0,_objectWithoutProperties2.default)(_ref2,_excluded2);var value=(0,_reactNativeReanimated.useSharedValue)(0);var FadeInComponent=(0,_react.useCallback)(function(_ref3){var index=_ref3.index,children=_ref3.children;var inputRange=[index-1,index,index+1,index+2];var animatedStyles=(0,_reactNativeReanimated.useAnimatedStyle)(function(){var _f=function _f(){return{opacity:(0,_reactNativeReanimated.interpolate)(value.value,inputRange,[0,0.6,1,1],_reactNativeReanimated.Extrapolation.CLAMP),transform:[{translateX:(0,_reactNativeReanimated.interpolate)(value.value,inputRange,[25,15,10,0],_reactNativeReanimated.Extrapolation.CLAMP)}]};};_f._closure={interpolate:_reactNativeReanimated.interpolate,value:value,inputRange:inputRange,Extrapolation:{CLAMP:_reactNativeReanimated.Extrapolation.CLAMP}};_f.asString="function _f(){const{interpolate,value,inputRange,Extrapolation}=jsThis._closure;{return{opacity:interpolate(value.value,inputRange,[0,0.6,1,1],Extrapolation.CLAMP),transform:[{translateX:interpolate(value.value,inputRange,[25,15,10,0],Extrapolation.CLAMP)}]};}}";_f.__workletHash=2524714757658;_f.__location="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/FlashList.js (92:46)";_f.__optimalization=3;return _f;}());return _react.default.createElement(_reactNativeReanimated.default.View,{style:animatedStyles,__self:_this,__source:{fileName:_jsxFileName,lineNumber:113,columnNumber:14}},children);},[]);var Item=function Item(_ref4){var _item$extraData;var item=_ref4.item;return item!=null&&(_item$extraData=item.extraData)!=null&&_item$extraData.isLoading?_react.default.createElement(FadeInComponent,{index:item.index,__self:_this,__source:{fileName:_jsxFileName,lineNumber:121,columnNumber:7}},SkeletonComponent||_react.default.createElement(Placeholder,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:122,columnNumber:31}})):_react.default.createElement(FadeInComponent,{index:item.index,__self:_this,__source:{fileName:_jsxFileName,lineNumber:125,columnNumber:7}},originalRenderItem(item));};var renderItem=function renderItem(item){return isLoading||item.index<props.placeHolderItemCount?_react.default.createElement(Item,{item:item,__self:_this,__source:{fileName:_jsxFileName,lineNumber:133,columnNumber:7}}):originalRenderItem(item);};(0,_react.useEffect)(function(){value.value=0;value.value=(0,_reactNativeReanimated.withSequence)((0,_reactNativeReanimated.withTiming)(20,{duration:animationDuration}),(0,_reactNativeReanimated.withTiming)(props.data.length+1,{duration:0}));return function(){(0,_reactNativeReanimated.cancelAnimation)(value);};},[animationDuration,value,props.data.length,isLoading]);return _react.default.createElement(_flashList.FlashList,(0,_extends2.default)({},props,{renderItem:renderItem,__self:_this,__source:{fileName:_jsxFileName,lineNumber:156,columnNumber:10}}));};FlashList.propTypes={SkeletonComponent:_propTypes.default.element,animationDuration:_propTypes.default.number,data:_propTypes.default.array.isRequired,isLoading:_propTypes.default.bool,placeHolderItemCount:_propTypes.default.number,onRefresh:_propTypes.default.func,onEndReached:_propTypes.default.func,keyExtractor:_propTypes.default.func};
|
package/lib/components/Input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.styles=exports.Input=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _taggedTemplateLiteralLoose2=_interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));var _react=_interopRequireWildcard(require("react"));var _styledSystem=require("styled-system");var _reactNative=require("react-native");var _native=_interopRequireWildcard(require("styled-components/native"));var _propTypes=_interopRequireDefault(require("prop-types"));var _=require("./");var _theme=require("../../src/theme");var _excluded=["label","value","onChangeText","onBlur","errorMessage","PrefixIcon","SuffixIcon","autoFocus","disabled","noBorder","textAlignVertical"];var _templateObject,_templateObject2,_templateObject3,_this=this,_jsxFileName="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/Input.js";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var TextInput=_native.default.TextInput(_templateObject||(_templateObject=(0,_taggedTemplateLiteralLoose2.default)(["\n ","\n ","\n ","\n ","\n ","\n ","\n"])),_styledSystem.flexbox,_styledSystem.space,_styledSystem.border,_styledSystem.buttonStyle,_styledSystem.typography,_styledSystem.color);var View=_native.default.View(_templateObject2||(_templateObject2=(0,_taggedTemplateLiteralLoose2.default)(["\n ","\n ","\n ","\n ","\n ","\n"])),_styledSystem.flexbox,_styledSystem.space,_styledSystem.border,_styledSystem.color,_styledSystem.layout);var Typography=_native.default.Text(_templateObject3||(_templateObject3=(0,_taggedTemplateLiteralLoose2.default)(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n"])),_styledSystem.textStyle,_styledSystem.space,_styledSystem.layout,_styledSystem.flexbox,_styledSystem.typography,_styledSystem.color,_styledSystem.position,(0,_styledSystem.system)({textDecoration:{property:"textDecoration",cssProperty:"textDecoration"},textTransform:{property:"textTransform",cssProperty:"textTransform"}}));var AnimatedLabel=_reactNative.Animated.createAnimatedComponent(Typography);var Input=function Input(props){var _rest$inputProps,_rest$inputProps2,_rest$inputProps3;var label=props.label,_props$value=props.value,value=_props$value===void 0?"":_props$value,_props$onChangeText=props.onChangeText,onChangeText=_props$onChangeText===void 0?function(){}:_props$onChangeText,_props$onBlur=props.onBlur,_onBlur=_props$onBlur===void 0?function(){}:_props$onBlur,_props$errorMessage=props.errorMessage,errorMessage=_props$errorMessage===void 0?null:_props$errorMessage,PrefixIcon=props.PrefixIcon,SuffixIcon=props.SuffixIcon,_props$autoFocus=props.autoFocus,autoFocus=_props$autoFocus===void 0?false:_props$autoFocus,_props$disabled=props.disabled,disabled=_props$disabled===void 0?false:_props$disabled,_props$noBorder=props.noBorder,noBorder=_props$noBorder===void 0?false:_props$noBorder,_props$textAlignVerti=props.textAlignVertical,textAlignVertical=_props$textAlignVerti===void 0?"top":_props$textAlignVerti,rest=(0,_objectWithoutProperties2.default)(props,_excluded);var _useWindowDimensions=(0,_reactNative.useWindowDimensions)(),width=_useWindowDimensions.width;var colors=(0,_react.useContext)(_native.ThemeContext).colors;var inputRef=(0,_react.useRef)();var containerRef=(0,_react.useRef)();var animatedController=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;(0,_react.useEffect)(function(){if(autoFocus){handleLabelAnimation(true);}else{handleLabelAnimation(false);}},[autoFocus]);(0,_react.useEffect)(function(){if(value){if(Math.floor(animatedController._value)===0){handleLabelAnimation(true);}}else{handleLabelAnimation(false);}},[value]);var handleLabelAnimation=function handleLabelAnimation(isFocused){_reactNative.Animated.timing(animatedController,{toValue:!!isFocused||!!value?1:0,duration:300,useNativeDriver:false}).start();!!label&&inputRef.current&&inputRef.current.setNativeProps({style:{top:isFocused?10:0}});};var handleStyles=(0,_react.useCallback)(function(isFocused){containerRef.current&&containerRef.current.setNativeProps({borderColor:errorMessage?colors.border.danger:isFocused?colors.border.purple500:colors.border.grey400,borderWidth:errorMessage||isFocused?1.5:1});},[]);var labelStyles={fontSize:animatedController.interpolate({inputRange:[0,1],outputRange:[17,13]}),top:animatedController.interpolate({inputRange:[0,1],outputRange:[14,6]})};var handleFocusBlur=function handleFocusBlur(isFocused){if(label){if(!value)handleLabelAnimation(isFocused);if(!noBorder)handleStyles(isFocused);}};return _react.default.createElement(View,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.styles=exports.Input=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _taggedTemplateLiteralLoose2=_interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));var _react=_interopRequireWildcard(require("react"));var _styledSystem=require("styled-system");var _reactNative=require("react-native");var _native=_interopRequireWildcard(require("styled-components/native"));var _propTypes=_interopRequireDefault(require("prop-types"));var _=require("./");var _theme=require("../../src/theme");var _excluded=["label","value","onChangeText","onBlur","errorMessage","PrefixIcon","SuffixIcon","autoFocus","disabled","noBorder","showInputAccessoryView","textAlignVertical"];var _templateObject,_templateObject2,_templateObject3,_this=this,_jsxFileName="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/Input.js";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var TextInput=_native.default.TextInput(_templateObject||(_templateObject=(0,_taggedTemplateLiteralLoose2.default)(["\n ","\n ","\n ","\n ","\n ","\n ","\n"])),_styledSystem.flexbox,_styledSystem.space,_styledSystem.border,_styledSystem.buttonStyle,_styledSystem.typography,_styledSystem.color);var View=_native.default.View(_templateObject2||(_templateObject2=(0,_taggedTemplateLiteralLoose2.default)(["\n ","\n ","\n ","\n ","\n ","\n"])),_styledSystem.flexbox,_styledSystem.space,_styledSystem.border,_styledSystem.color,_styledSystem.layout);var Typography=_native.default.Text(_templateObject3||(_templateObject3=(0,_taggedTemplateLiteralLoose2.default)(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n"])),_styledSystem.textStyle,_styledSystem.space,_styledSystem.layout,_styledSystem.flexbox,_styledSystem.typography,_styledSystem.color,_styledSystem.position,(0,_styledSystem.system)({textDecoration:{property:"textDecoration",cssProperty:"textDecoration"},textTransform:{property:"textTransform",cssProperty:"textTransform"}}));var AnimatedLabel=_reactNative.Animated.createAnimatedComponent(Typography);var Input=function Input(props){var _rest$inputProps,_rest$inputProps2,_rest$inputProps3;var label=props.label,_props$value=props.value,value=_props$value===void 0?"":_props$value,_props$onChangeText=props.onChangeText,onChangeText=_props$onChangeText===void 0?function(){}:_props$onChangeText,_props$onBlur=props.onBlur,_onBlur=_props$onBlur===void 0?function(){}:_props$onBlur,_props$errorMessage=props.errorMessage,errorMessage=_props$errorMessage===void 0?null:_props$errorMessage,PrefixIcon=props.PrefixIcon,SuffixIcon=props.SuffixIcon,_props$autoFocus=props.autoFocus,autoFocus=_props$autoFocus===void 0?false:_props$autoFocus,_props$disabled=props.disabled,disabled=_props$disabled===void 0?false:_props$disabled,_props$noBorder=props.noBorder,noBorder=_props$noBorder===void 0?false:_props$noBorder,_props$showInputAcces=props.showInputAccessoryView,showInputAccessoryView=_props$showInputAcces===void 0?true:_props$showInputAcces,_props$textAlignVerti=props.textAlignVertical,textAlignVertical=_props$textAlignVerti===void 0?"top":_props$textAlignVerti,rest=(0,_objectWithoutProperties2.default)(props,_excluded);var _useWindowDimensions=(0,_reactNative.useWindowDimensions)(),width=_useWindowDimensions.width;var colors=(0,_react.useContext)(_native.ThemeContext).colors;var inputRef=(0,_react.useRef)();var containerRef=(0,_react.useRef)();var animatedController=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;(0,_react.useEffect)(function(){if(autoFocus){handleLabelAnimation(true);}else{handleLabelAnimation(false);}},[autoFocus]);(0,_react.useEffect)(function(){if(value){if(Math.floor(animatedController._value)===0){handleLabelAnimation(true);}}else{handleLabelAnimation(false);}},[value]);var handleLabelAnimation=function handleLabelAnimation(isFocused){_reactNative.Animated.timing(animatedController,{toValue:!!isFocused||!!value?1:0,duration:300,useNativeDriver:false}).start();!!label&&inputRef.current&&inputRef.current.setNativeProps({style:{top:isFocused?10:0}});};var handleStyles=(0,_react.useCallback)(function(isFocused){containerRef.current&&containerRef.current.setNativeProps({borderColor:errorMessage?colors.border.danger:isFocused?colors.border.purple500:colors.border.grey400,borderWidth:errorMessage||isFocused?1.5:1});},[]);var labelStyles={fontSize:animatedController.interpolate({inputRange:[0,1],outputRange:[17,13]}),top:animatedController.interpolate({inputRange:[0,1],outputRange:[14,6]})};var handleFocusBlur=function handleFocusBlur(isFocused){if(label){if(!value)handleLabelAnimation(isFocused);if(!noBorder)handleStyles(isFocused);}};return _react.default.createElement(View,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:183,columnNumber:5}},_react.default.createElement(View,(0,_extends2.default)({ref:containerRef,borderRadius:8,borderWidth:noBorder?0:1,borderColor:errorMessage?"border.danger":"border.grey400",alignItems:"center",flexDirection:"row",justifyContent:"space-between"},!((_rest$inputProps=rest.inputProps)!=null&&_rest$inputProps.multiline)&&{height:58},{overflow:"hidden"},rest.containerProps,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:184,columnNumber:7}}),!!PrefixIcon&&_react.default.createElement(View,{pl:2,__self:_this,__source:{fileName:_jsxFileName,lineNumber:197,columnNumber:11}},_react.default.createElement(PrefixIcon,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:198,columnNumber:13}})),_react.default.createElement(View,{flex:1,left:10,__self:_this,__source:{fileName:_jsxFileName,lineNumber:201,columnNumber:9}},!!label&&_react.default.createElement(AnimatedLabel,{color:disabled?"font.grey400":"font.grey600",position:"absolute",zIndex:1,style:labelStyles,__self:_this,__source:{fileName:_jsxFileName,lineNumber:203,columnNumber:13}},label),_react.default.createElement(TextInput,(0,_extends2.default)({ref:inputRef,value:value,returnKeyType:(_rest$inputProps2=rest.inputProps)!=null&&_rest$inputProps2.multiline?"default":"done",onChangeText:onChangeText,autoFocus:autoFocus,editable:!disabled,onFocus:function onFocus(){handleFocusBlur(true);},onBlur:function onBlur(){_onBlur();handleFocusBlur(false);},inputAccessoryViewID:label,color:disabled?"font.grey500":"font.primary",fontSize:17,pr:3,top:0,zIndex:2,autoCapitalize:"none",mt:10,pb:3,pt:1,textAlignVertical:textAlignVertical},rest.inputProps,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:212,columnNumber:11}})),((_rest$inputProps3=rest.inputProps)==null?void 0:_rest$inputProps3.multiline)&&showInputAccessoryView&&_reactNative.Platform.OS==="ios"&&_react.default.createElement(_reactNative.InputAccessoryView,{nativeID:label,__self:_this,__source:{fileName:_jsxFileName,lineNumber:242,columnNumber:15}},_react.default.createElement(_.Container,{bg:"background.white",flexDirection:"row",p:2,width:width,justifyContent:"flex-end",alignItems:"center",pr:20,__self:_this,__source:{fileName:_jsxFileName,lineNumber:243,columnNumber:17}},_react.default.createElement(_.Button,{height:30,left:10,labelStyle:styles.doneButtonStyle,variant:"text",onPress:function onPress(){_reactNative.Keyboard.dismiss();},label:"Done",__self:_this,__source:{fileName:_jsxFileName,lineNumber:252,columnNumber:19}})))),!!SuffixIcon&&_react.default.createElement(View,{px:2,__self:_this,__source:{fileName:_jsxFileName,lineNumber:267,columnNumber:11}},_react.default.createElement(SuffixIcon,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:268,columnNumber:13}}))),!!errorMessage&&_react.default.createElement(Typography,{py:2,color:"font.danger",__self:_this,__source:{fileName:_jsxFileName,lineNumber:273,columnNumber:9}},errorMessage));};exports.Input=Input;Input.propTypes={label:_propTypes.default.string,value:_propTypes.default.string.isRequired,onChangeText:_propTypes.default.func.isRequired,onBlur:_propTypes.default.func,errorMessage:_propTypes.default.string,disabled:_propTypes.default.bool,autoFocus:_propTypes.default.bool,PrefixIcon:_propTypes.default.elementType,SuffixIcon:_propTypes.default.elementType,noBorder:_propTypes.default.bool,containerProps:_propTypes.default.object,textAlignVertical:_propTypes.default.oneOf(["auto","top","bottom","center"]),showInputAccessoryView:_propTypes.default.bool};var styles=_reactNative.StyleSheet.create({doneButtonStyle:{fontFamily:"sf700",color:_theme.theme.colors.font.base}});exports.styles=styles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ListItem=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var React=_interopRequireWildcard(require("react"));var _propTypes=_interopRequireDefault(require("prop-types"));var _propTypes2=_interopRequireDefault(require("@styled-system/prop-types"));var _=require("./");var _excluded=["LeftComponent","label","RightComponent"];var _this=this,_jsxFileName="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/ListItem.js";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var ListItem=function ListItem(_ref){var LeftComponent=_ref.LeftComponent,label=_ref.label,RightComponent=_ref.RightComponent,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);return React.createElement(_.Container,(0,_extends2.default)({flexDirection:"row",bg:"background.secondary",width:"100%",px:16,py:12,borderRadius:6,alignItems:"center",justifyContent:"space-between"},rest,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:35,columnNumber:5}}),React.createElement(_.Container,{flexDirection:"row",alignItems:"center",width:"50%",__self:_this,__source:{fileName:_jsxFileName,lineNumber:46,columnNumber:7}},LeftComponent&&React.createElement(LeftComponent,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:47,columnNumber:27}}),React.createElement(_.Typography,{color:"font.grey800",fontSize:"l",fontFamily:"
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ListItem=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var React=_interopRequireWildcard(require("react"));var _propTypes=_interopRequireDefault(require("prop-types"));var _propTypes2=_interopRequireDefault(require("@styled-system/prop-types"));var _=require("./");var _excluded=["LeftComponent","label","RightComponent"];var _this=this,_jsxFileName="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/ListItem.js";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var ListItem=function ListItem(_ref){var LeftComponent=_ref.LeftComponent,label=_ref.label,RightComponent=_ref.RightComponent,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);return React.createElement(_.Container,(0,_extends2.default)({flexDirection:"row",bg:"background.secondary",width:"100%",px:16,py:12,borderRadius:6,alignItems:"center",justifyContent:"space-between"},rest,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:35,columnNumber:5}}),React.createElement(_.Container,{flexDirection:"row",alignItems:"center",width:"50%",__self:_this,__source:{fileName:_jsxFileName,lineNumber:46,columnNumber:7}},LeftComponent&&React.createElement(LeftComponent,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:47,columnNumber:27}}),React.createElement(_.Typography,{color:"font.grey800",fontSize:"l",fontFamily:"sf500",__self:_this,__source:{fileName:_jsxFileName,lineNumber:48,columnNumber:9}},label)),React.createElement(_.Container,{width:"50%",alignItems:"flex-end",__self:_this,__source:{fileName:_jsxFileName,lineNumber:52,columnNumber:7}},React.createElement(RightComponent,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:53,columnNumber:9}})));};exports.ListItem=ListItem;ListItem.propTypes=(0,_extends2.default)({},_propTypes2.default.flexbox,_propTypes2.default.space,_propTypes2.default.border,_propTypes2.default.color,_propTypes2.default.layout,{LeftComponent:_propTypes.default.elementType,label:_propTypes.default.string.isRequired,RightComponent:_propTypes.default.elementType.isRequired});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext, useEffect } from "react";
|
|
2
2
|
import Icon from "react-native-remix-icon";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import { StyleSheet, Platform } from "react-native";
|
|
4
|
+
import { StyleSheet, Platform, TouchableWithoutFeedback } from "react-native";
|
|
5
5
|
import Animated, {
|
|
6
6
|
useSharedValue,
|
|
7
7
|
useAnimatedStyle,
|
|
@@ -9,6 +9,7 @@ import Animated, {
|
|
|
9
9
|
interpolate,
|
|
10
10
|
Extrapolation,
|
|
11
11
|
} from "react-native-reanimated";
|
|
12
|
+
|
|
12
13
|
import { Container, Typography } from "@components";
|
|
13
14
|
import { ThemeContext } from "styled-components/native";
|
|
14
15
|
|
|
@@ -113,29 +114,30 @@ function TabElement({
|
|
|
113
114
|
});
|
|
114
115
|
|
|
115
116
|
return (
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
>
|
|
123
|
-
<Container height={35} width={48} alignItems="center" mb={1}>
|
|
124
|
-
<Animated.View style={[styles.iconContainer, animatedStyles]}>
|
|
125
|
-
<Icon size={size} color={theme.colors.font.grey500} name={icon} />
|
|
126
|
-
</Animated.View>
|
|
127
|
-
<Animated.View style={[styles.iconContainer, animatedStyles2]}>
|
|
128
|
-
<Icon size={size} color={theme.colors.font.base} name={icon} />
|
|
129
|
-
</Animated.View>
|
|
130
|
-
</Container>
|
|
131
|
-
<Typography
|
|
132
|
-
color={isFocused ? tabBarActiveTintColor : tabBarInactiveTintColor}
|
|
133
|
-
fontFamily="sf500"
|
|
134
|
-
fontSize="4xs"
|
|
117
|
+
<TouchableWithoutFeedback onPress={onPress}>
|
|
118
|
+
<Container
|
|
119
|
+
flex={1}
|
|
120
|
+
alignItems="center"
|
|
121
|
+
borderTopWidth={1}
|
|
122
|
+
borderColor="background.grey200"
|
|
135
123
|
>
|
|
136
|
-
{
|
|
137
|
-
|
|
138
|
-
|
|
124
|
+
<Container height={35} width={48} alignItems="center" mb={1}>
|
|
125
|
+
<Animated.View style={[styles.iconContainer, animatedStyles]}>
|
|
126
|
+
<Icon size={size} color={theme.colors.font.grey500} name={icon} />
|
|
127
|
+
</Animated.View>
|
|
128
|
+
<Animated.View style={[styles.iconContainer, animatedStyles2]}>
|
|
129
|
+
<Icon size={size} color={theme.colors.font.base} name={icon} />
|
|
130
|
+
</Animated.View>
|
|
131
|
+
</Container>
|
|
132
|
+
<Typography
|
|
133
|
+
color={isFocused ? tabBarActiveTintColor : tabBarInactiveTintColor}
|
|
134
|
+
fontFamily="sf500"
|
|
135
|
+
fontSize="4xs"
|
|
136
|
+
>
|
|
137
|
+
{name}
|
|
138
|
+
</Typography>
|
|
139
|
+
</Container>
|
|
140
|
+
</TouchableWithoutFeedback>
|
|
139
141
|
);
|
|
140
142
|
}
|
|
141
143
|
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import React, { useCallback, useContext, useEffect } from "react";
|
|
3
3
|
import { FlashList as ShopifyFlashList } from "@shopify/flash-list";
|
|
4
4
|
import Animated, {
|
|
5
|
+
cancelAnimation,
|
|
5
6
|
Extrapolation,
|
|
6
7
|
interpolate,
|
|
7
8
|
useAnimatedStyle,
|
|
8
9
|
useSharedValue,
|
|
10
|
+
withSequence,
|
|
9
11
|
withTiming,
|
|
10
12
|
} from "react-native-reanimated";
|
|
11
13
|
import PropTypes from "prop-types";
|
|
@@ -33,7 +35,7 @@ const Placeholder = () => {
|
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
export const FlashList = ({
|
|
36
|
-
|
|
38
|
+
animationDuration = 2000,
|
|
37
39
|
SkeletonComponent,
|
|
38
40
|
placeHolderItemCount = 10,
|
|
39
41
|
isLoading = false,
|
|
@@ -50,7 +52,7 @@ export const FlashList = ({
|
|
|
50
52
|
return (
|
|
51
53
|
<FadeInFlatList
|
|
52
54
|
key={isLoading}
|
|
53
|
-
|
|
55
|
+
animationDuration={animationDuration}
|
|
54
56
|
SkeletonComponent={SkeletonComponent}
|
|
55
57
|
isLoading={isLoading}
|
|
56
58
|
extraData={{ isLoading, placeHolderItemCount }}
|
|
@@ -77,7 +79,7 @@ export const FlashList = ({
|
|
|
77
79
|
|
|
78
80
|
const FadeInFlatList = ({
|
|
79
81
|
renderItem: originalRenderItem,
|
|
80
|
-
|
|
82
|
+
animationDuration,
|
|
81
83
|
isLoading = false,
|
|
82
84
|
SkeletonComponent,
|
|
83
85
|
...props
|
|
@@ -136,18 +138,27 @@ const FadeInFlatList = ({
|
|
|
136
138
|
|
|
137
139
|
useEffect(() => {
|
|
138
140
|
value.value = 0;
|
|
139
|
-
value.value =
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
value.value = withSequence(
|
|
142
|
+
withTiming(20, {
|
|
143
|
+
duration: animationDuration,
|
|
144
|
+
}),
|
|
145
|
+
withTiming(props.data.length + 1, {
|
|
146
|
+
duration: 0,
|
|
147
|
+
})
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
return () => {
|
|
151
|
+
cancelAnimation(value);
|
|
152
|
+
};
|
|
142
153
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
143
|
-
}, [
|
|
154
|
+
}, [animationDuration, value, props.data.length, isLoading]);
|
|
144
155
|
|
|
145
156
|
return <ShopifyFlashList {...props} renderItem={renderItem} />;
|
|
146
157
|
};
|
|
147
158
|
|
|
148
159
|
FlashList.propTypes = {
|
|
149
160
|
SkeletonComponent: PropTypes.element,
|
|
150
|
-
|
|
161
|
+
animationDuration: PropTypes.number,
|
|
151
162
|
data: PropTypes.array.isRequired,
|
|
152
163
|
isLoading: PropTypes.bool,
|
|
153
164
|
placeHolderItemCount: PropTypes.number,
|
package/src/components/Input.js
CHANGED
|
@@ -101,6 +101,7 @@ export const Input = props => {
|
|
|
101
101
|
autoFocus = false,
|
|
102
102
|
disabled = false,
|
|
103
103
|
noBorder = false,
|
|
104
|
+
showInputAccessoryView = true,
|
|
104
105
|
textAlignVertical = "top",
|
|
105
106
|
...rest
|
|
106
107
|
} = props;
|
|
@@ -235,30 +236,32 @@ export const Input = props => {
|
|
|
235
236
|
textAlignVertical={textAlignVertical}
|
|
236
237
|
{...rest.inputProps}
|
|
237
238
|
/>
|
|
238
|
-
{rest.inputProps?.multiline &&
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
239
|
+
{rest.inputProps?.multiline &&
|
|
240
|
+
showInputAccessoryView &&
|
|
241
|
+
Platform.OS === "ios" && (
|
|
242
|
+
<InputAccessoryView nativeID={label}>
|
|
243
|
+
<Container
|
|
244
|
+
bg="background.white"
|
|
245
|
+
flexDirection="row"
|
|
246
|
+
p={2}
|
|
247
|
+
width={width}
|
|
248
|
+
justifyContent="flex-end"
|
|
249
|
+
alignItems="center"
|
|
250
|
+
pr={20}
|
|
251
|
+
>
|
|
252
|
+
<Button
|
|
253
|
+
height={30}
|
|
254
|
+
left={10}
|
|
255
|
+
labelStyle={styles.doneButtonStyle}
|
|
256
|
+
variant="text"
|
|
257
|
+
onPress={() => {
|
|
258
|
+
Keyboard.dismiss();
|
|
259
|
+
}}
|
|
260
|
+
label="Done"
|
|
261
|
+
/>
|
|
262
|
+
</Container>
|
|
263
|
+
</InputAccessoryView>
|
|
264
|
+
)}
|
|
262
265
|
</View>
|
|
263
266
|
{!!SuffixIcon && (
|
|
264
267
|
<View px={2}>
|
|
@@ -324,6 +327,10 @@ Input.propTypes = {
|
|
|
324
327
|
* Used to align the position of text in input.
|
|
325
328
|
*/
|
|
326
329
|
textAlignVertical: PropTypes.oneOf(["auto", "top", "bottom", "center"]),
|
|
330
|
+
/**
|
|
331
|
+
* Show Input AccessoryView on iOS
|
|
332
|
+
*/
|
|
333
|
+
showInputAccessoryView: PropTypes.bool,
|
|
327
334
|
};
|
|
328
335
|
|
|
329
336
|
export const styles = StyleSheet.create({
|
|
@@ -45,7 +45,7 @@ export const ListItem = ({ LeftComponent, label, RightComponent, ...rest }) => {
|
|
|
45
45
|
>
|
|
46
46
|
<Container flexDirection="row" alignItems="center" width="50%">
|
|
47
47
|
{LeftComponent && <LeftComponent />}
|
|
48
|
-
<Typography color="font.grey800" fontSize="l" fontFamily="
|
|
48
|
+
<Typography color="font.grey800" fontSize="l" fontFamily="sf500">
|
|
49
49
|
{label}
|
|
50
50
|
</Typography>
|
|
51
51
|
</Container>
|