contentoh-components-library 21.2.7 → 21.2.10

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 (59) hide show
  1. package/.env.development +3 -1
  2. package/.env.production +3 -1
  3. package/dist/components/atoms/FeatureTag/styles.js +1 -1
  4. package/dist/components/atoms/Graphic/Graphic.stories.js +9 -1
  5. package/dist/components/atoms/Graphic/index.js +4 -9
  6. package/dist/components/atoms/Graphic/styles.js +1 -1
  7. package/dist/components/atoms/MetricCard/MetricCard.stories.js +31 -0
  8. package/dist/components/atoms/MetricCard/index.js +24 -0
  9. package/dist/components/atoms/MetricCard/styles.js +20 -0
  10. package/dist/components/atoms/MetricSelect/MetricSelect.stories.js +46 -0
  11. package/dist/components/atoms/MetricSelect/index.js +37 -0
  12. package/dist/components/atoms/MetricSelect/styles.js +20 -0
  13. package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
  14. package/dist/components/atoms/StatusTag/index.js +58 -0
  15. package/dist/components/atoms/StatusTag/styles.js +20 -0
  16. package/dist/components/organisms/Calendar/Calendar.stories.js +28 -0
  17. package/dist/components/organisms/Calendar/index.js +33 -0
  18. package/dist/components/organisms/Calendar/styles.js +20 -0
  19. package/dist/components/organisms/DashboardMetric/DashboardMetric.stories.js +45 -0
  20. package/dist/components/organisms/DashboardMetric/index.js +168 -0
  21. package/dist/components/organisms/DashboardMetric/styles.js +20 -0
  22. package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
  23. package/dist/components/pages/Dashboard/Dashboard.stories.js +28 -0
  24. package/dist/components/pages/Dashboard/index.js +292 -0
  25. package/dist/components/pages/Dashboard/styles.js +18 -0
  26. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +73 -121
  27. package/dist/components/pages/ProviderProductEdition/index.js +30 -27
  28. package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
  29. package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
  30. package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
  31. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +55 -55
  32. package/dist/components/pages/RetailerProductEdition/index.js +3 -3
  33. package/dist/index.js +13 -0
  34. package/package.json +2 -1
  35. package/src/components/atoms/FeatureTag/styles.js +6 -0
  36. package/src/components/atoms/Graphic/Graphic.stories.js +8 -0
  37. package/src/components/atoms/Graphic/index.js +3 -9
  38. package/src/components/atoms/Graphic/styles.js +1 -2
  39. package/src/components/atoms/MetricCard/MetricCard.stories.js +14 -0
  40. package/src/components/atoms/MetricCard/index.js +10 -0
  41. package/src/components/atoms/MetricCard/styles.js +30 -0
  42. package/src/components/atoms/MetricSelect/MetricSelect.stories.js +37 -0
  43. package/src/components/atoms/MetricSelect/index.js +22 -0
  44. package/src/components/atoms/MetricSelect/styles.js +20 -0
  45. package/src/components/organisms/Calendar/Calendar.stories.js +10 -0
  46. package/src/components/organisms/Calendar/index.js +17 -0
  47. package/src/components/organisms/Calendar/styles.js +851 -0
  48. package/src/components/organisms/DashboardMetric/DashboardMetric.stories.js +28 -0
  49. package/src/components/organisms/DashboardMetric/index.js +128 -0
  50. package/src/components/organisms/DashboardMetric/styles.js +60 -0
  51. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  52. package/src/components/pages/Dashboard/Dashboard.stories.js +10 -0
  53. package/src/components/pages/Dashboard/index.js +146 -0
  54. package/src/components/pages/Dashboard/styles.js +24 -0
  55. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +80 -146
  56. package/src/components/pages/ProviderProductEdition/index.js +12 -16
  57. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +58 -58
  58. package/src/components/pages/RetailerProductEdition/index.js +3 -2
  59. package/src/index.js +1 -0
@@ -31,59 +31,59 @@ RetailerProductEditionDefault.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: false
33
33
  },
