@dropi/react-native-design-system 0.2.9 → 0.2.10
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/Tags/DefaultTag/DefaultTag.d.ts +11 -0
- package/lib/molecules/Tags/DefaultTag/DefaultTag.js +73 -0
- package/lib/molecules/Tags/DefaultTag/index.d.ts +1 -0
- package/lib/molecules/Tags/DefaultTag/index.js +16 -0
- package/lib/molecules/Tags/OrderTag/OrderTag.d.ts +6 -0
- package/lib/molecules/Tags/OrderTag/OrderTag.js +56 -0
- package/lib/molecules/Tags/OrderTag/index.d.ts +1 -0
- package/lib/molecules/Tags/OrderTag/index.js +16 -0
- package/lib/molecules/Tags/index.d.ts +2 -0
- package/lib/molecules/Tags/index.js +27 -0
- package/lib/molecules/Toasts/FeedbackToast/FeedbackToast.js +2 -1
- package/lib/molecules/index.d.ts +1 -0
- package/lib/molecules/index.js +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IconName } from 'dropi-lib-icons';
|
|
2
|
+
type TagType = 'primary' | 'secondary';
|
|
3
|
+
type TagState = 'default' | 'success' | 'info' | 'warning' | 'red' | 'neutral';
|
|
4
|
+
interface Props {
|
|
5
|
+
type: TagType;
|
|
6
|
+
label: string;
|
|
7
|
+
state?: TagState;
|
|
8
|
+
icon?: IconName;
|
|
9
|
+
}
|
|
10
|
+
export declare const DefaultTag: ({ type, label, state, icon }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DefaultTag = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _constants = require("../../../constants");
|
|
9
|
+
var _atoms = require("../../../atoms");
|
|
10
|
+
var _reactNative2 = _interopRequireDefault(require("dropi-lib-icons/react-native"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const TAG_BACKGROUND_COLORS = {
|
|
14
|
+
primary: {
|
|
15
|
+
default: _constants.colors['Primary-500'].light,
|
|
16
|
+
success: _constants.colors['Success-500'].light,
|
|
17
|
+
info: _constants.colors['Info-500'].light,
|
|
18
|
+
warning: _constants.colors['Warning-500'].light,
|
|
19
|
+
red: _constants.colors['Error-500'].light,
|
|
20
|
+
neutral: _constants.colors['Gray-500'].light
|
|
21
|
+
},
|
|
22
|
+
secondary: {
|
|
23
|
+
default: _constants.colors['Primary-100'].light,
|
|
24
|
+
success: _constants.colors['Success-50'].light,
|
|
25
|
+
info: _constants.colors['Info-50'].light,
|
|
26
|
+
warning: _constants.colors['Warning-50'].light,
|
|
27
|
+
red: _constants.colors['Error-50'].light,
|
|
28
|
+
neutral: _constants.colors['Gray-50'].light
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const getBackgroundColor = (type, state) => {
|
|
32
|
+
return TAG_BACKGROUND_COLORS[type][state];
|
|
33
|
+
};
|
|
34
|
+
const DefaultTag = ({
|
|
35
|
+
type,
|
|
36
|
+
label,
|
|
37
|
+
state = 'default',
|
|
38
|
+
icon
|
|
39
|
+
}) => {
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
41
|
+
style: [styles.container, {
|
|
42
|
+
backgroundColor: getBackgroundColor(type, state)
|
|
43
|
+
}],
|
|
44
|
+
children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.default, {
|
|
45
|
+
name: icon,
|
|
46
|
+
size: _constants.sizes.s,
|
|
47
|
+
color: type === 'primary' ? _constants.colors['White'].light : getBackgroundColor('primary', state),
|
|
48
|
+
style: {
|
|
49
|
+
marginRight: 4
|
|
50
|
+
}
|
|
51
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_atoms.Body, {
|
|
52
|
+
numberOfLines: 1,
|
|
53
|
+
type: "s-medium",
|
|
54
|
+
style: {
|
|
55
|
+
color: type === 'primary' ? _constants.colors['White'].light : getBackgroundColor('primary', state)
|
|
56
|
+
},
|
|
57
|
+
children: [" ", label, " "]
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
exports.DefaultTag = DefaultTag;
|
|
62
|
+
const styles = _reactNative.StyleSheet.create({
|
|
63
|
+
container: {
|
|
64
|
+
paddingVertical: 4,
|
|
65
|
+
paddingHorizontal: 8,
|
|
66
|
+
borderRadius: _constants.radius["border-5"],
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
justifyContent: 'center',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
maxWidth: 160,
|
|
71
|
+
alignSelf: 'flex-start'
|
|
72
|
+
}
|
|
73
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DefaultTag';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _DefaultTag = require("./DefaultTag");
|
|
7
|
+
Object.keys(_DefaultTag).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _DefaultTag[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _DefaultTag[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.OrderTag = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _constants = require("../../../constants");
|
|
9
|
+
var _atoms = require("../../../atoms");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
const STATUS_BACKGROUND_COLORS = {
|
|
12
|
+
'ENTREGADO': _constants.colors['Success-700'].light,
|
|
13
|
+
'EN TRANSITO': _constants.colors['Success-600'].light,
|
|
14
|
+
'GUIA_GENERADA': _constants.colors['Info-500'].light,
|
|
15
|
+
'RECOGIDO POR DROPI': _constants.colors['Info-700'].light,
|
|
16
|
+
'ENTREGADO A TRANSPORTADORA': _constants.colors['Success-400'].light,
|
|
17
|
+
'PENDIENTE': _constants.colors['Warning-600'].light,
|
|
18
|
+
'PENDIENTE CONFIRMACION': _constants.colors['Warning-500'].light,
|
|
19
|
+
'NOVEDAD': _constants.colors['Error-600'].light,
|
|
20
|
+
'DEVOLUCION': _constants.colors['Error-800'].light,
|
|
21
|
+
'CANCELADO': _constants.colors['Gray-400'].light
|
|
22
|
+
};
|
|
23
|
+
const getBackgroundColor = status => {
|
|
24
|
+
return STATUS_BACKGROUND_COLORS[status] || _constants.colors.Black.light;
|
|
25
|
+
};
|
|
26
|
+
const OrderTag = ({
|
|
27
|
+
status,
|
|
28
|
+
limitedWidth = false
|
|
29
|
+
}) => {
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
31
|
+
style: [styles.orderStatusTag, {
|
|
32
|
+
backgroundColor: getBackgroundColor(status),
|
|
33
|
+
maxWidth: limitedWidth ? 112 : '100%'
|
|
34
|
+
}],
|
|
35
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_atoms.Body, {
|
|
36
|
+
type: "xs-medium",
|
|
37
|
+
numberOfLines: 1,
|
|
38
|
+
style: styles.statusText,
|
|
39
|
+
children: status
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
exports.OrderTag = OrderTag;
|
|
44
|
+
const styles = _reactNative.StyleSheet.create({
|
|
45
|
+
orderStatusTag: {
|
|
46
|
+
maxWidth: 112,
|
|
47
|
+
borderRadius: _constants.radius["border-5"],
|
|
48
|
+
paddingHorizontal: _constants.spacing['size-2'],
|
|
49
|
+
paddingVertical: _constants.spacing['size-1'],
|
|
50
|
+
alignSelf: 'flex-start'
|
|
51
|
+
},
|
|
52
|
+
statusText: {
|
|
53
|
+
color: _constants.colors.White.light,
|
|
54
|
+
textAlign: 'center'
|
|
55
|
+
}
|
|
56
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './OrderTag';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _OrderTag = require("./OrderTag");
|
|
7
|
+
Object.keys(_OrderTag).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _OrderTag[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _OrderTag[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _DefaultTag = require("./DefaultTag");
|
|
7
|
+
Object.keys(_DefaultTag).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _DefaultTag[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _DefaultTag[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _OrderTag = require("./OrderTag");
|
|
18
|
+
Object.keys(_OrderTag).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _OrderTag[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _OrderTag[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -81,7 +81,8 @@ const FeedbackToast = exports.FeedbackToast = /*#__PURE__*/(0, _react.forwardRef
|
|
|
81
81
|
style: {
|
|
82
82
|
flexDirection: 'row',
|
|
83
83
|
flex: 1,
|
|
84
|
-
paddingVertical: _constants.spacing['size-4']
|
|
84
|
+
paddingVertical: _constants.spacing['size-4'],
|
|
85
|
+
justifyContent: 'space-between'
|
|
85
86
|
},
|
|
86
87
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
87
88
|
style: {
|
package/lib/molecules/index.d.ts
CHANGED
package/lib/molecules/index.js
CHANGED
|
@@ -68,4 +68,15 @@ Object.keys(_Toasts).forEach(function (key) {
|
|
|
68
68
|
return _Toasts[key];
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
|
+
});
|
|
72
|
+
var _Tags = require("./Tags");
|
|
73
|
+
Object.keys(_Tags).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _Tags[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _Tags[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
71
82
|
});
|