contentoh-components-library 21.4.4 → 21.4.6

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 (98) hide show
  1. package/dist/components/atoms/Avatar/index.js +3 -2
  2. package/dist/components/atoms/CheckBox/index.js +4 -1
  3. package/dist/components/atoms/CheckBox/styles.js +1 -1
  4. package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +90 -0
  5. package/dist/components/atoms/ImageCarousel/index.js +120 -0
  6. package/dist/components/atoms/ImageCarousel/styles.js +18 -0
  7. package/dist/components/atoms/PercentTag/PercentTag.stories.js +31 -0
  8. package/dist/components/atoms/PercentTag/index.js +23 -0
  9. package/dist/components/atoms/PercentTag/styles.js +22 -0
  10. package/dist/components/atoms/RatingStars/RatingStars.stories.js +30 -0
  11. package/dist/components/atoms/RatingStars/index.js +53 -0
  12. package/dist/components/atoms/RatingStars/styles.js +18 -0
  13. package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +48 -0
  14. package/dist/components/atoms/RetailerCatalog/index.js +69 -0
  15. package/dist/components/atoms/RetailerCatalog/styles.js +20 -0
  16. package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +33 -0
  17. package/dist/components/atoms/RetailerOption/index.js +62 -0
  18. package/dist/components/atoms/RetailerOption/styles.js +20 -0
  19. package/dist/components/atoms/RetailersList/RetailersList.stories.js +45 -0
  20. package/dist/components/atoms/RetailersList/index.js +46 -0
  21. package/dist/components/atoms/RetailersList/styles.js +18 -0
  22. package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +73 -0
  23. package/dist/components/atoms/UserCatalog/index.js +101 -0
  24. package/dist/components/atoms/UserCatalog/styles.js +18 -0
  25. package/dist/components/atoms/UserOption/UserOption.stories.js +40 -0
  26. package/dist/components/atoms/UserOption/index.js +130 -0
  27. package/dist/components/atoms/UserOption/styles.js +20 -0
  28. package/dist/components/atoms/UserSelector/UserSelector.stories.js +40 -0
  29. package/dist/components/atoms/UserSelector/index.js +98 -0
  30. package/dist/components/atoms/UserSelector/styles.js +32 -0
  31. package/dist/components/molecules/GridItem/GridItem.stories.js +123 -0
  32. package/dist/components/molecules/GridItem/index.js +143 -0
  33. package/dist/components/molecules/GridItem/styles.js +20 -0
  34. package/dist/components/molecules/HeaderItem/ColumnItem.js +23 -0
  35. package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +70 -0
  36. package/dist/components/molecules/HeaderItem/index.js +42 -0
  37. package/dist/components/molecules/HeaderItem/styles.js +30 -0
  38. package/dist/components/molecules/RowItem/ColumnItem.js +23 -0
  39. package/dist/components/molecules/RowItem/RowItem.stories.js +5242 -0
  40. package/dist/components/molecules/RowItem/index.js +58 -0
  41. package/dist/components/molecules/RowItem/styles.js +30 -0
  42. package/dist/components/organisms/GridProducts/GridProducts.stories.js +5097 -0
  43. package/dist/components/organisms/GridProducts/index.js +63 -0
  44. package/dist/components/organisms/GridProducts/styles.js +18 -0
  45. package/dist/components/organisms/GridProducts/utils.js +149 -0
  46. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -28
  47. package/dist/components/pages/RetailerProductEdition/index.js +23 -0
  48. package/dist/index.js +201 -58
  49. package/package.json +2 -1
  50. package/src/components/atoms/Avatar/index.js +8 -2
  51. package/src/components/atoms/CheckBox/index.js +2 -1
  52. package/src/components/atoms/CheckBox/styles.js +2 -0
  53. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +76 -0
  54. package/src/components/atoms/ImageCarousel/index.js +103 -0
  55. package/src/components/atoms/ImageCarousel/styles.js +79 -0
  56. package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -0
  57. package/src/components/atoms/PercentTag/index.js +9 -0
  58. package/src/components/atoms/PercentTag/styles.js +69 -0
  59. package/src/components/atoms/RatingStars/RatingStars.stories.js +10 -0
  60. package/src/components/atoms/RatingStars/index.js +31 -0
  61. package/src/components/atoms/RatingStars/styles.js +28 -0
  62. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -0
  63. package/src/components/atoms/RetailerCatalog/index.js +49 -0
  64. package/src/components/atoms/RetailerCatalog/styles.js +30 -0
  65. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -0
  66. package/src/components/atoms/RetailerOption/index.js +53 -0
  67. package/src/components/atoms/RetailerOption/styles.js +41 -0
  68. package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -0
  69. package/src/components/atoms/RetailersList/index.js +20 -0
  70. package/src/components/atoms/RetailersList/styles.js +19 -0
  71. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +67 -0
  72. package/src/components/atoms/UserCatalog/index.js +94 -0
  73. package/src/components/atoms/UserCatalog/styles.js +24 -0
  74. package/src/components/atoms/UserOption/UserOption.stories.js +25 -0
  75. package/src/components/atoms/UserOption/index.js +95 -0
  76. package/src/components/atoms/UserOption/styles.js +61 -0
  77. package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -0
  78. package/src/components/atoms/UserSelector/index.js +86 -0
  79. package/src/components/atoms/UserSelector/styles.js +55 -0
  80. package/src/components/molecules/GridItem/GridItem.stories.js +126 -0
  81. package/src/components/molecules/GridItem/index.js +97 -0
  82. package/src/components/molecules/GridItem/styles.js +104 -0
  83. package/src/components/molecules/HeaderItem/ColumnItem.js +9 -0
  84. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -0
  85. package/src/components/molecules/HeaderItem/index.js +26 -0
  86. package/src/components/molecules/HeaderItem/styles.js +27 -0
  87. package/src/components/molecules/RowItem/ColumnItem.js +9 -0
  88. package/src/components/molecules/RowItem/RowItem.stories.js +5660 -0
  89. package/src/components/molecules/RowItem/index.js +45 -0
  90. package/src/components/molecules/RowItem/styles.js +40 -0
  91. package/src/components/organisms/GridProducts/GridProducts.stories.js +5485 -0
  92. package/src/components/organisms/GridProducts/index.js +50 -0
  93. package/src/components/organisms/GridProducts/styles.js +15 -0
  94. package/src/components/organisms/GridProducts/utils.js +111 -0
  95. package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
  96. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +39 -21
  97. package/src/components/pages/RetailerProductEdition/index.js +12 -0
  98. package/src/index.js +12 -0
