react-native-boxes 1.3.16 → 1.3.17

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/src/Button.js DELETED
@@ -1,245 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SwitchView = exports.PressableView = exports.LoadingButton = exports.RightIconButton = exports.ButtonView = exports.TransparentButton = exports.TertiaryButtonView = void 0;
4
- const react_1 = require("react");
5
- const react_native_1 = require("react-native");
6
- const ThemeContext_1 = require("./ThemeContext");
7
- const Box_1 = require("./Box");
8
- const Text_1 = require("./Text");
9
- const Image_1 = require("./Image");
10
- function TertiaryButtonView(props) {
11
- const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
12
- return (<ButtonView {...props} underlayColor={props.underlayColor || theme.colors.transparent} style={[{
13
- backgroundColor: theme.colors.transparent,
14
- }, props.style]} textStyle={Object.assign({
15
- fontSize: theme.dimens.font.lg,
16
- color: theme.colors.accent
17
- }, props.textStyle || {})}/>);
18
- }
19
- exports.TertiaryButtonView = TertiaryButtonView;
20
- function TransparentButton(props) {
21
- const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
22
- const tstyle = props.style || {};
23
- const [isPressed, setIsPressed] = (0, react_1.useState)(false);
24
- const onPressIn = (e) => {
25
- setIsPressed(true);
26
- if (props.onPressIn)
27
- props.onPressIn(e);
28
- };
29
- const onPressOut = (e) => {
30
- setIsPressed(false);
31
- if (props.onPressOut)
32
- props.onPressOut(e);
33
- };
34
- return (<react_native_1.TouchableHighlight {...props} onPressIn={onPressIn} onPressOut={onPressOut} underlayColor={theme.colors.transparent} style={[{
35
- justifyContent: 'center',
36
- alignContent: 'center',
37
- alignItems: 'center',
38
- padding: theme.dimens.space.md,
39
- borderRadius: theme.dimens.space.xl,
40
- margin: theme.dimens.space.sm,
41
- backgroundColor: theme.colors.transparent,
42
- }, props.style]}>
43
- <Box_1.Center style={{
44
- padding: 0,
45
- margin: 0,
46
- flexDirection: 'row',
47
- backgroundColor: 'transparent'
48
- }}>
49
-
50
- {props.icon && (<react_native_1.View style={{
51
- margin: theme.dimens.space.sm
52
- }}>
53
- {(0, Image_1.getIcon)(props.icon)}
54
- </react_native_1.View>)}
55
-
56
- {(props.text || props.children) && (<Text_1.TextView style={{
57
- fontWeight: "500",
58
- justifyContent: 'center',
59
- alignContent: 'center',
60
- alignItems: 'center',
61
- //@ts-ignore
62
- fontSize: tstyle.fontSize,
63
- //@ts-ignore
64
- fontFamily: tstyle.fontFamily,
65
- //@ts-ignore
66
- color: isPressed ? (props.underlayColor || theme.colors.accent) : tstyle.color || theme.colors.text,
67
- }}>
68
- {props.text || props.children}
69
- </Text_1.TextView>)}
70
- </Box_1.Center>
71
- </react_native_1.TouchableHighlight>);
72
- }
73
- exports.TransparentButton = TransparentButton;
74
- function ButtonView(props) {
75
- const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
76
- const tstyle = props.style || {};
77
- const [isPressed, setIsPressed] = (0, react_1.useState)(false);
78
- const onPressIn = (e) => {
79
- setIsPressed(true);
80
- if (props.onPressIn)
81
- props.onPressIn(e);
82
- };
83
- const onPressOut = (e) => {
84
- setIsPressed(false);
85
- if (props.onPressOut)
86
- props.onPressOut(e);
87
- };
88
- const BtnIcon = (0, Image_1.getIcon)(props.icon);
89
- return (<react_native_1.TouchableHighlight {...props} onPressIn={onPressIn} onPressOut={onPressOut} underlayColor={props.underlayColor || theme.colors.accentLight} style={[{
90
- justifyContent: 'center',
91
- alignContent: 'center',
92
- alignItems: 'center',
93
- padding: theme.dimens.space.md,
94
- borderRadius: theme.dimens.space.xl,
95
- margin: theme.dimens.space.sm,
96
- backgroundColor: theme.colors.accent,
97
- }, props.style]}>
98
- <Box_1.Center style={{
99
- padding: 0,
100
- margin: 0,
101
- flexDirection: 'row',
102
- backgroundColor: 'transparent'
103
- }}>
104
-
105
- {BtnIcon && (<react_native_1.View style={{
106
- margin: theme.dimens.space.sm
107
- }}>
108
- <BtnIcon color={
109
- //@ts-ignore
110
- typeof props.icon == 'string' ? tstyle.color || theme.colors.invert.text : undefined}/>
111
- </react_native_1.View>)}
112
-
113
- {(props.text || props.children) && (<Text_1.TextView style={[{
114
- opacity: isPressed ? .7 : 1,
115
- fontWeight: "500",
116
- justifyContent: 'center',
117
- alignContent: 'center',
118
- alignItems: 'center',
119
- //@ts-ignore
120
- fontSize: tstyle.fontSize || theme.dimens.font.md,
121
- //@ts-ignore
122
- fontFamily: tstyle.fontFamily || theme.fonts.Regular,
123
- //@ts-ignore
124
- color: tstyle.color || theme.colors.invert.text,
125
- }, props.textStyle]}>
126
- {props.text || props.children}
127
- </Text_1.TextView>)}
128
- </Box_1.Center>
129
- </react_native_1.TouchableHighlight>);
130
- }
131
- exports.ButtonView = ButtonView;
132
- function RightIconButton(props) {
133
- const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
134
- const tstyle = props.style || {};
135
- const [isPressed, setIsPressed] = (0, react_1.useState)(false);
136
- const onPressIn = (e) => {
137
- setIsPressed(true);
138
- if (props.onPressIn)
139
- props.onPressIn(e);
140
- };
141
- const onPressOut = (e) => {
142
- setIsPressed(false);
143
- if (props.onPressOut)
144
- props.onPressOut(e);
145
- };
146
- const BtnIcon = (0, Image_1.getIcon)(props.icon);
147
- return (<react_native_1.TouchableHighlight {...props} onPressIn={onPressIn} onPressOut={onPressOut} underlayColor={props.underlayColor || theme.colors.accentLight} style={[{
148
- justifyContent: 'center',
149
- alignContent: 'center',
150
- alignItems: 'center',
151
- padding: theme.dimens.space.md,
152
- borderRadius: theme.dimens.space.xl,
153
- margin: theme.dimens.space.sm,
154
- backgroundColor: theme.colors.accent,
155
- }, props.style]}>
156
-
157
- <Box_1.HBox style={{
158
- padding: 0,
159
- margin: 0,
160
- alignItems: 'center',
161
- backgroundColor: 'transparent',
162
- width: '100%',
163
- paddingLeft: theme.dimens.space.sm,
164
- paddingRight: theme.dimens.space.sm,
165
- }}>
166
- <Box_1.Center style={{
167
- padding: 0,
168
- margin: 0,
169
- flexDirection: 'row',
170
- backgroundColor: 'transparent'
171
- }}>
172
-
173
- {(props.text) && (<Text_1.TextView style={{
174
- marginRight: theme.dimens.space.lg,
175
- justifyContent: 'center',
176
- alignContent: 'center',
177
- alignItems: 'center',
178
- //@ts-ignore
179
- fontSize: tstyle.fontSize,
180
- //@ts-ignore
181
- fontFamily: tstyle.fontFamily,
182
- //@ts-ignore
183
- color: tstyle.color || theme.colors.invert.text,
184
- }}>
185
- {props.text}
186
- </Text_1.TextView>)}
187
- {props.children}
188
-
189
- </Box_1.Center>
190
- {BtnIcon && (<react_native_1.View style={{
191
- position: 'absolute',
192
- right: 0,
193
- margin: theme.dimens.space.sm
194
- }}>
195
- <BtnIcon color={
196
- //@ts-ignore
197
- typeof props.icon == 'string' ? tstyle.color || theme.colors.invert.text : undefined}/>
198
- </react_native_1.View>)}
199
-
200
- </Box_1.HBox>
201
- </react_native_1.TouchableHighlight>);
202
- }
203
- exports.RightIconButton = RightIconButton;
204
- function LoadingButton(props) {
205
- const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
206
- const [_loading, _setIsLoading] = (0, react_1.useState)(props.loading);
207
- (0, react_1.useEffect)(() => {
208
- react_native_1.LayoutAnimation.configureNext(react_native_1.LayoutAnimation.Presets.easeInEaseOut);
209
- if (props.loading != _loading)
210
- _setIsLoading(props.loading);
211
- }, [props.loading]);
212
- let loaderColor = theme.colors.invert.text;
213
- let loaderSize = theme.dimens.icon.md;
214
- let btnBg = theme.colors.accent;
215
- let btnBgPressed = theme.colors.accentLight;
216
- if (_loading && props.loaderStyle == 'transparent') {
217
- loaderColor = theme.colors.accent;
218
- btnBg = theme.colors.transparent;
219
- btnBgPressed = theme.colors.transparent;
220
- loaderSize = theme.dimens.icon.lg;
221
- }
222
- return (<ButtonView {...props} underlayColor={btnBgPressed} style={[{
223
- width: _loading ? '100%' : '100%',
224
- backgroundColor: btnBg,
225
- padding: _loading && props.loaderStyle == 'transparent' ?
226
- theme.dimens.space.sm : theme.dimens.space.md
227
- }, props.style]} icon={_loading ?
228
- <react_native_1.ActivityIndicator size={loaderSize} color={loaderColor}/>
229
- : props.icon} text={!_loading ? props.text : undefined}/>);
230
- }
231
- exports.LoadingButton = LoadingButton;
232
- function PressableView(props) {
233
- //@ts-ignore
234
- return (<react_native_1.Pressable {...props} style={({ pressed }) => [{ opacity: pressed ? 0.7 : 1.0 }, props.style]}/>);
235
- }
236
- exports.PressableView = PressableView;
237
- function SwitchView(props) {
238
- const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
239
- return (<react_native_1.Switch trackColor={{
240
- false: theme.colors.caption,
241
- true: theme.colors.success
242
- }} thumbColor={props.value ? theme.colors.invert.text : theme.colors.text} ios_backgroundColor={theme.colors.caption} {...props}/>);
243
- }
244
- exports.SwitchView = SwitchView;
245
- //# sourceMappingURL=Button.js.map
package/src/Button.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["Button.tsx"],"names":[],"mappings":";;;AAAA,iCAAwD;AACxD,+CAAkN;AAClN,iDAA8C;AAC9C,+BAAqC;AACrC,iCAAiD;AACjD,mCAAkC;AAIlC,SAAgB,kBAAkB,CAAC,KAAsB;IACrD,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAA;IACtC,OAAO,CACH,CAAC,UAAU,CACP,IAAI,KAAK,CAAC,CACV,aAAa,CAAC,CAAC,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAC/D,KAAK,CAAC,CAAC,CAAC;gBACJ,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;aAC5C,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAChB,SAAS,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;YACrB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YAC9B,KAAK,EAAE,KAAK,CAAC,MA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BAAS,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAG,CAAC,CAAA;AAC9G,CAAC;AAJD,sCAIC;AAED,SAAgB,UAAU,CAAC,KAAkB;IACzC,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAA;IACtC,OAAO,CACH,CAAC,qBAAM,CACH,UAAU,CAAC,CAAC;YACR,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;YAC3B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;SAC7B,CAAC,CACF,UAAU,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CACvE,mBAAmB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAC1C,IAAI,KAAK,CAAC,EACZ,CACL,CAAA;AACL,CAAC;AAbD,gCAaC"}
package/src/I18n.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export type I18n = {
2
- t: (id?: string) => string | undefined;
3
- };
4
- export declare const _i18n: I18n;
package/src/I18n.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._i18n = void 0;
4
- exports._i18n = {
5
- t: (id) => id
6
- };
7
- //# sourceMappingURL=I18n.js.map
package/src/I18n.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"I18n.js","sourceRoot":"","sources":["I18n.ts"],"names":[],"mappings":";;;AAIa,QAAA,KAAK,GAAS;IACvB,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE;CAChB,CAAA"}
package/src/Image.d.ts DELETED
@@ -1,31 +0,0 @@
1
- import { ActivityIndicatorProps, ViewProps } from "react-native";
2
- export type IconProps = {
3
- name: any;
4
- size?: number;
5
- color?: string;
6
- onPress?: () => void;
7
- };
8
- export declare function Icon(props: ViewProps & IconProps): import("react").JSX.Element;
9
- /**
10
- *
11
- * @param props provide one of iconUrl , iconName , iconText
12
- * @returns
13
- */
14
- export declare function Avatar(props: ViewProps & {
15
- onPress?: Function;
16
- iconUrl?: string;
17
- iconName?: string;
18
- iconText?: string;
19
- iconNameProps?: IconProps;
20
- style?: any;
21
- }): import("react").JSX.Element;
22
- export declare function getIcon(Input: any, wrap?: boolean): any;
23
- export declare function Spinner(props: ActivityIndicatorProps): import("react").JSX.Element;
24
- export declare function StatusIcon(props: {
25
- status: string | any;
26
- colorMap?: {
27
- status: string | any;
28
- icon: string;
29
- color: string;
30
- }[];
31
- } & ViewProps): import("react").JSX.Element;
package/src/Image.js DELETED
@@ -1,129 +0,0 @@
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.StatusIcon = exports.Spinner = 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, wrap) {
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 (props) => {
77
- return <>
78
- {Input}
79
- </>;
80
- };
81
- }
82
- exports.getIcon = getIcon;
83
- function Spinner(props) {
84
- const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
85
- return (<react_native_1.ActivityIndicator size={theme.dimens.icon.md} color={theme.colors.accent} {...props}/>);
86
- }
87
- exports.Spinner = Spinner;
88
- function StatusIcon(props) {
89
- const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
90
- let color = theme.colors.info;
91
- let icon = 'check';
92
- let fromColorMap = undefined;
93
- if (props.colorMap) {
94
- fromColorMap = props.colorMap.find(mp => mp.status == props.status);
95
- }
96
- if (fromColorMap) {
97
- color = fromColorMap.color;
98
- icon = fromColorMap.icon;
99
- }
100
- else if (props.status == 'SUCCESS') {
101
- icon = 'check';
102
- color = theme.colors.success;
103
- }
104
- else if (props.status == 'FAILED') {
105
- icon = 'close';
106
- color = theme.colors.critical;
107
- }
108
- else if (props.status == 'PARTIAL_SUCCESS') {
109
- icon = 'warning';
110
- color = theme.colors.warning;
111
- }
112
- else if (props.status == 'IN_PROGRESS') {
113
- icon = 'play';
114
- color = theme.colors.accent;
115
- }
116
- else if (props.status == 'PAUSED') {
117
- icon = 'pause';
118
- color = theme.colors.text;
119
- }
120
- else {
121
- icon = 'info';
122
- color = theme.colors.text;
123
- }
124
- return (<Icon {...props} name={icon} color={color} style={[{
125
- paddingRight: theme.dimens.space.md
126
- }, props.style]}/>);
127
- }
128
- exports.StatusIcon = StatusIcon;
129
- //# sourceMappingURL=Image.js.map
package/src/Image.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Image.js","sourceRoot":"","sources":["Image.tsx"],"names":[],"mappings":";;;;;;AAAA,+CAAsG;AACtG,iFAAyD;AACzD,iCAAmC;AACnC,iDAAqD;AACrD,+BAA+B;AAC/B,iCAAkC;AAQlC,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,C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AAC,OAAO,CAAA;IAChC,CAAC;SAAM,IAAI,KAAK,CAAC,MAAM,IAAI,aAAa,EAAE,CAAC;QACvC,IAAI,GAAG,MAAM,CAAA;QACb,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAA;IAC/B,CAAC;SAAM,IAAI,KAAK,CAAC,MAAM,IAAI,QAAQ,EAAE,CAAC;QAClC,IAAI,GAAG,OAAO,CAAA;QACd,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAA;IAC7B,CAAC;SAAM,CAAC;QACJ,IAAI,GAAG,MAAM,CAAA;QACb,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAA;IAC7B,CAAC;IAED,OAAO,CACH,CAAC,IAAI,CAAE,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;gBAChD,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;aACtC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAG,CACtB,CAAA;AACL,CAAC;AArCD,gCAqCC"}
package/src/Input.d.ts DELETED
@@ -1,29 +0,0 @@
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
- export type CompositeTextInputViewProps = TextInputProps & {
12
- hint?: string;
13
- alertText?: string;
14
- alertTextColor?: string;
15
- pattern?: string;
16
- initialText?: string;
17
- icon?: 'close' | 'eye' | string | React.Component;
18
- _textInputProps?: TextInputProps;
19
- onIconPress?: ((event: GestureResponderEvent) => void) | undefined;
20
- };
21
- /**
22
- * Note: if input is inside a ScrollView in heirarchy anywhere then add keyboardShouldPersistTaps={'handled'}
23
- * to the scrollview else the icon click wont work
24
- * In case, you textinput is getting hidden due to keyboard see https://stackoverflow.com/a/77563800/6865753
25
-
26
- * @param props
27
- * @returns
28
- */
29
- export declare function CompositeTextInputView(props: CompositeTextInputViewProps): import("react").JSX.Element;
package/src/Input.js DELETED
@@ -1,190 +0,0 @@
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 {...props._textInputProps} 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, props._textInputProps?.style]}/>
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