@thecb/components 4.1.24 → 4.1.27
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 +41 -10
- package/package.json +1 -1
- package/src/components/atoms/form-layouts/FormFooterPanel.js +29 -0
- package/src/components/atoms/form-layouts/FormLayouts.theme.js +7 -2
- package/src/components/atoms/form-layouts/index.js +8 -1
- package/src/components/molecules/email-form/EmailForm.js +3 -3
- package/src/components/molecules/forgot-password-form/ForgotPasswordForm.js +3 -3
- package/src/components/molecules/login-form/LoginForm.js +2 -2
- package/src/components/molecules/payment-button-bar/PaymentButtonBar.js +3 -2
package/dist/index.cjs.js
CHANGED
|
@@ -20484,6 +20484,9 @@ var hoverFocusStyles$1 = {
|
|
|
20484
20484
|
"default": "color: #0E506D; outline: none; text-decoration: underline; ",
|
|
20485
20485
|
disabled: "color: #6E727E;"
|
|
20486
20486
|
};
|
|
20487
|
+
var formFooterPanel = {
|
|
20488
|
+
"default": "".concat(INFO_BLUE)
|
|
20489
|
+
};
|
|
20487
20490
|
var fallbackValues$h = {
|
|
20488
20491
|
linkColor: linkColor$2,
|
|
20489
20492
|
formBackgroundColor: formBackgroundColor$1,
|
|
@@ -20495,7 +20498,8 @@ var fallbackValues$h = {
|
|
|
20495
20498
|
fontSize: fontSize$6,
|
|
20496
20499
|
errorFontSize: errorFontSize$1,
|
|
20497
20500
|
fontWeight: fontWeight$3,
|
|
20498
|
-
hoverFocusStyles: hoverFocusStyles$1
|
|
20501
|
+
hoverFocusStyles: hoverFocusStyles$1,
|
|
20502
|
+
formFooterPanel: formFooterPanel
|
|
20499
20503
|
};
|
|
20500
20504
|
|
|
20501
20505
|
function _templateObject4$3() {
|
|
@@ -20765,6 +20769,30 @@ var FormContainer = function FormContainer(_ref) {
|
|
|
20765
20769
|
|
|
20766
20770
|
var FormContainer$1 = themeComponent(withWindowSize(FormContainer), "FormContainer", fallbackValues$h, "default");
|
|
20767
20771
|
|
|
20772
|
+
var FormFooterPanel = function FormFooterPanel(_ref) {
|
|
20773
|
+
var themeValues = _ref.themeValues,
|
|
20774
|
+
link = _ref.link,
|
|
20775
|
+
linkText = _ref.linkText;
|
|
20776
|
+
|
|
20777
|
+
var _useContext = React.useContext(styled.ThemeContext),
|
|
20778
|
+
isMobile = _useContext.isMobile;
|
|
20779
|
+
|
|
20780
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
20781
|
+
background: themeValues.formFooterPanel,
|
|
20782
|
+
minWidth: "100%",
|
|
20783
|
+
padding: isMobile ? "1.5rem" : "2rem"
|
|
20784
|
+
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
20785
|
+
justify: "center",
|
|
20786
|
+
align: "center"
|
|
20787
|
+
}, /*#__PURE__*/React__default.createElement(ButtonWithLink, {
|
|
20788
|
+
url: link,
|
|
20789
|
+
variant: "smallGhost",
|
|
20790
|
+
text: linkText
|
|
20791
|
+
})));
|
|
20792
|
+
};
|
|
20793
|
+
|
|
20794
|
+
var FormFooterPanel$1 = themeComponent(withWindowSize(FormFooterPanel), "FormFooterPanel", fallbackValues$h, "default");
|
|
20795
|
+
|
|
20768
20796
|
var fontSize$7 = {
|
|
20769
20797
|
"default": "1rem",
|
|
20770
20798
|
radio: "1.0625rem"
|
|
@@ -34990,15 +35018,15 @@ var EmailForm = function EmailForm(_ref) {
|
|
|
34990
35018
|
}, []);
|
|
34991
35019
|
}
|
|
34992
35020
|
|
|
34993
|
-
var emailFieldErrorMessages = (_emailFieldErrorMessa = {}, _defineProperty(_emailFieldErrorMessa, required.error, "Email is required"), _defineProperty(_emailFieldErrorMessa, isProbablyEmail.error, "Invalid email address"), _emailFieldErrorMessa);
|
|
35021
|
+
var emailFieldErrorMessages = (_emailFieldErrorMessa = {}, _defineProperty(_emailFieldErrorMessa, required.error, "Email address is required"), _defineProperty(_emailFieldErrorMessa, isProbablyEmail.error, "Invalid email address"), _emailFieldErrorMessa);
|
|
34994
35022
|
return /*#__PURE__*/React__default.createElement(FormContainer$1, {
|
|
34995
35023
|
variant: variant,
|
|
34996
35024
|
role: "form",
|
|
34997
|
-
"aria-label": "Email"
|
|
35025
|
+
"aria-label": "Email address"
|
|
34998
35026
|
}, guestCheckout && /*#__PURE__*/React__default.createElement(Paragraph$1, {
|
|
34999
35027
|
margin: "0 0 1.125rem 0"
|
|
35000
35028
|
}, "If desired, you can create a wallet later for faster checkout"), /*#__PURE__*/React__default.createElement(FormInputColumn, null, /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
35001
|
-
labelTextWhenNoError: "Email",
|
|
35029
|
+
labelTextWhenNoError: "Email address",
|
|
35002
35030
|
errorMessages: emailFieldErrorMessages,
|
|
35003
35031
|
type: "email",
|
|
35004
35032
|
field: fields.email,
|
|
@@ -35049,9 +35077,9 @@ var ForgotPasswordForm = function ForgotPasswordForm(_ref) {
|
|
|
35049
35077
|
}, []);
|
|
35050
35078
|
}
|
|
35051
35079
|
|
|
35052
|
-
var EmailErrorMessages = (_EmailErrorMessages = {}, _defineProperty(_EmailErrorMessages, required.error, "Email is required"), _defineProperty(_EmailErrorMessages, isProbablyEmail.error, "Email is not valid"), _EmailErrorMessages);
|
|
35080
|
+
var EmailErrorMessages = (_EmailErrorMessages = {}, _defineProperty(_EmailErrorMessages, required.error, "Email address is required"), _defineProperty(_EmailErrorMessages, isProbablyEmail.error, "Email address is not valid"), _EmailErrorMessages);
|
|
35053
35081
|
return /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
35054
|
-
labelTextWhenNoError: "Email",
|
|
35082
|
+
labelTextWhenNoError: "Email address",
|
|
35055
35083
|
errorMessages: EmailErrorMessages,
|
|
35056
35084
|
field: fields.email,
|
|
35057
35085
|
fieldActions: actions.fields.email,
|
|
@@ -35146,7 +35174,7 @@ var LoginForm = function LoginForm(_ref) {
|
|
|
35146
35174
|
}, []);
|
|
35147
35175
|
}
|
|
35148
35176
|
|
|
35149
|
-
var emailErrorMessages = (_emailErrorMessages = {}, _defineProperty(_emailErrorMessages, required.error, "Email is required"), _defineProperty(_emailErrorMessages, isProbablyEmail.error, "Invalid email address"), _emailErrorMessages);
|
|
35177
|
+
var emailErrorMessages = (_emailErrorMessages = {}, _defineProperty(_emailErrorMessages, required.error, "Email address is required"), _defineProperty(_emailErrorMessages, isProbablyEmail.error, "Invalid email address"), _emailErrorMessages);
|
|
35150
35178
|
|
|
35151
35179
|
var passwordErrorMessages = _defineProperty({}, required.error, "Password is required");
|
|
35152
35180
|
|
|
@@ -35154,7 +35182,7 @@ var LoginForm = function LoginForm(_ref) {
|
|
|
35154
35182
|
role: "form",
|
|
35155
35183
|
"aria-label": "Login"
|
|
35156
35184
|
}, /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
35157
|
-
labelTextWhenNoError: "Email",
|
|
35185
|
+
labelTextWhenNoError: "Email address",
|
|
35158
35186
|
errorMessages: emailErrorMessages,
|
|
35159
35187
|
type: "email",
|
|
35160
35188
|
field: fields.email,
|
|
@@ -38752,7 +38780,9 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
|
|
|
38752
38780
|
redirectURL = _ref.redirectURL,
|
|
38753
38781
|
_ref$redirectText = _ref.redirectText,
|
|
38754
38782
|
redirectText = _ref$redirectText === void 0 ? "Return" : _ref$redirectText,
|
|
38755
|
-
buttonFlexOverride = _ref.buttonFlexOverride
|
|
38783
|
+
buttonFlexOverride = _ref.buttonFlexOverride,
|
|
38784
|
+
_ref$hideForwardButto = _ref.hideForwardButton,
|
|
38785
|
+
hideForwardButton = _ref$hideForwardButto === void 0 ? false : _ref$hideForwardButto;
|
|
38756
38786
|
|
|
38757
38787
|
var _useContext = React.useContext(styled.ThemeContext),
|
|
38758
38788
|
isMobile = _useContext.isMobile;
|
|
@@ -38792,7 +38822,7 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
|
|
|
38792
38822
|
justify: buttonFlexOverride ? buttonFlexOverride : !!backButton ? "space-between" : "flex-end",
|
|
38793
38823
|
align: "center",
|
|
38794
38824
|
childGap: "0.75rem"
|
|
38795
|
-
}, backButton, forwardButton)));
|
|
38825
|
+
}, backButton, !hideForwardButton && /*#__PURE__*/React__default.createElement(React.Fragment, null, forwardButton))));
|
|
38796
38826
|
};
|
|
38797
38827
|
|
|
38798
38828
|
var backgroundColor$8 = {
|
|
@@ -40598,6 +40628,7 @@ exports.FailedIcon = FailedIcon;
|
|
|
40598
40628
|
exports.ForgotPasswordForm = ForgotPasswordForm;
|
|
40599
40629
|
exports.ForgotPasswordIcon = ForgotPasswordIcon$1;
|
|
40600
40630
|
exports.FormContainer = FormContainer$1;
|
|
40631
|
+
exports.FormFooterPanel = FormFooterPanel$1;
|
|
40601
40632
|
exports.FormInput = FormInput$1;
|
|
40602
40633
|
exports.FormInputColumn = FormInputColumn;
|
|
40603
40634
|
exports.FormInputRow = FormInputRow;
|
package/package.json
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { ThemeContext } from "styled-components";
|
|
3
|
+
import { fallbackValues } from "./FormLayouts.theme.js";
|
|
4
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
5
|
+
import { Box, Cluster } from "../layouts";
|
|
6
|
+
import ButtonWithLink from "../button-with-link";
|
|
7
|
+
import withWindowSize from "../../withWindowSize";
|
|
8
|
+
|
|
9
|
+
const FormFooterPanel = ({ themeValues, link, linkText }) => {
|
|
10
|
+
const { isMobile } = useContext(ThemeContext);
|
|
11
|
+
return (
|
|
12
|
+
<Box
|
|
13
|
+
background={themeValues.formFooterPanel}
|
|
14
|
+
minWidth="100%"
|
|
15
|
+
padding={isMobile ? "1.5rem" : "2rem"}
|
|
16
|
+
>
|
|
17
|
+
<Cluster justify="center" align="center">
|
|
18
|
+
<ButtonWithLink url={link} variant="smallGhost" text={linkText} />
|
|
19
|
+
</Cluster>
|
|
20
|
+
</Box>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default themeComponent(
|
|
25
|
+
withWindowSize(FormFooterPanel),
|
|
26
|
+
"FormFooterPanel",
|
|
27
|
+
fallbackValues,
|
|
28
|
+
"default"
|
|
29
|
+
);
|
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
MINESHAFT_GREY,
|
|
7
7
|
DUSTY_GREY,
|
|
8
8
|
GREY_CHATEAU,
|
|
9
|
-
ATHENS_GREY
|
|
9
|
+
ATHENS_GREY,
|
|
10
|
+
INFO_BLUE
|
|
10
11
|
} from "../../../constants/colors";
|
|
11
12
|
import { FONT_WEIGHT_REGULAR } from "../../../constants/style_constants";
|
|
12
13
|
|
|
@@ -36,6 +37,9 @@ const hoverFocusStyles = {
|
|
|
36
37
|
default: `color: #0E506D; outline: none; text-decoration: underline; `,
|
|
37
38
|
disabled: `color: #6E727E;`
|
|
38
39
|
};
|
|
40
|
+
const formFooterPanel = {
|
|
41
|
+
default: `${INFO_BLUE}`
|
|
42
|
+
};
|
|
39
43
|
|
|
40
44
|
export const fallbackValues = {
|
|
41
45
|
linkColor,
|
|
@@ -48,5 +52,6 @@ export const fallbackValues = {
|
|
|
48
52
|
fontSize,
|
|
49
53
|
errorFontSize,
|
|
50
54
|
fontWeight,
|
|
51
|
-
hoverFocusStyles
|
|
55
|
+
hoverFocusStyles,
|
|
56
|
+
formFooterPanel
|
|
52
57
|
};
|
|
@@ -2,5 +2,12 @@ import FormInput from "./FormInput";
|
|
|
2
2
|
import FormInputRow from "./FormInputRow";
|
|
3
3
|
import FormInputColumn from "./FormInputColumn";
|
|
4
4
|
import FormContainer from "./FormContainer";
|
|
5
|
+
import FormFooterPanel from "./FormFooterPanel";
|
|
5
6
|
|
|
6
|
-
export {
|
|
7
|
+
export {
|
|
8
|
+
FormInput,
|
|
9
|
+
FormInputRow,
|
|
10
|
+
FormInputColumn,
|
|
11
|
+
FormContainer,
|
|
12
|
+
FormFooterPanel
|
|
13
|
+
};
|
|
@@ -25,12 +25,12 @@ const EmailForm = ({
|
|
|
25
25
|
useEffect(() => () => actions.form.clear(), []);
|
|
26
26
|
}
|
|
27
27
|
const emailFieldErrorMessages = {
|
|
28
|
-
[required.error]: "Email is required",
|
|
28
|
+
[required.error]: "Email address is required",
|
|
29
29
|
[isProbablyEmail.error]: "Invalid email address"
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
|
-
<FormContainer variant={variant} role="form" aria-label="Email">
|
|
33
|
+
<FormContainer variant={variant} role="form" aria-label="Email address">
|
|
34
34
|
{guestCheckout && (
|
|
35
35
|
<Paragraph margin="0 0 1.125rem 0">
|
|
36
36
|
If desired, you can create a wallet later for faster checkout
|
|
@@ -38,7 +38,7 @@ const EmailForm = ({
|
|
|
38
38
|
)}
|
|
39
39
|
<FormInputColumn>
|
|
40
40
|
<FormInput
|
|
41
|
-
labelTextWhenNoError="Email"
|
|
41
|
+
labelTextWhenNoError="Email address"
|
|
42
42
|
errorMessages={emailFieldErrorMessages}
|
|
43
43
|
type="email"
|
|
44
44
|
field={fields.email}
|
|
@@ -14,13 +14,13 @@ const ForgotPasswordForm = ({
|
|
|
14
14
|
useEffect(() => () => actions.form.clear(), []);
|
|
15
15
|
}
|
|
16
16
|
const EmailErrorMessages = {
|
|
17
|
-
[required.error]: "Email is required",
|
|
18
|
-
[isProbablyEmail.error]: "Email is not valid"
|
|
17
|
+
[required.error]: "Email address is required",
|
|
18
|
+
[isProbablyEmail.error]: "Email address is not valid"
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
22
|
<FormInput
|
|
23
|
-
labelTextWhenNoError="Email"
|
|
23
|
+
labelTextWhenNoError="Email address"
|
|
24
24
|
errorMessages={EmailErrorMessages}
|
|
25
25
|
field={fields.email}
|
|
26
26
|
fieldActions={actions.fields.email}
|
|
@@ -14,7 +14,7 @@ const LoginForm = ({
|
|
|
14
14
|
useEffect(() => () => actions.form.clear(), []);
|
|
15
15
|
}
|
|
16
16
|
const emailErrorMessages = {
|
|
17
|
-
[required.error]: "Email is required",
|
|
17
|
+
[required.error]: "Email address is required",
|
|
18
18
|
[isProbablyEmail.error]: "Invalid email address"
|
|
19
19
|
};
|
|
20
20
|
const passwordErrorMessages = {
|
|
@@ -23,7 +23,7 @@ const LoginForm = ({
|
|
|
23
23
|
return (
|
|
24
24
|
<FormInputColumn role="form" aria-label="Login">
|
|
25
25
|
<FormInput
|
|
26
|
-
labelTextWhenNoError="Email"
|
|
26
|
+
labelTextWhenNoError="Email address"
|
|
27
27
|
errorMessages={emailErrorMessages}
|
|
28
28
|
type="email"
|
|
29
29
|
field={fields.email}
|
|
@@ -17,7 +17,8 @@ const PaymentButtonBar = ({
|
|
|
17
17
|
cancelText = "Cancel",
|
|
18
18
|
redirectURL,
|
|
19
19
|
redirectText = "Return",
|
|
20
|
-
buttonFlexOverride
|
|
20
|
+
buttonFlexOverride,
|
|
21
|
+
hideForwardButton = false
|
|
21
22
|
}) => {
|
|
22
23
|
const { isMobile } = useContext(ThemeContext);
|
|
23
24
|
|
|
@@ -80,7 +81,7 @@ const PaymentButtonBar = ({
|
|
|
80
81
|
childGap="0.75rem"
|
|
81
82
|
>
|
|
82
83
|
{backButton}
|
|
83
|
-
{forwardButton}
|
|
84
|
+
{!hideForwardButton && <Fragment>{forwardButton}</Fragment>}
|
|
84
85
|
</Cluster>
|
|
85
86
|
</Box>
|
|
86
87
|
</Fragment>
|