@thecb/components 10.11.1 → 10.11.2-beta.1
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 +36 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.esm.js +36 -22
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/form-layouts/FormInput.js +6 -4
- package/src/components/atoms/form-layouts/FormInput.stories.js +33 -0
- package/src/components/atoms/form-layouts/index.d.ts +5 -0
- package/src/components/atoms/form-select/FormSelect.js +5 -3
- package/src/components/atoms/form-select/index.d.ts +3 -0
- package/src/components/molecules/radio-group/RadioGroup.js +8 -3
- package/src/components/molecules/radio-group/RadioGroup.stories.js +1 -0
- package/src/components/molecules/radio-group/index.d.ts +1 -0
- package/src/components/atoms/.DS_Store +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -639,6 +639,11 @@ interface FormInputProps {
|
|
|
639
639
|
autocompleteValue?: string;
|
|
640
640
|
removeFromValue?: RegExp;
|
|
641
641
|
dataQa?: string | null;
|
|
642
|
+
isRequired?: boolean;
|
|
643
|
+
errorFieldExtraStyles?: string;
|
|
644
|
+
showFieldErrorRow?: boolean;
|
|
645
|
+
labelTextVariant?: string;
|
|
646
|
+
errorTextVariant?: string;
|
|
642
647
|
}
|
|
643
648
|
|
|
644
649
|
declare const FormInput: React.FC<Expand<FormInputProps> &
|
|
@@ -661,6 +666,9 @@ interface FormSelectProps {
|
|
|
661
666
|
smoothScroll?: boolean;
|
|
662
667
|
dataQa?: string | null;
|
|
663
668
|
widthFitOptions?: boolean;
|
|
669
|
+
isRequired?: boolean;
|
|
670
|
+
labelTextVariant?: string;
|
|
671
|
+
errorLabelTextVariant?: string;
|
|
664
672
|
}
|
|
665
673
|
|
|
666
674
|
declare const FormSelect: React.FC<Expand<FormSelectProps> &
|
|
@@ -1288,6 +1296,7 @@ interface RadioGroupProps {
|
|
|
1288
1296
|
handleChange?: () => void;
|
|
1289
1297
|
heading?: ReactNode;
|
|
1290
1298
|
headingText: string;
|
|
1299
|
+
headingFontSize?: string;
|
|
1291
1300
|
}
|
|
1292
1301
|
|
|
1293
1302
|
declare const RadioGroup: React.FC<Expand<RadioGroupProps> &
|
package/dist/index.esm.js
CHANGED
|
@@ -25542,7 +25542,11 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
25542
25542
|
_ref$widthFitOptions = _ref.widthFitOptions,
|
|
25543
25543
|
widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions,
|
|
25544
25544
|
_ref$isRequired = _ref.isRequired,
|
|
25545
|
-
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired
|
|
25545
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
|
|
25546
|
+
_ref$labelTextVariant = _ref.labelTextVariant,
|
|
25547
|
+
labelTextVariant = _ref$labelTextVariant === void 0 ? "pS" : _ref$labelTextVariant,
|
|
25548
|
+
_ref$errorLabelTextVa = _ref.errorLabelTextVariant,
|
|
25549
|
+
errorLabelTextVariant = _ref$errorLabelTextVa === void 0 ? "pXS" : _ref$errorLabelTextVa;
|
|
25546
25550
|
var _useState = useState(false),
|
|
25547
25551
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25548
25552
|
open = _useState2[0],
|
|
@@ -25572,7 +25576,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
25572
25576
|
align: "center"
|
|
25573
25577
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
25574
25578
|
as: "label",
|
|
25575
|
-
variant:
|
|
25579
|
+
variant: labelTextVariant,
|
|
25576
25580
|
color: themeValues.labelColor,
|
|
25577
25581
|
weight: themeValues.fontWeight,
|
|
25578
25582
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
@@ -25607,7 +25611,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
25607
25611
|
justify: "space-between"
|
|
25608
25612
|
}, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React.createElement(Text$1, {
|
|
25609
25613
|
color: ERROR_COLOR,
|
|
25610
|
-
variant:
|
|
25614
|
+
variant: errorLabelTextVariant,
|
|
25611
25615
|
weight: themeValues.fontWeight,
|
|
25612
25616
|
extraStyles: "\n word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }\n ",
|
|
25613
25617
|
id: createIdFromString(labelTextWhenNoError, "error message"),
|
|
@@ -27229,7 +27233,7 @@ var fallbackValues$n = {
|
|
|
27229
27233
|
};
|
|
27230
27234
|
|
|
27231
27235
|
var _excluded$v = ["showErrors", "themeValues"],
|
|
27232
|
-
_excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired", "errorFieldExtraStyles", "showFieldErrorRow"];
|
|
27236
|
+
_excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired", "errorFieldExtraStyles", "showFieldErrorRow", "labelTextVariant", "errorTextVariant"];
|
|
27233
27237
|
var InputField = styled.input.withConfig({
|
|
27234
27238
|
displayName: "FormInput__InputField",
|
|
27235
27239
|
componentId: "sc-l094r1-0"
|
|
@@ -27320,6 +27324,10 @@ var FormInput = function FormInput(_ref15) {
|
|
|
27320
27324
|
errorFieldExtraStyles = _ref15.errorFieldExtraStyles,
|
|
27321
27325
|
_ref15$showFieldError = _ref15.showFieldErrorRow,
|
|
27322
27326
|
showFieldErrorRow = _ref15$showFieldError === void 0 ? true : _ref15$showFieldError,
|
|
27327
|
+
_ref15$labelTextVaria = _ref15.labelTextVariant,
|
|
27328
|
+
labelTextVariant = _ref15$labelTextVaria === void 0 ? "pS" : _ref15$labelTextVaria,
|
|
27329
|
+
_ref15$errorTextVaria = _ref15.errorTextVariant,
|
|
27330
|
+
errorTextVariant = _ref15$errorTextVaria === void 0 ? "pXS" : _ref15$errorTextVaria,
|
|
27323
27331
|
props = _objectWithoutProperties(_ref15, _excluded2);
|
|
27324
27332
|
var _useState = useState(false),
|
|
27325
27333
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -27354,7 +27362,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
27354
27362
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
27355
27363
|
as: "label",
|
|
27356
27364
|
color: themeValues.labelColor,
|
|
27357
|
-
variant:
|
|
27365
|
+
variant: labelTextVariant,
|
|
27358
27366
|
weight: themeValues.fontWeight,
|
|
27359
27367
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
27360
27368
|
id: createIdFromString(labelTextWhenNoError)
|
|
@@ -27367,12 +27375,12 @@ var FormInput = function FormInput(_ref15) {
|
|
|
27367
27375
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
27368
27376
|
as: "label",
|
|
27369
27377
|
color: themeValues.labelColor,
|
|
27370
|
-
variant:
|
|
27378
|
+
variant: labelTextVariant,
|
|
27371
27379
|
fontWeight: themeValues.fontWeight,
|
|
27372
27380
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
27373
27381
|
id: createIdFromString(labelTextWhenNoError)
|
|
27374
27382
|
}, labelTextWhenNoError), type === "password" && /*#__PURE__*/React.createElement(Text$1, {
|
|
27375
|
-
variant:
|
|
27383
|
+
variant: labelTextVariant,
|
|
27376
27384
|
color: themeValues.linkColor,
|
|
27377
27385
|
weight: themeValues.fontWeight,
|
|
27378
27386
|
hoverStyles: themeValues.hoverFocusStyles,
|
|
@@ -27452,7 +27460,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
27452
27460
|
"aria-atomic": true
|
|
27453
27461
|
}, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React.createElement(Text$1, {
|
|
27454
27462
|
color: ERROR_COLOR,
|
|
27455
|
-
variant:
|
|
27463
|
+
variant: errorTextVariant,
|
|
27456
27464
|
weight: themeValues.fontWeight,
|
|
27457
27465
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }\n ".concat(errorFieldExtraStyles, ";"),
|
|
27458
27466
|
id: createIdFromString(labelTextWhenNoError, "error message")
|
|
@@ -49194,27 +49202,33 @@ PhoneForm.mapDispatchToProps = mapDispatchToProps$8;
|
|
|
49194
49202
|
var DefaultHeading = styled.div.withConfig({
|
|
49195
49203
|
displayName: "RadioGroup__DefaultHeading",
|
|
49196
49204
|
componentId: "sc-7lqrl8-0"
|
|
49197
|
-
})(["
|
|
49205
|
+
})(["", " color:", ";margin:0;padding:8px 0px;"], function (_ref) {
|
|
49206
|
+
var fontSize = _ref.fontSize;
|
|
49207
|
+
return "font-size: ".concat(fontSize, ";");
|
|
49208
|
+
}, CHARADE_GREY);
|
|
49198
49209
|
var StyledFieldset = styled.fieldset.withConfig({
|
|
49199
49210
|
displayName: "RadioGroup__StyledFieldset",
|
|
49200
49211
|
componentId: "sc-7lqrl8-1"
|
|
49201
49212
|
})(["", ""], function (props) {
|
|
49202
49213
|
return props.$extraStyles;
|
|
49203
49214
|
});
|
|
49204
|
-
var RadioGroup = function RadioGroup(
|
|
49205
|
-
var headingText =
|
|
49206
|
-
groupName =
|
|
49207
|
-
|
|
49208
|
-
|
|
49215
|
+
var RadioGroup = function RadioGroup(_ref2) {
|
|
49216
|
+
var headingText = _ref2.headingText,
|
|
49217
|
+
groupName = _ref2.groupName,
|
|
49218
|
+
_ref2$headingFontSize = _ref2.headingFontSize,
|
|
49219
|
+
headingFontSize = _ref2$headingFontSize === void 0 ? "0.875rem" : _ref2$headingFontSize,
|
|
49220
|
+
_ref2$heading = _ref2.heading,
|
|
49221
|
+
Heading = _ref2$heading === void 0 ? /*#__PURE__*/React.createElement(DefaultHeading, {
|
|
49209
49222
|
role: "heading",
|
|
49210
|
-
id: "radio-group-".concat(groupName, "-heading")
|
|
49211
|
-
|
|
49212
|
-
|
|
49213
|
-
|
|
49214
|
-
|
|
49215
|
-
handleChange =
|
|
49216
|
-
|
|
49217
|
-
|
|
49223
|
+
id: "radio-group-".concat(groupName, "-heading"),
|
|
49224
|
+
fontSize: headingFontSize
|
|
49225
|
+
}, headingText) : _ref2$heading,
|
|
49226
|
+
config = _ref2.config,
|
|
49227
|
+
extraStyles = _ref2.extraStyles,
|
|
49228
|
+
_ref2$handleChange = _ref2.handleChange,
|
|
49229
|
+
handleChange = _ref2$handleChange === void 0 ? noop : _ref2$handleChange,
|
|
49230
|
+
field = _ref2.field,
|
|
49231
|
+
fieldActions = _ref2.fieldActions;
|
|
49218
49232
|
var setValue = function setValue(value) {
|
|
49219
49233
|
return fieldActions.set(value);
|
|
49220
49234
|
};
|