@thecb/components 10.5.1-beta.1 → 10.5.1-beta.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "10.5.1-beta.1",
3
+ "version": "10.5.1-beta.3",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -90,6 +90,6 @@
90
90
  "ramda": "^0.27.0",
91
91
  "react-aria-modal": "^4.0.0",
92
92
  "react-pose": "^4.0.10",
93
- "redux-freeform": "^5.8.0"
93
+ "redux-freeform": "^5.9.0"
94
94
  }
95
95
  }
Binary file
@@ -35,7 +35,7 @@ import ChargebackIcon from "./ChargebackIcon";
35
35
  import ChargebackReversalIcon from "./ChargebackReversalIcon";
36
36
  import DuplicateIcon from "./DuplicateIcon";
37
37
  import ErroredIcon from "./ErroredIcon";
38
- import ExternalLinkIcon from "./ExternalLinkicon";
38
+ import ExternalLinkIcon from "./ExternalLinkIcon";
39
39
  import FailedIcon from "./FailedIcon";
40
40
  import PencilIcon from "./PencilIcon";
41
41
  import PendingIcon from "./PendingIcon";
@@ -77,7 +77,6 @@ export const modalV2 = () => (
77
77
  onlyCloseButton={boolean("onlyCloseButton", false, groupId)}
78
78
  onlyContinueButton={boolean("onlyContinueButton", false, groupId)}
79
79
  useDangerButton={boolean("useDangerButton", false, groupId)}
80
- showCloseIconButton={boolean("showCloseIconButton", true, groupId)}
81
80
  />
82
81
  );
83
82
 
@@ -18,8 +18,7 @@ import {
18
18
  ButtonLayoutWrapper,
19
19
  CancelButton,
20
20
  CloseButton,
21
- ContinueButton,
22
- CloseIconButton
21
+ ContinueButton
23
22
  } from "./__private__";
24
23
 
