@thecb/components 10.4.0-beta.0 → 10.4.0-beta.1
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 +801 -318
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +64 -1
- package/dist/index.esm.js +797 -317
- 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 +8 -4
- 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 +5 -1
- package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +74 -4
- 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 +87 -74
- 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 +13 -6
- package/src/components/molecules/link-card/LinkCard.stories.js +64 -34
- package/src/components/molecules/link-card/LinkCard.styled.js +11 -4
- package/src/components/molecules/link-card/LinkCard.theme.js +20 -5
- package/src/components/molecules/obligation/Obligation.js +2 -0
- package/src/components/molecules/obligation/modules/AutopayModalModule.js +29 -20
- package/src/components/molecules/obligation/modules/InactiveControlsModule.js +6 -3
- package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +23 -7
- package/src/components/molecules/obligation/modules/RemoveAccountModalModule.js +5 -3
- 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,8 @@ const AutopayModal = ({
|
|
|
27
27
|
inactive,
|
|
28
28
|
description,
|
|
29
29
|
subDescription,
|
|
30
|
-
allowedPaymentInstruments
|
|
30
|
+
allowedPaymentInstruments,
|
|
31
|
+
isInCustomerManagement = false
|
|
31
32
|
}) => {
|
|
32
33
|
const generateMethodNeededText = (planText, allowedPaymentInstruments) => {
|
|
33
34
|
const allowsCard = allowedPaymentInstruments.includes(CC_METHOD);
|
|
@@ -39,25 +40,27 @@ const AutopayModal = ({
|
|
|
39
40
|
? "checking account payment method"
|
|
40
41
|
: "payment method";
|
|
41
42
|
|
|
42
|
-
return `To
|
|
43
|
+
return `To set up ${planText} you must have a saved ${methodRequired} and address. Do you want to save these now?`;
|
|
43
44
|
};
|
|
44
45
|
const plan = isPaymentPlan ? "your payment plan" : "autopay";
|
|
45
46
|
const shortPlan = isPaymentPlan ? "Payment Plan" : "Autopay";
|
|
46
|
-
const deactivateText = `
|
|
47
|
-
|
|
47
|
+
const deactivateText = `Stop ${shortPlan.toLowerCase()} for ${titleCaseString(
|
|
48
|
+
description
|
|
49
|
+
)}: ${titleCaseString(subDescription)}`;
|
|
50
|
+
const activateText = `Set up ${shortPlan.toLowerCase()} for ${titleCaseString(
|
|
51
|
+
description
|
|
52
|
+
)}: ${titleCaseString(subDescription)}`;
|
|
48
53
|
const nextDate = dueDate || nextAutopayDate;
|
|
49
54
|
const modalExtraProps = {
|
|
50
|
-
modalHeaderText: autoPayActive
|
|
51
|
-
? titleCaseString(deactivateText)
|
|
52
|
-
: titleCaseString(activateText),
|
|
55
|
+
modalHeaderText: autoPayActive ? deactivateText : activateText,
|
|
53
56
|
modalBodyText: autoPayActive
|
|
54
|
-
? `Are you sure you want to
|
|
55
|
-
!inactive && nextDate
|
|
56
|
-
?
|
|
57
|
+
? `Are you sure you want to stop ${plan}? ${
|
|
58
|
+
!inactive && nextDate && nextDate !== "On"
|
|
59
|
+
? "Your next payment will be due on " + nextDate + "."
|
|
57
60
|
: ""
|
|
58
61
|
}`
|
|
59
62
|
: generateMethodNeededText(plan, allowedPaymentInstruments),
|
|
60
|
-
continueButtonText: autoPayActive ? `
|
|
63
|
+
continueButtonText: autoPayActive ? `Stop ${shortPlan}` : "Add",
|
|
61
64
|
useDangerButton: autoPayActive,
|
|
62
65
|
continueAction: autoPayActive
|
|
63
66
|
? () => {
|
|
@@ -78,6 +81,7 @@ const AutopayModal = ({
|
|
|
78
81
|
case "secondary": {
|
|
79
82
|
return (
|
|
80
83
|
<ButtonWithAction
|
|
84
|
+
disabled={isInCustomerManagement}
|
|
81
85
|
text={
|
|
82
86
|
autoPayActive ? `Turn off ${shortPlan}` : `Set Up ${shortPlan}`
|
|
83
87
|
}
|
|
@@ -97,10 +101,11 @@ const AutopayModal = ({
|
|
|
97
101
|
case "tertiary": {
|
|
98
102
|
return (
|
|
99
103
|
<ButtonWithAction
|
|
104
|
+
disabled={isInCustomerManagement}
|
|
100
105
|
text={autoPayActive ? `Manage ${shortPlan}` : `Set Up ${shortPlan}`}
|
|
101
|
-
variant="tertiary"
|
|
106
|
+
variant={isInCustomerManagement ? "disabledTertiary" : "tertiary"}
|
|
102
107
|
action={() => {
|
|
103
|
-
toggleModal(true);
|
|
108
|
+
isInCustomerManagement ? noop : toggleModal(true);
|
|
104
109
|
}}
|
|
105
110
|
dataQa="Manage Autopay"
|
|
106
111
|
extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
|
|
@@ -112,7 +117,7 @@ const AutopayModal = ({
|
|
|
112
117
|
<Box
|
|
113
118
|
padding="0"
|
|
114
119
|
onClick={() => {
|
|
115
|
-
toggleModal(true);
|
|
120
|
+
isInCustomerManagement ? noop : toggleModal(true);
|
|
116
121
|
}}
|
|
117
122
|
hoverStyles={hoverStyles}
|
|
118
123
|
activeStyles={activeStyles}
|
|
@@ -126,9 +131,13 @@ const AutopayModal = ({
|
|
|
126
131
|
<Text
|
|
127
132
|
variant="pS"
|
|
128
133
|
onClick={() => toggleModal(true)}
|
|
129
|
-
onKeyPress={
|
|
130
|
-
|
|
131
|
-
|
|
134
|
+
onKeyPress={
|
|
135
|
+
isInCustomerManagement
|
|
136
|
+
? noop
|
|
137
|
+
: e => {
|
|
138
|
+
e.key === "Enter" && toggleModal(true);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
132
141
|
tabIndex="0"
|
|
133
142
|
dataQa={`${shortPlan} On`}
|
|
134
143
|
color={SEA_GREEN}
|
|
@@ -146,8 +155,8 @@ const AutopayModal = ({
|
|
|
146
155
|
};
|
|
147
156
|
return (
|
|
148
157
|
<Modal
|
|
149
|
-
showModal={() => toggleModal(true)}
|
|
150
|
-
hideModal={() => toggleModal(false)}
|
|
158
|
+
showModal={isInCustomerManagement ? noop : () => toggleModal(true)}
|
|
159
|
+
hideModal={isInCustomerManagement ? noop : () => toggleModal(false)}
|
|
151
160
|
modalOpen={modalOpen}
|
|
152
161
|
{...modalExtraProps}
|
|
153
162
|
>
|
|
@@ -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
|
+
isInCustomerManagement = false
|
|
25
26
|
}) => {
|
|
26
27
|
const [modalOpen, toggleModal] = useState(false);
|
|
27
28
|
const { deleteObligationAssoc } = actions;
|
|
@@ -58,15 +59,17 @@ const InactiveControlsModule = ({
|
|
|
58
59
|
description={description}
|
|
59
60
|
subDescription={subDescription}
|
|
60
61
|
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
62
|
+
isInCustomerManagement={isInCustomerManagement}
|
|
61
63
|
/>
|
|
62
64
|
</Box>
|
|
63
65
|
)}
|
|
64
66
|
<Box padding="0" extraStyles={`flex-grow: 1;`}>
|
|
65
67
|
<RemoveAccountModalModule
|
|
66
68
|
agencyName={agencyName}
|
|
67
|
-
removeAccount={handleRemoveAccount}
|
|
69
|
+
removeAccount={isInCustomerManagement ? noop : handleRemoveAccount}
|
|
68
70
|
accountType={configType === "ACCOUNT" ? "Account" : "Property"}
|
|
69
71
|
isMobile={isMobile}
|
|
72
|
+
isInCustomerManagement={isInCustomerManagement}
|
|
70
73
|
/>
|
|
71
74
|
</Box>
|
|
72
75
|
</Cluster>
|
|
@@ -95,7 +95,7 @@ const PaymentDetailsActions = ({
|
|
|
95
95
|
extraStyles={isMobile && `flex-grow: 1;`}
|
|
96
96
|
>
|
|
97
97
|
<ButtonWithAction
|
|
98
|
-
variant="tertiary"
|
|
98
|
+
variant={isInCustomerManagement ? "disabledTertiary" : "tertiary"}
|
|
99
99
|
text={
|
|
100
100
|
config.type === "ACCOUNT"
|
|
101
101
|
? "Account Details"
|
|
@@ -110,9 +110,11 @@ const PaymentDetailsActions = ({
|
|
|
110
110
|
padding={isMobile ? "0 8px 0 0" : "0"}
|
|
111
111
|
extraStyles={isMobile && `flex-grow: 1;`}
|
|
112
112
|
>
|
|
113
|
-
{autoPayAvailable && !autoPayEnabled
|
|
113
|
+
{autoPayAvailable && !autoPayEnabled ? (
|
|
114
114
|
<ButtonWithAction
|
|
115
|
-
variant=
|
|
115
|
+
variant={
|
|
116
|
+
isInCustomerManagement ? "disabledTertiary" : "tertiary"
|
|
117
|
+
}
|
|
116
118
|
text={`Set Up ${planType}`}
|
|
117
119
|
action={() => {
|
|
118
120
|
setDetailedObligation(obligations, config, obligationAssocID);
|
|
@@ -120,6 +122,7 @@ const PaymentDetailsActions = ({
|
|
|
120
122
|
}}
|
|
121
123
|
dataQa="Set Up Autopay"
|
|
122
124
|
extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
|
|
125
|
+
disabled={isInCustomerManagement}
|
|
123
126
|
/>
|
|
124
127
|
) : (
|
|
125
128
|
<AutopayModalModule
|
|
@@ -138,22 +141,34 @@ const PaymentDetailsActions = ({
|
|
|
138
141
|
description={description}
|
|
139
142
|
subDescription={subDescription}
|
|
140
143
|
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
144
|
+
isInCustomerManagement={isInCustomerManagement}
|
|
141
145
|
/>
|
|
142
146
|
)}
|
|
143
147
|
</Box>
|
|
144
|
-
{!isMobile &&
|
|
148
|
+
{!isMobile && (
|
|
145
149
|
<Box padding={"0"}>
|
|
146
150
|
<ButtonWithAction
|
|
147
151
|
isLoading={isLoading}
|
|
148
|
-
action={
|
|
152
|
+
action={
|
|
153
|
+
isInCustomerManagement ? noop : () => handleClick(obligations)
|
|
154
|
+
}
|
|
149
155
|
text="Pay Now"
|
|
150
|
-
variant={
|
|
156
|
+
variant={
|
|
157
|
+
isMobile
|
|
158
|
+
? isInCustomerManagement
|
|
159
|
+
? "disabledSmallSecondary"
|
|
160
|
+
: "smallSecondary"
|
|
161
|
+
: isInCustomerManagement
|
|
162
|
+
? "disabledSecondary"
|
|
163
|
+
: "secondary"
|
|
164
|
+
}
|
|
151
165
|
dataQa="Pay Now"
|
|
166
|
+
disabled={isInCustomerManagement}
|
|
152
167
|
/>
|
|
153
168
|
</Box>
|
|
154
169
|
)}
|
|
155
170
|
</Cluster>
|
|
156
|
-
{isMobile &&
|
|
171
|
+
{isMobile && (
|
|
157
172
|
<Box padding="8px 0 0" width="100%">
|
|
158
173
|
<ButtonWithAction
|
|
159
174
|
isLoading={isLoading}
|
|
@@ -162,6 +177,7 @@ const PaymentDetailsActions = ({
|
|
|
162
177
|
variant={isMobile ? "smallSecondary" : "secondary"}
|
|
163
178
|
dataQa="Pay Now"
|
|
164
179
|
extraStyles={isMobile && `flex-grow: 1; width: 100%; margin: 0;`}
|
|
180
|
+
disabled={isInCustomerManagement}
|
|
165
181
|
/>
|
|
166
182
|
</Box>
|
|
167
183
|
)}
|
|
@@ -8,7 +8,8 @@ const RemoveAccountModalModule = ({
|
|
|
8
8
|
obligations = [],
|
|
9
9
|
removeAccount,
|
|
10
10
|
accountType,
|
|
11
|
-
isMobile
|
|
11
|
+
isMobile,
|
|
12
|
+
isInCustomerManagement = false
|
|
12
13
|
}) => {
|
|
13
14
|
const [modalIsOpen, setModalIsOpen] = useState(false);
|
|
14
15
|
const lastItem = [...obligations].pop();
|
|
@@ -48,12 +49,13 @@ const RemoveAccountModalModule = ({
|
|
|
48
49
|
<Box padding="0" extraStyles={`flex-grow: 1;`}>
|
|
49
50
|
<ButtonWithAction
|
|
50
51
|
text="Remove"
|
|
51
|
-
variant="secondary"
|
|
52
|
-
action={() => setModalIsOpen(true)}
|
|
52
|
+
variant={isInCustomerManagement ? "disabledSecondary" : "secondary"}
|
|
53
|
+
action={isInCustomerManagement ? noop : () => setModalIsOpen(true)}
|
|
53
54
|
dataQa="Remove Account"
|
|
54
55
|
extraStyles={
|
|
55
56
|
isMobile ? `flex-grow: 1; width: 100%; margin: 0;` : `flex-grow: 1;`
|
|
56
57
|
}
|
|
58
|
+
disabled={isInCustomerManagement}
|
|
57
59
|
/>
|
|
58
60
|
</Box>
|
|
59
61
|
</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
|
};
|