@bigbinary/neetoui-rn 0.0.160 → 0.0.161

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.
@@ -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:50,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:50,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:50,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
+ 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);};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neetoui-rn",
3
- "version": "0.0.160",
3
+ "version": "0.0.161",
4
4
  "main": "lib/index.js",
5
5
  "author": "BigBinary",
6
6
  "license": "MIT",
@@ -186,7 +186,7 @@ export const Alert = () => {
186
186
  borderWidth={1}
187
187
  fontFamily="sf400"
188
188
  fontSize="m"
189
- borderRadius={50}
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={50}
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={50}
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.background.base} name={icon} />
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={82} bg="background.white">
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;