@thecb/components 2.2.0 → 3.0.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/.github/workflows/bump-version.yml +30 -0
- package/.github/workflows/create-release/build-body.sh +35 -0
- package/.github/workflows/create-release.yml +52 -0
- package/.github/workflows/publish-update.yml +73 -0
- package/README.md +68 -90
- package/dist/index.cjs.js +49122 -0
- package/package.json +17 -37
- package/rollup.config.js +43 -23
- package/src/components/atoms/button-with-action/ButtonWithAction.js +25 -4
- package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +64 -234
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.js +53 -0
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.theme.js +9 -0
- package/src/components/atoms/formatted-credit-card/index.js +3 -0
- package/src/components/atoms/icons/AccountNumberImage.js +95 -0
- package/src/components/atoms/icons/BankIcon.js +82 -0
- package/src/components/atoms/icons/CheckmarkIcon.js +55 -0
- package/src/components/atoms/icons/GenericCard.js +39 -0
- package/src/components/atoms/icons/PaymentIcon.js +50 -0
- package/src/components/atoms/icons/RoutingNumberImage.js +95 -0
- package/src/components/atoms/icons/index.js +14 -1
- package/src/components/atoms/index.js +3 -0
- package/src/components/atoms/jumbo/Jumbo.js +76 -0
- package/src/components/atoms/jumbo/index.js +3 -0
- package/src/components/atoms/loading/Loading.js +17 -0
- package/src/components/atoms/loading/index.js +3 -0
- package/src/components/atoms/nav-header/NavHeader.js +1 -1
- package/src/components/index.js +1 -0
- package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.js +75 -0
- package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.theme.js +24 -0
- package/src/components/molecules/account-and-routing-modal/index.js +3 -0
- package/src/components/molecules/address-form/AddressForm.js +2 -1
- package/src/components/molecules/address-form/index.js +6 -6
- package/src/components/molecules/change-password-form/ChangePasswordForm.js +2 -1
- package/src/components/molecules/change-password-form/index.js +1 -1
- package/src/components/molecules/edit-name-form/EditNameForm.js +2 -1
- package/src/components/molecules/edit-name-form/index.js +1 -1
- package/src/components/molecules/editable-list/EditableList.js +139 -0
- package/src/components/molecules/editable-list/EditableList.styled.js +31 -0
- package/src/components/molecules/editable-list/index.js +3 -0
- package/src/components/molecules/editable-table/EditableTable.js +30 -0
- package/src/components/molecules/editable-table/EditableTable.styled.js +80 -0
- package/src/components/molecules/editable-table/TableListItem.js +64 -0
- package/src/components/molecules/editable-table/index.js +4 -0
- package/src/components/molecules/email-form/EmailForm.js +2 -1
- package/src/components/molecules/email-form/index.js +1 -1
- package/src/components/molecules/forgot-password-form/ForgotPasswordForm.js +2 -1
- package/src/components/molecules/forgot-password-form/index.js +1 -1
- package/src/components/molecules/index.js +5 -0
- package/src/components/molecules/login-form/LoginForm.js +2 -1
- package/src/components/molecules/login-form/index.js +1 -1
- package/src/components/molecules/module/Module.js +1 -3
- package/src/components/molecules/partial-amount-form/PartialAmountForm.js +73 -0
- package/src/components/molecules/partial-amount-form/PartialAmountForm.state.js +51 -0
- package/src/components/molecules/partial-amount-form/index.js +4 -0
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +189 -0
- package/src/components/molecules/payment-form-ach/PaymentFormACH.state.js +38 -0
- package/src/components/molecules/payment-form-ach/index.js +11 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +132 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.state.js +39 -0
- package/src/components/molecules/payment-form-card/index.js +11 -0
- package/src/components/molecules/phone-form/PhoneForm.js +2 -1
- package/src/components/molecules/phone-form/index.js +1 -1
- package/src/components/molecules/registration-form/RegistrationForm.js +2 -1
- package/src/components/molecules/registration-form/index.js +1 -1
- package/src/components/molecules/reset-password-form/ResetPasswordForm.js +3 -1
- package/src/components/molecules/reset-password-form/index.js +1 -1
- package/src/constants/index.js +4 -0
- package/src/index.js +3 -1
- package/src/util/formats.js +54 -2
- package/src/util/general.js +27 -4
- package/src/util/index.js +4 -0
- package/src/util/inputValidationUtils.js +0 -167
- package/.tool-versions +0 -1
- package/dist/cb-components.cjs.js +0 -77
- package/src/util/router-utils.js +0 -23
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecb/components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Common lib for CityBase react components",
|
|
5
|
-
"main": "dist/
|
|
6
|
-
"module": "dist/
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
7
|
"source": "src/index.js",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "rollup -c"
|
|
10
|
-
"dev": "microbundle watch"
|
|
9
|
+
"build": "rollup -c"
|
|
11
10
|
},
|
|
12
11
|
"repository": {
|
|
13
12
|
"type": "git",
|
|
@@ -36,61 +35,42 @@
|
|
|
36
35
|
"babel-eslint": "^10.1.0",
|
|
37
36
|
"babel-preset-env": "^1.7.0",
|
|
38
37
|
"babel-preset-react": "^6.24.1",
|
|
39
|
-
"connected-react-router": "^6.8.0",
|
|
40
|
-
"dompurify": "^2.0.11",
|
|
41
38
|
"eslint": "^6.8.0",
|
|
42
39
|
"eslint-config-prettier": "^6.11.0",
|
|
43
40
|
"eslint-plugin-babel": "^5.3.0",
|
|
44
41
|
"eslint-plugin-prettier": "^3.1.3",
|
|
45
42
|
"eslint-plugin-react": "^7.20.0",
|
|
46
|
-
"formatted-input": "^0.1.3",
|
|
47
|
-
"framer-motion": "^1.11.0",
|
|
48
|
-
"html-react-parser": "^0.10.3",
|
|
49
43
|
"husky": "^4.2.3",
|
|
50
|
-
"numeral": "^2.0.6",
|
|
51
44
|
"prettier": "^1.19.1",
|
|
52
45
|
"pretty-quick": "^2.0.1",
|
|
53
|
-
"react-aria-modal": "^4.0.0",
|
|
54
|
-
"react-helmet": "^6.0.0",
|
|
55
|
-
"react-pose": "^4.0.10",
|
|
56
|
-
"react-router-dom": "^5.2.0",
|
|
57
|
-
"redux-freeform": "^4.1.2",
|
|
58
46
|
"rollup": "^1.21.4",
|
|
59
47
|
"rollup-plugin-babel": "^4.3.3",
|
|
60
48
|
"rollup-plugin-commonjs": "^10.0.0",
|
|
61
49
|
"rollup-plugin-json": "^4.0.0",
|
|
62
50
|
"rollup-plugin-node-resolve": "^5.1.0",
|
|
63
|
-
"
|
|
64
|
-
"storybook": "^5.3.14"
|
|
65
|
-
"styled-components": "^5.1.1",
|
|
66
|
-
"styled-media-query": "^2.1.2",
|
|
67
|
-
"styled-theming": "^2.2.0"
|
|
51
|
+
"rollup-plugin-visualizer": "^4.0.4",
|
|
52
|
+
"storybook": "^5.3.14"
|
|
68
53
|
},
|
|
69
54
|
"peerDependencies": {
|
|
70
|
-
"connected-react-router": "^6.8.0",
|
|
71
|
-
"dompurify": "^2.0.11",
|
|
72
|
-
"formatted-input": "^0.1.3",
|
|
73
|
-
"framer-motion": "^1.11.0",
|
|
74
|
-
"html-react-parser": "^0.10.3",
|
|
75
|
-
"numeral": "^2.0.6",
|
|
76
55
|
"ramda": "^0.27.0",
|
|
77
56
|
"react": "^16.13.1",
|
|
78
|
-
"react-aria-modal": "^4.0.0",
|
|
79
57
|
"react-dom": "^16.13.1",
|
|
80
|
-
"react-helmet": "^6.0.0",
|
|
81
|
-
"react-is": "^16.13.1",
|
|
82
|
-
"react-pose": "^4.0.10",
|
|
83
58
|
"react-router-dom": "^5.2.0",
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"sanctuary-def": "^0.21.1",
|
|
87
|
-
"styled-components": ">=4.0.0",
|
|
88
|
-
"styled-media-query": ">=2.1.2",
|
|
89
|
-
"styled-theming": ">=2.2.0"
|
|
59
|
+
"styled-components": "^5.1.1",
|
|
60
|
+
"styled-theming": "^2.2.0"
|
|
90
61
|
},
|
|
91
62
|
"husky": {
|
|
92
63
|
"hooks": {
|
|
93
64
|
"pre-commit": "pretty-quick --staged"
|
|
94
65
|
}
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"formatted-input": "^0.1.3",
|
|
69
|
+
"framer-motion": "^1.11.0",
|
|
70
|
+
"numeral": "^2.0.6",
|
|
71
|
+
"react-aria-modal": "^4.0.0",
|
|
72
|
+
"react-pose": "^4.0.10",
|
|
73
|
+
"redux-freeform": "^4.1.3",
|
|
74
|
+
"sanctuary": "^3.0.0"
|
|
95
75
|
}
|
|
96
76
|
}
|
package/rollup.config.js
CHANGED
|
@@ -2,34 +2,54 @@ import resolve from "rollup-plugin-node-resolve";
|
|
|
2
2
|
import commonjs from "rollup-plugin-commonjs";
|
|
3
3
|
import babel from "rollup-plugin-babel";
|
|
4
4
|
import json from "rollup-plugin-json";
|
|
5
|
+
import visualizer from "rollup-plugin-visualizer";
|
|
5
6
|
import pkg from "./package.json";
|
|
6
7
|
|
|
7
|
-
import * as reactIs from "react-is";
|
|
8
8
|
import * as sanctuary from "sanctuary";
|
|
9
9
|
import * as formattedInput from "formatted-input";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const globals = {
|
|
12
|
+
react: "React",
|
|
13
|
+
"react-dom": "ReactDOM"
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const plugins = [
|
|
17
|
+
resolve({ preferBuiltins: false }),
|
|
18
|
+
babel({
|
|
19
|
+
exclude: "node_modules/**",
|
|
20
|
+
presets: ["@babel/env", "@babel/preset-react"]
|
|
21
|
+
}),
|
|
22
|
+
json(),
|
|
23
|
+
commonjs({
|
|
24
|
+
include: "node_modules/**",
|
|
25
|
+
namedExports: {
|
|
26
|
+
sanctuary: Object.keys(sanctuary),
|
|
27
|
+
"formatted-input": Object.keys(formattedInput)
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
visualizer()
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const external = [...Object.keys(pkg.peerDependencies || {})];
|
|
34
|
+
|
|
35
|
+
const output_data = [
|
|
36
|
+
{
|
|
37
|
+
file: pkg.main,
|
|
38
|
+
format: "cjs"
|
|
39
|
+
},
|
|
12
40
|
{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
// { file: 'docs/node_modules/oah-ui/dist/index.cjs.js', format: 'cjs' },
|
|
16
|
-
{ file: pkg.module, format: "esm" }
|
|
17
|
-
],
|
|
18
|
-
plugins: [
|
|
19
|
-
resolve({ preferBuiltins: false }),
|
|
20
|
-
babel({
|
|
21
|
-
exclude: "node_modules/**",
|
|
22
|
-
presets: ["@babel/env", "@babel/preset-react"]
|
|
23
|
-
}),
|
|
24
|
-
json(),
|
|
25
|
-
commonjs({
|
|
26
|
-
include: "node_modules/**",
|
|
27
|
-
namedExports: {
|
|
28
|
-
sanctuary: Object.keys(sanctuary),
|
|
29
|
-
"formatted-input": Object.keys(formattedInput)
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
],
|
|
33
|
-
external: [...Object.keys(pkg.peerDependencies || {})]
|
|
41
|
+
file: pkg.module,
|
|
42
|
+
format: "esm"
|
|
34
43
|
}
|
|
35
44
|
];
|
|
45
|
+
|
|
46
|
+
export default output_data.map(({ file, format }) => ({
|
|
47
|
+
input: "src/index.js",
|
|
48
|
+
output: {
|
|
49
|
+
file,
|
|
50
|
+
format,
|
|
51
|
+
globals
|
|
52
|
+
},
|
|
53
|
+
plugins,
|
|
54
|
+
external
|
|
55
|
+
}));
|
|
@@ -83,6 +83,27 @@ const ButtonWithAction = ({
|
|
|
83
83
|
variant
|
|
84
84
|
);
|
|
85
85
|
const loadingExtraStyles = `${extraStyles}; padding-top: 0.75rem; padding-bottom: 0.75rem;`;
|
|
86
|
+
const hoverStyles = `
|
|
87
|
+
outline: none;
|
|
88
|
+
background-color: ${themeValues.hoverBackgroundColor};
|
|
89
|
+
border-color: ${themeValues.hoverBorderColor};
|
|
90
|
+
color: ${themeValues.hoverColor};
|
|
91
|
+
`;
|
|
92
|
+
const activeStyles = `
|
|
93
|
+
outline: none;
|
|
94
|
+
background-color: ${themeValues.activeBackgroundColor};
|
|
95
|
+
border-color: ${themeValues.activeBorderColor};
|
|
96
|
+
color: ${themeValues.activeColor};
|
|
97
|
+
`;
|
|
98
|
+
const disabledStyles = `
|
|
99
|
+
background-clor: #6E727E;
|
|
100
|
+
border-clor: #6E727E;
|
|
101
|
+
color: #FFFFFF;
|
|
102
|
+
&:focus {
|
|
103
|
+
box-shadow: 0 0 10px #6E727E;
|
|
104
|
+
outline: none;
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
86
107
|
|
|
87
108
|
return (
|
|
88
109
|
<Box
|
|
@@ -92,10 +113,10 @@ const ButtonWithAction = ({
|
|
|
92
113
|
minWidth={themeValues.minWidth}
|
|
93
114
|
background={themeValues.backgroundColor}
|
|
94
115
|
border={themeValues.border}
|
|
95
|
-
hoverStyles={
|
|
96
|
-
focusStyles={
|
|
97
|
-
activeStyles={
|
|
98
|
-
disabledStyles={
|
|
116
|
+
hoverStyles={hoverStyles}
|
|
117
|
+
focusStyles={hoverStyles}
|
|
118
|
+
activeStyles={activeStyles}
|
|
119
|
+
disabledStyles={disabledStyles}
|
|
99
120
|
as="button"
|
|
100
121
|
onClick={action}
|
|
101
122
|
borderRadius="2px"
|
|
@@ -106,242 +106,70 @@ const border = {
|
|
|
106
106
|
whitePrimary: "2px solid transparent"
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
const
|
|
110
|
-
primary:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
color: #0E506D;
|
|
141
|
-
`,
|
|
142
|
-
ghost: `
|
|
143
|
-
outline: none;
|
|
144
|
-
box-shadow: none;
|
|
145
|
-
color: #0E506D;
|
|
146
|
-
`,
|
|
147
|
-
danger: `
|
|
148
|
-
outline: none;
|
|
149
|
-
background-color: #BA002C;
|
|
150
|
-
border: 2px solid #BA002C;
|
|
151
|
-
box-shadow: 0 0 10px #ED125F;
|
|
152
|
-
`,
|
|
153
|
-
whiteSecondary: `
|
|
154
|
-
outline: none;
|
|
155
|
-
background-color: #ffffff4D;
|
|
156
|
-
> div > span {
|
|
157
|
-
background-color: transparent;
|
|
158
|
-
}
|
|
159
|
-
`,
|
|
160
|
-
whitePrimary: `
|
|
161
|
-
outline: none;
|
|
162
|
-
background-color: #ffffff4D;
|
|
163
|
-
border: 2px solid transparent;
|
|
164
|
-
> div > span {
|
|
165
|
-
background-color: transparent;
|
|
166
|
-
}
|
|
167
|
-
`
|
|
109
|
+
const hoverBackgroundColor = {
|
|
110
|
+
primary: "#116285",
|
|
111
|
+
secondary: "transparent",
|
|
112
|
+
back: "transparent",
|
|
113
|
+
smallPrimary: "#116285",
|
|
114
|
+
smallSecondary: "transparent",
|
|
115
|
+
ghost: "transparent",
|
|
116
|
+
smallGhost: "transparent",
|
|
117
|
+
danger: "#BA002C"
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const hoverBorderColor = {
|
|
121
|
+
primary: "#116285",
|
|
122
|
+
secondary: "#DCEAF1",
|
|
123
|
+
back: "#DCEAF1",
|
|
124
|
+
smallPrimary: "#116285",
|
|
125
|
+
smallSecondary: "#DCEAF1",
|
|
126
|
+
ghost: "transparent",
|
|
127
|
+
smallGhost: "transparent",
|
|
128
|
+
danger: "#BA002C"
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const hoverColor = {
|
|
132
|
+
primary: "#FFFFFF",
|
|
133
|
+
secondary: "#116285",
|
|
134
|
+
back: "#116285",
|
|
135
|
+
smallPrimary: "#FFFFFF",
|
|
136
|
+
smallSecondary: "#116285",
|
|
137
|
+
ghost: "#116285",
|
|
138
|
+
smallGhost: "#116285",
|
|
139
|
+
danger: "#FFFFFF"
|
|
168
140
|
};
|
|
169
141
|
|
|
170
|
-
const
|
|
171
|
-
primary:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
background-color: #DCEAF1;
|
|
180
|
-
box-shadow: 0 0 10px #DCEAF1;
|
|
181
|
-
`,
|
|
182
|
-
back: `
|
|
183
|
-
cursor: pointer;
|
|
184
|
-
background-color: #DCEAF1;
|
|
185
|
-
box-shadow: 0 0 10px #DCEAF1;
|
|
186
|
-
`,
|
|
187
|
-
smallPrimary: `
|
|
188
|
-
cursor: pointer;
|
|
189
|
-
background-color: #116285;
|
|
190
|
-
border: 2px solid #116285;
|
|
191
|
-
box-shadow: 0 0 10px #15749D;
|
|
192
|
-
`,
|
|
193
|
-
smallSecondary: `
|
|
194
|
-
cursor: pointer;
|
|
195
|
-
background-color: #DCEAF1;
|
|
196
|
-
box-shadow: 0 0 10px #DCEAF1;
|
|
197
|
-
`,
|
|
198
|
-
smallGhost: `
|
|
199
|
-
cursor: pointer;
|
|
200
|
-
color: #0E506D;
|
|
201
|
-
`,
|
|
202
|
-
ghost: `
|
|
203
|
-
cursor: pointer;
|
|
204
|
-
color: #0E506D;
|
|
205
|
-
`,
|
|
206
|
-
danger: `
|
|
207
|
-
outline: none;
|
|
208
|
-
background-color: #BA002C;
|
|
209
|
-
border: 2px solid #BA002C;
|
|
210
|
-
box-shadow: 0 0 10px #ED125F;
|
|
211
|
-
`,
|
|
212
|
-
whiteSecondary: `
|
|
213
|
-
outline: none;
|
|
214
|
-
background-color: #ffffff4D;
|
|
215
|
-
> div > span {
|
|
216
|
-
background-color: transparent;
|
|
217
|
-
}
|
|
218
|
-
`,
|
|
219
|
-
whitePrimary: `
|
|
220
|
-
outline: none;
|
|
221
|
-
background-color: #ffffff4D;
|
|
222
|
-
border: 2px solid transparent;
|
|
223
|
-
> div > span {
|
|
224
|
-
background-color: transparent;
|
|
225
|
-
}
|
|
226
|
-
`
|
|
142
|
+
const activeBackgroundColor = {
|
|
143
|
+
primary: "#0E506D",
|
|
144
|
+
secondary: "transparent",
|
|
145
|
+
back: "transparent",
|
|
146
|
+
smallPrimary: "#0E506D",
|
|
147
|
+
smallSecondary: "transparent",
|
|
148
|
+
ghost: "transparent",
|
|
149
|
+
smallGhost: "transparent",
|
|
150
|
+
danger: "#870000"
|
|
227
151
|
};
|
|
228
152
|
|
|
229
|
-
const
|
|
230
|
-
primary:
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
`,
|
|
239
|
-
back: `
|
|
240
|
-
background-color: #B8D5E1;
|
|
241
|
-
box-shadow: 0 0 10px #B8D5E1;
|
|
242
|
-
`,
|
|
243
|
-
smallPrimary: `
|
|
244
|
-
background-color: #0E506D;
|
|
245
|
-
border: 2px solid #0E506D;
|
|
246
|
-
box-shadow: 0 0 10px #15749D;
|
|
247
|
-
`,
|
|
248
|
-
smallSecondary: `
|
|
249
|
-
background-color: #B8D5E1;
|
|
250
|
-
box-shadow: 0 0 10px #B8D5E1;
|
|
251
|
-
`,
|
|
252
|
-
smallGhost: `
|
|
253
|
-
background-color: transparent;
|
|
254
|
-
color: #15749D;
|
|
255
|
-
box-shadow: none;
|
|
256
|
-
`,
|
|
257
|
-
ghost: `
|
|
258
|
-
background-color: transparent;
|
|
259
|
-
color: #15749D;
|
|
260
|
-
box-shadow: none;
|
|
261
|
-
`,
|
|
262
|
-
danger: `
|
|
263
|
-
outline: none;
|
|
264
|
-
background-color: #870000;
|
|
265
|
-
border: 2px solid #870000;
|
|
266
|
-
box-shadow: 0 0 10px #ED125F;
|
|
267
|
-
`,
|
|
268
|
-
whiteSecondary: `
|
|
269
|
-
outline: none;
|
|
270
|
-
background-color: #00000033;
|
|
271
|
-
box-shadow: 0 0 10px #00000033;
|
|
272
|
-
> div > span {
|
|
273
|
-
background-color: transparent;
|
|
274
|
-
}
|
|
275
|
-
`,
|
|
276
|
-
whitePrimary: `
|
|
277
|
-
outline: none;
|
|
278
|
-
background-color: #00000033;
|
|
279
|
-
box-shadow: 0 0 10px #00000033;
|
|
280
|
-
border: 2px solid transparent;
|
|
281
|
-
> div > span {
|
|
282
|
-
background-color: transparent;
|
|
283
|
-
}
|
|
284
|
-
`
|
|
153
|
+
const activeBorderColor = {
|
|
154
|
+
primary: "#0E506D",
|
|
155
|
+
secondary: "#0E506D",
|
|
156
|
+
back: "#0E506D",
|
|
157
|
+
smallPrimary: "#0E506D",
|
|
158
|
+
smallSecondary: "#0E506D",
|
|
159
|
+
ghost: "transparent",
|
|
160
|
+
smallGhost: "transparent",
|
|
161
|
+
danger: "#870000"
|
|
285
162
|
};
|
|
286
163
|
|
|
287
|
-
const
|
|
288
|
-
primary:
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
color: #6E727E;
|
|
297
|
-
border: 2px solid #6E727E;
|
|
298
|
-
&:focus {
|
|
299
|
-
box-shadow: 0 0 10px #6E727E;
|
|
300
|
-
}
|
|
301
|
-
`,
|
|
302
|
-
back: `
|
|
303
|
-
color: #6E727E;
|
|
304
|
-
border: 2px solid #6E727E;
|
|
305
|
-
&:focus {
|
|
306
|
-
box-shadow: 0 0 10px #6E727E;
|
|
307
|
-
}
|
|
308
|
-
`,
|
|
309
|
-
smallPrimary: `
|
|
310
|
-
background-color: #6E727E;
|
|
311
|
-
border: 2px solid #6E727E;
|
|
312
|
-
&:focus {
|
|
313
|
-
box-shadow: 0 0 10px #6E727E;
|
|
314
|
-
}
|
|
315
|
-
`,
|
|
316
|
-
smallSecondary: `
|
|
317
|
-
color: #6E727E;
|
|
318
|
-
border: 2px solid #6E727E;
|
|
319
|
-
&:focus {
|
|
320
|
-
box-shadow: 0 0 10px #6E727E;
|
|
321
|
-
}
|
|
322
|
-
`,
|
|
323
|
-
smallGhost: `
|
|
324
|
-
color: #6E727E;
|
|
325
|
-
border: none;
|
|
326
|
-
`,
|
|
327
|
-
ghost: `
|
|
328
|
-
color: #6E727E;
|
|
329
|
-
border: none;
|
|
330
|
-
`,
|
|
331
|
-
whiteSecondary: `
|
|
332
|
-
color: #6E727E;
|
|
333
|
-
border: 2px solid #6E727E;
|
|
334
|
-
&:focus {
|
|
335
|
-
box-shadow: 0 0 10px #6E727E;
|
|
336
|
-
}
|
|
337
|
-
`,
|
|
338
|
-
whitePrimary: `
|
|
339
|
-
color: #6E727E;
|
|
340
|
-
border: 2px solid #6E727E;
|
|
341
|
-
&:focus {
|
|
342
|
-
box-shadow: 0 0 10px #6E727E;
|
|
343
|
-
}
|
|
344
|
-
`
|
|
164
|
+
const activeColor = {
|
|
165
|
+
primary: "#FFFFFF",
|
|
166
|
+
secondary: "#0E506D",
|
|
167
|
+
back: "#0E506D",
|
|
168
|
+
smallPrimary: "#FFFFFF",
|
|
169
|
+
smallSecondary: "#0E506D",
|
|
170
|
+
ghost: "#0E506D",
|
|
171
|
+
smallGhost: "#0E506D",
|
|
172
|
+
danger: "#FFFFFF"
|
|
345
173
|
};
|
|
346
174
|
|
|
347
175
|
export const fallbackValues = {
|
|
@@ -353,8 +181,10 @@ export const fallbackValues = {
|
|
|
353
181
|
minWidth,
|
|
354
182
|
backgroundColor,
|
|
355
183
|
border,
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
184
|
+
hoverBackgroundColor,
|
|
185
|
+
hoverBorderColor,
|
|
186
|
+
hoverColor,
|
|
187
|
+
activeBackgroundColor,
|
|
188
|
+
activeBorderColor,
|
|
189
|
+
activeColor
|
|
360
190
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import GenericCard from "../icons/GenericCard";
|
|
4
|
+
import Text from "../text";
|
|
5
|
+
import { Stack } from "../layouts";
|
|
6
|
+
import { fallbackValues } from "./FormattedCreditCard.theme";
|
|
7
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
8
|
+
|
|
9
|
+
export const CreditCardWrapper = styled.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: flex-start;
|
|
12
|
+
align-items: center;
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
export const CCIconWrapper = styled.div`
|
|
16
|
+
margin-right: 16px;
|
|
17
|
+
width: 30px;
|
|
18
|
+
height: auto;
|
|
19
|
+
display: flex;
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
const FormattedCreditCard = ({ lastFour, autoPay, themeValues }) => (
|
|
23
|
+
<CreditCardWrapper>
|
|
24
|
+
<CCIconWrapper>
|
|
25
|
+
<GenericCard />
|
|
26
|
+
</CCIconWrapper>
|
|
27
|
+
<Stack childGap="0">
|
|
28
|
+
<Text
|
|
29
|
+
variant="p"
|
|
30
|
+
padding="0 0 0 8px"
|
|
31
|
+
color={themeValues.textColor}
|
|
32
|
+
textAlign="left"
|
|
33
|
+
extraStyles={`display: inline-block;`}
|
|
34
|
+
>
|
|
35
|
+
{`Card ending in ${lastFour}`}
|
|
36
|
+
</Text>
|
|
37
|
+
{autoPay && (
|
|
38
|
+
<Text
|
|
39
|
+
variant="p"
|
|
40
|
+
color={themeValues.autopayTextColor}
|
|
41
|
+
extraStyles={`font-style: italic;`}
|
|
42
|
+
>{`Autopay Enabled`}</Text>
|
|
43
|
+
)}
|
|
44
|
+
</Stack>
|
|
45
|
+
</CreditCardWrapper>
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
export default themeComponent(
|
|
49
|
+
FormattedCreditCard,
|
|
50
|
+
"FormattedCreditCard",
|
|
51
|
+
fallbackValues,
|
|
52
|
+
"default"
|
|
53
|
+
);
|