@thecb/components 4.3.11 → 4.3.12

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 CHANGED
@@ -37410,6 +37410,7 @@ var InternalUserInfoForm = function InternalUserInfoForm(_ref) {
37410
37410
  selectAgency = _ref.selectAgency,
37411
37411
  roleOptions = _ref.roleOptions,
37412
37412
  clientOptions = _ref.clientOptions,
37413
+ namesDisabled = _ref.namesDisabled,
37413
37414
  emailDisabled = _ref.emailDisabled,
37414
37415
  roleDisabled = _ref.roleDisabled,
37415
37416
  selectionDisabled = _ref.selectionDisabled,
@@ -37443,7 +37444,7 @@ var InternalUserInfoForm = function InternalUserInfoForm(_ref) {
37443
37444
 
37444
37445
  var lastNameErrorMessages = _defineProperty({}, required.error, "Last name is required");
37445
37446
 
37446
- var emailErrorMessages = _defineProperty({}, required.error, "Email is required");
37447
+ var emailErrorMessages = _defineProperty({}, isProbablyEmail.error, "Invalid email address");
37447
37448
 
37448
37449
  var roleErrorMessages = _defineProperty({}, required.error, "Role is required");
37449
37450
 
@@ -37510,7 +37511,8 @@ var InternalUserInfoForm = function InternalUserInfoForm(_ref) {
37510
37511
  showErrors: showErrors,
37511
37512
  onKeyDown: function onKeyDown(e) {
37512
37513
  return e.key === "Enter" && handleSubmit(e);
37513
- }
37514
+ },
37515
+ disabled: namesDisabled
37514
37516
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
37515
37517
  labelTextWhenNoError: "Last Name",
37516
37518
  errorMessages: lastNameErrorMessages,
@@ -37519,7 +37521,8 @@ var InternalUserInfoForm = function InternalUserInfoForm(_ref) {
37519
37521
  showErrors: showErrors,
37520
37522
  onKeyDown: function onKeyDown(e) {
37521
37523
  return e.key === "Enter" && handleSubmit(e);
37522
- }
37524
+ },
37525
+ disabled: namesDisabled
37523
37526
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
37524
37527
  labelTextWhenNoError: "Email",
37525
37528
  errorMessages: emailErrorMessages,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "4.3.11",
3
+ "version": "4.3.12",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect } from "react";
2
- import { required } from "redux-freeform";
2
+ import { required, isProbablyEmail } from "redux-freeform";
3
3
  import { Stack, Box, Cluster } from "../../atoms/layouts";
4
4
  import ButtonWithAction from "../../atoms/button-with-action";
5
5
  import Heading from "../../atoms/heading";
@@ -47,6 +47,7 @@ const InternalUserInfoForm = ({
47
47
  selectAgency,
48
48
  roleOptions,
49
49
  clientOptions,
50
+ namesDisabled,
50
51
  emailDisabled,
51
52
  roleDisabled,
52
53
  selectionDisabled,
@@ -78,7 +79,7 @@ const InternalUserInfoForm = ({
78
79
  [required.error]: "Last name is required"
79
80
  };
80
81
  const emailErrorMessages = {
81
- [required.error]: "Email is required"
82
+ [isProbablyEmail.error]: "Invalid email address"
82
83
  };
83
84
  const roleErrorMessages = {
84
85
  [required.error]: "Role is required"
@@ -151,6 +152,7 @@ const InternalUserInfoForm = ({
151
152
  fieldActions={actions.fields.firstName}
152
153
  showErrors={showErrors}
153
154
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
155
+ disabled={namesDisabled}
154
156
  />
155
157
  <FormInput
156
158
  labelTextWhenNoError="Last Name"
@@ -159,6 +161,7 @@ const InternalUserInfoForm = ({
159
161
  fieldActions={actions.fields.lastName}
160
162
  showErrors={showErrors}
161
163
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
164
+ disabled={namesDisabled}
162
165
  />
163
166
  <FormInput
164
167
  labelTextWhenNoError="Email"