34
- token: "eyJraWQiOiJEV3owZnNieXg2MXNFcV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VmHzD3F_EMxaVyqV5aW5IoIQ",
35
35
  productSelected: {
36
- services: {
37
- datasheets: 0,
38
- descriptions: 0,
39
- images: 1
36
+ "services": {
37
+ "datasheets": 1,
38
+ "descriptions": 1,
39
+ "images": 1
40
40
  },
41
- orderId: 1789,
42
- status: "ACA",
43
- datasheet_status: "NS",
44
- prio: "none",
45
- version: 2,
46
- description_status: "NS",
47
- images_status: "ACA",
48
- article: {
49
- id_article: 68865,
50
- id_category: "2999",
51
- name: "RESIZE",
52
- upc: "169955",
53
- timestamp: "2022-06-21T16:03:10.000Z",
54
- id_user: 1238,
55
- status: "NULL",
56
- active: 0,
57
- company_id: 819,
58
- SKU: null,
59
- Descripcion: null,
60
- Proveedor: null,
61
- id_proveedor: 0,
62
- company_name: "The Home Depot Resize",
63
- country: "México",
64
- id_order: 1789,
65
- id_datasheet_especialist: null,
66
- id_datasheet_facilitator: null,
67
- id_description_especialist: null,
68
- id_description_facilitator: null,
69
- id_images_especialist: 1250,
70
- id_images_facilitator: 424,
71
- id_auditor: null,
72
- id_recepcionist: null,
73
- category: "Resizing|Resizing|Resizing",
74
- missingAttributes: null,
75
- missingDescriptions: null,
76
- missingImages: null
41
+ "orderId": 1810,
42
+ "status": "RP",
43
+ "datasheet_status": "RP",
44
+ "prio": "none",
45
+ "version": 2,
46
+ "description_status": "RP",
47
+ "images_status": "RP",
48
+ "article": {
49
+ "id_article": 68934,
50
+ "id_category": "2290",
51
+ "name": "SCOTCHBLUE  3PACK MASKING TAPE 24MMX55M",
52
+ "upc": "167907",
53
+ "timestamp": "2022-06-22T15:44:57.000Z",
54
+ "id_user": 704,
55
+ "status": "NULL",
56
+ "active": 1,
57
+ "company_id": 437,
58
+ "SKU": null,
59
+ "Descripcion": null,
60
+ "Proveedor": null,
61
+ "id_proveedor": 0,
62
+ "company_name": "",
63
+ "country": null,
64
+ "id_order": 1810,
65
+ "id_datasheet_especialist": 1248,
66
+ "id_datasheet_facilitator": 1252,
67
+ "id_description_especialist": 1248,
68
+ "id_description_facilitator": 1252,
69
+ "id_images_especialist": 1251,
70
+ "id_images_facilitator": 1286,
71
+ "id_auditor": 514,
72
+ "id_recepcionist": null,
73
+ "category": "Pinturas|Herramientas y accesorios para pintar|Cintas",
74
+ "missingAttributes": null,
75
+ "missingDescriptions": null,
76
+ "missingImages": null
77
77
  },
78
- retailers: [{
79
- id: 60,
80
- name: "The Home Depot Resizing",
81
- country: "México",
82
- id_region: 1,
83
- active: 1
78
+ "retailers": [{
79
+ "id": 58,
80
+ "name": "The Home Depot Golden",
81
+ "country": "México",
82
+ "id_region": 1,
83
+ "active": 1
84
84
  }],
85
- country: "México",
86
- upc: "169955"
85
+ "country": null,
86
+ "upc": "167907"
87
87
  },
88
88
  location: {
89
89
  product: {
@@ -92,22 +92,22 @@ RetailerProductEditionDefault.args = {
92
92
  }
93
93
  },
94
94
  user: {
95
- id_user: 425,
96
- name: "Auditor QA",
95
+ id_user: 1248,
96
+ name: "Facilitador Textos",
97
97
  last_name: " ",
98
- email: "ladiboh785@mi166.com",
98
+ email: "bayadi1538@mnqlm.com",
99
99
  position: "Tester",
100
100
  telephone: null,
101
101
  country: null,
102
102
  id_company: 254,
103
- id_cognito: "23a3f496-4e38-4e12-9bf5-7f90b77a2f35",
103
+ id_cognito: "0b66a4a9-7790-4034-a30a-c00808962867",
104
104
  birth_Date: null,
105
105
  about_me: null,
106
106
  zip_code: null,
107
107
  address: null,
108
108
  job: null,
109
109
  id_stripe: null,
110
- id_role: 1,
110
+ id_role: 7,
111
111
  active: 1,
112
112
  is_retailer: 0,
113
113
  email_notify: null,
@@ -122,6 +122,6 @@ RetailerProductEditionDefault.args = {
122
122
  products_limit: "1000",
123
123
  type: "Enterprise"
124
124
  },
125
- src: "https://content-management-profile-prod.s3.amazonaws.com/id-425/425.png?1659649029658"
125
+ src: "https://content-management-profile-prod.s3.amazonaws.com/id-423/423.png?1660182839373"
126
126
  }
127
127
  };
@@ -118,7 +118,7 @@ var reducerImages = function reducerImages(state, action) {
118
118
 
119
119
  case "changeAttrValue":
120
120
  var index = attrForImgs.general.findIndex(function (f) {
121
- return f.id = action.id;
121
+ return f.id === action.id;
122
122
  });
123
123
 
124
124
  if (index !== -1) {
@@ -1101,7 +1101,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1101
1101
  return statusArray.includes(srvActive) && (["RA", "RC"].includes(product === null || product === void 0 ? void 0 : product.status) || srv.filter(function (serv) {
1102
1102
  var _serv$status;
1103
1103
 
1104
- return statusArray.includes((_serv$status = serv.status) === null || _serv$status === void 0 ? void 0 : _serv$status.replace(/.*\//, ""));
1104
+ return ["CA"].includes((_serv$status = serv.status) === null || _serv$status === void 0 ? void 0 : _serv$status.replace(/.*\//, ""));
1105
1105
  }).length === srv.length);
1106
1106
 
1107
1107
  case 4:
@@ -1897,7 +1897,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1897
1897
  headerType: "input-name-header"
1898
1898
  }))]
1899
1899
  })
1900
- }), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1900
+ }), console.log(userAssigned(activeTab), auditorAssigned()), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1901
1901
  className: "commentary-box",
