contentoh-components-library 21.2.101 → 21.2.102

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 (122) hide show
  1. package/.env.development +5 -2
  2. package/.env.production +25 -25
  3. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
  4. package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
  5. package/dist/components/molecules/Dropdown/Dropdown.stories.js +96 -0
  6. package/dist/components/molecules/Dropdown/index.js +148 -0
  7. package/dist/components/molecules/Dropdown/styles.js +26 -0
  8. package/dist/components/molecules/HeaderTop/index.js +10 -5
  9. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  10. package/dist/components/organisms/OrderDetail/OrderDetail.stories.js +1 -1
  11. package/dist/components/organisms/OrderDetail/index.js +11 -20
  12. package/dist/components/organisms/OrderDetail/styles.js +1 -1
  13. package/dist/components/pages/ProviderProductEdition/index.js +2 -2
  14. package/dist/components/pages/RetailerProductEdition/index.js +2 -2
  15. package/dist/global-files/fonts.css +12 -0
  16. package/dist/global-files/variables.js +2 -0
  17. package/dist/index.js +254 -46
  18. package/package.json +12 -1
  19. package/src/assets/images/customSelect/starIcon.svg +14 -0
  20. package/{dist/assets/images/chatPopup → src/assets/images/defaultImages}/Spinner.gif +0 -0
  21. package/src/assets/images/defaultImages/notFound.svg +124 -0
  22. package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +47 -0
  23. package/src/components/atoms/ButtonFileChooser/index.js +69 -0
  24. package/src/components/atoms/ButtonFileChooser/styles.js +4 -0
  25. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +51 -0
  26. package/src/components/atoms/ButtonV2/index.js +79 -0
  27. package/src/components/atoms/ButtonV2/styles.js +195 -0
  28. package/src/components/atoms/CustomIcon/CustomIcon.stories.js +36 -0
  29. package/src/components/atoms/CustomIcon/index.js +41 -0
  30. package/src/components/atoms/CustomIcon/styles.js +85 -0
  31. package/src/components/atoms/IconFile/IconFile.stories.js +35 -0
  32. package/src/components/atoms/IconFile/index.js +119 -0
  33. package/src/components/atoms/IconFile/styles.js +67 -0
  34. package/src/components/atoms/Image/Image.stories.js +51 -0
  35. package/src/components/atoms/Image/index.js +55 -0
  36. package/src/components/atoms/Image/styles.js +34 -0
  37. package/src/components/atoms/ImageLink/ImageLink.stories.js +43 -0
  38. package/src/components/atoms/ImageLink/index.js +57 -0
  39. package/src/components/atoms/ImageLink/styles.js +30 -0
  40. package/src/components/atoms/ImagePreview/ImagePreview.stories.js +52 -0
  41. package/src/components/atoms/ImagePreview/index.js +191 -0
  42. package/src/components/atoms/ImagePreview/styles.js +77 -0
  43. package/src/components/atoms/InputText/InputText.stories.js +39 -0
  44. package/src/components/atoms/InputText/index.js +61 -0
  45. package/src/components/atoms/InputText/styles.js +89 -0
  46. package/src/components/atoms/NotFound/NotFound.stories.js +19 -0
  47. package/src/components/atoms/NotFound/index.js +52 -0
  48. package/src/components/atoms/NotFound/styles.js +55 -0
  49. package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +26 -0
  50. package/src/components/atoms/SelectItemV2/index.js +45 -0
  51. package/src/components/atoms/SelectItemV2/styles.js +55 -0
  52. package/src/components/atoms/Tooltip/Tooltip.stories.js +51 -0
  53. package/src/components/atoms/Tooltip/index.js +59 -0
  54. package/src/components/atoms/Tooltip/styles.js +42 -0
  55. package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +54 -0
  56. package/src/components/molecules/ButtonDownloadFile/index.js +111 -0
  57. package/src/components/molecules/ButtonDownloadFile/styles.js +66 -0
  58. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +20 -12
  59. package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
  60. package/src/components/molecules/Dropdown/Dropdown.stories.js +101 -0
  61. package/src/components/molecules/Dropdown/index.js +142 -0
  62. package/src/components/molecules/Dropdown/styles.js +75 -0
  63. package/src/components/molecules/HeaderTop/index.js +11 -6
  64. package/src/components/molecules/HeaderTop/styles.js +4 -0
  65. package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +46 -0
  66. package/src/components/molecules/ImageTooltip/index.js +62 -0
  67. package/src/components/molecules/ImageTooltip/styles.js +18 -0
  68. package/src/components/molecules/SelectV2/SelectV2.stories.js +114 -0
  69. package/src/components/molecules/SelectV2/index.js +332 -0
  70. package/src/components/molecules/SelectV2/styles.js +100 -0
  71. package/src/components/organisms/Chat/Chat.stories.js +199 -0
  72. package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +65 -0
  73. package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
  74. package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
  75. package/src/components/organisms/Chat/ChatLists/index.js +141 -0
  76. package/src/components/organisms/Chat/ChatLists/styles.js +162 -0
  77. package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +142 -0
  78. package/src/components/organisms/Chat/ContainerItems/index.js +549 -0
  79. package/src/components/organisms/Chat/ContainerItems/styles.js +328 -0
  80. package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +102 -0
  81. package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
  82. package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
  83. package/src/components/organisms/Chat/ContentChat/index.js +900 -0
  84. package/src/components/organisms/Chat/ContentChat/styles.js +41 -0
  85. package/src/components/organisms/Chat/Footer/Footer.stories.js +22 -0
  86. package/src/components/organisms/Chat/Footer/index.js +669 -0
  87. package/src/components/organisms/Chat/Footer/styles.js +286 -0
  88. package/src/components/organisms/Chat/Header/Header.stories.js +66 -0
  89. package/src/components/organisms/Chat/Header/index.js +94 -0
  90. package/src/components/organisms/Chat/Header/styles.js +49 -0
  91. package/src/components/organisms/Chat/index.js +294 -0
  92. package/src/components/organisms/Chat/styles.js +42 -0
  93. package/src/components/organisms/Modal/Modal.stories.js +55 -0
  94. package/src/components/organisms/Modal/index.js +97 -0
  95. package/src/components/organisms/Modal/styles.js +103 -0
  96. package/src/components/organisms/OrderDetail/OrderDetail.stories.js +1 -1
  97. package/src/components/organisms/OrderDetail/index.js +12 -19
  98. package/src/components/organisms/OrderDetail/styles.js +0 -1
  99. package/src/components/pages/ProviderProductEdition/index.js +2 -2
  100. package/src/components/pages/RetailerProductEdition/index.js +2 -2
  101. package/src/global-files/fonts.css +12 -0
  102. package/src/global-files/handle_http.js +231 -0
  103. package/src/global-files/utils.js +300 -0
  104. package/src/global-files/variables.js +2 -0
  105. package/src/index.js +16 -0
  106. package/dist/assets/images/chatPopup/close.svg +0 -3
  107. package/dist/assets/images/chatPopup/defaultImage.png +0 -0
  108. package/dist/assets/images/chatPopup/defaultProfile.png +0 -0
  109. package/dist/assets/images/chatPopup/doc.svg +0 -1
  110. package/dist/assets/images/chatPopup/document.svg +0 -1
  111. package/dist/assets/images/chatPopup/iconChat.svg +0 -19
  112. package/dist/assets/images/chatPopup/iconPlus.svg +0 -3
  113. package/dist/assets/images/chatPopup/pdf.svg +0 -75
  114. package/dist/assets/images/chatPopup/remove.svg +0 -4
  115. package/dist/assets/images/chatPopup/send.svg +0 -3
  116. package/dist/assets/images/chatPopup/svgIcon.svg +0 -109
  117. package/dist/assets/images/chatPopup/upload_file.svg +0 -3
  118. package/dist/assets/images/chatPopup/xls.svg +0 -53
  119. package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +0 -28
  120. package/dist/components/atoms/ChatPopUp/index.js +0 -841
  121. package/dist/components/atoms/ChatPopUp/styles.js +0 -27
  122. package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +0 -182
