@quintoandar-tokko/toast 1.0.101
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/index.js +116 -0
- package/package.json +23 -0
package/lib/index.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Toast = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _box = require("@quintoandar-tokko/box");
|
|
9
|
+
var _icons = require("@quintoandar-tokko/icons");
|
|
10
|
+
var _text = require("@quintoandar-tokko/text");
|
|
11
|
+
var _button = require("@quintoandar-tokko/button");
|
|
12
|
+
var _loader = require("@quintoandar-tokko/loader");
|
|
13
|
+
var _excluded = ["variant", "variantLoader", "variantText", "icon", "text", "subtitle", "closeIconNeighbor", "textDownload", "download", "hideCloseIcon"];
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
16
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
17
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
18
|
+
var Toast = exports.Toast = function Toast(_ref) {
|
|
19
|
+
var _ref$variant = _ref.variant,
|
|
20
|
+
variant = _ref$variant === void 0 ? 'base' : _ref$variant,
|
|
21
|
+
variantLoader = _ref.variantLoader,
|
|
22
|
+
_ref$variantText = _ref.variantText,
|
|
23
|
+
variantText = _ref$variantText === void 0 ? 'body.fontSize14' : _ref$variantText,
|
|
24
|
+
icon = _ref.icon,
|
|
25
|
+
text = _ref.text,
|
|
26
|
+
subtitle = _ref.subtitle,
|
|
27
|
+
closeIconNeighbor = _ref.closeIconNeighbor,
|
|
28
|
+
textDownload = _ref.textDownload,
|
|
29
|
+
download = _ref.download,
|
|
30
|
+
_ref$hideCloseIcon = _ref.hideCloseIcon,
|
|
31
|
+
hideCloseIcon = _ref$hideCloseIcon === void 0 ? false : _ref$hideCloseIcon,
|
|
32
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
+
return /*#__PURE__*/_react["default"].createElement(_box.Flex, _extends({
|
|
34
|
+
tx: "toast",
|
|
35
|
+
variant: variant
|
|
36
|
+
}, props, {
|
|
37
|
+
__css: {
|
|
38
|
+
display: 'flex',
|
|
39
|
+
flexDirection: 'row',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
padding: '0px 24px 0px 0px',
|
|
42
|
+
gap: '24px',
|
|
43
|
+
position: 'relative',
|
|
44
|
+
height: '72px',
|
|
45
|
+
background: '#272E33',
|
|
46
|
+
borderRadius: '6px',
|
|
47
|
+
color: 'white',
|
|
48
|
+
width: closeIconNeighbor ? '577px' : '423px',
|
|
49
|
+
justifyContent: closeIconNeighbor ? 'space-between' : 'unset'
|
|
50
|
+
}
|
|
51
|
+
}), /*#__PURE__*/_react["default"].createElement(_box.Box, {
|
|
52
|
+
__css: {
|
|
53
|
+
width: '327px',
|
|
54
|
+
display: 'flex',
|
|
55
|
+
flexDirection: 'row',
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
padding: '0px',
|
|
58
|
+
gap: '16px',
|
|
59
|
+
marginLeft: '24px'
|
|
60
|
+
}
|
|
61
|
+
}, icon !== undefined && /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
|
|
62
|
+
icon: icon,
|
|
63
|
+
fontSize: "32px"
|
|
64
|
+
}), variantLoader !== undefined && /*#__PURE__*/_react["default"].createElement(_loader.Loader, {
|
|
65
|
+
variant: variantLoader,
|
|
66
|
+
style: {
|
|
67
|
+
width: '32px',
|
|
68
|
+
height: '32px'
|
|
69
|
+
}
|
|
70
|
+
}), text !== undefined && subtitle !== undefined && /*#__PURE__*/_react["default"].createElement(_box.Box, {
|
|
71
|
+
__css: {
|
|
72
|
+
display: 'flex',
|
|
73
|
+
flexDirection: 'column',
|
|
74
|
+
gap: 2
|
|
75
|
+
}
|
|
76
|
+
}, /*#__PURE__*/_react["default"].createElement(_text.Text, {
|
|
77
|
+
variant: variantText,
|
|
78
|
+
color: "white",
|
|
79
|
+
fontWeight: "700",
|
|
80
|
+
fontSize: "14px"
|
|
81
|
+
}, text), /*#__PURE__*/_react["default"].createElement(_text.Text, {
|
|
82
|
+
color: "white",
|
|
83
|
+
fontSize: "14px"
|
|
84
|
+
}, subtitle)), text !== undefined && subtitle === undefined && /*#__PURE__*/_react["default"].createElement(_text.Text, {
|
|
85
|
+
variant: variantText,
|
|
86
|
+
display: "flex",
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
color: "white"
|
|
89
|
+
}, text), download !== undefined && /*#__PURE__*/_react["default"].createElement(_button.ButtonIcon, {
|
|
90
|
+
icon: "icon-descargar",
|
|
91
|
+
variant: "mainItemSmall",
|
|
92
|
+
color: "white",
|
|
93
|
+
text: textDownload,
|
|
94
|
+
onClick: download
|
|
95
|
+
})), !hideCloseIcon && !closeIconNeighbor && /*#__PURE__*/_react["default"].createElement(_button.ButtonIcon, {
|
|
96
|
+
color: "white",
|
|
97
|
+
icon: "icon-cerrar",
|
|
98
|
+
variant: ['subtleTrasnparentIconClearButton', 'iconMedium'],
|
|
99
|
+
onClick: function onClick() {
|
|
100
|
+
return props.closeFunction();
|
|
101
|
+
}
|
|
102
|
+
}), !hideCloseIcon && closeIconNeighbor && /*#__PURE__*/_react["default"].createElement(_box.Box, {
|
|
103
|
+
__css: {
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
display: 'flex',
|
|
106
|
+
gap: 4
|
|
107
|
+
}
|
|
108
|
+
}, closeIconNeighbor, /*#__PURE__*/_react["default"].createElement(_button.ButtonIcon, {
|
|
109
|
+
color: "white",
|
|
110
|
+
icon: "icon-cerrar",
|
|
111
|
+
variant: ['subtleTrasnparentIconClearButton', 'iconMedium'],
|
|
112
|
+
onClick: function onClick() {
|
|
113
|
+
return props.closeFunction();
|
|
114
|
+
}
|
|
115
|
+
})));
|
|
116
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@quintoandar-tokko/toast",
|
|
3
|
+
"version": "1.0.101",
|
|
4
|
+
"main": "lib/index.js",
|
|
5
|
+
"module": "src/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"lib"
|
|
8
|
+
],
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@quintoandar-tokko/box": "^1.2.286",
|
|
11
|
+
"@quintoandar-tokko/button": "^1.2.371",
|
|
12
|
+
"@quintoandar-tokko/icons": "^1.2.317",
|
|
13
|
+
"@quintoandar-tokko/loader": "^1.2.327",
|
|
14
|
+
"@quintoandar-tokko/text": "^1.2.287"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"react": "^16.8.0"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"gitHead": "3c5995a3482c9cd1b428a69e135c934c37bce2ae"
|
|
23
|
+
}
|