@thecb/components 10.4.0-beta.0 → 10.4.0-beta.10
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/README.md +2 -2
- package/dist/index.cjs.js +847 -331
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +64 -1
- package/dist/index.esm.js +843 -330
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/badge/Badge.js +6 -2
- package/src/components/atoms/badge/Badge.stories.js +2 -1
- package/src/components/atoms/badge/Badge.theme.js +6 -2
- package/src/components/atoms/breadcrumb/Breadcrumb.js +4 -3
- package/src/components/atoms/breadcrumb/Breadcrumb.theme.js +5 -2
- package/src/components/atoms/button-with-action/ButtonWithAction.js +34 -31
- package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +29 -7
- package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +72 -3
- package/src/components/atoms/button-with-link/ButtonWithLink.js +7 -3
- package/src/components/atoms/form-layouts/FormInput.js +1 -1
- package/src/components/atoms/icons/AutopayIcon.js +2 -2
- package/src/components/atoms/icons/CloseIcon.d.ts +1 -0
- package/src/components/atoms/icons/CloseIcon.js +48 -0
- package/src/components/atoms/icons/MultiCartIcon.js +12 -10
- package/src/components/atoms/icons/TrashIconV2.d.ts +1 -0
- package/src/components/atoms/icons/TrashIconV2.js +41 -0
- package/src/components/atoms/icons/icons.stories.js +5 -1
- package/src/components/atoms/icons/index.d.ts +2 -0
- package/src/components/atoms/icons/index.js +5 -1
- package/src/components/atoms/jumbo/Jumbo.js +1 -5
- package/src/components/atoms/layouts/Box.js +1 -0
- package/src/components/atoms/layouts/Box.styled.js +15 -0
- package/src/components/atoms/layouts/examples/box-example/BoxExample.stories.js +2 -1
- package/src/components/atoms/link/ExternalLink.styled.js +6 -3
- package/src/components/atoms/link/InternalLink.styled.js +6 -3
- package/src/components/atoms/placeholder/Placeholder.js +1 -1
- package/src/components/atoms/placeholder/Placeholder.stories.js +2 -2
- package/src/components/atoms/text/Text.styled.js +1 -0
- package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.js +1 -0
- package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.stories.js +41 -0
- package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.theme.js +10 -2
- package/src/components/molecules/index.d.ts +1 -0
- package/src/components/molecules/index.js +1 -0
- package/src/components/molecules/link-card/LinkCard.js +26 -8
- package/src/components/molecules/link-card/LinkCard.stories.js +68 -34
- package/src/components/molecules/link-card/LinkCard.styled.js +41 -25
- package/src/components/molecules/link-card/LinkCard.theme.js +28 -5
- package/src/components/molecules/obligation/Obligation.js +5 -2
- package/src/components/molecules/obligation/modules/AmountModule.js +13 -1
- package/src/components/molecules/obligation/modules/AmountModule.stories.js +3 -0
- package/src/components/molecules/obligation/modules/AutopayModalModule.js +33 -21
- package/src/components/molecules/obligation/modules/InactiveControlsModule.js +15 -3
- package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +32 -9
- package/src/components/molecules/obligation/modules/RemoveAccountModalModule.js +10 -6
- package/src/components/molecules/pagination/Pagination.js +1 -7
- package/src/components/molecules/pagination/Pagination.stories.js +32 -0
- package/src/components/molecules/pagination/Pagination.theme.js +1 -2
- package/src/components/molecules/payment-button-bar/PaymentButtonBar.js +6 -1
- package/src/components/molecules/tab-sidebar/TabSidebar.js +2 -2
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.js +1 -0
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.theme.js +10 -2
- package/src/components/templates/default-page-template/DefaultPageTemplate.js +3 -2
- package/src/constants/index.d.ts +2 -1
- package/src/constants/index.js +12 -3
- package/src/constants/style_constants.d.ts +11 -0
- package/src/constants/style_constants.js +3 -1
|
@@ -8,7 +8,7 @@ import { SEA_GREEN } from "../../../../constants/colors";
|
|
|
8
8
|
import { ACH_METHOD, CC_METHOD } from "../../../../constants/general";
|
|
9
9
|
import { fallbackValues } from "./AutopayModalModule.theme";
|
|
10
10
|
import { themeComponent } from "../../../../util/themeUtils";
|
|
11
|
-
import { titleCaseString } from "../../../../util/general";
|
|
11
|
+
import { titleCaseString, noop } from "../../../../util/general";
|
|
12
12
|
|
|
13
13
|
const AutopayModal = ({
|
|
14
14
|
autoPayActive,
|
|
@@ -27,7 +27,11 @@ const AutopayModal = ({
|
|
|
27
27
|
inactive,
|
|
28
28
|
description,
|
|
29
29
|
subDescription,
|
|
30
|
-
allowedPaymentInstruments
|
|
30
|
+
allowedPaymentInstruments,
|
|
31
|
+
disableActions = false,
|
|
32
|
+
action,
|
|
33
|
+
onClick,
|
|
34
|
+
onKeyPress
|
|
31
35
|
}) => {
|
|
32
36
|
const generateMethodNeededText = (planText, allowedPaymentInstruments) => {
|
|
33
37
|
const allowsCard = allowedPaymentInstruments.includes(CC_METHOD);
|
|
@@ -39,25 +43,27 @@ const AutopayModal = ({
|
|
|
39
43
|
? "checking account payment method"
|
|
40
44
|
: "payment method";
|
|
41
45
|
|
|
42
|
-
return `To
|
|
46
|
+
return `To set up ${planText} you must have a saved ${methodRequired} and address. Do you want to save these now?`;
|
|
43
47
|
};
|
|
44
48
|
const plan = isPaymentPlan ? "your payment plan" : "autopay";
|
|
45
49
|
const shortPlan = isPaymentPlan ? "Payment Plan" : "Autopay";
|
|
46
|
-
const deactivateText = `
|
|
47
|
-
|
|
50
|
+
const deactivateText = `Stop ${shortPlan.toLowerCase()} for ${titleCaseString(
|
|
51
|
+
description
|
|
52
|
+
)}: ${titleCaseString(subDescription)}`;
|
|
53
|
+
const activateText = `Set up ${shortPlan.toLowerCase()} for ${titleCaseString(
|
|
54
|
+
description
|
|
55
|
+
)}: ${titleCaseString(subDescription)}`;
|
|
48
56
|
const nextDate = dueDate || nextAutopayDate;
|
|
49
57
|
const modalExtraProps = {
|
|
50
|
-
modalHeaderText: autoPayActive
|
|
51
|
-
? titleCaseString(deactivateText)
|
|
52
|
-
: titleCaseString(activateText),
|
|
58
|
+
modalHeaderText: autoPayActive ? deactivateText : activateText,
|
|
53
59
|
modalBodyText: autoPayActive
|
|
54
|
-
? `Are you sure you want to
|
|
55
|
-
!inactive && nextDate
|
|
56
|
-
?
|
|
60
|
+
? `Are you sure you want to stop ${plan}? ${
|
|
61
|
+
!inactive && nextDate && nextDate !== "On"
|
|
62
|
+
? "Your next payment will be due on " + nextDate + "."
|
|
57
63
|
: ""
|
|
58
64
|
}`
|
|
59
65
|
: generateMethodNeededText(plan, allowedPaymentInstruments),
|
|
60
|
-
continueButtonText: autoPayActive ? `
|
|
66
|
+
continueButtonText: autoPayActive ? `Stop ${shortPlan}` : "Add",
|
|
61
67
|
useDangerButton: autoPayActive,
|
|
62
68
|
continueAction: autoPayActive
|
|
63
69
|
? () => {
|
|
@@ -83,7 +89,7 @@ const AutopayModal = ({
|
|
|
83
89
|
}
|
|
84
90
|
variant="secondary"
|
|
85
91
|
action={() => {
|
|
86
|
-
toggleModal(true);
|
|
92
|
+
action || toggleModal(true);
|
|
87
93
|
}}
|
|
88
94
|
dataQa="Turn off Autopay"
|
|
89
95
|
extraStyles={
|
|
@@ -91,6 +97,7 @@ const AutopayModal = ({
|
|
|
91
97
|
? `flex-grow: 1; width: 100%; margin: 0;`
|
|
92
98
|
: `flex-grow: 1; min-width: 165px;`
|
|
93
99
|
}
|
|
100
|
+
disabled={disableActions}
|
|
94
101
|
/>
|
|
95
102
|
);
|
|
96
103
|
}
|
|
@@ -100,10 +107,11 @@ const AutopayModal = ({
|
|
|
100
107
|
text={autoPayActive ? `Manage ${shortPlan}` : `Set Up ${shortPlan}`}
|
|
101
108
|
variant="tertiary"
|
|
102
109
|
action={() => {
|
|
103
|
-
toggleModal(true);
|
|
110
|
+
action || toggleModal(true);
|
|
104
111
|
}}
|
|
105
112
|
dataQa="Manage Autopay"
|
|
106
113
|
extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
|
|
114
|
+
disabled={disableActions}
|
|
107
115
|
/>
|
|
108
116
|
);
|
|
109
117
|
}
|
|
@@ -112,7 +120,7 @@ const AutopayModal = ({
|
|
|
112
120
|
<Box
|
|
113
121
|
padding="0"
|
|
114
122
|
onClick={() => {
|
|
115
|
-
toggleModal(true);
|
|
123
|
+
onClick || toggleModal(true);
|
|
116
124
|
}}
|
|
117
125
|
hoverStyles={hoverStyles}
|
|
118
126
|
activeStyles={activeStyles}
|
|
@@ -125,16 +133,20 @@ const AutopayModal = ({
|
|
|
125
133
|
<AutopayOnIcon />
|
|
126
134
|
<Text
|
|
127
135
|
variant="pS"
|
|
128
|
-
onClick={() => toggleModal(true)}
|
|
129
|
-
onKeyPress={
|
|
130
|
-
|
|
131
|
-
|
|
136
|
+
onClick={() => onClick || toggleModal(true)}
|
|
137
|
+
onKeyPress={
|
|
138
|
+
onKeyPress ||
|
|
139
|
+
(e => {
|
|
140
|
+
e.key === "Enter" && toggleModal(true);
|
|
141
|
+
})
|
|
142
|
+
}
|
|
132
143
|
tabIndex="0"
|
|
133
144
|
dataQa={`${shortPlan} On`}
|
|
134
145
|
color={SEA_GREEN}
|
|
135
146
|
weight={themeValues.fontWeight}
|
|
136
147
|
hoverStyles={themeValues.modalLinkHoverFocus}
|
|
137
148
|
extraStyles={`padding-left: 0.25rem;`}
|
|
149
|
+
disabled={disableActions}
|
|
138
150
|
>
|
|
139
151
|
{`${shortPlan} ${nextAutopayDate}`}
|
|
140
152
|
</Text>
|
|
@@ -146,8 +158,8 @@ const AutopayModal = ({
|
|
|
146
158
|
};
|
|
147
159
|
return (
|
|
148
160
|
<Modal
|
|
149
|
-
showModal={() => toggleModal(true)}
|
|
150
|
-
hideModal={() => toggleModal(false)}
|
|
161
|
+
showModal={disableActions ? noop : () => toggleModal(true)}
|
|
162
|
+
hideModal={disableActions ? noop : () => toggleModal(false)}
|
|
151
163
|
modalOpen={modalOpen}
|
|
152
164
|
{...modalExtraProps}
|
|
153
165
|
>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import { GHOST_GREY } from "../../../../constants/colors";
|
|
3
|
-
import ButtonWithAction from "../../../atoms/button-with-action";
|
|
4
3
|
import { Box, Cluster } from "../../../atoms/layouts";
|
|
5
4
|
import { AutopayModalModule } from "./AutopayModalModule";
|
|
6
5
|
import RemoveAccountModalModule from "./RemoveAccountModalModule";
|
|
6
|
+
import { noop } from "../../../../util/general";
|
|
7
7
|
|
|
8
8
|
const InactiveControlsModule = ({
|
|
9
9
|
autoPayEnabled,
|
|
@@ -21,7 +21,8 @@ const InactiveControlsModule = ({
|
|
|
21
21
|
actions,
|
|
22
22
|
description,
|
|
23
23
|
subDescription,
|
|
24
|
-
allowedPaymentInstruments
|
|
24
|
+
allowedPaymentInstruments,
|
|
25
|
+
disableActions = false
|
|
25
26
|
}) => {
|
|
26
27
|
const [modalOpen, toggleModal] = useState(false);
|
|
27
28
|
const { deleteObligationAssoc } = actions;
|
|
@@ -58,15 +59,26 @@ const InactiveControlsModule = ({
|
|
|
58
59
|
description={description}
|
|
59
60
|
subDescription={subDescription}
|
|
60
61
|
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
62
|
+
disableActions={disableActions}
|
|
63
|
+
action={disableActions ? noop : toggleModal(true)}
|
|
64
|
+
onClick={disableActions ? noop : toggleModal(true)}
|
|
65
|
+
onKeyPress={
|
|
66
|
+
disableActions
|
|
67
|
+
? noop
|
|
68
|
+
: e => {
|
|
69
|
+
e.key === "Enter" && toggleModal(true);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
61
72
|
/>
|
|
62
73
|
</Box>
|
|
63
74
|
)}
|
|
64
75
|
<Box padding="0" extraStyles={`flex-grow: 1;`}>
|
|
65
76
|
<RemoveAccountModalModule
|
|
66
77
|
agencyName={agencyName}
|
|
67
|
-
removeAccount={handleRemoveAccount}
|
|
78
|
+
removeAccount={disableActions ? noop : handleRemoveAccount}
|
|
68
79
|
accountType={configType === "ACCOUNT" ? "Account" : "Property"}
|
|
69
80
|
isMobile={isMobile}
|
|
81
|
+
disableActions={disableActions}
|
|
70
82
|
/>
|
|
71
83
|
</Box>
|
|
72
84
|
</Cluster>
|
|
@@ -4,6 +4,7 @@ import ButtonWithAction from "../../../atoms/button-with-action";
|
|
|
4
4
|
import { AutopayModalModule } from "./AutopayModalModule";
|
|
5
5
|
import { GHOST_GREY } from "../../../../constants/colors";
|
|
6
6
|
import AmountModule from "./AmountModule";
|
|
7
|
+
import { noop } from "../../../../util/general";
|
|
7
8
|
|
|
8
9
|
const PaymentDetailsActions = ({
|
|
9
10
|
isMobile,
|
|
@@ -24,7 +25,7 @@ const PaymentDetailsActions = ({
|
|
|
24
25
|
description,
|
|
25
26
|
subDescription,
|
|
26
27
|
allowedPaymentInstruments,
|
|
27
|
-
|
|
28
|
+
disableActions = false
|
|
28
29
|
}) => {
|
|
29
30
|
const planType = isPaymentPlan ? "Payment Plan" : "Autopay";
|
|
30
31
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -80,6 +81,7 @@ const PaymentDetailsActions = ({
|
|
|
80
81
|
description={description}
|
|
81
82
|
subDescription={subDescription}
|
|
82
83
|
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
84
|
+
disableActions={disableActions}
|
|
83
85
|
/>
|
|
84
86
|
</Cluster>
|
|
85
87
|
</Box>
|
|
@@ -101,7 +103,7 @@ const PaymentDetailsActions = ({
|
|
|
101
103
|
? "Account Details"
|
|
102
104
|
: "Property Details"
|
|
103
105
|
}
|
|
104
|
-
action={handleDetailsClick}
|
|
106
|
+
action={disableActions ? noop : handleDetailsClick}
|
|
105
107
|
dataQa="Account Details"
|
|
106
108
|
extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
|
|
107
109
|
/>
|
|
@@ -110,16 +112,23 @@ const PaymentDetailsActions = ({
|
|
|
110
112
|
padding={isMobile ? "0 8px 0 0" : "0"}
|
|
111
113
|
extraStyles={isMobile && `flex-grow: 1;`}
|
|
112
114
|
>
|
|
113
|
-
{autoPayAvailable && !autoPayEnabled
|
|
115
|
+
{autoPayAvailable && !autoPayEnabled ? (
|
|
114
116
|
<ButtonWithAction
|
|
115
117
|
variant="tertiary"
|
|
116
118
|
text={`Set Up ${planType}`}
|
|
117
119
|
action={() => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
+
if (!disableActions) {
|
|
121
|
+
setDetailedObligation(
|
|
122
|
+
obligations,
|
|
123
|
+
config,
|
|
124
|
+
obligationAssocID
|
|
125
|
+
);
|
|
126
|
+
handleAutopayAction();
|
|
127
|
+
}
|
|
120
128
|
}}
|
|
121
129
|
dataQa="Set Up Autopay"
|
|
122
130
|
extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
|
|
131
|
+
disabled={disableActions}
|
|
123
132
|
/>
|
|
124
133
|
) : (
|
|
125
134
|
<AutopayModalModule
|
|
@@ -138,30 +147,44 @@ const PaymentDetailsActions = ({
|
|
|
138
147
|
description={description}
|
|
139
148
|
subDescription={subDescription}
|
|
140
149
|
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
150
|
+
disableActions={disableActions}
|
|
151
|
+
action={disableActions ? noop : toggleModal(true)}
|
|
152
|
+
onClick={disableActions ? noop : toggleModal(true)}
|
|
153
|
+
onKeyPress={
|
|
154
|
+
disableActions
|
|
155
|
+
? noop
|
|
156
|
+
: e => {
|
|
157
|
+
e.key === "Enter" && toggleModal(true);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
141
160
|
/>
|
|
142
161
|
)}
|
|
143
162
|
</Box>
|
|
144
|
-
{!isMobile &&
|
|
163
|
+
{!isMobile && (
|
|
145
164
|
<Box padding={"0"}>
|
|
146
165
|
<ButtonWithAction
|
|
147
166
|
isLoading={isLoading}
|
|
148
|
-
action={() => handleClick(obligations)}
|
|
167
|
+
action={disableActions ? noop : () => handleClick(obligations)}
|
|
149
168
|
text="Pay Now"
|
|
150
169
|
variant={isMobile ? "smallSecondary" : "secondary"}
|
|
151
170
|
dataQa="Pay Now"
|
|
171
|
+
disabled={disableActions}
|
|
152
172
|
/>
|
|
153
173
|
</Box>
|
|
154
174
|
)}
|
|
155
175
|
</Cluster>
|
|
156
|
-
{isMobile &&
|
|
176
|
+
{isMobile && (
|
|
157
177
|
<Box padding="8px 0 0" width="100%">
|
|
158
178
|
<ButtonWithAction
|
|
159
179
|
isLoading={isLoading}
|
|
160
|
-
action={() =>
|
|
180
|
+
action={() =>
|
|
181
|
+
disableActions ? noop : () => handleClick(obligations)
|
|
182
|
+
}
|
|
161
183
|
text="Pay Now"
|
|
162
184
|
variant={isMobile ? "smallSecondary" : "secondary"}
|
|
163
185
|
dataQa="Pay Now"
|
|
164
186
|
extraStyles={isMobile && `flex-grow: 1; width: 100%; margin: 0;`}
|
|
187
|
+
disabled={disableActions}
|
|
165
188
|
/>
|
|
166
189
|
</Box>
|
|
167
190
|
)}
|
|
@@ -8,7 +8,8 @@ const RemoveAccountModalModule = ({
|
|
|
8
8
|
obligations = [],
|
|
9
9
|
removeAccount,
|
|
10
10
|
accountType,
|
|
11
|
-
isMobile
|
|
11
|
+
isMobile,
|
|
12
|
+
disableActions = false
|
|
12
13
|
}) => {
|
|
13
14
|
const [modalIsOpen, setModalIsOpen] = useState(false);
|
|
14
15
|
const lastItem = [...obligations].pop();
|
|
@@ -31,8 +32,8 @@ const RemoveAccountModalModule = ({
|
|
|
31
32
|
|
|
32
33
|
return (
|
|
33
34
|
<Modal
|
|
34
|
-
showModal={() => setModalIsOpen(true)}
|
|
35
|
-
hideModal={() => setModalIsOpen(false)}
|
|
35
|
+
showModal={disableActions ? noop : () => setModalIsOpen(true)}
|
|
36
|
+
hideModal={disableActions ? noop : () => setModalIsOpen(false)}
|
|
36
37
|
modalOpen={modalIsOpen}
|
|
37
38
|
modalHeaderText={`Remove ${accountType}`}
|
|
38
39
|
modalBodyText={`Are you sure you want to remove the ${identifier} ${accounts}? Any autopay scheduled against ${
|
|
@@ -40,8 +41,10 @@ const RemoveAccountModalModule = ({
|
|
|
40
41
|
} will be deactivated.`}
|
|
41
42
|
continueButtonText="Remove"
|
|
42
43
|
continueAction={() => {
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
if (!disableActions) {
|
|
45
|
+
removeAccount();
|
|
46
|
+
setModalIsOpen(false);
|
|
47
|
+
}
|
|
45
48
|
}}
|
|
46
49
|
useDangerButton
|
|
47
50
|
>
|
|
@@ -49,11 +52,12 @@ const RemoveAccountModalModule = ({
|
|
|
49
52
|
<ButtonWithAction
|
|
50
53
|
text="Remove"
|
|
51
54
|
variant="secondary"
|
|
52
|
-
action={() => setModalIsOpen(true)}
|
|
55
|
+
action={disableActions ? noop : () => setModalIsOpen(true)}
|
|
53
56
|
dataQa="Remove Account"
|
|
54
57
|
extraStyles={
|
|
55
58
|
isMobile ? `flex-grow: 1; width: 100%; margin: 0;` : `flex-grow: 1;`
|
|
56
59
|
}
|
|
60
|
+
disabled={disableActions}
|
|
57
61
|
/>
|
|
58
62
|
</Box>
|
|
59
63
|
</Modal>
|
|
@@ -94,6 +94,7 @@ export const getPagesPanel = (page, pagesCount) => {
|
|
|
94
94
|
|
|
95
95
|
const Pagination = ({
|
|
96
96
|
activeBorderWidth = "3px",
|
|
97
|
+
ariaLabel,
|
|
97
98
|
arrowColor,
|
|
98
99
|
borderRadius = "3px",
|
|
99
100
|
buttonHeight = "44px",
|
|
@@ -107,7 +108,6 @@ const Pagination = ({
|
|
|
107
108
|
pageNext,
|
|
108
109
|
pagePrevious,
|
|
109
110
|
setCurrentPage,
|
|
110
|
-
ariaLabel,
|
|
111
111
|
themeValues
|
|
112
112
|
}) => {
|
|
113
113
|
const { isMobile } = useContext(ThemeContext);
|
|
@@ -115,12 +115,6 @@ const Pagination = ({
|
|
|
115
115
|
const extraStyles = `
|
|
116
116
|
min-width: ${buttonWidth}; min-height: 100%; padding: 0;
|
|
117
117
|
border-radius: ${borderRadius};
|
|
118
|
-
&:hover, &:focus {
|
|
119
|
-
text-decoration: none;
|
|
120
|
-
> * > span {
|
|
121
|
-
text-decoration: none;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
118
|
> * > span {
|
|
125
119
|
color: ${numberColor ?? themeValues.numberColor}
|
|
126
120
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { number, text } from "@storybook/addon-knobs";
|
|
3
|
+
import Pagination from "./Pagination";
|
|
4
|
+
import page from "../../../../.storybook/page";
|
|
5
|
+
|
|
6
|
+
export const pagination = () => (
|
|
7
|
+
<Pagination
|
|
8
|
+
activeBorderWidth={text("activeBorderWidth", "3px", "props")}
|
|
9
|
+
ariaLabel={text("ariaLabel", "Aria Label", "props")}
|
|
10
|
+
arrowColor={text("arrowColor", "#FFFFFF", "props")}
|
|
11
|
+
borderRadius={text("borderRadius", "3px", "props")}
|
|
12
|
+
buttonHeight={text("buttonHeight", "44px", "props")}
|
|
13
|
+
buttonWidth={text("buttonWidth", "44px", "props")}
|
|
14
|
+
childGap={text("childGap", "24px", "props")}
|
|
15
|
+
currentPage={number("currentPage", 2)}
|
|
16
|
+
fontSize={text("fontSize", "17px", "props")}
|
|
17
|
+
fontWeight={text("fontWeight", "900", "props")}
|
|
18
|
+
numberColor={text("numberColor", "#15749D", "props")}
|
|
19
|
+
pageCount={number("pageCount", 3)}
|
|
20
|
+
pageNext={() => {}}
|
|
21
|
+
pagePrevious={() => {}}
|
|
22
|
+
setCurrentPage={() => {}}
|
|
23
|
+
// themeValues
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const story = page({
|
|
28
|
+
title: "Components|Molecules/Pagination",
|
|
29
|
+
Component: Pagination
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export default story;
|
|
@@ -22,7 +22,10 @@ const PaymentButtonBar = ({
|
|
|
22
22
|
redirectText = "Return",
|
|
23
23
|
buttonFlexOverride,
|
|
24
24
|
hideForwardButton = false,
|
|
25
|
-
hideBackButton = false
|
|
25
|
+
hideBackButton = false,
|
|
26
|
+
buttonGroupStyles,
|
|
27
|
+
hideAdditionalButton = false,
|
|
28
|
+
additionalButton
|
|
26
29
|
}) => {
|
|
27
30
|
const { isMobile } = useContext(ThemeContext);
|
|
28
31
|
|
|
@@ -92,9 +95,11 @@ const PaymentButtonBar = ({
|
|
|
92
95
|
: "flex-end"
|
|
93
96
|
}
|
|
94
97
|
align="center"
|
|
98
|
+
extraStyles={buttonGroupStyles}
|
|
95
99
|
>
|
|
96
100
|
{!hideBackButton && <Fragment>{backButton}</Fragment>}
|
|
97
101
|
{!hideForwardButton && <Fragment>{forwardButton}</Fragment>}
|
|
102
|
+
{!hideAdditionalButton && <Fragment>{additionalButton}</Fragment>}
|
|
98
103
|
</Cluster>
|
|
99
104
|
</Box>
|
|
100
105
|
</Fragment>
|
|
@@ -53,6 +53,7 @@ const TermsAndConditionsModal = ({
|
|
|
53
53
|
color={themeValues.linkColor}
|
|
54
54
|
weight={themeValues.fontWeight}
|
|
55
55
|
hoverStyles={themeValues.modalLinkHoverFocus}
|
|
56
|
+
textDecoration={themeValues.modalLinkTextDecoration}
|
|
56
57
|
extraStyles={`display: inline-block; width: fit-content; cursor: pointer`}
|
|
57
58
|
role="button" // This should always be a "button" since it opens a modal
|
|
58
59
|
className="modal-trigger"
|
package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.theme.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FONT_WEIGHT_REGULAR,
|
|
3
|
-
FONT_WEIGHT_SEMIBOLD
|
|
3
|
+
FONT_WEIGHT_SEMIBOLD,
|
|
4
|
+
LINK_TEXT_DECORATION
|
|
4
5
|
} from "../../../constants/style_constants";
|
|
5
6
|
|
|
6
7
|
const backgroundColor = { default: "#ffffff", footer: "#ffffff" };
|
|
@@ -22,11 +23,17 @@ const standardInteractionStyles = `
|
|
|
22
23
|
outline-offset: 2px;
|
|
23
24
|
}
|
|
24
25
|
`;
|
|
26
|
+
|
|
25
27
|
const modalLinkHoverFocus = {
|
|
26
28
|
default: standardInteractionStyles,
|
|
27
29
|
footer: standardInteractionStyles
|
|
28
30
|
};
|
|
29
31
|
|
|
32
|
+
const modalLinkTextDecoration = {
|
|
33
|
+
default: LINK_TEXT_DECORATION,
|
|
34
|
+
footer: "none"
|
|
35
|
+
};
|
|
36
|
+
|
|
30
37
|
export const fallbackValues = {
|
|
31
38
|
backgroundColor,
|
|
32
39
|
linkColor,
|
|
@@ -34,5 +41,6 @@ export const fallbackValues = {
|
|
|
34
41
|
fontSize,
|
|
35
42
|
lineHeight,
|
|
36
43
|
fontWeight,
|
|
37
|
-
modalLinkHoverFocus
|
|
44
|
+
modalLinkHoverFocus,
|
|
45
|
+
modalLinkTextDecoration
|
|
38
46
|
};
|
|
@@ -15,7 +15,8 @@ const CenterSingle = ({
|
|
|
15
15
|
themeValues,
|
|
16
16
|
maxWidth = "75rem",
|
|
17
17
|
gutters = "2rem",
|
|
18
|
-
fillPageVertical = false
|
|
18
|
+
fillPageVertical = false,
|
|
19
|
+
background = COOL_GREY_05
|
|
19
20
|
}) => {
|
|
20
21
|
const themeContext = useContext(ThemeContext);
|
|
21
22
|
const { isMobile } = themeContext;
|
|
@@ -24,7 +25,7 @@ const CenterSingle = ({
|
|
|
24
25
|
<Box
|
|
25
26
|
padding="0"
|
|
26
27
|
minWidth="100%"
|
|
27
|
-
background={
|
|
28
|
+
background={background}
|
|
28
29
|
extraStyles="flex-grow: 1;"
|
|
29
30
|
>
|
|
30
31
|
<Cover
|
package/src/constants/index.d.ts
CHANGED
package/src/constants/index.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export * as colors from "./colors";
|
|
2
|
+
export * as general from "./general";
|
|
3
|
+
export * as regexConstants from "./regex_constants";
|
|
4
|
+
export * as styleConstants from "./style_constants";
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
/**
|
|
7
|
+
* This export is named "fontWeights" and referenced as such in much existing code.
|
|
8
|
+
* Navigate Frontend is one example that uses this particular export. However, new
|
|
9
|
+
* usage of style constants should reference the `styleConstants` export instead.
|
|
10
|
+
*
|
|
11
|
+
* @deprecated
|
|
12
|
+
*/
|
|
13
|
+
export * as fontWeights from "./style_constants";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type StyleDeclaration = string;
|
|
2
|
+
|
|
3
|
+
export const HEADER_HEIGHT: StyleDeclaration;
|
|
4
|
+
export const FOOTER_HEIGHT: StyleDeclaration;
|
|
5
|
+
export const SPACER_HEIGHT: StyleDeclaration;
|
|
6
|
+
export const JUMBO_HEIGHT: StyleDeclaration;
|
|
7
|
+
export const COMPACT_JUMBO_HEIGHT: StyleDeclaration;
|
|
8
|
+
export const FONT_WEIGHT_REGULAR: StyleDeclaration;
|
|
9
|
+
export const FONT_WEIGHT_BOLD: StyleDeclaration;
|
|
10
|
+
export const FONT_WEIGHT_SEMIBOLD: StyleDeclaration;
|
|
11
|
+
export const LINK_TEXT_DECORATION: StyleDeclaration;
|
|
@@ -8,6 +8,7 @@ const COMPACT_JUMBO_HEIGHT = "65px";
|
|
|
8
8
|
const FONT_WEIGHT_REGULAR = "400";
|
|
9
9
|
const FONT_WEIGHT_BOLD = "700";
|
|
10
10
|
const FONT_WEIGHT_SEMIBOLD = "600";
|
|
11
|
+
const LINK_TEXT_DECORATION = "underline solid 1px";
|
|
11
12
|
|
|
12
13
|
export {
|
|
13
14
|
HEADER_HEIGHT,
|
|
@@ -17,5 +18,6 @@ export {
|
|
|
17
18
|
COMPACT_JUMBO_HEIGHT,
|
|
18
19
|
FONT_WEIGHT_REGULAR,
|
|
19
20
|
FONT_WEIGHT_BOLD,
|
|
20
|
-
FONT_WEIGHT_SEMIBOLD
|
|
21
|
+
FONT_WEIGHT_SEMIBOLD,
|
|
22
|
+
LINK_TEXT_DECORATION
|
|
21
23
|
};
|