@thecb/components 10.4.0-beta.15 → 10.4.0-beta.17
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/index.cjs.js +61 -54
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +61 -54
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/modal/Modal.js +6 -2
- package/src/components/molecules/modal/Modal.stories.js +2 -0
- package/src/components/molecules/obligation/modules/InactiveControlsModule.js +1 -1
- package/src/components/molecules/obligation/modules/RemoveAccountModalModule.js +8 -5
package/package.json
CHANGED
|
@@ -46,7 +46,8 @@ const Modal = ({
|
|
|
46
46
|
buttonExtraStyles,
|
|
47
47
|
children,
|
|
48
48
|
dataQa = null,
|
|
49
|
-
initialFocusSelector = ""
|
|
49
|
+
initialFocusSelector = "",
|
|
50
|
+
blurUnderlay = true
|
|
50
51
|
}) => {
|
|
51
52
|
const { isMobile } = useContext(ThemeContext);
|
|
52
53
|
const modalContainerRef = useRef(null);
|
|
@@ -66,7 +67,10 @@ const Modal = ({
|
|
|
66
67
|
display: "flex",
|
|
67
68
|
flexDirection: "column",
|
|
68
69
|
justifyContent: "center",
|
|
69
|
-
alignItems: "center"
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
background: "rgba(41, 42, 51, 0.45)",
|
|
72
|
+
backdropFilter: blurUnderlay ? "blur(4px)" : "none",
|
|
73
|
+
WebkitBackdropFilter: blurUnderlay ? "blur(4px)" : "none"
|
|
70
74
|
}}
|
|
71
75
|
dialogStyle={{
|
|
72
76
|
width: customWidth || "615px",
|
|
@@ -35,6 +35,7 @@ export const modal = () => (
|
|
|
35
35
|
defaultWrapper={boolean("defaultWrapper", true, groupId)}
|
|
36
36
|
onlyCloseButton={boolean("onlyCloseButton", false, groupId)}
|
|
37
37
|
maxHeight={text("maxHeight", null, groupId)}
|
|
38
|
+
blurUnderlay={boolean("blurUnderlay", true, groupId)}
|
|
38
39
|
/>
|
|
39
40
|
);
|
|
40
41
|
|
|
@@ -80,6 +81,7 @@ export const modalWithoutButtons = () => {
|
|
|
80
81
|
defaultWrapper={boolean("defaultWrapper", true, groupId)}
|
|
81
82
|
noButtons={boolean("noButtons", true, groupId)}
|
|
82
83
|
maxHeight={text("maxHeight", null, groupId)}
|
|
84
|
+
blurUnderlay={boolean("blurUnderlay", false, groupId)}
|
|
83
85
|
/>
|
|
84
86
|
);
|
|
85
87
|
};
|
|
@@ -69,7 +69,7 @@ const InactiveControlsModule = ({
|
|
|
69
69
|
removeAccount={disableActions ? noop : handleRemoveAccount}
|
|
70
70
|
accountType={configType === "ACCOUNT" ? "Account" : "Property"}
|
|
71
71
|
isMobile={isMobile}
|
|
72
|
-
|
|
72
|
+
disableActions={disableActions}
|
|
73
73
|
/>
|
|
74
74
|
</Box>
|
|
75
75
|
</Cluster>
|
|
@@ -2,6 +2,7 @@ import React, { useState } from "react";
|
|
|
2
2
|
import Modal from "../../modal";
|
|
3
3
|
import ButtonWithAction from "../../../atoms/button-with-action";
|
|
4
4
|
import { Box } from "../../../atoms/layouts";
|
|
5
|
+
import { noop } from "../../../../util/general";
|
|
5
6
|
|
|
6
7
|
const RemoveAccountModalModule = ({
|
|
7
8
|
agencyName,
|
|
@@ -9,7 +10,7 @@ const RemoveAccountModalModule = ({
|
|
|
9
10
|
removeAccount,
|
|
10
11
|
accountType,
|
|
11
12
|
isMobile,
|
|
12
|
-
|
|
13
|
+
disableActions = false
|
|
13
14
|
}) => {
|
|
14
15
|
const [modalIsOpen, setModalIsOpen] = useState(false);
|
|
15
16
|
const lastItem = [...obligations].pop();
|
|
@@ -41,8 +42,10 @@ const RemoveAccountModalModule = ({
|
|
|
41
42
|
} will be deactivated.`}
|
|
42
43
|
continueButtonText="Remove"
|
|
43
44
|
continueAction={() => {
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
if (!disableActions) {
|
|
46
|
+
removeAccount();
|
|
47
|
+
setModalIsOpen(false);
|
|
48
|
+
}
|
|
46
49
|
}}
|
|
47
50
|
useDangerButton
|
|
48
51
|
>
|
|
@@ -50,12 +53,12 @@ const RemoveAccountModalModule = ({
|
|
|
50
53
|
<ButtonWithAction
|
|
51
54
|
text="Remove"
|
|
52
55
|
variant="secondary"
|
|
53
|
-
action={
|
|
56
|
+
action={disableActions ? noop : () => setModalIsOpen(true)}
|
|
54
57
|
dataQa="Remove Account"
|
|
55
58
|
extraStyles={
|
|
56
59
|
isMobile ? `flex-grow: 1; width: 100%; margin: 0;` : `flex-grow: 1;`
|
|
57
60
|
}
|
|
58
|
-
disabled={
|
|
61
|
+
disabled={disableActions}
|
|
59
62
|
/>
|
|
60
63
|
</Box>
|
|
61
64
|
</Modal>
|