contentoh-components-library 21.0.28 → 21.0.31

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 (213) hide show
  1. package/.env.development +18 -3
  2. package/.env.production +16 -1
  3. package/CHANGELOG.md +31 -33
  4. package/dist/assets/images/generalButton/downloadIcon.svg +3 -0
  5. package/dist/assets/images/modalsSVGs/attributesSent.svg +208 -0
  6. package/dist/assets/images/modalsSVGs/descriptionSent.svg +237 -0
  7. package/dist/assets/images/modalsSVGs/providerSent.svg +445 -0
  8. package/dist/assets/images/modalsSVGs/uploadingImages.svg +148 -0
  9. package/dist/components/atoms/AsignationOption/index.js +9 -5
  10. package/dist/components/atoms/AsignationOption/styles.js +1 -1
  11. package/dist/components/{molecules/SignInLogin/SignInLogin.stories.js → atoms/CharCounter/CharCounter.stories.js} +10 -7
  12. package/dist/components/atoms/CharCounter/index.js +22 -0
  13. package/dist/components/{molecules/ApproveRejetPanel → atoms/CharCounter}/styles.js +3 -1
  14. package/dist/components/atoms/CheckBox/index.js +4 -2
  15. package/dist/components/atoms/Commentary/Commentary.stories.js +1 -0
  16. package/dist/components/atoms/Commentary/index.js +23 -0
  17. package/dist/components/atoms/{VerticalSideMenuMainPage → Commentary}/styles.js +6 -1
  18. package/dist/components/atoms/GeneralButton/index.js +5 -0
  19. package/dist/components/atoms/GeneralButton/styles.js +4 -2
  20. package/dist/components/atoms/GeneralInput/index.js +73 -24
  21. package/dist/components/atoms/GeneralInput/styles.js +7 -1
  22. package/dist/components/atoms/GenericModal/index.js +4 -2
  23. package/dist/components/atoms/GenericModal/styles.js +1 -1
  24. package/dist/components/atoms/Input/index.js +26 -0
  25. package/dist/components/atoms/Input/style.js +26 -0
  26. package/dist/components/{organisms/ChangePassword/ChangePassword.stories.js → atoms/InputFormatter/Wysiwyg.stories.js} +9 -7
  27. package/dist/components/atoms/InputFormatter/index.js +185 -0
  28. package/dist/components/atoms/InputFormatter/styles.js +33 -0
  29. package/dist/components/atoms/LabelToInput/index.js +53 -0
  30. package/dist/components/atoms/LabelToInput/style.js +22 -0
  31. package/dist/components/atoms/Loading/index.js +1 -2
  32. package/dist/components/atoms/Loading/styles.js +8 -4
  33. package/dist/components/atoms/Percent/Percent.stories.js +39 -0
  34. package/dist/components/atoms/Percent/index.js +39 -0
  35. package/dist/components/atoms/Percent/styles.js +20 -0
  36. package/dist/components/atoms/PriorityFlag/index.js +1 -1
  37. package/dist/components/atoms/ProductImage/styles.js +1 -1
  38. package/dist/components/atoms/ProgressBar/index.js +2 -2
  39. package/dist/components/atoms/ProgressBar/styles.js +3 -5
  40. package/dist/components/atoms/ScreenHeader/index.js +1 -1
  41. package/dist/components/atoms/ScreenHeader/styles.js +1 -1
  42. package/dist/components/atoms/Select/index.js +39 -0
  43. package/dist/components/atoms/Select/style.js +32 -0
  44. package/dist/components/atoms/StatusTag/index.js +37 -2
  45. package/dist/components/atoms/StatusTag/styles.js +1 -1
  46. package/dist/components/atoms/ValidationPanel/index.js +4 -3
  47. package/dist/components/molecules/AvatarAndValidation/index.js +17 -7
  48. package/dist/components/molecules/AvatarAndValidation/styles.js +1 -1
  49. package/dist/components/molecules/CarouselImagesLogin/index.js +42 -40
  50. package/dist/components/molecules/FeaturesBar/index.js +1 -1
  51. package/dist/components/molecules/GalleryElement/index.js +80 -21
  52. package/dist/components/molecules/GalleryElement/styles.js +1 -1
  53. package/dist/components/molecules/GalleryHeader/index.js +28 -6
  54. package/dist/components/molecules/GalleryHeader/styles.js +1 -1
  55. package/dist/components/molecules/ImageSelector/index.js +2 -4
  56. package/dist/components/molecules/ProductNameHeader/index.js +1 -2
  57. package/dist/components/molecules/RetailerSelector/RetailerSelector.stories.js +48 -0
  58. package/dist/components/molecules/RetailerSelector/index.js +74 -0
  59. package/dist/components/{atoms/MenuCommercialRetailers → molecules/RetailerSelector}/styles.js +1 -1
  60. package/dist/components/molecules/StatusAsignationInfo/index.js +46 -25
  61. package/dist/components/molecules/StatusAsignationInfo/styles.js +1 -1
  62. package/dist/components/molecules/TableHeader/index.js +12 -5
  63. package/dist/components/molecules/TableHeader/styles.js +1 -1
  64. package/dist/components/molecules/TagAndInput/index.js +26 -2
  65. package/dist/components/molecules/TextAndGradient/TextAndGradient.stories.js +31 -0
  66. package/dist/components/molecules/TextAndGradient/index.js +36 -0
  67. package/dist/components/molecules/TextAndGradient/styles.js +18 -0
  68. package/dist/components/organisms/FullProductNameHeader/index.js +32 -8
  69. package/dist/components/organisms/FullTabsMenu/index.js +18 -5
  70. package/dist/components/organisms/ImageDataTable/index.js +90 -14
  71. package/dist/components/organisms/InputGroup/index.js +34 -13
  72. package/dist/components/organisms/InputGroup/styles.js +1 -1
  73. package/dist/components/organisms/ProductImageModal/index.js +15 -11
  74. package/dist/components/organisms/ProductImageModal/styles.js +1 -1
  75. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +109 -347
  76. package/dist/components/pages/RetailerProductEdition/index.js +1589 -59
  77. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  78. package/dist/global-files/data.js +212 -53
  79. package/dist/global-files/global-styles.css +1 -0
  80. package/dist/global-files/variables.js +1 -0
  81. package/dist/index.js +30 -238
  82. package/package.json +12 -10
  83. package/src/assets/images/generalButton/downloadIcon.svg +3 -0
  84. package/src/assets/images/modalsSVGs/attributesSent.svg +208 -0
  85. package/src/assets/images/modalsSVGs/descriptionSent.svg +237 -0
  86. package/src/assets/images/modalsSVGs/providerSent.svg +445 -0
  87. package/src/assets/images/modalsSVGs/uploadingImages.svg +148 -0
  88. package/src/components/atoms/AsignationOption/index.js +7 -5
  89. package/src/components/atoms/AsignationOption/styles.js +9 -1
  90. package/src/components/atoms/CharCounter/CharCounter.stories.js +11 -0
  91. package/src/components/atoms/CharCounter/index.js +13 -0
  92. package/src/components/atoms/CharCounter/styles.js +10 -0
  93. package/src/components/atoms/CheckBox/index.js +8 -2
  94. package/src/components/atoms/Commentary/Commentary.stories.js +0 -0
  95. package/src/components/atoms/Commentary/index.js +9 -0
  96. package/src/components/atoms/Commentary/styles.js +16 -0
  97. package/src/components/atoms/GeneralButton/index.js +9 -2
  98. package/src/components/atoms/GeneralButton/styles.js +23 -0
  99. package/src/components/atoms/GeneralInput/index.js +71 -21
  100. package/src/components/atoms/GeneralInput/styles.js +11 -1
  101. package/src/components/atoms/GenericModal/index.js +2 -2
  102. package/src/components/atoms/GenericModal/styles.js +10 -2
  103. package/src/components/atoms/Input/index.js +15 -0
  104. package/src/components/atoms/Input/style.js +31 -0
  105. package/src/components/atoms/InputFormatter/Wysiwyg.stories.js +12 -0
  106. package/src/components/atoms/InputFormatter/index.js +141 -0
  107. package/src/components/atoms/InputFormatter/styles.js +40 -0
  108. package/src/components/atoms/LabelToInput/index.js +26 -0
  109. package/src/components/atoms/LabelToInput/style.js +41 -0
  110. package/src/components/atoms/Loading/index.js +4 -5
  111. package/src/components/atoms/Loading/styles.js +43 -43
  112. package/src/components/atoms/PriorityFlag/index.js +1 -1
  113. package/src/components/atoms/ProductImage/styles.js +1 -1
  114. package/src/components/atoms/ProgressBar/index.js +2 -2
  115. package/src/components/atoms/ProgressBar/styles.js +54 -3
  116. package/src/components/atoms/ScreenHeader/index.js +7 -3
  117. package/src/components/atoms/ScreenHeader/styles.js +9 -2
  118. package/src/components/atoms/Select/index.js +35 -0
  119. package/src/components/atoms/Select/style.js +76 -0
  120. package/src/components/atoms/StatusTag/index.js +30 -2
  121. package/src/components/atoms/StatusTag/styles.js +15 -3
  122. package/src/components/atoms/ValidationPanel/index.js +3 -3
  123. package/src/components/molecules/AvatarAndValidation/index.js +24 -6
  124. package/src/components/molecules/AvatarAndValidation/styles.js +1 -1
  125. package/src/components/molecules/CarouselImagesLogin/index.js +37 -34
  126. package/src/components/molecules/FeaturesBar/index.js +10 -7
  127. package/src/components/molecules/GalleryElement/index.js +75 -36
  128. package/src/components/molecules/GalleryElement/styles.js +38 -11
  129. package/src/components/molecules/GalleryHeader/index.js +14 -8
  130. package/src/components/molecules/GalleryHeader/styles.js +16 -0
  131. package/src/components/molecules/ImageSelector/index.js +2 -3
  132. package/src/components/molecules/ProductNameHeader/index.js +1 -2
  133. package/src/components/molecules/RetailerSelector/RetailerSelector.stories.js +35 -0
  134. package/src/components/molecules/RetailerSelector/index.js +63 -0
  135. package/src/components/molecules/RetailerSelector/styles.js +18 -0
  136. package/src/components/molecules/StatusAsignationInfo/index.js +62 -38
  137. package/src/components/molecules/StatusAsignationInfo/styles.js +12 -2
  138. package/src/components/molecules/TableHeader/index.js +16 -3
  139. package/src/components/molecules/TableHeader/styles.js +5 -0
  140. package/src/components/molecules/TagAndInput/index.js +24 -0
  141. package/src/components/organisms/FullProductNameHeader/index.js +28 -7
  142. package/src/components/organisms/FullTabsMenu/index.js +15 -3
  143. package/src/components/organisms/ImageDataTable/index.js +89 -11
  144. package/src/components/organisms/InputGroup/index.js +46 -11
  145. package/src/components/organisms/InputGroup/styles.js +3 -0
  146. package/src/components/organisms/ProductImageModal/index.js +20 -12
  147. package/src/components/organisms/ProductImageModal/styles.js +3 -0
  148. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +117 -343
  149. package/src/components/pages/RetailerProductEdition/index.js +1225 -46
  150. package/src/components/pages/RetailerProductEdition/styles.js +67 -4
  151. package/src/global-files/data.js +156 -57
  152. package/src/global-files/global-styles.css +1 -0
  153. package/src/global-files/variables.js +1 -0
  154. package/src/index.js +1 -17
  155. package/dist/assets/images/carouselImagesLogin/login2.svg +0 -117
  156. package/dist/assets/images/carouselImagesLogin/login3.svg +0 -147
  157. package/dist/assets/images/carouselImagesLogin/loginImage.svg +0 -301
  158. package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +0 -36
  159. package/dist/components/atoms/ListCommercialRetailers/index.js +0 -64
  160. package/dist/components/atoms/ListCommercialRetailers/styles.js +0 -20
  161. package/dist/components/atoms/Loading/Loading.stories.js +0 -28
  162. package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +0 -37
  163. package/dist/components/atoms/MenuCommercialRetailers/index.js +0 -25
  164. package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +0 -28
  165. package/dist/components/atoms/MenuProductImage/index.js +0 -88
  166. package/dist/components/atoms/MenuProductImage/styles.js +0 -20
  167. package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +0 -22
  168. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +0 -49
  169. package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +0 -25
  170. package/dist/components/molecules/ApproveRejetPanel/index.js +0 -49
  171. package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +0 -28
  172. package/dist/components/molecules/EmailResetPasswordLogin/index.js +0 -159
  173. package/dist/components/molecules/EmailResetPasswordLogin/styles.js +0 -20
  174. package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +0 -28
  175. package/dist/components/molecules/RegistrationFirstStep/index.js +0 -371
  176. package/dist/components/molecules/RegistrationFirstStep/styles.js +0 -20
  177. package/dist/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +0 -28
  178. package/dist/components/molecules/RegistrationSecondStep/index.js +0 -156
  179. package/dist/components/molecules/RegistrationSecondStep/styles.js +0 -20
  180. package/dist/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +0 -28
  181. package/dist/components/molecules/RegistrationThirdStep/index.js +0 -161
  182. package/dist/components/molecules/RegistrationThirdStep/styles.js +0 -20
  183. package/dist/components/molecules/SignInLogin/index.js +0 -292
  184. package/dist/components/molecules/SignInLogin/styles.js +0 -20
  185. package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +0 -28
  186. package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +0 -104
  187. package/dist/components/molecules/VerificationCodeResetPasswordLogin/styles.js +0 -20
  188. package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +0 -69
  189. package/dist/components/organisms/ChangePassword/index.js +0 -113
  190. package/dist/components/organisms/ChangePassword/styles.js +0 -18
  191. package/src/components/atoms/Loading/Loading.stories.js +0 -10
  192. package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +0 -11
  193. package/src/components/molecules/EmailResetPasswordLogin/index.js +0 -87
  194. package/src/components/molecules/EmailResetPasswordLogin/styles.js +0 -23
  195. package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +0 -11
  196. package/src/components/molecules/RegistrationFirstStep/index.js +0 -259
  197. package/src/components/molecules/RegistrationFirstStep/styles.js +0 -81
  198. package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +0 -11
  199. package/src/components/molecules/RegistrationSecondStep/index.js +0 -97
  200. package/src/components/molecules/RegistrationSecondStep/styles.js +0 -59
  201. package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +0 -11
  202. package/src/components/molecules/RegistrationThirdStep/index.js +0 -109
  203. package/src/components/molecules/RegistrationThirdStep/styles.js +0 -44
  204. package/src/components/molecules/SignInLogin/SignInLogin.stories.js +0 -11
  205. package/src/components/molecules/SignInLogin/index.js +0 -205
  206. package/src/components/molecules/SignInLogin/styles.js +0 -78
  207. package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +0 -11
  208. package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +0 -78
  209. package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +0 -49
  210. package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +0 -56
  211. package/src/components/organisms/ChangePassword/ChangePassword.stories.js +0 -11
  212. package/src/components/organisms/ChangePassword/index.js +0 -63
  213. package/src/components/organisms/ChangePassword/styles.js +0 -16
