contentoh-components-library 21.4.24 → 21.4.26
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/components/atoms/ImageCarousel/ImgeSlider.stories.js +90 -0
- package/dist/components/atoms/ImageCarousel/index.js +120 -0
- package/dist/components/atoms/ImageCarousel/styles.js +18 -0
- package/dist/components/atoms/PercentTag/PercentTag.stories.js +31 -0
- package/dist/components/atoms/PercentTag/index.js +23 -0
- package/dist/components/atoms/PercentTag/styles.js +22 -0
- package/dist/components/atoms/RatingStars/RatingStars.stories.js +30 -0
- package/dist/components/atoms/RatingStars/index.js +53 -0
- package/dist/components/atoms/RatingStars/styles.js +18 -0
- package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +48 -0
- package/dist/components/atoms/RetailerCatalog/index.js +69 -0
- package/dist/components/atoms/RetailerCatalog/styles.js +20 -0
- package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +33 -0
- package/dist/components/atoms/RetailerOption/index.js +62 -0
- package/dist/components/atoms/RetailerOption/styles.js +20 -0
- package/dist/components/atoms/RetailersList/RetailersList.stories.js +45 -0
- package/dist/components/atoms/RetailersList/index.js +46 -0
- package/dist/components/atoms/RetailersList/styles.js +18 -0
- package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +73 -0
- package/dist/components/atoms/UserCatalog/index.js +101 -0
- package/dist/components/atoms/UserCatalog/styles.js +18 -0
- package/dist/components/atoms/UserOption/UserOption.stories.js +40 -0
- package/dist/components/atoms/UserOption/index.js +130 -0
- package/dist/components/atoms/UserOption/styles.js +20 -0
- package/dist/components/atoms/UserSelector/UserSelector.stories.js +40 -0
- package/dist/components/atoms/UserSelector/index.js +98 -0
- package/dist/components/atoms/UserSelector/styles.js +32 -0
- package/dist/components/molecules/GridItem/GridItem.stories.js +123 -0
- package/dist/components/molecules/GridItem/index.js +152 -0
- package/dist/components/molecules/GridItem/styles.js +20 -0
- package/dist/components/molecules/HeaderItem/ColumnItem.js +23 -0
- package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +70 -0
- package/dist/components/molecules/HeaderItem/index.js +42 -0
- package/dist/components/molecules/HeaderItem/styles.js +30 -0
- package/dist/components/molecules/RowItem/ColumnItem.js +23 -0
- package/dist/components/molecules/RowItem/RowItem.stories.js +5242 -0
- package/dist/components/molecules/RowItem/index.js +58 -0
- package/dist/components/molecules/RowItem/styles.js +30 -0
- package/dist/components/molecules/StripeCardForm/StripeCardForm.stories.js +31 -0
- package/dist/components/molecules/StripeCardForm/index.js +87 -0
- package/dist/components/molecules/StripeCardForm/paymentForm.js +191 -0
- package/dist/components/molecules/StripeCardForm/styles.js +24 -0
- package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +30 -0
- package/dist/components/molecules/StripeCardSelector/index.js +107 -0
- package/dist/components/molecules/StripeCardSelector/styles.js +19 -0
- package/dist/components/molecules/StripeCardSelector/utils.js +56 -0
- package/dist/components/organisms/Chat/ContentChat/styles.js +1 -1
- package/dist/components/organisms/Chat/Footer/styles.js +1 -1
- package/dist/components/organisms/Chat/styles.js +1 -1
- package/dist/components/organisms/GridProducts/GridProducts.stories.js +5097 -0
- package/dist/components/organisms/GridProducts/index.js +63 -0
- package/dist/components/organisms/GridProducts/styles.js +18 -0
- package/dist/components/organisms/GridProducts/utils.js +149 -0
- package/dist/components/organisms/PanelLayout/PanelLayout.stories.js +87 -0
- package/dist/components/organisms/PanelLayout/index.js +27 -0
- package/dist/components/organisms/PanelLayout/styles.js +32 -0
- package/dist/components/organisms/SideModal/SideModal.stories.js +42 -0
- package/dist/components/organisms/SideModal/index.js +72 -0
- package/dist/components/organisms/SideModal/styles.js +18 -0
- package/package.json +1 -1
- package/src/components/organisms/Chat/ContentChat/styles.js +3 -0
- package/src/components/organisms/Chat/Footer/styles.js +4 -0
- package/src/components/organisms/Chat/styles.js +4 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GridProducts = void 0;
|
|
7
|
+
|
|
8
|
+
var _styles = require("./styles");
|
|
9
|
+
|
|
10
|
+
var _GridItem = require("../../molecules/GridItem");
|
|
11
|
+
|
|
12
|
+
var _HeaderItem = require("../../molecules/HeaderItem");
|
|
13
|
+
|
|
14
|
+
var _RowItem = require("../../molecules/RowItem");
|
|
15
|
+
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
|
+
var GridProducts = function GridProducts(_ref) {
|
|
19
|
+
var _ref$products = _ref.products,
|
|
20
|
+
products = _ref$products === void 0 ? [] : _ref$products,
|
|
21
|
+
_ref$columnsArray = _ref.columnsArray,
|
|
22
|
+
columnsArray = _ref$columnsArray === void 0 ? [] : _ref$columnsArray,
|
|
23
|
+
_ref$gridView = _ref.gridView,
|
|
24
|
+
gridView = _ref$gridView === void 0 ? true : _ref$gridView,
|
|
25
|
+
chkOnChange = _ref.chkOnChange,
|
|
26
|
+
_ref$selected = _ref.selected,
|
|
27
|
+
selected = _ref$selected === void 0 ? [] : _ref$selected,
|
|
28
|
+
chkChecked = _ref.chkChecked,
|
|
29
|
+
checkAll = _ref.checkAll,
|
|
30
|
+
chkCheckedAll = _ref.chkCheckedAll,
|
|
31
|
+
onGridClick = _ref.onGridClick;
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
33
|
+
children: !gridView ? products === null || products === void 0 ? void 0 : products.map(function (_ref2, i) {
|
|
34
|
+
var gridElement = _ref2.gridElement,
|
|
35
|
+
product = _ref2.product,
|
|
36
|
+
id = _ref2.id;
|
|
37
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridItem.GridItem, {
|
|
38
|
+
id: id,
|
|
39
|
+
index: i,
|
|
40
|
+
product: product,
|
|
41
|
+
gridElement: gridElement,
|
|
42
|
+
chkOnChange: chkOnChange,
|
|
43
|
+
onGridClick: onGridClick,
|
|
44
|
+
selected: selected,
|
|
45
|
+
chkChecked: chkChecked
|
|
46
|
+
}, i);
|
|
47
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
48
|
+
className: "table-view",
|
|
49
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderItem.HeaderItem, {
|
|
50
|
+
columnsArray: columnsArray,
|
|
51
|
+
checkAll: checkAll,
|
|
52
|
+
chkCheckedAll: chkCheckedAll
|
|
53
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RowItem.RowItem, {
|
|
54
|
+
productsArray: products,
|
|
55
|
+
chkOnChange: chkOnChange,
|
|
56
|
+
onGridClick: onGridClick,
|
|
57
|
+
chkChecked: chkChecked
|
|
58
|
+
})]
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
exports.GridProducts = GridProducts;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _templateObject;
|
|
15
|
+
|
|
16
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n height: calc(100% - 100px);\n overflow: auto;\n\n .table-view {\n height: 100%;\n width: 100%;\n }\n"])));
|
|
17
|
+
|
|
18
|
+
exports.Container = Container;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getProductsToTable = void 0;
|
|
7
|
+
|
|
8
|
+
var _RetailerCatalog = require("../../atoms/RetailerCatalog");
|
|
9
|
+
|
|
10
|
+
var _UserCatalog = require("../../atoms/UserCatalog");
|
|
11
|
+
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
|
|
14
|
+
var getProductsToTable = function getProductsToTable() {
|
|
15
|
+
var products = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
16
|
+
var textSpecialists = arguments.length > 1 ? arguments[1] : undefined;
|
|
17
|
+
var imagesSpecialists = arguments.length > 2 ? arguments[2] : undefined;
|
|
18
|
+
var auditors = arguments.length > 3 ? arguments[3] : undefined;
|
|
19
|
+
var images = arguments.length > 4 ? arguments[4] : undefined;
|
|
20
|
+
var onAssign = arguments.length > 5 ? arguments[5] : undefined;
|
|
21
|
+
var productsTableArray = [];
|
|
22
|
+
products.forEach(function (product) {
|
|
23
|
+
var article = product.article,
|
|
24
|
+
orderId = product.orderId,
|
|
25
|
+
upc = product.upc,
|
|
26
|
+
status = product.status,
|
|
27
|
+
version = product.version;
|
|
28
|
+
var id = (article === null || article === void 0 ? void 0 : article.id_article) + "-" + orderId;
|
|
29
|
+
var imgArray = images[(article === null || article === void 0 ? void 0 : article.id_article) + "-" + version];
|
|
30
|
+
var element = {
|
|
31
|
+
id: id,
|
|
32
|
+
cols: [{
|
|
33
|
+
name: (article === null || article === void 0 ? void 0 : article.country) || "-",
|
|
34
|
+
flex: 1,
|
|
35
|
+
minWidth: 100
|
|
36
|
+
}, {
|
|
37
|
+
name: orderId || "-",
|
|
38
|
+
flex: 1,
|
|
39
|
+
minWidth: 100
|
|
40
|
+
}, {
|
|
41
|
+
name: upc || "-",
|
|
42
|
+
flex: 1,
|
|
43
|
+
minWidth: 100
|
|
44
|
+
}, {
|
|
45
|
+
name: (article === null || article === void 0 ? void 0 : article.name) || "-",
|
|
46
|
+
flex: 1,
|
|
47
|
+
minWidth: 200
|
|
48
|
+
}, {
|
|
49
|
+
name: "S/M" || "-",
|
|
50
|
+
flex: 1,
|
|
51
|
+
minWidth: 100
|
|
52
|
+
}, {
|
|
53
|
+
name: status || "-",
|
|
54
|
+
flex: 1,
|
|
55
|
+
minWidth: 100
|
|
56
|
+
}, {
|
|
57
|
+
name: /*#__PURE__*/(0, _jsxRuntime.jsx)(_RetailerCatalog.RetailerCatalog, {
|
|
58
|
+
id: "retailers-" + id,
|
|
59
|
+
article: product,
|
|
60
|
+
retailers: product.retailers
|
|
61
|
+
}),
|
|
62
|
+
flex: 1,
|
|
63
|
+
minWidth: 100
|
|
64
|
+
}, {
|
|
65
|
+
name: product.prio,
|
|
66
|
+
flex: 1,
|
|
67
|
+
minWidth: 100
|
|
68
|
+
}, {
|
|
69
|
+
name: /*#__PURE__*/(0, _jsxRuntime.jsx)(_UserCatalog.UserCatalog, {
|
|
70
|
+
datasheet: article.id_datasheet_especialist,
|
|
71
|
+
description: article.id_description_especialist,
|
|
72
|
+
images: article.id_images_especialist,
|
|
73
|
+
auditor: article.id_auditor,
|
|
74
|
+
textSpecialists: textSpecialists,
|
|
75
|
+
imagesSpecialists: imagesSpecialists,
|
|
76
|
+
auditors: auditors,
|
|
77
|
+
id: "users-" + id,
|
|
78
|
+
product: product,
|
|
79
|
+
onAssign: onAssign
|
|
80
|
+
}),
|
|
81
|
+
flex: 1,
|
|
82
|
+
minWidth: 100
|
|
83
|
+
}, {
|
|
84
|
+
name: "Cont.",
|
|
85
|
+
flex: 1,
|
|
86
|
+
minWidth: 100
|
|
87
|
+
}],
|
|
88
|
+
gridElement: {
|
|
89
|
+
images: imgArray,
|
|
90
|
+
info: [{
|
|
91
|
+
title: "name",
|
|
92
|
+
value: (article === null || article === void 0 ? void 0 : article.name) || "-"
|
|
93
|
+
}, {
|
|
94
|
+
title: "order",
|
|
95
|
+
value: orderId || "-"
|
|
96
|
+
}, {
|
|
97
|
+
title: "category",
|
|
98
|
+
value: (article === null || article === void 0 ? void 0 : article.category) || "-"
|
|
99
|
+
}, {
|
|
100
|
+
title: "company",
|
|
101
|
+
value: (article === null || article === void 0 ? void 0 : article.company_name) || "-"
|
|
102
|
+
}, {
|
|
103
|
+
title: "price",
|
|
104
|
+
value: (article === null || article === void 0 ? void 0 : article.price) || "-"
|
|
105
|
+
}],
|
|
106
|
+
status: [{
|
|
107
|
+
title: "datasheet",
|
|
108
|
+
value: product === null || product === void 0 ? void 0 : product.datasheet_status,
|
|
109
|
+
percent: 80
|
|
110
|
+
}, {
|
|
111
|
+
title: "description",
|
|
112
|
+
value: product === null || product === void 0 ? void 0 : product.description_status,
|
|
113
|
+
percent: 80
|
|
114
|
+
}, {
|
|
115
|
+
title: "images",
|
|
116
|
+
value: product === null || product === void 0 ? void 0 : product.images_status,
|
|
117
|
+
percent: 80
|
|
118
|
+
}],
|
|
119
|
+
catalogs: {
|
|
120
|
+
leftSide: /*#__PURE__*/(0, _jsxRuntime.jsx)(_RetailerCatalog.RetailerCatalog, {
|
|
121
|
+
id: "retailers-" + id,
|
|
122
|
+
limit: 2,
|
|
123
|
+
article: product,
|
|
124
|
+
retailers: product.retailers
|
|
125
|
+
}),
|
|
126
|
+
rightSide: /*#__PURE__*/(0, _jsxRuntime.jsx)(_UserCatalog.UserCatalog, {
|
|
127
|
+
datasheet: article.id_datasheet_especialist,
|
|
128
|
+
description: article.id_description_especialist,
|
|
129
|
+
images: article.id_images_especialist,
|
|
130
|
+
auditor: article.id_auditor,
|
|
131
|
+
textSpecialists: textSpecialists,
|
|
132
|
+
imagesSpecialists: imagesSpecialists,
|
|
133
|
+
auditors: auditors,
|
|
134
|
+
id: "users-" + id,
|
|
135
|
+
product: product,
|
|
136
|
+
onAssign: onAssign
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
showBottom: true,
|
|
141
|
+
product: product,
|
|
142
|
+
article: article
|
|
143
|
+
};
|
|
144
|
+
productsTableArray.push(element);
|
|
145
|
+
});
|
|
146
|
+
return productsTableArray;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
exports.getProductsToTable = getProductsToTable;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.PanelLayoutDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
13
|
+
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
16
|
+
var _ButtonV = require("../../atoms/ButtonV2");
|
|
17
|
+
|
|
18
|
+
var _index = require("./index");
|
|
19
|
+
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
22
|
+
var _templateObject;
|
|
23
|
+
|
|
24
|
+
var TwoColumns = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: grid;\n width: 100%;\n grid-auto-rows: 1fr;\n grid-template-columns: 85% 15%;\n grid-template-rows: 100%;\n gap: 0px 10px;\n grid-template-areas: \"first second\";\n .first {\n grid-area: first;\n width: 100%;\n margin-left: 50px;\n display: flex;\n }\n .second {\n grid-area: second;\n width: 100%;\n }\n"])));
|
|
25
|
+
|
|
26
|
+
var _default = {
|
|
27
|
+
title: "Components/organisms/PanelLayout",
|
|
28
|
+
component: _index.PanelLayout
|
|
29
|
+
};
|
|
30
|
+
exports.default = _default;
|
|
31
|
+
|
|
32
|
+
var Template = function Template(args) {
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.PanelLayout, (0, _objectSpread2.default)({}, args));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var PanelLayoutDefault = Template.bind({});
|
|
37
|
+
exports.PanelLayoutDefault = PanelLayoutDefault;
|
|
38
|
+
PanelLayoutDefault.args = {
|
|
39
|
+
header: /*#__PURE__*/(0, _jsxRuntime.jsxs)(TwoColumns, {
|
|
40
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
41
|
+
className: "first",
|
|
42
|
+
children: "Productos"
|
|
43
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
44
|
+
className: "second",
|
|
45
|
+
children: "Precio"
|
|
46
|
+
})]
|
|
47
|
+
}),
|
|
48
|
+
body: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
49
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(TwoColumns, {
|
|
50
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
51
|
+
className: "first",
|
|
52
|
+
children: "Nombre de producto 1"
|
|
53
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
54
|
+
className: "second",
|
|
55
|
+
children: "Precio de producto 1"
|
|
56
|
+
})]
|
|
57
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(TwoColumns, {
|
|
58
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
59
|
+
className: "first",
|
|
60
|
+
children: "Nombre de producto 1"
|
|
61
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
62
|
+
className: "second",
|
|
63
|
+
children: "Precio de producto 1"
|
|
64
|
+
})]
|
|
65
|
+
})]
|
|
66
|
+
}),
|
|
67
|
+
footer: /*#__PURE__*/(0, _jsxRuntime.jsxs)(TwoColumns, {
|
|
68
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
69
|
+
className: "first",
|
|
70
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
71
|
+
id: "1",
|
|
72
|
+
label: "Seleccionar todos",
|
|
73
|
+
type: "pink"
|
|
74
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
75
|
+
id: "2",
|
|
76
|
+
label: "Manual"
|
|
77
|
+
})]
|
|
78
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
79
|
+
className: "second",
|
|
80
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
81
|
+
id: "3",
|
|
82
|
+
label: "Siguiente",
|
|
83
|
+
type: "pink"
|
|
84
|
+
})
|
|
85
|
+
})]
|
|
86
|
+
})
|
|
87
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PanelLayout = void 0;
|
|
7
|
+
|
|
8
|
+
var _styles = require("./styles");
|
|
9
|
+
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
var PanelLayout = function PanelLayout(_ref) {
|
|
13
|
+
var header = _ref.header,
|
|
14
|
+
body = _ref.body,
|
|
15
|
+
footer = _ref.footer;
|
|
16
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
17
|
+
children: [header ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Header, {
|
|
18
|
+
children: header
|
|
19
|
+
}) : null, body ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Body, {
|
|
20
|
+
children: body
|
|
21
|
+
}) : null, footer ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Footer, {
|
|
22
|
+
children: footer
|
|
23
|
+
}) : null]
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.PanelLayout = PanelLayout;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Header = exports.Footer = exports.Container = exports.Body = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: grid;\n grid-auto-rows: 1fr;\n grid-template-columns: 1fr;\n grid-template-rows: 34px 1fr 300px;\n gap: 0px 0px;\n grid-template-areas:\n \"header\"\n \"body\"\n \"footer\";\n font-family: ", ", sans-serif;\n font-size: 12px;\n"])), _variables.FontFamily.RobotoMedium);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
21
|
+
|
|
22
|
+
var Header = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n grid-area: header;\n background: #8a6caa;\n color: #ffffff;\n border-radius: 5px 5px 0px 0px;\n display: flex;\n align-items: center;\n"])));
|
|
23
|
+
|
|
24
|
+
exports.Header = Header;
|
|
25
|
+
|
|
26
|
+
var Body = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n grid-area: body;\n"])));
|
|
27
|
+
|
|
28
|
+
exports.Body = Body;
|
|
29
|
+
|
|
30
|
+
var Footer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n grid-area: footer;\n"])));
|
|
31
|
+
|
|
32
|
+
exports.Footer = Footer;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.DefaultSideModal = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _ = require(".");
|
|
13
|
+
|
|
14
|
+
var _ButtonV = require("../../atoms/ButtonV2");
|
|
15
|
+
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
|
+
var _default = {
|
|
19
|
+
title: "Components/organisms/SideModal",
|
|
20
|
+
component: _.SideModal
|
|
21
|
+
};
|
|
22
|
+
exports.default = _default;
|
|
23
|
+
|
|
24
|
+
var Template = function Template(args) {
|
|
25
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.SideModal, (0, _objectSpread2.default)({}, args));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var DefaultSideModal = Template.bind({});
|
|
29
|
+
exports.DefaultSideModal = DefaultSideModal;
|
|
30
|
+
DefaultSideModal.args = {
|
|
31
|
+
show: false,
|
|
32
|
+
header: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
33
|
+
className: "title-container",
|
|
34
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {})
|
|
35
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
36
|
+
label: "Ir al Checkout"
|
|
37
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
38
|
+
label: "X"
|
|
39
|
+
})],
|
|
40
|
+
body: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {}),
|
|
41
|
+
footer: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {})
|
|
42
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SideModal = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _styles = require("./styles");
|
|
11
|
+
|
|
12
|
+
var _iconsMaterial = require("@mui/icons-material");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var SideModal = function SideModal(_ref) {
|
|
17
|
+
var header = _ref.header,
|
|
18
|
+
body = _ref.body,
|
|
19
|
+
footer = _ref.footer,
|
|
20
|
+
show = _ref.show,
|
|
21
|
+
setShow = _ref.setShow,
|
|
22
|
+
_ref$id = _ref.id,
|
|
23
|
+
id = _ref$id === void 0 ? "side-modal" : _ref$id;
|
|
24
|
+
var modal = (0, _react.useRef)();
|
|
25
|
+
|
|
26
|
+
var closeModal = function closeModal(e) {
|
|
27
|
+
if (!e.target.closest("#".concat(id)) && show) {
|
|
28
|
+
var _modal$current, _modal$current$classL;
|
|
29
|
+
|
|
30
|
+
document.removeEventListener("click", closeModal, false);
|
|
31
|
+
modal === null || modal === void 0 ? void 0 : (_modal$current = modal.current) === null || _modal$current === void 0 ? void 0 : (_modal$current$classL = _modal$current.classList) === null || _modal$current$classL === void 0 ? void 0 : _modal$current$classL.remove("shown");
|
|
32
|
+
setShow && setShow(false);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
(0, _react.useEffect)(function () {
|
|
37
|
+
if (show && modal.current) {
|
|
38
|
+
var _modal$current2, _modal$current2$class;
|
|
39
|
+
|
|
40
|
+
document.addEventListener("click", closeModal, false);
|
|
41
|
+
modal === null || modal === void 0 ? void 0 : (_modal$current2 = modal.current) === null || _modal$current2 === void 0 ? void 0 : (_modal$current2$class = _modal$current2.classList) === null || _modal$current2$class === void 0 ? void 0 : _modal$current2$class.add("shown");
|
|
42
|
+
}
|
|
43
|
+
}, [show]);
|
|
44
|
+
(0, _react.useEffect)(function () {
|
|
45
|
+
return function () {
|
|
46
|
+
var _modal$current3, _modal$current3$class;
|
|
47
|
+
|
|
48
|
+
document.removeEventListener("click", closeModal, false);
|
|
49
|
+
modal === null || modal === void 0 ? void 0 : (_modal$current3 = modal.current) === null || _modal$current3 === void 0 ? void 0 : (_modal$current3$class = _modal$current3.classList) === null || _modal$current3$class === void 0 ? void 0 : _modal$current3$class.remove("shown");
|
|
50
|
+
setShow && setShow(false);
|
|
51
|
+
};
|
|
52
|
+
}, []);
|
|
53
|
+
return show && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
54
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
55
|
+
id: id,
|
|
56
|
+
ref: modal,
|
|
57
|
+
className: "modal-container",
|
|
58
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
59
|
+
className: "modal-header",
|
|
60
|
+
children: header
|
|
61
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
62
|
+
className: "modal-body",
|
|
63
|
+
children: body
|
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
65
|
+
className: "modal-footer",
|
|
66
|
+
children: footer
|
|
67
|
+
})]
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
exports.SideModal = SideModal;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _templateObject;
|
|
15
|
+
|
|
16
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100vw;\n height: 100vh;\n position: fixed;\n z-index: 9999999;\n background-color: transparent;\n top: 0;\n left: 0;\n\n .modal-container {\n width: 600px;\n height: 100%;\n position: absolute;\n right: -600px;\n background-color: #fff;\n display: flex;\n flex-direction: column;\n box-shadow: -0.5px 0px 5px #f0f0f0;\n border: 1px solid #f0f0f0;\n .modal-body {\n flex: 1;\n }\n\n &.shown {\n right: 0;\n }\n }\n"])));
|
|
17
|
+
|
|
18
|
+
exports.Container = Container;
|
package/package.json
CHANGED