@thecb/components 8.4.9-beta.0 → 8.4.9
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 +55 -19
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.js +55 -19
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/form-select/FormSelect.js +0 -1
- package/src/components/atoms/radio-button-with-label/RadioButtonWithLabel.js +49 -33
- package/src/components/atoms/solid-divider/SolidDivider.js +4 -4
- package/src/components/molecules/module/Module.js +16 -8
- package/src/components/molecules/radio-group/RadioGroup.js +2 -0
- package/src/components/molecules/radio-group/RadioGroup.stories.js +1 -1
- package/src/components/molecules/radio-section/RadioSection.js +2 -0
- package/src/constants/colors.js +2 -0
- package/src/types/common/Field.ts +3 -3
- package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +0 -49322
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -4997,6 +4997,8 @@ var BLACK_SQUEEZE = "#EAF2F7";
|
|
|
4997
4997
|
var GREY_CHATEAU = "#959CA8"; // CBS-500
|
|
4998
4998
|
|
|
4999
4999
|
var COOL_GREY_05 = "#fbfcfd"; // CBS-050
|
|
5000
|
+
|
|
5001
|
+
var MANATEE_GREY = "#878E9B"; // CB-60 (cool)
|
|
5000
5002
|
// BLUE
|
|
5001
5003
|
|
|
5002
5004
|
var CLOUDBURST_BLUE = "#26395c";
|
|
@@ -5131,6 +5133,7 @@ var colors = /*#__PURE__*/Object.freeze({
|
|
|
5131
5133
|
CHARADE_GREY: CHARADE_GREY,
|
|
5132
5134
|
GRECIAN_GREY: GRECIAN_GREY,
|
|
5133
5135
|
COOL_GREY_05: COOL_GREY_05,
|
|
5136
|
+
MANATEE_GREY: MANATEE_GREY,
|
|
5134
5137
|
BLACK_SQUEEZE: BLACK_SQUEEZE,
|
|
5135
5138
|
GREY_CHATEAU: GREY_CHATEAU,
|
|
5136
5139
|
CLOUDBURST_BLUE: CLOUDBURST_BLUE,
|
|
@@ -24235,8 +24238,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24235
24238
|
variant: "pXS",
|
|
24236
24239
|
weight: themeValues.fontWeight,
|
|
24237
24240
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
24238
|
-
id: createIdFromString(labelTextWhenNoError, "error message")
|
|
24239
|
-
"aria-live": "polite"
|
|
24241
|
+
id: createIdFromString(labelTextWhenNoError, "error message")
|
|
24240
24242
|
}, errorMessages[field.errors[0]]) : /*#__PURE__*/React__default.createElement(Text$1, {
|
|
24241
24243
|
extraStyles: "height: ".concat(themeValues.lineHeight, ";")
|
|
24242
24244
|
})));
|
|
@@ -27109,7 +27111,24 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
|
|
|
27109
27111
|
themeValues = _ref5.themeValues,
|
|
27110
27112
|
index = _ref5.index,
|
|
27111
27113
|
_ref5$handleChange = _ref5.handleChange,
|
|
27112
|
-
handleChange = _ref5$handleChange === void 0 ? noop : _ref5$handleChange
|
|
27114
|
+
handleChange = _ref5$handleChange === void 0 ? noop : _ref5$handleChange,
|
|
27115
|
+
field = _ref5.field,
|
|
27116
|
+
config = _ref5.config;
|
|
27117
|
+
|
|
27118
|
+
var getDefaultChecked = function getDefaultChecked(value, idx) {
|
|
27119
|
+
var selectionExistsInConfig = config.map(function (c) {
|
|
27120
|
+
return c.value;
|
|
27121
|
+
}).includes(field.rawValue);
|
|
27122
|
+
|
|
27123
|
+
if (selectionExistsInConfig) {
|
|
27124
|
+
// if exists, selection comes from the redux-freeform state
|
|
27125
|
+
return field.rawValue === value;
|
|
27126
|
+
} // fallback to first option as default selection
|
|
27127
|
+
|
|
27128
|
+
|
|
27129
|
+
return idx === 0;
|
|
27130
|
+
};
|
|
27131
|
+
|
|
27113
27132
|
return /*#__PURE__*/React__default.createElement(InputAndLabelContainer, {
|
|
27114
27133
|
align: "center",
|
|
27115
27134
|
childGap: "0.5rem",
|
|
@@ -27127,7 +27146,7 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
|
|
|
27127
27146
|
setValue(e.target.value);
|
|
27128
27147
|
handleChange(e);
|
|
27129
27148
|
},
|
|
27130
|
-
defaultChecked: index
|
|
27149
|
+
defaultChecked: getDefaultChecked(value, index)
|
|
27131
27150
|
}), /*#__PURE__*/React__default.createElement(Text$1, {
|
|
27132
27151
|
as: "label",
|
|
27133
27152
|
htmlFor: id,
|
|
@@ -27331,14 +27350,16 @@ var fallbackValues$x = {
|
|
|
27331
27350
|
};
|
|
27332
27351
|
|
|
27333
27352
|
var SolidDivider = function SolidDivider(_ref) {
|
|
27334
|
-
var
|
|
27353
|
+
var borderColor = _ref.borderColor,
|
|
27354
|
+
borderSize = _ref.borderSize,
|
|
27355
|
+
themeValues = _ref.themeValues;
|
|
27335
27356
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
27336
27357
|
padding: "0",
|
|
27337
27358
|
minWidth: "100%",
|
|
27338
27359
|
minHeight: "1px",
|
|
27339
|
-
borderColor: themeValues.borderColor,
|
|
27340
|
-
borderSize: themeValues.borderSize,
|
|
27341
|
-
borderWidthOverride: "0px 0px ".concat(themeValues.borderSize, " 0px")
|
|
27360
|
+
borderColor: borderColor || themeValues.borderColor,
|
|
27361
|
+
borderSize: borderSize || themeValues.borderSize,
|
|
27362
|
+
borderWidthOverride: "0px 0px ".concat(borderSize || themeValues.borderSize, " 0px")
|
|
27342
27363
|
});
|
|
27343
27364
|
};
|
|
27344
27365
|
|
|
@@ -46792,26 +46813,30 @@ var fallbackValues$J = {
|
|
|
46792
46813
|
*/
|
|
46793
46814
|
|
|
46794
46815
|
var Module = function Module(_ref) {
|
|
46795
|
-
var
|
|
46816
|
+
var _ref$variant = _ref.variant,
|
|
46817
|
+
variant = _ref$variant === void 0 ? "default" : _ref$variant,
|
|
46818
|
+
as = _ref.as,
|
|
46819
|
+
disabled = _ref.disabled,
|
|
46820
|
+
heading = _ref.heading,
|
|
46821
|
+
rightTitleContent = _ref.rightTitleContent,
|
|
46822
|
+
_ref$titleID = _ref.titleID,
|
|
46823
|
+
titleID = _ref$titleID === void 0 ? "" : _ref$titleID,
|
|
46796
46824
|
_ref$spacing = _ref.spacing,
|
|
46797
46825
|
spacing = _ref$spacing === void 0 ? "1rem" : _ref$spacing,
|
|
46798
46826
|
_ref$padding = _ref.padding,
|
|
46799
46827
|
padding = _ref$padding === void 0 ? "0" : _ref$padding,
|
|
46828
|
+
_ref$margin = _ref.margin,
|
|
46829
|
+
margin = _ref$margin === void 0 ? "0" : _ref$margin,
|
|
46800
46830
|
_ref$spacingBottom = _ref.spacingBottom,
|
|
46801
46831
|
spacingBottom = _ref$spacingBottom === void 0 ? "2.5rem" : _ref$spacingBottom,
|
|
46802
|
-
themeValues = _ref.themeValues,
|
|
46803
|
-
_ref$variant = _ref.variant,
|
|
46804
|
-
variant = _ref$variant === void 0 ? "default" : _ref$variant,
|
|
46805
46832
|
fontSize = _ref.fontSize,
|
|
46806
|
-
|
|
46807
|
-
_ref$titleID = _ref.titleID,
|
|
46808
|
-
titleID = _ref$titleID === void 0 ? "" : _ref$titleID,
|
|
46809
|
-
rightTitleContent = _ref.rightTitleContent,
|
|
46833
|
+
themeValues = _ref.themeValues,
|
|
46810
46834
|
children = _ref.children;
|
|
46811
46835
|
var themedFontSize = variant === "small" ? "1.25rem" : variant === "default" ? "1.375rem" : "2rem";
|
|
46812
46836
|
var computedFontSize = fontSize || themedFontSize;
|
|
46813
46837
|
var themedElemType = variant === "small" ? "h6" : variant === "default" ? "h5" : "h2";
|
|
46814
46838
|
var computedElemType = as || themedElemType;
|
|
46839
|
+
var disabledStyles = "opacity: 0.40;";
|
|
46815
46840
|
var headingText = /*#__PURE__*/React__default.createElement(Title$1, {
|
|
46816
46841
|
weight: themeValues.fontWeight,
|
|
46817
46842
|
color: themeValues.fontColor,
|
|
@@ -46821,12 +46846,18 @@ var Module = function Module(_ref) {
|
|
|
46821
46846
|
extraStyles: "font-size: ".concat(computedFontSize, ";"),
|
|
46822
46847
|
id: titleID
|
|
46823
46848
|
}, heading);
|
|
46824
|
-
return /*#__PURE__*/React__default.createElement(
|
|
46849
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
46850
|
+
"aria-disabled": disabled,
|
|
46851
|
+
extraStyles: disabled && disabledStyles,
|
|
46852
|
+
padding: "0",
|
|
46853
|
+
role: "group"
|
|
46854
|
+
}, heading && !rightTitleContent && headingText, heading && rightTitleContent && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
46825
46855
|
justify: "space-between",
|
|
46826
46856
|
align: "center",
|
|
46827
46857
|
nowrap: true
|
|
46828
46858
|
}, headingText, rightTitleContent), /*#__PURE__*/React__default.createElement(Box, {
|
|
46829
|
-
padding: "0 0 ".concat(spacingBottom)
|
|
46859
|
+
padding: "0 0 ".concat(spacingBottom),
|
|
46860
|
+
extraStyles: "margin: ".concat(margin)
|
|
46830
46861
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
46831
46862
|
padding: padding,
|
|
46832
46863
|
background: themeValues.backgroundColor,
|
|
@@ -49383,6 +49414,8 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
49383
49414
|
groupName: groupName,
|
|
49384
49415
|
setValue: setValue,
|
|
49385
49416
|
handleChange: handleChange,
|
|
49417
|
+
field: field,
|
|
49418
|
+
config: config,
|
|
49386
49419
|
"aria-invalid": field.dirty && field.hasErrors
|
|
49387
49420
|
}));
|
|
49388
49421
|
})));
|
|
@@ -49439,6 +49472,8 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
49439
49472
|
initiallyOpen = _ref$initiallyOpen === void 0 ? true : _ref$initiallyOpen,
|
|
49440
49473
|
_ref$openHeight = _ref.openHeight,
|
|
49441
49474
|
openHeight = _ref$openHeight === void 0 ? "auto" : _ref$openHeight,
|
|
49475
|
+
_ref$containerStyles = _ref.containerStyles,
|
|
49476
|
+
containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
|
|
49442
49477
|
ariaDescribedBy = _ref.ariaDescribedBy;
|
|
49443
49478
|
|
|
49444
49479
|
var handleKeyDown = function handleKeyDown(id, e) {
|
|
@@ -49491,7 +49526,8 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
49491
49526
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
49492
49527
|
padding: "1px",
|
|
49493
49528
|
border: "1px solid ".concat(themeValues.borderColor),
|
|
49494
|
-
borderRadius: "4px"
|
|
49529
|
+
borderRadius: "4px",
|
|
49530
|
+
extraStyles: containerStyles
|
|
49495
49531
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
49496
49532
|
childGap: "0"
|
|
49497
49533
|
}, sections.filter(function (section) {
|