@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/dist/index.cjs.js
CHANGED
|
@@ -4921,7 +4921,7 @@ var FONT_SIZE = {
|
|
|
4921
4921
|
// 16px
|
|
4922
4922
|
LG: "1.125rem",
|
|
4923
4923
|
// 18px
|
|
4924
|
-
|
|
4924
|
+
XL: "1.250rem" //20px
|
|
4925
4925
|
};
|
|
4926
4926
|
var FONT_WEIGHT_REGULAR = "400";
|
|
4927
4927
|
var FONT_WEIGHT_SEMIBOLD = "600";
|
|
@@ -46550,46 +46550,6 @@ var CloseButton = function CloseButton(_ref) {
|
|
|
46550
46550
|
});
|
|
46551
46551
|
};
|
|
46552
46552
|
|
|
46553
|
-
var ContinueButton = function ContinueButton(_ref) {
|
|
46554
|
-
var _ref$buttonExtraStyle = _ref.buttonExtraStyles,
|
|
46555
|
-
buttonExtraStyles = _ref$buttonExtraStyle === void 0 ? "" : _ref$buttonExtraStyle,
|
|
46556
|
-
_ref$continueAction = _ref.continueAction,
|
|
46557
|
-
continueAction = _ref$continueAction === void 0 ? noop : _ref$continueAction,
|
|
46558
|
-
_ref$continueButtonTe = _ref.continueButtonText,
|
|
46559
|
-
continueButtonText = _ref$continueButtonTe === void 0 ? "" : _ref$continueButtonTe,
|
|
46560
|
-
_ref$continueURL = _ref.continueURL,
|
|
46561
|
-
continueURL = _ref$continueURL === void 0 ? "" : _ref$continueURL,
|
|
46562
|
-
_ref$continueButtonVa = _ref.continueButtonVariant,
|
|
46563
|
-
continueButtonVariant = _ref$continueButtonVa === void 0 ? "primary" : _ref$continueButtonVa,
|
|
46564
|
-
_ref$isContinueAction = _ref.isContinueActionDisabled,
|
|
46565
|
-
isContinueActionDisabled = _ref$isContinueAction === void 0 ? false : _ref$isContinueAction,
|
|
46566
|
-
_ref$isLoading = _ref.isLoading,
|
|
46567
|
-
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
46568
|
-
_ref$isMobile = _ref.isMobile,
|
|
46569
|
-
isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile,
|
|
46570
|
-
_ref$useDangerButton = _ref.useDangerButton,
|
|
46571
|
-
useDangerButton = _ref$useDangerButton === void 0 ? false : _ref$useDangerButton;
|
|
46572
|
-
var ContinueButtonAtom = continueURL ? ButtonWithLink : ButtonWithAction;
|
|
46573
|
-
var fontSize = "font-size: ".concat(isMobile ? FONT_SIZE.XS : FONT_SIZE.SM, ";");
|
|
46574
|
-
var width = isMobile ? "width: 100%;" : "";
|
|
46575
|
-
return /*#__PURE__*/React__default.createElement(ContinueButtonAtom, {
|
|
46576
|
-
action: continueAction,
|
|
46577
|
-
borderRadius: BORDER_RADIUS.MD,
|
|
46578
|
-
className: "modal-continue-button",
|
|
46579
|
-
dataQa: continueButtonText,
|
|
46580
|
-
disabled: isContinueActionDisabled,
|
|
46581
|
-
extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(width),
|
|
46582
|
-
isLoading: isLoading,
|
|
46583
|
-
linkExtraStyles: "display: inline-block; ".concat(width),
|
|
46584
|
-
name: continueButtonText,
|
|
46585
|
-
role: "button",
|
|
46586
|
-
text: continueButtonText,
|
|
46587
|
-
textExtraStyles: "".concat(fontSize),
|
|
46588
|
-
url: continueURL,
|
|
46589
|
-
variant: useDangerButton ? "danger" : continueButtonVariant
|
|
46590
|
-
});
|
|
46591
|
-
};
|
|
46592
|
-
|
|
46593
46553
|
// TODO: Remove from `core-js@4`
|
|
46594
46554
|
|
|
46595
46555
|
|
|
@@ -62822,7 +62782,6 @@ var dist_13$1 = dist$7.withKnobs;
|
|
|
62822
62782
|
|
|
62823
62783
|
var CloseIconButton = function CloseIconButton(_ref) {
|
|
62824
62784
|
var _ref$buttonExtraStyle = _ref.buttonExtraStyles,
|
|
62825
|
-
buttonExtraStyles = _ref$buttonExtraStyle === void 0 ? "" : _ref$buttonExtraStyle,
|
|
62826
62785
|
_ref$hideModal = _ref.hideModal,
|
|
62827
62786
|
hideModal = _ref$hideModal === void 0 ? noop : _ref$hideModal,
|
|
62828
62787
|
_ref$iconWidth = _ref.iconWidth,
|
|
@@ -62832,11 +62791,11 @@ var CloseIconButton = function CloseIconButton(_ref) {
|
|
|
62832
62791
|
_ref$ariaLabel = _ref.ariaLabel,
|
|
62833
62792
|
ariaLabel = _ref$ariaLabel === void 0 ? "Close Modal" : _ref$ariaLabel;
|
|
62834
62793
|
return /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
62835
|
-
variant: "smallGhost",
|
|
62836
62794
|
action: hideModal,
|
|
62795
|
+
"aria-label": ariaLabel,
|
|
62837
62796
|
contentOverride: true,
|
|
62838
|
-
extraStyles:
|
|
62839
|
-
"
|
|
62797
|
+
extraStyles: "\n min-height: auto;\n min-width: auto;\n height: 1.5rem;\n margin: 0 0 0 0.5rem;\n &:focus {\n outline-offset: -3px;\n }\n ",
|
|
62798
|
+
variant: "smallGhost"
|
|
62840
62799
|
}, /*#__PURE__*/React__default.createElement(CloseIcon, {
|
|
62841
62800
|
role: "img",
|
|
62842
62801
|
"aria-hidden": "true",
|
|
@@ -62845,6 +62804,46 @@ var CloseIconButton = function CloseIconButton(_ref) {
|
|
|
62845
62804
|
}));
|
|
62846
62805
|
};
|
|
62847
62806
|
|
|
62807
|
+
var ContinueButton = function ContinueButton(_ref) {
|
|
62808
|
+
var _ref$buttonExtraStyle = _ref.buttonExtraStyles,
|
|
62809
|
+
buttonExtraStyles = _ref$buttonExtraStyle === void 0 ? "" : _ref$buttonExtraStyle,
|
|
62810
|
+
_ref$continueAction = _ref.continueAction,
|
|
62811
|
+
continueAction = _ref$continueAction === void 0 ? noop : _ref$continueAction,
|
|
62812
|
+
_ref$continueButtonTe = _ref.continueButtonText,
|
|
62813
|
+
continueButtonText = _ref$continueButtonTe === void 0 ? "" : _ref$continueButtonTe,
|
|
62814
|
+
_ref$continueURL = _ref.continueURL,
|
|
62815
|
+
continueURL = _ref$continueURL === void 0 ? "" : _ref$continueURL,
|
|
62816
|
+
_ref$continueButtonVa = _ref.continueButtonVariant,
|
|
62817
|
+
continueButtonVariant = _ref$continueButtonVa === void 0 ? "primary" : _ref$continueButtonVa,
|
|
62818
|
+
_ref$isContinueAction = _ref.isContinueActionDisabled,
|
|
62819
|
+
isContinueActionDisabled = _ref$isContinueAction === void 0 ? false : _ref$isContinueAction,
|
|
62820
|
+
_ref$isLoading = _ref.isLoading,
|
|
62821
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
62822
|
+
_ref$isMobile = _ref.isMobile,
|
|
62823
|
+
isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile,
|
|
62824
|
+
_ref$useDangerButton = _ref.useDangerButton,
|
|
62825
|
+
useDangerButton = _ref$useDangerButton === void 0 ? false : _ref$useDangerButton;
|
|
62826
|
+
var ContinueButtonAtom = continueURL ? ButtonWithLink : ButtonWithAction;
|
|
62827
|
+
var fontSize = "font-size: ".concat(isMobile ? FONT_SIZE.XS : FONT_SIZE.SM, ";");
|
|
62828
|
+
var width = isMobile ? "width: 100%;" : "";
|
|
62829
|
+
return /*#__PURE__*/React__default.createElement(ContinueButtonAtom, {
|
|
62830
|
+
action: continueAction,
|
|
62831
|
+
borderRadius: BORDER_RADIUS.MD,
|
|
62832
|
+
className: "modal-continue-button",
|
|
62833
|
+
dataQa: continueButtonText,
|
|
62834
|
+
disabled: isContinueActionDisabled,
|
|
62835
|
+
extraStyles: "".concat(buttonExtraStyles, "; margin: 0; ").concat(width),
|
|
62836
|
+
isLoading: isLoading,
|
|
62837
|
+
linkExtraStyles: "display: inline-block; ".concat(width),
|
|
62838
|
+
name: continueButtonText,
|
|
62839
|
+
role: "button",
|
|
62840
|
+
text: continueButtonText,
|
|
62841
|
+
textExtraStyles: "".concat(fontSize),
|
|
62842
|
+
url: continueURL,
|
|
62843
|
+
variant: useDangerButton ? "danger" : continueButtonVariant
|
|
62844
|
+
});
|
|
62845
|
+
};
|
|
62846
|
+
|
|
62848
62847
|
/*
|
|
62849
62848
|
Default Modal molecule
|
|
62850
62849
|
Uses react-aria-modal behind the scenes for a11y purposes
|
|
@@ -62877,10 +62876,10 @@ var Modal$2 = function Modal(_ref) {
|
|
|
62877
62876
|
continueAction = _ref$continueAction === void 0 ? noop : _ref$continueAction,
|
|
62878
62877
|
_ref$continueButtonTe = _ref.continueButtonText,
|
|
62879
62878
|
continueButtonText = _ref$continueButtonTe === void 0 ? "Continue" : _ref$continueButtonTe,
|
|
62880
|
-
_ref$continueURL = _ref.continueURL,
|
|
62881
|
-
continueURL = _ref$continueURL === void 0 ? "" : _ref$continueURL,
|
|
62882
62879
|
_ref$continueButtonVa = _ref.continueButtonVariant,
|
|
62883
62880
|
continueButtonVariant = _ref$continueButtonVa === void 0 ? "primary" : _ref$continueButtonVa,
|
|
62881
|
+
_ref$continueURL = _ref.continueURL,
|
|
62882
|
+
continueURL = _ref$continueURL === void 0 ? "" : _ref$continueURL,
|
|
62884
62883
|
_ref$customWidth = _ref.customWidth,
|
|
62885
62884
|
customWidth = _ref$customWidth === void 0 ? "" : _ref$customWidth,
|
|
62886
62885
|
_ref$dataQa = _ref.dataQa,
|
|
@@ -62915,12 +62914,12 @@ var Modal$2 = function Modal(_ref) {
|
|
|
62915
62914
|
onlyCloseButton = _ref$onlyCloseButton === void 0 ? false : _ref$onlyCloseButton,
|
|
62916
62915
|
_ref$onlyContinueButt = _ref.onlyContinueButton,
|
|
62917
62916
|
onlyContinueButton = _ref$onlyContinueButt === void 0 ? false : _ref$onlyContinueButt,
|
|
62917
|
+
_ref$showCloseIconBut = _ref.showCloseIconButton,
|
|
62918
|
+
showCloseIconButton = _ref$showCloseIconBut === void 0 ? false : _ref$showCloseIconBut,
|
|
62918
62919
|
_ref$underlayClickExi = _ref.underlayClickExits,
|
|
62919
62920
|
underlayClickExits = _ref$underlayClickExi === void 0 ? true : _ref$underlayClickExi,
|
|
62920
62921
|
_ref$useDangerButton = _ref.useDangerButton,
|
|
62921
|
-
useDangerButton = _ref$useDangerButton === void 0 ? false : _ref$useDangerButton
|
|
62922
|
-
_ref$showCloseIconBut = _ref.showCloseIconButton,
|
|
62923
|
-
showCloseIconButton = _ref$showCloseIconBut === void 0 ? false : _ref$showCloseIconBut;
|
|
62922
|
+
useDangerButton = _ref$useDangerButton === void 0 ? false : _ref$useDangerButton;
|
|
62924
62923
|
var _useContext = React.useContext(styled.ThemeContext),
|
|
62925
62924
|
isMobile = _useContext.isMobile;
|
|
62926
62925
|
|
|
@@ -62988,8 +62987,7 @@ var Modal$2 = function Modal(_ref) {
|
|
|
62988
62987
|
weight: FONT_WEIGHT_SEMIBOLD,
|
|
62989
62988
|
fontSize: isMobile ? FONT_SIZE.MD : FONT_SIZE.LG
|
|
62990
62989
|
}, modalHeaderText), showCloseIconButton && /*#__PURE__*/React__default.createElement(CloseIconButton, {
|
|
62991
|
-
hideModal: hideModal
|
|
62992
|
-
buttonExtraStyles: "\n min-height: auto;\n min-width: auto;\n height: 1.5rem;\n margin: 0 0 0 0.5rem;\n &:focus {\n outline-offset: -3px;\n }\n "
|
|
62990
|
+
hideModal: hideModal
|
|
62993
62991
|
}))), /*#__PURE__*/React__default.createElement(Box, {
|
|
62994
62992
|
background: modalBodyBg || ATHENS_GREY,
|
|
62995
62993
|
padding: "0"
|