contentoh-components-library 21.2.78 → 21.2.79

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.
Files changed (44) hide show
  1. package/.env.development +4 -1
  2. package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
  3. package/dist/components/atoms/StatusTag/index.js +58 -0
  4. package/dist/components/atoms/StatusTag/styles.js +20 -0
  5. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
  6. package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
  7. package/dist/components/molecules/GalleryElement/index.js +16 -1
  8. package/dist/components/molecules/GalleryHeader/index.js +3 -0
  9. package/dist/components/molecules/HeaderTop/index.js +10 -5
  10. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  11. package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
  12. package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
  13. package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
  14. package/dist/components/pages/RetailerProductEdition/index.js +2 -1
  15. package/package.json +6 -1
  16. package/src/assets/images/chatPopup/Spinner.gif +0 -0
  17. package/src/assets/images/chatPopup/close.svg +3 -0
  18. package/src/assets/images/chatPopup/defaultImage.png +0 -0
  19. package/src/assets/images/chatPopup/defaultProfile.png +0 -0
  20. package/src/assets/images/chatPopup/doc.svg +1 -0
  21. package/src/assets/images/chatPopup/document.svg +1 -0
  22. package/src/assets/images/chatPopup/iconChat.svg +19 -0
  23. package/src/assets/images/chatPopup/iconPlus.svg +3 -0
  24. package/src/assets/images/chatPopup/pdf.svg +75 -0
  25. package/src/assets/images/chatPopup/remove.svg +4 -0
  26. package/src/assets/images/chatPopup/send.svg +3 -0
  27. package/src/assets/images/chatPopup/svgIcon.svg +109 -0
  28. package/src/assets/images/chatPopup/upload_file.svg +3 -0
  29. package/src/assets/images/chatPopup/xls.svg +53 -0
  30. package/src/assets/images/customSelect/starIcon.svg +14 -0
  31. package/src/components/atoms/ChatPopUp/ChatPopUp.stories.js +11 -0
  32. package/src/components/atoms/ChatPopUp/index.js +541 -0
  33. package/src/components/atoms/ChatPopUp/styles.js +278 -0
  34. package/src/components/atoms/ChatPopUp/utils/handlersChat.js +104 -0
  35. package/src/components/atoms/Tooltip/Tooltip.stories.js +15 -0
  36. package/src/components/atoms/Tooltip/index.js +35 -0
  37. package/src/components/atoms/Tooltip/styles.js +5 -0
  38. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +20 -12
  39. package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
  40. package/src/components/molecules/GalleryElement/index.js +18 -0
  41. package/src/components/molecules/GalleryHeader/index.js +1 -0
  42. package/src/components/molecules/HeaderTop/index.js +10 -6
  43. package/src/components/molecules/HeaderTop/styles.js +4 -0
  44. package/src/components/pages/RetailerProductEdition/index.js +1 -0
