@thecb/components 10.4.0-beta.0 → 10.4.0-beta.2

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 (62) hide show
  1. package/README.md +2 -2
  2. package/dist/index.cjs.js +812 -323
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.d.ts +64 -1
  5. package/dist/index.esm.js +808 -322
  6. package/dist/index.esm.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/atoms/badge/Badge.js +6 -2
  9. package/src/components/atoms/badge/Badge.stories.js +2 -1
  10. package/src/components/atoms/badge/Badge.theme.js +8 -4
  11. package/src/components/atoms/breadcrumb/Breadcrumb.js +4 -3
  12. package/src/components/atoms/breadcrumb/Breadcrumb.theme.js +5 -2
  13. package/src/components/atoms/button-with-action/ButtonWithAction.js +34 -31
  14. package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +5 -1
  15. package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +74 -4
  16. package/src/components/atoms/button-with-link/ButtonWithLink.js +7 -3
  17. package/src/components/atoms/form-layouts/FormInput.js +1 -1
  18. package/src/components/atoms/icons/AutopayIcon.js +2 -2
  19. package/src/components/atoms/icons/CloseIcon.d.ts +1 -0
  20. package/src/components/atoms/icons/CloseIcon.js +48 -0
  21. package/src/components/atoms/icons/MultiCartIcon.js +12 -10
  22. package/src/components/atoms/icons/TrashIconV2.d.ts +1 -0
  23. package/src/components/atoms/icons/TrashIconV2.js +41 -0
  24. package/src/components/atoms/icons/icons.stories.js +5 -1
  25. package/src/components/atoms/icons/index.d.ts +2 -0
  26. package/src/components/atoms/icons/index.js +5 -1
  27. package/src/components/atoms/jumbo/Jumbo.js +1 -5
  28. package/src/components/atoms/layouts/Box.js +1 -0
  29. package/src/components/atoms/layouts/Box.styled.js +15 -0
  30. package/src/components/atoms/layouts/examples/box-example/BoxExample.stories.js +2 -1
  31. package/src/components/atoms/link/ExternalLink.styled.js +6 -3
  32. package/src/components/atoms/link/InternalLink.styled.js +6 -3
  33. package/src/components/atoms/placeholder/Placeholder.js +87 -74
  34. package/src/components/atoms/placeholder/Placeholder.stories.js +2 -2
  35. package/src/components/atoms/text/Text.styled.js +1 -0
  36. package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.js +1 -0
  37. package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.stories.js +41 -0
  38. package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.theme.js +10 -2
  39. package/src/components/molecules/index.d.ts +1 -0
  40. package/src/components/molecules/index.js +1 -0
  41. package/src/components/molecules/link-card/LinkCard.js +13 -6
  42. package/src/components/molecules/link-card/LinkCard.stories.js +64 -34
  43. package/src/components/molecules/link-card/LinkCard.styled.js +11 -4
  44. package/src/components/molecules/link-card/LinkCard.theme.js +20 -5
  45. package/src/components/molecules/obligation/Obligation.js +3 -0
  46. package/src/components/molecules/obligation/modules/AmountModule.js +3 -1
  47. package/src/components/molecules/obligation/modules/AutopayModalModule.js +33 -21
  48. package/src/components/molecules/obligation/modules/InactiveControlsModule.js +6 -3
  49. package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +20 -5
  50. package/src/components/molecules/obligation/modules/RemoveAccountModalModule.js +4 -2
  51. package/src/components/molecules/pagination/Pagination.js +1 -7
  52. package/src/components/molecules/pagination/Pagination.stories.js +32 -0
  53. package/src/components/molecules/pagination/Pagination.theme.js +1 -2
  54. package/src/components/molecules/payment-button-bar/PaymentButtonBar.js +6 -1
  55. package/src/components/molecules/tab-sidebar/TabSidebar.js +2 -2
  56. package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.js +1 -0
  57. package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.theme.js +10 -2
  58. package/src/components/templates/default-page-template/DefaultPageTemplate.js +3 -2
  59. package/src/constants/index.d.ts +2 -1
  60. package/src/constants/index.js +12 -3
  61. package/src/constants/style_constants.d.ts +11 -0
  62. package/src/constants/style_constants.js +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "10.4.0-beta.0",