@@ -0,0 +1,97 @@
1
+ import { Container } from "./styles";
2
+ import { ImageCarousel } from "../../atoms/ImageCarousel";
3
+ import { Status } from "../../atoms/Status";
4
+ import { PercentTag } from "../../atoms/PercentTag";
5
+ import { ButtonV2 } from "../../atoms/ButtonV2";
6
+ import { faStar as starIcon } from "@fortawesome/free-regular-svg-icons";
7
+ import { faCartPlus as cartIcon } from "@fortawesome/free-solid-svg-icons";
8
+ import { RatingStars } from "../../atoms/RatingStars";
9
+ import { CheckBox } from "../../atoms/CheckBox";
10
+
11
+ export const GridItem = ({
12
+ gridElement = {},
13
+ product,
14
+ id,
15
+ isMerchans,
16
+ chkOnChange,
17
+ onGridClick,
18
+ chkChecked,
19
+ index,
20
+ }) => {
21
+ const { images = [], info = [], status = [], catalogs = {} } = gridElement;
22
+
23
+ const getSrvName = (srv) => {
24
+ switch (srv) {
25
+ case "datasheet":
26
+ return "F.T.";
27
+ case "description":
28
+ return "D.C.";
29
+ case "images":
30
+ return "IMG";
31
+ }
32
+ };
33
+
34
+ return (
35
+ <Container onClick={(e) => onGridClick && onGridClick(e, product, index)}>
36
+ <div className="chk-container" onClick={(e) => e.stopPropagation()}>
37
+ <CheckBox
38
+ id={id}
39
+ name={id}
40
+ className="chk-absolute"
41
+ onChange={(e) => chkOnChange && chkOnChange(e, product)}
42
+ defaultChecked={chkChecked && chkChecked(product)}
43
+ />
44
+ </div>
45
+ <ImageCarousel imageArray={images} />
46
+ <div className="data-body">
47
+ {info?.map((item, i) =>
48
+ i === 0 ? <h3 key={i}>{item.value}</h3> : <p key={i}>{item.value}</p>
49
+ )}
50
+ </div>
51
+ <div className="status-slider">
52
+ {status?.map((item) => (
53
+ <div className="status-element">
54
+ <div className="srv-name">
55
+ <p>{getSrvName(item.title)}</p>
56
+ </div>
57
+ <Status statusType={item.value} />
58
+ <PercentTag percent={item.percent} progressBarType={item.value} />
59
+ </div>
60
+ ))}
61
+ </div>
62
+ {isMerchans ? (
63
+ <div className="cart-and-raiting">
64
+ <ButtonV2
65
+ borderType="circle"
66
+ type="whiteS2"
67
+ icon={starIcon}
68
+ size={10}
69
+ className="star-button"
70
+ />
71
+ <ButtonV2
72
+ borderType="circle"
73
+ type="whiteS2"
74
+ icon={cartIcon}
75
+ size={10}
76
+ className="star-button"
77
+ />
78
+ <ButtonV2
79
+ borderType="circle"
80
+ type="whiteS2"
81
+ icon={cartIcon}
82
+ size={10}
83
+ className="star-button"
84
+ />
85
+ <RatingStars ratingValue={4} />
86
+ </div>
87
+ ) : (
88
+ catalogs && (
89
+ <div className="retailers-and-user">
90
+ <div className="retailers-container">{catalogs.leftSide}</div>
91
+ <div className="users-container">{catalogs.rightSide}</div>
92
+ </div>
93
+ )
94
+ )}
95
+ </Container>
96
+ );
97
+ };
@@ -0,0 +1,104 @@
1
+ import styled from "styled-components";
2
+ import { FontFamily } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ width: 175px;
6
+ border: 1px solid #f0f0f0;
7
+ position: relative;
8
+ height: fit-content;
9
+
10
+ .chk-container {
11
+ position: absolute;
12
+ top: 5px;
13
+ left: 5px;
14
+ z-index: 5;
15
+ height: 16px;
16
+ }
17
+
18
+ .data-body {
19
+ padding: 10px;
20
+ border-bottom: 1px solid #f0f0f0;
21
+
22
+ h3,
23
+ p {
24
+ color: #262626;
25
+ font-family: ${FontFamily.Lato};
26
+ font-size: 12px;
27
+ line-height: 16px;
28
+ overflow: hidden;
29
+ white-space: nowrap;
30
+ text-overflow: ellipsis;
31
+
32
+ & + p {
33
+ margin-top: 5px;
34
+ }
35
+ }
36
+ p {
37
+ font-size: 10px;
38
+ line-height: 12px;
39
+ color: #808080;
40
+ }
41
+ }
42
+
43
+ .status-slider {
44
+ display: flex;
45
+ padding: 5px 10px;
46
+ overflow: auto;
47
+ border-bottom: 1px solid #f0f0f0;
48
+ flex-wrap: nowrap;
49
+
50
+ .status-element {
51
+ display: flex;
52
+
53
+ .srv-name {
54
+ background-color: #808080;
55
+ padding: 0 10px;
56
+ border-radius: 5px;
57
+ p {
58
+ font-family: ${FontFamily.AvenirNext};
59
+ font-size: 12px;
60
+ line-height: 20px;
61
+ font-weight: 700;
62
+ color: #fff;
63
+ }
64
+ }
65
+ }
66
+
67
+ * + * {
68
+ margin-left: 10px;
69
+ }
70
+ }
71
+
72
+ .cart-and-raiting,
73
+ .retailers-and-user {
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: space-between;
77
+ padding: 5px 10px;
78
+ .star-button {
79
+ button {
80
+ padding: 3px;
81
+ color: transparent;
82
+ -webkit-text-stroke: 1px #808080;
83
+ }
84
+ }
85
+ }
86
+
87
+ .retailers-and-user {
88
+ padding: 0;
89
+ > * {
90
+ flex: 1 0 50%;
91
+ display: flex;
92
+ padding: 5px;
93
+ height: 36px;
94
+ }
95
+ .retailers-container {
96
+ border-right: 1px solid #f0f0f0;
97
+ }
98
+ }
99
+
100
+ &:hover {
101
+ cursor: pointer;
102
+ box-shadow: 1px 2px 5px black;
103
+ }
104
+ `;
@@ -0,0 +1,9 @@
1
+ import { Column } from "./styles";
2
+
3
+ export const ColumnItem = ({ name, flex, minWidth }) => {
4
+ return (
5
+ <Column flex={flex} minWidth={minWidth}>
6
+ {name}
7
+ </Column>
8
+ );
9
+ };
@@ -0,0 +1,24 @@
1
+ import { HeaderItem } from ".";
2
+
3
+ export default {
4
+ title: "Components/molecules/HeaderItem",
5
+ component: HeaderItem,
6
+ };
7
+
8
+ const Template = (args) => <HeaderItem {...args} />;
9
+ export const HeaderItemDefault = Template.bind({});
10
+
11
+ HeaderItemDefault.args = {
12
+ columnsArray: [
13
+ { name: "Reg", flex: 1, minWidth: 100 },
14
+ { name: "Orden", flex: 1, minWidth: 100 },
15
+ { name: "UPC", flex: 1, minWidth: 100 },
16
+ { name: "Nombre", flex: 1, minWidth: 100 },
17
+ { name: "Marca", flex: 1, minWidth: 100 },
18
+ { name: "Estatus", flex: 1, minWidth: 100 },
19
+ { name: "Cadenas", flex: 1, minWidth: 100 },
20
+ { name: "Prio", flex: 1, minWidth: 100 },
21
+ { name: "E.D", flex: 1, minWidth: 100 },
22
+ { name: "Cont.", flex: 1, minWidth: 100 },
23
+ ],
24
+ };
@@ -0,0 +1,26 @@
1
+ import { Container } from "./styles";
2
+ import { ColumnItem } from "./ColumnItem";
3
+ import { CheckBox } from "../../atoms/CheckBox";
4
+
5
+ export const HeaderItem = ({ columnsArray = [], checkAll, chkCheckedAll }) => {
6
+ return (
7
+ <Container>
8
+ <div className="chk-global-container">
9
+ <CheckBox
10
+ id={"chk-global"}
11
+ name={"chk-global"}
12
+ onChange={(e) => checkAll && checkAll(e)}
13
+ checked={chkCheckedAll && chkCheckedAll()}
14
+ />
15
+ </div>
16
+ {columnsArray.map((col, i) => (
17
+ <ColumnItem
18
+ key={i}
19
+ flex={col.flex}
20
+ name={col.name}
21
+ minWidth={col.minWidth}
22
+ />
23
+ ))}
24
+ </Container>
25
+ );
26
+ };
@@ -0,0 +1,27 @@
1
+ import styled from "styled-components";
2
+ import { FontFamily } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ background-color: #f0f0f0;
6
+ display: flex;
7
+ width: 100%;
8
+ min-width: fit-content;
9
+
10
+ .chk-global-container {
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: center;
14
+ min-width: 30px;
15
+ }
16
+ `;
17
+
18
+ export const Column = styled.div`
19
+ flex: ${({ flex }) => (flex ? flex : 1)};
20
+ min-width: ${({ minWidth }) => (minWidth ? minWidth : 100)}px;
21
+ text-align: center;
22
+ color: #262626;
23
+ font-family: ${FontFamily.Lato};
24
+ font-size: 12px;
25
+ line-height: 16px;
26
+ padding: 10px 5px;
27
+ `;
@@ -0,0 +1,9 @@
1
+ import { Column } from "./styles";
2
+
3
+ export const ColumnItem = ({ element, flex, minWidth }) => {
4
+ return (
5
+ <Column flex={flex} minWidth={minWidth}>
6
+ {element}
7
+ </Column>
8
+ );
9
+ };