contentoh-components-library 21.3.12 → 21.3.13

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 (117) hide show
  1. package/.env.development +0 -5
  2. package/dist/assets/images/generalButton/closeIcon.svg +2 -2
  3. package/dist/components/atoms/ProgressBar/index.js +6 -36
  4. package/dist/components/atoms/ProgressBar/styles.js +3 -11
  5. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
  6. package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
  7. package/dist/components/molecules/HeaderTop/index.js +6 -23
  8. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  9. package/dist/components/molecules/ProductNameHeader/index.js +4 -6
  10. package/dist/components/organisms/FullProductNameHeader/index.js +0 -1
  11. package/dist/components/pages/Dashboard/index.js +21 -13
  12. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +50 -65
  13. package/dist/components/pages/ProviderProductEdition/index.js +11 -15
  14. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +86 -60
  15. package/dist/components/pages/RetailerProductEdition/index.js +12 -13
  16. package/dist/global-files/fonts.css +0 -6
  17. package/dist/global-files/variables.js +0 -2
  18. package/dist/index.js +46 -267
  19. package/package.json +1 -12
  20. package/src/assets/images/generalButton/closeIcon.svg +2 -2
  21. package/src/components/atoms/ProgressBar/index.js +5 -40
  22. package/src/components/atoms/ProgressBar/styles.js +0 -24
  23. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +12 -20
  24. package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
  25. package/src/components/molecules/HeaderTop/index.js +8 -29
  26. package/src/components/molecules/HeaderTop/styles.js +0 -4
  27. package/src/components/molecules/ProductNameHeader/index.js +2 -7
  28. package/src/components/organisms/FullProductNameHeader/index.js +0 -1
  29. package/src/components/pages/Dashboard/index.js +37 -31
  30. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +49 -67
  31. package/src/components/pages/ProviderProductEdition/index.js +7 -16
  32. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +85 -62
  33. package/src/components/pages/RetailerProductEdition/index.js +10 -12
  34. package/src/global-files/fonts.css +0 -6
  35. package/src/global-files/variables.js +0 -2
  36. package/src/index.js +0 -17
  37. package/src/assets/images/customSelect/starIcon.svg +0 -14
  38. package/src/assets/images/defaultImages/Spinner.gif +0 -0
  39. package/src/assets/images/defaultImages/notFound.svg +0 -124
  40. package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -47
  41. package/src/components/atoms/ButtonFileChooser/index.js +0 -68
  42. package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
  43. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -53
  44. package/src/components/atoms/ButtonV2/index.js +0 -85
  45. package/src/components/atoms/ButtonV2/styles.js +0 -217
  46. package/src/components/atoms/CustomIcon/CustomIcon.stories.js +0 -36
  47. package/src/components/atoms/CustomIcon/index.js +0 -41
  48. package/src/components/atoms/CustomIcon/styles.js +0 -85
  49. package/src/components/atoms/IconFile/IconFile.stories.js +0 -35
  50. package/src/components/atoms/IconFile/index.js +0 -119
  51. package/src/components/atoms/IconFile/styles.js +0 -67
  52. package/src/components/atoms/Image/Image.stories.js +0 -51
  53. package/src/components/atoms/Image/index.js +0 -55
  54. package/src/components/atoms/Image/styles.js +0 -34
  55. package/src/components/atoms/ImageLink/ImageLink.stories.js +0 -43
  56. package/src/components/atoms/ImageLink/index.js +0 -57
  57. package/src/components/atoms/ImageLink/styles.js +0 -30
  58. package/src/components/atoms/ImagePreview/ImagePreview.stories.js +0 -52
  59. package/src/components/atoms/ImagePreview/index.js +0 -178
  60. package/src/components/atoms/ImagePreview/styles.js +0 -77
  61. package/src/components/atoms/InputText/InputText.stories.js +0 -39
  62. package/src/components/atoms/InputText/index.js +0 -61
  63. package/src/components/atoms/InputText/styles.js +0 -89
  64. package/src/components/atoms/NotFound/NotFound.stories.js +0 -19
  65. package/src/components/atoms/NotFound/index.js +0 -52
  66. package/src/components/atoms/NotFound/styles.js +0 -55
  67. package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -26
  68. package/src/components/atoms/SelectItemV2/index.js +0 -61
  69. package/src/components/atoms/SelectItemV2/styles.js +0 -90
  70. package/src/components/atoms/Tooltip/Tooltip.stories.js +0 -51
  71. package/src/components/atoms/Tooltip/index.js +0 -59
  72. package/src/components/atoms/Tooltip/styles.js +0 -42
  73. package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -54
  74. package/src/components/molecules/ButtonDownloadFile/index.js +0 -109
  75. package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
  76. package/src/components/molecules/Dropdown/Dropdown.stories.js +0 -103
  77. package/src/components/molecules/Dropdown/index.js +0 -150
  78. package/src/components/molecules/Dropdown/styles.js +0 -75
  79. package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -68
  80. package/src/components/molecules/ImageTooltip/index.js +0 -63
  81. package/src/components/molecules/ImageTooltip/styles.js +0 -18
  82. package/src/components/molecules/SelectV2/SelectV2.stories.js +0 -115
  83. package/src/components/molecules/SelectV2/index.js +0 -357
  84. package/src/components/molecules/SelectV2/styles.js +0 -105
  85. package/src/components/molecules/SelectV2/test.js +0 -61
  86. package/src/components/molecules/SelectV2/test.stories.js +0 -10
  87. package/src/components/organisms/Chat/Chat.stories.js +0 -147
  88. package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -65
  89. package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
  90. package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
  91. package/src/components/organisms/Chat/ChatLists/index.js +0 -141
  92. package/src/components/organisms/Chat/ChatLists/styles.js +0 -162
  93. package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -142
  94. package/src/components/organisms/Chat/ContainerItems/index.js +0 -512
  95. package/src/components/organisms/Chat/ContainerItems/styles.js +0 -328
  96. package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -102
  97. package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
  98. package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
  99. package/src/components/organisms/Chat/ContentChat/index.js +0 -897
  100. package/src/components/organisms/Chat/ContentChat/styles.js +0 -41
  101. package/src/components/organisms/Chat/Footer/Footer.stories.js +0 -22
  102. package/src/components/organisms/Chat/Footer/index.js +0 -661
  103. package/src/components/organisms/Chat/Footer/styles.js +0 -286
  104. package/src/components/organisms/Chat/Header/Header.stories.js +0 -66
  105. package/src/components/organisms/Chat/Header/index.js +0 -94
  106. package/src/components/organisms/Chat/Header/styles.js +0 -49
  107. package/src/components/organisms/Chat/index.js +0 -235
  108. package/src/components/organisms/Chat/styles.js +0 -42
  109. package/src/components/organisms/Modal/Modal.stories.js +0 -55
  110. package/src/components/organisms/Modal/index.js +0 -97
  111. package/src/components/organisms/Modal/styles.js +0 -103
  112. package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -16
  113. package/src/components/organisms/RangeCalendar/index.js +0 -121
  114. package/src/components/organisms/RangeCalendar/styles.js +0 -883
  115. package/src/global-files/handle_http.js +0 -225
  116. package/src/global-files/handle_userTech.js +0 -7
  117. package/src/global-files/utils.js +0 -315
