@thecb/components 10.2.0 → 10.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "10.2.0",
3
+ "version": "10.4.0-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
@@ -68,7 +68,6 @@ const ButtonWithAction = forwardRef(
68
68
  text,
69
69
  textWrap = false,
70
70
  isLoading = false,
71
- disabled = false,
72
71
  loadingColor = "white",
73
72
  dataQa = null,
74
73
  textExtraStyles,
@@ -115,8 +114,8 @@ const ButtonWithAction = forwardRef(
115
114
  color: #FFFFFF;
116
115
  cursor: default;
117
116
  &:focus {
118
- outline: 3px solid #6D717E;
119
- outline-offset: 2px;
117
+ box-shadow: 0 0 10px #6D717E;
118
+ outline: none;
120
119
  }
121
120
  ${extraDisabledStyles}
122
121
  `;
@@ -130,12 +129,11 @@ const ButtonWithAction = forwardRef(
130
129
  minWidth={themeValues.minWidth}
131
130
  background={themeValues.backgroundColor}
132
131
  border={themeValues.border}
133
- hoverStyles={disabled ? disabledStyles : hoverStyles}
134
- activeStyles={disabled ? disabledStyles : activeStyles}
132
+ hoverStyles={hoverStyles}
133
+ activeStyles={activeStyles}
135
134
  disabledStyles={disabledStyles}
136
- aria-disabled={disabled}
137
135
  as="button"
138
- onClick={isLoading || disabled ? undefined : action}
136
+ onClick={isLoading ? undefined : action}
139
137
  borderRadius="2px"
140
138
  theme={themeContext}
141
139
  extraStyles={`margin: 0.5rem; ${extraStyles}`}
@@ -18,15 +18,12 @@ const variants = {
18
18
  const defaultValue = "primary";
19
19
  const groupId = "props";
20
20
 
21
- const buttonHandler = () => console.log("Button selected");
22
-
23
21
  export const buttonWithAction = () => (
24
22
  <ButtonWithAction
25
23
  variant={select(variantsLabel, variants, defaultValue, groupId)}
26
24
  text={text("text", "button", "props")}
27
25
  isLoading={boolean("isLoading", false, "props")}
28
- action={text("action", buttonHandler, "props")}
29
- disabled={boolean("disabled", false, "props")}
26
+ action={text("action", undefined, "props")}
30
27
  />
31
28
  );
32
29
 
@@ -57,11 +57,7 @@ const ButtonWithLink = ({
57
57
  text-decoration: none; }`}
58
58
  dataQa={dataQa}
59
59
  >
60
- <ButtonWithAction
61
- {...otherProps}
62
- disabled={disabled}
63
- extraStyles={extraStyles}
64
- />
60
+ <ButtonWithAction {...otherProps} extraStyles={extraStyles} />
65
61
  </ButtonWithLinkWrapper>
66
62
  );
67
63
  };
@@ -107,21 +107,6 @@ export const BoxWrapper = styled(
107
107
  : ``}
108
108
  `}
109
109
  }
110
-
111
- &[aria-disabled="true"] {
112
- ${({ disabledStyles, as }) =>
113
- css`
114
- ${disabledStyles}
115
- ${as === "button"
116
- ? ` > * > span {
117
- ${disabledStyles}
118
- border: none;
119
- outline: none;
120
- box-shadow: none;
121
- }`
122
- : ``}
123
- `}
124
- }
125
110
 
126
111
  & * {
127
112
  color: ${({ color }) => color};
@@ -36,7 +36,8 @@ const Obligation = ({
36
36
  inactive = false,
37
37
  inactiveLookupTitle = "",
38
38
  inactiveLookupInput = "Account",
39
- inactiveLookupValue = ""
39
+ inactiveLookupValue = "",
40
+ isInCustomerManagement = false
40
41
  }) => {
41
42
  /*
42
43
  The value of obligations is always an array. It can contain:
@@ -137,6 +138,7 @@ const Obligation = ({
137
138
  description={description}
138
139
  subDescription={subDescription}
139
140
  allowedPaymentInstruments={allowedPaymentInstruments}
141
+ isInCustomerManagement={isInCustomerManagement}
140
142
  />
141
143
  )}
142
144
  </Stack>
@@ -160,6 +162,7 @@ const Obligation = ({
160
162
  description={description}
161
163
  subDescription={subDescription}
162
164
  allowedPaymentInstruments={allowedPaymentInstruments}
165
+ isInCustomerManagement={isInCustomerManagement}
163
166
  />
164
167
  )}
165
168
  </Box>
@@ -23,7 +23,8 @@ const PaymentDetailsActions = ({
23
23
  dueDate,
24
24
  description,
25
25
  subDescription,
26
- allowedPaymentInstruments
26
+ allowedPaymentInstruments,
27
+ isInCustomerManagement = false
27
28
  }) => {
28
29
  const planType = isPaymentPlan ? "Payment Plan" : "Autopay";
29
30
  const [isLoading, setIsLoading] = useState(false);
@@ -109,7 +110,7 @@ const PaymentDetailsActions = ({
109
110
  padding={isMobile ? "0 8px 0 0" : "0"}
110
111
  extraStyles={isMobile && `flex-grow: 1;`}
111
112
  >
112
- {autoPayAvailable && !autoPayEnabled ? (
113
+ {autoPayAvailable && !autoPayEnabled && !isInCustomerManagement ? (
113
114
  <ButtonWithAction
114
115
  variant="tertiary"
115
116
  text={`Set Up ${planType}`}
@@ -140,7 +141,7 @@ const PaymentDetailsActions = ({
140
141
  />
141
142
  )}
142
143
  </Box>
143
- {!isMobile && (
144
+ {!isMobile && !isInCustomerManagement && (
144
145
  <Box padding={"0"}>
145
146
  <ButtonWithAction
146
147
  isLoading={isLoading}
@@ -152,7 +153,7 @@ const PaymentDetailsActions = ({
152
153
  </Box>
153
154
  )}
154
155
  </Cluster>
155
- {isMobile && (
156
+ {isMobile && !isInCustomerManagement && (
156
157
  <Box padding="8px 0 0" width="100%">
157
158
  <ButtonWithAction
158
159
  isLoading={isLoading}