@thecb/components 2.2.1 → 2.3.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.
Files changed (70) hide show
  1. package/.tool-versions +1 -0
  2. package/dist/index.cjs.js +30904 -3033
  3. package/package.json +15 -35
  4. package/rollup.config.js +3 -1
  5. package/src/components/atoms/button-with-action/ButtonWithAction.js +25 -4
  6. package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +64 -234
  7. package/src/components/atoms/formatted-credit-card/FormattedCreditCard.js +53 -0
  8. package/src/components/atoms/formatted-credit-card/FormattedCreditCard.theme.js +9 -0
  9. package/src/components/atoms/formatted-credit-card/index.js +3 -0
  10. package/src/components/atoms/icons/AccountNumberImage.js +95 -0
  11. package/src/components/atoms/icons/BankIcon.js +82 -0
  12. package/src/components/atoms/icons/CheckmarkIcon.js +55 -0
  13. package/src/components/atoms/icons/GenericCard.js +39 -0
  14. package/src/components/atoms/icons/PaymentIcon.js +50 -0
  15. package/src/components/atoms/icons/RoutingNumberImage.js +95 -0
  16. package/src/components/atoms/icons/index.js +14 -1
  17. package/src/components/atoms/index.js +3 -0
  18. package/src/components/atoms/jumbo/Jumbo.js +76 -0
  19. package/src/components/atoms/jumbo/index.js +3 -0
  20. package/src/components/atoms/loading/Loading.js +17 -0
  21. package/src/components/atoms/loading/index.js +3 -0
  22. package/src/components/atoms/nav-header/NavHeader.js +1 -1
  23. package/src/components/index.js +1 -0
  24. package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.js +75 -0
  25. package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.theme.js +24 -0
  26. package/src/components/molecules/account-and-routing-modal/index.js +3 -0
  27. package/src/components/molecules/address-form/AddressForm.js +2 -1
  28. package/src/components/molecules/address-form/index.js +6 -6
  29. package/src/components/molecules/change-password-form/ChangePasswordForm.js +2 -1
  30. package/src/components/molecules/change-password-form/index.js +1 -1
  31. package/src/components/molecules/edit-name-form/EditNameForm.js +2 -1
  32. package/src/components/molecules/edit-name-form/index.js +1 -1
  33. package/src/components/molecules/editable-list/EditableList.js +139 -0
  34. package/src/components/molecules/editable-list/EditableList.styled.js +31 -0
  35. package/src/components/molecules/editable-list/index.js +3 -0
  36. package/src/components/molecules/editable-table/EditableTable.js +30 -0
  37. package/src/components/molecules/editable-table/EditableTable.styled.js +80 -0
  38. package/src/components/molecules/editable-table/TableListItem.js +64 -0
  39. package/src/components/molecules/editable-table/index.js +4 -0
  40. package/src/components/molecules/email-form/EmailForm.js +2 -1
  41. package/src/components/molecules/email-form/index.js +1 -1
  42. package/src/components/molecules/forgot-password-form/ForgotPasswordForm.js +2 -1
  43. package/src/components/molecules/forgot-password-form/index.js +1 -1
  44. package/src/components/molecules/index.js +5 -0
  45. package/src/components/molecules/login-form/LoginForm.js +2 -1
  46. package/src/components/molecules/login-form/index.js +1 -1
  47. package/src/components/molecules/module/Module.js +1 -3
  48. package/src/components/molecules/partial-amount-form/PartialAmountForm.js +73 -0
  49. package/src/components/molecules/partial-amount-form/PartialAmountForm.state.js +51 -0
  50. package/src/components/molecules/partial-amount-form/index.js +4 -0
  51. package/src/components/molecules/payment-form-ach/PaymentFormACH.js +189 -0
  52. package/src/components/molecules/payment-form-ach/PaymentFormACH.state.js +38 -0
  53. package/src/components/molecules/payment-form-ach/index.js +11 -0
  54. package/src/components/molecules/payment-form-card/PaymentFormCard.js +132 -0
  55. package/src/components/molecules/payment-form-card/PaymentFormCard.state.js +39 -0
  56. package/src/components/molecules/payment-form-card/index.js +11 -0
  57. package/src/components/molecules/phone-form/PhoneForm.js +2 -1
  58. package/src/components/molecules/phone-form/index.js +1 -1
  59. package/src/components/molecules/registration-form/RegistrationForm.js +2 -1
  60. package/src/components/molecules/registration-form/index.js +1 -1
  61. package/src/components/molecules/reset-password-form/ResetPasswordForm.js +3 -1
  62. package/src/components/molecules/reset-password-form/index.js +1 -1
  63. package/src/constants/index.js +2 -0
  64. package/src/index.js +2 -1
  65. package/src/util/formats.js +54 -2
  66. package/src/util/general.js +27 -4
  67. package/src/util/index.js +2 -0
  68. package/src/util/inputValidationUtils.js +0 -167
  69. package/stats.html +2652 -0
  70. 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": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
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
- "sanctuary": "^3.0.0",
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
- "redux-freeform": "^4.1.2",
85
- "sanctuary": "^3.0.0",
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,6 +2,7 @@ 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
8
  import * as sanctuary from "sanctuary";
