@thecb/components 7.10.0-beta.0 → 7.10.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 +353 -257
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +353 -258
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +101 -96
- package/src/components/atoms/icons/PencilIcon.js +22 -0
- package/src/components/atoms/icons/icons.stories.js +2 -0
- package/src/components/atoms/icons/index.js +2 -0
- package/src/components/atoms/layouts/Box.styled.js +2 -2
- package/src/components/atoms/layouts/Cluster.d.ts +1 -0
- package/src/components/atoms/layouts/Cluster.js +2 -0
- package/src/components/atoms/line-item/LineItem.js +15 -1
- package/src/components/atoms/line-item/LineItem.stories.js +9 -0
- package/src/components/molecules/nav-menu/NavMenuMobile.js +3 -1
- package/src/components/molecules/pagination/Pagination.js +44 -20
- package/src/components/molecules/pagination/index.d.ts +1 -0
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +35 -8
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +37 -10
- package/src/components/molecules/terms-and-conditions/TermsAndConditions.js +3 -1
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.js +3 -2
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js +10 -0
- package/src/components/molecules/workflow-tile/WorkflowTile.js +14 -35
- package/src/constants/colors.js +6 -0
- package/src/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- /package/src/components/atoms/icons/{ExternalLinkicon.js → ExternalLinkIcon.js} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
WHITE,
|
|
3
|
+
TRANSPARENT,
|
|
4
|
+
SAPPHIRE_BLUE,
|
|
5
|
+
PEACOCK_BLUE,
|
|
6
|
+
MATISSE_BLUE,
|
|
7
|
+
RASPBERRY,
|
|
8
|
+
ERROR_COLOR
|
|
9
|
+
} from "../../../constants/colors";
|
|
5
10
|
|
|
6
11
|
const padding = {
|
|
7
12
|
primary: "0.75rem 1.5rem",
|
|
@@ -19,18 +24,18 @@ const padding = {
|
|
|
19
24
|
};
|
|
20
25
|
|
|
21
26
|
const color = {
|
|
22
|
-
primary:
|
|
23
|
-
secondary:
|
|
24
|
-
back:
|
|
25
|
-
smallPrimary:
|
|
26
|
-
smallSecondary:
|
|
27
|
-
smallGhost:
|
|
28
|
-
ghost:
|
|
29
|
-
tertiary:
|
|
30
|
-
danger:
|
|
31
|
-
dangerSecondary:
|
|
32
|
-
whiteSecondary:
|
|
33
|
-
whitePrimary:
|
|
27
|
+
primary: WHITE,
|
|
28
|
+
secondary: MATISSE_BLUE,
|
|
29
|
+
back: MATISSE_BLUE,
|
|
30
|
+
smallPrimary: WHITE,
|
|
31
|
+
smallSecondary: MATISSE_BLUE,
|
|
32
|
+
smallGhost: MATISSE_BLUE,
|
|
33
|
+
ghost: MATISSE_BLUE,
|
|
34
|
+
tertiary: MATISSE_BLUE,
|
|
35
|
+
danger: WHITE,
|
|
36
|
+
dangerSecondary: ERROR_COLOR,
|
|
37
|
+
whiteSecondary: WHITE,
|
|
38
|
+
whitePrimary: WHITE
|
|
34
39
|
};
|
|
35
40
|
|
|
36
41
|
const fontSizeVariant = {
|
|
@@ -94,123 +99,123 @@ const minWidth = {
|
|
|
94
99
|
};
|
|
95
100
|
|
|
96
101
|
const backgroundColor = {
|
|
97
|
-
primary:
|
|
98
|
-
secondary:
|
|
99
|
-
back:
|
|
100
|
-
smallPrimary:
|
|
101
|
-
smallSecondary:
|
|
102
|
-
smallGhost:
|
|
103
|
-
ghost:
|
|
104
|
-
tertiary:
|
|
105
|
-
danger:
|
|
106
|
-
dangerSecondary:
|
|
107
|
-
whiteSecondary:
|
|
108
|
-
whitePrimary:
|
|
102
|
+
primary: MATISSE_BLUE,
|
|
103
|
+
secondary: TRANSPARENT,
|
|
104
|
+
back: TRANSPARENT,
|
|
105
|
+
smallPrimary: MATISSE_BLUE,
|
|
106
|
+
smallSecondary: TRANSPARENT,
|
|
107
|
+
smallGhost: TRANSPARENT,
|
|
108
|
+
ghost: TRANSPARENT,
|
|
109
|
+
tertiary: TRANSPARENT,
|
|
110
|
+
danger: RASPBERRY,
|
|
111
|
+
dangerSecondary: TRANSPARENT,
|
|
112
|
+
whiteSecondary: TRANSPARENT,
|
|
113
|
+
whitePrimary: TRANSPARENT
|
|
109
114
|
};
|
|
110
115
|
|
|
111
116
|
const border = {
|
|
112
|
-
primary: "2px solid
|
|
113
|
-
secondary: "2px solid
|
|
114
|
-
back: "2px solid
|
|
115
|
-
smallPrimary: "2px solid
|
|
116
|
-
smallSecondary: "2px solid
|
|
117
|
+
primary: "2px solid " + MATISSE_BLUE,
|
|
118
|
+
secondary: "2px solid " + MATISSE_BLUE,
|
|
119
|
+
back: "2px solid " + MATISSE_BLUE,
|
|
120
|
+
smallPrimary: "2px solid " + MATISSE_BLUE,
|
|
121
|
+
smallSecondary: "2px solid " + MATISSE_BLUE,
|
|
117
122
|
smallGhost: "none",
|
|
118
123
|
ghost: "none",
|
|
119
124
|
tertiary: "none",
|
|
120
|
-
danger: "2px solid
|
|
121
|
-
dangerSecondary: "2px solid
|
|
122
|
-
whiteSecondary: "2px solid
|
|
123
|
-
whitePrimary: "2px solid
|
|
125
|
+
danger: "2px solid " + RASPBERRY,
|
|
126
|
+
dangerSecondary: "2px solid " + ERROR_COLOR,
|
|
127
|
+
whiteSecondary: "2px solid " + WHITE,
|
|
128
|
+
whitePrimary: "2px solid " + TRANSPARENT
|
|
124
129
|
};
|
|
125
130
|
|
|
126
131
|
const hoverBackgroundColor = {
|
|
127
|
-
primary:
|
|
132
|
+
primary: SAPPHIRE_BLUE,
|
|
128
133
|
secondary: "#DBEAF0",
|
|
129
|
-
back:
|
|
130
|
-
smallPrimary:
|
|
134
|
+
back: TRANSPARENT,
|
|
135
|
+
smallPrimary: SAPPHIRE_BLUE,
|
|
131
136
|
smallSecondary: "#DBEAF0",
|
|
132
|
-
smallGhost:
|
|
133
|
-
ghost:
|
|
134
|
-
tertiary:
|
|
137
|
+
smallGhost: TRANSPARENT,
|
|
138
|
+
ghost: TRANSPARENT,
|
|
139
|
+
tertiary: TRANSPARENT,
|
|
135
140
|
danger: "#BA002C",
|
|
136
|
-
dangerSecondary: "
|
|
137
|
-
whiteSecondary:
|
|
138
|
-
whitePrimary:
|
|
141
|
+
dangerSecondary: "#FAE7EE",
|
|
142
|
+
whiteSecondary: TRANSPARENT,
|
|
143
|
+
whitePrimary: TRANSPARENT
|
|
139
144
|
};
|
|
140
145
|
|
|
141
146
|
const hoverBorderColor = {
|
|
142
|
-
primary:
|
|
143
|
-
secondary:
|
|
147
|
+
primary: SAPPHIRE_BLUE,
|
|
148
|
+
secondary: MATISSE_BLUE,
|
|
144
149
|
back: "#DCEAF1",
|
|
145
|
-
smallPrimary:
|
|
146
|
-
smallSecondary:
|
|
147
|
-
smallGhost:
|
|
148
|
-
ghost:
|
|
149
|
-
tertiary:
|
|
150
|
+
smallPrimary: SAPPHIRE_BLUE,
|
|
151
|
+
smallSecondary: MATISSE_BLUE,
|
|
152
|
+
smallGhost: TRANSPARENT,
|
|
153
|
+
ghost: TRANSPARENT,
|
|
154
|
+
tertiary: TRANSPARENT,
|
|
150
155
|
danger: "#BA002C",
|
|
151
156
|
dangerSecondary: "#B10541",
|
|
152
|
-
whiteSecondary: "2px solid
|
|
153
|
-
whitePrimary: "2px solid
|
|
157
|
+
whiteSecondary: "2px solid " + TRANSPARENT,
|
|
158
|
+
whitePrimary: "2px solid " + TRANSPARENT
|
|
154
159
|
};
|
|
155
160
|
|
|
156
161
|
const hoverColor = {
|
|
157
|
-
primary:
|
|
158
|
-
secondary:
|
|
159
|
-
back:
|
|
160
|
-
smallPrimary:
|
|
161
|
-
smallSecondary:
|
|
162
|
-
smallGhost:
|
|
163
|
-
ghost:
|
|
164
|
-
tertiary:
|
|
165
|
-
danger:
|
|
162
|
+
primary: WHITE,
|
|
163
|
+
secondary: SAPPHIRE_BLUE,
|
|
164
|
+
back: SAPPHIRE_BLUE,
|
|
165
|
+
smallPrimary: WHITE,
|
|
166
|
+
smallSecondary: SAPPHIRE_BLUE,
|
|
167
|
+
smallGhost: SAPPHIRE_BLUE,
|
|
168
|
+
ghost: SAPPHIRE_BLUE,
|
|
169
|
+
tertiary: SAPPHIRE_BLUE,
|
|
170
|
+
danger: WHITE,
|
|
166
171
|
dangerSecondary: "#B10541",
|
|
167
|
-
whiteSecondary:
|
|
168
|
-
whitePrimary:
|
|
172
|
+
whiteSecondary: WHITE,
|
|
173
|
+
whitePrimary: WHITE
|
|
169
174
|
};
|
|
170
175
|
|
|
171
176
|
const activeBackgroundColor = {
|
|
172
|
-
primary:
|
|
177
|
+
primary: PEACOCK_BLUE,
|
|
173
178
|
secondary: "#B8D5E1",
|
|
174
|
-
back:
|
|
175
|
-
smallPrimary:
|
|
179
|
+
back: TRANSPARENT,
|
|
180
|
+
smallPrimary: PEACOCK_BLUE,
|
|
176
181
|
smallSecondary: "#B8D5E1",
|
|
177
|
-
smallGhost:
|
|
178
|
-
ghost:
|
|
179
|
-
tertiary:
|
|
182
|
+
smallGhost: TRANSPARENT,
|
|
183
|
+
ghost: TRANSPARENT,
|
|
184
|
+
tertiary: TRANSPARENT,
|
|
180
185
|
danger: "#870000",
|
|
181
|
-
dangerSecondary: "
|
|
182
|
-
whiteSecondary:
|
|
183
|
-
whitePrimary:
|
|
186
|
+
dangerSecondary: "#FAE7EE",
|
|
187
|
+
whiteSecondary: TRANSPARENT,
|
|
188
|
+
whitePrimary: TRANSPARENT
|
|
184
189
|
};
|
|
185
190
|
|
|
186
191
|
const activeBorderColor = {
|
|
187
|
-
primary:
|
|
188
|
-
secondary:
|
|
189
|
-
back:
|
|
190
|
-
smallPrimary:
|
|
191
|
-
smallSecondary:
|
|
192
|
-
smallGhost:
|
|
193
|
-
ghost:
|
|
194
|
-
tertiary:
|
|
192
|
+
primary: PEACOCK_BLUE,
|
|
193
|
+
secondary: MATISSE_BLUE,
|
|
194
|
+
back: PEACOCK_BLUE,
|
|
195
|
+
smallPrimary: PEACOCK_BLUE,
|
|
196
|
+
smallSecondary: MATISSE_BLUE,
|
|
197
|
+
smallGhost: TRANSPARENT,
|
|
198
|
+
ghost: TRANSPARENT,
|
|
199
|
+
tertiary: TRANSPARENT,
|
|
195
200
|
danger: "#870000",
|
|
196
201
|
dangerSecondary: "#910029",
|
|
197
|
-
whiteSecondary: "2px solid
|
|
198
|
-
whitePrimary: "2px solid
|
|
202
|
+
whiteSecondary: "2px solid " + TRANSPARENT,
|
|
203
|
+
whitePrimary: "2px solid " + TRANSPARENT
|
|
199
204
|
};
|
|
200
205
|
|
|
201
206
|
const activeColor = {
|
|
202
|
-
primary:
|
|
203
|
-
secondary:
|
|
204
|
-
back:
|
|
205
|
-
smallPrimary:
|
|
206
|
-
smallSecondary:
|
|
207
|
-
smallGhost:
|
|
208
|
-
ghost:
|
|
209
|
-
tertiary:
|
|
210
|
-
danger:
|
|
207
|
+
primary: WHITE,
|
|
208
|
+
secondary: MATISSE_BLUE,
|
|
209
|
+
back: PEACOCK_BLUE,
|
|
210
|
+
smallPrimary: WHITE,
|
|
211
|
+
smallSecondary: PEACOCK_BLUE,
|
|
212
|
+
smallGhost: PEACOCK_BLUE,
|
|
213
|
+
ghost: PEACOCK_BLUE,
|
|
214
|
+
tertiary: PEACOCK_BLUE,
|
|
215
|
+
danger: WHITE,
|
|
211
216
|
dangerSecondary: "#910029",
|
|
212
|
-
whiteSecondary:
|
|
213
|
-
whitePrimary:
|
|
217
|
+
whiteSecondary: WHITE,
|
|
218
|
+
whitePrimary: WHITE
|
|
214
219
|
};
|
|
215
220
|
|
|
216
221
|
export const fallbackValues = {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { fallbackValues } from "./Icons.theme";
|
|
3
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
4
|
+
|
|
5
|
+
const PencilIcon = ({ ariaLabel = "Edit", themeValues }) => (
|
|
6
|
+
<svg
|
|
7
|
+
aria-label={ariaLabel}
|
|
8
|
+
width="24px"
|
|
9
|
+
height="24px"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fillRule="evenodd"
|
|
15
|
+
clipRule="evenodd"
|
|
16
|
+
d="M19.74 6.84a.885.885 0 0 1 0 1.253l-1.626 1.626-3.333-3.333 1.626-1.626a.885.885 0 0 1 1.253 0l2.08 2.08ZM4 20.5v-3.333l9.83-9.83 3.333 3.333-9.83 9.83H4Z"
|
|
17
|
+
fill={themeValues.subIconColor}
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export default themeComponent(PencilIcon, "Icons", fallbackValues, "info");
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
DuplicateIcon,
|
|
32
32
|
ErroredIcon,
|
|
33
33
|
FailedIcon,
|
|
34
|
+
PencilIcon,
|
|
34
35
|
PendingIcon,
|
|
35
36
|
RefundIcon,
|
|
36
37
|
RejectedIcon,
|
|
@@ -75,6 +76,7 @@ export const chargebackReversalIcon = () => <ChargebackReversalIcon />;
|
|
|
75
76
|
export const duplicateIcon = () => <DuplicateIcon />;
|
|
76
77
|
export const erroredIcon = () => <ErroredIcon />;
|
|
77
78
|
export const failedIcon = () => <FailedIcon />;
|
|
79
|
+
export const pencilIcon = () => <PencilIcon />;
|
|
78
80
|
export const pendingIcon = () => <PendingIcon />;
|
|
79
81
|
export const refundIcon = () => <RefundIcon />;
|
|
80
82
|
export const rejectedIcon = () => <RejectedIcon />;
|
|
@@ -35,6 +35,7 @@ import DuplicateIcon from "./DuplicateIcon";
|
|
|
35
35
|
import ErroredIcon from "./ErroredIcon";
|
|
36
36
|
import ExternalLinkIcon from "./ExternalLinkIcon";
|
|
37
37
|
import FailedIcon from "./FailedIcon";
|
|
38
|
+
import PencilIcon from "./PencilIcon";
|
|
38
39
|
import PendingIcon from "./PendingIcon";
|
|
39
40
|
import RefundIcon from "./RefundIcon";
|
|
40
41
|
import RejectedIcon from "./RejectedIcon";
|
|
@@ -118,6 +119,7 @@ export {
|
|
|
118
119
|
ErroredIcon,
|
|
119
120
|
ExternalLinkIcon,
|
|
120
121
|
FailedIcon,
|
|
122
|
+
PencilIcon,
|
|
121
123
|
PendingIcon,
|
|
122
124
|
RefundIcon,
|
|
123
125
|
RejectedIcon,
|
|
@@ -49,10 +49,10 @@ export const BoxWrapper = styled(
|
|
|
49
49
|
text-align: ${({ textAlign }) => textAlign};
|
|
50
50
|
|
|
51
51
|
&:hover {
|
|
52
|
-
${({ hoverStyles, as }) =>
|
|
52
|
+
${({ hoverStyles, as, disabled }) =>
|
|
53
53
|
css`
|
|
54
54
|
${hoverStyles}
|
|
55
|
-
${as === "button"
|
|
55
|
+
${as === "button" && !disabled
|
|
56
56
|
? `> * > span {
|
|
57
57
|
${hoverStyles}
|
|
58
58
|
border: none;
|
|
@@ -24,6 +24,7 @@ const Cluster = ({
|
|
|
24
24
|
flexGrow,
|
|
25
25
|
extraStyles,
|
|
26
26
|
children,
|
|
27
|
+
innerWrapperAs = "div",
|
|
27
28
|
...rest
|
|
28
29
|
}) => (
|
|
29
30
|
<ClusterWrapper
|
|
@@ -41,6 +42,7 @@ const Cluster = ({
|
|
|
41
42
|
minHeight={minHeight}
|
|
42
43
|
minWidth={minWidth}
|
|
43
44
|
$nowrap={nowrap}
|
|
45
|
+
as={innerWrapperAs}
|
|
44
46
|
>
|
|
45
47
|
{safeChildren(children, <Fragment />)}
|
|
46
48
|
</ClusterInnerWrapper>
|
|
@@ -4,7 +4,13 @@ import Paragraph from "../paragraph";
|
|
|
4
4
|
import { themeComponent } from "../../../util/themeUtils";
|
|
5
5
|
import { fallbackValues } from "./LineItem.theme";
|
|
6
6
|
|
|
7
|
-
const LineItem = ({
|
|
7
|
+
const LineItem = ({
|
|
8
|
+
description,
|
|
9
|
+
subDescription,
|
|
10
|
+
amount,
|
|
11
|
+
themeValues,
|
|
12
|
+
displayQuantity = null
|
|
13
|
+
}) => (
|
|
8
14
|
<Cluster nowrap justify="space-between" align="start">
|
|
9
15
|
<Stack childGap="0px">
|
|
10
16
|
<Paragraph
|
|
@@ -17,6 +23,14 @@ const LineItem = ({ description, subDescription, amount, themeValues }) => (
|
|
|
17
23
|
{subDescription}
|
|
18
24
|
</Paragraph>
|
|
19
25
|
</Stack>
|
|
26
|
+
{!!displayQuantity && (
|
|
27
|
+
<Paragraph
|
|
28
|
+
variant={themeValues.paragraphVariant}
|
|
29
|
+
weight={themeValues.weightTitle}
|
|
30
|
+
>
|
|
31
|
+
{`x${displayQuantity}`}
|
|
32
|
+
</Paragraph>
|
|
33
|
+
)}
|
|
20
34
|
<Paragraph
|
|
21
35
|
variant={themeValues.paragraphVariant}
|
|
22
36
|
weight="600"
|
|
@@ -17,3 +17,12 @@ export const lineItem = () => (
|
|
|
17
17
|
amount={text("amount", "$4.00", "props")}
|
|
18
18
|
/>
|
|
19
19
|
);
|
|
20
|
+
|
|
21
|
+
export const lineItemWithQuantity = () => (
|
|
22
|
+
<LineItem
|
|
23
|
+
description={text("description", "Foo", "props")}
|
|
24
|
+
subDescription={text("subDescription", "Bar", "props")}
|
|
25
|
+
amount={text("amount", "$4.00", "props")}
|
|
26
|
+
displayQuantity={2}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
@@ -39,13 +39,14 @@ const menu = posed.div({
|
|
|
39
39
|
|
|
40
40
|
const ImposterMenu = styled(menu)`
|
|
41
41
|
position: fixed;
|
|
42
|
-
top:
|
|
42
|
+
top: ${({ headerSize }) => headerSize};
|
|
43
43
|
`;
|
|
44
44
|
|
|
45
45
|
const NavMenuMobile = ({
|
|
46
46
|
id,
|
|
47
47
|
menuContent = [],
|
|
48
48
|
visible = false,
|
|
49
|
+
headerSize = "72px",
|
|
49
50
|
themeValues
|
|
50
51
|
}) => {
|
|
51
52
|
return (
|
|
@@ -53,6 +54,7 @@ const NavMenuMobile = ({
|
|
|
53
54
|
id={id}
|
|
54
55
|
initialPose="invisible"
|
|
55
56
|
pose={visible ? "visible" : "invisible"}
|
|
57
|
+
headerSize={headerSize}
|
|
56
58
|
>
|
|
57
59
|
<Box
|
|
58
60
|
width="100vw"
|
|
@@ -23,6 +23,7 @@ const PrevNextPlaceholder = ({ buttonHeight, buttonWidth }) => (
|
|
|
23
23
|
|
|
24
24
|
const PrevNextButton = ({
|
|
25
25
|
action,
|
|
26
|
+
ariaLabel,
|
|
26
27
|
arrowColor,
|
|
27
28
|
borderRadius,
|
|
28
29
|
buttonHeight,
|
|
@@ -34,11 +35,13 @@ const PrevNextButton = ({
|
|
|
34
35
|
padding="0"
|
|
35
36
|
minHeight={buttonHeight}
|
|
36
37
|
extraStyles={`max-height: ${buttonHeight};`}
|
|
38
|
+
as="li"
|
|
37
39
|
>
|
|
38
40
|
<ButtonWithAction
|
|
39
41
|
action={action}
|
|
40
42
|
contentOverride
|
|
41
43
|
dataQa={type}
|
|
44
|
+
aria-label={ariaLabel}
|
|
42
45
|
extraStyles={`
|
|
43
46
|
background-color: ${numberColor};
|
|
44
47
|
border-color: ${numberColor};
|
|
@@ -48,9 +51,6 @@ const PrevNextButton = ({
|
|
|
48
51
|
min-height: 100%;
|
|
49
52
|
min-width: ${buttonWidth};
|
|
50
53
|
padding: 0;
|
|
51
|
-
&:focus {
|
|
52
|
-
outline: none
|
|
53
|
-
}
|
|
54
54
|
`}
|
|
55
55
|
>
|
|
56
56
|
<Box padding="0" extraStyles={type === "prev" && "transform: scaleX(-1)"}>
|
|
@@ -68,19 +68,23 @@ export const getPagesPanel = (page, pagesCount) => {
|
|
|
68
68
|
const space = page === 1 ? PAGING_INIT_SPACE : PAGING_SPACE;
|
|
69
69
|
const pages = [{ index: 1, isButton: true }];
|
|
70
70
|
if (page > space + 1) {
|
|
71
|
-
pages.push({ isDelimiter: true });
|
|
71
|
+
pages.push({ isDelimiter: true, id: "first-delimiter" });
|
|
72
72
|
}
|
|
73
73
|
for (
|
|
74
74
|
let j = Math.max(1, page - space) + 1;
|
|
75
75
|
j < Math.min(lastPageNumber, page + space);
|
|
76
76
|
j++
|
|
77
77
|
) {
|
|
78
|
-
pages.push({ index: j, isButton: true });
|
|
78
|
+
pages.push({ index: j, isButton: true, id: `page-${j}` });
|
|
79
79
|
}
|
|
80
80
|
if (page < lastPageNumber - space) {
|
|
81
|
-
pages.push({ isDelimiter: true });
|
|
81
|
+
pages.push({ isDelimiter: true, id: "last-delimiter" });
|
|
82
82
|
}
|
|
83
|
-
pages.push({
|
|
83
|
+
pages.push({
|
|
84
|
+
index: lastPageNumber,
|
|
85
|
+
isButton: true,
|
|
86
|
+
id: `page-${lastPageNumber}`
|
|
87
|
+
});
|
|
84
88
|
const activePage = pages.find(p => p.index === page);
|
|
85
89
|
if (activePage) {
|
|
86
90
|
activePage.active = true;
|
|
@@ -103,6 +107,7 @@ const Pagination = ({
|
|
|
103
107
|
pageNext,
|
|
104
108
|
pagePrevious,
|
|
105
109
|
setCurrentPage,
|
|
110
|
+
ariaLabel,
|
|
106
111
|
themeValues
|
|
107
112
|
}) => {
|
|
108
113
|
const { isMobile } = useContext(ThemeContext);
|
|
@@ -123,12 +128,9 @@ const Pagination = ({
|
|
|
123
128
|
&:hover {
|
|
124
129
|
background-color: ${themeValues.hoverBackgroundColor}
|
|
125
130
|
}
|
|
126
|
-
&:focus {
|
|
127
|
-
outline: none
|
|
128
|
-
}
|
|
129
131
|
`;
|
|
130
132
|
|
|
131
|
-
const
|
|
133
|
+
const currentPageStyles = `
|
|
132
134
|
border: ${activeBorderWidth} solid ${numberColor ??
|
|
133
135
|
themeValues.numberColor};
|
|
134
136
|
color: ${numberColor ?? themeValues.activeColor};
|
|
@@ -138,14 +140,27 @@ const Pagination = ({
|
|
|
138
140
|
}
|
|
139
141
|
&:hover {
|
|
140
142
|
background-color: initial;
|
|
143
|
+
border: ${activeBorderWidth} solid ${numberColor ??
|
|
144
|
+
themeValues.numberColor};
|
|
145
|
+
background-color: ${themeValues.activeBackgroundColor};
|
|
141
146
|
}
|
|
142
147
|
`;
|
|
143
148
|
|
|
144
149
|
return (
|
|
145
|
-
<Cluster
|
|
150
|
+
<Cluster
|
|
151
|
+
justify="center"
|
|
152
|
+
childGap={childGap}
|
|
153
|
+
overflow={true}
|
|
154
|
+
as="nav"
|
|
155
|
+
role="navigation"
|
|
156
|
+
innerWrapperAs="ul"
|
|
157
|
+
aria-label={ariaLabel}
|
|
158
|
+
extraStyles="> ul { padding: 0px; > li { list-style-type: none; } };"
|
|
159
|
+
>
|
|
146
160
|
{currentPage > 1 ? (
|
|
147
161
|
<PrevNextButton
|
|
148
162
|
action={pagePrevious}
|
|
163
|
+
ariaLabel={`Previous Page`}
|
|
149
164
|
arrowColor={arrowColor ?? themeValues.arrowColor}
|
|
150
165
|
borderRadius={borderRadius}
|
|
151
166
|
buttonHeight={buttonHeight}
|
|
@@ -178,35 +193,43 @@ const Pagination = ({
|
|
|
178
193
|
)
|
|
179
194
|
: getPagesPanel(currentPage, pageCount).map((item, index) =>
|
|
180
195
|
item.isButton ? (
|
|
181
|
-
<Box
|
|
196
|
+
<Box
|
|
197
|
+
padding="0"
|
|
198
|
+
extraStyles={`max-height: ${buttonHeight};`}
|
|
199
|
+
as="li"
|
|
200
|
+
key={item.id}
|
|
201
|
+
>
|
|
182
202
|
<ButtonWithAction
|
|
183
203
|
variant="ghost"
|
|
184
|
-
key={item.index}
|
|
185
204
|
text={item.index}
|
|
186
|
-
|
|
187
|
-
|
|
205
|
+
aria-current={item.active ? "page" : undefined}
|
|
206
|
+
aria-label={`${
|
|
207
|
+
item.index == pageCount ? "Last Page, " : ""
|
|
208
|
+
}page ${item.index}`}
|
|
188
209
|
action={
|
|
189
210
|
!item.active
|
|
190
211
|
? () => setCurrentPage({ pageNumber: item.index })
|
|
191
212
|
: noop
|
|
192
213
|
}
|
|
193
214
|
textExtraStyles={`font-size: ${fontSize}; font-weight: ${fontWeight};`}
|
|
194
|
-
extraStyles={extraStyles}
|
|
215
|
+
extraStyles={`${extraStyles}${
|
|
216
|
+
item.active ? currentPageStyles : ""
|
|
217
|
+
}`}
|
|
195
218
|
dataQa={index}
|
|
196
219
|
>
|
|
197
220
|
{item.index}
|
|
198
221
|
</ButtonWithAction>
|
|
199
222
|
</Box>
|
|
200
223
|
) : (
|
|
201
|
-
<Box padding="0 10px">
|
|
224
|
+
<Box padding="0 10px" as="li" key={item.id}>
|
|
202
225
|
<Cluster justify="flex-end">
|
|
203
226
|
<Text
|
|
204
|
-
key={index}
|
|
205
227
|
variant="pXL"
|
|
206
228
|
weight={fontWeight}
|
|
207
229
|
color={numberColor ?? themeValues.numberColor}
|
|
230
|
+
role="presentation"
|
|
208
231
|
>
|
|
209
|
-
{"
|
|
232
|
+
{"…"}
|
|
210
233
|
</Text>
|
|
211
234
|
</Cluster>
|
|
212
235
|
</Box>
|
|
@@ -215,6 +238,7 @@ const Pagination = ({
|
|
|
215
238
|
{currentPage < pageCount ? (
|
|
216
239
|
<PrevNextButton
|
|
217
240
|
action={pageNext}
|
|
241
|
+
ariaLabel={`Next Page`}
|
|
218
242
|
arrowColor={arrowColor ?? themeValues.arrowColor}
|
|
219
243
|
borderRadius={borderRadius}
|
|
220
244
|
buttonHeight={buttonHeight}
|
|
@@ -14,6 +14,9 @@ import {
|
|
|
14
14
|
} from "../../atoms/form-layouts";
|
|
15
15
|
import AccountAndRoutingModal from "../account-and-routing-modal";
|
|
16
16
|
import { noop } from "../../../util/general";
|
|
17
|
+
import { Cluster, Cover } from "../../atoms/layouts";
|
|
18
|
+
import TermsAndConditionsModal from "../terms-and-conditions-modal/TermsAndConditionsModal";
|
|
19
|
+
import Text from "../../atoms/text";
|
|
17
20
|
|
|
18
21
|
const PaymentFormACH = ({
|
|
19
22
|
variant = "default",
|
|
@@ -28,13 +31,18 @@ const PaymentFormACH = ({
|
|
|
28
31
|
handleSubmit = noop,
|
|
29
32
|
showWalletCheckbox,
|
|
30
33
|
saveToWallet,
|
|
31
|
-
walletCheckboxMarked
|
|
34
|
+
walletCheckboxMarked,
|
|
35
|
+
termsContent,
|
|
36
|
+
termsTitle = "Terms & Conditions"
|
|
32
37
|
}) => {
|
|
33
38
|
if (clearOnDismount) {
|
|
34
39
|
useEffect(() => () => actions.form.clear(), []);
|
|
35
40
|
}
|
|
36
41
|
const [showRouting, toggleShowRouting] = useState(false);
|
|
37
42
|
const [showAccount, toggleShowAccount] = useState(false);
|
|
43
|
+
const [termsModalOpen, setTermsModalOpen] = useState(false);
|
|
44
|
+
const showTerms = !!termsContent;
|
|
45
|
+
const showTermsLinkVariant = showWalletCheckbox ? "p" : "pS";
|
|
38
46
|
|
|
39
47
|
const nameErrors = {
|
|
40
48
|
[required.error]: "Name is required"
|
|
@@ -153,13 +161,32 @@ const PaymentFormACH = ({
|
|
|
153
161
|
hidden={hideDefaultPayment}
|
|
154
162
|
/>
|
|
155
163
|
)}
|
|
156
|
-
{showWalletCheckbox && (
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
164
|
+
{(showWalletCheckbox || showTerms) && (
|
|
165
|
+
<Cluster childGap={"4px"}>
|
|
166
|
+
{showWalletCheckbox && (
|
|
167
|
+
<Checkbox
|
|
168
|
+
name="bank checkbox"
|
|
169
|
+
title="Save checking account to wallet."
|
|
170
|
+
checked={walletCheckboxMarked}
|
|
171
|
+
onChange={saveToWallet}
|
|
172
|
+
/>
|
|
173
|
+
)}
|
|
174
|
+
{showTerms && (
|
|
175
|
+
<Cover singleChild>
|
|
176
|
+
<Cluster childGap={0}>
|
|
177
|
+
<Text variant={showTermsLinkVariant}>View </Text>
|
|
178
|
+
<TermsAndConditionsModal
|
|
179
|
+
link={termsTitle}
|
|
180
|
+
linkVariant={showTermsLinkVariant}
|
|
181
|
+
terms={termsContent}
|
|
182
|
+
title={termsTitle}
|
|
183
|
+
isOpen={termsModalOpen}
|
|
184
|
+
toggleOpen={setTermsModalOpen}
|
|
185
|
+
/>
|
|
186
|
+
</Cluster>
|
|
187
|
+
</Cover>
|
|
188
|
+
)}
|
|
189
|
+
</Cluster>
|
|
163
190
|
)}
|
|
164
191
|
</FormInputColumn>
|
|
165
192
|
</FormContainer>
|