@thecb/components 8.4.10-beta.5 → 8.4.10
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 +54 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.js +54 -17
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -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/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,
|
|
@@ -27110,7 +27113,24 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
|
|
|
27110
27113
|
themeValues = _ref5.themeValues,
|
|
27111
27114
|
index = _ref5.index,
|
|
27112
27115
|
_ref5$handleChange = _ref5.handleChange,
|
|
27113
|
-
handleChange = _ref5$handleChange === void 0 ? noop : _ref5$handleChange
|
|
27116
|
+
handleChange = _ref5$handleChange === void 0 ? noop : _ref5$handleChange,
|
|
27117
|
+
field = _ref5.field,
|
|
27118
|
+
config = _ref5.config;
|
|
27119
|
+
|
|
27120
|
+
var getDefaultChecked = function getDefaultChecked(value, idx) {
|
|
27121
|
+
var selectionExistsInConfig = config.map(function (c) {
|
|
27122
|
+
return c.value;
|
|
27123
|
+
}).includes(field.rawValue);
|
|
27124
|
+
|
|
27125
|
+
if (selectionExistsInConfig) {
|
|
27126
|
+
// if exists, selection comes from the redux-freeform state
|
|
27127
|
+
return field.rawValue === value;
|
|
27128
|
+
} // fallback to first option as default selection
|
|
27129
|
+
|
|
27130
|
+
|
|
27131
|
+
return idx === 0;
|
|
27132
|
+
};
|
|
27133
|
+
|
|
27114
27134
|
return /*#__PURE__*/React__default.createElement(InputAndLabelContainer, {
|
|
27115
27135
|
align: "center",
|
|
27116
27136
|
childGap: "0.5rem",
|
|
@@ -27128,7 +27148,7 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
|
|
|
27128
27148
|
setValue(e.target.value);
|
|
27129
27149
|
handleChange(e);
|
|
27130
27150
|
},
|
|
27131
|
-
defaultChecked: index
|
|
27151
|
+
defaultChecked: getDefaultChecked(value, index)
|
|
27132
27152
|
}), /*#__PURE__*/React__default.createElement(Text$1, {
|
|
27133
27153
|
as: "label",
|
|
27134
27154
|
htmlFor: id,
|
|
@@ -27332,14 +27352,16 @@ var fallbackValues$x = {
|
|
|
27332
27352
|
};
|
|
27333
27353
|
|
|
27334
27354
|
var SolidDivider = function SolidDivider(_ref) {
|
|
27335
|
-
var
|
|
27355
|
+
var borderColor = _ref.borderColor,
|
|
27356
|
+
borderSize = _ref.borderSize,
|
|
27357
|
+
themeValues = _ref.themeValues;
|
|
27336
27358
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
27337
27359
|
padding: "0",
|
|
27338
27360
|
minWidth: "100%",
|
|
27339
27361
|
minHeight: "1px",
|
|
27340
|
-
borderColor: themeValues.borderColor,
|
|
27341
|
-
borderSize: themeValues.borderSize,
|
|
27342
|
-
borderWidthOverride: "0px 0px ".concat(themeValues.borderSize, " 0px")
|
|
27362
|
+
borderColor: borderColor || themeValues.borderColor,
|
|
27363
|
+
borderSize: borderSize || themeValues.borderSize,
|
|
27364
|
+
borderWidthOverride: "0px 0px ".concat(borderSize || themeValues.borderSize, " 0px")
|
|
27343
27365
|
});
|
|
27344
27366
|
};
|
|
27345
27367
|
|
|
@@ -46793,26 +46815,30 @@ var fallbackValues$J = {
|
|
|
46793
46815
|
*/
|
|
46794
46816
|
|
|
46795
46817
|
var Module = function Module(_ref) {
|
|
46796
|
-
var
|
|
46818
|
+
var _ref$variant = _ref.variant,
|
|
46819
|
+
variant = _ref$variant === void 0 ? "default" : _ref$variant,
|
|
46820
|
+
as = _ref.as,
|
|
46821
|
+
disabled = _ref.disabled,
|
|
46822
|
+
heading = _ref.heading,
|
|
46823
|
+
rightTitleContent = _ref.rightTitleContent,
|
|
46824
|
+
_ref$titleID = _ref.titleID,
|
|
46825
|
+
titleID = _ref$titleID === void 0 ? "" : _ref$titleID,
|
|
46797
46826
|
_ref$spacing = _ref.spacing,
|
|
46798
46827
|
spacing = _ref$spacing === void 0 ? "1rem" : _ref$spacing,
|
|
46799
46828
|
_ref$padding = _ref.padding,
|
|
46800
46829
|
padding = _ref$padding === void 0 ? "0" : _ref$padding,
|
|
46830
|
+
_ref$margin = _ref.margin,
|
|
46831
|
+
margin = _ref$margin === void 0 ? "0" : _ref$margin,
|
|
46801
46832
|
_ref$spacingBottom = _ref.spacingBottom,
|
|
46802
46833
|
spacingBottom = _ref$spacingBottom === void 0 ? "2.5rem" : _ref$spacingBottom,
|
|
46803
|
-
themeValues = _ref.themeValues,
|
|
46804
|
-
_ref$variant = _ref.variant,
|
|
46805
|
-
variant = _ref$variant === void 0 ? "default" : _ref$variant,
|
|
46806
46834
|
fontSize = _ref.fontSize,
|
|
46807
|
-
|
|
46808
|
-
_ref$titleID = _ref.titleID,
|
|
46809
|
-
titleID = _ref$titleID === void 0 ? "" : _ref$titleID,
|
|
46810
|
-
rightTitleContent = _ref.rightTitleContent,
|
|
46835
|
+
themeValues = _ref.themeValues,
|
|
46811
46836
|
children = _ref.children;
|
|
46812
46837
|
var themedFontSize = variant === "small" ? "1.25rem" : variant === "default" ? "1.375rem" : "2rem";
|
|
46813
46838
|
var computedFontSize = fontSize || themedFontSize;
|
|
46814
46839
|
var themedElemType = variant === "small" ? "h6" : variant === "default" ? "h5" : "h2";
|
|
46815
46840
|
var computedElemType = as || themedElemType;
|
|
46841
|
+
var disabledStyles = "opacity: 0.40;";
|
|
46816
46842
|
var headingText = /*#__PURE__*/React__default.createElement(Title$1, {
|
|
46817
46843
|
weight: themeValues.fontWeight,
|
|
46818
46844
|
color: themeValues.fontColor,
|
|
@@ -46822,12 +46848,18 @@ var Module = function Module(_ref) {
|
|
|
46822
46848
|
extraStyles: "font-size: ".concat(computedFontSize, ";"),
|
|
46823
46849
|
id: titleID
|
|
46824
46850
|
}, heading);
|
|
46825
|
-
return /*#__PURE__*/React__default.createElement(
|
|
46851
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
46852
|
+
"aria-disabled": disabled,
|
|
46853
|
+
extraStyles: disabled && disabledStyles,
|
|
46854
|
+
padding: "0",
|
|
46855
|
+
role: "group"
|
|
46856
|
+
}, heading && !rightTitleContent && headingText, heading && rightTitleContent && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
46826
46857
|
justify: "space-between",
|
|
46827
46858
|
align: "center",
|
|
46828
46859
|
nowrap: true
|
|
46829
46860
|
}, headingText, rightTitleContent), /*#__PURE__*/React__default.createElement(Box, {
|
|
46830
|
-
padding: "0 0 ".concat(spacingBottom)
|
|
46861
|
+
padding: "0 0 ".concat(spacingBottom),
|
|
46862
|
+
extraStyles: "margin: ".concat(margin)
|
|
46831
46863
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
46832
46864
|
padding: padding,
|
|
46833
46865
|
background: themeValues.backgroundColor,
|
|
@@ -49384,6 +49416,8 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
49384
49416
|
groupName: groupName,
|
|
49385
49417
|
setValue: setValue,
|
|
49386
49418
|
handleChange: handleChange,
|
|
49419
|
+
field: field,
|
|
49420
|
+
config: config,
|
|
49387
49421
|
"aria-invalid": field.dirty && field.hasErrors
|
|
49388
49422
|
}));
|
|
49389
49423
|
})));
|
|
@@ -49440,6 +49474,8 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
49440
49474
|
initiallyOpen = _ref$initiallyOpen === void 0 ? true : _ref$initiallyOpen,
|
|
49441
49475
|
_ref$openHeight = _ref.openHeight,
|
|
49442
49476
|
openHeight = _ref$openHeight === void 0 ? "auto" : _ref$openHeight,
|
|
49477
|
+
_ref$containerStyles = _ref.containerStyles,
|
|
49478
|
+
containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
|
|
49443
49479
|
ariaDescribedBy = _ref.ariaDescribedBy;
|
|
49444
49480
|
|
|
49445
49481
|
var handleKeyDown = function handleKeyDown(id, e) {
|
|
@@ -49492,7 +49528,8 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
49492
49528
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
49493
49529
|
padding: "1px",
|
|
49494
49530
|
border: "1px solid ".concat(themeValues.borderColor),
|
|
49495
|
-
borderRadius: "4px"
|
|
49531
|
+
borderRadius: "4px",
|
|
49532
|
+
extraStyles: containerStyles
|
|
49496
49533
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
49497
49534
|
childGap: "0"
|
|
49498
49535
|
}, sections.filter(function (section) {
|