@@ -0,0 +1,278 @@
1
+ import styled from "styled-components";
2
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.button`
5
+ height: 34px;
6
+ width: 34px;
7
+ background-color: transparent;
8
+ border: 1px solid #f0f0f0;
9
+ border-radius: 50px;
10
+ padding: 10px;
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: center;
14
+ position: relative;
15
+ cursor: pointer;
16
+ &:hover {
17
+ background-color: #f0f0f0;
18
+ }
19
+ .icon-chat {
20
+ margin: 0;
21
+ width: 15px;
22
+ height: 15px;
23
+ }
24
+ `;
25
+ export const Slider = styled.div`
26
+ -webkit-box-shadow: 0px 0px 10px -1px rgba(0, 0, 0, 0.8);
27
+ box-shadow: 0px 0px 10px -1px rgba(0, 0, 0, 0.8);
28
+ z-index: 200;
29
+ width: 425px;
30
+ height: 600px;
31
+ border-radius: 10px;
32
+ background: white;
33
+ padding: 37px 16px 17px 20px;
34
+ position: absolute;
35
+ right: ${({ showMenu }) => (showMenu ? 2 : -50)}%;
36
+ top: 3%;
37
+ transition: right 2s ease 0;
38
+ .image {
39
+ display: flex;
40
+ justify-content: center;
41
+ align-content: center;
42
+ background-color: #f7f7f7;
43
+ border-radius: 10px;
44
+ #myList {
45
+ list-style: none;
46
+ img {
47
+ width: 365px;
48
+ border-radius: 10px;
49
+ }
50
+ }
51
+ }
52
+ .close {
53
+ background-color: #e33aa9;
54
+ border: 3px solid white;
55
+ height: 35px;
56
+ width: 35px;
57
+ border-radius: 50%;
58
+ position: absolute;
59
+ top: -18px;
60
+ display: flex;
61
+ justify-content: center;
62
+ align-items: center;
63
+ cursor: pointer;
64
+ }
65
+ .content-chat {
66
+ height: 495px;
67
+ max-height: 495px;
68
+ overflow-y: auto;
69
+ overflow-x: hidden;
70
+ background-color: transparent;
71
+ font-family: sans-serif;
72
+ font-size: 12px;
73
+ & + * {
74
+ margin-top: 12px;
75
+ }
76
+ ::-webkit-scrollbar {
77
+ width: 0;
78
+ }
79
+ .cargar-mas {
80
+ border: none;
81
+ border-radius: 10px;
82
+ font: normal normal normal 11px/11px sans-serif;
83
+ letter-spacing: 0.1px;
84
+ color: #8a6caa;
85
+ background-color: #f7f7fc;
86
+ padding: 5px 17px;
87
+ margin: 0 35%;
88
+ display: flex;
89
+ cursor: pointer;
90
+ white-space: nowrap;
91
+ &:hover {
92
+ background-color: #f0f0f0;
93
+ }
94
+ img {
95
+ margin-right: 7px;
96
+ height: 13px;
97
+ }
98
+ }
99
+ #myListChat {
100
+ list-style: none;
101
+ margin: 0;
102
+ padding: 0;
103
+ height: 100%;
104
+ overflow-y: auto;
105
+ overflow-x: hidden;
106
+ display: flex;
107
+ flex-direction: column-reverse;
108
+ gap: 3px;
109
+ .group-date {
110
+ display: flex;
111
+ justify-content: center;
112
+ align-items: center;
113
+ hr {
114
+ width: 120px;
115
+ border: 0.3px solid #f0f0f0;
116
+ }
117
+ p {
118
+ margin: 0 10px;
119
+ color: #b3b3b3;
120
+ }
121
+ }
122
+ li {
123
+ width: 100%;
124
+ padding: 5px 0;
125
+ margin: 0;
126
+ display: flex;
127
+ flex-direction: row-reverse;
128
+ justify-content: flex-start;
129
+ flex-wrap: nowrap;
130
+ gap: 5px;
131
+ align-items: center;
132
+ .tooltip-userName {
133
+ background-color: #f0f0f0;
134
+ padding: 6px 10px;
135
+ color: #000000;
136
+ font-size: 11px;
137
+ margin-bottom: 6px;
138
+ .MuiTooltip-arrow {
139
+ color: #f0f0f0;
140
+ }
141
+ }
142
+
143
+ .profile {
144
+ display: grid;
145
+ place-items: center;
146
+ align-self: start;
147
+ width: 34px;
148
+ height: 34px;
149
+ border-radius: 50%;
150
+ overflow: hidden;
151
+ img {
152
+ width: 100%;
153
+ height: 100%;
154
+ border-radius: inherit;
155
+ }
156
+ }
157
+ .img-file {
158
+ margin: 0 10px;
159
+ width: 165px;
160
+ img {
161
+ width: 100%;
162
+ object-fit: contain;
163
+ border-radius: 10px;
164
+ }
165
+ }
166
+ .body-message {
167
+ margin: 0 10px;
168
+ border-radius: 10px;
169
+ box-sizing: border-box;
170
+ background-color: #f0f0f0;
171
+ padding: 10px 10px 10px 12px;
172
+ max-width: 280px;
173
+ p {
174
+ color: #262626;
175
+ margin: 0;
176
+ padding: 0;
177
+ }
178
+ a {
179
+ text-decoration: none;
180
+ }
181
+ div {
182
+ cursor: pointer;
183
+ background-color: white;
184
+ border-radius: 10px;
185
+ padding: 7px 10px;
186
+ display: flex;
187
+ align-items: center;
188
+ img {
189
+ height: 20px;
190
+ width: 20px;
191
+ margin-right: 5px;
192
+ }
193
+ p {
194
+ color: #262626 !important;
195
+ white-space: nowrap;
196
+ text-overflow: ellipsis;
197
+ overflow: hidden;
198
+ }
199
+ }
200
+ }
201
+ .date {
202
+ display: flex;
203
+ align-items: center;
204
+ white-space: nowrap;
205
+ p {
206
+ color: #d9d9d9;
207
+ font-size: 9px;
208
+ }
209
+ }
210
+ &.own-message {
211
+ flex-direction: row;
212
+ justify-content: flex-start;
213
+ .body-message {
214
+ background-color: #8386ee;
215
+ p {
216
+ margin: 0;
217
+ padding: 0;
218
+ color: #ffffff;
219
+ }
220
+ }
221
+ }
222
+ }
223
+ }
224
+ }
225
+ .input-chat {
226
+ display: flex;
227
+ align-items: center;
228
+ border-radius: 17px;
229
+ background-color: #f7f7f7;
230
+ padding: 10px 7px 10px 15px;
231
+ .send-message {
232
+ background-color: transparent;
233
+ width: 157%;
234
+ border: none;
235
+ font-family: sans-serif;
236
+ font-size: 13px;
237
+ line-height: initial;
238
+ color: #242424;
239
+ ::placeholder {
240
+ font: normal normal medium 12px/14px sans-serif;
241
+ letter-spacing: 0.6px;
242
+ color: #b3b3b3;
243
+ }
244
+ :focus {
245
+ outline: none;
246
+ }
247
+ & + * {
248
+ margin-left: 10px;
249
+ }
250
+ }
251
+ .upload {
252
+ border: none;
253
+ background: transparent;
254
+ cursor: pointer;
255
+ & + * {
256
+ margin-left: 7px;
257
+ }
258
+ }
259
+ .add-picture-input {
260
+ display: none;
261
+ }
262
+ .send {
263
+ width: 35.4px;
264
+ height: 20px;
265
+ border: none;
266
+ background-color: #e33aa9;
267
+ border-radius: 50%;
268
+ display: flex;
269
+ justify-content: center;
270
+ cursor: pointer;
271
+ align-items: center;
272
+ img {
273
+ width: 11px;
274
+ height: 11px;
275
+ }
276
+ }
277
+ }
278
+ `;
@@ -0,0 +1,104 @@
1
+
2
+ import axios from "axios";
3
+
4
+
5
+ export const getBD = (
6
+ id_article,
7
+ version_article,
8
+ get_type,
9
+ item_date ,
10
+ tokenUser
11
+ ) => {
12
+ return new Promise(async (response, error) => {
13
+ try {
14
+ let URL = `https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/products-chat`; // endpoint
15
+ URL += `?id_article=${id_article}`;
16
+ URL += `&version_article=${version_article}`;
17
+ URL += `&get_type=${get_type}`;
18
+ URL += `&item_date=${item_date}`;
19
+
20
+ const respHTTPjson = await axios.get(URL, {
21
+ headers: {
22
+ // AQUI COLOCAR EL TOKEN DEL USUARIO CONECTADO
23
+ Authorization: tokenUser,
24
+ },
25
+ });
26
+ //console.log( "respHTTPjson" , respHTTPjson )
27
+ // verificar si existe un error en la peticion realizada
28
+ if (respHTTPjson.status != 200) {
29
+ response({
30
+ message: "No fue posible llevar a cabo la operacion",
31
+ errorDetails: respHTTPjson.statusText,
32
+ });
33
+ return;
34
+ }
35
+ // obtener body backend
36
+ const body = JSON.parse(respHTTPjson.data.body);
37
+ //console.log( "resHTTP body:" , body );
38
+ // verificar si existe error desde el backend
39
+ if (respHTTPjson.data.statusCode != 200) {
40
+ response({
41
+ message: body.message,
42
+ errorDetails: body.errorDetail,
43
+ });
44
+ return;
45
+ }
46
+ // cuando se ejecuto bien el create ... tomar un posible message
47
+ response({ body });
48
+ } catch (err) {
49
+ //console.log("error catch get items chat" , err);
50
+ response({
51
+ message: "Algo salio mal al obtener los items del chat",
52
+ errorDetails: err.message,
53
+ });
54
+ }
55
+ });
56
+ };
57
+
58
+
59
+ export const createItemBD = (
60
+ id_article,
61
+ version_article,
62
+ value_type,
63
+ value ,
64
+ tokenUser
65
+ ) => {
66
+ return new Promise(async (response, error) => {
67
+ try {
68
+ const URL = `https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/products-chat`;
69
+ const bodyData = {
70
+ id_article: id_article,
71
+ version_article: version_article,
72
+ value_type: value_type,
73
+ value: value,
74
+ };
75
+
76
+ const respHTTPjson = await axios.post(URL, bodyData, {
77
+ headers: {
78
+ Authorization: tokenUser,
79
+ },
80
+ });
81
+ if (respHTTPjson.status != 200) {
82
+ response({
83
+ message: "No fue posible llevar a cabo la operacion",
84
+ errorDetails: respHTTPjson.statusText,
85
+ });
86
+ return;
87
+ }
88
+ const body = JSON.parse(respHTTPjson.data.body);
89
+ if (respHTTPjson.data.statusCode != 200) {
90
+ response({
91
+ message: body.message,
92
+ errorDetails: body.errorDetail,
93
+ });
94
+ return;
95
+ }
96
+ response({ body: true });
97
+ } catch (err) {
98
+ response({
99
+ message: "Algo salio mal al agregar el item en el chat",
100
+ errorDetails: err.message,
101
+ });
102
+ }
103
+ });
104
+ };
@@ -0,0 +1,15 @@
1
+ import { CustomTooltip } from "./index";
2
+
3
+ export default {
4
+ title: "Components/atoms/CustomTooltip",
5
+ component: CustomTooltip
6
+ };
7
+
8
+ const Template = (args) => <CustomTooltip {...args} />;
9
+
10
+ export const TooltipDefault = Template.bind({});
11
+ TooltipDefault.args = {
12
+ componentTooltip: (<p> hola soy tooltip </p>) ,
13
+ children: (<button> abrir tooltip </button>) ,
14
+ className: "container-tooltip"
15
+ };
@@ -0,0 +1,35 @@
1
+ import { useEffect, useState } from "react";
2
+ import { Tooltip } from "@mui/material";
3
+ import { Container } from "./styles";
4
+ import React from "react";
5
+
6
+ export const CustomTooltip = ({
7
+ componentTooltip ,
8
+ children ,
9
+ className ,
10
+ ...props
11
+ }) => {
12
+
13
+ const MyComponent = React.forwardRef(function MyComponent(props, ref) {
14
+ return (
15
+ <div {...props} ref={ref}>
16
+ Bin
17
+ </div>
18
+ );
19
+ });
20
+
21
+ return (
22
+ <Tooltip
23
+ {...props}
24
+ arrow
25
+ placement="top"
26
+ componentsProps={{
27
+ tooltip: {className: className} ,
28
+ popper: {disablePortal: true}
29
+ }}
30
+ title={ componentTooltip }
31
+ >
32
+ {children}
33
+ </Tooltip>
34
+ )
35
+ };
@@ -0,0 +1,5 @@
1
+ import styled from "styled-components";
2
+
3
+ export const Container = styled.div`
4
+ border: 1px solid red;
5
+ `;
@@ -1,4 +1,5 @@
1
1
  import { CustomSelect } from "./index";