@@ -25,7 +26,8 @@ const plugins = [
25
26
  sanctuary: Object.keys(sanctuary),
26
27
  "formatted-input": Object.keys(formattedInput)
27
28
  }
28
- })
29
+ }),
30
+ visualizer()
29
31
  ];
30
32
 
31
33
  const external = [...Object.keys(pkg.peerDependencies || {})];
@@ -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={themeValues.hover}
96
- focusStyles={themeValues.focus}
97
- activeStyles={themeValues.active}
98
- disabledStyles={themeValues.disabled}
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 focus = {
110
- primary: `
111
- outline: none;
112
- background-color: #0E506D;
113
- border: 2px solid #0E506D;
114
- box-shadow: 0 0 10px #15749D;
115
- `,
116
- secondary: `
117
- outline: none;
118
- background-color: #DCEAF1;
119
- box-shadow: 0 0 10px #DCEAF1;
120
- `,
121
- back: `
122
- outline: none;
123
- background-color: #DCEAF1;
124
- box-shadow: 0 0 10px #DCEAF1;
125
- `,
126
- smallPrimary: `
127
- outline: none;
128
- background-color: #0E506D;
129
- border: 2px solid #0E506D;
130
- box-shadow: 0 0 10px #15749D;
131
- `,
132
- smallSecondary: `
133
- outline: none;
134
- background-color: #DCEAF1;
135
- box-shadow: 0 0 10px #DCEAF1;
136
- `,
137
- smallGhost: `
138
- outline: none;
139
- box-shadow: none;
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 hover = {
171
- primary: `
172
- cursor: pointer;
173
- background-color: #116285;
174
- border: 2px solid #116285;
175
- box-shadow: 0 0 10px #15749D;
176
- `,
177
- secondary: `
178
- cursor: pointer;
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 active = {
230
- primary: `
231
- background-color: #0E506D;
232
- border: 2px solid #0E506D;
233
- box-shadow: 0 0 10px #15749D;
234
- `,
235
- secondary: `
236
- background-color: #B8D5E1;
237
- box-shadow: 0 0 10px #B8D5E1;
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 disabled = {
288
- primary: `
289
- background-color: #6E727E;
290
- border: 2px solid #6E727E;
291
- &:focus {
292
- box-shadow: 0 0 10px #6E727E;
293
- }
294
- `,
295
- secondary: `
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
- hover,
357
- focus,
358
- active,
359
- disabled
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
+ );
@@ -0,0 +1,9 @@
1
+ import { CHARADE_GREY, REGENT_GREY } from "../../../constants/colors";
2
+
3
+ const textColor = `${CHARADE_GREY}`;
4
+ const autopayTextColor = `${REGENT_GREY}`;
5
+
6
+ export const fallbackValues = {
7
+ textColor,
8
+ autopayTextColor
9
+ };
@@ -0,0 +1,3 @@
1
+ import FormattedCreditCard from "./FormattedCreditCard";
2
+
3
+ export default FormattedCreditCard;