@thecb/components 8.1.0 → 8.2.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": "8.1.0",
3
+ "version": "8.2.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
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import styled from "styled-components";
3
+ import Box from "../layouts/Box";
4
+ import Text from "../../atoms/text/";
5
+ import { fallbackValues } from "./Badge.theme";
6
+
7
+ const StyledBadgeContainer = styled(Box)`
8
+ display: flex;
9
+ padding: 2px 8px;
10
+ align-items: center;
11
+ gap: 4px;
12
+ border-radius: 4px;
13
+ background-color: ${({ variant }) => fallbackValues.background[variant]};
14
+ `;
15
+
16
+ const StyledBadge = styled(Text)`
17
+ font-family: "Public Sans";
18
+ font-size: 10px;
19
+ font-style: normal;
20
+ font-weight: 400;
21
+ line-height: 150%; /* 15px */
22
+ letter-spacing: 0.2px;
23
+ color: ${({ variant }) => fallbackValues.color[variant]};
24
+
25
+ @media screen and (min-width: 1024px) {
26
+ font-size: 12px;
27
+ line-height: 150%; /* 18px */
28
+ letter-spacing: 0.24px;
29
+ }
30
+ `;
31
+
32
+ const Badge = ({ label, Icon, variant }) => (
33
+ <StyledBadgeContainer variant={variant}>
34
+ {Icon && <Icon fill={fallbackValues.color[variant]} />}
35
+ <StyledBadge variant={variant}>{label}</StyledBadge>
36
+ </StyledBadgeContainer>
37
+ );
38
+
39
+ export default Badge;
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import { text, select } from "@storybook/addon-knobs";
3
+ import Badge from "./Badge";
4
+ import page from "../../../../.storybook/page";
5
+ import AutopayIcon from "../icons/AutopayIcon";
6
+
7
+ const variants = {
8
+ info: "info",
9
+ warn: "warn",
10
+ primary: "primary",
11
+ success: "success"
12
+ };
13
+ const defaultValue = "success";
14
+ const groupId = "props";
15
+
16
+ export const badge = () => (
17
+ <Badge
18
+ variant={select("variants", variants, defaultValue, groupId)}
19
+ label={text("label", "Autopay Available", "props")}
20
+ Icon={text("Icon", AutopayIcon, "props")}
21
+ />
22
+ );
23
+
24
+ const story = page({
25
+ title: "Components|Atoms/Badge",
26
+ Component: Badge
27
+ });
28
+ export default story;
@@ -0,0 +1,29 @@
1
+ import {
2
+ CORNFLOWER_BLUE,
3
+ HALF_COLONIAL_WHITE,
4
+ HINT_GREEN,
5
+ INFO_BLUE,
6
+ MATISSE_BLUE,
7
+ ROYAL_BLUE,
8
+ SEA_GREEN,
9
+ ZEST_ORANGE
10
+ } from "../../../constants/colors";
11
+
12
+ const background = {
13
+ info: `${INFO_BLUE}`,
14
+ warn: `${HALF_COLONIAL_WHITE}`,
15
+ primary: `${CORNFLOWER_BLUE}`,
16
+ success: `${HINT_GREEN}`
17
+ };
18
+
19
+ const color = {
20
+ info: `${MATISSE_BLUE}`,
21
+ warn: `${ZEST_ORANGE}`,
22
+ primary: `${ROYAL_BLUE}`,
23
+ success: `${SEA_GREEN}`
24
+ };
25
+
26
+ export const fallbackValues = {
27
+ background,
28
+ color
29
+ };
@@ -0,0 +1,3 @@
1
+ import Badge from "./Badge";
2
+
3
+ export default Badge;
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+
3
+ const AutoPayIcon = ({ fill = "#317D4F" }) => (
4
+ <svg
5
+ width="16"
6
+ height="16"
7
+ viewBox="0 0 16 16"
8
+ fill="none"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ >
11
+ <mask
12
+ id="mask0_5560_39870"
13
+ style={{ maskType: "luminance" }}
14
+ maskUnits="userSpaceOnUse"
15
+ x="3"
16
+ y="3"
17
+ width="10"
18
+ height="10"
19
+ >
20
+ <path
21
+ d="M4.81368 7.38351C4.87789 7.38351 4.92927 7.36745 4.9678 7.33535C5.00633 7.30324 5.03202 7.2615 5.04486 7.21012C5.22467 6.49089 5.60677 5.9033 6.19114 5.44736C6.77552 4.99142 7.44018 4.76344 8.1851 4.76344C8.59609 4.76344 8.99103 4.83729 9.36991 4.98499C9.74879 5.13269 10.0924 5.34782 10.4006 5.63038L9.59146 6.43951C9.50155 6.52942 9.45661 6.63859 9.45661 6.76702C9.45661 6.89546 9.50155 7.00463 9.59146 7.09453C9.68136 7.18443 9.79054 7.22939 9.91897 7.22939L12.5005 7.22939C12.629 7.22939 12.7381 7.18443 12.828 7.09453C12.9179 7.00463 12.9629 6.89546 12.9629 6.76702L12.9629 4.18548C12.9629 4.05705 12.9179 3.94788 12.828 3.85797C12.7381 3.76807 12.629 3.72312 12.5005 3.72312C12.3721 3.72312 12.2629 3.76807 12.173 3.85797L11.4795 4.55152C11.0428 4.12769 10.5419 3.80018 9.97677 3.569C9.41166 3.33781 8.81443 3.22222 8.1851 3.22222C7.41449 3.22222 6.69846 3.3924 6.03702 3.73275C5.37558 4.0731 4.82009 4.53868 4.37057 5.12948C3.92105 5.72028 3.62565 6.38172 3.48437 7.1138C3.47153 7.17801 3.48759 7.23902 3.53253 7.29682C3.57749 7.35461 3.63849 7.38351 3.71555 7.38351L4.81368 7.38351ZM8.1851 12.7778C8.95571 12.7778 9.67173 12.6076 10.3332 12.2672C10.9946 11.9269 11.5501 11.4613 11.9996 10.8705C12.4491 10.2797 12.7445 9.61827 12.8858 8.88619C12.8987 8.82197 12.8826 8.76097 12.8377 8.70317C12.7927 8.64537 12.7317 8.61648 12.6546 8.61648H11.5565C11.4923 8.61648 11.4409 8.63253 11.4024 8.66464C11.3639 8.69675 11.3382 8.73849 11.3253 8.78986C11.1455 9.5091 10.7634 10.0967 10.1791 10.5526C9.59467 11.0086 8.93002 11.2366 8.1851 11.2366C7.77411 11.2366 7.37916 11.1627 7.00028 11.015C6.6214 10.8673 6.27784 10.6522 5.96959 10.3696L6.77873 9.56048C6.86864 9.47057 6.91359 9.3614 6.91359 9.23297C6.91359 9.10453 6.86864 8.99536 6.77873 8.90546C6.68882 8.81555 6.57966 8.7706 6.45122 8.7706H3.86968C3.74124 8.7706 3.63207 8.81555 3.54217 8.90546C3.45227 8.99536 3.40731 9.10453 3.40731 9.23297L3.40731 11.8145C3.40731 11.9429 3.45226 12.0521 3.54217 12.142C3.63207 12.2319 3.74124 12.2769 3.86968 12.2769C3.99811 12.2769 4.10728 12.2319 4.19719 12.142L4.89074 11.4485C5.32742 11.8723 5.82831 12.1998 6.39343 12.431C6.95854 12.6622 7.55577 12.7778 8.1851 12.7778Z"
22
+ fill="white"
23
+ />
24
+ </mask>
25
+ <g mask="url(#mask0_5560_39870)">
26
+ <path d="M0 0H16V16H0V0Z" fill={fill} />
27
+ </g>
28
+ </svg>
29
+ );
30
+
31
+ export default AutoPayIcon;
@@ -20,7 +20,6 @@ import {
20
20
  CheckmarkIcon,
21
21
  BankIcon,
22
22
  GenericCard,
23
- PaymentIcon,
24
23
  AutopayOnIcon,
25
24
  SearchIcon,
26
25
  AchReturnIcon,
@@ -65,7 +64,6 @@ export const routingNumberImage = () => <RoutingNumberImage />;
65
64
  export const checkmarkIcon = () => <CheckmarkIcon />;
66
65
  export const bankIcon = () => <BankIcon />;
67
66
  export const genericCard = () => <GenericCard />;
68
- export const paymentIcon = () => <PaymentIcon />;
69
67
  export const autopayOnIcon = () => <AutopayOnIcon />;
70
68
  export const searchIcon = () => <SearchIcon />;
71
69
  export const achReturnIcon = () => <AchReturnIcon />;
@@ -1,6 +1,7 @@
1
1
  export { default as AddObligation } from "./add-obligation";
2
2
  export { default as Alert } from "./alert";
3
3
  export { default as AmountCallout } from "./amount-callout";
4
+ export { default as Badge } from "./badge";
4
5
  export { default as BoxWithShadow } from "./box-with-shadow";
5
6
  export { default as Breadcrumb } from "./breadcrumb";
6
7
  export { default as ButtonWithAction } from "./button-with-action";
@@ -40,6 +40,7 @@ const COOL_GREY_05 = "#fbfcfd"; // CBS-050
40
40
  const CLOUDBURST_BLUE = "#26395c";
41
41
  const ZODIAC_BLUE = "#14284b";
42
42
  const CONGRESS_BLUE = "#005095";
43
+ const ROYAL_BLUE = "#3B5BDB";
43
44
  const SCIENCE_BLUE = "#0074D9";
44
45
  const MARINER_BLUE = "#2E75D2";
45
46
  const CURIOUS_BLUE = "#27A9E1";
@@ -51,9 +52,10 @@ const FOAM_BLUE = "#EFF4FD";
51
52
  const CELLO_BLUE = "#214566";
52
53
  const BOSTON_BLUE = "#357fb8";
53
54
  const INFO_BLUE = "#E4F4FD";
55
+ const CORNFLOWER_BLUE = "#EBEFFB";
54
56
  const HOVER_LIGHT_BLUE = "#EFFAFF";
55
57
  const MATISSE_BLUE = "#15749D";
56
- const ROYAL_BLUE = "#3181E3";
58
+
57
59
  const ASTRAL_BLUE = "#3176AA";
58
60
  const SAPPHIRE_BLUE = "#116285";
59
61
  const PEACOCK_BLUE = "#0E506D";
@@ -147,6 +149,7 @@ export {
147
149
  AQUA_HAZE_WHITE,
148
150
  BLEACH_WHITE,
149
151
  CATSKILL_WHITE,
152
+ CORNFLOWER_BLUE,
150
153
  HALF_COLONIAL_WHITE,
151
154
  ATHENS_GREY,
152
155
  ALTO_GREY,