@thecb/components 10.11.2-beta.2 → 10.12.0-beta.0
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 +58 -40
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +6 -9
- package/dist/index.esm.js +58 -40
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/card/Card.js +9 -0
- package/src/components/atoms/card/CardText.js +34 -11
- package/src/components/atoms/card/index.d.ts +6 -0
- package/src/components/atoms/form-layouts/FormInput.js +4 -6
- package/src/components/atoms/form-layouts/index.d.ts +0 -5
- package/src/components/atoms/form-select/FormSelect.js +3 -5
- package/src/components/atoms/form-select/index.d.ts +0 -3
- package/src/components/molecules/radio-group/RadioGroup.js +3 -8
- package/src/components/molecules/radio-group/index.d.ts +0 -1
- package/src/components/atoms/form-layouts/FormInput.stories.js +0 -33
package/dist/index.d.ts
CHANGED
|
@@ -577,7 +577,9 @@ declare const ButtonWithLink: React.FC<Expand<ButtonWithLinkProps> &
|
|
|
577
577
|
|
|
578
578
|
interface CardProps {
|
|
579
579
|
text?: string;
|
|
580
|
+
textAs?: string;
|
|
580
581
|
titleText?: string;
|
|
582
|
+
titleAs?: string;
|
|
581
583
|
titleVariant?: string;
|
|
582
584
|
extraStyles?: string;
|
|
583
585
|
imgSrc?: string;
|
|
@@ -601,6 +603,10 @@ interface CardProps {
|
|
|
601
603
|
borderRadius?: string;
|
|
602
604
|
width?: string;
|
|
603
605
|
padding?: string;
|
|
606
|
+
showQuitLink?: boolean;
|
|
607
|
+
onQuitClick?: (
|
|
608
|
+
event: React.MouseEvent<HTMLElement> | React.TouchEvent<HTMLElement>
|
|
609
|
+
) => void;
|
|
604
610
|
}
|
|
605
611
|
|
|
606
612
|
declare const Card: React.FC<Expand<CardProps> &
|
|
@@ -639,11 +645,6 @@ interface FormInputProps {
|
|
|
639
645
|
autocompleteValue?: string;
|
|
640
646
|
removeFromValue?: RegExp;
|
|
641
647
|
dataQa?: string | null;
|
|
642
|
-
isRequired?: boolean;
|
|
643
|
-
errorFieldExtraStyles?: string;
|
|
644
|
-
showFieldErrorRow?: boolean;
|
|
645
|
-
labelTextVariant?: string;
|
|
646
|
-
errorTextVariant?: string;
|
|
647
648
|
}
|
|
648
649
|
|
|
649
650
|
declare const FormInput: React.FC<Expand<FormInputProps> &
|
|
@@ -666,9 +667,6 @@ interface FormSelectProps {
|
|
|
666
667
|
smoothScroll?: boolean;
|
|
667
668
|
dataQa?: string | null;
|
|
668
669
|
widthFitOptions?: boolean;
|
|
669
|
-
isRequired?: boolean;
|
|
670
|
-
labelTextVariant?: string;
|
|
671
|
-
errorLabelTextVariant?: string;
|
|
672
670
|
}
|
|
673
671
|
|
|
674
672
|
declare const FormSelect: React.FC<Expand<FormSelectProps> &
|
|
@@ -1296,7 +1294,6 @@ interface RadioGroupProps {
|
|
|
1296
1294
|
handleChange?: () => void;
|
|
1297
1295
|
heading?: ReactNode;
|
|
1298
1296
|
headingText: string;
|
|
1299
|
-
headingFontSize?: string;
|
|
1300
1297
|
}
|
|
1301
1298
|
|
|
1302
1299
|
declare const RadioGroup: React.FC<Expand<RadioGroupProps> &
|
package/dist/index.esm.js
CHANGED
|
@@ -25542,11 +25542,7 @@ 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
|
|
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;
|
|
25545
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
|
|
25550
25546
|
var _useState = useState(false),
|
|
25551
25547
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25552
25548
|
open = _useState2[0],
|
|
@@ -25576,7 +25572,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
25576
25572
|
align: "center"
|
|
25577
25573
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
25578
25574
|
as: "label",
|
|
25579
|
-
variant:
|
|
25575
|
+
variant: "pS",
|
|
25580
25576
|
color: themeValues.labelColor,
|
|
25581
25577
|
weight: themeValues.fontWeight,
|
|
25582
25578
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
@@ -25611,7 +25607,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
25611
25607
|
justify: "space-between"
|
|
25612
25608
|
}, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React.createElement(Text$1, {
|
|
25613
25609
|
color: ERROR_COLOR,
|
|
25614
|
-
variant:
|
|
25610
|
+
variant: "pXS",
|
|
25615
25611
|
weight: themeValues.fontWeight,
|
|
25616
25612
|
extraStyles: "\n word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }\n ",
|
|
25617
25613
|
id: createIdFromString(labelTextWhenNoError, "error message"),
|
|
@@ -27233,7 +27229,7 @@ var fallbackValues$n = {
|
|
|
27233
27229
|
};
|
|
27234
27230
|
|
|
27235
27231
|
var _excluded$v = ["showErrors", "themeValues"],
|
|
27236
|
-
_excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired", "errorFieldExtraStyles", "showFieldErrorRow"
|
|
27232
|
+
_excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired", "errorFieldExtraStyles", "showFieldErrorRow"];
|
|
27237
27233
|
var InputField = styled.input.withConfig({
|
|
27238
27234
|
displayName: "FormInput__InputField",
|
|
27239
27235
|
componentId: "sc-l094r1-0"
|
|
@@ -27324,10 +27320,6 @@ var FormInput = function FormInput(_ref15) {
|
|
|
27324
27320
|
errorFieldExtraStyles = _ref15.errorFieldExtraStyles,
|
|
27325
27321
|
_ref15$showFieldError = _ref15.showFieldErrorRow,
|
|
27326
27322
|
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,
|
|
27331
27323
|
props = _objectWithoutProperties(_ref15, _excluded2);
|
|
27332
27324
|
var _useState = useState(false),
|
|
27333
27325
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -27362,7 +27354,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
27362
27354
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
27363
27355
|
as: "label",
|
|
27364
27356
|
color: themeValues.labelColor,
|
|
27365
|
-
variant:
|
|
27357
|
+
variant: "pS",
|
|
27366
27358
|
weight: themeValues.fontWeight,
|
|
27367
27359
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
27368
27360
|
id: createIdFromString(labelTextWhenNoError)
|
|
@@ -27375,12 +27367,12 @@ var FormInput = function FormInput(_ref15) {
|
|
|
27375
27367
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
27376
27368
|
as: "label",
|
|
27377
27369
|
color: themeValues.labelColor,
|
|
27378
|
-
variant:
|
|
27370
|
+
variant: "pS",
|
|
27379
27371
|
fontWeight: themeValues.fontWeight,
|
|
27380
27372
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
27381
27373
|
id: createIdFromString(labelTextWhenNoError)
|
|
27382
27374
|
}, labelTextWhenNoError), type === "password" && /*#__PURE__*/React.createElement(Text$1, {
|
|
27383
|
-
variant:
|
|
27375
|
+
variant: "pS",
|
|
27384
27376
|
color: themeValues.linkColor,
|
|
27385
27377
|
weight: themeValues.fontWeight,
|
|
27386
27378
|
hoverStyles: themeValues.hoverFocusStyles,
|
|
@@ -27460,7 +27452,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
27460
27452
|
"aria-atomic": true
|
|
27461
27453
|
}, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React.createElement(Text$1, {
|
|
27462
27454
|
color: ERROR_COLOR,
|
|
27463
|
-
variant:
|
|
27455
|
+
variant: "pXS",
|
|
27464
27456
|
weight: themeValues.fontWeight,
|
|
27465
27457
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }\n ".concat(errorFieldExtraStyles, ";"),
|
|
27466
27458
|
id: createIdFromString(labelTextWhenNoError, "error message")
|
|
@@ -39857,20 +39849,40 @@ var fallbackValues$E = {
|
|
|
39857
39849
|
};
|
|
39858
39850
|
|
|
39859
39851
|
var CardText = function CardText(_ref) {
|
|
39860
|
-
var
|
|
39852
|
+
var showQuitLink = _ref.showQuitLink,
|
|
39853
|
+
onQuitClick = _ref.onQuitClick,
|
|
39854
|
+
titleAs = _ref.titleAs,
|
|
39855
|
+
padding = _ref.padding,
|
|
39861
39856
|
text = _ref.text,
|
|
39857
|
+
_ref$textAs = _ref.textAs,
|
|
39858
|
+
textAs = _ref$textAs === void 0 ? "p" : _ref$textAs,
|
|
39862
39859
|
titleText = _ref.titleText,
|
|
39863
39860
|
_ref$titleVariant = _ref.titleVariant,
|
|
39864
39861
|
titleVariant = _ref$titleVariant === void 0 ? "small" : _ref$titleVariant,
|
|
39865
39862
|
themeValues = _ref.themeValues;
|
|
39866
39863
|
return /*#__PURE__*/React.createElement(Box, {
|
|
39867
39864
|
padding: padding
|
|
39868
|
-
}, /*#__PURE__*/React.createElement(Cover, null, /*#__PURE__*/React.createElement(Stack, null,
|
|
39869
|
-
|
|
39865
|
+
}, /*#__PURE__*/React.createElement(Cover, null, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Cluster, {
|
|
39866
|
+
justify: "space-between",
|
|
39867
|
+
align: "center",
|
|
39868
|
+
overflow: true
|
|
39869
|
+
}, titleText && /*#__PURE__*/React.createElement(Title$1, {
|
|
39870
|
+
as: titleAs,
|
|
39870
39871
|
variant: titleVariant,
|
|
39871
39872
|
color: themeValues.titleColor,
|
|
39872
39873
|
weight: themeValues.titleWeight
|
|
39873
|
-
}, titleText), /*#__PURE__*/React.createElement(
|
|
39874
|
+
}, titleText), showQuitLink && /*#__PURE__*/React.createElement(Box, {
|
|
39875
|
+
padding: "0",
|
|
39876
|
+
onClick: onQuitClick,
|
|
39877
|
+
onKeyDown: function onKeyDown(e) {
|
|
39878
|
+
return e.key === "Enter" && onQuitClick();
|
|
39879
|
+
},
|
|
39880
|
+
role: "button",
|
|
39881
|
+
tabIndex: 0,
|
|
39882
|
+
"aria-label": "Close Card: ".concat(titleText),
|
|
39883
|
+
extraStyles: "cursor: pointer;"
|
|
39884
|
+
}, /*#__PURE__*/React.createElement(IconQuitLarge, null))), /*#__PURE__*/React.createElement(Paragraph$1, {
|
|
39885
|
+
as: textAs,
|
|
39874
39886
|
color: themeValues.textColor
|
|
39875
39887
|
}, text))));
|
|
39876
39888
|
};
|
|
@@ -39911,9 +39923,17 @@ var Card = function Card(_ref) {
|
|
|
39911
39923
|
_ref$imgObjectFit = _ref.imgObjectFit,
|
|
39912
39924
|
imgObjectFit = _ref$imgObjectFit === void 0 ? "none" : _ref$imgObjectFit,
|
|
39913
39925
|
imgAltText = _ref.imgAltText,
|
|
39926
|
+
_ref$onQuitClick = _ref.onQuitClick,
|
|
39927
|
+
onQuitClick = _ref$onQuitClick === void 0 ? noop : _ref$onQuitClick,
|
|
39914
39928
|
_ref$padding = _ref.padding,
|
|
39915
39929
|
padding = _ref$padding === void 0 ? "24px" : _ref$padding,
|
|
39930
|
+
_ref$showQuitLink = _ref.showQuitLink,
|
|
39931
|
+
showQuitLink = _ref$showQuitLink === void 0 ? false : _ref$showQuitLink,
|
|
39916
39932
|
text = _ref.text,
|
|
39933
|
+
_ref$textAs = _ref.textAs,
|
|
39934
|
+
textAs = _ref$textAs === void 0 ? "p" : _ref$textAs,
|
|
39935
|
+
_ref$titleAs = _ref.titleAs,
|
|
39936
|
+
titleAs = _ref$titleAs === void 0 ? "h2" : _ref$titleAs,
|
|
39917
39937
|
titleText = _ref.titleText,
|
|
39918
39938
|
_ref$titleVariant = _ref.titleVariant,
|
|
39919
39939
|
titleVariant = _ref$titleVariant === void 0 ? "small" : _ref$titleVariant,
|
|
@@ -39970,9 +39990,13 @@ var Card = function Card(_ref) {
|
|
|
39970
39990
|
width: "100%",
|
|
39971
39991
|
extraStyles: "flex-basis: 100%;"
|
|
39972
39992
|
}, text && /*#__PURE__*/React.createElement(CardText$1, {
|
|
39993
|
+
onQuitClick: onQuitClick,
|
|
39973
39994
|
padding: padding,
|
|
39995
|
+
showQuitLink: showQuitLink,
|
|
39996
|
+
titleAs: titleAs,
|
|
39974
39997
|
titleText: titleText,
|
|
39975
39998
|
text: text,
|
|
39999
|
+
textAs: textAs,
|
|
39976
40000
|
titleVariant: titleVariant
|
|
39977
40001
|
}), children)))));
|
|
39978
40002
|
};
|
|
@@ -49202,33 +49226,27 @@ PhoneForm.mapDispatchToProps = mapDispatchToProps$8;
|
|
|
49202
49226
|
var DefaultHeading = styled.div.withConfig({
|
|
49203
49227
|
displayName: "RadioGroup__DefaultHeading",
|
|
49204
49228
|
componentId: "sc-7lqrl8-0"
|
|
49205
|
-
})(["
|
|
49206
|
-
var fontSize = _ref.fontSize;
|
|
49207
|
-
return "font-size: ".concat(fontSize, ";");
|
|
49208
|
-
}, CHARADE_GREY);
|
|
49229
|
+
})(["font-size:0.875rem;color:", " margin:0;padding:8px 0px;"], CHARADE_GREY);
|
|
49209
49230
|
var StyledFieldset = styled.fieldset.withConfig({
|
|
49210
49231
|
displayName: "RadioGroup__StyledFieldset",
|
|
49211
49232
|
componentId: "sc-7lqrl8-1"
|
|
49212
49233
|
})(["", ""], function (props) {
|
|
49213
49234
|
return props.$extraStyles;
|
|
49214
49235
|
});
|
|
49215
|
-
var RadioGroup = function RadioGroup(
|
|
49216
|
-
var headingText =
|
|
49217
|
-
groupName =
|
|
49218
|
-
|
|
49219
|
-
|
|
49220
|
-
_ref2$heading = _ref2.heading,
|
|
49221
|
-
Heading = _ref2$heading === void 0 ? /*#__PURE__*/React.createElement(DefaultHeading, {
|
|
49236
|
+
var RadioGroup = function RadioGroup(_ref) {
|
|
49237
|
+
var headingText = _ref.headingText,
|
|
49238
|
+
groupName = _ref.groupName,
|
|
49239
|
+
_ref$heading = _ref.heading,
|
|
49240
|
+
Heading = _ref$heading === void 0 ? /*#__PURE__*/React.createElement(DefaultHeading, {
|
|
49222
49241
|
role: "heading",
|
|
49223
|
-
id: "radio-group-".concat(groupName, "-heading")
|
|
49224
|
-
|
|
49225
|
-
|
|
49226
|
-
|
|
49227
|
-
|
|
49228
|
-
|
|
49229
|
-
|
|
49230
|
-
|
|
49231
|
-
fieldActions = _ref2.fieldActions;
|
|
49242
|
+
id: "radio-group-".concat(groupName, "-heading")
|
|
49243
|
+
}, headingText) : _ref$heading,
|
|
49244
|
+
config = _ref.config,
|
|
49245
|
+
extraStyles = _ref.extraStyles,
|
|
49246
|
+
_ref$handleChange = _ref.handleChange,
|
|
49247
|
+
handleChange = _ref$handleChange === void 0 ? noop : _ref$handleChange,
|
|
49248
|
+
field = _ref.field,
|
|
49249
|
+
fieldActions = _ref.fieldActions;
|
|
49232
49250
|
var setValue = function setValue(value) {
|
|
49233
49251
|
return fieldActions.set(value);
|
|
49234
49252
|
};
|