@thecb/components 10.5.1-beta.2 → 10.5.1-beta.4
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 +50 -52
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +50 -52
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/modal/Modal.stories.js +1 -1
- package/src/components/molecules/modal/ModalControlV2.js +6 -17
- package/src/components/molecules/modal/__private__/CloseIconButton.js +11 -3
- package/src/components/molecules/modal/__private__/index.d.ts +11 -11
- package/src/components/molecules/modal/__private__/index.js +1 -1
- package/src/constants/style_constants.js +1 -1
package/package.json
CHANGED
|
@@ -76,8 +76,8 @@ export const modalV2 = () => (
|
|
|
76
76
|
noButtons={boolean("noButtons", false, groupId)}
|
|
77
77
|
onlyCloseButton={boolean("onlyCloseButton", false, groupId)}
|
|
78
78
|
onlyContinueButton={boolean("onlyContinueButton", false, groupId)}
|
|
79
|
-
useDangerButton={boolean("useDangerButton", false, groupId)}
|
|
80
79
|
showCloseIconButton={boolean("showCloseIconButton", true, groupId)}
|
|
80
|
+
useDangerButton={boolean("useDangerButton", false, groupId)}
|
|
81
81
|
/>
|
|
82
82
|
);
|
|
83
83
|
|
|
@@ -18,8 +18,8 @@ import {
|
|
|
18
18
|
ButtonLayoutWrapper,
|
|
19
19
|
CancelButton,
|
|
20
20
|
CloseButton,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
CloseIconButton,
|
|
22
|
+
ContinueButton
|
|
23
23
|
} from "./__private__";
|
|
24
24
|
|
|
25
25
|
/*
|
|
@@ -44,8 +44,8 @@ const Modal = ({
|
|
|
44
44
|
closeButtonText = "Close",
|
|
45
45
|
continueAction = noop,
|
|
46
46
|
continueButtonText = "Continue",
|
|
47
|
-
continueURL = "",
|
|
48
47
|
continueButtonVariant = "primary",
|
|
48
|
+
continueURL = "",
|
|
49
49
|
customWidth = "",
|
|
50
50
|
dataQa = null,
|
|
51
51
|
defaultWrapper = true,
|
|
@@ -63,9 +63,9 @@ const Modal = ({
|
|
|
63
63
|
onExit = hideModal,
|
|
64
64
|
onlyCloseButton = false,
|
|
65
65
|
onlyContinueButton = false,
|
|
66
|
+
showCloseIconButton = false,
|
|
66
67
|
underlayClickExits = true,
|
|
67
|
-
useDangerButton = false
|
|
68
|
-
showCloseIconButton = false
|
|
68
|
+
useDangerButton = false
|
|
69
69
|
}) => {
|
|
70
70
|
const { isMobile } = useContext(ThemeContext);
|
|
71
71
|
|
|
@@ -141,18 +141,7 @@ const Modal = ({
|
|
|
141
141
|
{modalHeaderText}
|
|
142
142
|
</Title>
|
|
143
143
|
{showCloseIconButton && (
|
|
144
|
-
<CloseIconButton
|
|
145
|
-
hideModal={hideModal}
|
|
146
|
-
buttonExtraStyles={`
|
|
147
|
-
min-height: auto;
|
|
148
|
-
min-width: auto;
|
|
149
|
-
height: 1.5rem;
|
|
150
|
-
margin: 0 0 0 0.5rem;
|
|
151
|
-
&:focus {
|
|
152
|
-
outline-offset: -3px;
|
|
153
|
-
}
|
|
154
|
-
`}
|
|
155
|
-
/>
|
|
144
|
+
<CloseIconButton hideModal={hideModal} />
|
|
156
145
|
)}
|
|
157
146
|
</Cluster>
|
|
158
147
|
</Box>
|
|
@@ -13,11 +13,19 @@ export const CloseIconButton = ({
|
|
|
13
13
|
}) => {
|
|
14
14
|
return (
|
|
15
15
|
<ButtonWithAction
|
|
16
|
-
variant="smallGhost"
|
|
17
16
|
action={hideModal}
|
|
18
|
-
contentOverride
|
|
19
|
-
extraStyles={buttonExtraStyles}
|
|
20
17
|
aria-label={ariaLabel}
|
|
18
|
+
contentOverride
|
|
19
|
+
extraStyles={`
|
|
20
|
+
min-height: auto;
|
|
21
|
+
min-width: auto;
|
|
22
|
+
height: 1.5rem;
|
|
23
|
+
margin: 0 0 0 0.5rem;
|
|
24
|
+
&:focus {
|
|
25
|
+
outline-offset: -3px;
|
|
26
|
+
}
|
|
27
|
+
`}
|
|
28
|
+
variant="smallGhost"
|
|
21
29
|
>
|
|
22
30
|
<CloseIcon
|
|
23
31
|
role="img"
|
|
@@ -32,6 +32,17 @@ export interface CloseButtonProps {
|
|
|
32
32
|
export declare const CloseButton: React.FC<Expand<CloseButtonProps> &
|
|
33
33
|
React.HTMLAttributes<HTMLElement>>;
|
|
34
34
|
|
|
35
|
+
export interface CloseIconButtonProps {
|
|
36
|
+
buttonExtraStyles?: string;
|
|
37
|
+
hideModal?: action;
|
|
38
|
+
iconWidth?: string;
|
|
39
|
+
iconHeight?: string;
|
|
40
|
+
ariaLabel?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export declare const CloseIconButton: React.FC<Expand<CloseIconButtonProps> &
|
|
44
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
45
|
+
|
|
35
46
|
export interface ContinueButtonProps {
|
|
36
47
|
buttonExtraStyles?: string;
|
|
37
48
|
continueAction?: Function;
|
|
@@ -46,14 +57,3 @@ export interface ContinueButtonProps {
|
|
|
46
57
|
|
|
47
58
|
export declare const ContinueButton: React.FC<Expand<ContinueButtonProps> &
|
|
48
59
|
React.HTMLAttributes<HTMLElement>>;
|
|
49
|
-
|
|
50
|
-
export interface CloseIconButtonProps {
|
|
51
|
-
buttonExtraStyles?: string;
|
|
52
|
-
hideModal?: action;
|
|
53
|
-
iconWidth?: string;
|
|
54
|
-
iconHeight?: string;
|
|
55
|
-
ariaLabel?: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export declare const CloseIconButton: React.FC<Expand<CloseIconButtonProps> &
|
|
59
|
-
React.HTMLAttributes<HTMLElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as ButtonLayoutWrapper } from "./ButtonLayoutWrapper";
|
|
2
2
|
export { default as CancelButton } from "./CancelButton";
|
|
3
3
|
export { default as CloseButton } from "./CloseButton";
|
|
4
|
-
export { default as ContinueButton } from "./ContinueButton";
|
|
5
4
|
export { default as CloseIconButton } from "./CloseIconButton";
|
|
5
|
+
export { default as ContinueButton } from "./ContinueButton";
|