beem-component 2.1.18 → 2.1.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.
|
@@ -10,7 +10,7 @@ var _icons = require("@material-ui/icons");
|
|
|
10
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
11
|
var _colors = require("../colors");
|
|
12
12
|
var _iconStyles = require("../iconStyles");
|
|
13
|
-
const _excluded = ["children", "show", "size", "onHide", "centered"],
|
|
13
|
+
const _excluded = ["children", "show", "size", "zIndex", "onHide", "centered"],
|
|
14
14
|
_excluded2 = ["children", "size", "onHide", "subHeading", "closeButton", "show", "icon", "trailingIcon"];
|
|
15
15
|
/* eslint-disable no-undef */
|
|
16
16
|
/* eslint-disable react/display-name */
|
|
@@ -25,13 +25,18 @@ const {
|
|
|
25
25
|
} = /*#__PURE__*/_react.default.createContext();
|
|
26
26
|
const Overlay = exports.Overlay = _styledComponents.default.div.withConfig({
|
|
27
27
|
displayName: "modal__Overlay"
|
|
28
|
-
})(["position:fixed;top:0;left:0;z-index:
|
|
28
|
+
})(["position:fixed;top:0;left:0;z-index:", ";width:100vw;height:100vh;background-color:", ";"], _ref => {
|
|
29
|
+
let {
|
|
30
|
+
zIndex
|
|
31
|
+
} = _ref;
|
|
32
|
+
return zIndex || 20;
|
|
33
|
+
}, _colors.BmBgGrey45);
|
|
29
34
|
const ModalContent = exports.ModalContent = _styledComponents.default.div.withConfig({
|
|
30
35
|
displayName: "modal__ModalContent"
|
|
31
|
-
})(["display:flex;flex-direction:column;border-radius:0.8571rem;padding:1rem;margin:2rem auto;background:", ";width:auto;max-width:100%;> *:not(:last-child){margin-bottom:0.5rem;}@media (min-width:576px){width:", ";}"], _colors.BmPrimaryWhite,
|
|
36
|
+
})(["display:flex;flex-direction:column;border-radius:0.8571rem;padding:1rem;margin:2rem auto;background:", ";width:auto;max-width:100%;> *:not(:last-child){margin-bottom:0.5rem;}@media (min-width:576px){width:", ";}"], _colors.BmPrimaryWhite, _ref2 => {
|
|
32
37
|
let {
|
|
33
38
|
size
|
|
34
|
-
} =
|
|
39
|
+
} = _ref2;
|
|
35
40
|
if (size) {
|
|
36
41
|
return size;
|
|
37
42
|
}
|
|
@@ -40,15 +45,16 @@ const ModalContent = exports.ModalContent = _styledComponents.default.div.withCo
|
|
|
40
45
|
const ModalWrapper = exports.ModalWrapper = _styledComponents.default.div.withConfig({
|
|
41
46
|
displayName: "modal__ModalWrapper"
|
|
42
47
|
})(["position:fixed;top:0;left:0;z-index:9999;display:block;width:100%;height:100%;overflow:hidden;outline:0;margin:auto;overflow-x:hidden;overflow-y:auto;"]);
|
|
43
|
-
const BmModal =
|
|
48
|
+
const BmModal = _ref3 => {
|
|
44
49
|
let {
|
|
45
50
|
children,
|
|
46
51
|
show,
|
|
47
52
|
size,
|
|
53
|
+
zIndex,
|
|
48
54
|
onHide,
|
|
49
55
|
centered
|
|
50
|
-
} =
|
|
51
|
-
rest = _objectWithoutProperties(
|
|
56
|
+
} = _ref3,
|
|
57
|
+
rest = _objectWithoutProperties(_ref3, _excluded);
|
|
52
58
|
const [toggle, setToggle] = (0, _react.useState)(show);
|
|
53
59
|
(0, _react.useEffect)(() => {
|
|
54
60
|
setToggle(show);
|
|
@@ -62,7 +68,9 @@ const BmModal = _ref2 => {
|
|
|
62
68
|
document.addEventListener('keydown', keyPress);
|
|
63
69
|
return () => document.removeEventListener('keydown', keyPress);
|
|
64
70
|
}, [keyPress]);
|
|
65
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, toggle && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Overlay,
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, toggle && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Overlay, {
|
|
72
|
+
zIndex: zIndex
|
|
73
|
+
}), /*#__PURE__*/_react.default.createElement(ModalWrapper, {
|
|
66
74
|
showModal: show,
|
|
67
75
|
centered: centered,
|
|
68
76
|
onHide: onHide
|
|
@@ -87,7 +95,7 @@ const ModalHeaderContent = _styledComponents.default.div.withConfig({
|
|
|
87
95
|
const IconContainer = _styledComponents.default.div.withConfig({
|
|
88
96
|
displayName: "modal__IconContainer"
|
|
89
97
|
})(["display:flex;padding:0.5714rem;justify-content:center;align-items:center;border-radius:0.7143rem;border:0.0714rem solid var(--Gray-200,#eaecf0);background:var(--Base-White,#fff);box-shadow:0rem 0.0714rem 0.1429rem 0rem rgba(16,24,40,0.05);"]);
|
|
90
|
-
BmModal.Header =
|
|
98
|
+
BmModal.Header = _ref4 => {
|
|
91
99
|
let {
|
|
92
100
|
children,
|
|
93
101
|
size,
|
|
@@ -97,8 +105,8 @@ BmModal.Header = _ref3 => {
|
|
|
97
105
|
show,
|
|
98
106
|
icon,
|
|
99
107
|
trailingIcon
|
|
100
|
-
} =
|
|
101
|
-
rest = _objectWithoutProperties(
|
|
108
|
+
} = _ref4,
|
|
109
|
+
rest = _objectWithoutProperties(_ref4, _excluded2);
|
|
102
110
|
return /*#__PURE__*/_react.default.createElement(Consumer, null, value => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(ModalHeader, rest, trailingIcon && /*#__PURE__*/_react.default.createElement(IconContainer, null, trailingIcon), /*#__PURE__*/_react.default.createElement("div", {
|
|
103
111
|
style: {
|
|
104
112
|
width: '100%'
|
package/package.json
CHANGED
package/src/App.js
CHANGED
|
@@ -916,6 +916,7 @@ const Chat = () => {
|
|
|
916
916
|
};
|
|
917
917
|
};
|
|
918
918
|
const [showModal, setShowModal] = useState(false);
|
|
919
|
+
const [showModal1, setShowModal1] = useState(false);
|
|
919
920
|
|
|
920
921
|
const renderJsonMessagex = () => {
|
|
921
922
|
const parsedMessage = JSON.parse(x.metadata.prev_message);
|
|
@@ -1080,6 +1081,48 @@ const Chat = () => {
|
|
|
1080
1081
|
<BmButton onClick={() => setShowModal(!showModal)}>Click Me!</BmButton>
|
|
1081
1082
|
</div>
|
|
1082
1083
|
<BmModal show={showModal} onHide={() => setShowModal(false)}>
|
|
1084
|
+
<BmModal.Header closeButton>
|
|
1085
|
+
<h2>Header</h2>
|
|
1086
|
+
</BmModal.Header>
|
|
1087
|
+
<BmModal.Body>
|
|
1088
|
+
<div
|
|
1089
|
+
style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}
|
|
1090
|
+
>
|
|
1091
|
+
{sampleAppointmentTypes.map((type) => (
|
|
1092
|
+
<BmHorizontalCard
|
|
1093
|
+
name={type.name}
|
|
1094
|
+
description="Handles imaging and diagnostic scanssdijfsdoijfoisd jsdoij fosidf jsdoif jsdoifs ergjri gr[ jdi[t gegrepg fghepoiurig hroegeigig hep etghtpg hepghrp eug hrg[o hrgiorwrgh w[uugo ggwg iuhwoigw[ig soiug [oh g[wgh[oig hrw[ouig hei reg rwg wgujhsuw hgwrg h9rug rfewrewg fskg42398 glskjgur ghwpgh43hsaujhpghrpeihhou re9ojgpoh"
|
|
1095
|
+
price={type.price}
|
|
1096
|
+
color={type.color}
|
|
1097
|
+
isActive={type.isActive}
|
|
1098
|
+
location={type.location}
|
|
1099
|
+
paymentRequired={type.paymentRequired}
|
|
1100
|
+
selectedResources={type.selectedResources}
|
|
1101
|
+
address={type.address}
|
|
1102
|
+
duration={type.duration}
|
|
1103
|
+
guest_limit={type.guest_limit}
|
|
1104
|
+
key={type.id}
|
|
1105
|
+
onView={() => handleView(type.id)}
|
|
1106
|
+
onDelete={() => handleDelete(type)}
|
|
1107
|
+
onCopyLink={() => handleCopyLink(type.id)}
|
|
1108
|
+
data={type}
|
|
1109
|
+
editToolTip="edit appointment type"
|
|
1110
|
+
deleteToolTip="delete appointment type"
|
|
1111
|
+
copyToolTip="copy appointment type link"
|
|
1112
|
+
/>
|
|
1113
|
+
))}
|
|
1114
|
+
</div>
|
|
1115
|
+
</BmModal.Body>
|
|
1116
|
+
<BmModal.Footer>
|
|
1117
|
+
<p>This is a footer</p>
|
|
1118
|
+
<BmButton onClick={() => setShowModal1(true)}>open</BmButton>
|
|
1119
|
+
</BmModal.Footer>
|
|
1120
|
+
</BmModal>
|
|
1121
|
+
<BmModal
|
|
1122
|
+
zIndex={9999}
|
|
1123
|
+
show={showModal1}
|
|
1124
|
+
onHide={() => setShowModal1(false)}
|
|
1125
|
+
>
|
|
1083
1126
|
<BmModal.Header closeButton>
|
|
1084
1127
|
<h2>Header</h2>
|
|
1085
1128
|
</BmModal.Header>
|
|
@@ -1088,9 +1131,9 @@ const Chat = () => {
|
|
|
1088
1131
|
</BmModal.Body>
|
|
1089
1132
|
<BmModal.Footer>
|
|
1090
1133
|
<p>This is a footer</p>
|
|
1134
|
+
<BmButton onClick={() => setShowModal1(false)}>Close</BmButton>
|
|
1091
1135
|
</BmModal.Footer>
|
|
1092
1136
|
</BmModal>
|
|
1093
|
-
|
|
1094
1137
|
<div
|
|
1095
1138
|
style={{
|
|
1096
1139
|
display: 'flex',
|
|
@@ -15,7 +15,7 @@ export const Overlay = styled.div`
|
|
|
15
15
|
position: fixed;
|
|
16
16
|
top: 0;
|
|
17
17
|
left: 0;
|
|
18
|
-
z-index: 20;
|
|
18
|
+
z-index: ${({ zIndex }) => zIndex || 20};
|
|
19
19
|
width: 100vw;
|
|
20
20
|
height: 100vh;
|
|
21
21
|
background-color: ${BmBgGrey45};
|
|
@@ -58,7 +58,15 @@ export const ModalWrapper = styled.div`
|
|
|
58
58
|
overflow-y: auto;
|
|
59
59
|
`;
|
|
60
60
|
|
|
61
|
-
const BmModal = ({
|
|
61
|
+
const BmModal = ({
|
|
62
|
+
children,
|
|
63
|
+
show,
|
|
64
|
+
size,
|
|
65
|
+
zIndex,
|
|
66
|
+
onHide,
|
|
67
|
+
centered,
|
|
68
|
+
...rest
|
|
69
|
+
}) => {
|
|
62
70
|
const [toggle, setToggle] = useState(show);
|
|
63
71
|
useEffect(() => {
|
|
64
72
|
setToggle(show);
|
|
@@ -82,7 +90,7 @@ const BmModal = ({ children, show, size, onHide, centered, ...rest }) => {
|
|
|
82
90
|
<>
|
|
83
91
|
{toggle && (
|
|
84
92
|
<>
|
|
85
|
-
<Overlay />
|
|
93
|
+
<Overlay zIndex={zIndex} />
|
|
86
94
|
<ModalWrapper showModal={show} centered={centered} onHide={onHide}>
|
|
87
95
|
<Provider value={{ toggle, setToggle, size, show, onHide }}>
|
|
88
96
|
<ModalContent size={size} {...rest}>
|
|
@@ -8,12 +8,11 @@ export default {
|
|
|
8
8
|
component: BmModal,
|
|
9
9
|
title: 'components/Modals',
|
|
10
10
|
argTypes: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// },
|
|
11
|
+
size: {
|
|
12
|
+
control: { type: 'text' },
|
|
13
|
+
description: 'Controls the width of the modal in Pixels',
|
|
14
|
+
defaultValue: '500px',
|
|
15
|
+
},
|
|
17
16
|
closeButton: {
|
|
18
17
|
description:
|
|
19
18
|
'Placed on BmModal.Header component. Displays the close button (X)',
|
|
@@ -28,6 +27,11 @@ export default {
|
|
|
28
27
|
onHide: {
|
|
29
28
|
description: 'Handling the closing of the modal',
|
|
30
29
|
},
|
|
30
|
+
zIndex: {
|
|
31
|
+
description:
|
|
32
|
+
'Controls the stacking order of the modal in an event you have multiple modals',
|
|
33
|
+
control: { type: 'number' },
|
|
34
|
+
},
|
|
31
35
|
},
|
|
32
36
|
};
|
|
33
37
|
|