@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.esm.js
CHANGED
|
@@ -22111,7 +22111,7 @@ var ENTER = 13;
|
|
|
22111
22111
|
var ESCAPE = 27;
|
|
22112
22112
|
var SPACEBAR = 32;
|
|
22113
22113
|
|
|
22114
|
-
var _excluded$x = ["title", "name", "checked", "onChange", "disabled", "themeValues", "hidden", "error", "checkboxMargin", "extraStyles", "textExtraStyles", "labelledById", "dataQa", "checkboxExtraStyles", "hasIconOverride", "icon"];
|
|
22114
|
+
var _excluded$x = ["title", "name", "checked", "onChange", "disabled", "themeValues", "hidden", "error", "isRequired", "checkboxMargin", "extraStyles", "textExtraStyles", "labelledById", "dataQa", "checkboxExtraStyles", "hasIconOverride", "icon"];
|
|
22115
22115
|
var CheckboxContainer = styled.span.withConfig({
|
|
22116
22116
|
displayName: "Checkbox__CheckboxContainer",
|
|
22117
22117
|
componentId: "sc-36kqbv-0"
|
|
@@ -22170,6 +22170,8 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
|
22170
22170
|
hidden = _ref5$hidden === void 0 ? false : _ref5$hidden,
|
|
22171
22171
|
_ref5$error = _ref5.error,
|
|
22172
22172
|
error = _ref5$error === void 0 ? false : _ref5$error,
|
|
22173
|
+
_ref5$isRequired = _ref5.isRequired,
|
|
22174
|
+
isRequired = _ref5$isRequired === void 0 ? false : _ref5$isRequired,
|
|
22173
22175
|
_ref5$checkboxMargin = _ref5.checkboxMargin,
|
|
22174
22176
|
checkboxMargin = _ref5$checkboxMargin === void 0 ? "0 16px 0 0" : _ref5$checkboxMargin,
|
|
22175
22177
|
extraStyles = _ref5.extraStyles,
|
|
@@ -22198,6 +22200,13 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
|
22198
22200
|
ref: ref,
|
|
22199
22201
|
padding: "0",
|
|
22200
22202
|
tabIndex: "0",
|
|
22203
|
+
role: "checkbox",
|
|
22204
|
+
"aria-checked": checked,
|
|
22205
|
+
"aria-required": isRequired || undefined,
|
|
22206
|
+
"aria-invalid": error,
|
|
22207
|
+
"aria-label": ariaLabel,
|
|
22208
|
+
"aria-labelledby": ariaLabelledById,
|
|
22209
|
+
"aria-describedby": error ? "".concat(name, "-error-message") : undefined,
|
|
22201
22210
|
onFocus: function onFocus() {
|
|
22202
22211
|
return setFocused(true);
|
|
22203
22212
|
},
|
|
@@ -22218,19 +22227,16 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
|
22218
22227
|
id: "checkbox-".concat(name),
|
|
22219
22228
|
disabled: disabled,
|
|
22220
22229
|
name: name,
|
|
22221
|
-
"aria-label": ariaLabel,
|
|
22222
|
-
"aria-labelledby": ariaLabelledById,
|
|
22223
22230
|
checked: checked,
|
|
22224
22231
|
onChange: onChange,
|
|
22225
22232
|
tabIndex: "-1",
|
|
22226
|
-
|
|
22227
|
-
"aria-
|
|
22233
|
+
required: isRequired,
|
|
22234
|
+
"aria-hidden": "true"
|
|
22228
22235
|
}), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
|
|
22229
|
-
|
|
22236
|
+
"aria-hidden": "true",
|
|
22230
22237
|
error: error,
|
|
22231
22238
|
disabled: disabled,
|
|
22232
22239
|
checked: checked,
|
|
22233
|
-
"aria-checked": checked,
|
|
22234
22240
|
focused: focused,
|
|
22235
22241
|
defaultStyles: themeValues.defaultStyles,
|
|
22236
22242
|
checkedStyles: themeValues.checkedStyles,
|
|
@@ -25967,6 +25973,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
25967
25973
|
"aria-labelledby": ariaLabelledBy === undefined ? createIdFromString(labelTextWhenNoError) : ariaLabelledBy,
|
|
25968
25974
|
"aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
|
|
25969
25975
|
"aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
|
|
25976
|
+
"aria-required": isRequired,
|
|
25970
25977
|
onChange: function onChange(value) {
|
|
25971
25978
|
return setValue(value);
|
|
25972
25979
|
},
|
|
@@ -25999,6 +26006,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
25999
26006
|
"aria-labelledby": ariaLabelledBy === undefined ? createIdFromString(labelTextWhenNoError) : ariaLabelledBy,
|
|
26000
26007
|
"aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
|
|
26001
26008
|
"aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
|
|
26009
|
+
"aria-required": isRequired,
|
|
26002
26010
|
onChange: function onChange(e) {
|
|
26003
26011
|
return setValue(e.target.value);
|
|
26004
26012
|
},
|
|
@@ -48161,7 +48169,9 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
|
48161
48169
|
_ref$modalTitle = _ref.modalTitle,
|
|
48162
48170
|
modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle,
|
|
48163
48171
|
_ref$initialFocusSele = _ref.initialFocusSelector,
|
|
48164
|
-
initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele
|
|
48172
|
+
initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
|
|
48173
|
+
_ref$isRequired = _ref.isRequired,
|
|
48174
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
|
|
48165
48175
|
var _useState = useState(false),
|
|
48166
48176
|
_useState2 = _slicedToArray(_useState, 2),
|
|
48167
48177
|
showTerms = _useState2[0],
|
|
@@ -48194,7 +48204,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
|
48194
48204
|
onChange: onCheck,
|
|
48195
48205
|
checkboxMargin: checkboxMargin,
|
|
48196
48206
|
extraStyles: "align-self: flex-start;",
|
|
48197
|
-
labelledById: TermsAndConditionsTitleDivId
|
|
48207
|
+
labelledById: TermsAndConditionsTitleDivId,
|
|
48208
|
+
isRequired: isRequired
|
|
48198
48209
|
}), /*#__PURE__*/React__default.createElement(Stack, {
|
|
48199
48210
|
childGap: "0.25rem",
|
|
48200
48211
|
fullHeight: true
|
|
@@ -49352,7 +49363,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49352
49363
|
return e.key === "Enter" && handleSubmit(e);
|
|
49353
49364
|
},
|
|
49354
49365
|
autocompleteValue: "given-name",
|
|
49355
|
-
dataQa: "First name"
|
|
49366
|
+
dataQa: "First name",
|
|
49367
|
+
isRequired: true
|
|
49356
49368
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
49357
49369
|
labelTextWhenNoError: "Last name",
|
|
49358
49370
|
errorMessages: lastNameErrorMessages,
|
|
@@ -49363,7 +49375,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49363
49375
|
return e.key === "Enter" && handleSubmit(e);
|
|
49364
49376
|
},
|
|
49365
49377
|
autocompleteValue: "family-name",
|
|
49366
|
-
dataQa: "Last name"
|
|
49378
|
+
dataQa: "Last name",
|
|
49379
|
+
isRequired: true
|
|
49367
49380
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
49368
49381
|
labelTextWhenNoError: "Email address",
|
|
49369
49382
|
errorMessages: emailErrorMessages,
|
|
@@ -49376,7 +49389,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49376
49389
|
type: "email",
|
|
49377
49390
|
isEmail: true,
|
|
49378
49391
|
autocompleteValue: "email",
|
|
49379
|
-
dataQa: "Email address"
|
|
49392
|
+
dataQa: "Email address",
|
|
49393
|
+
isRequired: true
|
|
49380
49394
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
49381
49395
|
labelTextWhenNoError: "Password",
|
|
49382
49396
|
errorMessages: passwordErrorMessages,
|
|
@@ -49388,7 +49402,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49388
49402
|
},
|
|
49389
49403
|
type: "password",
|
|
49390
49404
|
autocompleteValue: "new-password",
|
|
49391
|
-
dataQa: "Password"
|
|
49405
|
+
dataQa: "Password",
|
|
49406
|
+
isRequired: true
|
|
49392
49407
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
49393
49408
|
labelTextWhenNoError: "Confirm password",
|
|
49394
49409
|
errorMessages: confirmPasswordErrorMessages,
|
|
@@ -49400,7 +49415,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49400
49415
|
},
|
|
49401
49416
|
type: "password",
|
|
49402
49417
|
autocompleteValue: "new-password",
|
|
49403
|
-
dataQa: "Confirm password"
|
|
49418
|
+
dataQa: "Confirm password",
|
|
49419
|
+
isRequired: true
|
|
49404
49420
|
}), /*#__PURE__*/React__default.createElement(Box, {
|
|
49405
49421
|
padding: isMobile ? "0" : "0.5rem 0 0"
|
|
49406
49422
|
}, /*#__PURE__*/React__default.createElement(PasswordRequirements, {
|