@dropi/react-native-design-system 0.2.11 → 0.2.12
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/lib/molecules/InputField/BaseInput.d.ts +14 -0
- package/lib/molecules/InputField/BaseInput.js +67 -0
- package/lib/molecules/InputField/EmailInput.d.ts +14 -0
- package/lib/molecules/InputField/EmailInput.js +77 -0
- package/lib/molecules/InputField/Input.d.ts +26 -0
- package/lib/molecules/InputField/Input.js +23 -0
- package/lib/molecules/InputField/PasswordInput.d.ts +11 -0
- package/lib/molecules/InputField/PasswordInput.js +97 -0
- package/lib/molecules/InputField/index.d.ts +2 -0
- package/lib/molecules/InputField/index.js +27 -0
- package/lib/molecules/InputField/molecules/InputError.d.ts +5 -0
- package/lib/molecules/InputField/molecules/InputError.js +46 -0
- package/lib/molecules/InputField/molecules/InputHelper.d.ts +5 -0
- package/lib/molecules/InputField/molecules/InputHelper.js +25 -0
- package/lib/molecules/InputField/molecules/InputIcon.d.ts +7 -0
- package/lib/molecules/InputField/molecules/InputIcon.js +31 -0
- package/lib/molecules/InputField/molecules/InputLabel.d.ts +5 -0
- package/lib/molecules/InputField/molecules/InputLabel.js +19 -0
- package/lib/molecules/InputField/molecules/index.d.ts +4 -0
- package/lib/molecules/InputField/molecules/index.js +49 -0
- package/lib/molecules/InputField/styles.d.ts +27 -0
- package/lib/molecules/InputField/styles.js +34 -0
- package/lib/molecules/index.d.ts +8 -7
- package/lib/molecules/index.js +11 -0
- package/package.json +10 -10
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TextInput, KeyboardTypeOptions, TextInputProps } from "react-native";
|
|
2
|
+
import { IconName } from "dropi-lib-icons";
|
|
3
|
+
export declare const BaseInput: import("react").ForwardRefExoticComponent<TextInputProps & {
|
|
4
|
+
type?: KeyboardTypeOptions;
|
|
5
|
+
preIcon?: IconName;
|
|
6
|
+
label?: string;
|
|
7
|
+
helper?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
tooltip?: string;
|
|
10
|
+
value: string;
|
|
11
|
+
hasError: boolean;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
isFocus: boolean;
|
|
14
|
+
} & import("react").RefAttributes<TextInput>>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BaseInput = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _molecules = require("./molecules");
|
|
9
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
var _constants = require("../../constants");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const BaseInput = exports.BaseInput = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
15
|
+
type = "default",
|
|
16
|
+
preIcon,
|
|
17
|
+
label,
|
|
18
|
+
helper,
|
|
19
|
+
placeholder,
|
|
20
|
+
tooltip,
|
|
21
|
+
value,
|
|
22
|
+
hasError,
|
|
23
|
+
errorMessage,
|
|
24
|
+
isFocus,
|
|
25
|
+
/** TextInput props */
|
|
26
|
+
...rest
|
|
27
|
+
}, ref) => {
|
|
28
|
+
const getBorderColor = () => {
|
|
29
|
+
if (hasError) {
|
|
30
|
+
return _constants.colors["Error-500"].light;
|
|
31
|
+
}
|
|
32
|
+
if (isFocus) {
|
|
33
|
+
return _constants.colors["Info-500"].light;
|
|
34
|
+
}
|
|
35
|
+
return _constants.colors["Gray-200"].light;
|
|
36
|
+
};
|
|
37
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
38
|
+
style: _styles.default.fieldContainer,
|
|
39
|
+
children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)(_molecules.InputLabel, {
|
|
40
|
+
text: label
|
|
41
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
42
|
+
style: [_styles.default.searchbarContainer, {
|
|
43
|
+
borderColor: getBorderColor()
|
|
44
|
+
}],
|
|
45
|
+
children: [preIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_molecules.InputIcon, {
|
|
46
|
+
icon: preIcon
|
|
47
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
48
|
+
style: [_styles.default.searchContainer, {
|
|
49
|
+
marginLeft: preIcon ? _constants.spacing["size-2"] : 0
|
|
50
|
+
}],
|
|
51
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
52
|
+
ref: ref,
|
|
53
|
+
style: _styles.default.usernameInput,
|
|
54
|
+
placeholder: placeholder,
|
|
55
|
+
placeholderTextColor: _constants.colors["Gray-500"].light,
|
|
56
|
+
value: value,
|
|
57
|
+
keyboardType: type,
|
|
58
|
+
...rest
|
|
59
|
+
})
|
|
60
|
+
})]
|
|
61
|
+
}), helper && !hasError && /*#__PURE__*/(0, _jsxRuntime.jsx)(_molecules.InputHelper, {
|
|
62
|
+
helperText: helper
|
|
63
|
+
}), hasError && errorMessage && /*#__PURE__*/(0, _jsxRuntime.jsx)(_molecules.InputError, {
|
|
64
|
+
errorMessage: errorMessage
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IconName } from "dropi-lib-icons";
|
|
2
|
+
type InputProps = {
|
|
3
|
+
preIcon?: IconName;
|
|
4
|
+
helper?: string;
|
|
5
|
+
tooltip?: string;
|
|
6
|
+
value: string;
|
|
7
|
+
onChange: (value: string) => void;
|
|
8
|
+
hasError: boolean;
|
|
9
|
+
errorMessage?: string;
|
|
10
|
+
readOnly: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const validateEmail: (value: string) => boolean;
|
|
13
|
+
export declare const EmailInput: ({ preIcon, helper, tooltip, value, onChange, hasError, errorMessage, readOnly, }: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validateEmail = exports.EmailInput = void 0;
|
|
7
|
+
var _BaseInput = require("./BaseInput");
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
const validateEmail = value => {
|
|
11
|
+
// Regular expression for validating email addresses
|
|
12
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
13
|
+
return emailRegex.test(value);
|
|
14
|
+
};
|
|
15
|
+
exports.validateEmail = validateEmail;
|
|
16
|
+
const EmailInput = ({
|
|
17
|
+
preIcon,
|
|
18
|
+
helper,
|
|
19
|
+
tooltip,
|
|
20
|
+
value,
|
|
21
|
+
onChange,
|
|
22
|
+
hasError,
|
|
23
|
+
errorMessage,
|
|
24
|
+
readOnly
|
|
25
|
+
}) => {
|
|
26
|
+
const [incorrectEmail, setIncorrectEmail] = (0, _react.useState)(false);
|
|
27
|
+
const [focus, setFocus] = (0, _react.useState)(false);
|
|
28
|
+
const [wasVisited, setWasVisited] = (0, _react.useState)(false);
|
|
29
|
+
const onFocus = () => {
|
|
30
|
+
setFocus(true);
|
|
31
|
+
};
|
|
32
|
+
const onBlur = () => {
|
|
33
|
+
setFocus(false);
|
|
34
|
+
if (!wasVisited) {
|
|
35
|
+
setWasVisited(true);
|
|
36
|
+
if (!validateEmail(value)) {
|
|
37
|
+
setIncorrectEmail(true);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const getErrorMessage = () => {
|
|
42
|
+
if (hasError) {
|
|
43
|
+
return errorMessage;
|
|
44
|
+
}
|
|
45
|
+
if (incorrectEmail) {
|
|
46
|
+
return "Ingresa un correo electrónico válido";
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseInput.BaseInput, {
|
|
50
|
+
type: "email-address",
|
|
51
|
+
label: "Correo electrónico",
|
|
52
|
+
placeholder: "Ingresa tu correo electrónico",
|
|
53
|
+
value: value,
|
|
54
|
+
preIcon: preIcon,
|
|
55
|
+
helper: helper,
|
|
56
|
+
tooltip: tooltip,
|
|
57
|
+
onChangeText: text => {
|
|
58
|
+
onChange(text);
|
|
59
|
+
if (wasVisited) {
|
|
60
|
+
if (validateEmail(value)) {
|
|
61
|
+
setIncorrectEmail(false);
|
|
62
|
+
} else {
|
|
63
|
+
setIncorrectEmail(true);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
hasError: hasError || incorrectEmail,
|
|
68
|
+
errorMessage: getErrorMessage(),
|
|
69
|
+
autoCorrect: false,
|
|
70
|
+
autoCapitalize: "none",
|
|
71
|
+
readOnly: readOnly,
|
|
72
|
+
onBlur: onBlur,
|
|
73
|
+
onFocus: onFocus,
|
|
74
|
+
isFocus: focus
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
exports.EmailInput = EmailInput;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type InputType = "text" | "number" | "email" | "password";
|
|
2
|
+
type InputFactoryProps = {
|
|
3
|
+
type: InputType;
|
|
4
|
+
};
|
|
5
|
+
export declare const Input: ({ type, ...props }: InputFactoryProps) => import("react").ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
6
|
+
type?: import("react-native").KeyboardTypeOptions;
|
|
7
|
+
preIcon?: import("dropi-lib-icons").IconName;
|
|
8
|
+
label?: string;
|
|
9
|
+
helper?: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
tooltip?: string;
|
|
12
|
+
value: string;
|
|
13
|
+
hasError: boolean;
|
|
14
|
+
errorMessage?: string;
|
|
15
|
+
isFocus: boolean;
|
|
16
|
+
} & import("react").RefAttributes<import("react-native").TextInput>> | (({ preIcon, helper, tooltip, value, onChange, hasError, errorMessage, readOnly, }: {
|
|
17
|
+
preIcon?: import("dropi-lib-icons").IconName;
|
|
18
|
+
helper?: string;
|
|
19
|
+
tooltip?: string;
|
|
20
|
+
value: string;
|
|
21
|
+
onChange: (value: string) => void;
|
|
22
|
+
hasError: boolean;
|
|
23
|
+
errorMessage?: string;
|
|
24
|
+
readOnly: boolean;
|
|
25
|
+
}) => import("react/jsx-runtime").JSX.Element);
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Input = void 0;
|
|
7
|
+
var _BaseInput = require("./BaseInput");
|
|
8
|
+
var _EmailInput = require("./EmailInput");
|
|
9
|
+
// import { PasswordInput } from "./PasswordInput"
|
|
10
|
+
|
|
11
|
+
const InputComponents = {
|
|
12
|
+
text: _BaseInput.BaseInput,
|
|
13
|
+
number: _BaseInput.BaseInput,
|
|
14
|
+
email: _EmailInput.EmailInput,
|
|
15
|
+
password: _EmailInput.EmailInput
|
|
16
|
+
};
|
|
17
|
+
const Input = ({
|
|
18
|
+
type,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
return InputComponents[type];
|
|
22
|
+
};
|
|
23
|
+
exports.Input = Input;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TextInput, TextInputProps } from "react-native";
|
|
2
|
+
import { IconName } from "dropi-lib-icons";
|
|
3
|
+
export declare const PasswordInput: import("react").ForwardRefExoticComponent<TextInputProps & {
|
|
4
|
+
preIcon?: IconName;
|
|
5
|
+
helper?: string;
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
value: string;
|
|
8
|
+
onChangeFunction: (value: string) => void;
|
|
9
|
+
hasError: boolean;
|
|
10
|
+
errorMessage?: string;
|
|
11
|
+
} & import("react").RefAttributes<TextInput>>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PasswordInput = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _constants = require("./../../constants");
|
|
9
|
+
var _molecules = require("./molecules");
|
|
10
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
11
|
+
var _react = require("react");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const PasswordInput = exports.PasswordInput = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
15
|
+
preIcon,
|
|
16
|
+
helper,
|
|
17
|
+
tooltip,
|
|
18
|
+
value,
|
|
19
|
+
onChangeFunction,
|
|
20
|
+
hasError,
|
|
21
|
+
errorMessage,
|
|
22
|
+
/** TextInput props */
|
|
23
|
+
...rest
|
|
24
|
+
}, ref) => {
|
|
25
|
+
const [passwordVisibility, setPasswordVisibility] = (0, _react.useState)(false);
|
|
26
|
+
const [incorrectPasswordLength, setIncorrectPasswordLength] = (0, _react.useState)(false);
|
|
27
|
+
const [focus, setFocus] = (0, _react.useState)(false);
|
|
28
|
+
const [wasVisited, setWasVisited] = (0, _react.useState)(false);
|
|
29
|
+
const onFocus = () => {
|
|
30
|
+
setFocus(true);
|
|
31
|
+
};
|
|
32
|
+
const onBlur = () => {
|
|
33
|
+
setFocus(false);
|
|
34
|
+
if (!wasVisited) {
|
|
35
|
+
setWasVisited(true);
|
|
36
|
+
if (value.length < 4) {
|
|
37
|
+
setIncorrectPasswordLength(true);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const getBorderColor = () => {
|
|
42
|
+
if (hasError || incorrectPasswordLength) {
|
|
43
|
+
return _constants.colors["Error-500"].light;
|
|
44
|
+
}
|
|
45
|
+
if (focus) {
|
|
46
|
+
return _constants.colors["Info-500"].light;
|
|
47
|
+
}
|
|
48
|
+
return _constants.colors["Gray-200"].light;
|
|
49
|
+
};
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
51
|
+
style: _styles.default.fieldContainer,
|
|
52
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_molecules.InputLabel, {
|
|
53
|
+
text: "Contraseña"
|
|
54
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
55
|
+
style: [_styles.default.searchbarContainer, {
|
|
56
|
+
borderColor: getBorderColor()
|
|
57
|
+
}],
|
|
58
|
+
children: [preIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_molecules.InputIcon, {
|
|
59
|
+
icon: preIcon
|
|
60
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
61
|
+
style: [_styles.default.searchContainer, {
|
|
62
|
+
marginLeft: preIcon ? _constants.spacing["size-2"] : 0
|
|
63
|
+
}],
|
|
64
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
65
|
+
ref: ref,
|
|
66
|
+
style: _styles.default.usernameInput,
|
|
67
|
+
placeholder: "Ingresa tu contraseña",
|
|
68
|
+
placeholderTextColor: _constants.colors["Gray-500"].light,
|
|
69
|
+
value: value,
|
|
70
|
+
secureTextEntry: !passwordVisibility,
|
|
71
|
+
onChangeText: text => {
|
|
72
|
+
onChangeFunction(text);
|
|
73
|
+
if (wasVisited) {
|
|
74
|
+
if (text.length < 4) {
|
|
75
|
+
setIncorrectPasswordLength(true);
|
|
76
|
+
} else {
|
|
77
|
+
setIncorrectPasswordLength(false);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
onFocus: onFocus,
|
|
82
|
+
onBlur: onBlur,
|
|
83
|
+
...rest
|
|
84
|
+
})
|
|
85
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_molecules.InputIcon, {
|
|
86
|
+
icon: passwordVisibility ? "eye-crossed" : "eye",
|
|
87
|
+
onClick: () => setPasswordVisibility(!passwordVisibility)
|
|
88
|
+
})]
|
|
89
|
+
}), helper && !hasError && /*#__PURE__*/(0, _jsxRuntime.jsx)(_molecules.InputHelper, {
|
|
90
|
+
helperText: helper
|
|
91
|
+
}), incorrectPasswordLength && /*#__PURE__*/(0, _jsxRuntime.jsx)(_molecules.InputError, {
|
|
92
|
+
errorMessage: "La contraseña debe tener al menos 4 caracteres"
|
|
93
|
+
}), hasError && errorMessage && /*#__PURE__*/(0, _jsxRuntime.jsx)(_molecules.InputError, {
|
|
94
|
+
errorMessage: errorMessage
|
|
95
|
+
})]
|
|
96
|
+
});
|
|
97
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _EmailInput = require("./EmailInput");
|
|
7
|
+
Object.keys(_EmailInput).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _EmailInput[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _EmailInput[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _PasswordInput = require("./PasswordInput");
|
|
18
|
+
Object.keys(_PasswordInput).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _PasswordInput[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _PasswordInput[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InputError = void 0;
|
|
7
|
+
var _reactNative = _interopRequireDefault(require("dropi-lib-icons/react-native"));
|
|
8
|
+
var _reactNative2 = require("react-native");
|
|
9
|
+
var _constants = require("../../../constants");
|
|
10
|
+
var _atoms = require("../../../atoms");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const InputError = ({
|
|
14
|
+
errorMessage
|
|
15
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative2.View, {
|
|
16
|
+
style: styles.errorContainer,
|
|
17
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.View, {
|
|
18
|
+
style: styles.errorIcon,
|
|
19
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.default, {
|
|
20
|
+
name: "warning-circle-outline",
|
|
21
|
+
size: _constants.sizes["s"],
|
|
22
|
+
color: _constants.colors["Error-500"].light
|
|
23
|
+
})
|
|
24
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_atoms.Body, {
|
|
25
|
+
type: "s-regular",
|
|
26
|
+
style: styles.errorText,
|
|
27
|
+
children: errorMessage
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
exports.InputError = InputError;
|
|
31
|
+
const styles = _reactNative2.StyleSheet.create({
|
|
32
|
+
errorContainer: {
|
|
33
|
+
marginTop: _constants.spacing["size-2"],
|
|
34
|
+
flexDirection: "row",
|
|
35
|
+
width: "100%"
|
|
36
|
+
},
|
|
37
|
+
errorIcon: {
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
paddingTop: _constants.spacing["size-1"]
|
|
40
|
+
},
|
|
41
|
+
errorText: {
|
|
42
|
+
color: _constants.colors["Error-500"].light,
|
|
43
|
+
marginLeft: _constants.spacing["size-1"],
|
|
44
|
+
flex: 1
|
|
45
|
+
}
|
|
46
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InputHelper = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _atoms = require("../../../atoms");
|
|
9
|
+
var _constants = require("../../../constants");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
const InputHelper = ({
|
|
12
|
+
helperText
|
|
13
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
14
|
+
style: {
|
|
15
|
+
marginTop: _constants.spacing["size-2"]
|
|
16
|
+
},
|
|
17
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_atoms.Body, {
|
|
18
|
+
type: "s-regular",
|
|
19
|
+
style: {
|
|
20
|
+
color: _constants.colors["Gray-600"].light
|
|
21
|
+
},
|
|
22
|
+
children: helperText
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
exports.InputHelper = InputHelper;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InputIcon = void 0;
|
|
7
|
+
var _reactNative = _interopRequireDefault(require("dropi-lib-icons/react-native"));
|
|
8
|
+
var _reactNative2 = require("react-native");
|
|
9
|
+
var _constants = require("../../../constants");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const InputIcon = ({
|
|
13
|
+
icon,
|
|
14
|
+
onClick
|
|
15
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.TouchableOpacity, {
|
|
16
|
+
style: styles.userAvatarContainer,
|
|
17
|
+
onPress: onClick,
|
|
18
|
+
activeOpacity: onClick ? 0 : 1,
|
|
19
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.default, {
|
|
20
|
+
name: icon,
|
|
21
|
+
size: _constants.sizes["xl"],
|
|
22
|
+
color: _constants.colors["Gray-400"].light
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
exports.InputIcon = InputIcon;
|
|
26
|
+
const styles = _reactNative2.StyleSheet.create({
|
|
27
|
+
userAvatarContainer: {
|
|
28
|
+
justifyContent: "center",
|
|
29
|
+
alignItems: "center"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InputLabel = void 0;
|
|
7
|
+
var _atoms = require("../../../atoms");
|
|
8
|
+
var _constants = require("../../../constants");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
const InputLabel = ({
|
|
11
|
+
text
|
|
12
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_atoms.Body, {
|
|
13
|
+
type: "m-regular",
|
|
14
|
+
style: {
|
|
15
|
+
color: _constants.colors["Gray-600"].light
|
|
16
|
+
},
|
|
17
|
+
children: text
|
|
18
|
+
});
|
|
19
|
+
exports.InputLabel = InputLabel;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _InputLabel = require("./InputLabel");
|
|
7
|
+
Object.keys(_InputLabel).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _InputLabel[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _InputLabel[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _InputIcon = require("./InputIcon");
|
|
18
|
+
Object.keys(_InputIcon).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _InputIcon[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _InputIcon[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _InputHelper = require("./InputHelper");
|
|
29
|
+
Object.keys(_InputHelper).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _InputHelper[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _InputHelper[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _InputError = require("./InputError");
|
|
40
|
+
Object.keys(_InputError).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _InputError[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _InputError[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
fieldContainer: {
|
|
3
|
+
marginBottom: number;
|
|
4
|
+
width: "100%";
|
|
5
|
+
};
|
|
6
|
+
searchbarContainer: {
|
|
7
|
+
width: "100%";
|
|
8
|
+
borderRadius: number;
|
|
9
|
+
borderWidth: number;
|
|
10
|
+
justifyContent: "space-between";
|
|
11
|
+
flexDirection: "row";
|
|
12
|
+
marginTop: number;
|
|
13
|
+
height: number;
|
|
14
|
+
paddingHorizontal: number;
|
|
15
|
+
paddingVertical: number;
|
|
16
|
+
};
|
|
17
|
+
searchContainer: {
|
|
18
|
+
flex: number;
|
|
19
|
+
justifyContent: "center";
|
|
20
|
+
};
|
|
21
|
+
usernameInput: {
|
|
22
|
+
fontWeight: "400";
|
|
23
|
+
color: "#475066";
|
|
24
|
+
fontSize: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _constants = require("./../../constants");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _default = exports.default = _reactNative.StyleSheet.create({
|
|
10
|
+
fieldContainer: {
|
|
11
|
+
marginBottom: _constants.spacing["size-4"],
|
|
12
|
+
width: "100%"
|
|
13
|
+
},
|
|
14
|
+
searchbarContainer: {
|
|
15
|
+
width: "100%",
|
|
16
|
+
borderRadius: _constants.radius["border-2"],
|
|
17
|
+
borderWidth: 1,
|
|
18
|
+
justifyContent: "space-between",
|
|
19
|
+
flexDirection: "row",
|
|
20
|
+
marginTop: _constants.spacing["size-2"],
|
|
21
|
+
height: 48,
|
|
22
|
+
paddingHorizontal: _constants.spacing["size-3"],
|
|
23
|
+
paddingVertical: _constants.spacing["size-2"]
|
|
24
|
+
},
|
|
25
|
+
searchContainer: {
|
|
26
|
+
flex: 1,
|
|
27
|
+
justifyContent: "center"
|
|
28
|
+
},
|
|
29
|
+
usernameInput: {
|
|
30
|
+
fontWeight: _constants.weights.regular,
|
|
31
|
+
color: _constants.colors["Gray-600"].light,
|
|
32
|
+
fontSize: _constants.sizes.s
|
|
33
|
+
}
|
|
34
|
+
});
|
package/lib/molecules/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
1
|
+
export * from "./Alert";
|
|
2
|
+
export * from "./EmptyState";
|
|
3
|
+
export * from "./RadioButtons";
|
|
4
|
+
export * from "./Search";
|
|
5
|
+
export * from "./Tooltip";
|
|
6
|
+
export * from "./Toasts";
|
|
7
|
+
export * from "./Tags";
|
|
8
|
+
export * from "./InputField";
|
package/lib/molecules/index.js
CHANGED
|
@@ -79,4 +79,15 @@ Object.keys(_Tags).forEach(function (key) {
|
|
|
79
79
|
return _Tags[key];
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
|
+
});
|
|
83
|
+
var _InputField = require("./InputField");
|
|
84
|
+
Object.keys(_InputField).forEach(function (key) {
|
|
85
|
+
if (key === "default" || key === "__esModule") return;
|
|
86
|
+
if (key in exports && exports[key] === _InputField[key]) return;
|
|
87
|
+
Object.defineProperty(exports, key, {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return _InputField[key];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
82
93
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dropi/react-native-design-system",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "A React Native package built from scratch",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
],
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"dropi-lib-icons": ">=1.2.5",
|
|
23
|
+
"dropi-lib-icons": ">=1.3.4",
|
|
24
|
+
"expo-constants": ">=17.1.7",
|
|
26
25
|
"expo-image": ">=2.4.0",
|
|
27
26
|
"lottie-react-native": ">=7.2.2",
|
|
28
|
-
"
|
|
27
|
+
"react": ">=19.0.0",
|
|
28
|
+
"react-native": ">=0.79.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@babel/cli": "^7.28.3",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"@babel/preset-react": "^7.28.5",
|
|
35
35
|
"@babel/preset-typescript": "^7.28.5",
|
|
36
36
|
"@types/react": "^19.2.3",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"typescript": "^5.6.0",
|
|
40
|
-
"dropi-lib-icons": "^1.2.5",
|
|
37
|
+
"dropi-lib-icons": "^1.3.4",
|
|
38
|
+
"expo-constants": ">=17.1.7",
|
|
41
39
|
"expo-image": ">=2.4.0",
|
|
42
40
|
"lottie-react-native": ">=7.2.2",
|
|
43
|
-
"
|
|
41
|
+
"react": "^19.2.0",
|
|
42
|
+
"react-native": "^0.82.1",
|
|
43
|
+
"typescript": "^5.6.0"
|
|
44
44
|
}
|
|
45
45
|
}
|