@thecb/components 12.0.0 → 12.0.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 +30 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +30 -14
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/checkbox/Checkbox.js +11 -6
- package/src/components/atoms/form-layouts/FormInput.js +2 -0
- package/src/components/molecules/registration-form/RegistrationForm.js +5 -0
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +3 -1
package/dist/index.cjs.js
CHANGED
|
@@ -22119,7 +22119,7 @@ var ENTER = 13;
|
|
|
22119
22119
|
var ESCAPE = 27;
|
|
22120
22120
|
var SPACEBAR = 32;
|
|
22121
22121
|
|
|
22122
|
-
var _excluded$x = ["title", "name", "checked", "onChange", "disabled", "themeValues", "hidden", "error", "checkboxMargin", "extraStyles", "textExtraStyles", "labelledById", "dataQa", "checkboxExtraStyles", "hasIconOverride", "icon"];
|
|
22122
|
+
var _excluded$x = ["title", "name", "checked", "onChange", "disabled", "themeValues", "hidden", "error", "isRequired", "checkboxMargin", "extraStyles", "textExtraStyles", "labelledById", "dataQa", "checkboxExtraStyles", "hasIconOverride", "icon"];
|
|
22123
22123
|
var CheckboxContainer = styled__default.span.withConfig({
|
|
22124
22124
|
displayName: "Checkbox__CheckboxContainer",
|
|
22125
22125
|
componentId: "sc-36kqbv-0"
|
|
@@ -22178,6 +22178,8 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref5, ref) {
|
|
|
22178
22178
|
hidden = _ref5$hidden === void 0 ? false : _ref5$hidden,
|
|
22179
22179
|
_ref5$error = _ref5.error,
|
|
22180
22180
|
error = _ref5$error === void 0 ? false : _ref5$error,
|
|
22181
|
+
_ref5$isRequired = _ref5.isRequired,
|
|
22182
|
+
isRequired = _ref5$isRequired === void 0 ? false : _ref5$isRequired,
|
|
22181
22183
|
_ref5$checkboxMargin = _ref5.checkboxMargin,
|
|
22182
22184
|
checkboxMargin = _ref5$checkboxMargin === void 0 ? "0 16px 0 0" : _ref5$checkboxMargin,
|
|
22183
22185
|
extraStyles = _ref5.extraStyles,
|
|
@@ -22206,6 +22208,13 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref5, ref) {
|
|
|
22206
22208
|
ref: ref,
|
|
22207
22209
|
padding: "0",
|
|
22208
22210
|
tabIndex: "0",
|
|
22211
|
+
role: "checkbox",
|
|
22212
|
+
"aria-checked": checked,
|
|
22213
|
+
"aria-required": isRequired || undefined,
|
|
22214
|
+
"aria-invalid": error,
|
|
22215
|
+
"aria-label": ariaLabel,
|
|
22216
|
+
"aria-labelledby": ariaLabelledById,
|
|
22217
|
+
"aria-describedby": error ? "".concat(name, "-error-message") : undefined,
|
|
22209
22218
|
onFocus: function onFocus() {
|
|
22210
22219
|
return setFocused(true);
|
|
22211
22220
|
},
|
|
@@ -22226,19 +22235,16 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref5, ref) {
|
|
|
22226
22235
|
id: "checkbox-".concat(name),
|
|
22227
22236
|
disabled: disabled,
|
|
22228
22237
|
name: name,
|
|
22229
|
-
"aria-label": ariaLabel,
|
|
22230
|
-
"aria-labelledby": ariaLabelledById,
|
|
22231
22238
|
checked: checked,
|
|
22232
22239
|
onChange: onChange,
|
|
22233
22240
|
tabIndex: "-1",
|
|
22234
|
-
|
|
22235
|
-
"aria-
|
|
22241
|
+
required: isRequired,
|
|
22242
|
+
"aria-hidden": "true"
|
|
22236
22243
|
}), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
|
|
22237
|
-
|
|
22244
|
+
"aria-hidden": "true",
|
|
22238
22245
|
error: error,
|
|
22239
22246
|
disabled: disabled,
|
|
22240
22247
|
checked: checked,
|
|
22241
|
-
"aria-checked": checked,
|
|
22242
22248
|
focused: focused,
|
|
22243
22249
|
defaultStyles: themeValues.defaultStyles,
|
|
22244
22250
|
checkedStyles: themeValues.checkedStyles,
|
|
@@ -25975,6 +25981,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
25975
25981
|
"aria-labelledby": ariaLabelledBy === undefined ? createIdFromString(labelTextWhenNoError) : ariaLabelledBy,
|
|
25976
25982
|
"aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
|
|
25977
25983
|
"aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
|
|
25984
|
+
"aria-required": isRequired,
|
|
25978
25985
|
onChange: function onChange(value) {
|
|
25979
25986
|
return setValue(value);
|
|
25980
25987
|
},
|
|
@@ -26007,6 +26014,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26007
26014
|
"aria-labelledby": ariaLabelledBy === undefined ? createIdFromString(labelTextWhenNoError) : ariaLabelledBy,
|
|
26008
26015
|
"aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
|
|
26009
26016
|
"aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
|
|
26017
|
+
"aria-required": isRequired,
|
|
26010
26018
|
onChange: function onChange(e) {
|
|
26011
26019
|
return setValue(e.target.value);
|
|
26012
26020
|
},
|
|
@@ -48169,7 +48177,9 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
|
48169
48177
|
_ref$modalTitle = _ref.modalTitle,
|
|
48170
48178
|
modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle,
|
|
48171
48179
|
_ref$initialFocusSele = _ref.initialFocusSelector,
|
|
48172
|
-
initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele
|
|
48180
|
+
initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
|
|
48181
|
+
_ref$isRequired = _ref.isRequired,
|
|
48182
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
|
|
48173
48183
|
var _useState = React.useState(false),
|
|
48174
48184
|
_useState2 = _slicedToArray(_useState, 2),
|
|
48175
48185
|
showTerms = _useState2[0],
|
|
@@ -48202,7 +48212,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
|
48202
48212
|
onChange: onCheck,
|
|
48203
48213
|
checkboxMargin: checkboxMargin,
|
|
48204
48214
|
extraStyles: "align-self: flex-start;",
|
|
48205
|
-
labelledById: TermsAndConditionsTitleDivId
|
|
48215
|
+
labelledById: TermsAndConditionsTitleDivId,
|
|
48216
|
+
isRequired: isRequired
|
|
48206
48217
|
}), /*#__PURE__*/React__default.createElement(Stack, {
|
|
48207
48218
|
childGap: "0.25rem",
|
|
48208
48219
|
fullHeight: true
|
|
@@ -49360,7 +49371,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49360
49371
|
return e.key === "Enter" && handleSubmit(e);
|
|
49361
49372
|
},
|
|
49362
49373
|
autocompleteValue: "given-name",
|
|
49363
|
-
dataQa: "First name"
|
|
49374
|
+
dataQa: "First name",
|
|
49375
|
+
isRequired: true
|
|
49364
49376
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
49365
49377
|
labelTextWhenNoError: "Last name",
|
|
49366
49378
|
errorMessages: lastNameErrorMessages,
|
|
@@ -49371,7 +49383,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49371
49383
|
return e.key === "Enter" && handleSubmit(e);
|
|
49372
49384
|
},
|
|
49373
49385
|
autocompleteValue: "family-name",
|
|
49374
|
-
dataQa: "Last name"
|
|
49386
|
+
dataQa: "Last name",
|
|
49387
|
+
isRequired: true
|
|
49375
49388
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
49376
49389
|
labelTextWhenNoError: "Email address",
|
|
49377
49390
|
errorMessages: emailErrorMessages,
|
|
@@ -49384,7 +49397,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49384
49397
|
type: "email",
|
|
49385
49398
|
isEmail: true,
|
|
49386
49399
|
autocompleteValue: "email",
|
|
49387
|
-
dataQa: "Email address"
|
|
49400
|
+
dataQa: "Email address",
|
|
49401
|
+
isRequired: true
|
|
49388
49402
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
49389
49403
|
labelTextWhenNoError: "Password",
|
|
49390
49404
|
errorMessages: passwordErrorMessages,
|
|
@@ -49396,7 +49410,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49396
49410
|
},
|
|
49397
49411
|
type: "password",
|
|
49398
49412
|
autocompleteValue: "new-password",
|
|
49399
|
-
dataQa: "Password"
|
|
49413
|
+
dataQa: "Password",
|
|
49414
|
+
isRequired: true
|
|
49400
49415
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
49401
49416
|
labelTextWhenNoError: "Confirm password",
|
|
49402
49417
|
errorMessages: confirmPasswordErrorMessages,
|
|
@@ -49408,7 +49423,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49408
49423
|
},
|
|
49409
49424
|
type: "password",
|
|
49410
49425
|
autocompleteValue: "new-password",
|
|
49411
|
-
dataQa: "Confirm password"
|
|
49426
|
+
dataQa: "Confirm password",
|
|
49427
|
+
isRequired: true
|
|
49412
49428
|
}), /*#__PURE__*/React__default.createElement(Box, {
|
|
49413
49429
|
padding: isMobile ? "0" : "0.5rem 0 0"
|
|
49414
49430
|
}, /*#__PURE__*/React__default.createElement(PasswordRequirements, {
|