contentoh-components-library 21.3.18 → 21.3.19
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.
- package/.env.development +0 -5
- package/dist/assets/images/generalButton/closeIcon.svg +2 -2
- package/dist/components/atoms/GeneralInput/index.js +14 -1
- package/dist/components/atoms/ProgressBar/index.js +6 -36
- package/dist/components/atoms/ProgressBar/styles.js +3 -11
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
- package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
- package/dist/components/molecules/HeaderTop/index.js +6 -23
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/molecules/ProductNameHeader/index.js +4 -6
- package/dist/components/organisms/FullProductNameHeader/index.js +0 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +50 -65
- package/dist/components/pages/ProviderProductEdition/index.js +11 -15
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +44 -36
- package/dist/components/pages/RetailerProductEdition/index.js +12 -13
- package/dist/global-files/data.js +23 -18
- package/dist/global-files/fonts.css +0 -6
- package/dist/global-files/variables.js +0 -2
- package/dist/index.js +46 -267
- package/package.json +1 -12
- package/src/assets/images/generalButton/closeIcon.svg +2 -2
- package/src/components/atoms/GeneralInput/index.js +10 -0
- package/src/components/atoms/ProgressBar/index.js +5 -40
- package/src/components/atoms/ProgressBar/styles.js +0 -24
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +12 -20
- package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
- package/src/components/molecules/HeaderTop/index.js +8 -29
- package/src/components/molecules/HeaderTop/styles.js +0 -4
- package/src/components/molecules/ProductNameHeader/index.js +2 -7
- package/src/components/organisms/FullProductNameHeader/index.js +0 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +49 -67
- package/src/components/pages/ProviderProductEdition/index.js +9 -16
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +46 -36
- package/src/components/pages/RetailerProductEdition/index.js +10 -14
- package/src/global-files/data.js +23 -18
- package/src/global-files/fonts.css +0 -6
- package/src/global-files/variables.js +0 -2
- package/src/index.js +0 -17
- package/dist/assets/images/customSelect/starIcon.svg +0 -14
- package/dist/assets/images/defaultImages/Spinner.gif +0 -0
- package/dist/assets/images/defaultImages/notFound.svg +0 -124
- package/dist/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -72
- package/dist/components/atoms/ButtonFileChooser/index.js +0 -110
- package/dist/components/atoms/ButtonFileChooser/styles.js +0 -20
- package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +0 -66
- package/dist/components/atoms/ButtonV2/index.js +0 -110
- package/dist/components/atoms/ButtonV2/styles.js +0 -53
- package/dist/components/atoms/CustomIcon/CustomIcon.stories.js +0 -50
- package/dist/components/atoms/CustomIcon/index.js +0 -40
- package/dist/components/atoms/CustomIcon/styles.js +0 -33
- package/dist/components/atoms/IconFile/IconFile.stories.js +0 -48
- package/dist/components/atoms/IconFile/index.js +0 -249
- package/dist/components/atoms/IconFile/styles.js +0 -23
- package/dist/components/atoms/Image/Image.stories.js +0 -73
- package/dist/components/atoms/Image/index.js +0 -76
- package/dist/components/atoms/Image/styles.js +0 -43
- package/dist/components/atoms/ImageLink/ImageLink.stories.js +0 -63
- package/dist/components/atoms/ImageLink/index.js +0 -77
- package/dist/components/atoms/ImageLink/styles.js +0 -40
- package/dist/components/atoms/ImagePreview/ImagePreview.stories.js +0 -70
- package/dist/components/atoms/ImagePreview/index.js +0 -208
- package/dist/components/atoms/ImagePreview/styles.js +0 -44
- package/dist/components/atoms/InputText/InputText.stories.js +0 -60
- package/dist/components/atoms/InputText/index.js +0 -66
- package/dist/components/atoms/InputText/styles.js +0 -32
- package/dist/components/atoms/NotFound/NotFound.stories.js +0 -36
- package/dist/components/atoms/NotFound/index.js +0 -75
- package/dist/components/atoms/NotFound/styles.js +0 -20
- package/dist/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -45
- package/dist/components/atoms/SelectItemV2/index.js +0 -57
- package/dist/components/atoms/SelectItemV2/styles.js +0 -30
- package/dist/components/atoms/Tooltip/Tooltip.stories.js +0 -66
- package/dist/components/atoms/Tooltip/index.js +0 -72
- package/dist/components/atoms/Tooltip/styles.js +0 -20
- package/dist/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -66
- package/dist/components/molecules/ButtonDownloadFile/index.js +0 -179
- package/dist/components/molecules/ButtonDownloadFile/styles.js +0 -23
- package/dist/components/molecules/Dropdown/Dropdown.stories.js +0 -98
- package/dist/components/molecules/Dropdown/index.js +0 -150
- package/dist/components/molecules/Dropdown/styles.js +0 -26
- package/dist/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -82
- package/dist/components/molecules/ImageTooltip/index.js +0 -85
- package/dist/components/molecules/ImageTooltip/styles.js +0 -33
- package/dist/components/molecules/SelectV2/SelectV2.stories.js +0 -120
- package/dist/components/molecules/SelectV2/index.js +0 -306
- package/dist/components/molecules/SelectV2/styles.js +0 -42
- package/dist/components/molecules/SelectV2/test.js +0 -95
- package/dist/components/molecules/SelectV2/test.stories.js +0 -27
- package/dist/components/organisms/Chat/Chat.stories.js +0 -160
- package/dist/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -83
- package/dist/components/organisms/Chat/ChatLists/index.js +0 -160
- package/dist/components/organisms/Chat/ChatLists/styles.js +0 -29
- package/dist/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -176
- package/dist/components/organisms/Chat/ContainerItems/index.js +0 -537
- package/dist/components/organisms/Chat/ContainerItems/styles.js +0 -20
- package/dist/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -142
- package/dist/components/organisms/Chat/ContentChat/index.js +0 -1429
- package/dist/components/organisms/Chat/ContentChat/styles.js +0 -20
- package/dist/components/organisms/Chat/Footer/Footer.stories.js +0 -43
- package/dist/components/organisms/Chat/Footer/index.js +0 -976
- package/dist/components/organisms/Chat/Footer/styles.js +0 -32
- package/dist/components/organisms/Chat/Header/Header.stories.js +0 -96
- package/dist/components/organisms/Chat/Header/index.js +0 -84
- package/dist/components/organisms/Chat/Header/styles.js +0 -20
- package/dist/components/organisms/Chat/index.js +0 -253
- package/dist/components/organisms/Chat/styles.js +0 -29
- package/dist/components/organisms/Modal/Modal.stories.js +0 -66
- package/dist/components/organisms/Modal/index.js +0 -95
- package/dist/components/organisms/Modal/styles.js +0 -20
- package/dist/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -33
- package/dist/components/organisms/RangeCalendar/index.js +0 -149
- package/dist/components/organisms/RangeCalendar/styles.js +0 -27
- package/dist/global-files/handle_http.js +0 -381
- package/dist/global-files/handle_userTech.js +0 -20
- package/dist/global-files/utils.js +0 -514
- package/src/assets/images/customSelect/starIcon.svg +0 -14
- package/src/assets/images/defaultImages/Spinner.gif +0 -0
- package/src/assets/images/defaultImages/notFound.svg +0 -124
- package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -47
- package/src/components/atoms/ButtonFileChooser/index.js +0 -68
- package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -53
- package/src/components/atoms/ButtonV2/index.js +0 -85
- package/src/components/atoms/ButtonV2/styles.js +0 -217
- package/src/components/atoms/CustomIcon/CustomIcon.stories.js +0 -36
- package/src/components/atoms/CustomIcon/index.js +0 -41
- package/src/components/atoms/CustomIcon/styles.js +0 -85
- package/src/components/atoms/IconFile/IconFile.stories.js +0 -35
- package/src/components/atoms/IconFile/index.js +0 -119
- package/src/components/atoms/IconFile/styles.js +0 -67
- package/src/components/atoms/Image/Image.stories.js +0 -51
- package/src/components/atoms/Image/index.js +0 -55
- package/src/components/atoms/Image/styles.js +0 -34
- package/src/components/atoms/ImageLink/ImageLink.stories.js +0 -43
- package/src/components/atoms/ImageLink/index.js +0 -57
- package/src/components/atoms/ImageLink/styles.js +0 -30
- package/src/components/atoms/ImagePreview/ImagePreview.stories.js +0 -52
- package/src/components/atoms/ImagePreview/index.js +0 -178
- package/src/components/atoms/ImagePreview/styles.js +0 -77
- package/src/components/atoms/InputText/InputText.stories.js +0 -39
- package/src/components/atoms/InputText/index.js +0 -61
- package/src/components/atoms/InputText/styles.js +0 -89
- package/src/components/atoms/NotFound/NotFound.stories.js +0 -19
- package/src/components/atoms/NotFound/index.js +0 -52
- package/src/components/atoms/NotFound/styles.js +0 -55
- package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -26
- package/src/components/atoms/SelectItemV2/index.js +0 -61
- package/src/components/atoms/SelectItemV2/styles.js +0 -90
- package/src/components/atoms/Tooltip/Tooltip.stories.js +0 -51
- package/src/components/atoms/Tooltip/index.js +0 -59
- package/src/components/atoms/Tooltip/styles.js +0 -42
- package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -54
- package/src/components/molecules/ButtonDownloadFile/index.js +0 -109
- package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
- package/src/components/molecules/Dropdown/Dropdown.stories.js +0 -103
- package/src/components/molecules/Dropdown/index.js +0 -150
- package/src/components/molecules/Dropdown/styles.js +0 -75
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -68
- package/src/components/molecules/ImageTooltip/index.js +0 -63
- package/src/components/molecules/ImageTooltip/styles.js +0 -18
- package/src/components/molecules/SelectV2/SelectV2.stories.js +0 -115
- package/src/components/molecules/SelectV2/index.js +0 -357
- package/src/components/molecules/SelectV2/styles.js +0 -105
- package/src/components/molecules/SelectV2/test.js +0 -61
- package/src/components/molecules/SelectV2/test.stories.js +0 -10
- package/src/components/organisms/Chat/Chat.stories.js +0 -147
- package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -65
- package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chat/ChatLists/index.js +0 -141
- package/src/components/organisms/Chat/ChatLists/styles.js +0 -162
- package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -142
- package/src/components/organisms/Chat/ContainerItems/index.js +0 -512
- package/src/components/organisms/Chat/ContainerItems/styles.js +0 -328
- package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -102
- package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chat/ContentChat/index.js +0 -897
- package/src/components/organisms/Chat/ContentChat/styles.js +0 -41
- package/src/components/organisms/Chat/Footer/Footer.stories.js +0 -22
- package/src/components/organisms/Chat/Footer/index.js +0 -661
- package/src/components/organisms/Chat/Footer/styles.js +0 -286
- package/src/components/organisms/Chat/Header/Header.stories.js +0 -66
- package/src/components/organisms/Chat/Header/index.js +0 -94
- package/src/components/organisms/Chat/Header/styles.js +0 -49
- package/src/components/organisms/Chat/index.js +0 -235
- package/src/components/organisms/Chat/styles.js +0 -42
- package/src/components/organisms/Modal/Modal.stories.js +0 -55
- package/src/components/organisms/Modal/index.js +0 -97
- package/src/components/organisms/Modal/styles.js +0 -103
- package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -16
- package/src/components/organisms/RangeCalendar/index.js +0 -121
- package/src/components/organisms/RangeCalendar/styles.js +0 -883
- package/src/global-files/handle_http.js +0 -225
- package/src/global-files/handle_userTech.js +0 -7
- package/src/global-files/utils.js +0 -330
|
@@ -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
|
-
};
|
|
@@ -1,67 +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
|
-
min-width: min-content;
|
|
7
|
-
min-height: min-content;
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
cursor: default;
|
|
10
|
-
display: grid;
|
|
11
|
-
place-items: center;
|
|
12
|
-
padding: 0px;
|
|
13
|
-
border-radius: ${({ borderType }) => {
|
|
14
|
-
return borderType?.toLowerCase() === "rectangle"
|
|
15
|
-
? "6px"
|
|
16
|
-
: borderType?.toLowerCase() === "circle"
|
|
17
|
-
? "50%"
|
|
18
|
-
: "0px";
|
|
19
|
-
}};
|
|
20
|
-
border: none;
|
|
21
|
-
|
|
22
|
-
// colores de acuerdo al tipo de icono
|
|
23
|
-
&.icon-word .icon {
|
|
24
|
-
color: #1f3780;
|
|
25
|
-
border-color: #1f3780;
|
|
26
|
-
}
|
|
27
|
-
&.icon-excel .icon {
|
|
28
|
-
color: #2d5639;
|
|
29
|
-
border-color: #2d5639;
|
|
30
|
-
}
|
|
31
|
-
&.icon-csv .icon {
|
|
32
|
-
color: #6b8e73;
|
|
33
|
-
border-color: #6b8e73;
|
|
34
|
-
}
|
|
35
|
-
&.icon-image .icon {
|
|
36
|
-
color: #ca7f4d;
|
|
37
|
-
border-color: #ca7f4d;
|
|
38
|
-
}
|
|
39
|
-
&.icon-pdf .icon {
|
|
40
|
-
color: #951a1a;
|
|
41
|
-
border-color: #951a1a;
|
|
42
|
-
}
|
|
43
|
-
&.icon-powerPoint .icon {
|
|
44
|
-
color: #ba4f19;
|
|
45
|
-
border-color: #ba4f19;
|
|
46
|
-
}
|
|
47
|
-
&.icon-zip .icon {
|
|
48
|
-
color: #b8950c;
|
|
49
|
-
border-color: #b8950c;
|
|
50
|
-
}
|
|
51
|
-
&.icon-code .icon {
|
|
52
|
-
color: #1c778e;
|
|
53
|
-
border-color: #1c778e;
|
|
54
|
-
}
|
|
55
|
-
&.icon-video .icon {
|
|
56
|
-
color: #a15bb1;
|
|
57
|
-
border-color: #a15bb1;
|
|
58
|
-
}
|
|
59
|
-
&.icon-audio .icon {
|
|
60
|
-
color: #3090e9;
|
|
61
|
-
border-color: #3090e9;
|
|
62
|
-
}
|
|
63
|
-
&.icon-default .icon {
|
|
64
|
-
color: #5e6265;
|
|
65
|
-
border-color: #5e6265;
|
|
66
|
-
}
|
|
67
|
-
`;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Image } from "./index";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Components/atoms/Image",
|
|
5
|
-
component: Image,
|
|
6
|
-
argTypes: {
|
|
7
|
-
borderType: {
|
|
8
|
-
options: [undefined, "rectangle", "circle"],
|
|
9
|
-
control: { type: "select" },
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const Template = (args) => <Image {...args} />;
|
|
15
|
-
|
|
16
|
-
const keyS3_test =
|
|
17
|
-
"84300/1/chat/playa-213f791b-d890-48e1-be19-28bf5a95d517.jpeg";
|
|
18
|
-
const srcTest = `https://content-management-profile.s3.amazonaws.com/id-59/59.png`;
|
|
19
|
-
export const ImageTest = Template.bind({});
|
|
20
|
-
ImageTest.args = {
|
|
21
|
-
width: "200px",
|
|
22
|
-
sizeLoading: "50",
|
|
23
|
-
colorLoading: "#bbbbbb",
|
|
24
|
-
src: srcTest,
|
|
25
|
-
componentDefault: <label> test error </label>,
|
|
26
|
-
borderType: undefined,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const keyS3_OK =
|
|
30
|
-
"84300/1/chat/f6579ed5-16e5-48d8-ace5-6be8e8e68f53-38896acf-9179-4686-9088-9784df624ab8.png";
|
|
31
|
-
const srcOK = `https://content-management-images.s3.amazonaws.com/${keyS3_OK}`;
|
|
32
|
-
export const ImageOK = Template.bind({});
|
|
33
|
-
ImageOK.args = {
|
|
34
|
-
width: "250px",
|
|
35
|
-
sizeLoading: "40",
|
|
36
|
-
src: srcOK,
|
|
37
|
-
componentDefault: <label> img no cargada </label>,
|
|
38
|
-
borderType: undefined,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const keyS3_ERROR =
|
|
42
|
-
"84300/1/chat/21dba1da-3c60-42c4-97bd-033664808256-fb19ff57-b91c-4ef2-ba2a-d857b55fb33b.svg";
|
|
43
|
-
const srcERROR = `https://content-management-images.s3.amazonaws.com/${keyS3_ERROR}`;
|
|
44
|
-
export const ImageERROR = Template.bind({});
|
|
45
|
-
ImageERROR.args = {
|
|
46
|
-
width: "300px",
|
|
47
|
-
sizeLoading: "60",
|
|
48
|
-
src: srcERROR,
|
|
49
|
-
componentDefault: <label> ERROR al cargar </label>,
|
|
50
|
-
borderType: undefined,
|
|
51
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Container, ContainerLoading, Img } from "./styles";
|
|
2
|
-
import { FontAwesomeIcon as Icon } from "@fortawesome/react-fontawesome";
|
|
3
|
-
import { faSpinner as iconLoading } from "@fortawesome/free-solid-svg-icons";
|
|
4
|
-
import { useState, useEffect } from "react";
|
|
5
|
-
|
|
6
|
-
export const Image = (props) => {
|
|
7
|
-
const {
|
|
8
|
-
className, // string
|
|
9
|
-
width, // string
|
|
10
|
-
sizeLoading, // number
|
|
11
|
-
colorLoading, // string
|
|
12
|
-
classNameLoading, // string
|
|
13
|
-
src, // imagen a cargar (string)
|
|
14
|
-
componentDefault, // componente a mostrar en caso de que no cargue src (JSX)
|
|
15
|
-
classNameImg, // string
|
|
16
|
-
borderType, // "rectangle" | "circle" -> por default none
|
|
17
|
-
} = props;
|
|
18
|
-
const [imgLoad, setImgLoad] = useState();
|
|
19
|
-
const [loading, setLoading] = useState(false);
|
|
20
|
-
|
|
21
|
-
/* solo para hacer pruebas en modo dev
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
setTimeout(() => {
|
|
24
|
-
setLoading(false);
|
|
25
|
-
}, 5000);
|
|
26
|
-
}, []); */
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<Container className={className} width={width} borderType={borderType}>
|
|
30
|
-
{src && (imgLoad === undefined || loading) && (
|
|
31
|
-
<ContainerLoading
|
|
32
|
-
className={classNameLoading}
|
|
33
|
-
sizeLoading={sizeLoading}
|
|
34
|
-
colorLoading={colorLoading}
|
|
35
|
-
>
|
|
36
|
-
<Icon pulse icon={iconLoading} />
|
|
37
|
-
</ContainerLoading>
|
|
38
|
-
)}
|
|
39
|
-
|
|
40
|
-
{(!src || (imgLoad === false && !loading)) && componentDefault}
|
|
41
|
-
|
|
42
|
-
<Img
|
|
43
|
-
className={classNameImg}
|
|
44
|
-
src={src}
|
|
45
|
-
onLoad={(event) => {
|
|
46
|
-
setImgLoad(true);
|
|
47
|
-
}}
|
|
48
|
-
onError={(event) => {
|
|
49
|
-
setImgLoad(false);
|
|
50
|
-
}}
|
|
51
|
-
show={imgLoad === true && !loading}
|
|
52
|
-
/>
|
|
53
|
-
</Container>
|
|
54
|
-
);
|
|
55
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { GlobalColors, FontFamily } from "../../../global-files/variables";
|
|
3
|
-
|
|
4
|
-
export const Container = styled.div`
|
|
5
|
-
display: grid;
|
|
6
|
-
place-items: center;
|
|
7
|
-
width: ${({ width }) => (width ? width : "min-content")};
|
|
8
|
-
min-width: min-content;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
border-radius: ${({ borderType }) => {
|
|
11
|
-
return borderType?.toLowerCase() === "rectangle"
|
|
12
|
-
? "6px"
|
|
13
|
-
: borderType?.toLowerCase() === "circle"
|
|
14
|
-
? "50%"
|
|
15
|
-
: "0px"; // default none
|
|
16
|
-
}};
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
export const ContainerLoading = styled.div`
|
|
20
|
-
width: 100%;
|
|
21
|
-
display: grid;
|
|
22
|
-
place-items: center;
|
|
23
|
-
min-width: min-content;
|
|
24
|
-
font-size: ${({ sizeLoading }) => (sizeLoading ? sizeLoading : "30")}px;
|
|
25
|
-
color: ${({ colorLoading }) => (colorLoading ? colorLoading : "#9e2674")};
|
|
26
|
-
padding: 5px;
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
export const Img = styled.img`
|
|
30
|
-
display: ${({ show }) => (show ? "grid" : "none")};
|
|
31
|
-
width: 100%;
|
|
32
|
-
object-fit: contain;
|
|
33
|
-
border-radius: inherit;
|
|
34
|
-
`;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { ImageLink } from "./index";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Components/atoms/ImageLink",
|
|
5
|
-
component: ImageLink,
|
|
6
|
-
argTypes: {},
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const Template = (args) => <ImageLink {...args} />;
|
|
10
|
-
|
|
11
|
-
const keyS3_test =
|
|
12
|
-
"84300/1/chat/playa-213f791b-d890-48e1-be19-28bf5a95d517.jpeg";
|
|
13
|
-
const srcTest = `https://content-management-images.s3.amazonaws.com/${keyS3_test}`;
|
|
14
|
-
export const ImageTest = Template.bind({});
|
|
15
|
-
ImageTest.args = {
|
|
16
|
-
width: "200px",
|
|
17
|
-
sizeLoading: "50",
|
|
18
|
-
colorLoading: "#bbbbbb",
|
|
19
|
-
src: srcTest,
|
|
20
|
-
componentDefault: <label> test error </label>,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const keyS3_OK =
|
|
24
|
-
"84300/1/chat/f6579ed5-16e5-48d8-ace5-6be8e8e68f53-38896acf-9179-4686-9088-9784df624ab8.png";
|
|
25
|
-
const srcOK = `https://content-management-images.s3.amazonaws.com/${keyS3_OK}`;
|
|
26
|
-
export const ImageOK = Template.bind({});
|
|
27
|
-
ImageOK.args = {
|
|
28
|
-
width: "250px",
|
|
29
|
-
sizeLoading: "40",
|
|
30
|
-
src: srcOK,
|
|
31
|
-
componentDefault: <label> img no cargada </label>,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const keyS3_ERROR =
|
|
35
|
-
"84300/1/chat/21dba1da-3c60-42c4-97bd-033664808256-fb19ff57-b91c-4ef2-ba2a-d857b55fb33b.svg";
|
|
36
|
-
const srcERROR = `https://content-management-images.s3.amazonaws.com/${keyS3_ERROR}`;
|
|
37
|
-
export const ImageERROR = Template.bind({});
|
|
38
|
-
ImageERROR.args = {
|
|
39
|
-
width: "300px",
|
|
40
|
-
sizeLoading: "60",
|
|
41
|
-
src: srcERROR,
|
|
42
|
-
componentDefault: <label> ERROR al cargar </label>,
|
|
43
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Container, ContainerLoading, ContainerLink } from "./styles";
|
|
2
|
-
import { FontAwesomeIcon as Icon } from "@fortawesome/react-fontawesome";
|
|
3
|
-
import { faSpinner as iconLoading } from "@fortawesome/free-solid-svg-icons";
|
|
4
|
-
import { useState, useEffect } from "react";
|
|
5
|
-
|
|
6
|
-
export const ImageLink = (props) => {
|
|
7
|
-
const {
|
|
8
|
-
className, // string
|
|
9
|
-
width, // string
|
|
10
|
-
sizeLoading, // number
|
|
11
|
-
colorLoading, // string
|
|
12
|
-
src, // imagen a cargar (string)
|
|
13
|
-
componentDefault, // componente a mostrar en caso de que no cargue src (JSX)
|
|
14
|
-
} = props;
|
|
15
|
-
const [imgLoad, setImgLoad] = useState();
|
|
16
|
-
const [loading, setLoading] = useState(false);
|
|
17
|
-
|
|
18
|
-
/* solo para hacer pruebas en modo dev
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
setTimeout(() => {
|
|
21
|
-
setLoading(false);
|
|
22
|
-
}, 5000);
|
|
23
|
-
}, []); */
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<Container className={className} width={width}>
|
|
27
|
-
{src && (imgLoad === undefined || loading) && (
|
|
28
|
-
<ContainerLoading
|
|
29
|
-
className={"container-loading"}
|
|
30
|
-
sizeLoading={sizeLoading}
|
|
31
|
-
colorLoading={colorLoading}
|
|
32
|
-
>
|
|
33
|
-
<Icon className="icon" pulse icon={iconLoading} />
|
|
34
|
-
</ContainerLoading>
|
|
35
|
-
)}
|
|
36
|
-
|
|
37
|
-
{(!src || (imgLoad === false && !loading)) && componentDefault}
|
|
38
|
-
|
|
39
|
-
<ContainerLink
|
|
40
|
-
className="container-img"
|
|
41
|
-
show={imgLoad === true && !loading}
|
|
42
|
-
href={src}
|
|
43
|
-
>
|
|
44
|
-
<img
|
|
45
|
-
className="img"
|
|
46
|
-
src={src}
|
|
47
|
-
onLoad={(event) => {
|
|
48
|
-
setImgLoad(true);
|
|
49
|
-
}}
|
|
50
|
-
onError={(event) => {
|
|
51
|
-
setImgLoad(false);
|
|
52
|
-
}}
|
|
53
|
-
/>
|
|
54
|
-
</ContainerLink>
|
|
55
|
-
</Container>
|
|
56
|
-
);
|
|
57
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { GlobalColors, FontFamily } from "../../../global-files/variables";
|
|
3
|
-
|
|
4
|
-
export const Container = styled.div`
|
|
5
|
-
display: grid;
|
|
6
|
-
place-items: center;
|
|
7
|
-
width: ${({ width }) => (width ? width : "min-content")};
|
|
8
|
-
min-width: min-content;
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
export const ContainerLoading = styled.div`
|
|
12
|
-
width: 100%;
|
|
13
|
-
display: grid;
|
|
14
|
-
place-items: center;
|
|
15
|
-
min-width: min-content;
|
|
16
|
-
font-size: ${({ sizeLoading }) => (sizeLoading ? sizeLoading : "30")}px;
|
|
17
|
-
color: ${({ colorLoading }) => (colorLoading ? colorLoading : "#9e2674")};
|
|
18
|
-
padding: 5px;
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
export const ContainerLink = styled.a`
|
|
22
|
-
display: ${({ show }) => (show ? "grid" : "none")};
|
|
23
|
-
width: 100%;
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
|
|
26
|
-
img {
|
|
27
|
-
width: 100%;
|
|
28
|
-
object-fit: contain;
|
|
29
|
-
}
|
|
30
|
-
`;
|