contentoh-components-library 21.2.46 → 21.2.48

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/dist/components/atoms/GeneralInput/index.js +4 -2
  2. package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +36 -0
  3. package/dist/components/atoms/ListCommercialRetailers/index.js +64 -0
  4. package/dist/components/atoms/ListCommercialRetailers/styles.js +20 -0
  5. package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +37 -0
  6. package/dist/components/atoms/MenuCommercialRetailers/index.js +25 -0
  7. package/dist/components/atoms/MenuCommercialRetailers/styles.js +20 -0
  8. package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +28 -0
  9. package/dist/components/atoms/MenuProductImage/index.js +88 -0
  10. package/dist/components/atoms/MenuProductImage/styles.js +20 -0
  11. package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
  12. package/dist/components/atoms/StatusTag/index.js +58 -0
  13. package/dist/components/atoms/StatusTag/styles.js +20 -0
  14. package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +7 -16
  15. package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +25 -0
  16. package/dist/components/molecules/ApproveRejetPanel/index.js +49 -0
  17. package/dist/components/molecules/ApproveRejetPanel/styles.js +18 -0
  18. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
  19. package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
  20. package/dist/components/molecules/CustomSelect/index.js +9 -36
  21. package/dist/components/molecules/CustomSelect/styles.js +1 -3
  22. package/dist/components/molecules/SignInLogin/index.js +22 -2
  23. package/dist/components/molecules/SignInLoginCreationApp/SignInLogin.stories.js +28 -0
  24. package/dist/components/molecules/SignInLoginCreationApp/index.js +270 -0
  25. package/dist/components/molecules/SignInLoginCreationApp/styles.js +20 -0
  26. package/dist/components/molecules/TagAndInput/index.js +4 -2
  27. package/dist/components/pages/Dashboard/Dashboard.stories.js +19 -19
  28. package/dist/components/pages/Dashboard/index.js +1 -1
  29. package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
  30. package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
  31. package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
  32. package/package.json +1 -1
  33. package/src/components/atoms/GeneralInput/index.js +2 -0
  34. package/src/components/atoms/VerticalSideMenuMainPage/styles.js +17 -15
  35. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +11 -19
  36. package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
  37. package/src/components/molecules/CustomSelect/index.js +8 -32
  38. package/src/components/molecules/CustomSelect/styles.js +1 -3
  39. package/src/components/molecules/SignInLogin/index.js +18 -0
  40. package/src/components/molecules/TagAndInput/index.js +2 -0
  41. package/src/components/pages/Dashboard/Dashboard.stories.js +19 -19
  42. package/src/components/pages/Dashboard/index.js +1 -1
  43. package/dist/assets/images/customSelect/starIcon.svg +0 -14
  44. package/src/assets/images/customSelect/starIcon.svg +0 -14
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = exports.RegistrationLoginFirstStepDefault = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
+
12
+ var _index = require("./index");
13
+
14
+ var _loginImage = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/loginImage.svg"));
15
+
16
+ var _login = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/login2.svg"));
17
+
18
+ var _login2 = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/login3.svg"));
19
+
20
+ var _jsxRuntime = require("react/jsx-runtime");
21
+
22
+ var _default = {
23
+ title: "Components/pages/RegistrationLoginFirstStep",
24
+ component: _index.RegistrationLoginFirstStep
25
+ };
26
+ exports.default = _default;
27
+
28
+ var Template = function Template(args) {
29
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.RegistrationLoginFirstStep, (0, _objectSpread2.default)({}, args));
30
+ };
31
+
32
+ var RegistrationLoginFirstStepDefault = Template.bind({});
33
+ exports.RegistrationLoginFirstStepDefault = RegistrationLoginFirstStepDefault;
34
+ RegistrationLoginFirstStepDefault.args = {
35
+ imageArrayCarousel: [_loginImage.default, _login.default, _login2.default],
36
+ textCarousel: "Elige la plataforma que conecta proovedores y retailers"
37
+ };
@@ -0,0 +1,269 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.RegistrationLoginFirstStep = void 0;
9
+
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
13
+
14
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
15
+
16
+ var _styles = require("./styles");
17
+
18
+ var _GradientPanel = require("../../atoms/GradientPanel");
19
+
20
+ var _CarouselImagesLogin = require("../../molecules/CarouselImagesLogin");
21
+
22
+ var _react = require("react");
23
+
24
+ var _LogoImage = require("../../atoms/LogoImage");
25
+
26
+ var _ScreenHeader = require("../../atoms/ScreenHeader");
27
+
28
+ var _variables = require("../../../global-files/variables");
29
+
30
+ var _TagAndInput = require("../../molecules/TagAndInput");
31
+
32
+ var _GeneralButton = require("../../atoms/GeneralButton");
33
+
34
+ var _GeneralInput = require("../../atoms/GeneralInput");
35
+
36
+ var _jsxRuntime = require("react/jsx-runtime");
37
+
38
+ var RegistrationLoginFirstStep = function RegistrationLoginFirstStep(_ref) {
39
+ var _ref$imageArrayCarous = _ref.imageArrayCarousel,
40
+ imageArrayCarousel = _ref$imageArrayCarous === void 0 ? [] : _ref$imageArrayCarous,
41
+ textCarousel = _ref.textCarousel,
42
+ backogroundColorCarousel = _ref.backogroundColorCarousel;
43
+
44
+ var _useState = (0, _react.useState)(false),
45
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
46
+ emptyName = _useState2[0],
47
+ setEmptyName = _useState2[1];
48
+
49
+ var _useState3 = (0, _react.useState)(false),
50
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
51
+ emptyLastName = _useState4[0],
52
+ setEmptyLastName = _useState4[1];
53
+
54
+ var _useState5 = (0, _react.useState)(false),
55
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
56
+ emptyEmail = _useState6[0],
57
+ setEmptyEmail = _useState6[1];
58
+
59
+ var _useState7 = (0, _react.useState)(false),
60
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
61
+ emptyJob = _useState8[0],
62
+ setEmptyJob = _useState8[1];
63
+
64
+ var _useState9 = (0, _react.useState)(false),
65
+ _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
66
+ emptyPhone = _useState10[0],
67
+ setEmptyPhone = _useState10[1];
68
+
69
+ var _useState11 = (0, _react.useState)(false),
70
+ _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
71
+ invalidEmail = _useState12[0],
72
+ setInvalidEmail = _useState12[1];
73
+
74
+ var validate = /*#__PURE__*/function () {
75
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
76
+ var name, lastName, email, job, phone;
77
+ return _regenerator.default.wrap(function _callee$(_context) {
78
+ while (1) {
79
+ switch (_context.prev = _context.next) {
80
+ case 0:
81
+ e.preventDefault();
82
+ name = document.querySelector("#nameInput").value;
83
+ lastName = document.querySelector("#lastNameInput").value;
84
+ email = document.querySelector("#emailInput").value;
85
+ job = document.querySelector("#jobInput").value;
86
+ phone = document.querySelector("#phoneInput").value;
87
+ name === "" ? setEmptyName(true) : setEmptyName(false);
88
+ lastName === "" ? setEmptyLastName(true) : setEmptyLastName(false);
89
+ email === "" ? setEmptyEmail(true) : setEmptyEmail(false);
90
+ job === "" ? setEmptyJob(true) : setEmptyJob(false);
91
+ phone === "" ? setEmptyPhone(true) : setEmptyPhone(false);
92
+ !/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) ? setInvalidEmail(true) : setInvalidEmail(false);
93
+
94
+ case 12:
95
+ case "end":
96
+ return _context.stop();
97
+ }
98
+ }
99
+ }, _callee);
100
+ }));
101
+
102
+ return function validate(_x) {
103
+ return _ref2.apply(this, arguments);
104
+ };
105
+ }();
106
+
107
+ var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
108
+ className: "credenciales",
109
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
110
+ fontFamily: _variables.FontFamily.AvenirNext,
111
+ color: _variables.GlobalColors.s5,
112
+ text: "Ingresa tus credenciales"
113
+ })
114
+ }, "2"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
115
+ className: "user",
116
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
117
+ className: "name-registration-user",
118
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
119
+ inputType: "text",
120
+ inputId: "nameInput",
121
+ label: "Nombre",
122
+ inputPlaceHolder: "Nombre"
123
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
124
+ inputType: "text",
125
+ inputId: "lastNameInput",
126
+ label: "Apellido",
127
+ inputPlaceHolder: "Apellido"
128
+ })]
129
+ }), emptyName && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
130
+ children: "Ingrese su nombre"
131
+ }), emptyLastName && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
132
+ children: "Ingrese sus apellidos"
133
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
134
+ inputType: "text",
135
+ inputId: "emailInput",
136
+ label: "Correo electrónico",
137
+ inputPlaceHolder: "username@contentoh.com"
138
+ }), emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
139
+ children: "Ingrese su correo"
140
+ }), invalidEmail && !emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
141
+ children: "Ingrese un correo v\xE1lido"
142
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
143
+ inputType: "text",
144
+ inputId: "jobInput",
145
+ label: "Puesto laboral",
146
+ inputPlaceHolder: "Puesto dentro de la empresa"
147
+ }), emptyJob && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
148
+ children: "Ingrese su puesto"
149
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
150
+ text: "Teléfono",
151
+ headerType: "input-name-header"
152
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
153
+ className: "phone-registration-user",
154
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
155
+ name: "select",
156
+ className: "phone-options",
157
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
158
+ children: "+52"
159
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
160
+ children: "+54"
161
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
162
+ children: "+57"
163
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
164
+ children: "+506"
165
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
166
+ children: "+593"
167
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
168
+ children: "+503"
169
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
170
+ children: "+504"
171
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
172
+ children: "+507"
173
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
174
+ children: "+51"
175
+ })]
176
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralInput.GeneralInput, {
177
+ inputId: "phoneInput",
178
+ inputType: "text",
179
+ inputPlaceholder: "Teléfono"
180
+ })]
181
+ }), emptyPhone && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
182
+ children: "Ingrese su n\xFAmero de tel\xE9fono"
183
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
184
+ text: "País",
185
+ headerType: "input-name-header"
186
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
187
+ name: "select",
188
+ className: "country-options",
189
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
190
+ value: "value1",
191
+ selected: true,
192
+ children: "Selecciona tu pa\xEDs"
193
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
194
+ value: "value2",
195
+ children: "Argentina"
196
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
197
+ value: "value3",
198
+ children: "Colombia"
199
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
200
+ value: "value2",
201
+ children: "Ecuador"
202
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
203
+ value: "value3",
204
+ children: "El Salvador"
205
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
206
+ value: "value2",
207
+ children: "Honduras"
208
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
209
+ value: "value3",
210
+ children: "M\xE9xico"
211
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
212
+ value: "value2",
213
+ children: "Panam\xE1"
214
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
215
+ value: "value3",
216
+ children: "Per\xFA"
217
+ })]
218
+ }), emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
219
+ children: "Seleccione su pa\xEDs"
220
+ })]
221
+ }, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
222
+ className: "button-end",
223
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
224
+ buttonType: "general-default-button",
225
+ label: "Enviar",
226
+ onClick: function onClick(e) {
227
+ return validate(e);
228
+ }
229
+ })
230
+ }, "4"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
231
+ className: "progress-bar",
232
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
233
+ className: "progress-bar-first-step"
234
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
235
+ className: "progress-bar-registration"
236
+ })]
237
+ }, "5"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
238
+ text: "Paso 1",
239
+ headerType: "date-header",
240
+ color: _variables.GlobalColors.s4
241
+ }, "6"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
242
+ className: "new-login",
243
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
244
+ className: "pre-registro",
245
+ children: ["\xBFYa tienes una cuenta?", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
246
+ children: " Inicia Sesi\xF3n"
247
+ })]
248
+ })
249
+ }, "7")];
250
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
251
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
252
+ className: "home-retailer",
253
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselImagesLogin.CarouselImagesLogin, {
254
+ panelImg: imageArrayCarousel,
255
+ panelText: textCarousel,
256
+ panelColor: backogroundColorCarousel
257
+ })
258
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
259
+ className: "home-login-retailer",
260
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GradientPanel.GradientPanel, {
261
+ componentsArray: loginRight,
262
+ panelType: "home-login",
263
+ panelColor: _variables.GlobalColors.white
264
+ })
265
+ })]
266
+ });
267
+ };
268
+
269
+ exports.RegistrationLoginFirstStep = RegistrationLoginFirstStep;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.Container = void 0;
9
+
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
11
+
12
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
+
14
+ var _variables = require("../../../global-files/variables");
15
+
16
+ var _templateObject;
17
+
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 100%;\n height: 100vh;\n .user {\n .name-registration-user {\n display: flex;\n justify-content: space-between;\n input {\n width: 160px;\n }\n }\n .input-name-header {\n margin-bottom: 4px;\n margin-top: 12px;\n }\n .phone-registration-user {\n display: flex;\n justify-content: space-between;\n .phone-options {\n width: 80px;\n }\n input {\n width: 100%;\n }\n & + * {\n margin-top: 10px;\n }\n }\n .country-options,\n .phone-options {\n width: 100%;\n border: 1px solid ", ";\n font-family: ", ";\n color: ", ";\n font-weight: normal;\n font-size: 12px;\n line-height: 15px;\n padding: 10px;\n outline: none;\n border-radius: 2px;\n resize: none;\n &:focus {\n border: 1px solid ", ";\n }\n }\n }\n .button-end {\n text-align: end;\n .general-default-button {\n width: 160px;\n }\n & + * {\n margin-top: 10px;\n }\n }\n .progress-bar {\n width: 100%;\n height: 8px;\n display: flex;\n justify-content: space-between;\n .progress-bar-first-step {\n width: 33.33%;\n background-color: rgb(196, 196, 196);\n }\n .progress-bar-registration {\n background-color: rgb(226, 226, 226);\n width: 66.66%;\n }\n }\n .date-header {\n .new-login {\n & + * {\n margin-top: 20px;\n }\n }\n }\n .home-login-retailer,\n .home-retailer {\n width: 50%;\n }\n"])), _variables.GlobalColors.s2, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4, _variables.GlobalColors.magenta_s2);
19
+
20
+ exports.Container = Container;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.2.46",
3
+ "version": "21.2.48",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -25,6 +25,7 @@ export const GeneralInput = ({
25
25
  description,
26
26
  inputOnChange,
27
27
  disabled,
28
+ onKeyDown,
28
29
  }) => {
29
30
  const [textValue, setTextValue] = useState({
30
31
  value: inputValue,
@@ -123,6 +124,7 @@ export const GeneralInput = ({
123
124
  onInput={(e) => onHandleChange(e)}
124
125
  maxLength={maxChar}
125
126
  required={isRequired}
127
+ onKeyDown={onKeyDown}
126
128
  />
127
129
  ) : (
128
130
  <InputFormatter
@@ -5,11 +5,11 @@ import { createGlobalStyle } from "styled-components";
5
5
  export const Container = styled.div`
6
6
  height: 100%;
7
7
  box-sizing: border-box;
8
- padding: 23px 10px 70px 10px;
8
+ padding: 23px 0 70px 0;
9
9
  flex-direction: column;
10
10
  justify-content: space-between;
11
11
  overflow: none;
12
- width: ${({ bar }) => (bar ? 250 : 58)}px;
12
+ width: ${({ bar }) => (bar ? 240 : 66)}px;
13
13
  background: linear-gradient(180deg, #e33aa9 0%, #3b1366 100%);
14
14
  scrollbar-width: none;
15
15
  display: flex;
@@ -20,27 +20,29 @@ export const Container = styled.div`
20
20
  margin-left: 30px;
21
21
  }
22
22
  .navbar-top {
23
- transition: all 0.3s linear;
23
+ .logo {
24
+ height: 22px;
25
+ }
24
26
  .option {
25
27
  .option-div {
28
+ width: 100%;
26
29
  & + div {
27
30
  margin-top: 10px;
28
31
  }
29
32
  }
30
33
  display: flex;
31
34
  flex-direction: column;
32
- align-items: flex-start;
35
+ align-items: center;
33
36
  margin-top: 50px;
34
37
  .active {
35
- background: #e33aa9;
36
- color: #fafafa;
38
+ //background: #c8489c;
37
39
  text-decoration: none;
38
- transition: all 0.3s linear;
40
+ background: #e33aa9;
39
41
  }
40
42
  .sub-option {
41
43
  display: flex;
42
44
  flex-direction: column;
43
- padding-left: ${({ bar }) => (bar ? 28 : 20)}px;
45
+ padding-left: 32px;
44
46
  height: auto;
45
47
  width: auto;
46
48
  }
@@ -52,7 +54,6 @@ export const NavLinkOption = styled(NavLink)`
52
54
  height: 38px;
53
55
  display: flex;
54
56
  justify-content: ${({ bar }) => (bar ? "flex-start" : "center")};
55
- border-radius: ${({ bar }) => (bar ? 18 : 100)}px;
56
57
  align-items: center;
57
58
  font-family: sans-serif;
58
59
  font-style: normal;
@@ -63,8 +64,7 @@ export const NavLinkOption = styled(NavLink)`
63
64
  color: #fafafa;
64
65
  text-decoration: none;
65
66
  cursor: pointer;
66
- width: ${({ bar }) => (bar ? "163" : "38")}px;
67
- padding: 0 17px;
67
+ padding: ${({ bar }) => (bar ? "0 22" : "0 8")}px;
68
68
  &:hover {
69
69
  background: #e33aa9;
70
70
  color: #fafafa;
@@ -76,9 +76,11 @@ export const NavLinkOption = styled(NavLink)`
76
76
  pointer-events: none;
77
77
  }
78
78
  img {
79
- width: 22px;
79
+ height: 22px;
80
+ position: absolute;
81
+ left: 22px;
80
82
  & + * {
81
- margin-left: 12px;
83
+ margin-left: 30px;
82
84
  }
83
85
  }
84
86
  &.sub-option-link {
@@ -103,13 +105,13 @@ export const NavLinkOption = styled(NavLink)`
103
105
  background-color: white;
104
106
  position: absolute;
105
107
  bottom: 0;
106
- left: ${({ bar }) => (bar ? -4 : -16)}%;
108
+ left: -6px;
107
109
  }
108
110
  &.active {
109
111
  background: none !important;
110
112
  color: #fafafa;
111
113
  text-decoration: none;
112
- transition: all 0.3s linear;
114
+ //transition: all 0.3s linear;
113
115
  &::before {
114
116
  background-color: #e33aa9;
115
117
  }
@@ -1,5 +1,4 @@
1
1
  import { CustomSelect } from "./index";
2
- import iconStar from "../../../assets/images/customSelect/starIcon.svg";
3
2
 
4
3
  export default {
5
4
  title: "Components/molecules/CustomSelect",
@@ -9,27 +8,20 @@ export default {
9
8
  const Template = (args) => <CustomSelect {...args} />;
10
9
  export const CustomSelectDefault = Template.bind({});
11
10
  CustomSelectDefault.args = {
12
- // selectLabel: "Todos los departamentos",
11
+ selectLabel: "Todos los departamentos",
13
12
  defaultOption: "Todos los departamentos",
14
13
  options: [
15
14
  {
16
- id: 47,
17
- name: "Enero 2023",
18
- isSelected: true,
19
- },
20
- {
21
- id: 49,
22
- name: "Mis Favoritos",
15
+ id: 1,
16
+ value: "Decoración",
17
+ subOptions: [
18
+ { id: 1, value: "Espejos" },
19
+ { id: 2, value: "Persianas" },
20
+ ],
23
21
  },
22
+ { id: 2, value: "Eléctrico" },
23
+ { id: 3, value: "Ferretería" },
24
+ { id: 4, value: "Herramientas" },
25
+ { id: 5, value: "Iluminación" },
24
26
  ],
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>
35
27
  };
@@ -7,7 +7,6 @@ export const SelecItem = ({
7
7
  setParameterArray,
8
8
  activeFilters,
9
9
  setActiveFilters,
10
- onClickItem,
11
10
  }) => {
12
11
  const [showSubOptions, setShowSubOptions] = useState(false);
13
12
  const [chkGlobal, setChkGlobal] = useState(false);
@@ -18,9 +17,6 @@ export const SelecItem = ({
18
17
  id={"main-item-" + option.id}
19
18
  label={option.name}
20
19
  onChange={(e) => {
21
- if (onClickItem) {
22
- onClickItem(e.target.checked, option.id)
23
- }
24
20
  const subOptions = option.subOptions;
25
21
  const filtersCopy = { ...activeFilters };
26
22
  if (subOptions) {
@@ -81,9 +77,6 @@ export const SelecItem = ({
81
77
  activeFilters[option.name][sub.name]
82
78
  }
83
79
  onChange={(e) => {
84
- if (onClickItem) {
85
- onClickItem(e.target.checked, sub.id)
86
- }
87
80
  if (e.target.checked) {
88
81
  setParameterArray((current) =>
89
82
  [...current, sub.id].sort((a, b) => a - b)
@@ -13,11 +13,8 @@ export const CustomSelect = ({
13
13
  customSelectId = "defaultSelectId",
14
14
  defaultOption,
15
15
  setParameterArray,
16
- onClickItem,
17
- icon,
18
- customOptions,
19
16
  }) => {
20
- const [filters, setFilters] = useState([]);
17
+ const [filters, setFilters] = useState(options || []);
21
18
  const [showList, setShowList] = useCloseModal(customSelectId);
22
19
  const [text, setText] = useState("");
23
20
  const [showDatePicker, setShowDatePicker] = useCloseModal(customSelectId);
@@ -36,21 +33,7 @@ export const CustomSelect = ({
36
33
  const end = new Date();
37
34
  setStartDate(start);
38
35
  setEndDate(end);
39
- const obj = {};
40
- options.forEach((o) => {
41
- const { name, isSelected, subOptions } = o;
42
- if (isSelected) obj[name] = {};
43
- subOptions?.forEach((so) => {
44
- const { name: nameSO, isSelected: isSelectedSO } = so;
45
- if (isSelectedSO) {
46
- if (!obj[name]) obj[name] = {};
47
- obj[name][nameSO] = true;
48
- }
49
- });
50
- });
51
- setActiveFilters(obj);
52
- setFilters(options);
53
- }, [options]);
36
+ }, []);
54
37
 
55
38
  const onChangeDatePicker = (dates) => {
56
39
  const [start, end] = dates;
@@ -81,18 +64,12 @@ export const CustomSelect = ({
81
64
  }, [text]);
82
65
 
83
66
  return (
84
- <Container id={customSelectId} selectLabel={selectLabel}>
67
+ <Container id={customSelectId}>
85
68
  <div className="button-list" onClick={() => setShowList(!showList)}>
86
- {selectLabel && <p>{selectLabel}</p>}
87
- {icon ? (
88
- <img src={icon} alt="Favorite" width={"20px"} />
89
- ) : (
90
- <div className="arrow-item">&#9664;</div>
91
- )}
69
+ <p>{selectLabel}</p>
70
+ <div className="arrow-item">&#9664;</div>
92
71
  </div>
93
- {showList && (customOptions ?
94
- customOptions
95
- : (
72
+ {showList && (
96
73
  <div className="select-container">
97
74
  {showSearchBar && (
98
75
  <div className="search-bar-filter">
@@ -109,7 +86,7 @@ export const CustomSelect = ({
109
86
  <div
110
87
  className="default-option"
111
88
  onClick={() => {
112
- setParameterArray && setParameterArray([]);
89
+ setParameterArray([]);
113
90
  setActiveFilters({});
114
91
  setShowList(false);
115
92
  }}
@@ -139,13 +116,12 @@ export const CustomSelect = ({
139
116
  setParameterArray={setParameterArray}
140
117
  activeFilters={activeFilters}
141
118
  setActiveFilters={setActiveFilters}
142
- onClickItem={onClickItem}
143
119
  />
144
120
  )
145
121
  )}
146
122
  </div>
147
123
  </div>
148
- ))}
124
+ )}
149
125
  {showDatePicker && (
150
126
  <Calendar
151
127
  onChange={onChangeDatePicker}
@@ -9,9 +9,7 @@ export const Container = styled.div`
9
9
  font-family: ${FontFamily.Raleway};
10
10
  font-size: 13px;
11
11
  display: flex;
12
- padding: ${(props) => (props.selectLabel !== "" ? "10px 15px" : "5px 5px")};
13
- //padding: 10px 15px;
14
- //padding: 5px 5px;
12
+ padding: 10px 15px;
15
13
  justify-content: space-between;
16
14
  border-radius: 50px;
17
15
  background-color: #fff;
@@ -143,6 +143,15 @@ export const SignInLogin = (props) => {
143
143
  label={"Nombre de usuario"}
144
144
  inputPlaceHolder={"username@contentoh.com"}
145
145
  inputId={"emailInput"}
146
+ onKeyDown={(e) => {
147
+ switch (e.key) {
148
+ case "Enter":
149
+ validate(e);
150
+ break;
151
+ default:
152
+ break;
153
+ }
154
+ }}
146
155
  />
147
156
  </div>
148
157
  {showErrors && emptyEmail && <label>Ingrese su correo</label>}
@@ -155,6 +164,15 @@ export const SignInLogin = (props) => {
155
164
  label={"Contraseña"}
156
165
  inputPlaceHolder={"Escribe tu contraseña"}
157
166
  inputId={"passwordInput"}
167
+ onKeyDown={(e) => {
168
+ switch (e.key) {
169
+ case "Enter":
170
+ validate(e);
171
+ break;
172
+ default:
173
+ break;
174
+ }
175
+ }}
158
176
  />
159
177
  <img
160
178
  src={showPassword}
@@ -26,6 +26,7 @@ export const TagAndInput = ({
26
26
  inputOnChange,
27
27
  color,
28
28
  disabled,
29
+ onKeyDown,
29
30
  }) => {
30
31
  return (
31
32
  <Container
@@ -63,6 +64,7 @@ export const TagAndInput = ({
63
64
  optionList={optionList}
64
65
  description={description}
65
66
  inputOnChange={inputOnChange}
67
+ onKeyDown={onKeyDown}
66
68
  />
67
69
  </Container>
68
70
  );