@bigbinary/neetoui-rn 0.0.159 → 0.0.162
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/lib/components/Alert.js +1 -1
- package/lib/components/BottomTabBar.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/Alert.js +3 -3
- package/src/components/BottomTabBar.js +3 -8
- package/src/components/Input.js +47 -2
- package/src/components/ListItem.js +5 -3
package/lib/components/Alert.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Alert=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeModal=_interopRequireDefault(require("react-native-modal"));var _=require("./");var _this=this,_jsxFileName="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/Alert.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 useAlertHook=function useAlertHook(){var _React$useState=_react.default.useState(false),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),isVisible=_React$useState2[0],setIsVisible=_React$useState2[1];var _useState=(0,_react.useState)({}),_useState2=(0,_slicedToArray2.default)(_useState,2),params=_useState2[0],setParams=_useState2[1];var _params$title=params.title,title=_params$title===void 0?"":_params$title,_params$description=params.description,description=_params$description===void 0?"":_params$description,_params$isCancelable=params.isCancelable,isCancelable=_params$isCancelable===void 0?true:_params$isCancelable,onDismiss=params.onDismiss,_params$buttons=params.buttons,buttons=_params$buttons===void 0?[]:_params$buttons;var show=_react.default.useCallback(function(params){setParams(params);setIsVisible(true);},[]);var hide=_react.default.useCallback(function(){setIsVisible(false);},[]);var hideOnBackPressDrop=_react.default.useCallback(function(){if(isCancelable){hide();}if(onDismiss&&isCancelable){onDismiss();}},[hide,isCancelable,onDismiss]);return{isVisible:isVisible,show:show,hide:hide,hideOnBackPressDrop:hideOnBackPressDrop,title:title,description:description,isCancelable:isCancelable,buttons:buttons};};var rootLevelRef=null;var Alert=function Alert(){var _useAlertHook=useAlertHook(),isVisible=_useAlertHook.isVisible,show=_useAlertHook.show,hide=_useAlertHook.hide,buttons=_useAlertHook.buttons,hideOnBackPressDrop=_useAlertHook.hideOnBackPressDrop,title=_useAlertHook.title,description=_useAlertHook.description;var _buttons=(0,_slicedToArray2.default)(buttons,3),_buttons$=_buttons[0],button1=_buttons$===void 0?{label:"OK",onPress:function onPress(){},variant:"solid"}:_buttons$,button2=_buttons[1],button3=_buttons[2];var ref=_react.default.useRef(null);_react.default.useImperativeHandle(ref,_react.default.useCallback(function(){return{show:show};},[show]));_react.default.useEffect(function(){rootLevelRef=ref.current;},[ref]);return _react.default.createElement(_reactNativeModal.default,{animationIn:"zoomInDown",animationOut:"zoomOutUp",animationInTiming:600,animationOutTiming:600,backdropTransitionInTiming:600,backdropTransitionOutTiming:600,style:styles.modalStyle,isVisible:isVisible,onBackdropPress:hideOnBackPressDrop,useNativeDriver:true,hideModalContentWhileAnimating:true,__self:_this,__source:{fileName:_jsxFileName,lineNumber:143,columnNumber:5}},_react.default.createElement(_.Container,{bg:"background.primary",justifyContent:"center",alignItems:"center",width:"90%",padding:20,borderRadius:20,__self:_this,__source:{fileName:_jsxFileName,lineNumber:156,columnNumber:7}},_react.default.createElement(_.Typography,{fontFamily:"sf700",fontSize:"l",color:"font.grey800",__self:_this,__source:{fileName:_jsxFileName,lineNumber:164,columnNumber:9}},title),_react.default.createElement(_.Container,{alignItems:"center",justifyContent:"center",__self:_this,__source:{fileName:_jsxFileName,lineNumber:167,columnNumber:9}},_react.default.createElement(_.Typography,{textAlign:"center",py:20,fontFamily:"sf400",fontSize:"l",color:"font.grey600",__self:_this,__source:{fileName:_jsxFileName,lineNumber:168,columnNumber:11}},description)),_react.default.createElement(_.Container,{flexDirection:"row",width:"100%",justifyContent:"space-around",__self:_this,__source:{fileName:_jsxFileName,lineNumber:179,columnNumber:9}},button2&&_react.default.createElement(_.Button,{borderWidth:1,fontFamily:"sf400",fontSize:"m",borderRadius:
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Alert=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeModal=_interopRequireDefault(require("react-native-modal"));var _=require("./");var _this=this,_jsxFileName="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/Alert.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 useAlertHook=function useAlertHook(){var _React$useState=_react.default.useState(false),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),isVisible=_React$useState2[0],setIsVisible=_React$useState2[1];var _useState=(0,_react.useState)({}),_useState2=(0,_slicedToArray2.default)(_useState,2),params=_useState2[0],setParams=_useState2[1];var _params$title=params.title,title=_params$title===void 0?"":_params$title,_params$description=params.description,description=_params$description===void 0?"":_params$description,_params$isCancelable=params.isCancelable,isCancelable=_params$isCancelable===void 0?true:_params$isCancelable,onDismiss=params.onDismiss,_params$buttons=params.buttons,buttons=_params$buttons===void 0?[]:_params$buttons;var show=_react.default.useCallback(function(params){setParams(params);setIsVisible(true);},[]);var hide=_react.default.useCallback(function(){setIsVisible(false);},[]);var hideOnBackPressDrop=_react.default.useCallback(function(){if(isCancelable){hide();}if(onDismiss&&isCancelable){onDismiss();}},[hide,isCancelable,onDismiss]);return{isVisible:isVisible,show:show,hide:hide,hideOnBackPressDrop:hideOnBackPressDrop,title:title,description:description,isCancelable:isCancelable,buttons:buttons};};var rootLevelRef=null;var Alert=function Alert(){var _useAlertHook=useAlertHook(),isVisible=_useAlertHook.isVisible,show=_useAlertHook.show,hide=_useAlertHook.hide,buttons=_useAlertHook.buttons,hideOnBackPressDrop=_useAlertHook.hideOnBackPressDrop,title=_useAlertHook.title,description=_useAlertHook.description;var _buttons=(0,_slicedToArray2.default)(buttons,3),_buttons$=_buttons[0],button1=_buttons$===void 0?{label:"OK",onPress:function onPress(){},variant:"solid"}:_buttons$,button2=_buttons[1],button3=_buttons[2];var ref=_react.default.useRef(null);_react.default.useImperativeHandle(ref,_react.default.useCallback(function(){return{show:show};},[show]));_react.default.useEffect(function(){rootLevelRef=ref.current;},[ref]);return _react.default.createElement(_reactNativeModal.default,{animationIn:"zoomInDown",animationOut:"zoomOutUp",animationInTiming:600,animationOutTiming:600,backdropTransitionInTiming:600,backdropTransitionOutTiming:600,style:styles.modalStyle,isVisible:isVisible,onBackdropPress:hideOnBackPressDrop,useNativeDriver:true,hideModalContentWhileAnimating:true,__self:_this,__source:{fileName:_jsxFileName,lineNumber:143,columnNumber:5}},_react.default.createElement(_.Container,{bg:"background.primary",justifyContent:"center",alignItems:"center",width:"90%",padding:20,borderRadius:20,__self:_this,__source:{fileName:_jsxFileName,lineNumber:156,columnNumber:7}},_react.default.createElement(_.Typography,{fontFamily:"sf700",fontSize:"l",color:"font.grey800",__self:_this,__source:{fileName:_jsxFileName,lineNumber:164,columnNumber:9}},title),_react.default.createElement(_.Container,{alignItems:"center",justifyContent:"center",__self:_this,__source:{fileName:_jsxFileName,lineNumber:167,columnNumber:9}},_react.default.createElement(_.Typography,{textAlign:"center",py:20,fontFamily:"sf400",fontSize:"l",color:"font.grey600",__self:_this,__source:{fileName:_jsxFileName,lineNumber:168,columnNumber:11}},description)),_react.default.createElement(_.Container,{flexDirection:"row",width:"100%",justifyContent:"space-around",__self:_this,__source:{fileName:_jsxFileName,lineNumber:179,columnNumber:9}},button2&&_react.default.createElement(_.Button,{borderWidth:1,fontFamily:"sf400",fontSize:"m",borderRadius:8,minWidth:110,height:35,p:0,onPress:function onPress(){button2.onPress==null?void 0:button2.onPress();hide();},label:button2.label,width:undefined,variant:button2.variant||"text",__self:_this,__source:{fileName:_jsxFileName,lineNumber:185,columnNumber:13}}),button1&&_react.default.createElement(_.Button,{fontFamily:"sf400",fontSize:"m",borderRadius:8,minWidth:110,onPress:function onPress(){button1.onPress==null?void 0:button1.onPress();hide();},label:button1.label,height:35,p:0,width:undefined,variant:button1.variant,__self:_this,__source:{fileName:_jsxFileName,lineNumber:203,columnNumber:13}})),button3&&_react.default.createElement(_.Button,{mt:20,borderWidth:1,fontFamily:"sf400",fontSize:"m",borderRadius:8,minWidth:110,onPress:function onPress(){button3.onPress==null?void 0:button3.onPress();hide();},label:button3.label,height:35,p:0,variant:button3.variant,__self:_this,__source:{fileName:_jsxFileName,lineNumber:221,columnNumber:11}})));};exports.Alert=Alert;var styles=_reactNative.StyleSheet.create({modalStyle:{alignItems:"center",justifyContent:"center"}});Alert.show=function(params){rootLevelRef.show(params);};
|
|
@@ -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 (92: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 (100:43)";_f.__optimalization=3;return _f;}());return _react.default.createElement(_.Container,{flex:1,onTouchStart:onPress,alignItems:"center",borderTopWidth:1,borderColor:"background.grey200",__self:this,__source:{fileName:_jsxFileName,lineNumber:116,columnNumber:5}},_react.default.createElement(_.Container,{height:35,width:48,alignItems:"center",mb:1,__self:this,__source:{fileName:_jsxFileName,lineNumber:123,columnNumber:7}},_react.default.createElement(_reactNativeReanimated.default.View,{style:[styles.iconContainer,animatedStyles],__self:this,__source:{fileName:_jsxFileName,lineNumber:124,columnNumber:9}},_react.default.createElement(_reactNativeRemixIcon.default,{size:size,color:theme.colors.
|
|
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 (92: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 (100:43)";_f.__optimalization=3;return _f;}());return _react.default.createElement(_.Container,{flex:1,onTouchStart:onPress,alignItems:"center",borderTopWidth:1,borderColor:"background.grey200",__self:this,__source:{fileName:_jsxFileName,lineNumber:116,columnNumber:5}},_react.default.createElement(_.Container,{height:35,width:48,alignItems:"center",mb:1,__self:this,__source:{fileName:_jsxFileName,lineNumber:123,columnNumber:7}},_react.default.createElement(_reactNativeReanimated.default.View,{style:[styles.iconContainer,animatedStyles],__self:this,__source:{fileName:_jsxFileName,lineNumber:124,columnNumber:9}},_react.default.createElement(_reactNativeRemixIcon.default,{size:size,color:theme.colors.font.grey500,name:icon,__self:this,__source:{fileName:_jsxFileName,lineNumber:125,columnNumber:11}})),_react.default.createElement(_reactNativeReanimated.default.View,{style:[styles.iconContainer,animatedStyles2],__self:this,__source:{fileName:_jsxFileName,lineNumber:127,columnNumber:9}},_react.default.createElement(_reactNativeRemixIcon.default,{size:size,color:theme.colors.font.base,name:icon,__self:this,__source:{fileName:_jsxFileName,lineNumber:128,columnNumber:11}}))),_react.default.createElement(_.Typography,{color:isFocused?tabBarActiveTintColor:tabBarInactiveTintColor,fontFamily:"sf500",fontSize:"4xs",__self:this,__source:{fileName:_jsxFileName,lineNumber:131,columnNumber:7}},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:83,bg:"background.white",__self:_this,__source:{fileName:_jsxFileName,lineNumber:151,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:170,columnNumber:11}});}));};exports.BottomTabBar=BottomTabBar;TabElement.propTypes={isFocused:_propTypes.default.boolean,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};
|
package/lib/components/Input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});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 _excluded=["label","value","onChangeText","errorMessage","PrefixIcon","SuffixIcon","autoFocus","disabled","noBorder"];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;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$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,rest=(0,_objectWithoutProperties2.default)(props,_excluded);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(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();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:[16,6]})};var handleFocusBlur=function handleFocusBlur(isFocused){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","errorMessage","PrefixIcon","SuffixIcon","autoFocus","disabled","noBorder"];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$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,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(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();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:[16,6]})};var handleFocusBlur=function handleFocusBlur(isFocused){if(!value)handleLabelAnimation(isFocused);if(!noBorder)handleStyles(isFocused);};return _react.default.createElement(View,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:177,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},{__self:_this,__source:{fileName:_jsxFileName,lineNumber:178,columnNumber:7}}),!!PrefixIcon&&_react.default.createElement(View,{pl:2,__self:_this,__source:{fileName:_jsxFileName,lineNumber:189,columnNumber:11}},_react.default.createElement(PrefixIcon,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:190,columnNumber:13}})),_react.default.createElement(View,{flex:1,left:10,__self:_this,__source:{fileName:_jsxFileName,lineNumber:193,columnNumber:9}},_react.default.createElement(AnimatedLabel,{color:disabled?"font.grey400":"font.grey600",position:"absolute",zIndex:1,style:labelStyles,__self:_this,__source:{fileName:_jsxFileName,lineNumber:194,columnNumber:11}},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(){handleFocusBlur(false);},inputAccessoryViewID:label,color:disabled?"font.grey500":"font.primary",fontSize:17,py:3,pr:3,top:0,zIndex:2,autoCapitalize:"none"},rest.inputProps,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:202,columnNumber:11}})),((_rest$inputProps3=rest.inputProps)==null?void 0:_rest$inputProps3.multiline)&&_reactNative.Platform.OS==="ios"&&_react.default.createElement(_reactNative.InputAccessoryView,{nativeID:label,__self:_this,__source:{fileName:_jsxFileName,lineNumber:226,columnNumber:13}},_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:227,columnNumber:15}},_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:236,columnNumber:17}})))),!!SuffixIcon&&_react.default.createElement(View,{px:2,__self:_this,__source:{fileName:_jsxFileName,lineNumber:251,columnNumber:11}},_react.default.createElement(SuffixIcon,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:252,columnNumber:13}}))),!!errorMessage&&_react.default.createElement(Typography,{py:2,color:"font.danger",__self:_this,__source:{fileName:_jsxFileName,lineNumber:257,columnNumber:9}},errorMessage));};exports.Input=Input;Input.propTypes={label:_propTypes.default.string,value:_propTypes.default.string.isRequired,onChangeText:_propTypes.default.func.isRequired,errorMessage:_propTypes.default.string,disabled:_propTypes.default.bool,autoFocus:_propTypes.default.bool,PrefixIcon:_propTypes.default.elementType,SuffixIcon:_propTypes.default.elementType,noBorder:_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:12,
|
|
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:12,py:16,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:"sf400",__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
package/src/components/Alert.js
CHANGED
|
@@ -186,7 +186,7 @@ export const Alert = () => {
|
|
|
186
186
|
borderWidth={1}
|
|
187
187
|
fontFamily="sf400"
|
|
188
188
|
fontSize="m"
|
|
189
|
-
borderRadius={
|
|
189
|
+
borderRadius={8}
|
|
190
190
|
minWidth={110}
|
|
191
191
|
height={35}
|
|
192
192
|
p={0}
|
|
@@ -203,7 +203,7 @@ export const Alert = () => {
|
|
|
203
203
|
<Button
|
|
204
204
|
fontFamily="sf400"
|
|
205
205
|
fontSize="m"
|
|
206
|
-
borderRadius={
|
|
206
|
+
borderRadius={8}
|
|
207
207
|
minWidth={110}
|
|
208
208
|
onPress={() => {
|
|
209
209
|
button1.onPress?.();
|
|
@@ -223,7 +223,7 @@ export const Alert = () => {
|
|
|
223
223
|
borderWidth={1}
|
|
224
224
|
fontFamily="sf400"
|
|
225
225
|
fontSize="m"
|
|
226
|
-
borderRadius={
|
|
226
|
+
borderRadius={8}
|
|
227
227
|
minWidth={110}
|
|
228
228
|
onPress={() => {
|
|
229
229
|
button3.onPress?.();
|
|
@@ -122,17 +122,12 @@ function TabElement({
|
|
|
122
122
|
>
|
|
123
123
|
<Container height={35} width={48} alignItems="center" mb={1}>
|
|
124
124
|
<Animated.View style={[styles.iconContainer, animatedStyles]}>
|
|
125
|
-
<Icon
|
|
126
|
-
size={size}
|
|
127
|
-
color={theme.colors.background.grey200}
|
|
128
|
-
name={icon}
|
|
129
|
-
/>
|
|
125
|
+
<Icon size={size} color={theme.colors.font.grey500} name={icon} />
|
|
130
126
|
</Animated.View>
|
|
131
127
|
<Animated.View style={[styles.iconContainer, animatedStyles2]}>
|
|
132
|
-
<Icon size={size} color={theme.colors.
|
|
128
|
+
<Icon size={size} color={theme.colors.font.base} name={icon} />
|
|
133
129
|
</Animated.View>
|
|
134
130
|
</Container>
|
|
135
|
-
|
|
136
131
|
<Typography
|
|
137
132
|
color={isFocused ? tabBarActiveTintColor : tabBarInactiveTintColor}
|
|
138
133
|
fontFamily="sf500"
|
|
@@ -153,7 +148,7 @@ const styles = StyleSheet.create({
|
|
|
153
148
|
|
|
154
149
|
export const BottomTabBar = ({ state, descriptors, navigation }) => {
|
|
155
150
|
return (
|
|
156
|
-
<Container flexDirection="row" height={
|
|
151
|
+
<Container flexDirection="row" height={83} bg="background.white">
|
|
157
152
|
{state.routes.map(({ key, name }, index) => {
|
|
158
153
|
const { options } = descriptors[key];
|
|
159
154
|
const isFocused = state.index === index;
|
package/src/components/Input.js
CHANGED
|
@@ -12,9 +12,18 @@ import {
|
|
|
12
12
|
system,
|
|
13
13
|
position,
|
|
14
14
|
} from "styled-system";
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
Animated,
|
|
17
|
+
InputAccessoryView,
|
|
18
|
+
Keyboard,
|
|
19
|
+
StyleSheet,
|
|
20
|
+
useWindowDimensions,
|
|
21
|
+
Platform,
|
|
22
|
+
} from "react-native";
|
|
16
23
|
import styled, { ThemeContext } from "styled-components/native";
|
|
17
24
|
import PropTypes from "prop-types";
|
|
25
|
+
import { Button, Container } from "@components";
|
|
26
|
+
import { theme } from "../../src/theme";
|
|
18
27
|
|
|
19
28
|
const TextInput = styled.TextInput`
|
|
20
29
|
${flexbox}
|
|
@@ -94,6 +103,7 @@ export const Input = props => {
|
|
|
94
103
|
...rest
|
|
95
104
|
} = props;
|
|
96
105
|
|
|
106
|
+
const { width } = useWindowDimensions();
|
|
97
107
|
const colors = useContext(ThemeContext).colors;
|
|
98
108
|
const inputRef = useRef();
|
|
99
109
|
const containerRef = useRef();
|
|
@@ -105,6 +115,7 @@ export const Input = props => {
|
|
|
105
115
|
} else {
|
|
106
116
|
handleLabelAnimation(false);
|
|
107
117
|
}
|
|
118
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
108
119
|
}, [autoFocus]);
|
|
109
120
|
|
|
110
121
|
useEffect(() => {
|
|
@@ -115,6 +126,7 @@ export const Input = props => {
|
|
|
115
126
|
} else {
|
|
116
127
|
handleLabelAnimation(false);
|
|
117
128
|
}
|
|
129
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
118
130
|
}, [value]);
|
|
119
131
|
|
|
120
132
|
const handleLabelAnimation = isFocused => {
|
|
@@ -171,7 +183,7 @@ export const Input = props => {
|
|
|
171
183
|
alignItems="center"
|
|
172
184
|
flexDirection="row"
|
|
173
185
|
justifyContent="space-between"
|
|
174
|
-
{...(!rest
|
|
186
|
+
{...(!rest.inputProps?.multiline && { height: 58 })}
|
|
175
187
|
>
|
|
176
188
|
{!!PrefixIcon && (
|
|
177
189
|
<View pl={2}>
|
|
@@ -190,6 +202,7 @@ export const Input = props => {
|
|
|
190
202
|
<TextInput
|
|
191
203
|
ref={inputRef}
|
|
192
204
|
value={value}
|
|
205
|
+
returnKeyType={rest.inputProps?.multiline ? "default" : "done"}
|
|
193
206
|
onChangeText={onChangeText}
|
|
194
207
|
autoFocus={autoFocus}
|
|
195
208
|
editable={!disabled}
|
|
@@ -199,6 +212,7 @@ export const Input = props => {
|
|
|
199
212
|
onBlur={() => {
|
|
200
213
|
handleFocusBlur(false);
|
|
201
214
|
}}
|
|
215
|
+
inputAccessoryViewID={label}
|
|
202
216
|
color={disabled ? "font.grey500" : "font.primary"}
|
|
203
217
|
fontSize={17}
|
|
204
218
|
py={3}
|
|
@@ -208,6 +222,30 @@ export const Input = props => {
|
|
|
208
222
|
autoCapitalize="none"
|
|
209
223
|
{...rest.inputProps}
|
|
210
224
|
/>
|
|
225
|
+
{rest.inputProps?.multiline && Platform.OS === "ios" && (
|
|
226
|
+
<InputAccessoryView nativeID={label}>
|
|
227
|
+
<Container
|
|
228
|
+
bg="background.white"
|
|
229
|
+
flexDirection="row"
|
|
230
|
+
p={2}
|
|
231
|
+
width={width}
|
|
232
|
+
justifyContent="flex-end"
|
|
233
|
+
alignItems="center"
|
|
234
|
+
pr={20}
|
|
235
|
+
>
|
|
236
|
+
<Button
|
|
237
|
+
height={30}
|
|
238
|
+
left={10}
|
|
239
|
+
labelStyle={styles.doneButtonStyle}
|
|
240
|
+
variant="text"
|
|
241
|
+
onPress={() => {
|
|
242
|
+
Keyboard.dismiss();
|
|
243
|
+
}}
|
|
244
|
+
label="Done"
|
|
245
|
+
/>
|
|
246
|
+
</Container>
|
|
247
|
+
</InputAccessoryView>
|
|
248
|
+
)}
|
|
211
249
|
</View>
|
|
212
250
|
{!!SuffixIcon && (
|
|
213
251
|
<View px={2}>
|
|
@@ -262,3 +300,10 @@ Input.propTypes = {
|
|
|
262
300
|
*/
|
|
263
301
|
noBorder: PropTypes.bool,
|
|
264
302
|
};
|
|
303
|
+
|
|
304
|
+
export const styles = StyleSheet.create({
|
|
305
|
+
doneButtonStyle: {
|
|
306
|
+
fontFamily: "sf700",
|
|
307
|
+
color: theme.colors.font.base,
|
|
308
|
+
},
|
|
309
|
+
});
|
|
@@ -37,19 +37,21 @@ export const ListItem = ({ LeftComponent, label, RightComponent, ...rest }) => {
|
|
|
37
37
|
bg="background.secondary"
|
|
38
38
|
width="100%"
|
|
39
39
|
px={12}
|
|
40
|
-
|
|
40
|
+
py={16}
|
|
41
41
|
borderRadius={6}
|
|
42
42
|
alignItems="center"
|
|
43
43
|
justifyContent="space-between"
|
|
44
44
|
{...rest}
|
|
45
45
|
>
|
|
46
|
-
<Container flexDirection="row" alignItems="center">
|
|
46
|
+
<Container flexDirection="row" alignItems="center" width="50%">
|
|
47
47
|
{LeftComponent && <LeftComponent />}
|
|
48
48
|
<Typography color="font.grey800" fontSize="l" fontFamily="sf400">
|
|
49
49
|
{label}
|
|
50
50
|
</Typography>
|
|
51
51
|
</Container>
|
|
52
|
-
<
|
|
52
|
+
<Container width="50%" alignItems="flex-end">
|
|
53
|
+
<RightComponent />
|
|
54
|
+
</Container>
|
|
53
55
|
</Container>
|
|
54
56
|
);
|
|
55
57
|
};
|