@@ -0,0 +1,12 @@
1
+ import { InputFormatter } from "./index";
2
+
3
+ export default {
4
+ title: "Components/atoms/InputFormatter",
5
+ component: InputFormatter,
6
+ };
7
+
8
+ const Template = (args) => <InputFormatter {...args} />;
9
+
10
+ export const DefaultInputFormatter = Template.bind({});
11
+
12
+ DefaultInputFormatter.args = { text: "hola mundo" };
@@ -0,0 +1,141 @@
1
+ import ReactQuill from "react-quill";
2
+ import "react-quill/dist/quill.snow.css";
3
+ import { useEffect, useState } from "react";
4
+ import { Container } from "./styles";
5
+
6
+ export const InputFormatter = ({
7
+ mainValue = "",
8
+ inputId,
9
+ articleId,
10
+ updatedDescriptions,
11
+ setUpdatedDescriptions,
12
+ addTextAreaToArray,
13
+ name,
14
+ isRequired,
15
+ maxChar,
16
+ }) => {
17
+ const [inputValue, setInputValue] = useState(mainValue);
18
+ const [selection, setSelection] = useState(false);
19
+ const [position, setPosition] = useState({ left: 0, top: 0 });
20
+ const [charsCounter, setCharsCounter] = useState(0);
21
+ const [quillState, setQuillState] = useState({});
22
+ const maxLength = maxChar ? maxChar : 999;
23
+
24
+ const getValue = (value) => {
25
+ let temp = value.replace(/\n/gm, "<br>");
26
+ return temp;
27
+ };
28
+
29
+ //const quillRef = useRef();
30
+ const setQuill = (ref) => {
31
+ if (!ref || ref === null) return;
32
+ if (typeof ref.getEditor !== "function") return;
33
+ setQuillState(ref.getEditor());
34
+ };
35
+
36
+ const valueFormater = (value) => {
37
+ return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "");
38
+ };
39
+
40
+ const onChange = (valueInput, delta, user, h) => {
41
+ let value = "";
42
+ try {
43
+ if (h.getLength() - 1 <= maxLength) {
44
+ setInputValue(
45
+ (val) => (val = valueInput.replace(/<\/?span.*?>/gm, ""))
46
+ );
47
+ value = valueInput;
48
+ } else {
49
+ quillState.deleteText(maxLength, quillState.getLength());
50
+ setInputValue((val) => (val = quillState.getText()));
51
+ value = quillState.getText();
52
+ }
53
+ } catch (error) {
54
+ console.log(error);
55
+ }
56
+ setCharsCounter(h.getLength() - 1);
57
+ value = valueFormater(value);
58
+
59
+ let idInput = inputId;
60
+ let dataSave = updatedDescriptions.slice();
61
+ if (dataSave.length > 0) {
62
+ if (dataSave.filter((e) => e.attributeId === idInput).length > 0) {
63
+ dataSave.forEach((e) => {
64
+ if (e.attributeId === idInput) {
65
+ e.value = value;
66
+ }
67
+ });
68
+ } else {
69
+ dataSave.push({
70
+ articleId: articleId,
71
+ attributeId: idInput,
72
+ value: value,
73
+ });
74
+ }
75
+ } else {
76
+ dataSave.push({
77
+ articleId: articleId,
78
+ attributeId: idInput,
79
+ value: value,
80
+ });
81
+ }
82
+ setUpdatedDescriptions(dataSave);
83
+ };
84
+
85
+ const getSelection = (range, a, b) => {
86
+ //getBounds(index,length)
87
+ const selected = b.getSelection();
88
+ const bounds = b.getBounds(selected?.index || 0, selected?.length || 0);
89
+ if (a === "user") {
90
+ setPosition({ left: bounds.left, top: bounds.top });
91
+ setSelection(selected?.length > 0);
92
+ }
93
+ };
94
+
95
+ return (
96
+ <Container
97
+ isRequired={
98
+ isRequired &&
99
+ (inputValue.replace(/<.*?>/gm, "").length === 0 || !inputValue)
100
+ }
101
+ selection={selection}
102
+ position={position}
103
+ >
104
+ <ReactQuill
105
+ id={inputId + ""}
106
+ ref={(el) => setQuill(el)}
107
+ value={getValue(inputValue)}
108
+ //disabled={!props.enableInputs}
109
+ modules={{ toolbar: ["bold"] }}
110
+ onKeyPress={(e) => {
111
+ if (charsCounter >= maxLength && e.key !== "Backspace") {
112
+ e.preventDefault();
113
+ }
114
+ }}
115
+ onKeyDown={(e) => {
116
+ let keysArray = [
117
+ "Backspace",
118
+ "Meta",
119
+ "ArrowLeft",
120
+ "ArrowRight",
121
+ "ArrowUp",
122
+ "ArrowDown",
123
+ ];
124
+ if (
125
+ charsCounter >= maxLength &&
126
+ keysArray.every((key) => e.key !== key)
127
+ ) {
128
+ e.preventDefault();
129
+ }
130
+ }}
131
+ onChange={(valueInput, user, range, h) => {
132
+ onChange(valueInput, user, range, h);
133
+ }}
134
+ onChangeSelection={getSelection}
135
+ />
136
+ <p className="description-limit">
137
+ {charsCounter}/{maxLength}
138
+ </p>
139
+ </Container>
140
+ );
141
+ };
@@ -0,0 +1,40 @@
1
+ import styled from "styled-components";
2
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ .quill {
6
+ border: 1px solid
7
+ ${({ focus, isRequired }) =>
8
+ focus ? GlobalColors.magenta_s2 : isRequired ? "red" : GlobalColors.s3};
9
+ position: relative;
10
+ border-radius: 2px;
11
+
12
+ .ql-toolbar {
13
+ background-color: ${GlobalColors.s2};
14
+ position: absolute;
15
+ z-index: 10;
16
+ border: 1px solid ${GlobalColors.s3};
17
+ width: 45px;
18
+ height: 45px;
19
+ border-radius: 4px;
20
+ visibility: ${({ selection }) => (selection ? "visible" : "hidden")};
21
+ top: ${({ position }) => position.top}px;
22
+ left: ${({ position }) => position.left}px;
23
+ }
24
+
25
+ .ql-container {
26
+ border: none;
27
+ font-family: ${FontFamily.AvenirNext};
28
+ color: ${GlobalColors.s4};
29
+ strong {
30
+ font-family: ${FontFamily.Raleway_900};
31
+ }
32
+ }
33
+ }
34
+ .description-limit {
35
+ font-size: 12px;
36
+ font-family: ${FontFamily.AvenirNext};
37
+ color: ${GlobalColors.s4};
38
+ text-align: right;
39
+ }
40
+ `;
@@ -0,0 +1,26 @@
1
+ import React, { useState, useEffect } from "react";
2
+ import { MainContainer } from "./style";
3
+ import Input from "../Input";
4
+
5
+ export default function LabelToInput(props) {
6
+ const [isActive, setIsActive] = useState(false);
7
+ const [defaultValue, setDefaultValue] = useState("");
8
+ useEffect(() => {
9
+ setDefaultValue(props.defaultValue === "" ? "-" : props.defaultValue);
10
+ }, [props.defaultValue]);
11
+ return (
12
+ <MainContainer width={props.width} error={!isActive && props.error}>
13
+ {!isActive ? (
14
+ <p onClick={() => setIsActive(true)}>{defaultValue}</p>
15
+ ) : (
16
+ <Input
17
+ {...props}
18
+ onBlur={() => {
19
+ props.onBlur && props.onBlur();
20
+ setIsActive(false);
21
+ }}
22
+ />
23
+ )}
24
+ </MainContainer>
25
+ );
26
+ }
@@ -0,0 +1,41 @@
1
+ import styled from "styled-components";
2
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
3
+
4
+ export const MainContainer = styled.div`
5
+ display: flex;
6
+ align-items: center;
7
+ width: fit-content;
8
+ height: 20px;
9
+ box-sizing: border-box;
10
+ border-radius: 2px;
11
+ margin-left: auto;
12
+ white-space: nowrap;
13
+ overflow-x: auto;
14
+ overflow-y: hidden;
15
+
16
+ & > p {
17
+ font-family: ${FontFamily.AvenirNext};
18
+ font-weight: 400;
19
+ font-size: 11px;
20
+ line-height: 19px;
21
+ color: ${GlobalColors.s5};
22
+ background-color: ${GlobalColors.s2};
23
+ padding: 1px 3px;
24
+ border-radius: 3px;
25
+ min-width: 50px;
26
+ height: 21px;
27
+ text-align: center;
28
+ }
29
+ border: ${(props) => props.error && "1px solid red"};
30
+ ::-webkit-scrollbar {
31
+ width: 3px;
32
+ height: 3px;
33
+ }
34
+ ::-webkit-scrollbar-track {
35
+ background: #f1f1f1;
36
+ }
37
+ ::-webkit-scrollbar-thumb {
38
+ background: #d4d1d7;
39
+ border-radius: 3px;
40
+ }
41
+ `;
@@ -1,13 +1,12 @@
1
- import { Container } from "./styles";
2
-
1
+ import { Container, Loader } from "./styles";
3
2
  export const Loading = () => {
4
3
  return (
5
- <Container >
6
- <div className="loader">
4
+ <Container>
5
+ <Loader>
7
6
  <span className="first"></span>
8
7
  <span className="second"></span>
9
8
  <span className="third"></span>
10
- </div>
9
+ </Loader>
11
10
  </Container>
12
11
  );
13
12
  };
@@ -6,52 +6,52 @@ export const Container = styled.div`
6
6
  align-items: center;