@@ -1,53 +0,0 @@
1
- import { ButtonV2 } from "./index";
2
- import { faCamera as iconCamera } from "@fortawesome/free-solid-svg-icons";
3
-
4
- export default {
5
- title: "Components/atoms/ButtonV2",
6
- component: ButtonV2,
7
- argTypes: {
8
- type: {
9
- options: [
10
- undefined,
11
- "white",
12
- "whiteS2",
13
- "whiteS3",
14
- "whiteS4",
15
- "pink",
16
- "gray",
17
- "purple",
18
- "purpleS2",
19
- "black",
20
- ],
21
- control: { type: "select" },
22
- },
23
- borderType: {
24
- options: [undefined, "rectangle", "oval", "circle"],
25
- control: { type: "select" },
26
- },
27
- iconPosition: {
28
- options: [undefined, "left", "right", "top", "bottom"],
29
- control: { type: "select" },
30
- },
31
- },
32
- };
33
-
34
- const Template = (args) => <ButtonV2 {...args} />;
35
-
36
- export const ButtonTest = Template.bind({});
37
- ButtonTest.args = {
38
- id: "",
39
- key: "",
40
- disabled: false,
41
- isLoading: false,
42
- className: "",
43
- type: undefined,
44
- transparent: false,
45
- borderType: undefined,
46
- iconPosition: undefined,
47
- label: "Ejemplo boton",
48
- size: "20",
49
- icon: iconCamera,
50
- onClick: () => {
51
- console.log("click boton");
52
- },
53
- };
@@ -1,85 +0,0 @@
1
- import { Container } from "./styles";
2
- import { Button as ButtonMUI } from "@mui/material";
3
- import { FontAwesomeIcon as Icon } from "@fortawesome/react-fontawesome";
4
- import { faSpinner as iconLoading } from "@fortawesome/free-solid-svg-icons";
5
- import React from "react";
6
-
7
- export const ButtonV2 = (props) => {
8
- const {
9
- id,
10
- keyId,
11
- className,
12
- disabled,
13
- type, // white | whiteS2 | whiteS3 | whiteS4 | pink | gray | purple | purpleS2 | black => por default (white)
14
- transparent, // boolean => por default (NO transparent)
15
- label,
16
- size, // number ... label? size -> label && icon adaptable : size -> icon
17
- borderType, // rectangle | oval | circle
18
- icon, // icon fontawesome
19
- iconPosition, // left | right | top | bottom
20
- isLoading, // boolean
21
- onClick,
22
- } = props;
23
-
24
- return (
25
- <Container
26
- id={id}
27
- key={keyId}
28
- className={className}
29
- type={type}
30
- transparent={transparent}
31
- borderType={borderType}
32
- iconPosition={
33
- ["left", "right", "top", "bottom"].includes(iconPosition)
34
- ? iconPosition
35
- : "left"
36
- }
37
- icon={icon}
38
- label={label}
39
- size={size}
40
- disabled={disabled}
41
- isLoading={isLoading}
42
- >
43
- <ButtonMUI
44
- className={
45
- "button " +
46
- ([
47
- "white",
48
- "whiteS2",
49
- "whiteS3",
50
- "whiteS4",
51
- "pink",
52
- "gray",
53
- "purple",
54
- "purpleS2",
55
- "black",
56
- ].includes(type)
57
- ? type
58
- : "white") +
59
- (transparent ? " transparent" : " fill")
60
- }
61
- variant={"text"}
62
- disabled={disabled || isLoading}
63
- onClick={async (event) => onClick && (await onClick(event))}
64
- >
65
- {isLoading ? (
66
- <>
67
- <i className="iconLoading">
68
- <Icon pulse={true} icon={iconLoading} />
69
- </i>
70
- {label && label}
71
- </>
72
- ) : (
73
- <>
74
- {icon && (
75
- <i className="icon">
76
- <Icon icon={icon} />
77
- </i>
78
- )}
79
- {label && label}
80
- </>
81
- )}
82
- </ButtonMUI>
83
- </Container>
84
- );
85
- };
@@ -1,217 +0,0 @@
1
- import styled from "styled-components";
2
- import { GlobalColors, FontFamily } from "../../../global-files/variables";
3
-
4
- export const Container = styled.div`
5
- width: fit-content;
6
- padding: 0px;
7
- cursor: ${({ disabled, isLoading }) =>
8
- disabled || isLoading ? "not-allowed" : "pointer"};
9
- border-radius: ${({ label, borderType, transparent }) => {
10
- return borderType?.toLowerCase() === "rectangle"
11
- ? "6px"
12
- : borderType?.toLowerCase() === "oval"
13
- ? "17px"
14
- : borderType?.toLowerCase() === "circle"
15
- ? "50%"
16
- : transparent
17
- ? "6px"
18
- : label && label?.trim() !== ""
19
- ? "17px"
20
- : "6px"; // default rectangle
21
- }};
22
- border: none;
23
-
24
- .button {
25
- --size: ${({ size }) => (size ? size : "13")}px;
26
- width: 100%;
27
- min-width: min-content;
28
- cursor: inherit;
29
- display: flex;
30
- flex-direction: ${({ iconPosition }) =>
31
- iconPosition === "top"
32
- ? "column"
33
- : iconPosition === "right"
34
- ? "row-reverse"
35
- : iconPosition === "bottom"
36
- ? "column-reverse"
37
- : "row"};
38
- gap: 7px;
39
- align-items: center;
40
- justify-content: center;
41
- padding: ${({ label, borderType }) => {
42
- return label && label?.trim() !== ""
43
- ? "5px 15px" // button con label
44
- : "5px";
45
- }};
46
- border-radius: inherit;
47
- border: ${({ label, borderType, transparent }) => {
48
- return ["rectangle", "circle", "oval"].includes(borderType?.toLowerCase())
49
- ? "1px solid black"
50
- : transparent
51
- ? "none"
52
- : label && label?.trim() !== ""
53
- ? "1px solid black" // button con label
54
- : "none"; // button icon sin borde
55
- }};
56
- font-family: ${FontFamily.RobotoMedium}, sans-serif;
57
- font-size: var(--size);
58
- line-height: 1.2;
59
- text-transform: none;
60
-
61
- // tipos de botones fill
62
- &.fill {
63
- &.white {
64
- background-color: white;
65
- color: #e33aa9;
66
- border-color: #e33aa9;
67
- &:hover {
68
- background-color: #f4f4f4;
69
- }
70
- }
71
- &.whiteS2 {
72
- background-color: white;
73
- color: #7b7979;
74
- border-color: #f0f0f0;
75
- &:hover {
76
- background-color: #f4f4f4;
77
- }
78
- }
79
- &.whiteS3 {
80
- background-color: white;
81
- color: #262626;
82
- border-color: #f0f0f0;
83
- &:hover {
84
- background-color: #f4f4f4;
85
- }
86
- }
87
- &.whiteS4 {
88
- background-color: white;
89
- color: #8a6caa;
90
- border-color: #8a6caa;
91
- &:hover {
92
- background-color: #e0e0f1;
93
- }
94
- }
95
- &.pink {
96
- background-color: #e33aa9;
97
- color: white;
98
- border-color: #e33aa9;
99
- &:hover {
100
- background-color: #b42983;
101
- }
102
- }
103
- &.gray {
104
- background-color: #e8e5e5;
105
- color: #262626;
106
- border-color: #7b7979;
107
- .icon,
108
- .iconLoading {
109
- color: #7b7979;
110
- }
111
- &:hover {
112
- background-color: #d6d3d3;
113
- }
114
- }
115
- &.purple {
116
- background-color: #f7f7fc;
117
- color: #8a6caa;
118
- border-color: #8a6caa;
119
- &:hover {
120
- background-color: #e0e0f1;
121
- }
122
- }
123
- &.purpleS2 {
124
- background-color: #8a6caa;
125
- color: white;
126
- border-color: #8a6caa;
127
- &:hover {
128
- background-color: #61467e;
129
- }
130
- }
131
- }
132
-
133
- // tipos de botones transparent
134
- &.transparent {
135
- &:hover {
136
- background-color: transparent;
137
- }
138
- &.white {
139
- color: white;
140
- border-color: #e33aa9;
141
- &:hover {
142
- color: #d6d4d4;
143
- }
144
- }
145
- &.pink {
146
- color: #e33aa9;
147
- border-color: #e33aa9;
148
- &:hover {
149
- color: #b42983;
150
- }
151
- }
152
- &.gray {
153
- color: #262626;
154
- border-color: #7b7979;
155
- .icon,
156
- .iconLoading {
157
- color: #7b7979;
158
- transition: inherit;
159
- }
160
- &:hover {
161
- color: #7b7979;
162
- .icon,
163
- .iconLoading {
164
- color: #bdbbbb;
165
- }
166
- }
167
- }
168
- &.purple {
169
- color: #8a6caa;
170
- border-color: #8a6caa;
171
- &:hover {
172
- color: #714f95;
173
- }
174
- }
175
- &.black {
176
- color: #262626;
177
- border-color: #262626;
178
- &:hover {
179
- color: #7b7979;
180
- }
181
- }
182
- }
183
-
184
- .icon,
185
- .iconLoading {
186
- display: grid;
187
- place-items: center;
188
- color: inherit;
189
- font-size: ${({ label }) => {
190
- return label && label?.trim() !== ""
191
- ? "calc(var(--size) + 3px)" // button with label
192
- : "var(--size)"; // button icon
193
- }};
194
- }
195
- .iconLoading {
196
- font-size: ${({ icon }) => !icon && "var(--size)"};
197
- }
198
-
199
- // mismo estilo desabilitado para cualquier tipo de boton
200
- &:disabled {
201
- background-color: #fcebf7 !important;
202
- color: #7b7979 !important;
203
- border-color: #7b7979 !important;
204
-
205
- .icon {
206
- color: #9e9c9c !important;
207
- }
208
- .iconLoading {
209
- color: #9e2674 !important;
210
- }
211
-
212
- &:hover {
213
- background-color: #fcebf7 !important;
214
- }
215
- }
216
- }
217
- `;
@@ -1,36 +0,0 @@
1
- import { CustomIcon } from "./index";
2
- import { faCamera as iconCamera } from "@fortawesome/free-solid-svg-icons";
3
-
4
- export default {
5
- title: "Components/atoms/CustomIcon",
6
- component: CustomIcon,
7
- argTypes: {
8
- type: {
9
- options: [
10
- undefined,
11
- "white",
12
- "whiteS2",
13
- "pink",
14
- "gray",
15
- "purple",
16
- "black",
17
- ],
18
- control: { type: "select" },
19
- },
20
- borderType: {
21
- options: [undefined, "rectangle", "circle"],
22
- control: { type: "select" },
23
- },
24
- },
25
- };
26
-
27
- const Template = (args) => <CustomIcon {...args} />;
28
-
29
- export const ButtonTest = Template.bind({});
30
- ButtonTest.args = {
31
- type: undefined,
32
- transparent: false,
33
- borderType: undefined,
34
- size: "20",
35
- icon: iconCamera,
36
- };
@@ -1,41 +0,0 @@
1
- import { Container } from "./styles";
2
- import { FontAwesomeIcon as Icon } from "@fortawesome/react-fontawesome";
3
- import React from "react";
4
-
5
- export const CustomIcon = (props) => {
6
- const {
7
- id,
8
- key,
9
- className,
10
- type, // white | whiteS2 | pink | gray || purple | black => (default white)
11
- transparent, // boolean
12
- size, // number ... default (13)
13
- borderType, // rectangle || circle (default)
14
- icon, // icon fontawesome
15
- } = props;
16
-
17
- return (
18
- <>
19
- {icon ? (
20
- <Container
21
- id={id}
22
- key={key}
23
- className={
24
- "container-icon " +
25
- (["white", "whiteS2", "pink", "gray", "purple", "black"].includes(
26
- type
27
- )
28
- ? type
29
- : "white") +
30
- (transparent ? " transparent " : " fill ") +
31
- className
32
- }
33
- borderType={borderType}
34
- size={size}
35
- >
36
- <Icon icon={icon} />
37
- </Container>
38
- ) : null}
39
- </>
40
- );
41
- };
@@ -1,85 +0,0 @@
1
- import styled from "styled-components";
2
- import { GlobalColors, FontFamily } from "../../../global-files/variables";
3
-
4
- export const Container = styled.i`
5
- width: fit-content;
6
- min-width: min-content;
7
- cursor: default;
8
- display: grid;
9
- place-items: center;
10
- font-size: ${({ size }) => (size ? size : "13")}px;
11
- border-radius: ${({ borderType }) => {
12
- return borderType?.toLowerCase() === "rectangle"
13
- ? "6px"
14
- : borderType?.toLowerCase() === "circle"
15
- ? "50%"
16
- : "0px";
17
- }};
18
- padding: ${({ borderType }) => {
19
- return ["rectangle", "circle"].includes(borderType?.toLowerCase())
20
- ? "5px"
21
- : "0px";
22
- }};
23
- border: ${({ borderType, transparent }) => {
24
- return ["rectangle", "circle"].includes(borderType?.toLowerCase())
25
- ? "1px solid black"
26
- : "none";
27
- }};
28
-
29
- // tipos de iconos fill
30
- &.fill {
31
- &.white {
32
- background-color: white;
33
- color: #e33aa9;
34
- border-color: #e33aa9;
35
- }
36
- &.whiteS2 {
37
- background-color: white;
38
- color: #7b7979;
39
- border-color: #f0f0f0;
40
- }
41
- &.pink {
42
- background-color: #e33aa9;
43
- color: white;
44
- border-color: #e33aa9;
45
- }
46
- &.gray {
47
- background-color: #e8e5e5;
48
- border-color: #7b7979;
49
- color: #7b7979;
50
- }
51
- &.purple {
52
- background-color: #f7f7fc;
53
- color: #8a6caa;
54
- border-color: #8a6caa;
55
- }
56
- }
57
-
58
- // tipos de iconos transparent
59
- &.transparent {
60
- &.white {
61
- color: white;
62
- border-color: #e33aa9;
63
- }
64
- &.whiteS2 {
65
- color: #7b7979;
66
- border-color: #f0f0f0;
67
- }
68
- &.pink {
69
- color: #e33aa9;
70
- border-color: #e33aa9;
71
- }
72
- &.gray {
73
- color: #7b7979;
74
- border-color: #7b7979;
75
- }
76
- &.purple {
77
- color: #8a6caa;
78
- border-color: #8a6caa;
79
- }
80
- &.black {
81
- color: #262626;
82
- border-color: #262626;
83
- }
84
- }
85
- `;
@@ -1,35 +0,0 @@
1
- import { IconFile } from "./index";
2
-
3
- export default {
4
- title: "Components/atoms/IconFile",
5
- component: IconFile,
6
- argTypes: {
7
- type: {
8
- options: [
9
- undefined,
10
- "white",
11
- "whiteS2",
12
- "pink",
13
- "gray",
14
- "purple",
15
- "black",
16
- ],
17
- control: { type: "select" },
18
- },
19
- borderType: {
20
- options: [undefined, "rectangle", "circle"],
21
- control: { type: "select" },
22
- },
23
- },
24
- };
25
-
26
- const Template = (args) => <IconFile {...args} />;
27
-
28
- export const ButtonTest = Template.bind({});
29
- ButtonTest.args = {
30
- type: undefined,
31
- transparent: false,
32
- borderType: undefined,
33
- size: "100",
34
- ext: "doc",
35
- };
@@ -1,119 +0,0 @@
1
- import { Container } from "./styles";
2
- import {
3
- faFileExcel as IconFileExcel,
4
- faFileWord as IconFileWord,
5
- faFilePdf as IconFilePdf,
6
- faFileCsv as IconFileCsv,
7
- faFileImage as IconFileImg,
8
- faFilePowerpoint as IconFilePowerPoint,
9
- faFileZipper as IconFileZip,
10
- faFileCode as IconFileCode,
11
- faFileAudio as IconFileAudio,
12
- faFileLines as IconFileDefault,
13
- faFileVideo as IconFileVideo,
14
- } from "@fortawesome/free-solid-svg-icons";
15
- import React, { useRef } from "react";
16
- import { CustomIcon } from "../CustomIcon";
17
-
18
- export const IconFile = (props) => {
19
- const {
20
- id,
21
- key,
22
- className,
23
- type, // white | whiteS2 | pink | gray | purple | black => (default -> white)
24
- transparent, // boolean
25
- size, // number ... default (13)
26
- borderType, // rectangle || circle || (cualquier otro valor -> no borde)
27
- ext, // extension del file
28
- } = props;
29
- const extensions = {
30
- // file word
31
- docx: { icon: IconFileWord, type: "word" },
32
- docm: { icon: IconFileWord, type: "word" },
33
- doc: { icon: IconFileWord, type: "word" },
34
- docs: { icon: IconFileWord, type: "word" },
35
-
36
- // file excel
37
- xls: { icon: IconFileExcel, type: "excel" },
38
- xlsm: { icon: IconFileExcel, type: "excel" },
39
- xlsx: { icon: IconFileExcel, type: "excel" },
40
- tsv: { icon: IconFileExcel, type: "excel" },
41
- // file csv
42
- csv: { icon: IconFileCsv, type: "csv" },
43
- // file image
44
- svg: { icon: IconFileImg, type: "image" },
45
- gif: { icon: IconFileImg, type: "image" },
46
- // file pdf
47
- pdf: { icon: IconFilePdf, type: "pdf" },
48
- // file power point
49
- pot: { icon: IconFilePowerPoint, type: "powerPoint" },
50
- potm: { icon: IconFilePowerPoint, type: "powerPoint" },
51
- potx: { icon: IconFilePowerPoint, type: "powerPoint" },
52
- pps: { icon: IconFilePowerPoint, type: "powerPoint" },
53
- ppsm: { icon: IconFilePowerPoint, type: "powerPoint" },
54
- ppsx: { icon: IconFilePowerPoint, type: "powerPoint" },
55
- ppt: { icon: IconFilePowerPoint, type: "powerPoint" },
56
- pptm: { icon: IconFilePowerPoint, type: "powerPoint" },
57
- pptx: { icon: IconFilePowerPoint, type: "powerPoint" },
58
-
59
- // file zip
60
- rar: { icon: IconFileZip, type: "zip" },
61
- zip: { icon: IconFileZip, type: "zip" },
62
- tar: { icon: IconFileZip, type: "zip" },
63
-
64
- // file code
65
- xml: { icon: IconFileCode, type: "code" },
66
- htm: { icon: IconFileCode, type: "code" },
67
- html: { icon: IconFileCode, type: "code" },
68
- css: { icon: IconFileCode, type: "code" },
69
- js: { icon: IconFileCode, type: "code" },
70
- jsx: { icon: IconFileCode, type: "code" },
71
- ts: { icon: IconFileCode, type: "code" },
72
- tsx: { icon: IconFileCode, type: "code" },
73
- cpp: { icon: IconFileCode, type: "code" },
74
- c: { icon: IconFileCode, type: "code" },
75
- java: { icon: IconFileCode, type: "code" },
76
- php: { icon: IconFileCode, type: "code" },
77
- json: { icon: IconFileCode, type: "code" },
78
- sql: { icon: IconFileCode, type: "code" },
79
-
80
- // file video
81
- avi: { icon: IconFileVideo, type: "video" },
82
- mp4: { icon: IconFileVideo, type: "video" },
83
- mpeg: { icon: IconFileVideo, type: "video" },
84
- mpg: { icon: IconFileVideo, type: "video" },
85
- wmv: { icon: IconFileVideo, type: "video" },
86
-
87
- // file audio
88
- m4a: { icon: IconFileAudio, type: "audio" },
89
- mp3: { icon: IconFileAudio, type: "audio" },
90
- wav: { icon: IconFileAudio, type: "audio" },
91
- wma: { icon: IconFileAudio, type: "audio" },
92
- };
93
- const ref = useRef();
94
-
95
- return (
96
- <>
97
- <Container
98
- className={
99
- className +
100
- (!type && extensions[ext]?.type
101
- ? " icon-" + extensions[ext].type
102
- : undefined)
103
- }
104
- borderType={borderType}
105
- >
106
- <CustomIcon
107
- id={id}
108
- key={key}
109
- className="icon"
110
- type={type}
111
- transparent={transparent}
112
- borderType={borderType}
113
- size={size}
114
- icon={extensions[ext]?.icon ?? IconFileDefault}
115
- />
116
- </Container>
117
- </>
118
- );
119
- };