1902
1902
  children: [!comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1903
1903
  className: "commentary",
package/dist/index.js CHANGED
@@ -758,6 +758,19 @@ Object.keys(_CustomerType).forEach(function (key) {
758
758
  });
759
759
  });
760
760
 
761
+ var _Dashboard = require("./components/pages/Dashboard");
762
+
763
+ Object.keys(_Dashboard).forEach(function (key) {
764
+ if (key === "default" || key === "__esModule") return;
765
+ if (key in exports && exports[key] === _Dashboard[key]) return;
766
+ Object.defineProperty(exports, key, {
767
+ enumerable: true,
768
+ get: function get() {
769
+ return _Dashboard[key];
770
+ }
771
+ });
772
+ });
773
+
761
774
  var _EmailResetPassword = require("./components/pages/EmailResetPassword");
762
775
 
763
776
  Object.keys(_EmailResetPassword).forEach(function (key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.2.7",
3
+ "version": "21.2.10",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -22,6 +22,7 @@
22
22
  "prop-types": "^15.7.2",
23
23
  "react": "^17.0.2",
24
24
  "react-chartjs-2": "^4.0.1",
25
+ "react-datepicker": "^4.8.0",
25
26
  "react-dom": "^17.0.2",
26
27
  "react-draft-wysiwyg": "^1.14.7",
27
28
  "react-dropzone": "^12.0.4",
@@ -34,4 +34,10 @@ export const Container = styled.div`
34
34
  letter-spacing: -0.015em;
35
35
  color: ${GlobalColors.s4};
36
36
  }
37
+
38
+ &:last-of-type {
39
+ p {
40
+ font-size: 24px;
41
+ }
42
+ }
37
43
  `;
@@ -18,4 +18,12 @@ GraphicDefault.args = {
18
18
  },
19
19
  ],
20
20
  },
21
+ options: {
22
+ plugins: {
23
+ legend: {
24
+ position: "left",
25
+ },
26
+ },
27
+ },
28
+ type: "doughnut",
21
29
  };
@@ -2,17 +2,11 @@ import { Container } from "./styles";
2
2
  import { Chart } from "react-chartjs-2";
3
3
  import "chart.js/auto";
4
4
 