@@ -0,0 +1,141 @@
1
+ import { Container, ContainerItemChat, ContainerTooltip } from "./styles";
2
+ import { useEffect, useState } from "react";
3
+ import { getCustomDate } from "../../../../global-files/utils";
4
+ import { faImage as IconImage } from "@fortawesome/free-solid-svg-icons";
5
+ import { CustomIcon } from "../../../atoms/CustomIcon";
6
+ import { Image } from "../../../atoms/Image";
7
+ import { Tooltip } from "../../../atoms/Tooltip";
8
+
9
+ export const ChatLists = (props) => {
10
+ const {
11
+ companies /* {
12
+ id: { name , src , statusChat , items } ,
13
+ ...
14
+ } */,
15
+ currentCompanyId, // number
16
+ onClickCompany, // (id) => {}
17
+ } = props;
18
+ const [openChats, setOpenChats] = useState([]);
19
+ const [closedChats, setClosedChats] = useState([]);
20
+
21
+ useEffect(() => {
22
+ renderChats();
23
+ }, [companies]);
24
+
25
+ const renderChats = () => {
26
+ let jsxOpenChats = [];
27
+ let jsxClosedChats = [];
28
+
29
+ for (const companyId of Object.keys(companies)) {
30
+ const company = companies[companyId];
31
+ // crear el item chat
32
+ const itemChat = (
33
+ <ContainerItemChat
34
+ key={"itemChat-" + companyId}
35
+ onClick={(event) => {
36
+ onClickCompany && onClickCompany(companyId);
37
+ }}
38
+ >
39
+ {/* logo de la compañia */}
40
+ <Image
41
+ className="img-logoCompany"
42
+ width={"34px"}
43
+ sizeLoading={24}
44
+ colorLoading={undefined}
45
+ src={company.src}
46
+ componentDefault={
47
+ <CustomIcon
48
+ className="icon-logoCompany"
49
+ type={"white"}
50
+ borderType={"circle"}
51
+ size={15}
52
+ icon={IconImage}
53
+ />
54
+ }
55
+ />
56
+
57
+ {/* name y date */}
58
+ <div className="container-info">
59
+ <label className="label-name"> {company.name} </label>
60
+ <label className="label-lastDate">
61
+ {getCustomDate(
62
+ new Date(
63
+ company.items.length ? company.items[0].date : undefined
64
+ )
65
+ )}
66
+ </label>
67
+ </div>
68
+
69
+ {/* label interno */}
70
+ <div className="container-indicators">
71
+ {currentCompanyId == companyId && (
72
+ <div className="label-ownCompany">Interno</div>
73
+ )}
74
+ </div>
75
+ </ContainerItemChat>
76
+ );
77
+
78
+ // checar si es chat abierto
79
+ if (company.statusChat == "closed") jsxClosedChats.push(itemChat);
80
+ else jsxOpenChats.push(itemChat);
81
+ }
82
+ setOpenChats(jsxOpenChats);
83
+ setClosedChats(jsxClosedChats);
84
+ };
85
+
86
+ return (
87
+ <>
88
+ <Container>
89
+ {openChats.length !== 0 && (
90
+ <section>
91
+ <div className="container-headerChats">
92
+ <Tooltip
93
+ className={"tooltip-title"}
94
+ position={"topCenter"}
95
+ addArrow={false}
96
+ transitionType={"zoom"}
97
+ followCursor={false}
98
+ componentTooltip={
99
+ <ContainerTooltip>
100
+ <label className="label-title"> Chats abiertos </label>
101
+ <label className="label-message">{`De acuerdo al estatus
102
+ actual del producto, puedes establecer una conversación
103
+ con estas compañias`}</label>
104
+ </ContainerTooltip>
105
+ }
106
+ >
107
+ <label> Chats abiertos </label>
108
+ </Tooltip>
109
+ </div>
110
+ <div className="container-bodyChats">{openChats}</div>
111
+ </section>
112
+ )}
113
+
114
+ {closedChats.length !== 0 && (
115
+ <section>
116
+ <div className="container-headerChats">
117
+ <Tooltip
118
+ className={"tooltip-title"}
119
+ position={"topCenter"}
120
+ addArrow={false}
121
+ transitionType={"zoom"}
122
+ followCursor={false}
123
+ componentTooltip={
124
+ <ContainerTooltip>
125
+ <label className="label-title"> Chats cerrados </label>
126
+ <label className="label-message">{`Las conversaciones
127
+ con estas compañias han finalizado debido al cambio de
128
+ estatus, sigue el flujo de trabajo con tus chats abiertos`}</label>
129
+ </ContainerTooltip>
130
+ }
131
+ >
132
+ <label> Chats cerrados </label>
133
+ </Tooltip>
134
+ </div>
135
+ <div className="container-bodyChats">{closedChats}</div>
136
+ </section>
137
+ )}
138
+ </Container>
139
+ </>
140
+ );
141
+ };
@@ -0,0 +1,162 @@
1
+ import styled from "styled-components";
2
+ import { GlobalColors, FontFamily } from "../../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ width: 100%;
6
+ max-height: 100%;
7
+ flex-grow: 2;
8
+ display: flex;
9
+ flex-direction: column;
10
+ justify-content: flex-start;
11
+ gap: 30px;
12
+ background: white;
13
+ padding: 20px;
14
+ overflow: auto;
15
+ //border: 1px solid red;
16
+
17
+ section {
18
+ width: 100%;
19
+ display: flex;
20
+ flex-direction: column;
21
+ gap: 15px;
22
+
23
+ // container del nombre de la seccion con su icono info
24
+ .container-headerChats {
25
+ width: 100%;
26
+ display: flex;
27
+ flex-direction: row;
28
+ flex-wrap: nowrap;
29
+ align-items: center;
30
+ gap: 5px;
31
+
32
+ .tooltip-title {
33
+ max-width: 100%;
34
+
35
+ label {
36
+ font-family: ${FontFamily.RobotoMedium}, sans-serif;
37
+ font-size: 15px;
38
+ text-align: left;
39
+ color: #262626;
40
+ }
41
+ }
42
+ }
43
+
44
+ // container de la lista de los items chats de la seccion
45
+ .container-bodyChats {
46
+ width: 100%;
47
+ display: flex;
48
+ flex-direction: column;
49
+ gap: 10px;
50
+ }
51
+ }
52
+ `;
53
+
54
+ export const ContainerItemChat = styled.div`
55
+ width: 100%;
56
+ min-width: min-content;
57
+ display: flex;
58
+ flex-direction: row;
59
+ align-items: center;
60
+ justify-content: flex-start;
61
+ gap: 20px;
62
+ background: #f7f7fc;
63
+ padding: 15px;
64
+ border-radius: 10px;
65
+ cursor: pointer;
66
+ transition: background 0.25s;
67
+
68
+ * {
69
+ cursor: inherit;
70
+ }
71
+
72
+ // imagen del logo de la compañia
73
+ .img-logoCompany {
74
+ border-radius: 50%;
75
+ overflow: hidden;
76
+ height: 34px;
77
+ width: 34px;
78
+
79
+ .icon-logoCompany {
80
+ width: 100%;
81
+ height: 100%;
82
+ }
83
+ }
84
+
85
+ // container de las etiquetas "name" y "lastDate"
86
+ .container-info {
87
+ flex-grow: 2;
88
+ display: flex;
89
+ flex-direction: column;
90
+ align-items: flex-start;
91
+ gap: 4px;
92
+
93
+ .label-name {
94
+ font-family: ${FontFamily.RobotoMedium}, sans-serif;
95
+ font-size: 15px;
96
+ text-align: left;
97
+ color: #262626;
98
+ }
99
+ .label-lastDate {
100
+ font-family: ${FontFamily.RobotoRegular}, sans-serif;
101
+ font-size: 11px;
102
+ text-align: left;
103
+ color: #b3b3b3;
104
+ }
105
+ }
106
+
107
+ .container-indicators {
108
+ display: flex;
109
+ flex-direction: row;
110
+ align-items: center;
111
+ gap: 7px;
112
+
113
+ // label "Interno"
114
+ .label-ownCompany {
115
+ padding: 5px 10px;
116
+ border-radius: 3px;
117
+ font-family: ${FontFamily.RobotoRegular}, sans-serif;
118
+ font-size: 10px;
119
+ background-color: rgba(0, 0, 0, 0.05);
120
+ color: #707070;
121
+ }
122
+ }
123
+
124
+ // cuando el item chat tenga el cursor
125
+ &:hover {
126
+ background-color: #d7d7dd;
127
+
128
+ .container-info {
129
+ .label-lastDate {
130
+ color: #959292;
131
+ }
132
+ }
133
+
134
+ /*
135
+ .label-ownCompany {
136
+ background-color: ;
137
+ }*/
138
+ }
139
+ `;
140
+
141
+ // container con 2 labels "label-title" y "label-message"
142
+ export const ContainerTooltip = styled.div`
143
+ min-width: min-content;
144
+ display: flex;
145
+ flex-direction: column;
146
+ align-items: flex-start;
147
+ gap: 5px;
148
+ background: transparent;
149
+
150
+ .label-title {
151
+ font-family: ${FontFamily.RobotoMedium}, sans-serif;
152
+ font-size: 12px;
153
+ text-align: left;
154
+ color: #262626;
155
+ }
156
+ .label-message {
157
+ font-family: ${FontFamily.RobotoRegular}, sans-serif;
158
+ font-size: 11px;
159
+ text-align: left;
160
+ color: #262626;
161
+ }
162
+ `;
@@ -0,0 +1,142 @@
1
+ import { ContainerItems } from "./index";
2
+
3
+ export default {
4
+ title: "Components/organisms/Chat/ContainerItems",
5
+ component: ContainerItems,
6
+ };
7
+
8
+ const Template = (args) => <ContainerItems {...args} />;
9
+
10
+ // items de prueba
11
+ const items = {
12
+ 1: {
13
+ date: "2022-10-13 10:10:00",
14
+ type: "message",
15
+ value: "mensaje 1 user10",
16
+ userId: 10,
17
+ },
18
+ 2: {
19
+ date: "2022-10-12 13:19:00",
20
+ type: "message",
21
+ value: "mensaje 1 user20",
22
+ userId: 20,
23
+ },
24
+ 3: {
25
+ date: "2022-10-12 12:33:00",
26
+ type: "comment",
27
+ value: "comentario 1 user20",
28
+ userId: 20,
29
+ },
30
+ 4: {
31
+ date: "2022-10-12 11:56:00",
32
+ type: "comment",
33
+ value: "comentario 1 user30",
34
+ userId: 30,
35
+ },
36
+ 5: {
37
+ date: "2022-10-12 8:41:00",
38
+ type: "statusService",
39
+ value: "La sección imágenes ha sido validada",
40
+ userId: 20,
41
+ },
42
+ 6: {
43
+ date: "2022-10-11 14:58:00",
44
+ type: "img",
45
+ value: "84300/1/chat/playa-213f791b-d890-48e1-be19-28bf5a95d517.jpeg",
46
+ userId: 10,
47
+ },
48
+ 7: {
49
+ date: "2022-10-10 16:12:00",
50
+ type: "img",
51
+ value: `84300/1/chat/21dba1da-3c60-42c4-97bd-033664808256-fb19ff57-b91c-4ef2-ba2a-d857b55fb33b.svg`,
52
+ userId: 30,
53
+ },
54
+ 8: {
55
+ date: "2022-10-10 15:55:00",
56
+ type: "statusArticle",
57
+ value: "El estatus cambio a Aprobado Coordinador",
58
+ userId: 20,
59
+ },
60
+ 9: {
61
+ date: "2022-10-10 9:15:00",
62
+ type: "comment",
63
+ value: "comentario 1 user10",
64
+ userId: 10,
65
+ },
66
+ 10: {
67
+ date: "2022-10-9 6:24:00",
68
+ type: "file",
69
+ value:
70
+ "84300/1/chat/acuse RFC-8b2eb177-5bfc-4266-9b26-4e7297880594-9e2e5853-4697-442a-8ff7-3b7a1ede0856.pdf",
71
+ userId: 10,
72
+ },
73
+ 11: {
74
+ date: "2022-10-9 4:29:00",
75
+ type: "file",
76
+ value: "84300/1/chat/noExiste.docx",
77
+ userId: 30,
78
+ },
79
+ 12: {
80
+ date: "2022-10-9 2:39:00",
81
+ type: "file",
82
+ value: "84300/1/chat/noExiste2.xlsx",
83
+ userId: 20,
84
+ },
85
+ 13: {
86
+ date: "2022-10-8 23:46:00",
87
+ type: "file",
88
+ value: "84300/1/chat/noExiste3.csv",
89
+ userId: 20,
90
+ },
91
+ 14: {
92
+ date: "2022-10-8 23:22:00",
93
+ type: "file",
94
+ value: "84300/1/chat/noExiste4.pptx",
95
+ userId: 30,
96
+ },
97
+ 15: {
98
+ date: "2022-10-8 21:01:00",
99
+ type: "file",
100
+ value: "84300/1/chat/noExiste5.zip",
101
+ userId: 10,
102
+ },
103
+ 16: {
104
+ date: "2022-10-8 20:11:00",
105
+ type: "file",
106
+ value: "84300/1/chat/noExiste6.txt",
107
+ userId: 10,
108
+ },
109
+ };
110
+
111
+ // users de prueba
112
+ const users = {
113
+ 10: { name: "Pedro Castillo", companyId: 100 },
114
+ 20: { name: "Ana Carranza", companyId: 200 },
115
+ 30: { name: "Javier Aguayo", companyId: 100 },
116
+ };
117
+
118
+ // companies de prueba multiple
119
+ const companies = {
120
+ 100: { name: "Fábrica", statusChat: "enabled" },
121
+ 200: { name: "Proveedor", statusChat: "current" },
122
+ };
123
+
124
+ export const exampleChat = Template.bind({});
125
+ exampleChat.args = {
126
+ chatData: {
127
+ items,
128
+ users,
129
+ companies,
130
+ },
131
+ currentUser: { id: 10, companyId: 100 },
132
+ };
133
+
134
+ export const emptyChat = Template.bind({});
135
+ emptyChat.args = {
136
+ chatData: {
137
+ items: [],
138
+ users: [],
139
+ companies: [],
140
+ },
141
+ currentUser: { id: 10, companyId: 100 },
142
+ };