@thecb/components 10.2.1-beta.2 → 10.2.2-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.
Files changed (29) hide show
  1. package/README.md +2 -2
  2. package/dist/index.cjs.js +134 -188
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.d.ts +0 -36
  5. package/dist/index.esm.js +133 -187
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +49322 -0
  8. package/package.json +1 -1
  9. package/src/.DS_Store +0 -0
  10. package/src/components/.DS_Store +0 -0
  11. package/src/components/atoms/.DS_Store +0 -0
  12. package/src/components/atoms/breadcrumb/Breadcrumb.js +3 -4
  13. package/src/components/atoms/breadcrumb/Breadcrumb.theme.js +2 -5
  14. package/src/components/atoms/button-with-action/ButtonWithAction.js +7 -2
  15. package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +2 -22
  16. package/src/components/atoms/button-with-link/ButtonWithLink.js +2 -2
  17. package/src/components/atoms/icons/.DS_Store +0 -0
  18. package/src/components/atoms/link/ExternalLink.styled.js +3 -6
  19. package/src/components/atoms/link/InternalLink.styled.js +3 -6
  20. package/src/components/atoms/text/Text.styled.js +0 -1
  21. package/src/components/molecules/obligation/modules/AutopayModalModule.js +12 -10
  22. package/src/components/molecules/pagination/Pagination.js +7 -1
  23. package/src/components/molecules/pagination/Pagination.theme.js +2 -1
  24. package/src/components/molecules/tab-sidebar/TabSidebar.js +1 -0
  25. package/src/constants/index.d.ts +1 -2
  26. package/src/constants/index.js +3 -12
  27. package/src/constants/style_constants.js +1 -3
  28. package/src/components/molecules/pagination/Pagination.stories.js +0 -32
  29. package/src/constants/style_constants.d.ts +0 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "10.2.1-beta.2",
