@thecb/components 7.7.0-beta.5 → 7.7.1-beta.1

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": "7.7.0-beta.5",
3
+ "version": "7.7.1-beta.1",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -5,7 +5,7 @@ import Text from "../text";
5
5
  import { Box, Stack } from "../layouts";
6
6
  import { fallbackValues } from "./FormattedCreditCard.theme";
7
7
  import { themeComponent } from "../../../util/themeUtils";
8
- import { renderCardStatus } from "../../../util/general";
8
+ import { renderCardStatus } from "../../../util/formats";
9
9
 
10
10
  export const CreditCardWrapper = styled.div`
11
11
  display: flex;
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import { fallbackValues } from "./Icons.theme";
3
+ import { themeComponent } from "../../../util/themeUtils";
4
+
5
+ const HistoryIconSmall = ({ themeValues, iconIndex = 0 }) => {
6
+ return (
7
+ <svg
8
+ width="20"
9
+ height="20"
10
+ viewBox="0 0 20 20"
11
+ fill="none"
12
+ xmlns="http://www.w3.org/2000/svg"
13
+ >
14
+ <path
15
+ d="M3.33337 8.33333C3.33337 7.8731 3.70647 7.5 4.16671 7.5H15.8334C16.2936 7.5 16.6667 7.8731 16.6667 8.33333V16.6667C16.6667 17.1269 16.2936 17.5 15.8334 17.5H4.16671C3.70647 17.5 3.33337 17.1269 3.33337 16.6667V8.33333Z"
16
+ fill={themeValues.singleIconColor}
17
+ />
18
+ <path
19
+ fillRule="evenodd"
20
+ clipRule="evenodd"
21
+ d="M5.08337 4.75C4.66916 4.75 4.33337 5.08579 4.33337 5.5C4.33337 5.91421 4.66916 6.25 5.08337 6.25H14.9134C15.3276 6.25 15.6634 5.91421 15.6634 5.5C15.6634 5.08579 15.3276 4.75 14.9134 4.75H5.08337Z"
22
+ fill={themeValues.singleIconColor}
23
+ />
24
+ <path
25
+ fillRule="evenodd"
26
+ clipRule="evenodd"
27
+ d="M6.03337 2.25C5.64677 2.25 5.33337 2.5634 5.33337 2.95C5.33337 3.3366 5.64678 3.65 6.03337 3.65H13.9634C14.35 3.65 14.6634 3.3366 14.6634 2.95C14.6634 2.5634 14.35 2.25 13.9634 2.25H6.03337Z"
28
+ fill={themeValues.singleIconColor}
29
+ />
30
+ </svg>
31
+ );
32
+ };
33
+
34
+ export default themeComponent(
35
+ HistoryIconSmall,
36
+ "Icons",
37
+ fallbackValues,
38
+ "primary"
39
+ );
@@ -62,6 +62,7 @@ import GuidedCheckoutImage from "./GuidedCheckoutImage";
62
62
  import ProfileImage from "./ProfileImage";
63
63
  import RevenueManagementImage from "./RevenueManagementImage";
64
64
  import FindIconSmall from "./FindIconSmall";
65
+ import HistoryIconSmall from "./HistoryIconSmall";
65
66
 
66
67
  export {
67
68
  AccountsIcon,
@@ -127,5 +128,6 @@ export {
127
128
  GuidedCheckoutImage,
128
129
  ProfileImage,
129
130
  RevenueManagementImage,
130
- FindIconSmall
131
+ FindIconSmall,
132
+ HistoryIconSmall
131
133
  };
@@ -1,4 +1,7 @@
1
+ import React from "react";
1
2
  import { createFormat } from "formatted-input";
3
+ import Text from "../components/atoms/text";
4
+ import { ASH_GREY, FIRE_YELLOW } from "../constants/colors";
2
5
  export const formatDelimiter = "_";
3
6
 
4
7
  export const phoneFormats = [
@@ -80,3 +83,53 @@ export const expirationDateFormat = createFormat(
80
83
  );
81
84
  export const phoneFormat = createFormat(phoneFormats, formatDelimiter);
82
85
  export const moneyFormat = createFormat(moneyFormats, formatDelimiter);
86
+
87
+ export const renderCardStatus = (
88
+ expirationStatus,
89
+ expireDate,
90
+ textAlign = "right",
91
+ as = "span"
92
+ ) => {
93
+ const ACTIVE = "ACTIVE";
94
+ const EXPIRING_SOON = "EXPIRING_SOON";
95
+ const EXPIRED = "EXPIRED";
96
+ const textMargin = textAlign === "right" ? "auto" : "0";
97
+
98
+ switch (expirationStatus) {
99
+ case ACTIVE:
100
+ return (
101
+ <Text
102
+ as={as}
103
+ variant="pXS"
104
+ color={ASH_GREY}
105
+ extraStyles={`text-align: ${textAlign}; margin: ${textMargin};`}
106
+ >
107
+ Exp Date {expireDate}
108
+ </Text>
109
+ );
110
+ case EXPIRING_SOON:
111
+ return (
112
+ <Text
113
+ as={as}
114
+ variant="pXS"
115
+ color={FIRE_YELLOW}
116
+ extraStyles={`text-align: ${textAlign}; margin: ${textMargin};`}
117
+ >
118
+ Expiring Soon {expireDate}
119
+ </Text>
120
+ );
121
+ case EXPIRED:
122
+ return (
123
+ <Text
124
+ as={as}
125
+ variant="pXS"
126
+ color={ASH_GREY}
127
+ extraStyles={`text-align: ${textAlign}; margin: ${textMargin};`}
128
+ >
129
+ Expired
130
+ </Text>
131
+ );
132
+ default:
133
+ null;
134
+ }
135
+ };
@@ -1,7 +1,6 @@
1
1
  import React, { Fragment } from "react";
2
2
  import numeral from "numeral";
3
- import { CHARADE_GREY, ASH_GREY, FIRE_YELLOW } from "../constants/colors";
4
- import Text from "../components/atoms/text";
3
+ import { CHARADE_GREY } from "../constants/colors";
5
4
 
6
5
  export const noop = () => {};
7
6
 
@@ -160,53 +159,3 @@ export const titleCaseString = string => {
160
159
  )
161
160
  .join(" ");
162
161
  };
163
-
164
- export const renderCardStatus = (
165
- expirationStatus,
166
- expireDate,
167
- textAlign = "right",
168
- as = "span"
169
- ) => {
170
- const ACTIVE = "ACTIVE";
171
- const EXPIRING_SOON = "EXPIRING_SOON";
172
- const EXPIRED = "EXPIRED";
173
- const textMargin = textAlign === "right" ? "auto" : "0";
174
-
175
- switch (expirationStatus) {
176
- case ACTIVE:
177
- return (
178
- <Text
179
- as={as}
180
- variant="pXS"
181
- color={ASH_GREY}
182
- extraStyles={`text-align: ${textAlign}; margin: ${textMargin};`}
183
- >
184
- Exp Date {expireDate}
185
- </Text>
186
- );
187
- case EXPIRING_SOON:
188
- return (
189
- <Text
190
- as={as}
191
- variant="pXS"
192
- color={FIRE_YELLOW}
193
- extraStyles={`text-align: ${textAlign}; margin: ${textMargin};`}
194
- >
195
- Expiring Soon {expireDate}
196
- </Text>
197
- );
198
- case EXPIRED:
199
- return (
200
- <Text
201
- as={as}
202
- variant="pXS"
203
- color={ASH_GREY}
204
- extraStyles={`text-align: ${textAlign}; margin: ${textMargin};`}
205
- >
206
- Expired
207
- </Text>
208
- );
209
- default:
210
- null;
211
- }
212
- };
package/src/.DS_Store DELETED
Binary file
Binary file