3
+ "version": "10.4.0-beta.2",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -32,9 +32,13 @@ const StyledBadge = styled(Text)`
32
32
 
33
33
  const Badge = ({ label, Icon, themeValues, iconOnLeft = true }) => (
34
34
  <StyledBadgeContainer background={themeValues.background}>
35
- {iconOnLeft && Icon && <Icon fill={themeValues.color} />}
35
+ {iconOnLeft && Icon && (
36
+ <Icon color={themeValues.color} fill={themeValues.color} />
37
+ )}
36
38
  <StyledBadge color={themeValues.color}>{label}</StyledBadge>
37
- {!iconOnLeft && Icon && <Icon fill={themeValues.color} />}
39
+ {!iconOnLeft && Icon && (
40
+ <Icon color={themeValues.color} fill={themeValues.color} />
41
+ )}
38
42
  </StyledBadgeContainer>
39
43
  );
40
44
 
@@ -9,7 +9,8 @@ const variants = {
9
9
  info: "info",
10
10
  warn: "warn",
11
11
  primary: "primary",
12
- success: "success"
12
+ success: "success",
13
+ disabled: "disabled"
13
14
  };
14
15
 
15
16
  const defaultValue = "success";
@@ -1,4 +1,6 @@
1
1
  import {
2
+ MANATEE_GREY,
3
+ GRECIAN_GREY,
2
4
  CORNFLOWER_BLUE,
3
5
  HALF_COLONIAL_WHITE,
4
6
  HINT_GREEN,
@@ -13,17 +15,19 @@ const background = {
13
15
  info: `${INFO_BLUE}`,
14
16
  warn: `${HALF_COLONIAL_WHITE}`,
15
17
  primary: `${CORNFLOWER_BLUE}`,
16
- success: `${HINT_GREEN}`
18
+ success: `${HINT_GREEN}`,
19
+ disabled: `${GRECIAN_GREY}`
17
20
  };
18
21
 
19
22
  const color = {
20
23
  info: `${MATISSE_BLUE}`,
21
24
  warn: `${ZEST_ORANGE}`,
22
25
  primary: `${ROYAL_BLUE_VIVID}`,
23
- success: `${SEA_GREEN}`
26
+ success: `${SEA_GREEN}`,
27
+ disabled: `${MANATEE_GREY}`
24
28
  };
25
29
 
26
30
  export const fallbackValues = {
27
- background,
28
- color
31
+ background: background,
32
+ color: color
29
33
  };
@@ -33,15 +33,16 @@ const Breadcrumbs = ({ breadcrumbsList = [] }) => {
33
33
  margin={themeValues.margin}
34
34
  extraStyles={`
35
35
  text-transform: uppercase;
36
+ text-decoration: none;
36
37
  ${isActive.toString() === "true" &&
37
- `pointer-events: none;
38
- color: ${themeValues.activeBreadcrumbColor};
38
+ `color: ${themeValues.activeBreadcrumbColor};
39
+ pointer-events: none;
39
40
  `}
40
41
  &:first-child {
41
42
  margin-left: 0;
42
43
  }
43
44
  &:active {
44
- color: ${themeValues.activeColor};
45
+ color: ${themeValues.activeColor};
45
46
  }`}
46
47
  >
47
48
  {linkText}
@@ -1,5 +1,8 @@
1
1
  // import theme from "styled-theming";
2
- import { MATISSE_BLUE, STORM_GREY } from "../../../constants/colors";
2
+ import { colors, styleConstants } from "../../../constants";
3
+
4
+ const { MATISSE_BLUE, STORM_GREY } = colors;
5
+ const { LINK_TEXT_DECORATION } = styleConstants;
3
6
 