7
7
  height: 100%;
8
8
  width: 100%;
9
- .loader {
10
- display: flex;
11
- justify-content: center;
12
- align-items: center;
13
- height: 100%;
14
- width: 100%;
15
- span {
16
- display: inline-block;
17
- border-radius: 100%;
18
- margin-left: 5px;
19
- opacity: 1;
20
- }
21
- .first {
22
- background-color: #ff75cf;
23
- }
24
- .second {
25
- background-color: #e33aa9;
26
- }
27
- .third {
28
- background-color: #b12d84;
29
- }
30
- span:nth-child(1) {
31
- width: 16px;
32
- height: 16px;
33
- animation: opacitychange 1s ease-in-out infinite;
34
- }
35
- span:nth-child(2) {
36
- width: 18px;
37
- height: 18px;
9
+ `;
10
+ export const Loader = styled.div`
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
14
+ height: 100%;
15
+ width: 100%;
16
+ span {
17
+ display: inline-block;
18
+ border-radius: 100%;
19
+ margin: 35px 5px;
20
+ opacity: 1;
21
+ }
22
+ .first {
23
+ background-color: #ff75cf;
24
+ }
25
+ .second {
26
+ background-color: #e33aa9;
27
+ }
28
+ .third {
29
+ background-color: #b12d84;
30
+ }
31
+ span:nth-child(1) {
32
+ width: 16px;
33
+ height: 16px;
34
+ animation: opacitychange 1s ease-in-out infinite;
35
+ }
36
+ span:nth-child(2) {
37
+ width: 18px;
38
+ height: 18px;
38
39
 
39
- animation: opacitychange 1s ease-in-out 0.33s infinite;
40
- }
41
- span:nth-child(3) {
42
- width: 20px;
43
- height: 20px;
40
+ animation: opacitychange 1s ease-in-out 0.33s infinite;
41
+ }
42
+ span:nth-child(3) {
43
+ width: 20px;
44
+ height: 20px;
44
45
 
45
- animation: opacitychange 1s ease-in-out 0.66s infinite;
46
+ animation: opacitychange 1s ease-in-out 0.66s infinite;
47
+ }
48
+ @keyframes opacitychange {
49
+ 0%,
50
+ 100% {
51
+ opacity: 0;
46
52
  }
47
- @keyframes opacitychange {
48
- 0%,
49
- 100% {
50
- opacity: 0;
51
- }
52
- 60% {
53
- opacity: 1;
54
- }
53
+ 60% {
54
+ opacity: 1;
55
55
  }
56
56
  }
57
57
  `;
@@ -6,7 +6,7 @@ import low from "../../../assets/images/flags/lowPriority.svg";
6
6
 
7
7
  export const PriorityFlag = ({ priority }) => {
8
8
  const PriorityFlags = {
9
- ["no priority"]: without,
9
+ ["none"]: without,
10
10
  ["low"]: low,
11
11
  ["medium"]: medium,
12
12
  ["high"]: high,
@@ -4,7 +4,7 @@ export const Container = styled.div`
4
4
  width: fit-content;
5
5
 
6
6
  img {
7
- object-fit: cover;
7
+ object-fit: contain;
8
8
  }
9
9
 
10
10
  &.carousel-image {
@@ -1,8 +1,8 @@
1
1
  import { Container } from "./styles";
2
2
 
3
- export const ProgressBar = ({ percent, backgroundColor }) => {
3
+ export const ProgressBar = ({ percent, progressBarType }) => {
4
4
  return (
5
- <Container backgroundColor={backgroundColor}>
5
+ <Container className={`status-${progressBarType}`}>
6
6
  <p>{percent}%</p>
7
7
  </Container>
8
8
  );
@@ -2,7 +2,7 @@ import styled from "styled-components";
2
2
  import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
3
 
4
4
  export const Container = styled.div`
5
- background-color: ${(props) => GlobalColors[props.backgroundColor]};
5
+ background-color: ${GlobalColors.s3};
6
6
  width: fit-content;
7
7
  height: 27px;
8
8
  padding: 4px;
@@ -11,8 +11,59 @@ export const Container = styled.div`
11
11
  font-weight: 600;
12
12
  font-size: 14px;
13
13
  line-height: 19px;
14
- color: ${(props) =>
15
- props.backgroundColor === "s2" || props.backgroundColor === "s1"
14
+ color: ${(backgroundColor) =>
15
+ backgroundColor === "s2" || backgroundColor === "s1"
16
16
  ? GlobalColors.s4
17
17
  : GlobalColors.white};
18
+
19
+ &.status-As,
20
+ &.status-P {
21
+ background-color: ${GlobalColors.in_progress};
22
+ }
23
+
24
+ &.status-Pr,
25
+ &.status-Rr {
26
+ background-color: ${GlobalColors.reception};
27
+ }
28
+
29
+ &.status-AA,
30
+ &.status-AP,
31
+ &.status-AC,
32
+ &.status-AF {
33
+ background-color: ${GlobalColors.finished};
34
+ }
35
+
36
+ &.status-RA,
37
+ &.status-RF,
38
+ &.status-RP,
39
+ &.status-RC {
40
+ background-color: ${GlobalColors.rejected_status};
41
+ }
42
+
43
+ &.status-Dat,
44
+ &.status-Dsc,
45
+ &.status-Imgs {
46
+ background-color: ${GlobalColors.s4};
47
+ }
48
+
49
+ &.status-Ex {
50
+ background-color: ${GlobalColors.exported};
51
+ }
52
+
53
+ &.status-DDI {
54
+ background-color: ${GlobalColors.original_purpura};
55
+ }
56
+
57
+ &.status-GLD {
58
+ background-color: ${GlobalColors.in_progress};
59
+ }
60
+
61
+ &.status-TAB {
62
+ background-color: ${GlobalColors.deep_gray};
63
+ }
64
+
65
+ &.status-Pt {
66
+ background-color: ${GlobalColors.s2};
67
+ color: ${GlobalColors.s4};
68
+ }
18
69
  `;
@@ -8,12 +8,16 @@ export const ScreenHeader = ({
8
8
  color,
9
9
  headerType,
10
10
  Paragraph,
11
-
12
11
  }) => {
13
12
  return (
14
- <Container fontFamily={fontFamily} color={color} className={headerType} key={`title-${text}`}>
13
+ <Container
14
+ fontFamily={fontFamily}
15
+ color={color}
16
+ className={headerType}
17
+ key={`title-${text}`}
18
+ >
15
19
  {text} {boldText && <span> {boldText}</span>}
16
- {<p>{Paragraph}</p>}
20
+ {Paragraph && <p>{Paragraph}</p>}
17
21
  </Container>
18
22
  );
19
23
  };
@@ -52,6 +52,11 @@ export const Container = styled.h2`
52
52
  font-weight: 400;
53
53
  font-size: 11px;
54
54
  line-height: 18px;
55
+
56
+ &:last-child {
57
+ min-width: 50px;
58
+ text-align: center;
59
+ }
55
60
  }
56
61
 
57
62
  &.gray-table-row {
@@ -63,12 +68,14 @@ export const Container = styled.h2`
63
68
  background-color: ${GlobalColors.s2};
64
69
  padding: 1px 3px;
65
70
  border-radius: 3px;
71
+ min-width: 50px;
72
+ text-align: center;
66
73
  }
67
- &.header-and-paragraph{
74
+ &.header-and-paragraph {
68
75
  font-family: ${FontFamily.Raleway};
69
76
  font-size: 36px;
70
77
  color: ${GlobalColors.s5};
71
- p{
78
+ p {
72
79
  font-family: ${FontFamily.AvenirNext};
73
80
  font-size: 14px;
74
81
  color: ${GlobalColors.s4};
@@ -0,0 +1,35 @@
1
+ import { SelectCustom, Container, BackgroundEnd } from "./style";
2
+
3
+ export default function Select(props) {
4
+ return (
5
+ <Container width={props.width}>
6
+ <SelectCustom
7
+ id={props.id}
8
+ width={props.width}
9
+ onChange={props.onChange}
10
+ defaultValue={props.valueSelected ? props.valueSelected : ""}
11
+ >
12
+ <option value="" disabled>
13
+ {props.placeholder}
14
+ </option>
15
+ {props.options &&
16
+ props.options.map((item, i) => (
17
+ <option
18
+ className={item.required ? "option-required" : ""}
19
+ //className={ ? "option-required" : ""}
20
+ key={"select-" + item.value ? item.value : item + "-" + i}
21
+ value={item.value ? item.value : item}
22
+ // selected={
23
+ // item.value
24
+ // ? item.value == props.valueSelected && "selected"
25
+ // : item === props.valueSelected && "selected"
26
+ // }
27
+ >
28
+ {item.name ? item.name : item} {item?.required ? "*" : ""}
29
+ </option>
30
+ ))}
31
+ </SelectCustom>
32
+ <BackgroundEnd />
33
+ </Container>
34
+ );
35
+ }
@@ -0,0 +1,76 @@
1
+ import styled from "styled-components";
2
+
3
+ export const Container = styled.div`
4
+ position: relative;
5
+ display: flex;
6
+ align-items: center;
7
+ cursor: pointer;
8
+ height: 21px;
9
+ line-height: 3;
10
+ width: ${({ width }) => width || "100%"};
11
+ overflow: hidden;
12
+ border-radius: 0.25em;
13
+ &::after {
14
+ border-left: 1px solid #e33aa9;
15
+ border-top: 1px solid #e33aa9;
16
+ width: 4px;
17
+ content: "";
18
+ height: 4px;
19
+ position: absolute;
20
+ right: 7px;
21
+ -webkit-transform: rotate(-135deg);
22
+ -ms-transform: rotate(-135deg);
23
+ transform: rotate(-135deg);
24
+ top: 35%;
25
+ }
26
+ &::before {
27
+ border-left: 1px solid #e33aa9;
28
+ width: 1px;
29
+ content: "";
30
+ height: 15px;
31
+ right: 15px;
32
+ position: absolute;
33
+ z-index: 2;
34
+ }
35
+ `;
36
+
37
+ export const BackgroundEnd = styled.div`
38
+ position: absolute;
39
+ left: calc(100% - 18px);
40
+ height: 100%;
41
+ width: 18px;
42
+ background-color: #fafafa;
43
+ `;
44
+
45
+ export const SelectCustom = styled.select`
46
+ background: #fafafa;
47
+ -webkit-appearance: none;
48
+ -moz-appearance: none;
49
+ -ms-appearance: none;
50
+ appearance: none;
51
+ outline: 0;
52
+ box-shadow: none;
53
+ border: 0 !important;
54
+ background-image: none;
55
+ width: ${({ width }) => width || "100%"};
56
+ cursor: pointer;
57
+ height: 21px;
58
+ font-family: Avenir Next;
59
+ font-style: normal;
60
+ font-weight: normal;
61
+ font-size: 12px;
62
+ line-height: 21px;
63
+ padding: 0 5px;
64
+ box-sizing: border-box;
65
+ &::-ms-expand {
66
+ display: none;
67
+ }
68
+ option {
69
+ &:disabled {
70
+ color: #d4d1d7;
71
+ }
72
+ &:invalid {
73
+ color: gray;
74
+ }
75
+ }
76
+ `;
@@ -1,9 +1,37 @@
1
1
  import { Container } from "./styles";
2
2
 
3
3
  export const StatusTag = ({ statusType, ovalForm }) => {
4
+ const getShortStatus = (status) => {
5
+ switch (status) {
6
+ case "COMPLETED":
7
+ return "C";
8
+ case "RECEPTION":
9
+ return "Pr";
10
+ case "NULL":
11
+ return "-";
12
+ case "RECEIVED":
13
+ return "Rc";
14
+ case "IN_PROGRESS":
15
+ return "P";
16
+ case "ASSIGNED":
17
+ return "As";
18
+ case "APPROVED":
19
+ return "Ap";
20
+ case "VALIDATING":
21
+ return "V";
22
+ case "PAID_OUT":
23
+ return "Po";
24
+ default:
25
+ return status;
26
+ }
27
+ };
4
28
  return (
5
- <Container className={`status-${statusType} ${ovalForm && "oval-form"}`}>
6
- <p>{statusType}</p>
29
+ <Container
30
+ className={`status-${getShortStatus(statusType)} ${
31
+ ovalForm && "oval-form"
32
+ }`}
33
+ >
34
+ <p>{getShortStatus(statusType)}</p>
7
35
  </Container>
8
36
  );
9
37
  };