25
24
  /*
@@ -62,8 +61,7 @@ const Modal = ({
62
61
  onlyCloseButton = false,
63
62
  onlyContinueButton = false,
64
63
  underlayClickExits = true,
65
- useDangerButton = false,
66
- showCloseIconButton = false
64
+ useDangerButton = false
67
65
  }) => {
68
66
  const { isMobile } = useContext(ThemeContext);
69
67
 
@@ -110,7 +108,7 @@ const Modal = ({
110
108
  borderRadius: BORDER_RADIUS.MD,
111
109
  margin: SPACING.XS,
112
110
  overflow: "auto",
113
- width: isMobile ? "" : customWidth || "576px"
111
+ width: isMobile ? "" : customWidth || "615px"
114
112
  }}
115
113
  underlayClickExits={underlayClickExits}
116
114
  aria-modal={true}
@@ -124,11 +122,7 @@ const Modal = ({
124
122
  borderWidthOverride={`0 0 ${BORDER_THIN} 0`}
125
123
  padding={`${SPACING.XS} ${SPACING.MD}`}
126
124
  >
127
- <Cluster
128
- justify={showCloseIconButton ? "space-between" : "flex-start"}
129
- align="center"
130
- nowrap
131
- >
125
+ <Cluster justify="flex-start" align="center">
132
126
  <Title
133
127
  as="h2"
134
128
  weight={FONT_WEIGHT_SEMIBOLD}
@@ -136,22 +130,6 @@ const Modal = ({
136
130
  >
137
131
  {modalHeaderText}
138
132
  </Title>
139
- {showCloseIconButton && (
140
- <CloseIconButton
141
- hideModal={hideModal}
142
- iconWidth={isMobile ? "20" : "24"}
143
- iconHeight={isMobile ? "20" : "24"}
144
- buttonExtraStyles={`
145
- min-height: auto;
146
- min-width: auto;
147
- height: 1.5rem;
148
- margin: 0;
149
- &:focus {
150
- outline-offset: -3px;
151
- }
152
- `}
153
- />
154
- )}
155
133
  </Cluster>
156
134
  </Box>
157
135
  <Box background={modalBodyBg || ATHENS_GREY} padding="0">
@@ -44,14 +44,3 @@ export interface ContinueButtonProps {
44
44
 
45
45
  export declare const ContinueButton: React.FC<Expand<ContinueButtonProps> &
46
46
  React.HTMLAttributes<HTMLElement>>;
47
-
48
- export interface CloseIconButtonProps {
49
- buttonExtraStyles?: string;
50
- hideModal?: action;
51
- iconWidth?: string;
52
- iconHeight?: string;
53
- ariaLabel?: string;
54
- }
55
-
56
- export declare const CloseIconButton: React.FC<Expand<CloseIconButtonProps> &
57
- React.HTMLAttributes<HTMLElement>>;
@@ -2,4 +2,3 @@ export { default as ButtonLayoutWrapper } from "./ButtonLayoutWrapper";
2
2
  export { default as CancelButton } from "./CancelButton";
3
3
  export { default as CloseButton } from "./CloseButton";
4
4
  export { default as ContinueButton } from "./ContinueButton";
5
- export { default as CloseIconButton } from "./CloseIconButton";
@@ -7,7 +7,8 @@ import {
7
7
  hasLowercaseLetter,
8
8
  hasUppercaseLetter,
9
9
  hasSpecialCharacter,
10
- isProbablyEmail
10
+ isProbablyEmail,
11
+ validName
11
12
  } from "redux-freeform";
12
13
  import PasswordRequirements from "../../atoms/password-requirements";
13
14
  import { Box } from "../../atoms/layouts";
@@ -26,10 +27,12 @@ const RegistrationForm = ({
26
27
  useEffect(() => () => actions.form.clear(), []);
27
28
  }
28
29
  const firstNameErrorMessages = {
29
- [required.error]: "First name is required"
30
+ [required.error]: "First name is required",
31
+ [validName.error]: "First name contains invalid characters"
30
32
  };
31
33
  const lastNameErrorMessages = {
32
- [required.error]: "Last name is required"
34
+ [required.error]: "Last name is required",
35
+ [validName.error]: "Last name contains invalid characters"
33
36
  };
34
37
  const emailErrorMessages = {
35
38
  [required.error]: "Email is required",
@@ -7,15 +7,16 @@ import {
7
7
  hasLowercaseLetter,
8
8
  hasUppercaseLetter,
9
9
  hasSpecialCharacter,
10
- isProbablyEmail
10
+ isProbablyEmail,
11
+ validName
11
12
  } from "redux-freeform";
12
13
 
13
14
  const formConfig = {
14
15
  firstName: {
15
- validators: [required()]
16
+ validators: [required(), validName()]
16
17
  },
17
18
  lastName: {
18
- validators: [required()]
19
+ validators: [required(), validName()]
19
20
  },
20
21
  email: {
21
22
  validators: [required(), isProbablyEmail()]
@@ -8,8 +8,7 @@ export const FONT_SIZE = {
8
8
  XS: "0.750rem", // 12px
9
9
  SM: "0.875rem", // 14px
10
10
  MD: "1.000rem", // 16px
11
- LG: "1.125rem", // 18px
12
- XLG: "1.25rem" //20px
11
+ LG: "1.125rem" // 18px
13
12
  };
14
13
  export const FONT_WEIGHT_REGULAR = "400";
15
14
  export const FONT_WEIGHT_SEMIBOLD = "600";
@@ -1,32 +0,0 @@
1
- import React from "react";
2
- import { noop } from "../../../../util/general";
3
- import ButtonWithAction from "../../../atoms/button-with-action/ButtonWithAction";
4
- import { CloseIcon } from "../../../atoms/icons/CloseIcon";
5
- import { button } from "@storybook/addon-knobs";
6
-
7
- export const CloseIconButton = ({
8
- buttonExtraStyles = "",
9
- hideModal = noop,
10
- iconWidth = "24",
11
- iconHeight = "24",
12
- ariaLabel = ""
13
- }) => {
14
- return (
15
- <ButtonWithAction
16
- variant="smallGhost"
17
- action={hideModal}
18
- contentOverride
19
- extraStyles={buttonExtraStyles}
20
- aria-label={ariaLabel ?? "Close Modal"}
21
- >
22
- <CloseIcon
23
- role="img"
24
- aria-hidden="true"
25
- iconWidth={iconWidth}
26
- iconHeight={iconHeight}
27
- />
28
- </ButtonWithAction>
29
- );
30
- };
31
-
32
- export default CloseIconButton;