@bigbinary/neetoui-rn 0.0.64 → 0.0.68
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/README.md +11 -7
- package/lib/components/Button.js +1 -1
- package/lib/components/Chip.js +1 -1
- package/lib/components/Input.js +1 -1
- package/lib/components/ParentView.js +1 -1
- package/package.json +1 -2
- package/src/components/Button.js +59 -0
- package/src/components/Chip.js +69 -2
- package/src/components/Input.js +70 -48
- package/src/components/ParentView.js +5 -17
package/README.md
CHANGED
|
@@ -4,10 +4,18 @@
|
|
|
4
4
|
**NeetoUI-RN** is the library that drives the experience in all Neeto React
|
|
5
5
|
Native products built at [BigBinary](https://www.bigbinary.com).
|
|
6
6
|
|
|
7
|
+
## Documentation
|
|
8
|
+
|
|
9
|
+
Read the docs here.
|
|
10
|
+
|
|
11
|
+
Docs: https://neetoui-rn-docs.netlify.app/
|
|
12
|
+
|
|
13
|
+
Storybook: https://neetoui-rn.netlify.app
|
|
14
|
+
|
|
7
15
|
## Installation
|
|
8
16
|
|
|
9
17
|
```
|
|
10
|
-
yarn add @bigbinary/neetoui-rn
|
|
18
|
+
yarn add @bigbinary/neetoui-rn react-native-svg react-native-webview
|
|
11
19
|
```
|
|
12
20
|
|
|
13
21
|
To link the library, run:
|
|
@@ -63,10 +71,6 @@ Run `cd docs`, `yarn start` to run component documentation locally.
|
|
|
63
71
|
Run `cd docs`, `yarn build` to build component documentation locally, this would
|
|
64
72
|
create `dist` folder with static files in `docs` folder.
|
|
65
73
|
|
|
66
|
-
##
|
|
67
|
-
|
|
68
|
-
Read the docs here.
|
|
74
|
+
## Learn more about contributing to this repository
|
|
69
75
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Storybook: https://neetoui-rn.netlify.app
|
|
76
|
+
https://github.com/bigbinary/neeto-ui-rn/blob/master/CONTRIBUTING.md
|
package/lib/components/Button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.TouchableOpacity=exports.Button=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 _native=_interopRequireDefault(require("styled-components/native"));var _propTypes=_interopRequireDefault(require("@styled-system/prop-types"));var _=require("./");var _propTypes2=_interopRequireDefault(require("prop-types"));var _excluded=["RightIcon","LeftIcon","fontFamily","color","fontSize","loadingText","isLoading","Loader","disabled","variant"];var _templateObject,_this=this,_jsxFileName="/Users/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/Button.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 TouchableOpacity=_native.default.TouchableOpacity(_templateObject||(_templateObject=(0,_taggedTemplateLiteralLoose2.default)(["\n ","\n ","\n ","\n ","\n ","\n ","\n"])),_styledSystem.buttonStyle,_styledSystem.flexbox,_styledSystem.space,_styledSystem.border,_styledSystem.layout,_styledSystem.color);exports.TouchableOpacity=TouchableOpacity;var Button=function Button(_ref){var RightIcon=_ref.RightIcon,LeftIcon=_ref.LeftIcon,fontFamily=_ref.fontFamily,color=_ref.color,fontSize=_ref.fontSize,loadingText=_ref.loadingText,isLoading=_ref.isLoading,Loader=_ref.Loader,disabled=_ref.disabled,variant=_ref.variant,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var style=rest.style||{};if(disabled||isLoading){style=(0,_extends2.default)({},style,{opacity:0.5});}return React.createElement(TouchableOpacity,(0,_extends2.default)({flexDirection:"row",disabled:disabled||isLoading},rest,{variant:variant,style:style,__self:_this,__source:{fileName:_jsxFileName,lineNumber:
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.TouchableOpacity=exports.Button=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 _native=_interopRequireDefault(require("styled-components/native"));var _propTypes=_interopRequireDefault(require("@styled-system/prop-types"));var _=require("./");var _propTypes2=_interopRequireDefault(require("prop-types"));var _excluded=["RightIcon","LeftIcon","fontFamily","color","fontSize","loadingText","isLoading","Loader","disabled","variant"];var _templateObject,_this=this,_jsxFileName="/Users/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/Button.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 TouchableOpacity=_native.default.TouchableOpacity(_templateObject||(_templateObject=(0,_taggedTemplateLiteralLoose2.default)(["\n ","\n ","\n ","\n ","\n ","\n ","\n"])),_styledSystem.buttonStyle,_styledSystem.flexbox,_styledSystem.space,_styledSystem.border,_styledSystem.layout,_styledSystem.color);exports.TouchableOpacity=TouchableOpacity;var Button=function Button(_ref){var RightIcon=_ref.RightIcon,LeftIcon=_ref.LeftIcon,fontFamily=_ref.fontFamily,color=_ref.color,fontSize=_ref.fontSize,loadingText=_ref.loadingText,isLoading=_ref.isLoading,Loader=_ref.Loader,disabled=_ref.disabled,variant=_ref.variant,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var style=rest.style||{};if(disabled||isLoading){style=(0,_extends2.default)({},style,{opacity:0.5});}return React.createElement(TouchableOpacity,(0,_extends2.default)({flexDirection:"row",disabled:disabled||isLoading},rest,{variant:variant,style:style,__self:_this,__source:{fileName:_jsxFileName,lineNumber:74,columnNumber:5}}),Loader&&isLoading&&React.createElement(_.Container,{mx:1,__self:_this,__source:{fileName:_jsxFileName,lineNumber:82,columnNumber:9}},React.createElement(Loader,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:83,columnNumber:11}})),LeftIcon&&React.createElement(LeftIcon,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:86,columnNumber:20}}),React.createElement(_.Typography,{textAlign:"center",mx:1,color:color,fontFamily:fontFamily||"inter700",fontSize:fontSize||"s",textStyle:variant,__self:_this,__source:{fileName:_jsxFileName,lineNumber:87,columnNumber:7}},isLoading?loadingText:rest.label),RightIcon&&React.createElement(RightIcon,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:97,columnNumber:21}}));};exports.Button=Button;Button.defaultProps={variant:"solid",p:12,alignItems:"center",justifyContent:"center",borderRadius:2,loadingText:"Loading…"};Button.propTypes=(0,_extends2.default)({},_propTypes.default.buttonStyle,_propTypes.default.flexbox,_propTypes.default.space,_propTypes.default.border,_propTypes.default.layout,_propTypes.default.color,{label:_propTypes2.default.string.isRequired,variant:_propTypes2.default.oneOf(["text","inverse","solid"]),RightIcon:_propTypes2.default.elementType,LeftIcon:_propTypes2.default.elementType,loadingText:_propTypes2.default.string,isLoading:_propTypes2.default.bool,Loader:_propTypes2.default.elementType});
|
package/lib/components/Chip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.TouchableOpacity=exports.Chip=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 _propTypes=_interopRequireDefault(require("prop-types"));var _styledSystem=require("styled-system");var _native=_interopRequireDefault(require("styled-components/native"));var _reactNativeRemixIcon=_interopRequireDefault(require("react-native-remix-icon"));var _=require("./");var _excluded=["label","LeftIcon","variant","labelColor","closeIconBackground","closeIconColor","onClose","onChipPress","isDisabled","closeIconSize","closeIcon"];var _templateObject,_this=this,_jsxFileName="/Users/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/Chip.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 TouchableOpacity=_native.default.TouchableOpacity(_templateObject||(_templateObject=(0,_taggedTemplateLiteralLoose2.default)(["\n ","\n ","\n ","\n ","\n ","\n"])),_styledSystem.space,_styledSystem.border,_styledSystem.color,_styledSystem.flexbox,_styledSystem.layout);exports.TouchableOpacity=TouchableOpacity;var variantStyleObj={solid:{bg:"background.grey200"},outlined:{bg:"background.white",border:"1px solid",borderColor:"border.grey400"}};var Chip=function Chip(_ref){var label=_ref.label,LeftIcon=_ref.LeftIcon,variant=_ref.variant,labelColor=_ref.labelColor,closeIconBackground=_ref.closeIconBackground,closeIconColor=_ref.closeIconColor,onClose=_ref.onClose,onChipPress=_ref.onChipPress,isDisabled=_ref.isDisabled,closeIconSize=_ref.closeIconSize,closeIcon=_ref.closeIcon,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);return React.createElement(TouchableOpacity,(0,_extends2.default)({flexDirection:"row",p:2,borderRadius:20,alignItems:"center",onPress:onChipPress,disabled:!onChipPress||isDisabled},variant&&variantStyleObj[variant],isDisabled&&{opacity:0.5},rest.containerStyle,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.TouchableOpacity=exports.Chip=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 _propTypes=_interopRequireDefault(require("prop-types"));var _styledSystem=require("styled-system");var _native=_interopRequireDefault(require("styled-components/native"));var _reactNativeRemixIcon=_interopRequireDefault(require("react-native-remix-icon"));var _=require("./");var _excluded=["label","LeftIcon","variant","labelColor","closeIconBackground","closeIconColor","onClose","onChipPress","isDisabled","closeIconSize","closeIcon"];var _templateObject,_this=this,_jsxFileName="/Users/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/Chip.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 TouchableOpacity=_native.default.TouchableOpacity(_templateObject||(_templateObject=(0,_taggedTemplateLiteralLoose2.default)(["\n ","\n ","\n ","\n ","\n ","\n"])),_styledSystem.space,_styledSystem.border,_styledSystem.color,_styledSystem.flexbox,_styledSystem.layout);exports.TouchableOpacity=TouchableOpacity;var variantStyleObj={solid:{bg:"background.grey200"},outlined:{bg:"background.white",border:"1px solid",borderColor:"border.grey400"}};var Chip=function Chip(_ref){var label=_ref.label,LeftIcon=_ref.LeftIcon,variant=_ref.variant,labelColor=_ref.labelColor,closeIconBackground=_ref.closeIconBackground,closeIconColor=_ref.closeIconColor,onClose=_ref.onClose,onChipPress=_ref.onChipPress,isDisabled=_ref.isDisabled,closeIconSize=_ref.closeIconSize,closeIcon=_ref.closeIcon,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);return React.createElement(TouchableOpacity,(0,_extends2.default)({flexDirection:"row",p:2,borderRadius:20,alignItems:"center",onPress:onChipPress,disabled:!onChipPress||isDisabled},variant&&variantStyleObj[variant],isDisabled&&{opacity:0.5},rest.containerStyle,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:77,columnNumber:5}}),LeftIcon&&React.createElement(LeftIcon,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:88,columnNumber:20}}),React.createElement(_.Typography,{mx:2,fontFamily:"inter400",color:labelColor,__self:_this,__source:{fileName:_jsxFileName,lineNumber:89,columnNumber:7}},label),onClose&&React.createElement(TouchableOpacity,(0,_extends2.default)({bg:closeIconBackground,borderRadius:10,disabled:isDisabled,onPress:onClose},rest.closeIconContainerStyle,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:93,columnNumber:9}}),React.createElement(_reactNativeRemixIcon.default,{name:closeIcon,size:closeIconSize,color:closeIconColor,__self:_this,__source:{fileName:_jsxFileName,lineNumber:100,columnNumber:11}})));};exports.Chip=Chip;Chip.defaultProps={variant:"outlined",labelColor:"font.primary",closeIconBackground:"background.grey500",closeIconColor:"white",isDisabled:false,closeIconSize:14,closeIcon:"ri-close-fill"};Chip.propTypes={label:_propTypes.default.string.isRequired,LeftIcon:_propTypes.default.elementType,variant:_propTypes.default.string,labelColor:_propTypes.default.string,closeIconBackground:_propTypes.default.string,closeIconColor:_propTypes.default.string,onClose:_propTypes.default.func,closeIconSize:_propTypes.default.number,closeIcon:_propTypes.default.string,onChipPress:_propTypes.default.func,isDisabled:_propTypes.default.bool};
|
package/lib/components/Input.js
CHANGED
|
@@ -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","message","error","onFocus","onBlur","inline","brandRight","brandLeft","brandColor","brandBackground","disabled","secureTextEntry","textAlignVertical"];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,_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,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,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=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=isFocus&&{backgroundColor:error?theme.colors.border.danger:theme.colors.border.base};return _react.default.createElement(_.Container,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:119,columnNumber:5}},!inline&&_react.default.createElement(LabelText,{labelStyles:labelStyles,inline:inline,label:label,__self:_this,__source:{fileName:_jsxFileName,lineNumber:121,columnNumber:9}}),_react.default.createElement(_.Container,(0,_extends2.default)({},focusStyles,disabledStyles,{flexDirection:inline?"row":"column",onBlur:handleBlur,onFocus:handleFocus,position:"relative",__self:_this,__source:{fileName:_jsxFileName,lineNumber:123,columnNumber:7}}),inline&&_react.default.createElement(_.Container,{alignSelf:"flex-end",maxWidth:100,__self:_this,__source:{fileName:_jsxFileName,lineNumber:132,columnNumber:11}},_react.default.createElement(LabelText,{labelStyles:labelStyles,inline:inline,label:label,__self:_this,__source:{fileName:_jsxFileName,lineNumber:133,columnNumber:13}})),_react.default.createElement(_.Container,{flexDirection:"row",width:"100%",__self:_this,__source:{fileName:_jsxFileName,lineNumber:140,columnNumber:9}},brandLeft&&_react.default.createElement(InputText,{text:brandLeft,borderColor:borderColor,brandColor:brandColor,brandBackground:brandBackground,__self:_this,__source:{fileName:_jsxFileName,lineNumber:142,columnNumber:13}}),_react.default.createElement(TextInput,(0,_extends2.default)({ref:ref,height:40,flex:1,textStyle:"subtext",border:!inline&&borderColor,editable:!disabled,color:error?theme.colors.font.danger:theme.colors.font.primary,secureTextEntry:secureTextEntry&&!isPasswordVisible,textAlignVertical:textAlignVertical},rest,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:149,columnNumber:11}})),brandRight&&_react.default.createElement(InputText,{text:brandRight,borderColor:borderColor,brandColor:brandColor,brandBackground:brandBackground,__self:_this,__source:{fileName:_jsxFileName,lineNumber:163,columnNumber:13}})),secureTextEntry&&_react.default.createElement(_.Container,{position:"absolute",left:"90%",height:"100%",justifyContent:"center",__self:_this,__source:{fileName:_jsxFileName,lineNumber:172,columnNumber:11}},_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:178,columnNumber:13}}))),inline&&_react.default.createElement(View,(0,_extends2.default)({backgroundColor:theme.colors.border.primary,height:1},inlineInputStyles,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:187,columnNumber:9}})),_react.default.createElement(ErrorMessage,{theme:theme,error:error,message:message,__self:_this,__source:{fileName:_jsxFileName,lineNumber:193,columnNumber:7}}));});exports.Input=Input;var InputText=function InputText(_ref){var text=_ref.text,borderColor=_ref.borderColor,brandColor=_ref.brandColor,brandBackground=_ref.brandBackground;return _react.default.createElement(_.Container,{bg:brandBackground,justifyContent:"center",px:2,borderColor:borderColor,borderWidth:"1px",__self:_this,__source:{fileName:_jsxFileName,lineNumber:199,columnNumber:3}},text&&_react.default.createElement(_.Typography,{color:brandColor,__self:_this,__source:{fileName:_jsxFileName,lineNumber:206,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:211,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:224,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,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,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,border:1,px:2,fontFamily:"inter400",fontSize:"14px",borderRadius:2};
|
|
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,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:"14px"};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ParentView=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _propTypes=_interopRequireDefault(require("prop-types"));var _native=require("styled-components/native");var
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ParentView=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _propTypes=_interopRequireDefault(require("prop-types"));var _native=require("styled-components/native");var _=require("./");var _excluded=["barStyle","children","backgroundColor","bg"];var _this=this,_jsxFileName="/Users/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/ParentView.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 ParentView=function ParentView(_ref){var _ref$barStyle=_ref.barStyle,barStyle=_ref$barStyle===void 0?"light-content":_ref$barStyle,children=_ref.children,backgroundColor=_ref.backgroundColor,bg=_ref.bg,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var theme=(0,_react.useContext)(_native.ThemeContext);var newBackgroundColor=backgroundColor||bg||theme.colors.background.parentView;var statusBarColors={default:theme.colors.background.white,"dark-content":theme.colors.background.white,"light-content":theme.colors.background.base};var statusBarColor=statusBarColors[barStyle]||statusBarColors["default"];return _react.default.createElement(_.Container,{flex:1,__self:_this,__source:{fileName:_jsxFileName,lineNumber:48,columnNumber:5}},_react.default.createElement(_.Container,{backgroundColor:statusBarColor,__self:_this,__source:{fileName:_jsxFileName,lineNumber:49,columnNumber:7}},_react.default.createElement(_reactNative.SafeAreaView,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:50,columnNumber:9}},_react.default.createElement(_reactNative.StatusBar,{barStyle:barStyle,backgroundColor:statusBarColor,__self:_this,__source:{fileName:_jsxFileName,lineNumber:51,columnNumber:11}}))),_react.default.createElement(_.Container,(0,_extends2.default)({flex:1,backgroundColor:newBackgroundColor},rest,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:54,columnNumber:7}}),children));};exports.ParentView=ParentView;ParentView.propTypes={barStyle:_propTypes.default.string,children:_propTypes.default.node,backgroundColor:_propTypes.default.string,bg:_propTypes.default.string};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neetoui-rn",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.68",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"author": "BigBinary",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@styled-system/prop-types": "^5.1.5",
|
|
48
|
-
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
49
48
|
"react-native-modal": "^13.0.0",
|
|
50
49
|
"react-native-pell-rich-editor": "^1.8.6",
|
|
51
50
|
"react-native-remix-icon": "^0.3.0",
|
package/src/components/Button.js
CHANGED
|
@@ -21,6 +21,37 @@ export const TouchableOpacity = styled.TouchableOpacity`
|
|
|
21
21
|
${color}
|
|
22
22
|
`;
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* Buttons are touchable elements used to interact with the screen and to trigger an action.
|
|
27
|
+
*
|
|
28
|
+
* <div class="screenshots">
|
|
29
|
+
* <img src="screenshots/button/solidButtons.png" />
|
|
30
|
+
* <img src="screenshots/button/loaderButtons.png" />
|
|
31
|
+
* </div>
|
|
32
|
+
*
|
|
33
|
+
* ## Usage
|
|
34
|
+
* ```js
|
|
35
|
+
* import * as React from 'react';
|
|
36
|
+
* import { Button, Container } from '@bigbinary/neetoui-rn';
|
|
37
|
+
*
|
|
38
|
+
* export default function Main() {
|
|
39
|
+
* return (
|
|
40
|
+
* <Container>
|
|
41
|
+
* <Button
|
|
42
|
+
* my={9}
|
|
43
|
+
* width={200}
|
|
44
|
+
* variant="solid"
|
|
45
|
+
* disabled
|
|
46
|
+
* label="Solid Button"
|
|
47
|
+
* />
|
|
48
|
+
* </Container>
|
|
49
|
+
* );
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
|
|
24
55
|
export const Button = ({
|
|
25
56
|
RightIcon,
|
|
26
57
|
LeftIcon,
|
|
@@ -84,10 +115,38 @@ Button.propTypes = {
|
|
|
84
115
|
...propTypes.border,
|
|
85
116
|
...propTypes.layout,
|
|
86
117
|
...propTypes.color,
|
|
118
|
+
/**
|
|
119
|
+
* Takes the text that needs to be displayed inside the button.
|
|
120
|
+
*/
|
|
87
121
|
label: PropTypes.string.isRequired,
|
|
122
|
+
/**
|
|
123
|
+
* Supported Type: 'text' | 'inverse' | 'solid'
|
|
124
|
+
* You can change the mode to adjust the styling.
|
|
125
|
+
* <ul>
|
|
126
|
+
* <li>text - flat button without background or outline.</li>
|
|
127
|
+
* <li>inverse - button with an outline.</li>
|
|
128
|
+
* <li>solid - button with a background color.</li>
|
|
129
|
+
* </ul>
|
|
130
|
+
*/
|
|
131
|
+
variant: PropTypes.oneOf(["text", "inverse", "solid"]),
|
|
132
|
+
/**
|
|
133
|
+
* Expects a component.
|
|
134
|
+
*/
|
|
88
135
|
RightIcon: PropTypes.elementType,
|
|
136
|
+
/**
|
|
137
|
+
* Expects a component.
|
|
138
|
+
*/
|
|
89
139
|
LeftIcon: PropTypes.elementType,
|
|
140
|
+
/**
|
|
141
|
+
* Custom text can be specified while loading if default one needs to changed.
|
|
142
|
+
*/
|
|
90
143
|
loadingText: PropTypes.string,
|
|
144
|
+
/**
|
|
145
|
+
* Whether to show a loading indicator.
|
|
146
|
+
*/
|
|
91
147
|
isLoading: PropTypes.bool,
|
|
148
|
+
/**
|
|
149
|
+
* Expects a component. Is used to override the default loader.
|
|
150
|
+
*/
|
|
92
151
|
Loader: PropTypes.elementType,
|
|
93
152
|
};
|
package/src/components/Chip.js
CHANGED
|
@@ -25,6 +25,40 @@ const variantStyleObj = {
|
|
|
25
25
|
},
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* Chips are compact elements that represent an input, attribute, or action.
|
|
31
|
+
*
|
|
32
|
+
* <div class="screenshots">
|
|
33
|
+
* <img src="screenshots/chip/chip.png" />
|
|
34
|
+
* </div>
|
|
35
|
+
*
|
|
36
|
+
* ## Usage
|
|
37
|
+
* ```js
|
|
38
|
+
* import * as React from 'react';
|
|
39
|
+
* import { Chip, Container, Typography } from '@bigbinary/neetoui-rn';
|
|
40
|
+
*
|
|
41
|
+
* export default function Main(){
|
|
42
|
+
* return (
|
|
43
|
+
* <Container>
|
|
44
|
+
* <Chip
|
|
45
|
+
* label="Outlined Chip"
|
|
46
|
+
* LeftIcon={() => <Typography>📣</Typography>}
|
|
47
|
+
* variant="outlined"
|
|
48
|
+
* onChipPress={() => {
|
|
49
|
+
* alert("Chip pressed");
|
|
50
|
+
* }}
|
|
51
|
+
* onClose={() => {
|
|
52
|
+
* alert("On Close clicked");
|
|
53
|
+
* }}
|
|
54
|
+
* />
|
|
55
|
+
* </Container>
|
|
56
|
+
* );
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
61
|
+
|
|
28
62
|
export const Chip = ({
|
|
29
63
|
label,
|
|
30
64
|
LeftIcon,
|
|
@@ -81,15 +115,48 @@ Chip.defaultProps = {
|
|
|
81
115
|
};
|
|
82
116
|
|
|
83
117
|
Chip.propTypes = {
|
|
118
|
+
/**
|
|
119
|
+
* Takes the text that needs to be displayed inside the chip.
|
|
120
|
+
*/
|
|
84
121
|
label: PropTypes.string.isRequired,
|
|
122
|
+
/**
|
|
123
|
+
* Expects a component. Used to set left Icon or Avatar.
|
|
124
|
+
*/
|
|
85
125
|
LeftIcon: PropTypes.elementType,
|
|
126
|
+
/**
|
|
127
|
+
* Supported variant: 'outlined' | 'solid'
|
|
128
|
+
*/
|
|
86
129
|
variant: PropTypes.string,
|
|
130
|
+
/**
|
|
131
|
+
* Sets chip text color.
|
|
132
|
+
*/
|
|
87
133
|
labelColor: PropTypes.string,
|
|
134
|
+
/**
|
|
135
|
+
* Sets close Icon background color.
|
|
136
|
+
*/
|
|
88
137
|
closeIconBackground: PropTypes.string,
|
|
138
|
+
/**
|
|
139
|
+
* Sets close Icon color.
|
|
140
|
+
*/
|
|
89
141
|
closeIconColor: PropTypes.string,
|
|
142
|
+
/**
|
|
143
|
+
* Expects a function to execute on close icon press. The close icon appears only when the onClose prop is specified.
|
|
144
|
+
*/
|
|
90
145
|
onClose: PropTypes.func,
|
|
91
|
-
|
|
92
|
-
|
|
146
|
+
/**
|
|
147
|
+
* Used to set the size of the close icon.
|
|
148
|
+
*/
|
|
93
149
|
closeIconSize: PropTypes.number,
|
|
150
|
+
/**
|
|
151
|
+
* Close icon name can be specified if default one needs to changed. Only supports remixIcons.
|
|
152
|
+
*/
|
|
94
153
|
closeIcon: PropTypes.string,
|
|
154
|
+
/**
|
|
155
|
+
* Expects a function to execute on chip press.
|
|
156
|
+
*/
|
|
157
|
+
onChipPress: PropTypes.func,
|
|
158
|
+
/**
|
|
159
|
+
* Whether the chip is disabled. A disabled chip has a overlay and onPress is not called on touch.
|
|
160
|
+
*/
|
|
161
|
+
isDisabled: PropTypes.bool,
|
|
95
162
|
};
|
package/src/components/Input.js
CHANGED
|
@@ -63,11 +63,14 @@ export const Input = React.forwardRef((props, ref) => {
|
|
|
63
63
|
const {
|
|
64
64
|
label = "",
|
|
65
65
|
labelStyles,
|
|
66
|
+
containerStyles,
|
|
66
67
|
message = "",
|
|
67
68
|
error = false,
|
|
68
69
|
onFocus,
|
|
69
70
|
onBlur,
|
|
70
71
|
inline = false,
|
|
72
|
+
LeftIcon,
|
|
73
|
+
RightIcon,
|
|
71
74
|
brandRight,
|
|
72
75
|
brandLeft,
|
|
73
76
|
brandColor = "font.grey600",
|
|
@@ -75,6 +78,7 @@ export const Input = React.forwardRef((props, ref) => {
|
|
|
75
78
|
disabled = false,
|
|
76
79
|
secureTextEntry = false,
|
|
77
80
|
textAlignVertical = "top",
|
|
81
|
+
enableFocusStyle = false,
|
|
78
82
|
...rest
|
|
79
83
|
} = props;
|
|
80
84
|
|
|
@@ -95,38 +99,44 @@ export const Input = React.forwardRef((props, ref) => {
|
|
|
95
99
|
setIsFocus(false);
|
|
96
100
|
};
|
|
97
101
|
|
|
98
|
-
const focusStyles =
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
const focusStyles = enableFocusStyle &&
|
|
103
|
+
isFocus && {
|
|
104
|
+
borderRadius: 4,
|
|
105
|
+
borderColor: error
|
|
106
|
+
? "rgba(255, 105, 105, 0.3)"
|
|
107
|
+
: theme.colors.border.grey400,
|
|
108
|
+
borderWidth: inline ? "0px" : "3px",
|
|
109
|
+
borderStyle: "solid",
|
|
110
|
+
};
|
|
106
111
|
|
|
107
112
|
const disabledStyles = disabled && {
|
|
108
113
|
opacity: 0.5,
|
|
109
114
|
bg: theme.colors.background.secondary,
|
|
110
115
|
};
|
|
111
116
|
|
|
112
|
-
const inlineInputStyles =
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
const inlineInputStyles = enableFocusStyle &&
|
|
118
|
+
isFocus && {
|
|
119
|
+
backgroundColor: error
|
|
120
|
+
? theme.colors.border.danger
|
|
121
|
+
: theme.colors.border.base,
|
|
122
|
+
};
|
|
117
123
|
|
|
118
124
|
return (
|
|
119
125
|
<Container>
|
|
120
|
-
{!inline && (
|
|
126
|
+
{!inline && !!label && (
|
|
121
127
|
<LabelText labelStyles={labelStyles} inline={inline} label={label} />
|
|
122
128
|
)}
|
|
123
129
|
<Container
|
|
130
|
+
border={!inline}
|
|
131
|
+
borderColor={borderColor}
|
|
132
|
+
borderRadius={2}
|
|
124
133
|
{...focusStyles}
|
|
125
134
|
{...disabledStyles}
|
|
126
135
|
flexDirection={inline ? "row" : "column"}
|
|
127
136
|
onBlur={handleBlur}
|
|
128
137
|
onFocus={handleFocus}
|
|
129
138
|
position="relative"
|
|
139
|
+
{...containerStyles}
|
|
130
140
|
>
|
|
131
141
|
{inline && (
|
|
132
142
|
<Container alignSelf="flex-end" maxWidth={100}>
|
|
@@ -138,10 +148,14 @@ export const Input = React.forwardRef((props, ref) => {
|
|
|
138
148
|
</Container>
|
|
139
149
|
)}
|
|
140
150
|
<Container flexDirection="row" width="100%">
|
|
151
|
+
{LeftIcon && (
|
|
152
|
+
<Container alignSelf="center" mx="4px">
|
|
153
|
+
<LeftIcon />
|
|
154
|
+
</Container>
|
|
155
|
+
)}
|
|
141
156
|
{brandLeft && (
|
|
142
157
|
<InputText
|
|
143
158
|
text={brandLeft}
|
|
144
|
-
borderColor={borderColor}
|
|
145
159
|
brandColor={brandColor}
|
|
146
160
|
brandBackground={brandBackground}
|
|
147
161
|
/>
|
|
@@ -151,7 +165,6 @@ export const Input = React.forwardRef((props, ref) => {
|
|
|
151
165
|
height={40}
|
|
152
166
|
flex={1}
|
|
153
167
|
textStyle="subtext"
|
|
154
|
-
border={!inline && borderColor}
|
|
155
168
|
editable={!disabled}
|
|
156
169
|
color={error ? theme.colors.font.danger : theme.colors.font.primary}
|
|
157
170
|
secureTextEntry={secureTextEntry && !isPasswordVisible}
|
|
@@ -162,26 +175,27 @@ export const Input = React.forwardRef((props, ref) => {
|
|
|
162
175
|
{brandRight && (
|
|
163
176
|
<InputText
|
|
164
177
|
text={brandRight}
|
|
165
|
-
borderColor={borderColor}
|
|
166
178
|
brandColor={brandColor}
|
|
167
179
|
brandBackground={brandBackground}
|
|
168
180
|
/>
|
|
169
181
|
)}
|
|
182
|
+
|
|
183
|
+
{RightIcon && (
|
|
184
|
+
<Container alignSelf="center" mx="4px">
|
|
185
|
+
<RightIcon />
|
|
186
|
+
</Container>
|
|
187
|
+
)}
|
|
188
|
+
|
|
189
|
+
{secureTextEntry && (
|
|
190
|
+
<Container justifyContent="center" mx="4px">
|
|
191
|
+
<Icon
|
|
192
|
+
name={isPasswordVisible ? "eye-line" : "eye-off-line"}
|
|
193
|
+
color={theme.colors.background.grey500}
|
|
194
|
+
onPress={() => setIsPasswordVisible(!isPasswordVisible)}
|
|
195
|
+
/>
|
|
196
|
+
</Container>
|
|
197
|
+
)}
|
|
170
198
|
</Container>
|
|
171
|
-
{secureTextEntry && (
|
|
172
|
-
<Container
|
|
173
|
-
position="absolute"
|
|
174
|
-
left="90%"
|
|
175
|
-
height="100%"
|
|
176
|
-
justifyContent="center"
|
|
177
|
-
>
|
|
178
|
-
<Icon
|
|
179
|
-
name={isPasswordVisible ? "eye-line" : "eye-off-line"}
|
|
180
|
-
color={theme.colors.background.grey500}
|
|
181
|
-
onPress={() => setIsPasswordVisible(!isPasswordVisible)}
|
|
182
|
-
/>
|
|
183
|
-
</Container>
|
|
184
|
-
)}
|
|
185
199
|
</Container>
|
|
186
200
|
{inline && (
|
|
187
201
|
<View
|
|
@@ -195,14 +209,8 @@ export const Input = React.forwardRef((props, ref) => {
|
|
|
195
209
|
);
|
|
196
210
|
});
|
|
197
211
|
|
|
198
|
-
const InputText = ({ text,
|
|
199
|
-
<Container
|
|
200
|
-
bg={brandBackground}
|
|
201
|
-
justifyContent="center"
|
|
202
|
-
px={2}
|
|
203
|
-
borderColor={borderColor}
|
|
204
|
-
borderWidth="1px"
|
|
205
|
-
>
|
|
212
|
+
const InputText = ({ text, brandColor, brandBackground }) => (
|
|
213
|
+
<Container bg={brandBackground} justifyContent="center" px={2}>
|
|
206
214
|
{text && <Typography color={brandColor}>{text}</Typography>}
|
|
207
215
|
</Container>
|
|
208
216
|
);
|
|
@@ -239,9 +247,13 @@ Input.propTypes = {
|
|
|
239
247
|
*/
|
|
240
248
|
label: PropTypes.string,
|
|
241
249
|
/**
|
|
242
|
-
* To change the styles of label
|
|
250
|
+
* To change the styles of label.
|
|
243
251
|
*/
|
|
244
252
|
labelStyles: PropTypes.object,
|
|
253
|
+
/**
|
|
254
|
+
* To change the styles of input text container.
|
|
255
|
+
*/
|
|
256
|
+
containerStyles: PropTypes.object,
|
|
245
257
|
/**
|
|
246
258
|
* To display error/info messages
|
|
247
259
|
*/
|
|
@@ -251,15 +263,15 @@ Input.propTypes = {
|
|
|
251
263
|
*/
|
|
252
264
|
error: PropTypes.bool,
|
|
253
265
|
/**
|
|
254
|
-
* Changes input layout to inline
|
|
266
|
+
* Changes input layout to inline.
|
|
255
267
|
*/
|
|
256
268
|
inline: PropTypes.bool,
|
|
257
269
|
/**
|
|
258
|
-
* Display brand to the right of input
|
|
270
|
+
* Display brand to the right of input.
|
|
259
271
|
*/
|
|
260
272
|
brandRight: PropTypes.string,
|
|
261
273
|
/**
|
|
262
|
-
* Display brand to the left of input
|
|
274
|
+
* Display brand to the left of input.
|
|
263
275
|
*/
|
|
264
276
|
brandLeft: PropTypes.string,
|
|
265
277
|
/**
|
|
@@ -267,17 +279,29 @@ Input.propTypes = {
|
|
|
267
279
|
*/
|
|
268
280
|
disabled: PropTypes.bool,
|
|
269
281
|
/**
|
|
270
|
-
* To change the color of brand text
|
|
282
|
+
* To change the color of brand text.
|
|
271
283
|
*/
|
|
272
284
|
brandColor: PropTypes.string,
|
|
273
285
|
/**
|
|
274
|
-
* To change the color of brand text
|
|
286
|
+
* To change the color of brand text.
|
|
275
287
|
*/
|
|
276
288
|
brandBackground: PropTypes.string,
|
|
277
289
|
/**
|
|
278
|
-
* To hide and show password and enable secure text entry
|
|
290
|
+
* To hide and show password and enable secure text entry.
|
|
279
291
|
*/
|
|
280
292
|
secureTextEntry: PropTypes.bool,
|
|
293
|
+
/**
|
|
294
|
+
* If true, shows border on focus.
|
|
295
|
+
*/
|
|
296
|
+
enableFocusStyle: PropTypes.bool,
|
|
297
|
+
/**
|
|
298
|
+
* Display Icon to the left of input.
|
|
299
|
+
*/
|
|
300
|
+
LeftIcon: PropTypes.func,
|
|
301
|
+
/**
|
|
302
|
+
* Display Icon to the Right of input.
|
|
303
|
+
*/
|
|
304
|
+
RightIcon: PropTypes.func,
|
|
281
305
|
children: PropTypes.node,
|
|
282
306
|
};
|
|
283
307
|
|
|
@@ -301,9 +325,7 @@ ErrorMessage.propTypes = {
|
|
|
301
325
|
|
|
302
326
|
TextInput.defaultProps = {
|
|
303
327
|
height: 40,
|
|
304
|
-
border: 1,
|
|
305
328
|
px: 2,
|
|
306
329
|
fontFamily: "inter400",
|
|
307
330
|
fontSize: "14px",
|
|
308
|
-
borderRadius: 2,
|
|
309
331
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React, { useContext } from "react";
|
|
2
|
-
import { SafeAreaView, StatusBar
|
|
2
|
+
import { SafeAreaView, StatusBar } from "react-native";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { ThemeContext } from "styled-components/native";
|
|
5
|
-
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
|
|
6
5
|
import { Container } from "@components";
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
|
-
*ParentView wraps the childrens with SafeAreaview
|
|
8
|
+
*ParentView wraps the childrens with SafeAreaview.
|
|
10
9
|
*
|
|
11
10
|
* ## Usage
|
|
12
11
|
* ```js
|
|
@@ -46,21 +45,16 @@ export const ParentView = ({
|
|
|
46
45
|
statusBarColors[barStyle] || statusBarColors["default"];
|
|
47
46
|
|
|
48
47
|
return (
|
|
49
|
-
<
|
|
50
|
-
enableOnAndroid={true}
|
|
51
|
-
contentContainerStyle={styles.scrollView}
|
|
52
|
-
showsVerticalScrollIndicator={false}
|
|
53
|
-
style={{ backgroundColor: newBackgroundColor }}
|
|
54
|
-
>
|
|
48
|
+
<Container flex={1}>
|
|
55
49
|
<Container backgroundColor={statusBarColor}>
|
|
56
50
|
<SafeAreaView>
|
|
57
|
-
<StatusBar barStyle={barStyle} />
|
|
51
|
+
<StatusBar barStyle={barStyle} backgroundColor={statusBarColor} />
|
|
58
52
|
</SafeAreaView>
|
|
59
53
|
</Container>
|
|
60
54
|
<Container flex={1} backgroundColor={newBackgroundColor} {...rest}>
|
|
61
55
|
{children}
|
|
62
56
|
</Container>
|
|
63
|
-
</
|
|
57
|
+
</Container>
|
|
64
58
|
);
|
|
65
59
|
};
|
|
66
60
|
|
|
@@ -79,9 +73,3 @@ ParentView.propTypes = {
|
|
|
79
73
|
*/
|
|
80
74
|
bg: PropTypes.string,
|
|
81
75
|
};
|
|
82
|
-
|
|
83
|
-
const styles = StyleSheet.create({
|
|
84
|
-
scrollView: {
|
|
85
|
-
flexGrow: 1,
|
|
86
|
-
},
|
|
87
|
-
});
|