react-native-boxes 1.0.19 → 1.2.0

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/dist/Image.js ADDED
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getIcon = exports.Avatar = exports.Icon = void 0;
7
+ const react_native_1 = require("react-native");
8
+ const FontAwesome_1 = __importDefault(require("@expo/vector-icons/FontAwesome"));
9
+ const react_1 = require("react");
10
+ const ThemeContext_1 = require("./ThemeContext");
11
+ const Box_1 = require("./Box");
12
+ const Text_1 = require("./Text");
13
+ function Icon(props) {
14
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
15
+ return (<FontAwesome_1.default {...props} size={props.size || theme.dimens?.icon?.md} color={props.color || theme.colors?.text}/>);
16
+ }
17
+ exports.Icon = Icon;
18
+ /**
19
+ *
20
+ * @param props provide one of iconUrl , iconName , iconText
21
+ * @returns
22
+ */
23
+ function Avatar(props) {
24
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
25
+ const view = <Box_1.Center style={[{
26
+ margin: theme.dimens.space.sm,
27
+ overflow: 'hidden',
28
+ borderRadius: 100,
29
+ width: theme.dimens.icon.xl,
30
+ height: theme.dimens.icon.xl,
31
+ borderWidth: theme.dimens.space.xs * 2,
32
+ borderStyle: 'solid',
33
+ borderColor: theme.colors.accentLight,
34
+ backgroundColor: theme.colors.forground,
35
+ }, props.style]}>
36
+ <Box_1.Center style={{
37
+ width: '110%',
38
+ height: '110%',
39
+ }}>
40
+ {(() => {
41
+ if (props.iconUrl)
42
+ return (<react_native_1.Image style={{
43
+ width: '120%',
44
+ height: '120%',
45
+ }} source={{
46
+ uri: props.iconUrl,
47
+ }}/>);
48
+ if (props.iconName || props.iconNameProps?.name)
49
+ return (<Icon name={props.iconName || props.iconNameProps?.name} {...props.iconNameProps}/>);
50
+ if (props.iconText)
51
+ return (<Text_1.Subtitle style={{
52
+ color: props.style?.color || theme.colors.accentLight,
53
+ }}>{props.iconText?.substring(0, 2)}</Text_1.Subtitle>);
54
+ })()}
55
+ </Box_1.Center>
56
+ </Box_1.Center>;
57
+ if (props.onPress)
58
+ return (<react_native_1.Pressable onPress={() => {
59
+ if (props.onPress)
60
+ props.onPress();
61
+ }}>
62
+ {view}
63
+ </react_native_1.Pressable>);
64
+ return view;
65
+ }
66
+ exports.Avatar = Avatar;
67
+ function getIcon(input) {
68
+ if (input == undefined) {
69
+ return undefined;
70
+ }
71
+ if (typeof input == 'string') {
72
+ return (props) => {
73
+ return (<Icon {...props} name={props.name || input}/>);
74
+ };
75
+ }
76
+ return input;
77
+ }
78
+ exports.getIcon = getIcon;
79
+ //# sourceMappingURL=Image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Image.js","sourceRoot":"","sources":["../src/Image.tsx"],"names":[],"mappings":";;;;;;AAAA,+CAA2D;AAC3D,iFAAyD;AACzD,iCAAmC;AACnC,iDAA8C;AAC9C,+BAA+B;AAC/B,iCAAkC;AAOlC,SAAgB,IAAI,CAAC,KAA4B;IAC7C,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAA;IACtC,OAAO,CACH,CAAC,qBAAW,CAAC,IAAI,KAAK,CAAC,CACnB,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAC3C,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,EAC3C,CACL,CAAA;AACL,CAAC;AARD,oBAQC;AAGD;;;;GAIG;AACH,SAAgB,MAAM,CAAC,KAOtB;IACG,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAA;IACtC,MAAM,IAAI,GA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,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW;qBACxD,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,eAAQ,CAAC,CAClD,CAAA;QACT,CAAC,CAAC,EACN,CACJ;QAAA,EAAE,YAAM,CACZ;IAAA,EAAE,YAAM,CAAC,CAAA;IACT,IAAI,KAAK,CAAC,OAAO;QACb,OAAO,CACH,CAAC,wBAAS,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE;gBACrB,IAAI,KAAK,CAAC,OAAO;oBACb,KAAK,CAAC,OAAO,EAAE,CAAA;YACvB,CAAC,CAAC,CACE;gBAAA,CAAC,IAAI,CACT;YAAA,EAAE,wBAAS,CAAC,CACf,CAAA;IACL,OAAO,IAAI,CAAA;AACf,CAAC;AA/DD,wBA+DC;AAGD,SAAgB,OAAO,CAAC,KAAU;IAC9B,IAAI,KAAK,IAAI,SAAS,EAAE,CAAC;QACrB,OAAO,SAAS,CAAA;IACpB,CAAC;IACD,IAAI,OAAO,KAAK,IAAI,QAAQ,EAAE,CAAC;QAC3B,OAAO,CAAC,KAAgB,EAAE,EAAE;YACxB,OAAO,CACH,CAAC,IAAI,CAAE,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,EAAG,CAClD,CAAA;QACL,CAAC,CAAA;IACL,CAAC;IACD,OAAO,KAAK,CAAA;AAChB,CAAC;AAZD,0BAYC"}
@@ -0,0 +1,27 @@
1
+ import { GestureResponderEvent, TextInputProps } from "react-native";
2
+ /**
3
+ *
4
+ * @param initialText if you use initialText then you dont need to maintain the 2 way binding between value and setValue, just enjoy props.onChangeText events
5
+ * @returns
6
+ */
7
+ export declare function TextInputView(props: TextInputProps & {
8
+ initialText?: string;
9
+ pattern?: string;
10
+ }): import("react").JSX.Element;
11
+ /**
12
+ * Note: if input is inside a ScrollView in heirarchy anywhere then add keyboardShouldPersistTaps={'handled'}
13
+ * to the scrollview else the icon click wont work
14
+ * In case, you textinput is getting hidden due to keyboard see https://stackoverflow.com/a/77563800/6865753
15
+
16
+ * @param props
17
+ * @returns
18
+ */
19
+ export declare function CompositeTextInputView(props: TextInputProps & {
20
+ hint?: string;
21
+ alertText?: string;
22
+ alertTextColor?: string;
23
+ pattern?: string;
24
+ initialText?: string;
25
+ icon?: 'close' | 'eye' | string | React.Component;
26
+ onIconPress?: ((event: GestureResponderEvent) => void) | undefined;
27
+ }): import("react").JSX.Element;
package/dist/Input.js ADDED
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CompositeTextInputView = exports.TextInputView = void 0;
4
+ const react_1 = require("react");
5
+ const react_native_1 = require("react-native");
6
+ const ThemeContext_1 = require("./ThemeContext");
7
+ const utils_1 = require("./utils");
8
+ const Box_1 = require("./Box");
9
+ const Text_1 = require("./Text");
10
+ const Image_1 = require("./Image");
11
+ /**
12
+ *
13
+ * @param initialText if you use initialText then you dont need to maintain the 2 way binding between value and setValue, just enjoy props.onChangeText events
14
+ * @returns
15
+ */
16
+ function TextInputView(props) {
17
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
18
+ const [text, setText] = (0, react_1.useState)(props.initialText);
19
+ const [focused, setFocused] = (0, react_1.useState)(false);
20
+ function onTextChange(newText) {
21
+ setText(newText);
22
+ props.onChangeText && props.onChangeText(newText);
23
+ }
24
+ return (<react_native_1.TextInput {...props} onFocus={(e) => {
25
+ setFocused(true);
26
+ props.onFocus && props.onFocus(e);
27
+ }} onBlur={(e) => {
28
+ setFocused(false);
29
+ props.onBlur && props.onBlur(e);
30
+ }} value={props.value || text} onChangeText={(newText) => {
31
+ if (props.pattern) {
32
+ const re = new RegExp(props.pattern);
33
+ if (newText === "" || re.test(newText)) {
34
+ onTextChange(newText);
35
+ }
36
+ }
37
+ else {
38
+ onTextChange(newText);
39
+ }
40
+ }} style={[{
41
+ color: theme.colors.text,
42
+ textAlignVertical: "top",
43
+ width: 'auto',
44
+ fontSize: theme.dimens.font.md,
45
+ fontFamily: theme.fonts.Regular,
46
+ padding: theme.dimens.space.md,
47
+ paddingStart: theme.dimens.space.md,
48
+ paddingBottom: (0, utils_1.isWeb)() ? theme.dimens.space.md : theme.dimens.space.sm / 2,
49
+ margin: theme.dimens.space.sm,
50
+ borderWidth: focused ? 1.5 : 1.5,
51
+ borderRadius: theme.dimens.space.sm,
52
+ borderColor: !focused ? theme.colors.caption : theme.colors.accent
53
+ }, (0, utils_1.isWeb)() ? {
54
+ //@ts-ignore
55
+ outline: 'none',
56
+ } : {},
57
+ props.style]}/>);
58
+ }
59
+ exports.TextInputView = TextInputView;
60
+ /**
61
+ * Note: if input is inside a ScrollView in heirarchy anywhere then add keyboardShouldPersistTaps={'handled'}
62
+ * to the scrollview else the icon click wont work
63
+ * In case, you textinput is getting hidden due to keyboard see https://stackoverflow.com/a/77563800/6865753
64
+
65
+ * @param props
66
+ * @returns
67
+ */
68
+ function CompositeTextInputView(props) {
69
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
70
+ const [text, setText] = (0, react_1.useState)(props.initialText);
71
+ const [alerttext, setAlertText] = (0, react_1.useState)(props.alertText);
72
+ const [focused, setFocused] = (0, react_1.useState)(false);
73
+ function onTextChange(newText) {
74
+ setText(newText);
75
+ props.onChangeText && props.onChangeText(newText);
76
+ }
77
+ const fontStyles = (0, utils_1.assignFields)({}, props.style, [
78
+ "returnKeyType",
79
+ "keyboardType",
80
+ "textContentType",
81
+ "multiline",
82
+ "fontFamily",
83
+ "fontSize",
84
+ "fontWeight",
85
+ "fontVariant",
86
+ "color",
87
+ "inputMode"
88
+ ]);
89
+ var hintVisible = false;
90
+ if (props.placeholder && props.placeholder.length > 0 && focused) {
91
+ hintVisible = true;
92
+ }
93
+ if (!focused && text && text.length > 0) {
94
+ hintVisible = true;
95
+ }
96
+ if (!props.placeholder) {
97
+ hintVisible = false;
98
+ }
99
+ // (focused || ((text ||
100
+ // props.value == undefined ? props.placeholder : props.value || ''
101
+ // )?.length || 0) > 0)
102
+ // if (!hintVisible && props.placeholder != undefined && props.placeholder?.length > 0 && text != undefined && text?.length > 0) {
103
+ // hintVisible = false
104
+ // }
105
+ const alertVisible = alerttext && alerttext.length;
106
+ (0, react_1.useEffect)(() => {
107
+ setText(props.value);
108
+ }, [props.value]);
109
+ (0, react_1.useEffect)(() => {
110
+ setAlertText(props.alertText);
111
+ }, [props.alertText]);
112
+ //@ts-ignore
113
+ const IconComponent = typeof props.icon == 'string' ? (<Image_1.Icon color={!focused ? theme.colors.caption : theme.colors.accent} style={{
114
+ minWidth: (0, utils_1.isWeb)() ? theme.dimens.icon.lg : theme.dimens.icon.sm,
115
+ padding: theme.dimens.space.sm / 2,
116
+ }} name={props.icon}/>) : props.icon;
117
+ return (<Box_1.HBox style={[{
118
+ paddingEnd: theme.dimens.space.md,
119
+ justifyContent: 'space-between',
120
+ alignItems: 'center',
121
+ padding: 0,
122
+ paddingStart: theme.dimens.space.sm * 1.5,
123
+ margin: theme.dimens.space.sm,
124
+ borderWidth: 1.5,
125
+ borderRadius: theme.dimens.space.sm,
126
+ borderColor: !focused ? theme.colors.caption : theme.colors.accent,
127
+ }, (!hintVisible && !alertVisible) ? {
128
+ paddingTop: theme.dimens.space.sm,
129
+ paddingBottom: theme.dimens.space.sm
130
+ } : {}, props.style]}>
131
+
132
+
133
+ <Box_1.VBox style={[{
134
+ flex: 1,
135
+ paddingBottom: alertVisible ? 0 : theme.dimens.space.sm
136
+ }, hintVisible ? {} : {
137
+ paddingTop: theme.dimens.space.sm
138
+ }]}>
139
+ {hintVisible && <Text_1.TextView style={{
140
+ padding: 0,
141
+ margin: 0,
142
+ fontSize: theme.dimens.font.sm,
143
+ color: !focused ? theme.colors.caption : theme.colors.accent,
144
+ }}>{props.placeholder}</Text_1.TextView>}
145
+ <react_native_1.TextInput selectionColor={props.selectionColor || theme.colors.accent} secureTextEntry={props.secureTextEntry} placeholderTextColor={theme.colors.caption} placeholder={hintVisible ? '' : theme.i18n?.t(props.placeholder) || props.placeholder} keyboardType={props.keyboardType} returnKeyType={props.returnKeyType || 'default'} onFocus={(e) => {
146
+ setFocused(true);
147
+ props.onFocus && props.onFocus(e);
148
+ }} onBlur={(e) => {
149
+ setFocused(false);
150
+ props.onBlur && props.onBlur(e);
151
+ }} value={props.value || text} onChangeText={(newText) => {
152
+ if (props.pattern) {
153
+ const re = new RegExp(props.pattern);
154
+ if (newText === "" || re.test(newText)) {
155
+ onTextChange(newText);
156
+ }
157
+ }
158
+ else {
159
+ onTextChange(newText);
160
+ }
161
+ }} style={[{
162
+ color: theme.colors.text,
163
+ fontSize: theme.dimens.font.md,
164
+ fontFamily: theme.fonts.Regular,
165
+ }, (0, utils_1.isWeb)() ? {
166
+ //@ts-ignore
167
+ outline: 'none',
168
+ } : {}, fontStyles]}/>
169
+ {alertVisible && <Text_1.TextView style={{
170
+ color: props.alertTextColor || theme.colors.critical,
171
+ padding: 0,
172
+ margin: 0,
173
+ paddingBottom: theme.dimens.space.sm,
174
+ fontSize: theme.dimens.font.sm,
175
+ }}>{alerttext}</Text_1.TextView>}
176
+ </Box_1.VBox>
177
+ {props.icon != undefined &&
178
+ <react_native_1.TouchableOpacity onPress={(e) => {
179
+ if (!props.onIconPress && props.icon == 'close') {
180
+ onTextChange('');
181
+ }
182
+ props.onIconPress && props.onIconPress(e);
183
+ }}>
184
+ {(IconComponent)}
185
+ </react_native_1.TouchableOpacity>}
186
+
187
+ </Box_1.HBox>);
188
+ }
189
+ exports.CompositeTextInputView = CompositeTextInputView;
190
+ //# sourceMappingURL=Input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.js","sourceRoot":"","sources":["../src/Input.tsx"],"names":[],"mappings":";;;AAAA,iCAAmE;AACnE,+CAAkG;AAClG,iDAA8C;AAC9C,mCAA8C;AAC9C,+BAAmC;AACnC,iCAA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{ ViewProps } from "react-native";
3
+ export declare function AlertMessage(props: ViewProps & {
4
+ text: string;
5
+ type?: 'info' | 'success' | 'warning' | 'critical';
6
+ onDismiss?: Function;
7
+ }): React.JSX.Element | undefined;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.AlertMessage = void 0;
30
+ const Box_1 = require("./Box");
31
+ const React = __importStar(require("react"));
32
+ const react_1 = require("react");
33
+ const ThemeContext_1 = require("./ThemeContext");
34
+ const FontAwesome_1 = __importDefault(require("@expo/vector-icons/FontAwesome"));
35
+ const react_native_1 = require("react-native");
36
+ const Text_1 = require("./Text");
37
+ function AlertMessage(props) {
38
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
39
+ const type = props.type || 'info';
40
+ //@ts-ignore
41
+ let icon = {
42
+ 'info': 'info-circle',
43
+ 'success': 'check-circle',
44
+ 'warning': 'info-circle',
45
+ 'critical': 'warning'
46
+ }[type];
47
+ let color = {
48
+ 'info': '#2196F3',
49
+ 'success': '#4CAF50',
50
+ 'warning': '#FFC107',
51
+ 'critical': '#F44336'
52
+ }[type];
53
+ if (!props.text || props.text.length < 1) {
54
+ return undefined;
55
+ }
56
+ return (<Box_1.HBox style={[{
57
+ flex: 1,
58
+ margin: theme.dimens.space.sm,
59
+ backgroundColor: theme.colors[type] || color,
60
+ alignItems: 'center',
61
+ justifyContent: 'space-between',
62
+ flexDirection: 'row',
63
+ paddingStart: theme.dimens.space.md,
64
+ paddingEnd: theme.dimens.space.md,
65
+ paddingBottom: props.text.length > 40 && react_native_1.Platform.OS == 'web' ?
66
+ theme.dimens.space.lg : theme.dimens.space.md,
67
+ paddingTop: props.text.length > 40 && react_native_1.Platform.OS == 'web' ?
68
+ theme.dimens.space.lg : theme.dimens.space.md,
69
+ borderRadius: theme.dimens.space.sm,
70
+ }, props.style]}>
71
+
72
+ <Box_1.HBox style={{
73
+ flex: 0.93,
74
+ alignItems: 'center',
75
+ }}>
76
+ <FontAwesome_1.default style={{
77
+ marginRight: theme.dimens.space.md
78
+ }} name={icon} size={theme.dimens.icon.md} color={theme.colors.invert.text}/>
79
+ <Text_1.TextView style={{
80
+ flexShrink: 1,
81
+ padding: 0,
82
+ color: theme.colors.invert.text,
83
+ }}>{props.text}
84
+ </Text_1.TextView>
85
+ </Box_1.HBox>
86
+ {props.onDismiss && <react_native_1.Pressable style={{
87
+ flexDirection: 'row-reverse',
88
+ flex: 0.06,
89
+ }} onPress={() => {
90
+ props.onDismiss && props.onDismiss();
91
+ }}>
92
+ <FontAwesome_1.default name={'close'} size={theme.dimens.icon.md} color={theme.colors.invert.text}/>
93
+ </react_native_1.Pressable>}
94
+ </Box_1.HBox>);
95
+ }
96
+ exports.AlertMessage = AlertMessage;
97
+ //# sourceMappingURL=Message.js.map
@@ -0,0 +1 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,wBAAS,CACzB,KAAK,CAAC,CAAC;gBACH,aAAa,EAAE,aAAa;gBAC5B,IAAI,EAAE,IAAI;aACb,CAAC,CACF,OAAO,CAAC,CAAC,GAAG,EAAE;gBACV,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,EAAE,CAAA;YACxC,CAAC,CAAC,CACF;oBAAA,CAAC,qBAAW,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CACvB,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAC3B,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EACxC;gBAAA,EAAE,wBAAS,CACf,CACJ;QAAA,EAAE,UAAI,CAAC,CACV,CAAA;AACL,CAAC;AA/ED,oCA+EC"}
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import { StyleProp, TextStyle, ViewProps } from 'react-native';
3
+ import { IconProps } from './Image';
4
+ export type BottomSheetProps = {
5
+ visible: boolean;
6
+ title?: string | React.Component;
7
+ cancellable?: boolean;
8
+ children: any;
9
+ onDismiss?: Function;
10
+ };
11
+ export declare const BottomSheet: (props: BottomSheetProps) => React.JSX.Element;
12
+ export declare function Expand(props: ViewProps & {
13
+ title?: string;
14
+ iconName?: string;
15
+ iconPosition?: 'left' | 'right';
16
+ titleStyle?: StyleProp<TextStyle>;
17
+ titleBackgroundColor?: string;
18
+ iconStyle?: IconProps;
19
+ initialExpand?: boolean;
20
+ duration?: number;
21
+ onChange?: (isExpanded: boolean) => void;
22
+ }): React.JSX.Element;