3
+ "version": "10.2.2-beta.0",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
package/src/.DS_Store ADDED
Binary file
Binary file
Binary file
@@ -34,15 +34,14 @@ const Breadcrumbs = ({ breadcrumbsList = [] }) => {
34
34
  extraStyles={`
35
35
  text-transform: uppercase;
36
36
  ${isActive.toString() === "true" &&
37
- `color: ${themeValues.activeBreadcrumbColor};
38
- pointer-events: none;
39
- text-decoration: none;
37
+ `pointer-events: none;
38
+ color: ${themeValues.activeBreadcrumbColor};
40
39
  `}
41
40
  &:first-child {
42
41
  margin-left: 0;
43
42
  }
44
43
  &:active {
45
- color: ${themeValues.activeColor};
44
+ color: ${themeValues.activeColor};
46
45
  }`}
47
46
  >
48
47
  {linkText}
@@ -1,8 +1,5 @@
1
1
  // import theme from "styled-theming";
2
- import { colors, styleConstants } from "../../../constants";
3
-
4
- const { MATISSE_BLUE, STORM_GREY } = colors;
5
- const { LINK_TEXT_DECORATION } = styleConstants;
2
+ import { MATISSE_BLUE, STORM_GREY } from "../../../constants/colors";
6
3
 
7
4
  /*
8
5
  For now I'm using string values, eventually shared components library will have its own constants file
@@ -16,7 +13,7 @@ const fontSize = "0.875rem";
16
13
  const lineHeight = "1.25rem";
17
14
  const fontWeight = "400";
18
15
  const margin = "0.5rem";
19
- const hover = `text-decoration: ${LINK_TEXT_DECORATION};`;
16
+ const hover = `text-decoration: none;`;
20
17
 
21
18
  export const fallbackValues = {
22
19
  color,
@@ -57,7 +57,7 @@ const Spinner = ({ color, isMobile }) => (
57
57
 
58
58
  Note: the children prop is only used if contentOverride is set to true, in which case
59
59
  the text prop is ignored.
60
-
60
+
61
61
  */
62
62
 
63
63
  const ButtonWithAction = forwardRef(
@@ -95,6 +95,9 @@ const ButtonWithAction = forwardRef(
95
95
  background-color: ${themeValues.hoverBackgroundColor};
96
96
  border-color: ${themeValues.hoverBorderColor};
97
97
  color: ${themeValues.hoverColor};
98
+ text-decoration: ${
99
+ variant === "ghost" || variant === "smallGhost" ? "underline" : "none"
100
+ };
98
101
  cursor: pointer;
99
102
  `;
100
103
  const activeStyles = `
@@ -102,6 +105,9 @@ const ButtonWithAction = forwardRef(
102
105
  background-color: ${themeValues.activeBackgroundColor};
103
106
  border-color: ${themeValues.activeBorderColor};
104
107
  color: ${themeValues.activeColor};
108
+ text-decoration: ${
109
+ variant === "ghost" || variant === "smallGhost" ? "underline" : "none"
110
+ };
105
111
  `;
106
112
  const disabledStyles = `
107
113
  background-color: #6D717E;
@@ -148,7 +154,6 @@ const ButtonWithAction = forwardRef(
148
154
  weight={themeValues.fontWeight}
149
155
  variant={themeValues.fontSizeVariant}
150
156
  color={themeValues.color}
151
- textDecoration={themeValues.textDecoration}
152
157
  textWrap={textWrap}
153
158
  extraStyles={textExtraStyles}
154
159
  >
@@ -1,6 +1,4 @@
1
- import { colors, styleConstants } from "../../../constants";
2
-
3
- const {
1
+ import {
4
2
  WHITE,
5
3
  TRANSPARENT,
6
4
  SAPPHIRE_BLUE,
@@ -8,9 +6,7 @@ const {
8
6
  MATISSE_BLUE,
9
7
  RASPBERRY,
10
8
  ERROR_COLOR
11
- } = colors;
12
-
13
- const { LINK_TEXT_DECORATION } = styleConstants;
9
+ } from "../../../constants/colors";
14
10
 
15
11
  const padding = {
16
12
  primary: "0.75rem 1.5rem",
@@ -102,21 +98,6 @@ const minWidth = {
102
98
  whitePrimary: "130px"
103
99
  };
104
100
 
105
- const textDecoration = {
106
- primary: "none",
107
- secondary: "none",
108
- back: "none",
109
- smallPrimary: "none",
110
- smallSecondary: "none",
111
- smallGhost: LINK_TEXT_DECORATION,
112
- ghost: LINK_TEXT_DECORATION,
113
- tertiary: "none",
114
- danger: "none",
115
- dangerSecondary: "none",
116
- whiteSecondary: "none",
117
- whitePrimary: "none"
118
- };
119
-
120
101
  const backgroundColor = {
121
102
  primary: MATISSE_BLUE,
122
103
  secondary: TRANSPARENT,
@@ -244,7 +225,6 @@ export const fallbackValues = {
244
225
  fontWeight,
245
226
  height,
246
227
  minWidth,
247
- textDecoration,
248
228
  backgroundColor,
249
229
  border,
250
230
  hoverBackgroundColor,
@@ -9,8 +9,8 @@ const ButtonWithLink = ({
9
9
  url = "/",
10
10
  disabled = false,
11
11
  fileLink = false,
12
- extraStyles = "",
13
- linkExtraStyles = "",
12
+ extraStyles,
13
+ linkExtraStyles,
14
14
  newTab = false,
15
15
  dataQa,
16
16
  ...otherProps
@@ -1,10 +1,6 @@
1
1
  import React, { forwardRef } from "react";
2
2
  import styled from "styled-components";
3
- import { colors, styleConstants } from "../../../constants";
4
-
5
- const { ROYAL_BLUE } = colors;
6
- const { LINK_TEXT_DECORATION } = styleConstants;
7
-
3
+ import { ROYAL_BLUE } from "../../../constants/colors";
8
4
  /*
9
5
  The extracting of props and the disabling of the eslint rule is to stop React from complaining about
10
6
  unrecognized DOM attributes.
@@ -22,10 +18,10 @@ export const StyledExternalLink = styled(
22
18
  font-weight: ${({ weight }) => weight};
23
19
  font-family: ${({ fontFamily }) => fontFamily};
24
20
  line-height: ${({ lineheight }) => lineheight};
25
- text-decoration: ${LINK_TEXT_DECORATION};
26
21
 
27
22
  &:hover {
28
23
  color: ${({ hoverColor }) => hoverColor};
24
+ text-decoration: underline;
29
25
  }
30
26
 
31
27
  &:focus {
@@ -34,6 +30,7 @@ export const StyledExternalLink = styled(
34
30
  }
35
31
 
36
32
  &:active {
33
+ text-decoration: underline;
37
34
  color: ${({ activeColor }) => activeColor};
38
35
  }
39
36
 
@@ -1,11 +1,7 @@
1
1
  import React, { forwardRef } from "react";
2
2
  import styled from "styled-components";
3
3
  import { Link } from "react-router-dom";
4
- import { colors, styleConstants } from "../../../constants";
5
-
6
- const { ROYAL_BLUE } = colors;
7
- const { LINK_TEXT_DECORATION } = styleConstants;
8
-
4
+ import { ROYAL_BLUE } from "../../../constants/colors";
9
5
  /*
10
6
  The extracting of props and the disabling of the eslint rule is to stop React from complaining about
11
7
  unrecognized DOM attributes.
@@ -28,10 +24,10 @@ export const StyledInternalLink = styled(
28
24
  font-size: ${({ fontSize }) => fontSize};
29
25
  font-family: ${({ fontFamily }) => fontFamily};
30
26
  margin: ${({ margin }) => margin};
31
- text-decoration: ${LINK_TEXT_DECORATION};
32
27
 
33
28
  &:hover {
34
29
  color: ${({ hoverColor }) => hoverColor};
30
+ text-decoration: underline;
35
31
  }
36
32
 
37
33
  &:focus {
@@ -40,6 +36,7 @@ export const StyledInternalLink = styled(
40
36
  }
41
37
 
42
38
  &:active {
39
+ text-decoration: underline;
43
40
  color: ${({ activeColor }) => activeColor};
44
41
  }
45
42
 
@@ -8,7 +8,6 @@ export const TextSpan = styled.span`
8
8
  font-weight: ${({ weight }) => weight};
9
9
  font-family: ${({ fontFamily }) => fontFamily};
10
10
  color: ${({ color }) => color};
11
- text-decoration: ${textDecoration => textDecoration};
12
11
  white-space: ${({ $textWrap }) => ($textWrap ? "initial" : "nowrap")};
13
12
 
14
13
  &:hover {
@@ -39,25 +39,27 @@ const AutopayModal = ({
39
39
  ? "checking account payment method"
40
40
  : "payment method";
41
41
 
42
- return `To setup ${planText} you must have a saved ${methodRequired} and address. Do you want to save these now?`;
42
+ return `To set up ${planText} you must have a saved ${methodRequired} and address. Do you want to save these now?`;
43
43
  };
44
44
  const plan = isPaymentPlan ? "your payment plan" : "autopay";
45
45
  const shortPlan = isPaymentPlan ? "Payment Plan" : "Autopay";
46
- const deactivateText = `deactivate ${shortPlan} for ${description}: ${subDescription}`;
47
- const activateText = `Set Up ${shortPlan} for ${description}: ${subDescription}`;
46
+ const deactivateText = `Stop ${shortPlan.toLowerCase()} for ${titleCaseString(
47
+ description
48
+ )}: ${titleCaseString(subDescription)}`;
49
+ const activateText = `Set Up ${shortPlan.toLowerCase()} for ${titleCaseString(
50
+ description
51
+ )}: ${titleCaseString(subDescription)}`;
48
52
  const nextDate = dueDate || nextAutopayDate;
49
53
  const modalExtraProps = {
50
- modalHeaderText: autoPayActive
51
- ? titleCaseString(deactivateText)
52
- : titleCaseString(activateText),
54
+ modalHeaderText: autoPayActive ? deactivateText : activateText,
53
55
  modalBodyText: autoPayActive
54
- ? `Are you sure you want to deactivate ${plan}? ${
55
- !inactive && nextDate
56
- ? `Your next payment will be due on ${nextDate}.`
56
+ ? `Are you sure you want to stop ${plan}? ${
57
+ !inactive && nextDate && nextDate !== "On"
58
+ ? "Your next payment will be due on " + nextDate + "."
57
59
  : ""
58
60
  }`
59
61
  : generateMethodNeededText(plan, allowedPaymentInstruments),
60
- continueButtonText: autoPayActive ? `Disable ${shortPlan}` : "Add",
62
+ continueButtonText: autoPayActive ? `Stop ${shortPlan}` : "Add",
61
63
  useDangerButton: autoPayActive,
62
64
  continueAction: autoPayActive
63
65
  ? () => {
@@ -94,7 +94,6 @@ export const getPagesPanel = (page, pagesCount) => {
94
94
 
95
95
  const Pagination = ({
96
96
  activeBorderWidth = "3px",
97
- ariaLabel,
98
97
  arrowColor,
99
98
  borderRadius = "3px",
100
99
  buttonHeight = "44px",
@@ -108,6 +107,7 @@ const Pagination = ({
108
107
  pageNext,
109
108
  pagePrevious,
110
109
  setCurrentPage,
110
+ ariaLabel,
111
111
  themeValues
112
112
  }) => {
113
113
  const { isMobile } = useContext(ThemeContext);
@@ -115,6 +115,12 @@ 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
+ }
118
124
  > * > span {
119
125
  color: ${numberColor ?? themeValues.numberColor}
120
126
  }
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  WHITE,
3
3
  MATISSE_BLUE,
4
- ALABASTER_WHITE
4
+ ALABASTER_WHITE,
5
+ STORM_GREY
5
6
  } from "../../../constants/colors";
6
7
 
7
8
  const arrowColor = WHITE;
@@ -36,6 +36,7 @@ const TabSidebar = ({ links, isMobile, themeValues }) => (
36
36
  to={route}
37
37
  key={`${route}-${index}`}
38
38
  extraStyles={`&:hover {
39
+ text-decoration: none;
39
40
  ${
40
41
  active
41
42
  ? `> * {
@@ -1,4 +1,3 @@
1
1
  import * as colors from "./colors";
2
- import * as styleConstants from "./style_constants";
3
2
 
4
- export { colors, styleConstants };
3
+ export { colors };
@@ -1,13 +1,4 @@
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";
1
+ import * as colors from "./colors";
2
+ import * as fontWeights from "./style_constants";
5
3
 
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";
4
+ export { colors, fontWeights };
@@ -8,7 +8,6 @@ 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";
12
11
 
13
12
  export {
14
13
  HEADER_HEIGHT,
@@ -18,6 +17,5 @@ export {
18
17
  COMPACT_JUMBO_HEIGHT,
19
18
  FONT_WEIGHT_REGULAR,
20
19
  FONT_WEIGHT_BOLD,
21
- FONT_WEIGHT_SEMIBOLD,
22
- LINK_TEXT_DECORATION
20
+ FONT_WEIGHT_SEMIBOLD
23
21
  };
@@ -1,32 +0,0 @@
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;
@@ -1,11 +0,0 @@
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;