@bigbinary/neetoui-rn 0.0.220 → 0.0.221
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +43 -5
- package/lib/components/Accordion.js +1 -1
- package/lib/components/Button.js +1 -1
- package/lib/components/ButtonGroup.js +1 -1
- package/lib/components/Calendar.js +1 -1
- package/lib/components/Chip.js +1 -1
- package/lib/components/FAB.js +1 -1
- package/lib/components/Input.js +1 -1
- package/lib/components/MultiSelect.js +1 -1
- package/lib/components/NotificationPreferenceList.js +1 -1
- package/lib/components/OrganizationItem.js +1 -1
- package/lib/components/RichTextEditor.js +1 -1
- package/lib/components/SearchBar.js +1 -1
- package/lib/components/SegmentedTopBar.js +1 -1
- package/lib/components/SocialButton.js +1 -1
- package/lib/components/Touchable.js +1 -1
- package/package.json +1 -1
- package/src/components/Accordion.js +98 -93
- package/src/components/Button.js +17 -15
- package/src/components/ButtonGroup.js +6 -4
- package/src/components/Calendar.js +1 -2
- package/src/components/Chip.js +6 -3
- package/src/components/FAB.js +9 -0
- package/src/components/Input.js +17 -18
- package/src/components/MultiSelect.js +2 -67
- package/src/components/NotificationPreferenceList.js +8 -10
- package/src/components/OrganizationItem.js +10 -11
- package/src/components/RichTextEditor.js +2 -0
- package/src/components/SearchBar.js +13 -11
- package/src/components/SegmentedTopBar.js +5 -10
- package/src/components/SocialButton.js +11 -2
- package/src/components/Touchable.js +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.SocialButton=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _propTypes=_interopRequireDefault(require("@styled-system/prop-types"));var _propTypes2=_interopRequireDefault(require("prop-types"));var _native=require("styled-components/native");var _reactNative=require("react-native");var _appleLogo=_interopRequireDefault(require("../../assets/icons/apple-logo.svg"));var _googleLogo=_interopRequireDefault(require("../../assets/icons/google-logo.svg"));var _=require("./");var _excluded=["variant","disabled","labelStyle","isLoading"];var _this=this,_jsxFileName="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/SocialButton.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 SocialButton=function SocialButton(
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.SocialButton=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _propTypes=_interopRequireDefault(require("@styled-system/prop-types"));var _propTypes2=_interopRequireDefault(require("prop-types"));var _native=require("styled-components/native");var _reactNative=require("react-native");var _appleLogo=_interopRequireDefault(require("../../assets/icons/apple-logo.svg"));var _googleLogo=_interopRequireDefault(require("../../assets/icons/google-logo.svg"));var _=require("./");var _excluded=["variant","disabled","labelStyle","isLoading"];var _this=this,_jsxFileName="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/SocialButton.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 SocialButton=function SocialButton(_ref){var variant=_ref.variant,disabled=_ref.disabled,labelStyle=_ref.labelStyle,isLoading=_ref.isLoading,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var theme=(0,_react.useContext)(_native.ThemeContext);var capitalize=function capitalize(str){return""+str.charAt(0).toUpperCase()+str.slice(1);};return _react.default.createElement(_.Touchable,(0,_extends2.default)({rippleColor:theme.colors.background.grey800,disabled:disabled,bg:"transparent",height:48,width:"100%",borderRadius:8,borderWidth:1,borderColor:theme.colors.border.grey800,alignItems:"center",justifyContent:"center"},rest,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:47,columnNumber:5}}),isLoading?_react.default.createElement(_reactNative.ActivityIndicator,{color:theme.colors.background.grey800,__self:_this,__source:{fileName:_jsxFileName,lineNumber:61,columnNumber:9}}):_react.default.createElement(_react.default.Fragment,null,_react.default.createElement(_.Container,{position:"absolute",left:17,__self:_this,__source:{fileName:_jsxFileName,lineNumber:64,columnNumber:11}},variant==="apple"&&_react.default.createElement(_appleLogo.default,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:65,columnNumber:37}}),variant==="google"&&_react.default.createElement(_googleLogo.default,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:66,columnNumber:38}})),_react.default.createElement(_.Typography,(0,_extends2.default)({color:theme.colors.font.primary,fontSize:"m",fontFamily:theme.fonts.sf500},labelStyle,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:68,columnNumber:11}}),"Continue with ",capitalize(variant))));};exports.SocialButton=SocialButton;SocialButton.propTypes=(0,_extends2.default)({},_propTypes.default.buttonStyle,_propTypes.default.flexbox,_propTypes.default.space,_propTypes.default.border,_propTypes.default.layout,_propTypes.default.color,{variant:_propTypes2.default.oneOf(["apple","google"]),disabled:_propTypes2.default.bool,labelStyle:_propTypes2.default.object,isLoading:_propTypes2.default.bool});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Touchable=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 _propTypes2=_interopRequireDefault(require("@styled-system/prop-types"));var _reactNativeMaterialRipple=_interopRequireDefault(require("react-native-material-ripple"));var _native=_interopRequireDefault(require("styled-components/native"));var _styledSystem=require("styled-system");var _utils=require("../utils/utils");var _excluded=["children","elevation"];var _templateObject,_this=this,_jsxFileName="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/Touchable.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 StyledRipple=(0,_native.default)(_reactNativeMaterialRipple.default)(_templateObject||(_templateObject=(0,_taggedTemplateLiteralLoose2.default)(["\n ","\n ","\n ","\n ","\n ","\n ","\n"])),_styledSystem.buttonStyle,_styledSystem.flexbox,_styledSystem.space,_styledSystem.border,_styledSystem.layout,_styledSystem.color);var Touchable=React.forwardRef(function(props,ref){var children=props.children,elevation=props.elevation,rest=(0,_objectWithoutProperties2.default)(props,_excluded);var shadowStyles=elevation?(0,_utils.getShadowStyles)(elevation):{};return React.createElement(StyledRipple,(0,_extends2.default)({rippleOpacity:0.09,rippleDuration:600,rippleContainerBorderRadius:rest.borderRadius?rest.borderRadius:0,style:shadowStyles,ref:ref},rest,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:65,columnNumber:5}}),children);});exports.Touchable=Touchable;Touchable.propTypes=(0,_extends2.default)({},_propTypes2.default.flexbox,_propTypes2.default.space,_propTypes2.default.border,_propTypes2.default.layout,_propTypes2.default.color,_propTypes2.default.buttonStyle,{children:_propTypes.default.node});
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Touchable=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 _propTypes2=_interopRequireDefault(require("@styled-system/prop-types"));var _reactNativeMaterialRipple=_interopRequireDefault(require("react-native-material-ripple"));var _native=_interopRequireDefault(require("styled-components/native"));var _styledSystem=require("styled-system");var _utils=require("../utils/utils");var _excluded=["children","elevation"];var _templateObject,_this=this,_jsxFileName="/home/runner/work/neeto-ui-rn/neeto-ui-rn/src/components/Touchable.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 StyledRipple=(0,_native.default)(_reactNativeMaterialRipple.default)(_templateObject||(_templateObject=(0,_taggedTemplateLiteralLoose2.default)(["\n ","\n ","\n ","\n ","\n ","\n ","\n"])),_styledSystem.buttonStyle,_styledSystem.flexbox,_styledSystem.space,_styledSystem.border,_styledSystem.layout,_styledSystem.color);var Touchable=React.forwardRef(function(props,ref){var children=props.children,elevation=props.elevation,rest=(0,_objectWithoutProperties2.default)(props,_excluded);var shadowStyles=elevation?(0,_utils.getShadowStyles)(elevation):{};return React.createElement(StyledRipple,(0,_extends2.default)({rippleOpacity:0.09,rippleDuration:600,rippleContainerBorderRadius:rest.borderRadius?rest.borderRadius:0,style:shadowStyles,ref:ref},rest,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:65,columnNumber:5}}),children);});exports.Touchable=Touchable;Touchable.propTypes=(0,_extends2.default)({},_propTypes2.default.flexbox,_propTypes2.default.space,_propTypes2.default.border,_propTypes2.default.layout,_propTypes2.default.color,_propTypes2.default.buttonStyle,{children:_propTypes.default.node,elevation:_propTypes.default.oneOfType([_propTypes.default.number,_propTypes.default.string])});
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react-native/no-inline-styles */
|
|
1
2
|
import React, {
|
|
2
3
|
useContext,
|
|
3
4
|
useState,
|
|
@@ -89,104 +90,108 @@ const AccordionBody = ({ isExpanded, children }) => {
|
|
|
89
90
|
*
|
|
90
91
|
*/
|
|
91
92
|
|
|
92
|
-
export const Accordion = React.forwardRef(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
93
|
+
export const Accordion = React.forwardRef(
|
|
94
|
+
(
|
|
95
|
+
{
|
|
96
|
+
header,
|
|
97
|
+
noBorder = false,
|
|
98
|
+
iconProp = {},
|
|
99
|
+
onStateChanged,
|
|
100
|
+
children,
|
|
101
|
+
position = "bottom",
|
|
102
|
+
shouldShowToggle = true,
|
|
103
|
+
...rest
|
|
104
|
+
},
|
|
105
|
+
ref
|
|
106
|
+
) => {
|
|
107
|
+
const { name, Label, size, color } = iconProp;
|
|
108
|
+
const theme = useContext(ThemeContext);
|
|
109
|
+
const [isExpanded, setExpanded] = useState(false);
|
|
110
|
+
const animationController = useRef(
|
|
111
|
+
new Animated.Value(isExpanded ? 1 : 0)
|
|
112
|
+
).current;
|
|
113
|
+
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
Animated.timing(animationController, {
|
|
116
|
+
duration: 300,
|
|
117
|
+
toValue: isExpanded ? 1 : 0,
|
|
118
|
+
useNativeDriver: false,
|
|
119
|
+
}).start(() => {
|
|
120
|
+
!!onStateChanged && onStateChanged(isExpanded);
|
|
121
|
+
});
|
|
122
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
123
|
+
}, [isExpanded]);
|
|
124
|
+
|
|
125
|
+
const handleAnimation = () => {
|
|
126
|
+
setExpanded(!isExpanded);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
useImperativeHandle(ref, () => ({
|
|
130
|
+
toggleAccordion: handleAnimation,
|
|
131
|
+
openAccordion: () => setExpanded(true),
|
|
132
|
+
closeAccordion: () => setExpanded(false),
|
|
133
|
+
}));
|
|
134
|
+
|
|
135
|
+
const arrowAngle = animationController.interpolate({
|
|
136
|
+
inputRange: [0, 1],
|
|
137
|
+
outputRange: ["0rad", `${Math.PI}rad`],
|
|
117
138
|
});
|
|
118
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
119
|
-
}, [isExpanded]);
|
|
120
139
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const arrowAngle = animationController.interpolate({
|
|
132
|
-
inputRange: [0, 1],
|
|
133
|
-
outputRange: ["0rad", `${Math.PI}rad`],
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
return (
|
|
137
|
-
<Container
|
|
138
|
-
{...(!noBorder && {
|
|
139
|
-
borderColor: "border.grey400",
|
|
140
|
-
borderWidth: 1,
|
|
141
|
-
borderRadius: 8,
|
|
142
|
-
})}
|
|
143
|
-
width="100%"
|
|
144
|
-
padding={12}
|
|
145
|
-
{...rest}
|
|
146
|
-
>
|
|
147
|
-
{position === "top" && (
|
|
148
|
-
<AccordionBody isExpanded={isExpanded}>{children}</AccordionBody>
|
|
149
|
-
)}
|
|
150
|
-
<TouchableOpacity
|
|
151
|
-
rippleOpacity={0}
|
|
152
|
-
style={styles.accordionContainer}
|
|
153
|
-
onPress={() => {
|
|
154
|
-
handleAnimation();
|
|
155
|
-
}}
|
|
140
|
+
return (
|
|
141
|
+
<Container
|
|
142
|
+
{...(!noBorder && {
|
|
143
|
+
borderColor: "border.grey400",
|
|
144
|
+
borderWidth: 1,
|
|
145
|
+
borderRadius: 8,
|
|
146
|
+
})}
|
|
147
|
+
width="100%"
|
|
148
|
+
padding={12}
|
|
149
|
+
{...rest}
|
|
156
150
|
>
|
|
157
|
-
{
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
151
|
+
{position === "top" && (
|
|
152
|
+
<AccordionBody isExpanded={isExpanded}>{children}</AccordionBody>
|
|
153
|
+
)}
|
|
154
|
+
<TouchableOpacity
|
|
155
|
+
rippleOpacity={0}
|
|
156
|
+
style={styles.accordionContainer}
|
|
157
|
+
onPress={() => {
|
|
158
|
+
handleAnimation();
|
|
159
|
+
}}
|
|
160
|
+
>
|
|
161
|
+
{!!header && <Container flexGrow={1}>{header()}</Container>}
|
|
162
|
+
{!!shouldShowToggle && (
|
|
163
|
+
<Container
|
|
164
|
+
alignItems="center"
|
|
165
|
+
justifyContent="center"
|
|
166
|
+
flexDirection="row"
|
|
167
|
+
px={1}
|
|
171
168
|
>
|
|
172
|
-
<
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
169
|
+
{Label && <Label />}
|
|
170
|
+
<Animated.View
|
|
171
|
+
style={{
|
|
172
|
+
alignItems: "flex-end",
|
|
173
|
+
transform: [{ rotateZ: arrowAngle }],
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
<Container>
|
|
177
|
+
<Icon
|
|
178
|
+
name={name ?? "ri-arrow-down-s-line"}
|
|
179
|
+
color={color ?? theme.colors.font.grey700}
|
|
180
|
+
size={size ?? 24}
|
|
181
|
+
/>
|
|
182
|
+
</Container>
|
|
183
|
+
</Animated.View>
|
|
184
|
+
</Container>
|
|
185
|
+
)}
|
|
186
|
+
</TouchableOpacity>
|
|
187
|
+
|
|
188
|
+
{position === "bottom" && (
|
|
189
|
+
<AccordionBody isExpanded={isExpanded}>{children}</AccordionBody>
|
|
181
190
|
)}
|
|
182
|
-
</
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
)}
|
|
187
|
-
</Container>
|
|
188
|
-
);
|
|
189
|
-
});
|
|
191
|
+
</Container>
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
);
|
|
190
195
|
|
|
191
196
|
AccordionBody.propTypes = {
|
|
192
197
|
isExpanded: PropTypes.bool.isRequired,
|
package/src/components/Button.js
CHANGED
|
@@ -68,21 +68,20 @@ export const BUTTON_VARIANTS = Object.freeze({
|
|
|
68
68
|
*
|
|
69
69
|
*/
|
|
70
70
|
|
|
71
|
-
export const Button =
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
} = props;
|
|
71
|
+
export const Button = ({
|
|
72
|
+
variant,
|
|
73
|
+
label,
|
|
74
|
+
labelStyle,
|
|
75
|
+
RightIcon,
|
|
76
|
+
LeftIcon,
|
|
77
|
+
disabled,
|
|
78
|
+
isLoading,
|
|
79
|
+
loadingText,
|
|
80
|
+
fontFamily,
|
|
81
|
+
color,
|
|
82
|
+
fontSize,
|
|
83
|
+
...rest
|
|
84
|
+
}) => {
|
|
86
85
|
const theme = useContext(ThemeContext);
|
|
87
86
|
const width = variant === "text" || variant === "danger-text" ? null : "100%";
|
|
88
87
|
|
|
@@ -254,4 +253,7 @@ Button.propTypes = {
|
|
|
254
253
|
* To show loading text along with the loading indicator on the button.
|
|
255
254
|
*/
|
|
256
255
|
loadingText: PropTypes.string,
|
|
256
|
+
fontFamily: PropTypes.string,
|
|
257
|
+
color: PropTypes.string,
|
|
258
|
+
fontSize: PropTypes.string,
|
|
257
259
|
};
|
|
@@ -36,7 +36,9 @@ export const ButtonGroup = ({
|
|
|
36
36
|
buttonItems,
|
|
37
37
|
onPress,
|
|
38
38
|
currentActiveBtn,
|
|
39
|
-
|
|
39
|
+
wrapperStyle,
|
|
40
|
+
buttonStyle,
|
|
41
|
+
buttonTextStyle,
|
|
40
42
|
}) => {
|
|
41
43
|
return (
|
|
42
44
|
<Container
|
|
@@ -47,7 +49,7 @@ export const ButtonGroup = ({
|
|
|
47
49
|
flexDirection="row"
|
|
48
50
|
justifyContent="space-between"
|
|
49
51
|
alignSelf="center"
|
|
50
|
-
{...
|
|
52
|
+
{...wrapperStyle}
|
|
51
53
|
>
|
|
52
54
|
{buttonItems.map(item => {
|
|
53
55
|
return (
|
|
@@ -61,11 +63,11 @@ export const ButtonGroup = ({
|
|
|
61
63
|
onPress(item);
|
|
62
64
|
}
|
|
63
65
|
}}
|
|
64
|
-
{...
|
|
66
|
+
{...buttonStyle}
|
|
65
67
|
>
|
|
66
68
|
<Typography
|
|
67
69
|
color={item === currentActiveBtn ? inActiveColor : activeColor}
|
|
68
|
-
{...
|
|
70
|
+
{...buttonTextStyle}
|
|
69
71
|
>
|
|
70
72
|
{item}
|
|
71
73
|
</Typography>
|
|
@@ -32,8 +32,7 @@ import { Calendar as RNCalender } from "react-native-calendars";
|
|
|
32
32
|
* Checkout <a href=" https://www.npmjs.com/package/react-native-calendars">react-native-calendars</a> package for all the available props
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
|
-
export const Calendar =
|
|
36
|
-
const { selectedDate, ...rest } = props;
|
|
35
|
+
export const Calendar = ({ selectedDate, ...rest }) => {
|
|
37
36
|
delete rest.markedDates;
|
|
38
37
|
const theme = useContext(ThemeContext);
|
|
39
38
|
const isCurrentDay = dayjs(selectedDate).isSame(dayjs(), "D");
|
package/src/components/Chip.js
CHANGED
|
@@ -61,7 +61,8 @@ export const Chip = ({
|
|
|
61
61
|
isDisabled,
|
|
62
62
|
closeIconSize,
|
|
63
63
|
closeIcon,
|
|
64
|
-
|
|
64
|
+
containerStyle,
|
|
65
|
+
closeIconContainerStyle,
|
|
65
66
|
}) => {
|
|
66
67
|
return (
|
|
67
68
|
<Touchable
|
|
@@ -73,7 +74,7 @@ export const Chip = ({
|
|
|
73
74
|
disabled={!onChipPress || isDisabled}
|
|
74
75
|
{...(variant && variantStyleObj[variant])}
|
|
75
76
|
{...(isDisabled && { opacity: 0.5 })}
|
|
76
|
-
{...
|
|
77
|
+
{...containerStyle}
|
|
77
78
|
>
|
|
78
79
|
{LeftIcon && <LeftIcon />}
|
|
79
80
|
<Typography mx={2} fontFamily="sf400" color={labelColor}>
|
|
@@ -85,7 +86,7 @@ export const Chip = ({
|
|
|
85
86
|
borderRadius={10}
|
|
86
87
|
disabled={isDisabled}
|
|
87
88
|
onPress={onClose}
|
|
88
|
-
{...
|
|
89
|
+
{...closeIconContainerStyle}
|
|
89
90
|
>
|
|
90
91
|
<Icon name={closeIcon} size={closeIconSize} color={closeIconColor} />
|
|
91
92
|
</Touchable>
|
|
@@ -149,4 +150,6 @@ Chip.propTypes = {
|
|
|
149
150
|
* Whether the chip is disabled. A disabled chip has a overlay and onPress is not called on touch.
|
|
150
151
|
*/
|
|
151
152
|
isDisabled: PropTypes.bool,
|
|
153
|
+
containerStyle: PropTypes.object,
|
|
154
|
+
closeIconContainerStyle: PropTypes.object,
|
|
152
155
|
};
|
package/src/components/FAB.js
CHANGED
|
@@ -99,4 +99,13 @@ FAB.propTypes = {
|
|
|
99
99
|
* Function to execute on press.
|
|
100
100
|
*/
|
|
101
101
|
onPress: PropTypes.func.isRequired,
|
|
102
|
+
/**
|
|
103
|
+
* String to set background color.
|
|
104
|
+
*/
|
|
105
|
+
bg: PropTypes.string,
|
|
106
|
+
/**
|
|
107
|
+
* Boolean to disable button.
|
|
108
|
+
*/
|
|
109
|
+
disabled: PropTypes.bool,
|
|
110
|
+
variant: PropTypes.string,
|
|
102
111
|
};
|
package/src/components/Input.js
CHANGED
|
@@ -94,23 +94,22 @@ const AnimatedLabel = Animated.createAnimatedComponent(Typography);
|
|
|
94
94
|
*
|
|
95
95
|
*/
|
|
96
96
|
|
|
97
|
-
export const Input =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
97
|
+
export const Input = ({
|
|
98
|
+
label,
|
|
99
|
+
value = "",
|
|
100
|
+
onChangeText = () => {},
|
|
101
|
+
onBlur = () => {},
|
|
102
|
+
errorMessage = null,
|
|
103
|
+
PrefixIcon,
|
|
104
|
+
SuffixIcon,
|
|
105
|
+
autoFocus = false,
|
|
106
|
+
disabled = false,
|
|
107
|
+
noBorder = false,
|
|
108
|
+
showInputAccessoryView = true,
|
|
109
|
+
textAlignVertical = "top",
|
|
110
|
+
containerProps,
|
|
111
|
+
...rest
|
|
112
|
+
}) => {
|
|
114
113
|
const { width } = useWindowDimensions();
|
|
115
114
|
const colors = useContext(ThemeContext).colors;
|
|
116
115
|
const inputRef = useRef();
|
|
@@ -203,7 +202,7 @@ export const Input = props => {
|
|
|
203
202
|
justifyContent="space-between"
|
|
204
203
|
{...(!rest.inputProps?.multiline && { height: 58 })}
|
|
205
204
|
overflow="hidden"
|
|
206
|
-
{...
|
|
205
|
+
{...containerProps}
|
|
207
206
|
>
|
|
208
207
|
{!!PrefixIcon && (
|
|
209
208
|
<View pl={2}>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react-native/no-inline-styles */
|
|
1
2
|
import React, { useContext, useEffect, useState } from "react";
|
|
2
3
|
import PropTypes from "prop-types";
|
|
3
4
|
import {
|
|
@@ -24,13 +25,7 @@ import {
|
|
|
24
25
|
position,
|
|
25
26
|
} from "styled-system";
|
|
26
27
|
|
|
27
|
-
import {
|
|
28
|
-
BottomSheet,
|
|
29
|
-
CheckBox,
|
|
30
|
-
Container,
|
|
31
|
-
Touchable,
|
|
32
|
-
Alert,
|
|
33
|
-
} from "@components";
|
|
28
|
+
import { BottomSheet, CheckBox, Container, Alert } from "@components";
|
|
34
29
|
|
|
35
30
|
const Typography = styled.Text`
|
|
36
31
|
${textStyle}
|
|
@@ -133,41 +128,6 @@ MultiSelectItem.propTypes = {
|
|
|
133
128
|
confirmationAlertObj: PropTypes.object,
|
|
134
129
|
};
|
|
135
130
|
|
|
136
|
-
const DropdownItem = ({
|
|
137
|
-
label,
|
|
138
|
-
onPress,
|
|
139
|
-
defaultDropdownItemHeight,
|
|
140
|
-
itemContainerStyle,
|
|
141
|
-
itemLabelStyle,
|
|
142
|
-
}) => {
|
|
143
|
-
return (
|
|
144
|
-
<Touchable bg="background.white" onPress={onPress}>
|
|
145
|
-
<Container
|
|
146
|
-
height={defaultDropdownItemHeight}
|
|
147
|
-
p={2}
|
|
148
|
-
{...itemContainerStyle}
|
|
149
|
-
>
|
|
150
|
-
<Typography
|
|
151
|
-
fontFamily="sf400"
|
|
152
|
-
fontSize="s"
|
|
153
|
-
color="font.grey"
|
|
154
|
-
{...itemLabelStyle}
|
|
155
|
-
>
|
|
156
|
-
{label}
|
|
157
|
-
</Typography>
|
|
158
|
-
</Container>
|
|
159
|
-
</Touchable>
|
|
160
|
-
);
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
DropdownItem.propTypes = {
|
|
164
|
-
label: PropTypes.string,
|
|
165
|
-
onPress: PropTypes.func,
|
|
166
|
-
defaultDropdownItemHeight: PropTypes.number,
|
|
167
|
-
itemContainerStyle: PropTypes.object,
|
|
168
|
-
itemLabelStyle: PropTypes.object,
|
|
169
|
-
};
|
|
170
|
-
|
|
171
131
|
const AnimatedLabel = Animated.createAnimatedComponent(Typography);
|
|
172
132
|
|
|
173
133
|
/**
|
|
@@ -564,10 +524,6 @@ MultiSelect.propTypes = {
|
|
|
564
524
|
* Show loader while creating a searched option not present in the options list
|
|
565
525
|
*/
|
|
566
526
|
showCreateOptionLoader: PropTypes.bool,
|
|
567
|
-
/**
|
|
568
|
-
* Custom label for creating searched option not present in the options list
|
|
569
|
-
*/
|
|
570
|
-
createOptionLabel: PropTypes.string,
|
|
571
527
|
/**
|
|
572
528
|
* Callback when create searched option is pressed
|
|
573
529
|
*/
|
|
@@ -592,10 +548,6 @@ MultiSelect.propTypes = {
|
|
|
592
548
|
* To customise dropdown item container styles.
|
|
593
549
|
*/
|
|
594
550
|
itemContainerStyle: PropTypes.object,
|
|
595
|
-
/**
|
|
596
|
-
* To customise dropdown item text styles.
|
|
597
|
-
*/
|
|
598
|
-
itemLabelStyle: PropTypes.object,
|
|
599
551
|
/**
|
|
600
552
|
* To customise item container styles for multi selected items.
|
|
601
553
|
*/
|
|
@@ -608,22 +560,6 @@ MultiSelect.propTypes = {
|
|
|
608
560
|
* To customise confirmation alert popup.
|
|
609
561
|
*/
|
|
610
562
|
confirmationAlertObj: PropTypes.object,
|
|
611
|
-
/**
|
|
612
|
-
* To customise search input container style.
|
|
613
|
-
*/
|
|
614
|
-
searchInputContainerStyle: PropTypes.object,
|
|
615
|
-
/**
|
|
616
|
-
* To customise search input style.
|
|
617
|
-
*/
|
|
618
|
-
searchInputStyle: PropTypes.object,
|
|
619
|
-
/**
|
|
620
|
-
* To customise empty options placeholder container style.
|
|
621
|
-
*/
|
|
622
|
-
emptyOptionsContainerStyle: PropTypes.object,
|
|
623
|
-
/**
|
|
624
|
-
* To customise empty options placeholder text style.
|
|
625
|
-
*/
|
|
626
|
-
emptyOptionsLabelStyle: PropTypes.object,
|
|
627
563
|
/**
|
|
628
564
|
* To customise empty options placeholder container style.
|
|
629
565
|
*/
|
|
@@ -694,7 +630,6 @@ MultiSelect.defaultProps = {
|
|
|
694
630
|
isSearchable: false,
|
|
695
631
|
showCreateOption: false,
|
|
696
632
|
showCreateOptionLoader: false,
|
|
697
|
-
createOptionLabel: null,
|
|
698
633
|
onPressCreateOption: () => {},
|
|
699
634
|
onDonePress: () => {},
|
|
700
635
|
maxItemSize: 5,
|
|
@@ -74,16 +74,14 @@ import { Container, Typography, Divider, ToggleSwitch } from "@components";
|
|
|
74
74
|
*
|
|
75
75
|
*/
|
|
76
76
|
|
|
77
|
-
export const NotificationPreferenceList =
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
} = props;
|
|
86
|
-
|
|
77
|
+
export const NotificationPreferenceList = ({
|
|
78
|
+
data,
|
|
79
|
+
itemWrapperProps,
|
|
80
|
+
itemContainerProps,
|
|
81
|
+
labelContainerProps,
|
|
82
|
+
labelProps,
|
|
83
|
+
...rest
|
|
84
|
+
}) => {
|
|
87
85
|
return (
|
|
88
86
|
<Container bg="background.secondary" borderRadius={8} {...rest}>
|
|
89
87
|
{data?.map((item, index) => {
|
|
@@ -27,17 +27,16 @@ import { ThemeContext } from "styled-components/native";
|
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
-
export const OrganizationItem =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} = props;
|
|
30
|
+
export const OrganizationItem = ({
|
|
31
|
+
label,
|
|
32
|
+
labelContainerProps,
|
|
33
|
+
iconContainerProps,
|
|
34
|
+
iconProps,
|
|
35
|
+
labelProps,
|
|
36
|
+
name,
|
|
37
|
+
nameProps,
|
|
38
|
+
...rest
|
|
39
|
+
}) => {
|
|
41
40
|
const theme = useContext(ThemeContext);
|
|
42
41
|
return (
|
|
43
42
|
<Container
|