4
7
  /*
5
8
  For now I'm using string values, eventually shared components library will have its own constants file
@@ -13,7 +16,7 @@ const fontSize = "0.875rem";
13
16
  const lineHeight = "1.25rem";
14
17
  const fontWeight = "400";
15
18
  const margin = "0.5rem";
16
- const hover = `text-decoration: none;`;
19
+ const hover = `text-decoration: ${LINK_TEXT_DECORATION};`;
17
20
 
18
21
  export const fallbackValues = {
19
22
  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(
@@ -68,6 +68,7 @@ const ButtonWithAction = forwardRef(
68
68
  text,
69
69
  textWrap = false,
70
70
  isLoading = false,
71
+ disabled = false,
71
72
  loadingColor = "white",
72
73
  dataQa = null,
73
74
  textExtraStyles,
@@ -90,35 +91,35 @@ const ButtonWithAction = forwardRef(
90
91
  const { isMobile } = themeContext;
91
92
 
92
93
  const hoverStyles = `
93
- outline: none;
94
- background-color: ${themeValues.hoverBackgroundColor};
95
- border-color: ${themeValues.hoverBorderColor};
96
- color: ${themeValues.hoverColor};
97
- text-decoration: ${
98
- variant === "ghost" || variant === "smallGhost" ? "underline" : "none"
99
- };
100
- cursor: pointer;
101
- `;
94
+ outline: none;
95
+ background-color: ${themeValues.hoverBackgroundColor};
96
+ border-color: ${themeValues.hoverBorderColor};
97
+ color: ${themeValues.hoverColor};
98
+ text-decoration: ${
99
+ variant === "ghost" || variant === "smallGhost" ? "underline" : "none"
100
+ };
101
+ cursor: pointer;
102
+ `;
102
103
  const activeStyles = `
103
- outline: none;
104
- background-color: ${themeValues.activeBackgroundColor};
105
- border-color: ${themeValues.activeBorderColor};
106
- color: ${themeValues.activeColor};
107
- text-decoration: ${
108
- variant === "ghost" || variant === "smallGhost" ? "underline" : "none"
109
- };
110
- `;
111
- const disabledStyles = `
112
- background-color: #6D717E;
113
- border-color: #6D717E;
114
- color: #FFFFFF;
115
- cursor: default;
116
- &:focus {
117
- box-shadow: 0 0 10px #6D717E;
118
104
  outline: none;
119
- }
120
- ${extraDisabledStyles}
105
+ background-color: ${themeValues.activeBackgroundColor};
106
+ border-color: ${themeValues.activeBorderColor};
107
+ color: ${themeValues.activeColor};
108
+ text-decoration: ${
109
+ variant === "ghost" || variant === "smallGhost" ? "underline" : "none"
110
+ };
121
111
  `;
112
+ const disabledStyles = `
113
+ background-color: ${themeValues.disabledBackgroundColor};
114
+ border-color: ${themeValues.disabledBorderColor};
115
+ color: ${themeValues.disabledColor};
116
+ cursor: default;
117
+ &:focus {
118
+ outline: 3px solid ${themeValues.disabledBorderColor};
119
+ outline-offset: 2px;
120
+ }
121
+ ${extraDisabledStyles}
122
+ `;
122
123
 
123
124
  return (
124
125
  <Box
@@ -129,11 +130,12 @@ const ButtonWithAction = forwardRef(
129
130
  minWidth={themeValues.minWidth}
130
131
  background={themeValues.backgroundColor}
131
132
  border={themeValues.border}
132
- hoverStyles={hoverStyles}
133
- activeStyles={activeStyles}
133
+ hoverStyles={disabled ? disabledStyles : hoverStyles}
134
+ activeStyles={disabled ? disabledStyles : activeStyles}
134
135
  disabledStyles={disabledStyles}
136
+ aria-disabled={disabled}
135
137
  as="button"
136
- onClick={isLoading ? undefined : action}
138
+ onClick={isLoading || disabled ? undefined : action}
137
139
  borderRadius="2px"
138
140
  theme={themeContext}
139
141
  extraStyles={`margin: 0.5rem; ${extraStyles}`}
@@ -151,7 +153,8 @@ const ButtonWithAction = forwardRef(
151
153
  <Text
152
154
  weight={themeValues.fontWeight}
153
155
  variant={themeValues.fontSizeVariant}
154
- color={themeValues.color}
156
+ color={disabled ? themeValues.disabledColor : themeValues.color}
157
+ textDecoration={themeValues.textDecoration}
155
158
  textWrap={textWrap}
156
159
  extraStyles={textExtraStyles}
157
160
  >
@@ -12,18 +12,22 @@ const variants = {
12
12
  smallSecondary: "smallSecondary",
13
13
  ghost: "ghost",
14
14
  smallGhost: "smallGhost",
15
+ tertiary: "tertiary",
15
16
  danger: "danger",
16
17
  None: undefined
17
18
  };
18
19
  const defaultValue = "primary";
19
20
  const groupId = "props";
20
21
 
22
+ const buttonHandler = () => console.log("Button selected");
23
+
21
24
  export const buttonWithAction = () => (
22
25
  <ButtonWithAction
23
26
  variant={select(variantsLabel, variants, defaultValue, groupId)}
27
+ disabled={boolean("disabled", false, "props")}
24
28
  text={text("text", "button", "props")}
25
29
  isLoading={boolean("isLoading", false, "props")}
26
- action={text("action", undefined, "props")}
30
+ action={text("action", buttonHandler, "props")}
27
31
  />
28
32
  );
29
33
 
@@ -1,12 +1,63 @@
1
- import {
1
+ import { colors, styleConstants } from "../../../constants";
2
+
3
+ const {
2
4
  WHITE,
3
5
  TRANSPARENT,
4
6
  SAPPHIRE_BLUE,
5
7
  PEACOCK_BLUE,
8
+ MANATEE_GREY,
6
9
  MATISSE_BLUE,
7
10
  RASPBERRY,
8
- ERROR_COLOR
9
- } from "../../../constants/colors";
11
+ ERROR_COLOR,
12
+ STORM_GREY
13
+ } = colors;
14
+
15
+ const { LINK_TEXT_DECORATION } = styleConstants;
16
+
17
+ const disabledBorderColor = {
18
+ primary: STORM_GREY,
19
+ secondary: STORM_GREY,
20
+ back: TRANSPARENT,
21
+ smallPrimary: STORM_GREY,
22
+ smallSecondary: STORM_GREY,
23
+ smallGhost: TRANSPARENT,
24
+ ghost: TRANSPARENT,
25
+ tertiary: TRANSPARENT,
26
+ danger: STORM_GREY,
27
+ dangerSecondary: STORM_GREY,
28
+ whiteSecondary: TRANSPARENT,
29
+ whitePrimary: TRANSPARENT
30
+ };
31
+
32
+ const disabledColor = {
33
+ primary: WHITE,
34
+ secondary: MANATEE_GREY,
35
+ back: MANATEE_GREY,
36
+ smallPrimary: WHITE,
37
+ smallSecondary: MANATEE_GREY,
38
+ smallGhost: MANATEE_GREY,
39
+ ghost: MANATEE_GREY,
40
+ tertiary: MANATEE_GREY,
41
+ danger: WHITE,
42
+ dangerSecondary: MANATEE_GREY,
43
+ whiteSecondary: MANATEE_GREY,
44
+ whitePrimary: MANATEE_GREY
45
+ };
46
+
47
+ const disabledBackgroundColor = {
48
+ primary: MANATEE_GREY,
49
+ secondary: TRANSPARENT,
50
+ back: TRANSPARENT,
51
+ smallPrimary: MANATEE_GREY,
52
+ smallSecondary: TRANSPARENT,
53
+ smallGhost: TRANSPARENT,
54
+ ghost: TRANSPARENT,
55
+ tertiary: TRANSPARENT,
56
+ danger: MANATEE_GREY,
57
+ dangerSecondary: TRANSPARENT,
58
+ whiteSecondary: TRANSPARENT,
59
+ whitePrimary: TRANSPARENT
60
+ };
10
61
 
11
62
  const padding = {
12
63
  primary: "0.75rem 1.5rem",
@@ -98,6 +149,21 @@ const minWidth = {
98
149
  whitePrimary: "130px"
99
150
  };
100
151
 
152
+ const textDecoration = {
153
+ primary: "none",
154
+ secondary: "none",
155
+ back: "none",
156
+ smallPrimary: "none",
157
+ smallSecondary: "none",
158
+ smallGhost: LINK_TEXT_DECORATION,
159
+ ghost: LINK_TEXT_DECORATION,
160
+ tertiary: "none",
161
+ danger: "none",
162
+ dangerSecondary: "none",
163
+ whiteSecondary: "none",
164
+ whitePrimary: "none"
165
+ };
166
+
101
167
  const backgroundColor = {
102
168
  primary: MATISSE_BLUE,
103
169
  secondary: TRANSPARENT,
@@ -225,6 +291,7 @@ export const fallbackValues = {
225
291
  fontWeight,
226
292
  height,
227
293
  minWidth,
294
+ textDecoration,
228
295
  backgroundColor,
229
296
  border,
230
297
  hoverBackgroundColor,
@@ -232,5 +299,8 @@ export const fallbackValues = {
232
299
  hoverColor,
233
300
  activeBackgroundColor,
234
301
  activeBorderColor,
235
- activeColor
302
+ activeColor,
303
+ disabledColor,
304
+ disabledBackgroundColor,
305
+ disabledBorderColor
236
306
  };
@@ -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
@@ -57,7 +57,11 @@ const ButtonWithLink = ({
57
57
  text-decoration: none; }`}
58
58
  dataQa={dataQa}
59
59
  >
60
- <ButtonWithAction {...otherProps} extraStyles={extraStyles} />
60
+ <ButtonWithAction
61
+ {...otherProps}
62
+ disabled={disabled}
63
+ extraStyles={extraStyles}
64
+ />
61
65
  </ButtonWithLinkWrapper>
62
66
  );
63
67
  };
@@ -172,7 +172,7 @@ const FormInput = ({
172
172
  color={themeValues.linkColor}
173
173
  weight={themeValues.fontWeight}
174
174
  hoverStyles={themeValues.hoverFocusStyles}
175
- extraStyles={`cursor: pointer; &:focus { outline-offset: -2px; }`}
175
+ extraStyles={`text-decoration: underline; cursor: pointer; &:focus { outline-offset: -2px; }`}
176
176
  onClick={() => setShowPassword(!showPassword)}
177
177
  tabIndex="0"
178
178
  aria-label={showPassword ? "Hide Password" : "Show password"}
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
 
3
3
  // Fill color based on default "success" variant color
4
- const AutopayIcon = ({ fill = "#317D4F" }) => (
4
+ const AutopayIcon = ({ fill = "#317D4F", color = "#317D4F" }) => (
5
5
  <svg
6
6
  width="16"
7
7
  height="16"
@@ -24,7 +24,7 @@ const AutopayIcon = ({ fill = "#317D4F" }) => (
24
24
  />
25
25
  </mask>
26
26
  <g mask="url(#mask0_5560_39870)">
27
- <path d="M0 0H16V16H0V0Z" fill={fill} />
27
+ <path d="M0 0H16V16H0V0Z" fill={fill || color} />
28
28
  </g>
29
29
  </svg>
30
30
  );
@@ -0,0 +1 @@
1
+ export const CloseIcon: JSX.Element;
@@ -0,0 +1,48 @@
1
+ import React from "react";
2
+
3
+ export const CloseIcon = ({
4
+ iconFill = "#3B414D",
5
+ iconWidth = "24",
6
+ iconHeight = "24",
7
+ ...rest
8
+ }) => {
9
+ return (
10
+ <svg
11
+ xmlns="http://www.w3.org/2000/svg"
12
+ width={iconWidth}
13
+ height={iconHeight}
14
+ viewBox="0 0 24 24"
15
+ fill="none"
16
+ {...rest}
17
+ >
18
+ <title>Close Icon</title>
19
+ <path
20
+ fillRule="evenodd"
21
+ clipRule="evenodd"
22
+ d="M17.3033 5.98982C17.108 5.79456 16.7915 5.79456 16.5962 5.98982L12 10.586L7.40381 5.98982C7.20854 5.79456 6.89196 5.79456 6.6967 5.98982L5.98959 6.69693C5.79433 6.89219 5.79433 7.20878 5.98959 7.40404L10.5858 12.0002L5.98959 16.5964C5.79433 16.7917 5.79433 17.1083 5.98959 17.3035L6.6967 18.0106C6.89196 18.2059 7.20854 18.2059 7.40381 18.0106L12 13.4144L16.5962 18.0106C16.7915 18.2059 17.108 18.2059 17.3033 18.0106L18.0104 17.3035C18.2057 17.1083 18.2057 16.7917 18.0104 16.5964L13.4142 12.0002L18.0104 7.40404C18.2057 7.20878 18.2057 6.89219 18.0104 6.69693L17.3033 5.98982Z"
23
+ fill={iconFill}
24
+ />
25
+ <mask
26
+ id="mask0_3727_16765"
27
+ style={{ maskType: "luminance" }}
28
+ maskUnits="userSpaceOnUse"
29
+ x="5"
30
+ y="5"
31
+ width="14"
32
+ height="14"
33
+ >
34
+ <path
35
+ fillRule="evenodd"
36
+ clipRule="evenodd"
37
+ d="M17.3033 5.98982C17.108 5.79456 16.7915 5.79456 16.5962 5.98982L12 10.586L7.40381 5.98982C7.20854 5.79456 6.89196 5.79456 6.6967 5.98982L5.98959 6.69693C5.79433 6.89219 5.79433 7.20878 5.98959 7.40404L10.5858 12.0002L5.98959 16.5964C5.79433 16.7917 5.79433 17.1083 5.98959 17.3035L6.6967 18.0106C6.89196 18.2059 7.20854 18.2059 7.40381 18.0106L12 13.4144L16.5962 18.0106C16.7915 18.2059 17.108 18.2059 17.3033 18.0106L18.0104 17.3035C18.2057 17.1083 18.2057 16.7917 18.0104 16.5964L13.4142 12.0002L18.0104 7.40404C18.2057 7.20878 18.2057 6.89219 18.0104 6.69693L17.3033 5.98982Z"
38
+ fill="none"
39
+ />
40
+ </mask>
41
+ <g mask="url(#mask0_3727_16765)">
42
+ <path d="M0 0H24V24H0V0Z" fill={iconFill} />
43
+ </g>
44
+ </svg>
45
+ );
46
+ };
47
+
48
+ export default CloseIcon;
@@ -1,23 +1,25 @@
1
1
  import React from "react";
2
2
 
3
- const MultiCartIcon = ({ iconFill = "#3B5BDB", isMobile = true }) => {
4
- const iconWidth = isMobile ? "20" : "25";
5
- const iconHeight = isMobile ? "17" : "23";
3
+ const MultiCartIcon = ({
4
+ iconFill = "#3B5BDB",
5
+ iconWidth = "20",
6
+ iconHeight = "17",
7
+ ...rest
8
+ }) => {
6
9
  return (
7
10
  <svg
8
11
  xmlns="http://www.w3.org/2000/svg"
9
12
  width={iconWidth}
10
13
  height={iconHeight}
11
- viewBox={`0 0 ${iconWidth} ${iconHeight}`}
12
- fill="none"
14
+ viewBox="0 0 24.81 22.06"
15
+ {...rest}
13
16
  >
17
+ <title>Icon - Cart-Empty</title>
14
18
  <path
15
- d={
16
- isMobile
17
- ? "M17.5312 9.99414C17.4648 10.1934 17.3652 10.3594 17.2324 10.459C17.0996 10.5918 16.9336 10.625 16.7676 10.625H7.03906L7.23828 11.6875H16.1699C16.4023 11.6875 16.6016 11.7871 16.7676 11.9863C16.9004 12.1855 16.9668 12.418 16.9336 12.6504L16.7344 13.4805C17.0664 13.6465 17.2988 13.8789 17.498 14.1777C17.6973 14.4766 17.7969 14.8086 17.7969 15.1406C17.7969 15.6719 17.5977 16.1035 17.2324 16.4688C16.8672 16.834 16.4355 17 15.9375 17C15.4062 17 14.9746 16.834 14.6094 16.4688C14.2441 16.1035 14.0781 15.6719 14.0781 15.1406C14.0781 14.6094 14.2441 14.1777 14.6426 13.8125H7.66992C8.03516 14.1777 8.23438 14.6094 8.23438 15.1406C8.23438 15.6719 8.03516 16.1035 7.66992 16.4688C7.30469 16.834 6.87305 17 6.375 17C5.84375 17 5.41211 16.834 5.04688 16.4688C4.68164 16.1035 4.51562 15.6719 4.51562 15.1406C4.51562 14.8086 4.58203 14.5098 4.74805 14.2109C4.91406 13.9453 5.14648 13.7129 5.44531 13.5137L3.12109 2.125H0.796875C0.564453 2.125 0.365234 2.05859 0.232422 1.89258C0.0664062 1.75977 0 1.56055 0 1.32812V0.796875C0 0.597656 0.0664062 0.398438 0.232422 0.232422C0.365234 0.0996094 0.564453 0 0.796875 0H4.2168C4.38281 0 4.54883 0.0664062 4.68164 0.199219C4.81445 0.332031 4.91406 0.464844 4.98047 0.630859L5.2793 2.125H18.3281C18.5938 2.125 18.793 2.22461 18.959 2.42383C19.0918 2.62305 19.1582 2.85547 19.0918 3.08789L17.5312 9.99414Z"
18
- : "M22.6875 13.4336C22.6016 13.6914 22.4727 13.9062 22.3008 14.0352C22.1289 14.207 21.9141 14.25 21.6992 14.25H9.10938L9.36719 15.625H20.9258C21.2266 15.625 21.4844 15.7539 21.6992 16.0117C21.8711 16.2695 21.957 16.5703 21.9141 16.8711L21.6562 17.9453C22.0859 18.1602 22.3867 18.4609 22.6445 18.8477C22.9023 19.2344 23.0312 19.6641 23.0312 20.0938C23.0312 20.7812 22.7734 21.3398 22.3008 21.8125C21.8281 22.2852 21.2695 22.5 20.625 22.5C19.9375 22.5 19.3789 22.2852 18.9062 21.8125C18.4336 21.3398 18.2188 20.7812 18.2188 20.0938C18.2188 19.4062 18.4336 18.8477 18.9492 18.375H9.92578C10.3984 18.8477 10.6562 19.4062 10.6562 20.0938C10.6562 20.7812 10.3984 21.3398 9.92578 21.8125C9.45312 22.2852 8.89453 22.5 8.25 22.5C7.5625 22.5 7.00391 22.2852 6.53125 21.8125C6.05859 21.3398 5.84375 20.7812 5.84375 20.0938C5.84375 19.6641 5.92969 19.2773 6.14453 18.8906C6.35938 18.5469 6.66016 18.2461 7.04688 17.9883L4.03906 3.25H1.03125C0.730469 3.25 0.472656 3.16406 0.300781 2.94922C0.0859375 2.77734 0 2.51953 0 2.21875V1.53125C0 1.27344 0.0859375 1.01562 0.300781 0.800781C0.472656 0.628906 0.730469 0.5 1.03125 0.5H5.45703C5.67188 0.5 5.88672 0.585938 6.05859 0.757812C6.23047 0.929688 6.35938 1.10156 6.44531 1.31641L6.83203 3.25H23.7188C24.0625 3.25 24.3203 3.37891 24.5352 3.63672C24.707 3.89453 24.793 4.19531 24.707 4.49609L22.6875 13.4336Z"
19
- }
19
+ d="M18.7499553,20.499994 C19.348912,20.499994 19.8632339,20.2851508 20.2929204,19.8554643 C20.7226068,19.4257779 20.9374501,18.911456 20.9374501,18.3124993 C20.9374501,17.8958334 20.8267735,17.5117199 20.6054196,17.1601583 C20.3840658,16.8085966 20.0780771,16.5416703 19.6874531,16.3593789 L19.6874531,16.3593789 L19.9218275,15.3828187 C19.9739105,15.0963613 19.9088069,14.835945 19.7265155,14.6015706 C19.544224,14.3671962 19.3098496,14.2500089 19.0233921,14.2500089 L19.0233921,14.2500089 L8.5156047,14.2500089 L8.28123026,13.0000119 L19.7265155,13.0000119 C19.9348481,13.0000119 20.1236501,12.9349077 20.2929204,12.8046999 C20.4621906,12.6744921 20.5728678,12.4922006 20.6249508,12.2578262 L20.6249508,12.2578262 L22.4608839,4.13284556 C22.5390088,3.84638811 22.4869258,3.58597187 22.3046343,3.35159742 C22.1223429,3.11722298 21.8749478,3.00004172 21.5624486,3.00004172 L21.5624486,3.00004172 L6.21092269,3.00004172 L5.85936103,1.24222745 C5.80727802,1.03389482 5.6966008,0.858113985 5.52733057,0.714884961 C5.35806034,0.571655937 5.16925831,0.500041723 4.96092567,0.500041723 L4.96092567,0.500041723 L0.937497765,0.500041723 C0.67708152,0.500041723 0.455728279,0.591187141 0.273436848,0.773478571 C0.0911454173,0.955770002 0,1.17712324 0,1.43753949 L0,1.43753949 L0,2.062538 C0,2.32295424 0.0911454173,2.54430748 0.273436848,2.72659891 C0.455728279,2.90889035 0.67708152,3.00004172 0.937497765,3.00004172 L0.937497765,3.00004172 L3.67186625,3.00004172 L6.40623473,16.3984413 C6.06769367,16.606774 5.80076742,16.8802108 5.60545539,17.2187519 C5.41014335,17.5572929 5.31248733,17.9218752 5.31248733,18.3124993 C5.31248733,18.911456 5.52733057,19.4257779 5.95701705,19.8554643 C6.38670352,20.2851508 6.90102541,20.499994 7.49998212,20.499994 C8.09893883,20.499994 8.61326071,20.2851508 9.04294719,19.8554643 C9.47263367,19.4257779 9.6874769,18.904946 9.6874769,18.2929681 C9.6874769,17.6809901 9.46612307,17.1666689 9.02341599,16.750003 L9.02341599,16.750003 L17.2265214,16.750003 C16.7838143,17.1666689 16.5624605,17.6809901 16.5624605,18.2929681 C16.5624605,18.904946 16.7773037,19.4257779 17.2069902,19.8554643 C17.6366767,20.2851508 18.1509986,20.499994 18.7499553,20.499994 Z"
20
+ id="cart-badge-shopping-cart"
20
21
  fill={iconFill}
22
+ fillRule="nonzero"
21
23
  />
22
24
  </svg>
23
25
  );
@@ -0,0 +1 @@
1
+ export const TrashIconV2: JSX.Element;
@@ -0,0 +1,41 @@
1
+ import React from "react";
2
+ import { fallbackValues } from "./Icons.theme";
3
+ import { themeComponent } from "../../../util/themeUtils";
4
+
5
+ const TrashIconV2 = ({ themeValues, iconFill }) => {
6
+ return (
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ width="18"
10
+ height="18"
11
+ viewBox="0 0 18 18"
12
+ fill="none"
13
+ >
14
+ <path
15
+ fillRule="evenodd"
16
+ clipRule="evenodd"
17
+ d="M11.5 4H14V6H4V4H6.5L7.21429 3H10.7857L11.5 4ZM6.99048 15C6.25714 15 5.65714 14.4857 5.65714 13.8571L4.85714 7H12.8571L12.0571 13.8571C12.0571 14.4857 11.4571 15 10.7238 15H6.99048Z"
18
+ fill={iconFill ?? themeValues.singleIconColor}
19
+ />
20
+ <mask
21
+ id="mask0_4292_11876"
22
+ style={{ maskType: "luminance" }}
23
+ maskUnits="userSpaceOnUse"
24
+ x="4"
25
+ y="3"
26
+ width="10"
27
+ height="12"
28
+ >
29
+ <path
30
+ fillRule="evenodd"
31
+ clipRule="evenodd"
32
+ d="M11.5 4H14V6H4V4H6.5L7.21429 3H10.7857L11.5 4ZM6.99048 15C6.25714 15 5.65714 14.4857 5.65714 13.8571L4.85714 7H12.8571L12.0571 13.8571C12.0571 14.4857 11.4571 15 10.7238 15H6.99048Z"
33
+ fill="white"
34
+ />
35
+ </mask>
36
+ <g mask="url(#mask0_4292_11876)"></g>
37
+ </svg>
38
+ );
39
+ };
40
+
41
+ export default themeComponent(TrashIconV2, "Icons", fallbackValues, "primary");
@@ -40,7 +40,9 @@ import {
40
40
  StatusUnknownIcon,
41
41
  AutopayIcon,
42
42
  KebabMenuIcon,
43
- MultiCartIcon
43
+ MultiCartIcon,
44
+ CloseIcon,
45
+ TrashIconV2
44
46
  } from "./index";
45
47
 
46
48
  const story = page({
@@ -88,3 +90,5 @@ export const statusUnknownIcon = () => <StatusUnknownIcon />;
88
90
  export const autopayIcon = () => <AutopayIcon />;
89
91
  export const kebabMenuIcon = () => <KebabMenuIcon />;
90
92
  export const multiCartIcon = () => <MultiCartIcon />;
93
+ export const closeIcon = () => <CloseIcon />;
94
+ export const trashIconV2 = () => <TrashIconV2 />;
@@ -23,3 +23,5 @@ export * from "./XCircleIconMedium";
23
23
  export * from "./XCircleIconSmall";
24
24
  export * from "./KebabMenuIcon";
25
25
  export * from "./MultiCartIcon";
26
+ export * from "./CloseIcon";
27
+ export * from "./TrashIconV2";
@@ -88,6 +88,8 @@ import ChargebackReversalIconMedium from "./ChargebackReversalIconMedium";
88
88
  import PlusCircleIcon from "./PlusCircleIcon";
89
89
  import KebabMenuIcon from "./KebabMenuIcon";
90
90
  import MultiCartIcon from "./MultiCartIcon";
91
+ import CloseIcon from "./CloseIcon";
92
+ import TrashIconV2 from "./TrashIconV2";
91
93
 
92
94
  export {
93
95
  AccountsIcon,
@@ -179,5 +181,7 @@ export {
179
181
  ChargebackReversalIconMedium,
180
182
  PlusCircleIcon,
181
183
  KebabMenuIcon,
182
- MultiCartIcon
184
+ MultiCartIcon,
185
+ CloseIcon,
186
+ TrashIconV2
183
187
  };
@@ -21,9 +21,7 @@ const Jumbo = ({
21
21
  itemsCount,
22
22
  showCartStatus = false,
23
23
  openCartSlider,
24
- extraStyles,
25
- cartStatusExtraStyles,
26
- cartStatusThemeValues
24
+ extraStyles
27
25
  }) => {
28
26
  const { isMobile } = useContext(ThemeContext);
29
27
  return (
@@ -53,7 +51,6 @@ const Jumbo = ({
53
51
  }
54
52
  align="center"
55
53
  nowrap={showCartStatus}
56
- extraStyles={cartStatusExtraStyles}
57
54
  >
58
55
  <Title
59
56
  variant={isMobile ? "small" : "large"}
@@ -83,7 +80,6 @@ const Jumbo = ({
83
80
  )}
84
81
  {showCartStatus && (
85
82
  <CartStatus
86
- themeValues={cartStatusThemeValues}
87
83
  total={total}
88
84
  itemsCount={itemsCount}
89
85
  openCart={openCartSlider}
@@ -45,6 +45,7 @@ const Box = forwardRef(
45
45
  extraStyles,
46
46
  srOnly = false,
47
47
  dataQa,
48
+ disabled = false,
48
49
  children,
49
50
  ...rest
50
51
  },
@@ -107,6 +107,21 @@ 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
+ }
110
125
 
111
126
  & * {
112
127
  color: ${({ color }) => color};
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { text, radios, select } from "@storybook/addon-knobs";
2
+ import { boolean, text, radios, select } from "@storybook/addon-knobs";
3
3
 
4
4
  import page from "../../../../../../.storybook/page";
5
5
  import Box from "../../Box";
@@ -47,6 +47,7 @@ export const box = () => (
47
47
  onFocus={text("onFocus", () => {}, groupId)}
48
48
  onBlur={text("onBlur", () => {}, groupId)}
49
49
  onTouchEnd={text("onTouchEnd", () => {}, groupId)}
50
+ disabled={boolean("disabled", false, groupId)}
50
51
  >
51
52
  Text Child
52
53
  <LayoutContentBlock