contentoh-components-library 21.4.7 → 21.4.9

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 (108) hide show
  1. package/.env.development +1 -5
  2. package/.env.production +1 -3
  3. package/dist/assets/fonts/roboto/LICENSE.txt +202 -0
  4. package/dist/components/atoms/Avatar/index.js +2 -3
  5. package/dist/components/atoms/Card/index.js +5 -46
  6. package/dist/components/atoms/Card/styles.js +1 -3
  7. package/dist/components/atoms/CheckBox/index.js +2 -7
  8. package/dist/components/atoms/CheckBox/styles.js +1 -1
  9. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  10. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  11. package/dist/components/molecules/HeaderTop/index.js +11 -68
  12. package/dist/components/molecules/TagAndInput/index.js +1 -1
  13. package/dist/components/organisms/Chat/Chat.stories.js +8 -27
  14. package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
  15. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  16. package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
  17. package/dist/components/organisms/Chat/Footer/index.js +39 -48
  18. package/dist/components/organisms/Chat/index.js +4 -49
  19. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  20. package/dist/components/organisms/Modal/styles.js +1 -1
  21. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +29 -169
  22. package/dist/components/pages/ProviderProductEdition/index.js +203 -213
  23. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  24. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +60 -85
  25. package/dist/components/pages/RetailerProductEdition/index.js +303 -315
  26. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  27. package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
  28. package/dist/index.js +52 -234
  29. package/package.json +1 -4
  30. package/src/components/atoms/Avatar/index.js +2 -8
  31. package/src/components/atoms/Card/index.js +2 -35
  32. package/src/components/atoms/Card/styles.js +5 -41
  33. package/src/components/atoms/CheckBox/index.js +1 -4
  34. package/src/components/atoms/CheckBox/styles.js +0 -2
  35. package/src/components/atoms/InputFormatter/styles.js +1 -2
  36. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  37. package/src/components/molecules/HeaderTop/index.js +6 -52
  38. package/src/components/molecules/TagAndInput/index.js +8 -10
  39. package/src/components/organisms/Chat/Chat.stories.js +7 -27
  40. package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
  41. package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
  42. package/src/components/organisms/Chat/ContentChat/index.js +12 -88
  43. package/src/components/organisms/Chat/Footer/index.js +0 -11
  44. package/src/components/organisms/Chat/index.js +4 -46
  45. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  46. package/src/components/organisms/Modal/styles.js +1 -4
  47. package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
  48. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +34 -188
  49. package/src/components/pages/ProviderProductEdition/index.js +132 -132
  50. package/src/components/pages/ProviderProductEdition/styles.js +1 -5
  51. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -72
  52. package/src/components/pages/RetailerProductEdition/index.js +138 -122
  53. package/src/components/pages/RetailerProductEdition/styles.js +0 -4
  54. package/src/components/pages/RetailerProductEdition/utils.js +0 -37
  55. package/src/index.js +0 -15
  56. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
  57. package/src/components/atoms/ImageCarousel/index.js +0 -103
  58. package/src/components/atoms/ImageCarousel/styles.js +0 -79
  59. package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
  60. package/src/components/atoms/PercentTag/index.js +0 -9
  61. package/src/components/atoms/PercentTag/styles.js +0 -69
  62. package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
  63. package/src/components/atoms/RatingStars/index.js +0 -31
  64. package/src/components/atoms/RatingStars/styles.js +0 -28
  65. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
  66. package/src/components/atoms/RetailerCatalog/index.js +0 -49
  67. package/src/components/atoms/RetailerCatalog/styles.js +0 -30
  68. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
  69. package/src/components/atoms/RetailerOption/index.js +0 -53
  70. package/src/components/atoms/RetailerOption/styles.js +0 -41
  71. package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
  72. package/src/components/atoms/RetailersList/index.js +0 -20
  73. package/src/components/atoms/RetailersList/styles.js +0 -19
  74. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
  75. package/src/components/atoms/UserCatalog/index.js +0 -96
  76. package/src/components/atoms/UserCatalog/styles.js +0 -24
  77. package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
  78. package/src/components/atoms/UserOption/index.js +0 -95
  79. package/src/components/atoms/UserOption/styles.js +0 -61
  80. package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
  81. package/src/components/atoms/UserSelector/index.js +0 -86
  82. package/src/components/atoms/UserSelector/styles.js +0 -55
  83. package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
  84. package/src/components/molecules/GridItem/index.js +0 -97
  85. package/src/components/molecules/GridItem/styles.js +0 -104
  86. package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
  87. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
  88. package/src/components/molecules/HeaderItem/index.js +0 -26
  89. package/src/components/molecules/HeaderItem/styles.js +0 -27
  90. package/src/components/molecules/RowItem/ColumnItem.js +0 -9
  91. package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
  92. package/src/components/molecules/RowItem/index.js +0 -45
  93. package/src/components/molecules/RowItem/styles.js +0 -40
  94. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
  95. package/src/components/molecules/StripeCardForm/index.js +0 -42
  96. package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
  97. package/src/components/molecules/StripeCardForm/styles.js +0 -73
  98. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
  99. package/src/components/molecules/StripeCardSelector/index.js +0 -44
  100. package/src/components/molecules/StripeCardSelector/styles.js +0 -4
  101. package/src/components/molecules/StripeCardSelector/utils.js +0 -17
  102. package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
  103. package/src/components/organisms/GridProducts/index.js +0 -50
  104. package/src/components/organisms/GridProducts/styles.js +0 -14
  105. package/src/components/organisms/GridProducts/utils.js +0 -111
  106. package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
  107. package/src/components/organisms/SideModal/index.js +0 -50
  108. package/src/components/organisms/SideModal/styles.js +0 -30