5
- export const Graphic = ({ data }) => {
6
- const options = {
7
- plugins: {
8
- legend: {
9
- position: "left",
10
- },
11
- },
12
- };
5
+ export const Graphic = ({ data, type, options }) => {
6
+
13
7
  return (
14
8
  <Container>
15
- <Chart type="doughnut" data={data} options={options} />
9
+ <Chart type={type} data={data} options={options} />
16
10
  </Container>
17
11
  );
18
12
  };
@@ -1,4 +1,3 @@
1
1
  import styled from "styled-components";
2
2
 
3
- export const Container = styled.div`
4
- `;
3
+ export const Container = styled.div``;
@@ -0,0 +1,14 @@
1
+ import { MetricCard } from "./index";
2
+
3
+ export default {
4
+ title: "Components/atoms/MetricCard",
5
+ component: MetricCard,
6
+ };
7
+
8
+ const Template = (args) => <MetricCard {...args} />;
9
+ export const MetricCardDefault = Template.bind({});
10
+
11
+ MetricCardDefault.args = {
12
+ label: "Productos Totales",
13
+ number: 2367,
14
+ };
@@ -0,0 +1,10 @@
1
+ import { Container } from "./styles";
2
+
3
+ export const MetricCard = ({ label, number }) => {
4
+ return (
5
+ <Container>
6
+ <p>{label}</p>
7
+ <p>{number}</p>
8
+ </Container>
9
+ );
10
+ };
@@ -0,0 +1,30 @@
1
+ import styled from "styled-components";
2
+ import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ padding: 10px 20px;
6
+ border: 1px solid ${GlobalColors.s3};
7
+ width: fit-content;
8
+ text-align: center;
9
+ border-radius: 10px;
10
+
11
+ p {
12
+ color: #000;
13
+ font-size: 25px;
14
+ font-family: ${FontFamily.Raleway_600};
15
+ font-size: 25px;
16
+ font-feature-settings: "pnum", "lnum";
17
+
18
+ &:first-of-type {
19
+ color: ${GlobalColors.s3};
20
+ font-family: ${FontFamily.Raleway};
21
+ font-weight: 500;
22
+ font-size: 13px;
23
+ line-height: 13px;
24
+ }
25
+
26
+ & + * {
27
+ margin-top: 3px;
28
+ }
29
+ }
30
+ `;
@@ -0,0 +1,37 @@
1
+ import { useState } from "react";
2
+ import { MetricSelect } from ".";
3
+
4
+ export default {
5
+ title: "Components/atoms/MetricSelect",
6
+ component: MetricSelect,
7
+ };
8
+
9
+ const Template = (args) => {
10
+ const [optionSelected, setSelectedOption] = useState("Semana actual");
11
+ const onChange = (e) => {
12
+ setSelectedOption(e.target.value);
13
+ };
14
+ return (
15
+ <MetricSelect
16
+ {...args}
17
+ optionSelected={optionSelected}
18
+ onChange={onChange}
19
+ />
20
+ );
21
+ };
22
+ export const MetricSelectDefault = Template.bind({});
23
+ MetricSelectDefault.args = {
24
+ options: [
25
+ "12/12/12",
26
+ "12/12/13",
27
+ "12/12/14",
28
+ "12/12/15",
29
+ "12/12/16",
30
+ "12/12/17",
31
+ "12/12/18",
32
+ "12/12/19",
33
+ "12/12/20",
34
+ "12/12/21",
35
+ "12/12/22",
36
+ ],
37
+ };
@@ -0,0 +1,22 @@
1
+ import { Container } from "./styles";
2
+
3
+ export const MetricSelect = ({
4
+ options,
5
+ optionSelected,
6
+ onChange,
7
+ label,
8
+ className,
9
+ }) => {
10
+ return (
11
+ <Container className={className}>
12
+ <select value={optionSelected} onChange={onChange}>
13
+ <option value="" disabled>{label}</option>
14
+ {options?.map((option) => (
15
+ <option key={option.name} value={option.id}>
16
+ {option.name}
17
+ </option>
18
+ ))}
19
+ </select>
20
+ </Container>
21
+ );
22
+ };
@@ -0,0 +1,20 @@
1
+ import styled from "styled-components";
2
+ import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ background-color: ${GlobalColors.s2};
6
+ width: fit-content;
7
+ display: block;
8
+ padding-right: 10px;
9
+ border-radius: 5px;
10
+
11
+ select {
12
+ color: ${GlobalColors.s4};
13
+ outline: none;
14
+ padding: 10px;
15
+ background-color: transparent;
16
+ border: none;
17
+ option:first-of-type {
18
+ }
19
+ }
20
+ `;
@@ -0,0 +1,10 @@
1
+ import { Calendar } from ".";
2
+
3
+ export default {
4
+ title: "Components/organisms/Calendar",
5
+ component: Calendar,
6
+ };
7
+
8
+ const Template = (args) => <Calendar {...args} />;
9
+ export const CalendarDefault = Template.bind({});
10
+ CalendarDefault.args = {};
@@ -0,0 +1,17 @@
1
+ import { Container } from "./styles";
2
+ import DatePicker from "react-datepicker";
3
+ import { useState } from "react";
4
+
5
+ export const Calendar = ({ onChange, startDate, endDate }) => {
6
+ return (
7
+ <Container>
8
+ <DatePicker
9
+ selected={startDate}
10
+ onChange={onChange}
11
+ startDate={startDate}
12
+ endDate={endDate}
13
+ selectsRange
14
+ />
15
+ </Container>
16
+ );
17
+ };