@bigbinary/neetoui-rn 0.0.100 → 0.0.101

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.TextInput=exports.Input=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));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 _reactNativeRemixIcon=_interopRequireDefault(require("react-native-remix-icon"));var _native=_interopRequireWildcard(require("styled-components/native"));var _propTypes=_interopRequireDefault(require("@styled-system/prop-types"));var _propTypes2=_interopRequireDefault(require("prop-types"));var _=require("./");var _excluded=["label","labelStyles","containerStyles","message","error","onFocus","onBlur","inline","LeftIcon","RightIcon","brandRight","brandLeft","brandColor","brandBackground","disabled","secureTextEntry","textAlignVertical","enableFocusStyle"];var _templateObject,_templateObject2,_this=this,_jsxFileName="/Users/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);exports.TextInput=TextInput;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 Input=_react.default.forwardRef(function(props,ref){var _props$label=props.label,label=_props$label===void 0?"":_props$label,labelStyles=props.labelStyles,containerStyles=props.containerStyles,_props$message=props.message,message=_props$message===void 0?"":_props$message,_props$error=props.error,error=_props$error===void 0?false:_props$error,onFocus=props.onFocus,onBlur=props.onBlur,_props$inline=props.inline,inline=_props$inline===void 0?false:_props$inline,LeftIcon=props.LeftIcon,RightIcon=props.RightIcon,brandRight=props.brandRight,brandLeft=props.brandLeft,_props$brandColor=props.brandColor,brandColor=_props$brandColor===void 0?"font.grey600":_props$brandColor,_props$brandBackgroun=props.brandBackground,brandBackground=_props$brandBackgroun===void 0?"background.menubackground":_props$brandBackgroun,_props$disabled=props.disabled,disabled=_props$disabled===void 0?false:_props$disabled,_props$secureTextEntr=props.secureTextEntry,secureTextEntry=_props$secureTextEntr===void 0?false:_props$secureTextEntr,_props$textAlignVerti=props.textAlignVertical,textAlignVertical=_props$textAlignVerti===void 0?"top":_props$textAlignVerti,_props$enableFocusSty=props.enableFocusStyle,enableFocusStyle=_props$enableFocusSty===void 0?false:_props$enableFocusSty,rest=(0,_objectWithoutProperties2.default)(props,_excluded);var theme=(0,_react.useContext)(_native.ThemeContext);var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isPasswordVisible=_useState2[0],setIsPasswordVisible=_useState2[1];var _useState3=(0,_react.useState)(false),_useState4=(0,_slicedToArray2.default)(_useState3,2),isFocus=_useState4[0],setIsFocus=_useState4[1];var borderColor=error?theme.colors.border.danger:theme.colors.border.primary;var handleFocus=function handleFocus(e){onFocus&&onFocus(e);setIsFocus(true);};var handleBlur=function handleBlur(e){onBlur&&onBlur(e);setIsFocus(false);};var focusStyles=enableFocusStyle&&isFocus&&{borderRadius:4,borderColor:error?"rgba(255, 105, 105, 0.3)":theme.colors.border.grey400,borderWidth:inline?"0px":"3px",borderStyle:"solid"};var disabledStyles=disabled&&{opacity:0.5,bg:theme.colors.background.secondary};var inlineInputStyles=enableFocusStyle&&isFocus&&{backgroundColor:error?theme.colors.border.danger:theme.colors.border.base};return _react.default.createElement(_.Container,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:125,columnNumber:5}},!inline&&!!label&&_react.default.createElement(LabelText,{labelStyles:labelStyles,inline:inline,label:label,__self:_this,__source:{fileName:_jsxFileName,lineNumber:127,columnNumber:9}}),_react.default.createElement(_.Container,(0,_extends2.default)({border:!inline?"1px":"0",borderColor:borderColor,borderRadius:2},focusStyles,disabledStyles,{flexDirection:inline?"row":"column",onBlur:handleBlur,onFocus:handleFocus,position:"relative"},containerStyles,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:129,columnNumber:7}}),inline&&_react.default.createElement(_.Container,{alignSelf:"flex-end",maxWidth:100,__self:_this,__source:{fileName:_jsxFileName,lineNumber:142,columnNumber:11}},_react.default.createElement(LabelText,{labelStyles:labelStyles,inline:inline,label:label,__self:_this,__source:{fileName:_jsxFileName,lineNumber:143,columnNumber:13}})),_react.default.createElement(_.Container,{flexDirection:"row",width:"100%",__self:_this,__source:{fileName:_jsxFileName,lineNumber:150,columnNumber:9}},LeftIcon&&_react.default.createElement(_.Container,{alignSelf:"center",mx:"4px",__self:_this,__source:{fileName:_jsxFileName,lineNumber:152,columnNumber:13}},_react.default.createElement(LeftIcon,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:153,columnNumber:15}})),brandLeft&&_react.default.createElement(InputText,{text:brandLeft,brandColor:brandColor,brandBackground:brandBackground,__self:_this,__source:{fileName:_jsxFileName,lineNumber:157,columnNumber:13}}),_react.default.createElement(TextInput,(0,_extends2.default)({ref:ref,height:40,flex:1,textStyle:"subtext",editable:!disabled,color:error?theme.colors.font.danger:theme.colors.font.primary,secureTextEntry:secureTextEntry&&!isPasswordVisible,textAlignVertical:textAlignVertical},rest,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:163,columnNumber:11}})),brandRight&&_react.default.createElement(InputText,{text:brandRight,brandColor:brandColor,brandBackground:brandBackground,__self:_this,__source:{fileName:_jsxFileName,lineNumber:176,columnNumber:13}}),RightIcon&&_react.default.createElement(_.Container,{alignSelf:"center",mx:"4px",__self:_this,__source:{fileName:_jsxFileName,lineNumber:184,columnNumber:13}},_react.default.createElement(RightIcon,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:185,columnNumber:15}})),secureTextEntry&&_react.default.createElement(_.Container,{justifyContent:"center",mx:"4px",__self:_this,__source:{fileName:_jsxFileName,lineNumber:190,columnNumber:13}},_react.default.createElement(_reactNativeRemixIcon.default,{name:isPasswordVisible?"eye-line":"eye-off-line",color:theme.colors.background.grey500,onPress:function onPress(){return setIsPasswordVisible(!isPasswordVisible);},__self:_this,__source:{fileName:_jsxFileName,lineNumber:191,columnNumber:15}})))),inline&&_react.default.createElement(View,(0,_extends2.default)({backgroundColor:theme.colors.border.primary,height:1},inlineInputStyles,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:201,columnNumber:9}})),_react.default.createElement(ErrorMessage,{theme:theme,error:error,message:message,__self:_this,__source:{fileName:_jsxFileName,lineNumber:207,columnNumber:7}}));});exports.Input=Input;var InputText=function InputText(_ref){var text=_ref.text,brandColor=_ref.brandColor,brandBackground=_ref.brandBackground;return _react.default.createElement(_.Container,{bg:brandBackground,justifyContent:"center",px:2,__self:_this,__source:{fileName:_jsxFileName,lineNumber:213,columnNumber:3}},text&&_react.default.createElement(_.Typography,{color:brandColor,__self:_this,__source:{fileName:_jsxFileName,lineNumber:214,columnNumber:14}},text));};var LabelText=function LabelText(_ref2){var inline=_ref2.inline,label=_ref2.label,labelStyles=_ref2.labelStyles;return _react.default.createElement(_.Typography,(0,_extends2.default)({numberOfLines:1,textStyle:"subtext",mb:inline?"12px":"7px"},labelStyles,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:219,columnNumber:3}}),label);};var ErrorMessage=function ErrorMessage(_ref3){var error=_ref3.error,message=_ref3.message,theme=_ref3.theme;if(error){return _react.default.createElement(_.Typography,{textStyle:"subtext",color:theme.colors.font.danger,__self:_this,__source:{fileName:_jsxFileName,lineNumber:232,columnNumber:7}},message);}return null;};Input.propTypes=(0,_extends2.default)({},_propTypes.default.flexbox,_propTypes.default.space,_propTypes.default.border,_propTypes.default.buttonStyle,{label:_propTypes2.default.string,labelStyles:_propTypes2.default.object,containerStyles:_propTypes2.default.object,message:_propTypes2.default.string,error:_propTypes2.default.bool,inline:_propTypes2.default.bool,brandRight:_propTypes2.default.string,brandLeft:_propTypes2.default.string,disabled:_propTypes2.default.bool,brandColor:_propTypes2.default.string,brandBackground:_propTypes2.default.string,secureTextEntry:_propTypes2.default.bool,enableFocusStyle:_propTypes2.default.bool,LeftIcon:_propTypes2.default.func,RightIcon:_propTypes2.default.func,children:_propTypes2.default.node});InputText.propTypes={text:_propTypes2.default.string,borderColor:_propTypes2.default.string,brandColor:_propTypes2.default.string,brandBackground:_propTypes2.default.string};LabelText.propTypes={inline:_propTypes2.default.bool,label:_propTypes2.default.string,labelStyles:_propTypes2.default.object};ErrorMessage.propTypes={error:_propTypes2.default.bool,message:_propTypes2.default.string};TextInput.defaultProps={height:40,px:2,fontFamily:"inter400",fontSize:"16px"};
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.TextInput=exports.Input=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));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 _reactNativeRemixIcon=_interopRequireDefault(require("react-native-remix-icon"));var _reactNative=require("react-native");var _native=_interopRequireWildcard(require("styled-components/native"));var _propTypes=_interopRequireDefault(require("@styled-system/prop-types"));var _propTypes2=_interopRequireDefault(require("prop-types"));var _=require("./");var _excluded=["label","labelStyles","containerStyles","message","error","onFocus","onBlur","inline","LeftIcon","RightIcon","brandRight","brandLeft","brandColor","brandBackground","disabled","secureTextEntry","textAlignVertical","enableFocusStyle"];var _templateObject,_templateObject2,_this=this,_jsxFileName="/Users/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);exports.TextInput=TextInput;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 Input=_react.default.forwardRef(function(props,ref){var _props$label=props.label,label=_props$label===void 0?"":_props$label,labelStyles=props.labelStyles,containerStyles=props.containerStyles,_props$message=props.message,message=_props$message===void 0?"":_props$message,_props$error=props.error,error=_props$error===void 0?false:_props$error,onFocus=props.onFocus,onBlur=props.onBlur,_props$inline=props.inline,inline=_props$inline===void 0?false:_props$inline,LeftIcon=props.LeftIcon,RightIcon=props.RightIcon,brandRight=props.brandRight,brandLeft=props.brandLeft,_props$brandColor=props.brandColor,brandColor=_props$brandColor===void 0?"font.grey600":_props$brandColor,_props$brandBackgroun=props.brandBackground,brandBackground=_props$brandBackgroun===void 0?"background.menubackground":_props$brandBackgroun,_props$disabled=props.disabled,disabled=_props$disabled===void 0?false:_props$disabled,_props$secureTextEntr=props.secureTextEntry,secureTextEntry=_props$secureTextEntr===void 0?false:_props$secureTextEntr,_props$textAlignVerti=props.textAlignVertical,textAlignVertical=_props$textAlignVerti===void 0?"top":_props$textAlignVerti,_props$enableFocusSty=props.enableFocusStyle,enableFocusStyle=_props$enableFocusSty===void 0?false:_props$enableFocusSty,rest=(0,_objectWithoutProperties2.default)(props,_excluded);var theme=(0,_react.useContext)(_native.ThemeContext);var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isPasswordVisible=_useState2[0],setIsPasswordVisible=_useState2[1];var _useState3=(0,_react.useState)(0),_useState4=(0,_slicedToArray2.default)(_useState3,2),height=_useState4[0],setHeight=_useState4[1];var _useState5=(0,_react.useState)(false),_useState6=(0,_slicedToArray2.default)(_useState5,2),isFocus=_useState6[0],setIsFocus=_useState6[1];var borderColor=error?theme.colors.border.danger:theme.colors.border.primary;var handleFocus=function handleFocus(e){onFocus&&onFocus(e);setIsFocus(true);};var handleBlur=function handleBlur(e){onBlur&&onBlur(e);setIsFocus(false);};var focusStyles=enableFocusStyle&&isFocus&&{borderRadius:4,borderColor:error?"rgba(255, 105, 105, 0.3)":theme.colors.border.grey400,borderWidth:inline?"0px":"3px",borderStyle:"solid"};var disabledStyles=disabled&&{opacity:0.5,bg:theme.colors.background.secondary};var inlineInputStyles=enableFocusStyle&&isFocus&&{backgroundColor:error?theme.colors.border.danger:theme.colors.border.base};return _react.default.createElement(_.Container,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:128,columnNumber:5}},!inline&&!!label&&_react.default.createElement(LabelText,{labelStyles:labelStyles,inline:inline,label:label,__self:_this,__source:{fileName:_jsxFileName,lineNumber:130,columnNumber:9}}),_react.default.createElement(_.Container,(0,_extends2.default)({border:!inline?"1px":"0",borderColor:borderColor,borderRadius:2},focusStyles,disabledStyles,{flexDirection:inline?"row":"column",onBlur:handleBlur,onFocus:handleFocus,position:"relative"},containerStyles,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:132,columnNumber:7}}),inline&&_react.default.createElement(_.Container,{alignSelf:"flex-end",maxWidth:100,__self:_this,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:11}},_react.default.createElement(LabelText,{labelStyles:labelStyles,inline:inline,label:label,__self:_this,__source:{fileName:_jsxFileName,lineNumber:146,columnNumber:13}})),_react.default.createElement(_.Container,{flexDirection:"row",width:"100%",__self:_this,__source:{fileName:_jsxFileName,lineNumber:153,columnNumber:9}},LeftIcon&&_react.default.createElement(_.Container,{alignSelf:"center",mx:"4px",__self:_this,__source:{fileName:_jsxFileName,lineNumber:155,columnNumber:13}},_react.default.createElement(LeftIcon,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:156,columnNumber:15}})),brandLeft&&_react.default.createElement(InputText,{text:brandLeft,brandColor:brandColor,brandBackground:brandBackground,__self:_this,__source:{fileName:_jsxFileName,lineNumber:160,columnNumber:13}}),_react.default.createElement(TextInput,(0,_extends2.default)({ref:ref,flex:1},_reactNative.Platform.select({ios:{},android:{height:height,onContentSizeChange:function onContentSizeChange(event){setHeight(event.nativeEvent.contentSize.height);}}}),{textStyle:"subtext",editable:!disabled,color:error?theme.colors.font.danger:theme.colors.font.primary,secureTextEntry:secureTextEntry&&!isPasswordVisible,textAlignVertical:textAlignVertical},rest,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:166,columnNumber:11}})),brandRight&&_react.default.createElement(InputText,{text:brandRight,brandColor:brandColor,brandBackground:brandBackground,__self:_this,__source:{fileName:_jsxFileName,lineNumber:187,columnNumber:13}}),RightIcon&&_react.default.createElement(_.Container,{alignSelf:"center",mx:"4px",__self:_this,__source:{fileName:_jsxFileName,lineNumber:195,columnNumber:13}},_react.default.createElement(RightIcon,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:196,columnNumber:15}})),secureTextEntry&&_react.default.createElement(_.Container,{justifyContent:"center",mx:"4px",__self:_this,__source:{fileName:_jsxFileName,lineNumber:201,columnNumber:13}},_react.default.createElement(_reactNativeRemixIcon.default,{name:isPasswordVisible?"eye-line":"eye-off-line",color:theme.colors.background.grey500,onPress:function onPress(){return setIsPasswordVisible(!isPasswordVisible);},__self:_this,__source:{fileName:_jsxFileName,lineNumber:202,columnNumber:15}})))),inline&&_react.default.createElement(View,(0,_extends2.default)({backgroundColor:theme.colors.border.primary,height:1},inlineInputStyles,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:212,columnNumber:9}})),_react.default.createElement(ErrorMessage,{theme:theme,error:error,message:message,__self:_this,__source:{fileName:_jsxFileName,lineNumber:218,columnNumber:7}}));});exports.Input=Input;var InputText=function InputText(_ref){var text=_ref.text,brandColor=_ref.brandColor,brandBackground=_ref.brandBackground;return _react.default.createElement(_.Container,{bg:brandBackground,justifyContent:"center",px:2,__self:_this,__source:{fileName:_jsxFileName,lineNumber:224,columnNumber:3}},text&&_react.default.createElement(_.Typography,{color:brandColor,__self:_this,__source:{fileName:_jsxFileName,lineNumber:225,columnNumber:14}},text));};var LabelText=function LabelText(_ref2){var inline=_ref2.inline,label=_ref2.label,labelStyles=_ref2.labelStyles;return _react.default.createElement(_.Typography,(0,_extends2.default)({numberOfLines:1,textStyle:"subtext",mb:inline?"12px":"7px"},labelStyles,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:230,columnNumber:3}}),label);};var ErrorMessage=function ErrorMessage(_ref3){var error=_ref3.error,message=_ref3.message,theme=_ref3.theme;if(error){return _react.default.createElement(_.Typography,{textStyle:"subtext",color:theme.colors.font.danger,__self:_this,__source:{fileName:_jsxFileName,lineNumber:243,columnNumber:7}},message);}return null;};Input.propTypes=(0,_extends2.default)({},_propTypes.default.flexbox,_propTypes.default.space,_propTypes.default.border,_propTypes.default.buttonStyle,{label:_propTypes2.default.string,labelStyles:_propTypes2.default.object,containerStyles:_propTypes2.default.object,message:_propTypes2.default.string,error:_propTypes2.default.bool,inline:_propTypes2.default.bool,brandRight:_propTypes2.default.string,brandLeft:_propTypes2.default.string,disabled:_propTypes2.default.bool,brandColor:_propTypes2.default.string,brandBackground:_propTypes2.default.string,secureTextEntry:_propTypes2.default.bool,enableFocusStyle:_propTypes2.default.bool,LeftIcon:_propTypes2.default.func,RightIcon:_propTypes2.default.func,children:_propTypes2.default.node});InputText.propTypes={text:_propTypes2.default.string,borderColor:_propTypes2.default.string,brandColor:_propTypes2.default.string,brandBackground:_propTypes2.default.string};LabelText.propTypes={inline:_propTypes2.default.bool,label:_propTypes2.default.string,labelStyles:_propTypes2.default.object};ErrorMessage.propTypes={error:_propTypes2.default.bool,message:_propTypes2.default.string};TextInput.defaultProps={px:2,minHeight:45,fontFamily:"inter400",fontSize:"16px"};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neetoui-rn",
3
- "version": "0.0.100",
3
+ "version": "0.0.101",
4
4
  "main": "lib/index.js",
