contentoh-components-library 21.4.58 → 21.4.60
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/dist/components/atoms/CheckBox/index.js +7 -2
- package/dist/index.js +13 -0
- package/package.json +1 -1
- package/src/components/atoms/CheckBox/index.js +4 -1
- package/src/components/organisms/SideModal/SideModal.stories.js +23 -0
- package/src/components/organisms/SideModal/index.js +50 -0
- package/src/components/organisms/SideModal/styles.js +30 -0
- package/src/index.js +1 -0
- package/src/components/atoms/TabSection/styles.js +0 -23
|
@@ -16,15 +16,20 @@ var CheckBox = function CheckBox(_ref) {
|
|
|
16
16
|
isFilter = _ref.isFilter,
|
|
17
17
|
defaultChecked = _ref.defaultChecked,
|
|
18
18
|
_ref$disabled = _ref.disabled,
|
|
19
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled
|
|
19
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
20
|
+
checked = _ref.checked,
|
|
21
|
+
_ref$className = _ref.className,
|
|
22
|
+
className = _ref$className === void 0 ? "" : _ref$className;
|
|
20
23
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
24
|
+
className: className,
|
|
21
25
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
22
26
|
type: "checkbox",
|
|
23
27
|
name: id,
|
|
24
28
|
id: id,
|
|
25
29
|
onChange: onChange,
|
|
26
30
|
defaultChecked: defaultChecked,
|
|
27
|
-
disabled: disabled
|
|
31
|
+
disabled: disabled,
|
|
32
|
+
checked: checked
|
|
28
33
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
29
34
|
htmlFor: id,
|
|
30
35
|
children: label && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
package/dist/index.js
CHANGED
|
@@ -1018,6 +1018,19 @@ Object.keys(_TableResizable).forEach(function (key) {
|
|
|
1018
1018
|
});
|
|
1019
1019
|
});
|
|
1020
1020
|
|
|
1021
|
+
var _index76 = require("./components/organisms/SideModal/index");
|
|
1022
|
+
|
|
1023
|
+
Object.keys(_index76).forEach(function (key) {
|
|
1024
|
+
if (key === "default" || key === "__esModule") return;
|
|
1025
|
+
if (key in exports && exports[key] === _index76[key]) return;
|
|
1026
|
+
Object.defineProperty(exports, key, {
|
|
1027
|
+
enumerable: true,
|
|
1028
|
+
get: function get() {
|
|
1029
|
+
return _index76[key];
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
});
|
|
1033
|
+
|
|
1021
1034
|
var _PanelLayout = require("./components/organisms/PanelLayout");
|
|
1022
1035
|
|
|
1023
1036
|
Object.keys(_PanelLayout).forEach(function (key) {
|
package/package.json
CHANGED
|
@@ -7,9 +7,11 @@ export const CheckBox = ({
|
|
|
7
7
|
isFilter,
|
|
8
8
|
defaultChecked,
|
|
9
9
|
disabled = false,
|
|
10
|
+
checked,
|
|
11
|
+
className = "",
|
|
10
12
|
}) => {
|
|
11
13
|
return (
|
|
12
|
-
<Container key={`check-${id}`}>
|
|
14
|
+
<Container key={`check-${id}`} className={className}>
|
|
13
15
|
<input
|
|
14
16
|
type="checkbox"
|
|
15
17
|
name={id}
|
|
@@ -17,6 +19,7 @@ export const CheckBox = ({
|
|
|
17
19
|
onChange={onChange}
|
|
18
20
|
defaultChecked={defaultChecked}
|
|
19
21
|
disabled={disabled}
|
|
22
|
+
checked={checked}
|
|
20
23
|
/>
|
|
21
24
|
<label htmlFor={id}>
|
|
22
25
|
{label && <p className={isFilter && "filter-text"}>{label}</p>}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SideModal } from ".";
|
|
2
|
+
import { ButtonV2 } from "../../atoms/ButtonV2";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/organisms/SideModal",
|
|
6
|
+
component: SideModal,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const Template = (args) => <SideModal {...args} />;
|
|
10
|
+
|
|
11
|
+
export const DefaultSideModal = Template.bind({});
|
|
12
|
+
DefaultSideModal.args = {
|
|
13
|
+
show: false,
|
|
14
|
+
header: [
|
|
15
|
+
<div className="title-container">
|
|
16
|
+
<h2></h2>
|
|
17
|
+
</div>,
|
|
18
|
+
<ButtonV2 label="Ir al Checkout" />,
|
|
19
|
+
<ButtonV2 label="X" />,
|
|
20
|
+
],
|
|
21
|
+
body: <></>,
|
|
22
|
+
footer: <></>,
|
|
23
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
import { Container } from "./styles";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { PropaneSharp } from "@mui/icons-material";
|
|
5
|
+
|
|
6
|
+
export const SideModal = ({
|
|
7
|
+
header,
|
|
8
|
+
body,
|
|
9
|
+
footer,
|
|
10
|
+
show,
|
|
11
|
+
setShow,
|
|
12
|
+
id = "side-modal",
|
|
13
|
+
}) => {
|
|
14
|
+
const modal = useRef();
|
|
15
|
+
|
|
16
|
+
const closeModal = (e) => {
|
|
17
|
+
if (!e.target.closest(`#${id}`) && show) {
|
|
18
|
+
document.removeEventListener("click", closeModal, false);
|
|
19
|
+
modal?.current?.classList?.remove("shown");
|
|
20
|
+
setShow && setShow(false);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (show && modal.current) {
|
|
26
|
+
document.addEventListener("click", closeModal, false);
|
|
27
|
+
modal?.current?.classList?.add("shown");
|
|
28
|
+
}
|
|
29
|
+
}, [show]);
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
return () => {
|
|
33
|
+
document.removeEventListener("click", closeModal, false);
|
|
34
|
+
modal?.current?.classList?.remove("shown");
|
|
35
|
+
setShow && setShow(false);
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
show && (
|
|
41
|
+
<Container>
|
|
42
|
+
<div id={id} ref={modal} className="modal-container">
|
|
43
|
+
<div className="modal-header">{header}</div>
|
|
44
|
+
<div className="modal-body">{body}</div>
|
|
45
|
+
<div className="modal-footer">{footer}</div>
|
|
46
|
+
</div>
|
|
47
|
+
</Container>
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const Container = styled.div`
|
|
4
|
+
width: 100vw;
|
|
5
|
+
height: 100vh;
|
|
6
|
+
position: fixed;
|
|
7
|
+
z-index: 9999999;
|
|
8
|
+
background-color: transparent;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
|
|
12
|
+
.modal-container {
|
|
13
|
+
width: 600px;
|
|
14
|
+
height: 100%;
|
|
15
|
+
position: absolute;
|
|
16
|
+
right: -600px;
|
|
17
|
+
background-color: #fff;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
box-shadow: -0.5px 0px 5px #f0f0f0;
|
|
21
|
+
border: 1px solid #f0f0f0;
|
|
22
|
+
.modal-body {
|
|
23
|
+
flex: 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.shown {
|
|
27
|
+
right: 0;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
package/src/index.js
CHANGED
|
@@ -81,6 +81,7 @@ export * from "./components/organisms/Modal/index";
|
|
|
81
81
|
export * from "./components/organisms/OrderDetail/index";
|
|
82
82
|
export * from "./components/organisms/RangeCalendar";
|
|
83
83
|
export * from "./components/organisms/TableResizable";
|
|
84
|
+
export * from "./components/organisms/SideModal/index";
|
|
84
85
|
export * from "./components/organisms/PanelLayout";
|
|
85
86
|
|
|
86
87
|
//pages
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
3
|
-
|
|
4
|
-
export const Container = styled.div`
|
|
5
|
-
font-family: ${FontFamily.Raleway_500};
|
|
6
|
-
color: ${GlobalColors.s5};
|
|
7
|
-
font-size: 14px;
|
|
8
|
-
line-height: 21px;
|
|
9
|
-
border-bottom: 2px solid ${GlobalColors.s3};
|
|
10
|
-
width: 149px;
|
|
11
|
-
padding-bottom: 5px;
|
|
12
|
-
transition: 0.1s all;
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
|
|
15
|
-
&.active {
|
|
16
|
-
font-size: 18px;
|
|
17
|
-
border-bottom: 2px solid ${GlobalColors.magenta_s2};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
& + * {
|
|
21
|
-
margin-left: 10px;
|
|
22
|
-
}
|
|
23
|
-
`;
|