@thecb/components 9.2.0-beta.2 → 9.2.0-beta.3

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": "9.2.0-beta.2",
3
+ "version": "9.2.0-beta.3",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -1,35 +1,17 @@
1
1
  import React from "react";
2
-
3
- // import CloseIcon from "../CloseIcon";
4
- // import ErrorIcon from "../ErrorMessage/ErrorIcon";
5
- // import SuccessIcon from "../SuccessMessage/SuccessIcon";
6
- // import { SEMI_BOLD } from "@/constants/fonts";
7
- // import { CloseIconWrapper } from "./ToastNotification.styled";
8
2
  import { Box, Cluster } from "../../atoms/layouts";
9
3
  import { Paragraph } from "../../atoms";
10
4
  import {
11
5
  SuccessfulIconMedium,
12
6
  ErroredIcon,
13
- IconQuitLarge,
14
- SuccessfulIconSmall,
7
+ IconQuitLarge
15
8
  } from "../../atoms/icons";
16
- import { ERROR_COLOR, HINT_GREEN } from "../../../constants/colors";
9
+ import { ERROR_BACKGROUND_COLOR, HINT_GREEN } from "../../../constants/colors";
17
10
  import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
18
- import styled from "styled-components";
19
-
20
- export const CloseIconWrapper = styled.div`
21
- min-height: 24px;
22
- min-width: 24px;
23
- display: flex;
24
- margin: 16px;
25
- justify-content: center;
26
- align-items: center;
27
- cursor: pointer;
28
- `;
29
11
 
30
12
  const VARIANTS = {
31
13
  SUCCESS: "success",
32
- ERROR: "error",
14
+ ERROR: "error"
33
15
  };
34
16
 
35
17
  const ToastNotification = ({
@@ -38,6 +20,7 @@ const ToastNotification = ({
38
20
  minWidth = "112px",
39
21
  maxWidth = "350px",
40
22
  height = "56px",
23
+ childGap = "1rem",
41
24
  closeToastNotification,
42
25
  toastOpen,
43
26
  variant = VARIANTS.SUCCESS,
@@ -51,14 +34,14 @@ const ToastNotification = ({
51
34
  : variant === VARIANTS.SUCCESS
52
35
  ? HINT_GREEN
53
36
  : variant === "error"
54
- ? ERROR_COLOR
37
+ ? ERROR_BACKGROUND_COLOR
55
38
  : WHITE
56
39
  }
57
40
  minWidth={minWidth}
58
41
  minHeight={height && parseInt(height) < 100 ? height : "100px"}
59
42
  height={height ? height : "auto"}
60
43
  tabIndex={toastOpen ? "-1" : "0"}
61
- padding="0"
44
+ padding="0rem 1rem"
62
45
  borderRadius="4px"
63
46
  boxShadow="0px 4px 4px rgba(41, 42, 51, 0.15),
64
47
  0px 1px 7px rgba(41, 42, 51, 0.2),
@@ -69,8 +52,8 @@ const ToastNotification = ({
69
52
  ${extraStyles};
70
53
  `}
71
54
  >
72
- <Cluster align="center" childGap="0">
73
- {variant === "success" && <SuccessfulIconSmall />}
55
+ <Cluster align="center" childGap={childGap}>
56
+ {variant === "success" && <SuccessfulIconMedium />}
74
57
  {variant === "error" && <ErroredIcon />}
75
58
  <Box padding="1rem 0" maxWidth={maxWidth}>
76
59
  <Paragraph
@@ -80,9 +63,7 @@ const ToastNotification = ({
80
63
  {message}
81
64
  </Paragraph>
82
65
  </Box>
83
- <CloseIconWrapper>
84
- <IconQuitLarge />
85
- </CloseIconWrapper>
66
+ <IconQuitLarge />
86
67
  </Cluster>
87
68
  </Box>
88
69
  );
@@ -97,6 +97,7 @@ export const COSMOS_RED: Color;
97
97
  export const BLUSH_RED: Color;
98
98
 
99
99
  export const ERROR_COLOR: Color;
100
+ export const ERROR_BACKGROUND_COLOR: Color;
100
101
 
101
102
  export const ALERT_COLORS: {
102
103
  warn: ColorSet;
@@ -90,6 +90,7 @@ const BLUSH_RED = "#FFF0F5";
90
90
 
91
91
  // Second level color constants
92
92
  const ERROR_COLOR = RAZZMATAZZ_RED;
93
+ const ERROR_BACKGROUND_COLOR = "#FFF4F8";
93
94
 
94
95
  // These colors are sequestered so that the alert component can reference them // by type of alert
95
96
  const ALERT_COLORS = {
@@ -221,5 +222,6 @@ export {
221
222
  RASPBERRY,
222
223
  ALERT_COLORS,
223
224
  PILL_COLORS,
224
- ERROR_COLOR
225
+ ERROR_COLOR,
226
+ ERROR_BACKGROUND_COLOR
225
227
  };