contentoh-components-library 21.2.102 → 21.2.104
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 +2 -5
- package/.env.production +25 -25
- package/dist/components/atoms/GeneralButton/index.js +6 -2
- package/dist/components/atoms/Select/VersionSelect.js +2 -1
- 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 +5 -10
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/organisms/CreateVersion/RenderChilds.js +11 -11
- package/dist/components/organisms/CreateVersion/index.js +30 -89
- package/dist/components/organisms/OrderDetail/OrderDetail.stories.js +1 -1
- package/dist/components/organisms/OrderDetail/index.js +20 -11
- package/dist/components/organisms/OrderDetail/styles.js +1 -1
- package/dist/components/organisms/OrderDetail/utils/Table/styles.js +1 -1
- package/dist/components/organisms/OrderDetail/utils/Table/utils.js +45 -15
- package/dist/components/organisms/VersionSelector/index.js +28 -2
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +69 -147
- package/dist/components/pages/ProviderProductEdition/index.js +2 -22
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +77 -67
- package/dist/components/pages/RetailerProductEdition/index.js +5 -24
- package/dist/global-files/fonts.css +0 -12
- package/dist/global-files/variables.js +0 -2
- package/dist/index.js +46 -254
- package/package.json +1 -12
- package/src/components/atoms/GeneralButton/index.js +4 -1
- package/src/components/atoms/Select/VersionSelect.js +4 -2
- 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 +6 -11
- package/src/components/molecules/HeaderTop/styles.js +0 -4
- package/src/components/organisms/CreateVersion/RenderChilds.js +28 -34
- package/src/components/organisms/CreateVersion/index.js +16 -36
- package/src/components/organisms/OrderDetail/OrderDetail.stories.js +1 -1
- package/src/components/organisms/OrderDetail/index.js +19 -12
- package/src/components/organisms/OrderDetail/styles.js +1 -0
- package/src/components/organisms/OrderDetail/utils/Table/styles.js +30 -0
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +30 -15
- package/src/components/organisms/VersionSelector/index.js +18 -3
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +75 -166
- package/src/components/pages/ProviderProductEdition/index.js +2 -21
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +79 -67
- package/src/components/pages/RetailerProductEdition/index.js +2 -14
- package/src/global-files/customHooks.js +2 -2
- package/src/global-files/fonts.css +0 -12
- package/src/global-files/variables.js +0 -2
- package/src/index.js +0 -16
- 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 -118
- 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 -111
- 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 -222
- 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 -46
- package/dist/components/atoms/SelectItemV2/styles.js +0 -23
- 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 -96
- package/dist/components/molecules/Dropdown/index.js +0 -148
- package/dist/components/molecules/Dropdown/styles.js +0 -26
- package/dist/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -72
- package/dist/components/molecules/ImageTooltip/index.js +0 -84
- package/dist/components/molecules/ImageTooltip/styles.js +0 -33
- package/dist/components/molecules/SelectV2/SelectV2.stories.js +0 -119
- package/dist/components/molecules/SelectV2/index.js +0 -298
- package/dist/components/molecules/SelectV2/styles.js +0 -42
- package/dist/components/organisms/Chat/Chat.stories.js +0 -215
- 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 -569
- 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 -1422
- 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 -984
- 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 -327
- 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/global-files/handle_http.js +0 -383
- package/dist/global-files/utils.js +0 -472
- 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 -69
- package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -51
- package/src/components/atoms/ButtonV2/index.js +0 -79
- package/src/components/atoms/ButtonV2/styles.js +0 -195
- 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 -191
- 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 -45
- package/src/components/atoms/SelectItemV2/styles.js +0 -55
- 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 -111
- package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
- package/src/components/molecules/Dropdown/Dropdown.stories.js +0 -101
- package/src/components/molecules/Dropdown/index.js +0 -142
- package/src/components/molecules/Dropdown/styles.js +0 -75
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -46
- package/src/components/molecules/ImageTooltip/index.js +0 -62
- package/src/components/molecules/ImageTooltip/styles.js +0 -18
- package/src/components/molecules/SelectV2/SelectV2.stories.js +0 -114
- package/src/components/molecules/SelectV2/index.js +0 -332
- package/src/components/molecules/SelectV2/styles.js +0 -100
- package/src/components/organisms/Chat/Chat.stories.js +0 -199
- 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 -549
- 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 -900
- 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 -669
- 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 -294
- 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/global-files/handle_http.js +0 -231
- package/src/global-files/utils.js +0 -300
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ButtonFileChooser } from "./index";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Components/atoms/ButtonFileChooser",
|
|
5
|
-
component: ButtonFileChooser,
|
|
6
|
-
argTypes: {
|
|
7
|
-
color: {
|
|
8
|
-
options: [undefined, "white", "pink", "gray"],
|
|
9
|
-
control: { type: "select" },
|
|
10
|
-
},
|
|
11
|
-
background: {
|
|
12
|
-
options: [undefined, "white", "pink", "gray"],
|
|
13
|
-
control: { type: "select" },
|
|
14
|
-
},
|
|
15
|
-
borderType: {
|
|
16
|
-
options: [undefined, "rectangle", "oval", "circle"],
|
|
17
|
-
control: { type: "select" },
|
|
18
|
-
},
|
|
19
|
-
iconPosition: {
|
|
20
|
-
options: [undefined, "start", "end"],
|
|
21
|
-
control: { type: "select" },
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const Template = (args) => <ButtonFileChooser {...args} />;
|
|
27
|
-
|
|
28
|
-
export const ButtonTest = Template.bind({});
|
|
29
|
-
ButtonTest.args = {
|
|
30
|
-
id: "",
|
|
31
|
-
key: "",
|
|
32
|
-
disabled: false,
|
|
33
|
-
isLoading: false,
|
|
34
|
-
className: "",
|
|
35
|
-
color: undefined,
|
|
36
|
-
background: undefined,
|
|
37
|
-
borderType: undefined,
|
|
38
|
-
iconPosition: undefined,
|
|
39
|
-
label: "Ejemplo boton",
|
|
40
|
-
size: "20",
|
|
41
|
-
showIcon: true,
|
|
42
|
-
multipleFiles: false,
|
|
43
|
-
onChangeFiles: (files) => {
|
|
44
|
-
console.log("files:", files);
|
|
45
|
-
},
|
|
46
|
-
filters: "",
|
|
47
|
-
};
|
|
@@ -1,69 +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 {
|
|
5
|
-
faSpinner as IconLoading,
|
|
6
|
-
faFileUpload as IconUpload,
|
|
7
|
-
} from "@fortawesome/free-solid-svg-icons";
|
|
8
|
-
import React from "react";
|
|
9
|
-
import { getFileExtension, getFileName } from "../../../global-files/utils";
|
|
10
|
-
import { ButtonV2 } from "../ButtonV2";
|
|
11
|
-
|
|
12
|
-
export const ButtonFileChooser = (props) => {
|
|
13
|
-
const {
|
|
14
|
-
id,
|
|
15
|
-
key,
|
|
16
|
-
className,
|
|
17
|
-
disabled,
|
|
18
|
-
type, // white | whiteS2 | pink | gray | purple => por default (white)
|
|
19
|
-
transparent, // boolean => por default (NO transparent)
|
|
20
|
-
label,
|
|
21
|
-
size, // number ... label? size -> label && icon adaptable : size -> icon
|
|
22
|
-
borderType, // rectangle || oval (solo aplica para label) || circle (solo aplica para icon)
|
|
23
|
-
showIcon, // icon fontawesome
|
|
24
|
-
iconPosition = "start", // end
|
|
25
|
-
isLoading, // boolean
|
|
26
|
-
filters, // string
|
|
27
|
-
multipleFiles, // boolean
|
|
28
|
-
onChangeFiles, // (files = [{}]) => {}
|
|
29
|
-
} = props;
|
|
30
|
-
|
|
31
|
-
const openChooser = () => {
|
|
32
|
-
const files = [];
|
|
33
|
-
const chooser = document.createElement("input");
|
|
34
|
-
chooser.type = "file";
|
|
35
|
-
chooser.style.display = "none";
|
|
36
|
-
if (multipleFiles) chooser.multiple = true;
|
|
37
|
-
if (filters) chooser.accept = filters; // "image/*,text/*,application/*"
|
|
38
|
-
chooser.onchange = async (event) => {
|
|
39
|
-
//console.log("files:", chooser.files);
|
|
40
|
-
for (const file of chooser.files) {
|
|
41
|
-
files.push(file);
|
|
42
|
-
}
|
|
43
|
-
onChangeFiles && onChangeFiles(files);
|
|
44
|
-
};
|
|
45
|
-
document.body.appendChild(chooser);
|
|
46
|
-
chooser.click();
|
|
47
|
-
document.body.removeChild(chooser);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<ButtonV2
|
|
52
|
-
id={id}
|
|
53
|
-
key={key}
|
|
54
|
-
className={className}
|
|
55
|
-
disabled={disabled}
|
|
56
|
-
isLoading={isLoading}
|
|
57
|
-
type={type}
|
|
58
|
-
transparent={transparent}
|
|
59
|
-
label={label}
|
|
60
|
-
size={size}
|
|
61
|
-
borderType={borderType}
|
|
62
|
-
icon={showIcon ? IconUpload : undefined}
|
|
63
|
-
iconPosition={iconPosition}
|
|
64
|
-
onClick={(event) => {
|
|
65
|
-
openChooser();
|
|
66
|
-
}}
|
|
67
|
-
/>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
@@ -1,51 +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
|
-
"pink",
|
|
15
|
-
"gray",
|
|
16
|
-
"purple",
|
|
17
|
-
"black",
|
|
18
|
-
],
|
|
19
|
-
control: { type: "select" },
|
|
20
|
-
},
|
|
21
|
-
borderType: {
|
|
22
|
-
options: [undefined, "rectangle", "oval", "circle"],
|
|
23
|
-
control: { type: "select" },
|
|
24
|
-
},
|
|
25
|
-
iconPosition: {
|
|
26
|
-
options: [undefined, "start", "end"],
|
|
27
|
-
control: { type: "select" },
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const Template = (args) => <ButtonV2 {...args} />;
|
|
33
|
-
|
|
34
|
-
export const ButtonTest = Template.bind({});
|
|
35
|
-
ButtonTest.args = {
|
|
36
|
-
id: "",
|
|
37
|
-
key: "",
|
|
38
|
-
disabled: false,
|
|
39
|
-
isLoading: false,
|
|
40
|
-
className: "",
|
|
41
|
-
type: undefined,
|
|
42
|
-
transparent: false,
|
|
43
|
-
borderType: undefined,
|
|
44
|
-
iconPosition: undefined,
|
|
45
|
-
label: "Ejemplo boton",
|
|
46
|
-
size: "20",
|
|
47
|
-
icon: iconCamera,
|
|
48
|
-
onClick: () => {
|
|
49
|
-
console.log("click boton");
|
|
50
|
-
},
|
|
51
|
-
};
|
|
@@ -1,79 +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 | pink | gray | purple | 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 = "start", // end
|
|
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={iconPosition}
|
|
33
|
-
icon={icon}
|
|
34
|
-
label={label}
|
|
35
|
-
size={size}
|
|
36
|
-
disabled={disabled}
|
|
37
|
-
isLoading={isLoading}
|
|
38
|
-
>
|
|
39
|
-
<ButtonMUI
|
|
40
|
-
className={
|
|
41
|
-
"button " +
|
|
42
|
-
([
|
|
43
|
-
"white",
|
|
44
|
-
"whiteS2",
|
|
45
|
-
"whiteS3",
|
|
46
|
-
"pink",
|
|
47
|
-
"gray",
|
|
48
|
-
"purple",
|
|
49
|
-
"black",
|
|
50
|
-
].includes(type)
|
|
51
|
-
? type
|
|
52
|
-
: "white") +
|
|
53
|
-
(transparent ? " transparent" : " fill")
|
|
54
|
-
}
|
|
55
|
-
variant={"text"}
|
|
56
|
-
disabled={disabled || isLoading}
|
|
57
|
-
onClick={async (event) => onClick && (await onClick(event))}
|
|
58
|
-
>
|
|
59
|
-
{isLoading ? (
|
|
60
|
-
<>
|
|
61
|
-
<i className="iconLoading">
|
|
62
|
-
<Icon pulse={true} icon={iconLoading} />
|
|
63
|
-
</i>
|
|
64
|
-
{label && label}
|
|
65
|
-
</>
|
|
66
|
-
) : (
|
|
67
|
-
<>
|
|
68
|
-
{icon && (
|
|
69
|
-
<i className="icon">
|
|
70
|
-
<Icon icon={icon} />
|
|
71
|
-
</i>
|
|
72
|
-
)}
|
|
73
|
-
{label && label}
|
|
74
|
-
</>
|
|
75
|
-
)}
|
|
76
|
-
</ButtonMUI>
|
|
77
|
-
</Container>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
@@ -1,195 +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 === "start" ? "row" : "row-reverse"};
|
|
32
|
-
gap: 7px;
|
|
33
|
-
align-items: center;
|
|
34
|
-
justify-content: center;
|
|
35
|
-
padding: ${({ label, borderType }) => {
|
|
36
|
-
return label && label?.trim() !== ""
|
|
37
|
-
? "5px 15px" // button con label
|
|
38
|
-
: "5px";
|
|
39
|
-
}};
|
|
40
|
-
border-radius: inherit;
|
|
41
|
-
border: ${({ label, borderType, transparent }) => {
|
|
42
|
-
return ["rectangle", "circle", "oval"].includes(borderType?.toLowerCase())
|
|
43
|
-
? "1px solid black"
|
|
44
|
-
: transparent
|
|
45
|
-
? "none"
|
|
46
|
-
: label && label?.trim() !== ""
|
|
47
|
-
? "1px solid black" // button con label
|
|
48
|
-
: "none"; // button icon sin borde
|
|
49
|
-
}};
|
|
50
|
-
font-family: ${FontFamily.RobotoMedium}, sans-serif;
|
|
51
|
-
font-size: var(--size);
|
|
52
|
-
line-height: 1.2;
|
|
53
|
-
text-transform: none;
|
|
54
|
-
|
|
55
|
-
// tipos de botones fill
|
|
56
|
-
&.fill {
|
|
57
|
-
&.white {
|
|
58
|
-
background-color: white;
|
|
59
|
-
color: #e33aa9;
|
|
60
|
-
border-color: #e33aa9;
|
|
61
|
-
&:hover {
|
|
62
|
-
background-color: #f4f4f4;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
&.whiteS2 {
|
|
66
|
-
background-color: white;
|
|
67
|
-
color: #7b7979;
|
|
68
|
-
border-color: #f0f0f0;
|
|
69
|
-
&:hover {
|
|
70
|
-
background-color: #f4f4f4;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
&.whiteS3 {
|
|
74
|
-
background-color: white;
|
|
75
|
-
color: #262626;
|
|
76
|
-
border-color: #f0f0f0;
|
|
77
|
-
&:hover {
|
|
78
|
-
background-color: #f4f4f4;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
&.pink {
|
|
82
|
-
background-color: #e33aa9;
|
|
83
|
-
color: white;
|
|
84
|
-
border-color: #e33aa9;
|
|
85
|
-
&:hover {
|
|
86
|
-
background-color: #b42983;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
&.gray {
|
|
90
|
-
background-color: #e8e5e5;
|
|
91
|
-
color: #262626;
|
|
92
|
-
border-color: #7b7979;
|
|
93
|
-
.icon,
|
|
94
|
-
.iconLoading {
|
|
95
|
-
color: #7b7979;
|
|
96
|
-
}
|
|
97
|
-
&:hover {
|
|
98
|
-
background-color: #d6d3d3;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
&.purple {
|
|
102
|
-
background-color: #f7f7fc;
|
|
103
|
-
color: #8a6caa;
|
|
104
|
-
border-color: #8a6caa;
|
|
105
|
-
&:hover {
|
|
106
|
-
background-color: #e0e0f1;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// tipos de botones transparent
|
|
112
|
-
&.transparent {
|
|
113
|
-
&:hover {
|
|
114
|
-
background-color: transparent;
|
|
115
|
-
}
|
|
116
|
-
&.white {
|
|
117
|
-
color: white;
|
|
118
|
-
border-color: #e33aa9;
|
|
119
|
-
&:hover {
|
|
120
|
-
color: #d6d4d4;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
&.pink {
|
|
124
|
-
color: #e33aa9;
|
|
125
|
-
border-color: #e33aa9;
|
|
126
|
-
&:hover {
|
|
127
|
-
color: #b42983;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
&.gray {
|
|
131
|
-
color: #262626;
|
|
132
|
-
border-color: #7b7979;
|
|
133
|
-
.icon,
|
|
134
|
-
.iconLoading {
|
|
135
|
-
color: #7b7979;
|
|
136
|
-
transition: inherit;
|
|
137
|
-
}
|
|
138
|
-
&:hover {
|
|
139
|
-
color: #7b7979;
|
|
140
|
-
.icon,
|
|
141
|
-
.iconLoading {
|
|
142
|
-
color: #bdbbbb;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
&.purple {
|
|
147
|
-
color: #8a6caa;
|
|
148
|
-
border-color: #8a6caa;
|
|
149
|
-
&:hover {
|
|
150
|
-
color: #714f95;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
&.black {
|
|
154
|
-
color: #262626;
|
|
155
|
-
border-color: #262626;
|
|
156
|
-
&:hover {
|
|
157
|
-
color: #7b7979;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.icon,
|
|
163
|
-
.iconLoading {
|
|
164
|
-
display: grid;
|
|
165
|
-
place-items: center;
|
|
166
|
-
color: inherit;
|
|
167
|
-
font-size: ${({ label }) => {
|
|
168
|
-
return label && label?.trim() !== ""
|
|
169
|
-
? "calc(var(--size) + 3px)" // button with label
|
|
170
|
-
: "var(--size)"; // button icon
|
|
171
|
-
}};
|
|
172
|
-
}
|
|
173
|
-
.iconLoading {
|
|
174
|
-
font-size: ${({ icon }) => !icon && "var(--size)"};
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// mismo estilo desabilitado para cualquier tipo de boton
|
|
178
|
-
&:disabled {
|
|
179
|
-
background-color: #fcebf7 !important;
|
|
180
|
-
color: #7b7979 !important;
|
|
181
|
-
border-color: #7b7979 !important;
|
|
182
|
-
|
|
183
|
-
.icon {
|
|
184
|
-
color: #9e9c9c !important;
|
|
185
|
-
}
|
|
186
|
-
.iconLoading {
|
|
187
|
-
color: #9e2674 !important;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
&:hover {
|
|
191
|
-
background-color: #fcebf7 !important;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
`;
|
|
@@ -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
|
-
};
|