@thecb/components 7.9.4-beta.2 → 7.9.4-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 +49 -44
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +49 -44
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/checkbox/Checkbox.js +1 -3
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +14 -6
package/dist/index.esm.js
CHANGED
|
@@ -21000,43 +21000,40 @@ var HiddenCheckbox = styled.input.attrs({
|
|
|
21000
21000
|
var StyledCheckbox = styled.div.withConfig({
|
|
21001
21001
|
displayName: "Checkbox__StyledCheckbox",
|
|
21002
21002
|
componentId: "sc-36kqbv-4"
|
|
21003
|
-
})(["display:inline-block;
|
|
21004
|
-
var
|
|
21005
|
-
return checkboxMargin;
|
|
21006
|
-
}, CheckboxIcon, function (_ref3) {
|
|
21007
|
-
var checked = _ref3.checked;
|
|
21003
|
+
})(["display:inline-block;width:24px;height:24px;border-radius:2px;transition:all 150ms;", "{visibility:", ";}", ";"], CheckboxIcon, function (_ref2) {
|
|
21004
|
+
var checked = _ref2.checked;
|
|
21008
21005
|
return checked ? "visible" : "hidden";
|
|
21009
|
-
}, function (
|
|
21010
|
-
var error =
|
|
21011
|
-
disabled =
|
|
21012
|
-
checked =
|
|
21013
|
-
focused =
|
|
21014
|
-
defaultStyles =
|
|
21015
|
-
checkedStyles =
|
|
21016
|
-
focusedStyles =
|
|
21017
|
-
errorStyles =
|
|
21018
|
-
disabledStyles =
|
|
21019
|
-
disabledCheckedStyles =
|
|
21006
|
+
}, function (_ref3) {
|
|
21007
|
+
var error = _ref3.error,
|
|
21008
|
+
disabled = _ref3.disabled,
|
|
21009
|
+
checked = _ref3.checked,
|
|
21010
|
+
focused = _ref3.focused,
|
|
21011
|
+
defaultStyles = _ref3.defaultStyles,
|
|
21012
|
+
checkedStyles = _ref3.checkedStyles,
|
|
21013
|
+
focusedStyles = _ref3.focusedStyles,
|
|
21014
|
+
errorStyles = _ref3.errorStyles,
|
|
21015
|
+
disabledStyles = _ref3.disabledStyles,
|
|
21016
|
+
disabledCheckedStyles = _ref3.disabledCheckedStyles;
|
|
21020
21017
|
return error ? css(["", " ", ""], errorStyles, focused && focusedStyles) : disabled ? css(["", ""], checked ? disabledCheckedStyles : disabledStyles) : checked ? css(["", " ", ""], checkedStyles, focused && focusedStyles) : css(["", " ", ""], defaultStyles, focused && focusedStyles);
|
|
21021
21018
|
});
|
|
21022
21019
|
|
|
21023
|
-
var Checkbox = function Checkbox(
|
|
21024
|
-
var title =
|
|
21025
|
-
name =
|
|
21026
|
-
checked =
|
|
21027
|
-
|
|
21028
|
-
onChange =
|
|
21029
|
-
|
|
21030
|
-
disabled =
|
|
21031
|
-
themeValues =
|
|
21032
|
-
|
|
21033
|
-
hidden =
|
|
21034
|
-
|
|
21035
|
-
error =
|
|
21036
|
-
|
|
21037
|
-
checkboxMargin =
|
|
21038
|
-
extraStyles =
|
|
21039
|
-
textExtraStyles =
|
|
21020
|
+
var Checkbox = function Checkbox(_ref4) {
|
|
21021
|
+
var title = _ref4.title,
|
|
21022
|
+
name = _ref4.name,
|
|
21023
|
+
checked = _ref4.checked,
|
|
21024
|
+
_ref4$onChange = _ref4.onChange,
|
|
21025
|
+
onChange = _ref4$onChange === void 0 ? noop : _ref4$onChange,
|
|
21026
|
+
_ref4$disabled = _ref4.disabled,
|
|
21027
|
+
disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,
|
|
21028
|
+
themeValues = _ref4.themeValues,
|
|
21029
|
+
_ref4$hidden = _ref4.hidden,
|
|
21030
|
+
hidden = _ref4$hidden === void 0 ? false : _ref4$hidden,
|
|
21031
|
+
_ref4$error = _ref4.error,
|
|
21032
|
+
error = _ref4$error === void 0 ? false : _ref4$error,
|
|
21033
|
+
_ref4$checkboxMargin = _ref4.checkboxMargin,
|
|
21034
|
+
checkboxMargin = _ref4$checkboxMargin === void 0 ? "0 16px 0 0" : _ref4$checkboxMargin,
|
|
21035
|
+
extraStyles = _ref4.extraStyles,
|
|
21036
|
+
textExtraStyles = _ref4.textExtraStyles;
|
|
21040
21037
|
|
|
21041
21038
|
var _useState = useState(false),
|
|
21042
21039
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -21063,7 +21060,7 @@ var Checkbox = function Checkbox(_ref5) {
|
|
|
21063
21060
|
},
|
|
21064
21061
|
hiddenStyles: hidden,
|
|
21065
21062
|
background: themeValues.backgroundColor,
|
|
21066
|
-
extraStyles: "outline: none; ".concat(extraStyles)
|
|
21063
|
+
extraStyles: "outline: none; ".concat(extraStyles, "; margin: ").concat(checkboxMargin, ";")
|
|
21067
21064
|
}, /*#__PURE__*/React.createElement(CheckboxLabelContainer, null, /*#__PURE__*/React.createElement(CheckboxContainer, {
|
|
21068
21065
|
"data-qa": "Checkbox"
|
|
21069
21066
|
}, /*#__PURE__*/React.createElement(HiddenCheckbox, {
|
|
@@ -21086,8 +21083,7 @@ var Checkbox = function Checkbox(_ref5) {
|
|
|
21086
21083
|
errorStyles: themeValues.errorStyles,
|
|
21087
21084
|
disabledStyles: themeValues.disabledStyles,
|
|
21088
21085
|
disabledCheckedStyles: themeValues.disabledCheckedStyles,
|
|
21089
|
-
focusedStyles: themeValues.focusedStyles
|
|
21090
|
-
checkboxMargin: checkboxMargin
|
|
21086
|
+
focusedStyles: themeValues.focusedStyles
|
|
21091
21087
|
}, /*#__PURE__*/React.createElement(CheckboxIcon, {
|
|
21092
21088
|
viewBox: "0 0 24 24",
|
|
21093
21089
|
disabled: disabled,
|
|
@@ -48645,7 +48641,11 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
|
48645
48641
|
_ref$modalVariant = _ref.modalVariant,
|
|
48646
48642
|
modalVariant = _ref$modalVariant === void 0 ? "default" : _ref$modalVariant,
|
|
48647
48643
|
_ref$containerBackgro = _ref.containerBackground,
|
|
48648
|
-
containerBackground = _ref$containerBackgro === void 0 ? ATHENS_GREY : _ref$containerBackgro
|
|
48644
|
+
containerBackground = _ref$containerBackgro === void 0 ? ATHENS_GREY : _ref$containerBackgro,
|
|
48645
|
+
_ref$checkboxMargin = _ref.checkboxMargin,
|
|
48646
|
+
checkboxMargin = _ref$checkboxMargin === void 0 ? "0 0.5rem 0 0" : _ref$checkboxMargin,
|
|
48647
|
+
_ref$modalTitle = _ref.modalTitle,
|
|
48648
|
+
modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle;
|
|
48649
48649
|
|
|
48650
48650
|
var _useState = useState(false),
|
|
48651
48651
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -48658,7 +48658,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
|
48658
48658
|
minWidth: displayInline ? "0" : "100%",
|
|
48659
48659
|
background: displayInline ? "transparent" : containerBackground,
|
|
48660
48660
|
boxShadow: displayInline ? "none" : standardBoxShadow,
|
|
48661
|
-
borderRadius: displayInline ? "0" : "4px"
|
|
48661
|
+
borderRadius: displayInline ? "0" : "4px",
|
|
48662
|
+
extraStyles: "margin: 4px 0 0 4px;"
|
|
48662
48663
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
48663
48664
|
childGap: "0.25rem"
|
|
48664
48665
|
}, html && /*#__PURE__*/React.createElement(Box, {
|
|
@@ -48671,21 +48672,25 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
|
48671
48672
|
name: id,
|
|
48672
48673
|
error: hasError,
|
|
48673
48674
|
checked: isChecked,
|
|
48674
|
-
onChange: onCheck
|
|
48675
|
+
onChange: onCheck,
|
|
48676
|
+
checkboxMargin: checkboxMargin
|
|
48675
48677
|
}), /*#__PURE__*/React.createElement(Stack, {
|
|
48676
|
-
childGap: "0.25rem"
|
|
48678
|
+
childGap: "0.25rem",
|
|
48679
|
+
fullHeight: true
|
|
48677
48680
|
}, /*#__PURE__*/React.createElement(Cluster, {
|
|
48678
48681
|
justify: "flex-start",
|
|
48679
|
-
align: "
|
|
48680
|
-
nowrap: true
|
|
48682
|
+
align: "center",
|
|
48683
|
+
nowrap: true,
|
|
48684
|
+
extraStyles: "padding-right: 2px; > div > * { margin: 4px 2px; };"
|
|
48681
48685
|
}, description && /*#__PURE__*/React.createElement(Text$1, {
|
|
48682
48686
|
color: CHARADE_GREY
|
|
48683
|
-
}, description
|
|
48687
|
+
}, description), terms && /*#__PURE__*/React.createElement(TermsAndConditionsModal$1, {
|
|
48684
48688
|
link: linkText,
|
|
48685
48689
|
terms: terms,
|
|
48686
48690
|
isOpen: showTerms,
|
|
48687
48691
|
toggleOpen: toggleShowTerms,
|
|
48688
|
-
linkVariant: modalVariant
|
|
48692
|
+
linkVariant: modalVariant,
|
|
48693
|
+
title: modalTitle
|
|
48689
48694
|
})), showCheckbox && hasError && /*#__PURE__*/React.createElement(Text$1, {
|
|
48690
48695
|
variant: "pXS",
|
|
48691
48696
|
color: ERROR_COLOR,
|