2
+ import iconStar from "../../../assets/images/customSelect/starIcon.svg";
2
3
 
3
4
  export default {
4
5
  title: "Components/molecules/CustomSelect",
@@ -8,20 +9,27 @@ export default {
8
9
  const Template = (args) => <CustomSelect {...args} />;
9
10
  export const CustomSelectDefault = Template.bind({});
10
11
  CustomSelectDefault.args = {
11
- selectLabel: "Todos los departamentos",
12
+ // selectLabel: "Todos los departamentos",
12
13
  defaultOption: "Todos los departamentos",
13
14
  options: [
14
- {
15
- id: 1,
16
- value: "Decoración",
17
- subOptions: [
18
- { id: 1, value: "Espejos" },
19
- { id: 2, value: "Persianas" },
20
- ],
15
+ {
16
+ id: 47,
17
+ name: "Enero 2023",
18
+ isSelected: true,
19
+ },
20
+ {
21
+ id: 49,
22
+ name: "Mis Favoritos",
21
23
  },
22
- { id: 2, value: "Eléctrico" },
23
- { id: 3, value: "Ferretería" },
24
- { id: 4, value: "Herramientas" },
25
- { id: 5, value: "Iluminación" },
26
24
  ],
25
+ onClickItem: (v, id) => {
26
+ if (v) {
27
+ console.log("Agregar a la lista", id);
28
+ } else {
29
+ console.log("Eliminar a la lista", id);
30
+ }
31
+ },
32
+ icon: iconStar,
33
+ showSearchBar: true,
34
+ customOptions: <p>Esto es un customOptions</p>
27
35
  };
@@ -7,6 +7,7 @@ export const SelecItem = ({
7
7
  setParameterArray,
8
8
  activeFilters,
9
9
  setActiveFilters,
10
+ onClickItem,
10
11
  }) => {
11
12
  const [showSubOptions, setShowSubOptions] = useState(false);
12
13
  const [chkGlobal, setChkGlobal] = useState(false);
@@ -17,6 +18,9 @@ export const SelecItem = ({
17
18
  id={"main-item-" + option.id}
18
19
  label={option.name}
19
20
  onChange={(e) => {
21
+ if (onClickItem) {
22
+ onClickItem(e.target.checked, option.id)
23
+ }
20
24
  const subOptions = option.subOptions;
21
25
  const filtersCopy = { ...activeFilters };
22
26
  if (subOptions) {
@@ -77,6 +81,9 @@ export const SelecItem = ({
77
81
  activeFilters[option.name][sub.name]
78
82
  }
79
83
  onChange={(e) => {
84
+ if (onClickItem) {
85
+ onClickItem(e.target.checked, sub.id)
86
+ }
80
87
  if (e.target.checked) {
81
88
  setParameterArray((current) =>
82
89
  [...current, sub.id].sort((a, b) => a - b)
@@ -21,6 +21,8 @@ export const GalleryElement = ({
21
21
  selectedImages,
22
22
  setSelectedImages,
23
23
  setCheckAll,
24
+ setSocketType,
25
+ shotThd,
24
26
  }) => {
25
27
  const [statusValidation, setStatusValidation] = useState(validation);
26
28
  const [showValidationPanel, setShowValidationPanel] = useState(false);
@@ -118,6 +120,22 @@ export const GalleryElement = ({
118
120
  });
119
121
  }}
120
122
  />
123
+ {shotThd && (
124
+ <Select
125
+ width="100%"
126
+ placeholder="Tipo de imagen THD"
127
+ options={imageShotType}
128
+ valueSelected={image.image_shot_type}
129
+ onChange={(e) => {
130
+ changeImage({
131
+ action: "changeShotType",
132
+ attribute: "image_shot_type",
133
+ value: +e.target.value,
134
+ index: number,
135
+ });
136
+ }}
137
+ />
138
+ )}
121
139
  </>
122
140
  )}
123
141
  </div>
@@ -20,6 +20,7 @@ export const GalleryHeader = ({ setCheckAll, setSelectedImages, shotThd }) => {
20
20
  <p className="">Tipo de toma</p>
21
21
  <p className="">Tipo de imagen</p>
22
22
  <p className="">Tipo de empaque</p>
23
+ {shotThd && <p className="">Tipo de imagen THD</p>}
23
24
  </Container>
24
25
  );
25
26
  };
@@ -2,6 +2,7 @@ import { Container } from "./styles";
2
2
  import { ScreenHeader } from "../../atoms/ScreenHeader/index";
3
3
  import { Button } from "../../atoms/GeneralButton/index";
4
4
  import { useEffect, useRef } from "react";
5
+ import { ChatPopUp } from "../../atoms/ChatPopUp/index";
5
6
 
6
7
  export const HeaderTop = ({ setHeaderTop }) => {
7
8
  const headerTop = useRef();
@@ -13,12 +14,15 @@ export const HeaderTop = ({ setHeaderTop }) => {
13
14
  return (
14
15
  <Container ref={headerTop}>
15
16
  <ScreenHeader text="Edición de producto" />
16
- <Button
17
- buttonType="close-button"
18
- onClick={() => {
19
- window.location.href = `/products`;
20
- }}
21
- />
17
+ <div className="buttons-top">
18
+ {/* <ChatPopUp /> */}
19
+ <Button
20
+ buttonType="close-button"
21
+ onClick={() => {
22
+ window.location.href = `/products`;
23
+ }}
24
+ />
25
+ </div>
22
26
  </Container>
23
27
  );
24
28
  };
@@ -3,4 +3,8 @@ import styled from "styled-components";
3
3
  export const Container = styled.div`
4
4
  display: flex;
5
5
  justify-content: space-between;
6
+ .buttons-top {
7
+ display: flex;
8
+ align-items: center;
9
+ }
6
10
  `;
@@ -435,6 +435,7 @@ export const RetailerProductEdition = ({
435
435
  changeImage={setImages}
436
436
  selectedImages={selectedImages}
437
437
  setSelectedImages={setSelectedImages}
438
+ shotThd={shotThd}
438
439
  />
439
440
  ));
440
441
  };