@@ -1,50 +0,0 @@
1
- import { Container } from "./styles";
2
- import { GridItem } from "../../molecules/GridItem";
3
- import { HeaderItem } from "../../molecules/HeaderItem";
4
- import { RowItem } from "../../molecules/RowItem";
5
-
6
- export const GridProducts = ({
7
- products = [],
8
- columnsArray = [],
9
- gridView = true,
10
- chkOnChange,
11
- selected = [],
12
- chkChecked,
13
- checkAll,
14
- chkCheckedAll,
15
- onGridClick,
16
- }) => {
17
- return (
18
- <Container>
19
- {!gridView ? (
20
- products?.map(({ gridElement, product, id }, i) => (
21
- <GridItem
22
- key={i}
23
- id={id}
24
- index={i}
25
- product={product}
26
- gridElement={gridElement}
27
- chkOnChange={chkOnChange}
28
- onGridClick={onGridClick}
29
- selected={selected}
30
- chkChecked={chkChecked}
31
- />
32
- ))
33
- ) : (
34
- <div className="table-view">
35
- <HeaderItem
36
- columnsArray={columnsArray}
37
- checkAll={checkAll}
38
- chkCheckedAll={chkCheckedAll}
39
- />
40
- <RowItem
41
- productsArray={products}
42
- chkOnChange={chkOnChange}
43
- onGridClick={onGridClick}
44
- chkChecked={chkChecked}
45
- />
46
- </div>
47
- )}
48
- </Container>
49
- );
50
- };
@@ -1,14 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- export const Container = styled.div`
4
- display: flex;
5
- flex-wrap: wrap;
6
- gap: 10px;
7
- height: calc(100% - 100px);
8
- overflow: auto;
9
-
10
- .table-view {
11
- height: 100%;
12
- width: 100%;
13
- }
14
- `;
@@ -1,111 +0,0 @@
1
- import { RetailerCatalog } from "../../atoms/RetailerCatalog";
2
- import { UserCatalog } from "../../atoms/UserCatalog";
3
-
4
- export const getProductsToTable = (
5
- products = [],
6
- textSpecialists,
7
- imagesSpecialists,
8
- auditors,
9
- images,
10
- onAssign
11
- ) => {
12
- const productsTableArray = [];
13
-
14
- products.forEach((product) => {
15
- const { article, orderId, upc, status, version } = product;
16
- const id = article?.id_article + "-" + orderId;
17
- const imgArray = images[article?.id_article + "-" + version];
18
- const element = {
19
- id,
20
- cols: [
21
- { name: article?.country || "-", flex: 1, minWidth: 100 },
22
- { name: orderId || "-", flex: 1, minWidth: 100 },
23
- { name: upc || "-", flex: 1, minWidth: 100 },
24
- { name: article?.name || "-", flex: 1, minWidth: 200 },
25
- { name: "S/M" || "-", flex: 1, minWidth: 100 },
26
- { name: status || "-", flex: 1, minWidth: 100 },
27
- {
28
- name: (
29
- <RetailerCatalog
30
- id={"retailers-" + id}
31
- article={product}
32
- retailers={product.retailers}
33
- />
34
- ),
35
- flex: 1,
36
- minWidth: 100,
37
- },
38
- { name: product.prio, flex: 1, minWidth: 100 },
39
- {
40
- name: (
41
- <UserCatalog
42
- datasheet={article.id_datasheet_especialist}
43
- description={article.id_description_especialist}
44
- images={article.id_images_especialist}
45
- auditor={article.id_auditor}
46
- textSpecialists={textSpecialists}
47
- imagesSpecialists={imagesSpecialists}
48
- auditors={auditors}
49
- id={"users-" + id}
50
- product={product}
51
- onAssign={onAssign}
52
- />
53
- ),
54
- flex: 1,
55
- minWidth: 100,
56
- },
57
- { name: "Cont.", flex: 1, minWidth: 100 },
58
- ],
59
- gridElement: {
60
- images: imgArray,
61
- info: [
62
- { title: "name", value: article?.name || "-" },
63
- { title: "order", value: orderId || "-" },
64
- { title: "category", value: article?.category || "-" },
65
- { title: "company", value: article?.company_name || "-" },
66
- { title: "price", value: article?.price || "-" },
67
- ],
68
- status: [
69
- { title: "datasheet", value: product?.datasheet_status, percent: 80 },
70
- {
71
- title: "description",
72
- value: product?.description_status,
73
- percent: 80,
74
- },
75
- { title: "images", value: product?.images_status, percent: 80 },
76
- ],
77
- catalogs: {
78
- leftSide: (
79
- <RetailerCatalog
80
- id={"retailers-" + id}
81
- limit={2}
82
- article={product}
83
- retailers={product.retailers}
84
- />
85
- ),
86
- rightSide: (
87
- <UserCatalog
88
- datasheet={article.id_datasheet_especialist}
89
- description={article.id_description_especialist}
90
- images={article.id_images_especialist}
91
- auditor={article.id_auditor}
92
- textSpecialists={textSpecialists}
93
- imagesSpecialists={imagesSpecialists}
94
- auditors={auditors}
95
- id={"users-" + id}
96
- product={product}
97
- onAssign={onAssign}
98
- />
99
- ),
100
- },
101
- },
102
- showBottom: true,
103
- product,
104
- article,
105
- };
106
-
107
- productsTableArray.push(element);
108
- });
109
-
110
- return productsTableArray;
111
- };
@@ -1,23 +0,0 @@
1
- import { SideModal } from ".";
2
- import { ButtonV2 } from "../../atoms/ButtonV2";
3
-
4
- export default {
5
- title: "Components/organisms/SideModal",
6
- component: SideModal,
7
- };
8
-
9
- const Template = (args) => <SideModal {...args} />;
10
-
11
- export const DefaultSideModal = Template.bind({});
12
- DefaultSideModal.args = {
13
- show: false,
14
- header: [
15
- <div className="title-container">
16
- <h2></h2>
17
- </div>,
18
- <ButtonV2 label="Ir al Checkout" />,
19
- <ButtonV2 label="X" />,
20
- ],
21
- body: <></>,
22
- footer: <></>,
23
- };
@@ -1,50 +0,0 @@
1
- import { useRef } from "react";
2
- import { Container } from "./styles";
3
- import { useEffect } from "react";
4
- import { PropaneSharp } from "@mui/icons-material";
5
-
6
- export const SideModal = ({
7
- header,
8
- body,
9
- footer,
10
- show,
11
- setShow,
12
- id = "side-modal",
13
- }) => {
14
- const modal = useRef();
15
-
16
- const closeModal = (e) => {
17
- if (!e.target.closest(`#${id}`) && show) {
18
- document.removeEventListener("click", closeModal, false);
19
- modal?.current?.classList?.remove("shown");
20
- setShow && setShow(false);
21
- }
22
- };
23
-
24
- useEffect(() => {
25
- if (show && modal.current) {
26
- document.addEventListener("click", closeModal, false);
27
- modal?.current?.classList?.add("shown");
28
- }
29
- }, [show]);
30
-
31
- useEffect(() => {
32
- return () => {
33
- document.removeEventListener("click", closeModal, false);
34
- modal?.current?.classList?.remove("shown");
35
- setShow && setShow(false);
36
- };
37
- }, []);
38
-
39
- return (
40
- show && (
41
- <Container>
42
- <div id={id} ref={modal} className="modal-container">
43
- <div className="modal-header">{header}</div>
44
- <div className="modal-body">{body}</div>
45
- <div className="modal-footer">{footer}</div>
46
- </div>
47
- </Container>
48
- )
49
- );
50
- };
@@ -1,30 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- export const Container = styled.div`
4
- width: 100vw;
5
- height: 100vh;
6
- position: fixed;
7
- z-index: 9999999;
8
- background-color: transparent;
9
- top: 0;
10
- left: 0;
11
-
12
- .modal-container {
13
- width: 600px;
14
- height: 100%;
15
- position: absolute;
16
- right: -600px;
17
- background-color: #fff;
18
- display: flex;
19
- flex-direction: column;
20
- box-shadow: -0.5px 0px 5px #f0f0f0;
21
- border: 1px solid #f0f0f0;
22
- .modal-body {
23
- flex: 1;
24
- }
25
-
26
- &.shown {
27
- right: 0;
28
- }
29
- }
30
- `;