@thecb/components 10.6.0-beta.7 → 10.6.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 +39 -58
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +39 -58
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/atoms/toggle-switch/ToggleSwitch.js +33 -61
- package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +2 -3
- package/src/components/atoms/toggle-switch/ToggleSwitch.theme.js +5 -5
- package/src/components/atoms/wallet-name/WalletName.js +2 -2
- package/src/components/molecules/registration-form/RegistrationForm.js +6 -3
- package/src/components/molecules/registration-form/RegistrationForm.state.js +4 -3
package/dist/index.cjs.js
CHANGED
|
@@ -39119,17 +39119,17 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
39119
39119
|
};
|
|
39120
39120
|
|
|
39121
39121
|
var onBackground = "".concat(MATISSE_BLUE);
|
|
39122
|
-
var disabledBackground = "".concat(
|
|
39122
|
+
var disabledBackground = "".concat(MANATEE_GREY);
|
|
39123
|
+
var disabledBackgroundLight = "".concat(ATHENS_GREY);
|
|
39123
39124
|
var white = "".concat(WHITE);
|
|
39124
|
-
var offBackground = "".concat(REGENT_GREY);
|
|
39125
39125
|
var labelStyles = "\n display: flex;\n justify-content: flex-start;\n align-items: center;\n";
|
|
39126
39126
|
var rightLabelStyles = "\n ".concat(labelStyles, "\n flex-direction: row;\n");
|
|
39127
39127
|
var leftLabelStyles = "\n ".concat(labelStyles, "\n flex-direction: row-reverse;\n");
|
|
39128
39128
|
var fallbackValues$y = {
|
|
39129
39129
|
onBackground: onBackground,
|
|
39130
39130
|
disabledBackground: disabledBackground,
|
|
39131
|
+
disabledBackgroundLight: disabledBackgroundLight,
|
|
39131
39132
|
white: white,
|
|
39132
|
-
offBackground: offBackground,
|
|
39133
39133
|
rightLabelStyles: rightLabelStyles,
|
|
39134
39134
|
leftLabelStyles: leftLabelStyles
|
|
39135
39135
|
};
|
|
@@ -39147,7 +39147,7 @@ var HiddenToggleSwitchBox = styled__default.input.withConfig({
|
|
|
39147
39147
|
var VisibleSwitchComponent = styled__default.label.withConfig({
|
|
39148
39148
|
displayName: "ToggleSwitch__VisibleSwitchComponent",
|
|
39149
39149
|
componentId: "sc-1t51u6v-1"
|
|
39150
|
-
})(["width:
|
|
39150
|
+
})(["width:44px;height:24px;border-radius:12px;border:none;position:relative;box-sizing:border-box;cursor:", ";display:inline-block;&:hover{box-shadow:", ";}&:focus{box-shadow:0px 2px 5px 0px rgba(0,0,0,0.5);}", ""], function (_ref3) {
|
|
39151
39151
|
var disabled = _ref3.disabled;
|
|
39152
39152
|
return disabled ? "auto" : "pointer";
|
|
39153
39153
|
}, function (_ref4) {
|
|
@@ -39157,14 +39157,10 @@ var VisibleSwitchComponent = styled__default.label.withConfig({
|
|
|
39157
39157
|
var isMobile = _ref5.isMobile;
|
|
39158
39158
|
return isMobile ? "transform: scale(0.75)" : "";
|
|
39159
39159
|
});
|
|
39160
|
-
var
|
|
39161
|
-
displayName: "
|
|
39160
|
+
var ToggleSwitchRingComponent = styled__default.div.withConfig({
|
|
39161
|
+
displayName: "ToggleSwitch__ToggleSwitchRingComponent",
|
|
39162
39162
|
componentId: "sc-1t51u6v-2"
|
|
39163
|
-
})(["position:absolute;width:
|
|
39164
|
-
var ToggleSwitchInnerRingComponent = styled__default.div.withConfig({
|
|
39165
|
-
displayName: "ToggleSwitch__ToggleSwitchInnerRingComponent",
|
|
39166
|
-
componentId: "sc-1t51u6v-3"
|
|
39167
|
-
})(["position:absolute;width:14px;height:14px;top:3px;left:3px;right:3px;bottom:3px;border-radius:50%;box-sizing:border-box;"]);
|
|
39163
|
+
})(["position:absolute;width:16px;height:16px;border:none;border-radius:50%;box-sizing:border-box;"]);
|
|
39168
39164
|
var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
39169
39165
|
var _ref6$isOn = _ref6.isOn,
|
|
39170
39166
|
isOn = _ref6$isOn === void 0 ? false : _ref6$isOn,
|
|
@@ -39181,50 +39177,26 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
|
39181
39177
|
themeValues = _ref6.themeValues,
|
|
39182
39178
|
isMobile = _ref6.isMobile,
|
|
39183
39179
|
dataQa = _ref6.dataQa;
|
|
39184
|
-
var
|
|
39180
|
+
var ToggleSwitchRing = posed(ToggleSwitchRingComponent)({
|
|
39185
39181
|
off: {
|
|
39186
|
-
backgroundColor: themeValues.
|
|
39187
|
-
|
|
39188
|
-
|
|
39189
|
-
|
|
39190
|
-
|
|
39191
|
-
on: {
|
|
39192
|
-
backgroundColor: themeValues.onBackground,
|
|
39193
|
-
transition: {
|
|
39194
|
-
ease: "easeIn"
|
|
39195
|
-
}
|
|
39196
|
-
},
|
|
39197
|
-
disabled: {
|
|
39198
|
-
backgroundColor: themeValues.disabledBackground
|
|
39199
|
-
}
|
|
39200
|
-
});
|
|
39201
|
-
var ToggleSwitchMiddleRing = posed(ToggleSwitchMiddleRingComponent)({
|
|
39202
|
-
off: {
|
|
39203
|
-
backgroundColor: themeValues.white,
|
|
39204
|
-
left: "2px",
|
|
39205
|
-
top: "2px",
|
|
39206
|
-
bottom: "2px",
|
|
39207
|
-
right: "24px",
|
|
39182
|
+
backgroundColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
|
|
39183
|
+
left: "4px",
|
|
39184
|
+
top: "3px",
|
|
39185
|
+
bottom: "3px",
|
|
39186
|
+
right: "20px",
|
|
39208
39187
|
transition: {
|
|
39209
39188
|
ease: "backIn"
|
|
39210
39189
|
}
|
|
39211
39190
|
},
|
|
39212
39191
|
on: {
|
|
39213
39192
|
backgroundColor: themeValues.white,
|
|
39214
|
-
right: "
|
|
39215
|
-
top: "
|
|
39216
|
-
bottom: "
|
|
39217
|
-
left: "
|
|
39193
|
+
right: "8px",
|
|
39194
|
+
top: "3px",
|
|
39195
|
+
bottom: "3px",
|
|
39196
|
+
left: "22px",
|
|
39218
39197
|
transition: {
|
|
39219
39198
|
ease: "backIn"
|
|
39220
39199
|
}
|
|
39221
|
-
},
|
|
39222
|
-
disabled: {
|
|
39223
|
-
backgroundColor: themeValues.white,
|
|
39224
|
-
left: "2px",
|
|
39225
|
-
top: "2px",
|
|
39226
|
-
bottom: "2px",
|
|
39227
|
-
right: "24px"
|
|
39228
39200
|
}
|
|
39229
39201
|
});
|
|
39230
39202
|
var VisibleSwitch = posed(VisibleSwitchComponent)({
|
|
@@ -39239,19 +39211,20 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
|
39239
39211
|
boxShadow: "0px 2px 5px 0px rgba(0,0,0,0.5)"
|
|
39240
39212
|
},
|
|
39241
39213
|
off: {
|
|
39242
|
-
|
|
39214
|
+
border: "1px solid",
|
|
39215
|
+
backgroundColor: disabled ? themeValues.disabledBackgroundLight : themeValues.white,
|
|
39216
|
+
borderColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
|
|
39243
39217
|
transition: {
|
|
39244
39218
|
ease: "easeOut"
|
|
39245
39219
|
}
|
|
39246
39220
|
},
|
|
39247
39221
|
on: {
|
|
39248
|
-
|
|
39222
|
+
border: "1px solid",
|
|
39223
|
+
backgroundColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
|
|
39224
|
+
borderColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
|
|
39249
39225
|
transition: {
|
|
39250
39226
|
ease: "easeIn"
|
|
39251
39227
|
}
|
|
39252
|
-
},
|
|
39253
|
-
disabled: {
|
|
39254
|
-
backgroundColor: themeValues.disabledBackground
|
|
39255
39228
|
}
|
|
39256
39229
|
});
|
|
39257
39230
|
var handleKeyDown = function handleKeyDown(e) {
|
|
@@ -39286,11 +39259,11 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
|
39286
39259
|
htmlFor: "#toggle-".concat(name),
|
|
39287
39260
|
onClick: disabled ? noop : onToggle,
|
|
39288
39261
|
onKeyDown: disabled ? noop : handleKeyDown,
|
|
39289
|
-
pose:
|
|
39262
|
+
pose: isOn ? "on" : "off",
|
|
39290
39263
|
tabIndex: disabled ? -1 : 0,
|
|
39291
39264
|
disabled: disabled,
|
|
39292
39265
|
isMobile: isMobile
|
|
39293
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
39266
|
+
}, /*#__PURE__*/React__default.createElement(ToggleSwitchRing, null)))), label && /*#__PURE__*/React__default.createElement(Heading$1, {
|
|
39294
39267
|
variant: "h4",
|
|
39295
39268
|
weight: FONT_WEIGHT_SEMIBOLD,
|
|
39296
39269
|
extraStyles: "margin: 0 0.5rem; position: relative; bottom: 1px; display: inline-block;",
|
|
@@ -39759,13 +39732,13 @@ var WalletName = function WalletName(_ref) {
|
|
|
39759
39732
|
justify: text || actionText ? "flex-end" : "flex-start",
|
|
39760
39733
|
extraStyles: "margin-top: 0.5rem;"
|
|
39761
39734
|
}, text && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
39762
|
-
extraStyles: "font-size:
|
|
39735
|
+
extraStyles: "font-size: 0.857rem;"
|
|
39763
39736
|
}, text), (text || actionText) && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\xA0"), action && actionText && /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
39764
39737
|
text: actionText,
|
|
39765
39738
|
action: action,
|
|
39766
39739
|
variant: "smallGhost",
|
|
39767
39740
|
disabled: disableAction,
|
|
39768
|
-
extraStyles: "\n margin: 0;\n min-width: 0;\n span {font-size: 0.
|
|
39741
|
+
extraStyles: "\n margin: 0;\n min-width: 0;\n span {font-size: 0.857rem;}\n ".concat(linkButtonExtraStyles, "\n ")
|
|
39769
39742
|
})));
|
|
39770
39743
|
};
|
|
39771
39744
|
|
|
@@ -40363,6 +40336,14 @@ validatorFns[IS_PROBABLY_EMAIL] = (value, args, form) => {
|
|
|
40363
40336
|
return new RegExp(/^\S+@\S+\.\S+$/).test(value);
|
|
40364
40337
|
};
|
|
40365
40338
|
|
|
40339
|
+
const VALID_NAME = 'validator/VALID_NAME';
|
|
40340
|
+
const VALID_NAME_ERROR = 'validator/VALID_NAME_ERROR';
|
|
40341
|
+
const validName = createValidator(VALID_NAME, VALID_NAME_ERROR);
|
|
40342
|
+
validatorFns[VALID_NAME] = (value, args, form) =>
|
|
40343
|
+
value === ''
|
|
40344
|
+
? false
|
|
40345
|
+
: new RegExp(/[A-zÀ-ÿ\-,'\S]+(\s?[A-zÀ-ÿ\-,'\S])*/).test(value);
|
|
40346
|
+
|
|
40366
40347
|
const runValidatorErrorMessage = (type) =>
|
|
40367
40348
|
`${type} was passed to runValidator, but that validator type does not exist.
|
|
40368
40349
|
Please check that you are only calling validator creator functions exported from
|
|
@@ -50255,8 +50236,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
50255
50236
|
};
|
|
50256
50237
|
}, []);
|
|
50257
50238
|
}
|
|
50258
|
-
var firstNameErrorMessages = _defineProperty({}, required.error, "First name is required");
|
|
50259
|
-
var lastNameErrorMessages = _defineProperty({}, required.error, "Last name is required");
|
|
50239
|
+
var firstNameErrorMessages = _defineProperty(_defineProperty({}, required.error, "First name is required"), validName.error, "First name contains invalid characters");
|
|
50240
|
+
var lastNameErrorMessages = _defineProperty(_defineProperty({}, required.error, "Last name is required"), validName.error, "Last name contains invalid characters");
|
|
50260
50241
|
var emailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email is required"), isProbablyEmail.error, "Invalid email address");
|
|
50261
50242
|
var passwordErrorMessages = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, required.error, "Password is required"), hasLength.error, "Password must have at least 8 characters"), hasNumber.error, "Password must contain at least one number"), hasLowercaseLetter.error, "Password must contain at least one lowercase letter"), hasUppercaseLetter.error, "Password must contain at least one uppercase letter"), hasSpecialCharacter.error, "Password must contain at least one special character (!@#$%^&*.?)");
|
|
50262
50243
|
var confirmPasswordErrorMessages = _defineProperty({}, matchesField.error, "Confirm password must match password");
|
|
@@ -50332,10 +50313,10 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
50332
50313
|
|
|
50333
50314
|
var formConfig$9 = {
|
|
50334
50315
|
firstName: {
|
|
50335
|
-
validators: [required()]
|
|
50316
|
+
validators: [required(), validName()]
|
|
50336
50317
|
},
|
|
50337
50318
|
lastName: {
|
|
50338
|
-
validators: [required()]
|
|
50319
|
+
validators: [required(), validName()]
|
|
50339
50320
|
},
|
|
50340
50321
|
email: {
|
|
50341
50322
|
validators: [required(), isProbablyEmail()]
|