contentoh-components-library 21.3.28 → 21.3.30

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 +0 -3
  2. package/.env.production +3 -2
  3. package/dist/assets/images/generalButton/closeIcon.svg +2 -2
  4. package/dist/components/atoms/ProgressBar/index.js +6 -36
  5. package/dist/components/atoms/ProgressBar/styles.js +3 -11
  6. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
  7. package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
  8. package/dist/components/molecules/GalleryElement/index.js +1 -1
  9. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  10. package/dist/components/molecules/ProductNameHeader/index.js +4 -6
  11. package/dist/components/organisms/Chat/ContainerItems/index.js +13 -2
  12. package/dist/components/organisms/FullProductNameHeader/index.js +0 -1
  13. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +50 -65
  14. package/dist/components/pages/ProviderProductEdition/index.js +11 -17
  15. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -73
  16. package/dist/components/pages/RetailerProductEdition/index.js +14 -19
  17. package/dist/components/pages/RetailerProductEdition/utils.js +1 -1
  18. package/dist/global-files/data.js +23 -18
  19. package/dist/global-files/fonts.css +0 -6
  20. package/dist/global-files/variables.js +0 -2
  21. package/dist/index.js +46 -267
  22. package/package.json +1 -13
  23. package/src/assets/images/generalButton/closeIcon.svg +2 -2
  24. package/src/components/atoms/ProgressBar/index.js +5 -40
  25. package/src/components/atoms/ProgressBar/styles.js +0 -24
  26. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +12 -20
  27. package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
  28. package/src/components/molecules/GalleryElement/index.js +1 -1
  29. package/src/components/molecules/HeaderTop/styles.js +2 -5
  30. package/src/components/molecules/ProductNameHeader/index.js +2 -7
  31. package/src/components/organisms/FullProductNameHeader/index.js +0 -1
  32. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +49 -67
  33. package/src/components/pages/ProviderProductEdition/index.js +9 -16
  34. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -78
  35. package/src/components/pages/RetailerProductEdition/index.js +20 -18
  36. package/src/components/pages/RetailerProductEdition/utils.js +1 -2
  37. package/src/global-files/data.js +23 -18
  38. package/src/global-files/fonts.css +0 -6
  39. package/src/global-files/variables.js +0 -2
  40. package/src/index.js +0 -17
  41. package/src/assets/images/customSelect/starIcon.svg +0 -14
  42. package/src/assets/images/defaultImages/Spinner.gif +0 -0
  43. package/src/assets/images/defaultImages/notFound.svg +0 -124
  44. package/src/assets/sounds/newMessage.mp3 +0 -0
  45. package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -47
  46. package/src/components/atoms/ButtonFileChooser/index.js +0 -68
  47. package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
  48. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -53
  49. package/src/components/atoms/ButtonV2/index.js +0 -85
  50. package/src/components/atoms/ButtonV2/styles.js +0 -217
  51. package/src/components/atoms/CustomIcon/CustomIcon.stories.js +0 -36
  52. package/src/components/atoms/CustomIcon/index.js +0 -41
  53. package/src/components/atoms/CustomIcon/styles.js +0 -85
  54. package/src/components/atoms/IconFile/IconFile.stories.js +0 -35
  55. package/src/components/atoms/IconFile/index.js +0 -119
  56. package/src/components/atoms/IconFile/styles.js +0 -67
  57. package/src/components/atoms/Image/Image.stories.js +0 -51
  58. package/src/components/atoms/Image/index.js +0 -55
  59. package/src/components/atoms/Image/styles.js +0 -34
  60. package/src/components/atoms/ImageLink/ImageLink.stories.js +0 -43
  61. package/src/components/atoms/ImageLink/index.js +0 -57
  62. package/src/components/atoms/ImageLink/styles.js +0 -30
  63. package/src/components/atoms/ImagePreview/ImagePreview.stories.js +0 -52
  64. package/src/components/atoms/ImagePreview/index.js +0 -178
  65. package/src/components/atoms/ImagePreview/styles.js +0 -77
  66. package/src/components/atoms/InputText/InputText.stories.js +0 -39
  67. package/src/components/atoms/InputText/index.js +0 -61
  68. package/src/components/atoms/InputText/styles.js +0 -89
  69. package/src/components/atoms/NotFound/NotFound.stories.js +0 -19
  70. package/src/components/atoms/NotFound/index.js +0 -52
  71. package/src/components/atoms/NotFound/styles.js +0 -55
  72. package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -26
  73. package/src/components/atoms/SelectItemV2/index.js +0 -61
  74. package/src/components/atoms/SelectItemV2/styles.js +0 -90
  75. package/src/components/atoms/Tooltip/Tooltip.stories.js +0 -51
  76. package/src/components/atoms/Tooltip/index.js +0 -59
  77. package/src/components/atoms/Tooltip/styles.js +0 -42
  78. package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -54
  79. package/src/components/molecules/ButtonDownloadFile/index.js +0 -109
  80. package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
  81. package/src/components/molecules/Dropdown/Dropdown.stories.js +0 -103
  82. package/src/components/molecules/Dropdown/index.js +0 -150
  83. package/src/components/molecules/Dropdown/styles.js +0 -75
  84. package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -68
  85. package/src/components/molecules/ImageTooltip/index.js +0 -63
  86. package/src/components/molecules/ImageTooltip/styles.js +0 -18
  87. package/src/components/molecules/SelectV2/SelectV2.stories.js +0 -115
  88. package/src/components/molecules/SelectV2/index.js +0 -357
  89. package/src/components/molecules/SelectV2/styles.js +0 -105
  90. package/src/components/molecules/SelectV2/test.js +0 -60
  91. package/src/components/molecules/SelectV2/test.stories.js +0 -10
  92. package/src/components/organisms/Chat/Chat.stories.js +0 -149
  93. package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -65
  94. package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
  95. package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
  96. package/src/components/organisms/Chat/ChatLists/index.js +0 -141
  97. package/src/components/organisms/Chat/ChatLists/styles.js +0 -162
  98. package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -142
  99. package/src/components/organisms/Chat/ContainerItems/index.js +0 -513
  100. package/src/components/organisms/Chat/ContainerItems/styles.js +0 -348
  101. package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -102
  102. package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
  103. package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
  104. package/src/components/organisms/Chat/ContentChat/index.js +0 -922
  105. package/src/components/organisms/Chat/ContentChat/styles.js +0 -41
  106. package/src/components/organisms/Chat/Footer/Footer.stories.js +0 -22
  107. package/src/components/organisms/Chat/Footer/index.js +0 -661
  108. package/src/components/organisms/Chat/Footer/styles.js +0 -286
  109. package/src/components/organisms/Chat/Header/Header.stories.js +0 -66
  110. package/src/components/organisms/Chat/Header/index.js +0 -93
  111. package/src/components/organisms/Chat/Header/styles.js +0 -49
  112. package/src/components/organisms/Chat/index.js +0 -238
  113. package/src/components/organisms/Chat/styles.js +0 -42
  114. package/src/components/organisms/Modal/Modal.stories.js +0 -55
  115. package/src/components/organisms/Modal/index.js +0 -97
  116. package/src/components/organisms/Modal/styles.js +0 -103
  117. package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -16
  118. package/src/components/organisms/RangeCalendar/index.js +0 -121
  119. package/src/components/organisms/RangeCalendar/styles.js +0 -883
  120. package/src/global-files/handle_http.js +0 -225
  121. package/src/global-files/handle_userTech.js +0 -7
  122. package/src/global-files/utils.js +0 -330
