@thecb/components 5.7.0-beta.4 → 5.8.0-beta.0
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 +8766 -8967
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +8766 -8968
- package/dist/index.esm.js.map +1 -1
- package/package.json +6 -2
- package/src/components/atoms/amount-callout/AmountCallout.js +6 -12
- package/src/components/atoms/amount-callout/AmountCallout.stories.js +0 -10
- package/src/components/atoms/amount-callout/AmountCallout.theme.js +1 -15
- package/src/components/atoms/detail/Detail.theme.js +10 -8
- package/src/components/atoms/dropdown/Dropdown.js +8 -4
- package/src/components/atoms/form-layouts/FormInput.js +8 -8
- package/src/components/atoms/form-select/FormSelect.js +3 -1
- package/src/components/atoms/layouts/Box.js +8 -2
- package/src/components/atoms/layouts/Cluster.js +4 -4
- package/src/components/atoms/layouts/Cluster.styled.js +4 -4
- package/src/components/atoms/nav-footer/NavFooter.stories.js +1 -1
- package/src/components/atoms/paragraph/Paragraph.js +1 -1
- package/src/components/atoms/paragraph/Paragraph.theme.js +8 -6
- package/src/components/atoms/text/Text.theme.js +8 -6
- package/src/components/atoms/title/Title.theme.js +6 -4
- package/src/components/molecules/index.js +1 -0
- package/src/components/molecules/obligation/Obligation.js +88 -5
- package/src/components/molecules/obligation/modules/InactiveControlsModule.js +61 -0
- package/src/components/molecules/obligation/modules/InactiveTitleModule.js +41 -0
- package/src/components/molecules/obligation/modules/TitleModule.js +14 -8
- package/src/components/molecules/obligation/modules/index.js +10 -1
- package/src/components/molecules/periscope-dashboard-iframe/PeriscopeDashBoardIframe.stories.js +22 -0
- package/src/components/molecules/periscope-dashboard-iframe/PeriscopeDashboardIframe.js +124 -0
- package/src/components/molecules/periscope-dashboard-iframe/PeriscopeDashboardIframe.styled.js +9 -0
- package/src/components/molecules/periscope-dashboard-iframe/index.js +3 -0
- package/src/components/molecules/tabs/Tabs.js +3 -3
- package/src/util/general.js +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecb/components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.0-beta.0",
|
|
4
4
|
"description": "Common lib for CityBase react components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
"@storybook/addon-storysource": "^5.3.14",
|
|
39
39
|
"@storybook/addon-viewport": "^5.3.14",
|
|
40
40
|
"@storybook/react": "^5.3.14",
|
|
41
|
+
"babel-core": "^6.26.3",
|
|
42
|
+
"babel-loader": "^8.1.0",
|
|
43
|
+
"babel-preset-env": "^1.7.0",
|
|
44
|
+
"babel-preset-react": "^6.24.1",
|
|
41
45
|
"eslint": "^6.8.0",
|
|
42
46
|
"eslint-config-prettier": "^6.11.0",
|
|
43
47
|
"eslint-plugin-babel": "^5.3.0",
|
|
@@ -81,6 +85,6 @@
|
|
|
81
85
|
"ramda": "^0.27.0",
|
|
82
86
|
"react-aria-modal": "^4.0.0",
|
|
83
87
|
"react-pose": "^4.0.10",
|
|
84
|
-
"redux-freeform": "^5.
|
|
88
|
+
"redux-freeform": "^5.5.0"
|
|
85
89
|
}
|
|
86
90
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import Title from "../title";
|
|
3
3
|
import { Box } from "../layouts";
|
|
4
4
|
import { fallbackValues } from "./AmountCallout.theme";
|
|
5
5
|
import { themeComponent } from "../../../util/themeUtils";
|
|
@@ -7,21 +7,15 @@ import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
|
|
|
7
7
|
|
|
8
8
|
const AmountCallout = ({ amount, textAlign, themeValues }) => (
|
|
9
9
|
<Box padding="0" textAlign={textAlign}>
|
|
10
|
-
<
|
|
11
|
-
variant="
|
|
10
|
+
<Title
|
|
11
|
+
variant="small"
|
|
12
12
|
weight={FONT_WEIGHT_SEMIBOLD}
|
|
13
|
-
fontSize={themeValues.fontSize}
|
|
14
13
|
color={themeValues.color}
|
|
15
|
-
|
|
14
|
+
as="p"
|
|
16
15
|
>
|
|
17
16
|
{amount}
|
|
18
|
-
</
|
|
17
|
+
</Title>
|
|
19
18
|
</Box>
|
|
20
19
|
);
|
|
21
20
|
|
|
22
|
-
export default themeComponent(
|
|
23
|
-
AmountCallout,
|
|
24
|
-
"AmountCallout",
|
|
25
|
-
fallbackValues,
|
|
26
|
-
"medium"
|
|
27
|
-
);
|
|
21
|
+
export default themeComponent(AmountCallout, "AmountCallout", fallbackValues);
|
|
@@ -3,15 +3,6 @@ import { text, select } from "@storybook/addon-knobs";
|
|
|
3
3
|
import AmountCallout from "./AmountCallout";
|
|
4
4
|
import page from "../../../../.storybook/page";
|
|
5
5
|
|
|
6
|
-
const variantsLabel = "variant";
|
|
7
|
-
const variants = {
|
|
8
|
-
small: "small",
|
|
9
|
-
medium: "medium",
|
|
10
|
-
large: "large",
|
|
11
|
-
None: undefined
|
|
12
|
-
};
|
|
13
|
-
const defaultValue = "large";
|
|
14
|
-
|
|
15
6
|
const textAlignLabel = "textAlign";
|
|
16
7
|
const textAlign = {
|
|
17
8
|
left: "left",
|
|
@@ -23,7 +14,6 @@ const groupId = "props";
|
|
|
23
14
|
|
|
24
15
|
export const amountCallout = () => (
|
|
25
16
|
<AmountCallout
|
|
26
|
-
variant={select(variantsLabel, variants, defaultValue, groupId)}
|
|
27
17
|
amount={text("text", "$1.23", "props")}
|
|
28
18
|
textAlign={select(
|
|
29
19
|
textAlignLabel,
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
const fontSize = {
|
|
2
|
-
large: "1.5rem",
|
|
3
|
-
medium: "1.25rem",
|
|
4
|
-
small: "1.094rem"
|
|
5
|
-
};
|
|
6
|
-
|
|
7
1
|
const color = "#15749D";
|
|
8
2
|
|
|
9
|
-
const lineHeight = {
|
|
10
|
-
large: "2rem",
|
|
11
|
-
medium: "1.875rem",
|
|
12
|
-
small: "1.641rem"
|
|
13
|
-
};
|
|
14
|
-
|
|
15
3
|
export const fallbackValues = {
|
|
16
|
-
|
|
17
|
-
color,
|
|
18
|
-
lineHeight
|
|
4
|
+
color
|
|
19
5
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
// Comments assume desktop base font size of 16px, mobile base font size of 14px
|
|
2
|
+
|
|
1
3
|
const fontSize = {
|
|
2
|
-
large: "1.125rem",
|
|
3
|
-
regular: "1rem",
|
|
4
|
-
small: "0.875rem",
|
|
5
|
-
extraSmall: "0.75rem"
|
|
4
|
+
large: "1.125rem", // 18px (at base font size of 16)
|
|
5
|
+
regular: "1rem", // 16px
|
|
6
|
+
small: "0.875rem", // 14px
|
|
7
|
+
extraSmall: "0.75rem" // 12px
|
|
6
8
|
};
|
|
7
9
|
|
|
8
10
|
const fontFamily = {
|
|
@@ -13,10 +15,10 @@ const fontFamily = {
|
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
const mobileFontSize = {
|
|
16
|
-
large: "1.14285rem",
|
|
17
|
-
regular: "1",
|
|
18
|
-
small: "0.85714rem",
|
|
19
|
-
extraSmall: "0.71428rem"
|
|
18
|
+
large: "1.14285rem", // 16px (at base font size of 14)
|
|
19
|
+
regular: "1", // 14px
|
|
20
|
+
small: "0.85714rem", // 12px
|
|
21
|
+
extraSmall: "0.71428rem" // 10px
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
export const fallbackValues = {
|
|
@@ -92,7 +92,8 @@ const Dropdown = ({
|
|
|
92
92
|
themeValues,
|
|
93
93
|
maxHeight,
|
|
94
94
|
widthFitOptions = false,
|
|
95
|
-
disabled
|
|
95
|
+
disabled,
|
|
96
|
+
hasTitles = false
|
|
96
97
|
}) => {
|
|
97
98
|
const [inputValue, setInputValue] = useState("");
|
|
98
99
|
const [optionsState, setOptionsState] = useState([]);
|
|
@@ -113,6 +114,9 @@ const Dropdown = ({
|
|
|
113
114
|
const optionRefs = useRef([...Array(options.length)].map(() => createRef()));
|
|
114
115
|
const dropdownRef = useRef(null);
|
|
115
116
|
|
|
117
|
+
const getSelection = () =>
|
|
118
|
+
value ? options.find(option => option.value === value)?.text : placeholder;
|
|
119
|
+
|
|
116
120
|
const onKeyDown = e => {
|
|
117
121
|
const { key, keyCode } = e;
|
|
118
122
|
const focus = document.activeElement;
|
|
@@ -210,6 +214,7 @@ const Dropdown = ({
|
|
|
210
214
|
background-color: #f7f7f7;
|
|
211
215
|
pointer-events: none;`
|
|
212
216
|
}
|
|
217
|
+
title={hasTitles ? getSelection() : null}
|
|
213
218
|
>
|
|
214
219
|
<Box
|
|
215
220
|
as="button"
|
|
@@ -253,9 +258,7 @@ const Dropdown = ({
|
|
|
253
258
|
pointer-events: none;`
|
|
254
259
|
}
|
|
255
260
|
>
|
|
256
|
-
{
|
|
257
|
-
? options.find(option => option.value === value)?.text
|
|
258
|
-
: placeholder}
|
|
261
|
+
{getSelection()}
|
|
259
262
|
</Text>
|
|
260
263
|
)}
|
|
261
264
|
<IconWrapper open={isOpen}>
|
|
@@ -287,6 +290,7 @@ const Dropdown = ({
|
|
|
287
290
|
disabled={disabledValues.includes(choice.value)}
|
|
288
291
|
data-qa={choice.text}
|
|
289
292
|
themeValues={themeValues}
|
|
293
|
+
title={hasTitles ? choice.text : null}
|
|
290
294
|
>
|
|
291
295
|
<Text
|
|
292
296
|
variant="p"
|
|
@@ -15,7 +15,7 @@ const InputField = styled.input`
|
|
|
15
15
|
? ERROR_COLOR
|
|
16
16
|
: themeValues.borderColor};
|
|
17
17
|
border-radius: 2px;
|
|
18
|
-
height: ${({ customHeight }) => (customHeight ? customHeight : "48px")};
|
|
18
|
+
height: ${({ $customHeight }) => ($customHeight ? $customHeight : "48px")};
|
|
19
19
|
width: 100%;
|
|
20
20
|
padding: 1rem;
|
|
21
21
|
min-width: 100px;
|
|
@@ -47,9 +47,9 @@ const InputField = styled.input`
|
|
|
47
47
|
background-color: #f7f7f7;
|
|
48
48
|
`}
|
|
49
49
|
|
|
50
|
-
${({ extraStyles }) =>
|
|
50
|
+
${({ $extraStyles }) =>
|
|
51
51
|
css`
|
|
52
|
-
${extraStyles}
|
|
52
|
+
${$extraStyles}
|
|
53
53
|
`}
|
|
54
54
|
`;
|
|
55
55
|
|
|
@@ -63,7 +63,7 @@ const FormattedInputField = styled(({ showErrors, themeValues, ...props }) => (
|
|
|
63
63
|
? ERROR_COLOR
|
|
64
64
|
: themeValues.borderColor};
|
|
65
65
|
border-radius: 2px;
|
|
66
|
-
height: ${({ customHeight }) => (customHeight ? customHeight : "48px")};
|
|
66
|
+
height: ${({ $customHeight }) => ($customHeight ? $customHeight : "48px")};
|
|
67
67
|
width: 100%;
|
|
68
68
|
padding: 1rem;
|
|
69
69
|
min-width: 100px;
|
|
@@ -199,8 +199,8 @@ const FormInput = ({
|
|
|
199
199
|
showErrors={showErrors}
|
|
200
200
|
data-qa={labelTextWhenNoError}
|
|
201
201
|
themeValues={themeValues}
|
|
202
|
-
customHeight={customHeight}
|
|
203
|
-
extraStyles={extraStyles}
|
|
202
|
+
$customHeight={customHeight}
|
|
203
|
+
$extraStyles={extraStyles}
|
|
204
204
|
{...props}
|
|
205
205
|
/>
|
|
206
206
|
) : (
|
|
@@ -216,8 +216,8 @@ const FormInput = ({
|
|
|
216
216
|
data-qa={labelTextWhenNoError}
|
|
217
217
|
themeValues={themeValues}
|
|
218
218
|
background={background}
|
|
219
|
-
customHeight={customHeight}
|
|
220
|
-
extraStyles={extraStyles}
|
|
219
|
+
$customHeight={customHeight}
|
|
220
|
+
$extraStyles={extraStyles}
|
|
221
221
|
{...props}
|
|
222
222
|
/>
|
|
223
223
|
)}
|
|
@@ -18,7 +18,8 @@ const FormSelect = ({
|
|
|
18
18
|
dropdownMaxHeight,
|
|
19
19
|
disabledValues,
|
|
20
20
|
disabled,
|
|
21
|
-
themeValues
|
|
21
|
+
themeValues,
|
|
22
|
+
hasTitles = false
|
|
22
23
|
}) => {
|
|
23
24
|
const [open, setOpen] = useState(false);
|
|
24
25
|
const dropdownRef = useRef(null);
|
|
@@ -59,6 +60,7 @@ const FormSelect = ({
|
|
|
59
60
|
<Dropdown
|
|
60
61
|
aria-labelledby={labelTextWhenNoError.replace(/\s+/g, "-")}
|
|
61
62
|
maxHeight={dropdownMaxHeight}
|
|
63
|
+
hasTitles={hasTitles}
|
|
62
64
|
placeholder={options[0] ? options[0].text : ""}
|
|
63
65
|
options={options}
|
|
64
66
|
value={field.rawValue}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React, { Fragment } from "react";
|
|
2
2
|
import { BoxWrapper } from "./Box.styled";
|
|
3
|
-
import { safeChildren } from "../../../util/general";
|
|
3
|
+
import { safeChildren, screenReaderOnlyStyle } from "../../../util/general";
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Box component to create generic boxes
|
|
7
7
|
Supply padding, border, background, and color values
|
|
8
|
+
|
|
9
|
+
srOnly prop enables special screen-reader style that is used to position content
|
|
10
|
+
completely off screen (only for users of screen readers)
|
|
8
11
|
*/
|
|
9
12
|
|
|
10
13
|
const Box = ({
|
|
@@ -37,6 +40,7 @@ const Box = ({
|
|
|
37
40
|
theme,
|
|
38
41
|
hiddenStyles,
|
|
39
42
|
extraStyles,
|
|
43
|
+
srOnly = false,
|
|
40
44
|
dataQa,
|
|
41
45
|
children,
|
|
42
46
|
...rest
|
|
@@ -63,7 +67,9 @@ const Box = ({
|
|
|
63
67
|
onClick={onClick}
|
|
64
68
|
hiddenStyles={hiddenStyles}
|
|
65
69
|
onKeyDown={onKeyDown}
|
|
66
|
-
extraStyles={
|
|
70
|
+
extraStyles={
|
|
71
|
+
srOnly ? `${screenReaderOnlyStyle}${extraStyles}` : extraStyles
|
|
72
|
+
}
|
|
67
73
|
theme={theme}
|
|
68
74
|
textAlign={textAlign}
|
|
69
75
|
data-qa={dataQa}
|
|
@@ -29,10 +29,10 @@ const Cluster = ({
|
|
|
29
29
|
<ClusterWrapper
|
|
30
30
|
overflow={overflow}
|
|
31
31
|
{...rest}
|
|
32
|
-
justifySelf={justifySelf}
|
|
33
|
-
alignSelf={alignSelf}
|
|
34
|
-
flexGrow={flexGrow}
|
|
35
|
-
extraStyles={extraStyles}
|
|
32
|
+
$justifySelf={justifySelf}
|
|
33
|
+
$alignSelf={alignSelf}
|
|
34
|
+
$flexGrow={flexGrow}
|
|
35
|
+
$extraStyles={extraStyles}
|
|
36
36
|
>
|
|
37
37
|
<ClusterInnerWrapper
|
|
38
38
|
justify={justify}
|
|
@@ -7,10 +7,10 @@ export const ClusterWrapper = styled(({ overflow, ...props }) => (
|
|
|
7
7
|
))`
|
|
8
8
|
overflow: ${({ overflow }) => (overflow ? "visible" : "hidden")};
|
|
9
9
|
box-sizing: border-box;
|
|
10
|
-
justify-self: ${({ justifySelf }) => justifySelf};
|
|
11
|
-
align-self: ${({ alignSelf }) => alignSelf};
|
|
12
|
-
flex-grow: ${({ flexGrow }) => flexGrow};
|
|
13
|
-
${({ extraStyles }) => extraStyles};
|
|
10
|
+
justify-self: ${({ $justifySelf }) => $justifySelf};
|
|
11
|
+
align-self: ${({ $alignSelf }) => $alignSelf};
|
|
12
|
+
flex-grow: ${({ $flexGrow }) => $flexGrow};
|
|
13
|
+
${({ $extraStyles }) => $extraStyles};
|
|
14
14
|
`;
|
|
15
15
|
|
|
16
16
|
export const ClusterInnerWrapper = styled.div`
|
|
@@ -23,7 +23,7 @@ export const navFooter = () => (
|
|
|
23
23
|
<NavFooter
|
|
24
24
|
leftContent={<Left />}
|
|
25
25
|
rightContent={<Right />}
|
|
26
|
-
headerHeight={text("headerHeight", "105px", "props")}
|
|
26
|
+
$headerHeight={text("headerHeight", "105px", "props")}
|
|
27
27
|
backgroundColor={select("activeColor", colors, "white", "props")}
|
|
28
28
|
footerPadding={text("footerPadding", "1.5rem 1rem", "props")}
|
|
29
29
|
isMobile={boolean("isMobile", false, "props")}
|
|
@@ -7,13 +7,15 @@ const fontFamily = {
|
|
|
7
7
|
pXL: "Public Sans"
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
+
// Comments assume base font size of 16px
|
|
11
|
+
|
|
10
12
|
const fontSize = {
|
|
11
|
-
p: "1rem",
|
|
12
|
-
pL: "1.125rem",
|
|
13
|
-
pS: "0.875rem",
|
|
14
|
-
pXS: "0.75rem",
|
|
15
|
-
pXXS: "0.65rem",
|
|
16
|
-
pXL: "1.5rem"
|
|
13
|
+
p: "1rem", // 16px
|
|
14
|
+
pL: "1.125rem", // 18px
|
|
15
|
+
pS: "0.875rem", // 14px
|
|
16
|
+
pXS: "0.75rem", // 12px
|
|
17
|
+
pXXS: "0.65rem", // 10px
|
|
18
|
+
pXL: "1.5rem" // 24px
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
export const fallbackValues = {
|
|
@@ -11,13 +11,15 @@ const fontFamily = {
|
|
|
11
11
|
// Use a Paragraph if you want a block level element
|
|
12
12
|
// Use a Text if you want an inline element
|
|
13
13
|
|
|
14
|
+
// Comments assume base font size of 16px
|
|
15
|
+
|
|
14
16
|
const fontSize = {
|
|
15
|
-
p: "1rem",
|
|
16
|
-
pL: "1.125rem",
|
|
17
|
-
pS: "0.875rem",
|
|
18
|
-
pXS: "0.75rem",
|
|
19
|
-
pXXS: "0.65rem",
|
|
20
|
-
pXL: "1.5rem"
|
|
17
|
+
p: "1rem", // 16px
|
|
18
|
+
pL: "1.125rem", // 18px
|
|
19
|
+
pS: "0.875rem", // 14px
|
|
20
|
+
pXS: "0.75rem", // 12px
|
|
21
|
+
pXXS: "0.65rem", // 10px
|
|
22
|
+
pXL: "1.5rem" // 24px
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
export const fallbackValues = {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
// Comments assume desktop base font size of 16px, mobile base font size of 14px
|
|
2
|
+
|
|
1
3
|
const fontSize = {
|
|
2
|
-
large: "1.5rem",
|
|
3
|
-
small: "1.25rem"
|
|
4
|
+
large: "1.5rem", // 24px (at base font size of 16px)
|
|
5
|
+
small: "1.25rem" // 20px
|
|
4
6
|
};
|
|
5
7
|
|
|
6
8
|
const fontFamily = {
|
|
@@ -9,8 +11,8 @@ const fontFamily = {
|
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
const mobileFontSize = {
|
|
12
|
-
large: "1.5rem",
|
|
13
|
-
small: "1.2142rem"
|
|
14
|
+
large: "1.5rem", // 21px (at base font size of 14px)
|
|
15
|
+
small: "1.2142rem" // 17px
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
export const fallbackValues = {
|
|
@@ -33,3 +33,4 @@ export { default as TermsAndConditionsModal } from "./terms-and-conditions-modal
|
|
|
33
33
|
export { default as Timeout } from "./timeout";
|
|
34
34
|
export { default as WelcomeModule } from "./welcome-module";
|
|
35
35
|
export { default as WorkflowTile } from "./workflow-tile";
|
|
36
|
+
export { default as PeriscopeDashboardIframe } from "./periscope-dashboard-iframe";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Box, Cluster, Stack } from "../../../components/atoms/layouts";
|
|
3
|
-
import { WHITE,
|
|
3
|
+
import { WHITE, BRIGHT_GREY, ATHENS_GREY } from "../../../constants/colors";
|
|
4
4
|
import {
|
|
5
5
|
IconModule,
|
|
6
6
|
TitleModule,
|
|
7
7
|
AmountModule,
|
|
8
|
-
PaymentDetailsActions
|
|
8
|
+
PaymentDetailsActions,
|
|
9
|
+
InactiveControlsModule,
|
|
10
|
+
InactiveTitleModule
|
|
9
11
|
} from "./modules";
|
|
10
12
|
|
|
11
13
|
const Obligation = ({
|
|
@@ -21,15 +23,24 @@ const Obligation = ({
|
|
|
21
23
|
navigateToSettings,
|
|
22
24
|
isMobile,
|
|
23
25
|
isPaymentPlan,
|
|
24
|
-
nextAutopayDate
|
|
26
|
+
nextAutopayDate,
|
|
27
|
+
obligationAssocID,
|
|
28
|
+
isActive = true,
|
|
29
|
+
inactiveLookupTitle = "",
|
|
30
|
+
inactiveLookupInput = "Account",
|
|
31
|
+
inactiveLookupValue = ""
|
|
25
32
|
}) => {
|
|
26
33
|
const obligation = obligations[0];
|
|
27
34
|
const { customAttributes } = obligation;
|
|
28
|
-
|
|
35
|
+
const boxShadowValue =
|
|
36
|
+
"0px 4px 4px rgba(41, 42, 51, 0.1), 0px 1px 1px 2px rgba(41, 42, 51, 0.1);";
|
|
37
|
+
const activeObligation = (
|
|
29
38
|
<Box
|
|
30
39
|
padding="0"
|
|
31
40
|
borderRadius="4px"
|
|
32
|
-
boxShadow={
|
|
41
|
+
boxShadow={boxShadowValue}
|
|
42
|
+
as="section"
|
|
43
|
+
aria-label={`${obligation.description} ${obligation.subDescription}`}
|
|
33
44
|
>
|
|
34
45
|
<Box background={WHITE}>
|
|
35
46
|
<Stack childGap="14px">
|
|
@@ -115,6 +126,78 @@ const Obligation = ({
|
|
|
115
126
|
)}
|
|
116
127
|
</Box>
|
|
117
128
|
);
|
|
129
|
+
|
|
130
|
+
const inactiveObligation = (
|
|
131
|
+
<Box
|
|
132
|
+
padding="0"
|
|
133
|
+
borderRadius="4px"
|
|
134
|
+
boxShadow={boxShadowValue}
|
|
135
|
+
as="section"
|
|
136
|
+
aria-label={`${inactiveLookupTitle} ${inactiveLookupInput}: ${inactiveLookupValue}`}
|
|
137
|
+
>
|
|
138
|
+
<Box background={ATHENS_GREY}>
|
|
139
|
+
<Stack childGap="14px">
|
|
140
|
+
<Box key={`${obligations[0].id}-top`} padding="0 8px" minWidth="100%">
|
|
141
|
+
<Cluster
|
|
142
|
+
justify="space-between"
|
|
143
|
+
align="center"
|
|
144
|
+
childGap="4px"
|
|
145
|
+
nowrap
|
|
146
|
+
>
|
|
147
|
+
<Box padding="0">
|
|
148
|
+
<Cluster justify="flex-start" align="center">
|
|
149
|
+
<IconModule
|
|
150
|
+
icon={config.icon}
|
|
151
|
+
iconDefault={config.iconDefault}
|
|
152
|
+
configIconMap={config.iconMap}
|
|
153
|
+
iconValue={config.iconValue}
|
|
154
|
+
customAttributes={customAttributes}
|
|
155
|
+
/>
|
|
156
|
+
<InactiveTitleModule
|
|
157
|
+
title={inactiveLookupTitle}
|
|
158
|
+
subtitle={`${inactiveLookupInput}: ${inactiveLookupValue}`}
|
|
159
|
+
titleColor={BRIGHT_GREY}
|
|
160
|
+
autoPayEnabled={autoPayEnabled}
|
|
161
|
+
isMobile={isMobile}
|
|
162
|
+
/>
|
|
163
|
+
</Cluster>
|
|
164
|
+
</Box>
|
|
165
|
+
{!isMobile && (
|
|
166
|
+
<InactiveControlsModule
|
|
167
|
+
obligations={obligations}
|
|
168
|
+
autoPayEnabled={autoPayEnabled}
|
|
169
|
+
deactivatePaymentSchedule={deactivatePaymentSchedule}
|
|
170
|
+
autoPaySchedule={autoPaySchedule}
|
|
171
|
+
paymentPlanSchedule={paymentPlanSchedule}
|
|
172
|
+
config={config}
|
|
173
|
+
actions={actions}
|
|
174
|
+
isMobile={isMobile}
|
|
175
|
+
nextAutopayDate={nextAutopayDate}
|
|
176
|
+
obligationAssocID={obligationAssocID}
|
|
177
|
+
/>
|
|
178
|
+
)}
|
|
179
|
+
</Cluster>
|
|
180
|
+
</Box>
|
|
181
|
+
{isMobile && (
|
|
182
|
+
<InactiveControlsModule
|
|
183
|
+
obligations={obligations}
|
|
184
|
+
autoPayEnabled={autoPayEnabled}
|
|
185
|
+
deactivatePaymentSchedule={deactivatePaymentSchedule}
|
|
186
|
+
autoPaySchedule={autoPaySchedule}
|
|
187
|
+
paymentPlanSchedule={paymentPlanSchedule}
|
|
188
|
+
config={config}
|
|
189
|
+
actions={actions}
|
|
190
|
+
isMobile={isMobile}
|
|
191
|
+
nextAutopayDate={nextAutopayDate}
|
|
192
|
+
obligationAssocID={obligationAssocID}
|
|
193
|
+
/>
|
|
194
|
+
)}
|
|
195
|
+
</Stack>
|
|
196
|
+
</Box>
|
|
197
|
+
</Box>
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
return isActive ? activeObligation : inactiveObligation;
|
|
118
201
|
};
|
|
119
202
|
|
|
120
203
|
export default Obligation;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { GHOST_GREY } from "../../../../constants/colors";
|
|
3
|
+
import ButtonWithAction from "../../../atoms/button-with-action";
|
|
4
|
+
import { Box, Cluster } from "../../../atoms/layouts";
|
|
5
|
+
import { AutopayModalModule } from "./AutopayModalModule";
|
|
6
|
+
|
|
7
|
+
const InactiveControlsModule = ({
|
|
8
|
+
autoPayEnabled,
|
|
9
|
+
autoPaySchedule,
|
|
10
|
+
navigateToSettings,
|
|
11
|
+
deactivatePaymentSchedule,
|
|
12
|
+
isMobile,
|
|
13
|
+
paymentPlanSchedule,
|
|
14
|
+
isPaymentPlan,
|
|
15
|
+
nextAutopayDate,
|
|
16
|
+
obligationAssocID,
|
|
17
|
+
actions
|
|
18
|
+
}) => {
|
|
19
|
+
const [modalOpen, toggleModal] = useState(false);
|
|
20
|
+
const { removeAccount } = actions;
|
|
21
|
+
const handleRemoveAccount = () => removeAccount(obligationAssocID);
|
|
22
|
+
return (
|
|
23
|
+
<Box
|
|
24
|
+
padding={isMobile ? "18px 0 0 0" : "0"}
|
|
25
|
+
border={isMobile ? `1px solid ${GHOST_GREY}` : `0px`}
|
|
26
|
+
borderWidthOverride={isMobile ? `1px 0 0 0` : `0px`}
|
|
27
|
+
>
|
|
28
|
+
<Cluster childGap={isMobile ? `8px` : `18px`}>
|
|
29
|
+
{autoPayEnabled && (
|
|
30
|
+
<Box padding="0" extraStyles={`flex-grow: 1;`}>
|
|
31
|
+
<AutopayModalModule
|
|
32
|
+
autoPayActive={autoPayEnabled}
|
|
33
|
+
autoPaySchedule={autoPaySchedule}
|
|
34
|
+
toggleModal={toggleModal}
|
|
35
|
+
modalOpen={modalOpen}
|
|
36
|
+
navigateToSettings={navigateToSettings}
|
|
37
|
+
deactivatePaymentSchedule={deactivatePaymentSchedule}
|
|
38
|
+
buttonLinkType
|
|
39
|
+
isMobile={isMobile}
|
|
40
|
+
paymentPlanSchedule={paymentPlanSchedule}
|
|
41
|
+
isPaymentPlan={isPaymentPlan}
|
|
42
|
+
nextAutopayDate={nextAutopayDate}
|
|
43
|
+
obligationAssocID={obligationAssocID}
|
|
44
|
+
/>
|
|
45
|
+
</Box>
|
|
46
|
+
)}
|
|
47
|
+
<Box padding="0" extraStyles={`flex-grow: 1;`}>
|
|
48
|
+
<ButtonWithAction
|
|
49
|
+
variant="tertiary"
|
|
50
|
+
text="Remove"
|
|
51
|
+
action={handleRemoveAccount}
|
|
52
|
+
dataQa="Remove Account"
|
|
53
|
+
extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
|
|
54
|
+
/>
|
|
55
|
+
</Box>
|
|
56
|
+
</Cluster>
|
|
57
|
+
</Box>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default InactiveControlsModule;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Stack } from "../../../atoms/layouts";
|
|
3
|
+
import Title from "../../../atoms/title";
|
|
4
|
+
import Detail from "../../../atoms/detail";
|
|
5
|
+
import { BLACK, CHARADE_GREY, ZEST_ORANGE } from "../../../../constants/colors";
|
|
6
|
+
import { FONT_WEIGHT_SEMIBOLD } from "../../../../constants/style_constants";
|
|
7
|
+
|
|
8
|
+
const InactiveTitleModule = ({ title, subtitle, autoPayEnabled }) => (
|
|
9
|
+
<Box padding="0">
|
|
10
|
+
<Stack childGap="0">
|
|
11
|
+
<Title
|
|
12
|
+
variant="small"
|
|
13
|
+
as="h4"
|
|
14
|
+
color={CHARADE_GREY}
|
|
15
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
16
|
+
>
|
|
17
|
+
{title}
|
|
18
|
+
</Title>
|
|
19
|
+
<Detail variant="small" as="h5" color={CHARADE_GREY}>
|
|
20
|
+
{subtitle}
|
|
21
|
+
</Detail>
|
|
22
|
+
<Detail
|
|
23
|
+
variant="small"
|
|
24
|
+
as="p"
|
|
25
|
+
color={ZEST_ORANGE}
|
|
26
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
27
|
+
>
|
|
28
|
+
Unable to load account details
|
|
29
|
+
</Detail>
|
|
30
|
+
<Detail variant="extraSmall" as="p" color={BLACK}>
|
|
31
|
+
{`This may mean that the account has been paid off or there was an error loading it. If you have questions about this account, please contact us.${
|
|
32
|
+
autoPayEnabled
|
|
33
|
+
? " You may disable Autopay for this account by pressing the Turn off Autopay button."
|
|
34
|
+
: ""
|
|
35
|
+
}`}
|
|
36
|
+
</Detail>
|
|
37
|
+
</Stack>
|
|
38
|
+
</Box>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export default InactiveTitleModule;
|