5
5
  "author": "BigBinary",
6
6
  "license": "MIT",
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/display-name */
1
2
  import React, { useContext, useState } from "react";
2
3
  import {
3
4
  flexbox,
@@ -9,6 +10,7 @@ import {
9
10
  layout,
10
11
  } from "styled-system";
11
12
  import Icon from "react-native-remix-icon";
13
+ import { Platform } from "react-native";
12
14
  import styled, { ThemeContext } from "styled-components/native";
13
15
  import propTypes from "@styled-system/prop-types";
14
16
  import PropTypes from "prop-types";
@@ -84,6 +86,7 @@ export const Input = React.forwardRef((props, ref) => {
84
86
 
85
87
  const theme = useContext(ThemeContext);
86
88
  const [isPasswordVisible, setIsPasswordVisible] = useState(false);
89
+ const [height, setHeight] = useState(0);
87
90
  const [isFocus, setIsFocus] = useState(false);
88
91
  const borderColor = error
89
92
  ? theme.colors.border.danger
@@ -162,8 +165,16 @@ export const Input = React.forwardRef((props, ref) => {
162
165
  )}
163
166
  <TextInput
164
167
  ref={ref}
165
- height={40}
166
168
  flex={1}
169
+ {...Platform.select({
170
+ ios: {},
171
+ android: {
172
+ height,
173
+ onContentSizeChange: event => {
174
+ setHeight(event.nativeEvent.contentSize.height);
175
+ },
176
+ },
177
+ })}
167
178
  textStyle="subtext"
168
179
  editable={!disabled}
169
180
  color={error ? theme.colors.font.danger : theme.colors.font.primary}
@@ -324,8 +335,8 @@ ErrorMessage.propTypes = {
324
335
  };
325
336
 
326
337
  TextInput.defaultProps = {
327
- height: 40,
328
338
  px: 2,
339
+ minHeight: 45,
329
340
  fontFamily: "inter400",
330
341
  fontSize: "16px",
331
342
  };