@@ -1,65 +0,0 @@
1
- import { ChatLists } from "./index";
2
- import THD from "./THD.png";
3
- import Rotoplas from "./Rotoplas.jpeg";
4
-
5
- export default {
6
- title: "Components/organisms/Chat/ChatLists",
7
- component: ChatLists,
8
- };
9
-
10
- const Template = (args) => <ChatLists {...args} />;
11
-
12
- // companies de prueba
13
- const companies = {
14
- 200: {
15
- name: "The Home Depot",
16
- src: THD,
17
- lastChatDate: "2022-11-4 21:01:00",
18
- statusChat: "disabled",
19
- },
20
- 300: {
21
- name: "Rotoplas",
22
- src: Rotoplas,
23
- lastChatDate: "2022-11-03 21:01:00",
24
- statusChat: "enabled",
25
- },
26
- 100: {
27
- name: "Content-oh!",
28
- src: "",
29
- lastChatDate: "2022-11-02 21:01:00",
30
- statusChat: "current",
31
- },
32
- };
33
- // companies de prueba sin chats cerrados
34
- const companies2 = {
35
- 300: {
36
- name: "Rotoplas",
37
- src: Rotoplas,
38
- lastChatDate: "2022-10-27 21:01:00",
39
- statusChat: "enabled",
40
- },
41
- 100: {
42
- name: "Content-oh!",
43
- src: "",
44
- lastChatDate: "2022-9-27 21:01:00",
45
- statusChat: "current",
46
- },
47
- };
48
-
49
- export const exampleChatLists = Template.bind({});
50
- exampleChatLists.args = {
51
- companies,
52
- currentCompanyId: 100,
53
- onClickCompany: (companyId) => {
54
- console.log("click en company:", companyId);
55
- },
56
- };
57
-
58
- export const onlyOpenChatLists = Template.bind({});
59
- onlyOpenChatLists.args = {
60
- companies: companies2,
61
- currentCompanyId: 100,
62
- onClickCompany: (companyId) => {
63
- console.log("click en company:", companyId);
64
- },
65
- };
@@ -1,141 +0,0 @@
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
- };
@@ -1,162 +0,0 @@
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
- `;
@@ -1,142 +0,0 @@
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
- };