carbon-react 152.0.1 → 152.2.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.
@@ -1,4 +1,4 @@
1
- declare const _default: (isDisabled?: boolean, destructive?: boolean) => {
1
+ declare const _default: (isDisabled?: boolean, destructive?: boolean, isWhite?: boolean) => {
2
2
  primary: string;
3
3
  secondary: string;
4
4
  tertiary: string;
@@ -32,7 +32,7 @@ const gradientSharedStyle = `
32
32
  background: linear-gradient(to right, #d6f8df, #d9f2ff, #ede2ff) padding-box, linear-gradient(to right, #00D639, #11AFFF, #8F49FE) border-box;
33
33
  }
34
34
  `;
35
- export default (isDisabled, destructive) => ({
35
+ export default (isDisabled, destructive, isWhite) => ({
36
36
  primary: `
37
37
  background: var(--colorsActionMajor500);
38
38
  border-color: transparent;
@@ -85,7 +85,7 @@ export default (isDisabled, destructive) => ({
85
85
  ${makeColors("var(--colorsSemanticNegativeYang100)")};
86
86
  }
87
87
  ` : ""}
88
-
88
+
89
89
  ${isDisabled ? `
90
90
  border-color: var(--colorsActionDisabled500);
91
91
  ${makeColors("var(--colorsActionMajorYin030)")};
@@ -96,6 +96,39 @@ export default (isDisabled, destructive) => ({
96
96
  }
97
97
  ${disabledImageStyle}
98
98
  ` : ""}
99
+
100
+ ${isWhite ? `
101
+ border-color: var(--colorsActionMajorYang100);
102
+ ${makeColors("var(--colorsActionMajorYang100)")}
103
+ &:hover {
104
+ background: var(--colorsActionMajorYang100);
105
+ ${makeColors("var(--colorsUtilityYin100)")};
106
+ }
107
+
108
+
109
+ ${destructive ? `
110
+ border-color: var(--colorsSemanticNegative450);
111
+ ${makeColors("var(--colorsSemanticNegative450)")}
112
+ &:hover {
113
+ background: var(--colorsSemanticNegative600);
114
+ border-color: var(--colorsSemanticNegativeTransparent);
115
+ ${makeColors("var(--colorsSemanticNegativeYang100)")};
116
+ }
117
+ ` : ""}
118
+
119
+ ${isDisabled ? `
120
+ border-color: #4B4B4B;
121
+ ${makeColors("#4B4B4B")};
122
+ &:hover {
123
+ background: transparent;
124
+ border-color: #4B4B4B;
125
+ ${makeColors("#4B4B4B")};
126
+
127
+ }
128
+ ${disabledImageStyle}
129
+ ` : ""}
130
+ }
131
+ ` : ""}
99
132
  `,
100
133
  tertiary: `
101
134
  background: transparent;
@@ -131,7 +164,7 @@ export default (isDisabled, destructive) => ({
131
164
  background: var(--colorsActionMajor600);
132
165
  ${makeColors("var(--colorsActionMajorYang100)")}
133
166
  }
134
-
167
+
135
168
  ${isDisabled ? `
136
169
  background: var(--colorsActionDisabled500);
137
170
  ${makeColors("var(--colorsActionMajorYin030)")};
@@ -144,13 +177,13 @@ export default (isDisabled, destructive) => ({
144
177
  `,
145
178
  "gradient-grey": `
146
179
  ${isDisabled ? gradientDisabledStyle : `
147
- background: linear-gradient(#F2F5F6, #F2F5F6) padding-box, linear-gradient(to right, #00D639, #11AFFF, #8F49FE) border-box;
180
+ background: linear-gradient(#F2F5F6, #F2F5F6) padding-box, linear-gradient(to right, #00D639, #11AFFF, #8F49FE) border-box;
148
181
  ${gradientSharedStyle}
149
182
  `}
150
183
  `,
151
184
  "gradient-white": `
152
185
  ${isDisabled ? gradientDisabledStyle : `
153
- background: linear-gradient(#FFFFFF, #FFFFFF) padding-box, linear-gradient(to right, #00D639, #11AFFF, #8F49FE) border-box;
186
+ background: linear-gradient(#FFFFFF, #FFFFFF) padding-box, linear-gradient(to right, #00D639, #11AFFF, #8F49FE) border-box;
154
187
  ${gradientSharedStyle}
155
188
  `}
156
189
  `
@@ -40,6 +40,8 @@ export interface ButtonProps extends SpaceProps, TagProps {
40
40
  iconType?: IconType;
41
41
  /** id attribute */
42
42
  id?: string;
43
+ /** Whether to use the white-on-dark colour variant */
44
+ isWhite?: boolean;
43
45
  /** If provided, the text inside a button will not wrap */
44
46
  noWrap?: boolean;
45
47
  /** Specify a callback triggered on blur */
@@ -70,6 +70,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
70
70
  iconTooltipMessage,
71
71
  iconTooltipPosition,
72
72
  iconType,
73
+ isWhite = false,
73
74
  m = 0,
74
75
  noWrap,
75
76
  onClick,
@@ -139,6 +140,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
139
140
  buttonType: buttonType,
140
141
  disabled: isDisabled,
141
142
  destructive: destructive,
143
+ isWhite: isWhite,
142
144
  type: href ? undefined : "button",
143
145
  iconType: iconType,
144
146
  size: size,
@@ -1,9 +1,9 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import { space } from "styled-system";
3
- import BaseTheme from "../../style/themes/base";
4
- import buttonTypes from "./button-types.style";
5
3
  import StyledIcon from "../icon/icon.style";
4
+ import BaseTheme from "../../style/themes/base";
6
5
  import addFocusStyling from "../../style/utils/add-focus-styling";
6
+ import buttonTypes from "./button-types.style";
7
7
  function additionalIconStyle(iconType) {
8
8
  if (iconType === "services") return "6px";
9
9
  return "20px";
@@ -21,8 +21,8 @@ function stylingForIconOnly(size) {
21
21
  dimension = "40px";
22
22
  }
23
23
  return `
24
- padding: 0px;
25
- width: ${dimension};
24
+ padding: 0px;
25
+ width: ${dimension};
26
26
  min-height: ${dimension}`;
27
27
  }
28
28
  function stylingForType({
@@ -30,10 +30,11 @@ function stylingForType({
30
30
  disabled,
31
31
  buttonType,
32
32
  size,
33
- destructive
33
+ destructive,
34
+ isWhite
34
35
  }) {
35
36
  return css`
36
- ${buttonTypes(disabled, destructive)[buttonType]};
37
+ ${buttonTypes(disabled, destructive, isWhite)[buttonType]};
37
38
 
38
39
  ${size === "small" && css`
39
40
  font-size: var(--fontSizes100);
@@ -44,7 +45,7 @@ function stylingForType({
44
45
  font-size: var(--fontSizes100);
45
46
  min-height: 40px;
46
47
  `}
47
-
48
+
48
49
  ${size === "large" && css`
49
50
  font-size: var(--fontSizes200);
50
51
  min-height: 48px;
@@ -84,7 +85,7 @@ const StyledButton = styled.button`
84
85
  }) => fullWidth && css`
85
86
  width: 100%;
86
87
  `}
87
-
88
+
88
89
  ${({
89
90
  iconOnly,
90
91
  iconPosition,
@@ -1,6 +1,6 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React from "react";
3
- import StyledTile, { StyledHighlight } from "./tile.style";
3
+ import StyledTile from "./tile.style";
4
4
  import TileContext from "./__internal__/tile.context";
5
5
  import filterStyledSystemPaddingProps from "../../style/utils/filter-styled-system-padding-props";
6
6
  import filterStyledSystemMarginProps from "../../style/utils/filter-styled-system-margin-props";
@@ -26,13 +26,14 @@ export const Tile = ({
26
26
  });
27
27
  const marginProps = filterStyledSystemMarginProps(rest);
28
28
  const contentPaddingProps = computeContentPadding(paddingProps, isHorizontal);
29
- const tile = /*#__PURE__*/React.createElement(StyledTile, _extends({
29
+ return /*#__PURE__*/React.createElement(StyledTile, _extends({
30
30
  variant: variant,
31
31
  width: width,
32
32
  height: height,
33
33
  isHorizontal: isHorizontal,
34
34
  p: p,
35
35
  roundness: roundness,
36
+ highlightVariant: highlightVariant,
36
37
  borderWidth: borderWidth,
37
38
  borderVariant: borderVariant
38
39
  }, paddingProps, marginProps, tagComponent("tile", rest)), /*#__PURE__*/React.createElement(TileContext.Provider, {
@@ -41,14 +42,5 @@ export const Tile = ({
41
42
  paddingPropsFromTile: contentPaddingProps
42
43
  }
43
44
  }, children));
44
- if (highlightVariant) {
45
- return /*#__PURE__*/React.createElement(StyledHighlight, {
46
- variant: highlightVariant,
47
- roundness: roundness,
48
- "aria-hidden": true,
49
- "data-role": `tile-${highlightVariant}-highlight`
50
- }, tile);
51
- }
52
- return tile;
53
45
  };
54
46
  export default Tile;
@@ -1,4 +1,4 @@
1
1
  export const TILE_ORIENTATIONS = ["horizontal", "vertical"];
2
2
  export const TILE_THEMES = ["tile", "transparent", "active", "grey"];
3
3
  export const TILE_BORDER_VARIANTS = ["default", "info", "selected", "negative", "positive", "caution"];
4
- export const TILE_HIGHLIGHT_VARIANTS = ["gradient", "success", "neutral", "error", "warning", "info"];
4
+ export const TILE_HIGHLIGHT_VARIANTS = ["gradient", "success", "neutral", "error", "warning", "info", "important"];
@@ -3,8 +3,4 @@ import { TileProps } from "./tile.component";
3
3
  declare const StyledTile: import("styled-components").StyledComponent<"div", any, Pick<TileProps, "width" | "height" | "variant" | "roundness" | "borderWidth" | "borderVariant" | "highlightVariant"> & {
4
4
  isHorizontal?: boolean | undefined;
5
5
  } & SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol>, never>;
6
- export declare const StyledHighlight: import("styled-components").StyledComponent<"div", any, {
7
- variant: Required<TileProps["highlightVariant"]>;
8
- roundness: TileProps["roundness"];
9
- }, never>;
10
6
  export default StyledTile;
@@ -48,6 +48,9 @@ const getHighlightVariant = variant => {
48
48
  return "var(--colorsSemanticCaution500)";
49
49
  case "info":
50
50
  return "var(--colorsSemanticInfo500)";
51
+ // FE-6368 has been raised for the below, change hex values for design tokens (when added)
52
+ case "important":
53
+ return " #8F4CD7";
51
54
  default:
52
55
  // gradient is default
53
56
  return "linear-gradient(0deg, rgb(143, 73, 254) 5%, rgb(0, 146, 219) 50%, rgb(19, 160, 56) 95%)";
@@ -61,10 +64,25 @@ const StyledTile = styled.div`
61
64
  variant,
62
65
  width,
63
66
  roundness,
67
+ highlightVariant,
64
68
  height
65
69
  }) => css`
66
70
  ${space}
67
71
 
72
+ ${highlightVariant && css`
73
+ overflow: hidden;
74
+ &::before {
75
+ display: block;
76
+ content: "";
77
+ height: 100%;
78
+ width: 8px;
79
+ position: absolute;
80
+ top: 0;
81
+ left: 0;
82
+ background: ${getHighlightVariant(highlightVariant)};
83
+ }
84
+ `}
85
+
68
86
  box-sizing: border-box;
69
87
  border: var(--${borderWidth}) solid
70
88
  ${getBorderColor(borderVariant, variant)};
@@ -109,21 +127,4 @@ const StyledTile = styled.div`
109
127
  StyledTile.defaultProps = {
110
128
  theme: baseTheme
111
129
  };
112
- export const StyledHighlight = styled.div`
113
- height: 100%;
114
- width: 100%;
115
- position: relative;
116
- background: ${({
117
- variant
118
- }) => getHighlightVariant(variant)};
119
- border-radius: ${({
120
- roundness
121
- }) => getBorderRadius(roundness)};
122
-
123
- ${StyledTile} {
124
- border-left: 0;
125
- left: 4px;
126
- width: calc(100% - 4px);
127
- }
128
- `;
129
130
  export default StyledTile;
@@ -1,4 +1,4 @@
1
- declare const _default: (isDisabled?: boolean, destructive?: boolean) => {
1
+ declare const _default: (isDisabled?: boolean, destructive?: boolean, isWhite?: boolean) => {
2
2
  primary: string;
3
3
  secondary: string;
4
4
  tertiary: string;
@@ -39,7 +39,7 @@ const gradientSharedStyle = `
39
39
  background: linear-gradient(to right, #d6f8df, #d9f2ff, #ede2ff) padding-box, linear-gradient(to right, #00D639, #11AFFF, #8F49FE) border-box;
40
40
  }
41
41
  `;
42
- var _default = (isDisabled, destructive) => ({
42
+ var _default = (isDisabled, destructive, isWhite) => ({
43
43
  primary: `
44
44
  background: var(--colorsActionMajor500);
45
45
  border-color: transparent;
@@ -92,7 +92,7 @@ var _default = (isDisabled, destructive) => ({
92
92
  ${makeColors("var(--colorsSemanticNegativeYang100)")};
93
93
  }
94
94
  ` : ""}
95
-
95
+
96
96
  ${isDisabled ? `
97
97
  border-color: var(--colorsActionDisabled500);
98
98
  ${makeColors("var(--colorsActionMajorYin030)")};
@@ -103,6 +103,39 @@ var _default = (isDisabled, destructive) => ({
103
103
  }
104
104
  ${disabledImageStyle}
105
105
  ` : ""}
106
+
107
+ ${isWhite ? `
108
+ border-color: var(--colorsActionMajorYang100);
109
+ ${makeColors("var(--colorsActionMajorYang100)")}
110
+ &:hover {
111
+ background: var(--colorsActionMajorYang100);
112
+ ${makeColors("var(--colorsUtilityYin100)")};
113
+ }
114
+
115
+
116
+ ${destructive ? `
117
+ border-color: var(--colorsSemanticNegative450);
118
+ ${makeColors("var(--colorsSemanticNegative450)")}
119
+ &:hover {
120
+ background: var(--colorsSemanticNegative600);
121
+ border-color: var(--colorsSemanticNegativeTransparent);
122
+ ${makeColors("var(--colorsSemanticNegativeYang100)")};
123
+ }
124
+ ` : ""}
125
+
126
+ ${isDisabled ? `
127
+ border-color: #4B4B4B;
128
+ ${makeColors("#4B4B4B")};
129
+ &:hover {
130
+ background: transparent;
131
+ border-color: #4B4B4B;
132
+ ${makeColors("#4B4B4B")};
133
+
134
+ }
135
+ ${disabledImageStyle}
136
+ ` : ""}
137
+ }
138
+ ` : ""}
106
139
  `,
107
140
  tertiary: `
108
141
  background: transparent;
@@ -138,7 +171,7 @@ var _default = (isDisabled, destructive) => ({
138
171
  background: var(--colorsActionMajor600);
139
172
  ${makeColors("var(--colorsActionMajorYang100)")}
140
173
  }
141
-
174
+
142
175
  ${isDisabled ? `
143
176
  background: var(--colorsActionDisabled500);
144
177
  ${makeColors("var(--colorsActionMajorYin030)")};
@@ -151,13 +184,13 @@ var _default = (isDisabled, destructive) => ({
151
184
  `,
152
185
  "gradient-grey": `
153
186
  ${isDisabled ? gradientDisabledStyle : `
154
- background: linear-gradient(#F2F5F6, #F2F5F6) padding-box, linear-gradient(to right, #00D639, #11AFFF, #8F49FE) border-box;
187
+ background: linear-gradient(#F2F5F6, #F2F5F6) padding-box, linear-gradient(to right, #00D639, #11AFFF, #8F49FE) border-box;
155
188
  ${gradientSharedStyle}
156
189
  `}
157
190
  `,
158
191
  "gradient-white": `
159
192
  ${isDisabled ? gradientDisabledStyle : `
160
- background: linear-gradient(#FFFFFF, #FFFFFF) padding-box, linear-gradient(to right, #00D639, #11AFFF, #8F49FE) border-box;
193
+ background: linear-gradient(#FFFFFF, #FFFFFF) padding-box, linear-gradient(to right, #00D639, #11AFFF, #8F49FE) border-box;
161
194
  ${gradientSharedStyle}
162
195
  `}
163
196
  `
@@ -40,6 +40,8 @@ export interface ButtonProps extends SpaceProps, TagProps {
40
40
  iconType?: IconType;
41
41
  /** id attribute */
42
42
  id?: string;
43
+ /** Whether to use the white-on-dark colour variant */
44
+ isWhite?: boolean;
43
45
  /** If provided, the text inside a button will not wrap */
44
46
  noWrap?: boolean;
45
47
  /** Specify a callback triggered on blur */
@@ -79,6 +79,7 @@ const Button = /*#__PURE__*/_react.default.forwardRef(({
79
79
  iconTooltipMessage,
80
80
  iconTooltipPosition,
81
81
  iconType,
82
+ isWhite = false,
82
83
  m = 0,
83
84
  noWrap,
84
85
  onClick,
@@ -148,6 +149,7 @@ const Button = /*#__PURE__*/_react.default.forwardRef(({
148
149
  buttonType: buttonType,
149
150
  disabled: isDisabled,
150
151
  destructive: destructive,
152
+ isWhite: isWhite,
151
153
  type: href ? undefined : "button",
152
154
  iconType: iconType,
153
155
  size: size,
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = exports.StyledButtonSubtext = exports.StyledButtonMainText = void 0;
7
7
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
8
  var _styledSystem = require("styled-system");
9
- var _base = _interopRequireDefault(require("../../style/themes/base"));
10
- var _buttonTypes = _interopRequireDefault(require("./button-types.style"));
11
9
  var _icon = _interopRequireDefault(require("../icon/icon.style"));
10
+ var _base = _interopRequireDefault(require("../../style/themes/base"));
12
11
  var _addFocusStyling = _interopRequireDefault(require("../../style/utils/add-focus-styling"));
12
+ var _buttonTypes = _interopRequireDefault(require("./button-types.style"));
13
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
15
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -30,8 +30,8 @@ function stylingForIconOnly(size) {
30
30
  dimension = "40px";
31
31
  }
32
32
  return `
33
- padding: 0px;
34
- width: ${dimension};
33
+ padding: 0px;
34
+ width: ${dimension};
35
35
  min-height: ${dimension}`;
36
36
  }
37
37
  function stylingForType({
@@ -39,10 +39,11 @@ function stylingForType({
39
39
  disabled,
40
40
  buttonType,
41
41
  size,
42
- destructive
42
+ destructive,
43
+ isWhite
43
44
  }) {
44
45
  return (0, _styledComponents.css)`
45
- ${(0, _buttonTypes.default)(disabled, destructive)[buttonType]};
46
+ ${(0, _buttonTypes.default)(disabled, destructive, isWhite)[buttonType]};
46
47
 
47
48
  ${size === "small" && (0, _styledComponents.css)`
48
49
  font-size: var(--fontSizes100);
@@ -53,7 +54,7 @@ function stylingForType({
53
54
  font-size: var(--fontSizes100);
54
55
  min-height: 40px;
55
56
  `}
56
-
57
+
57
58
  ${size === "large" && (0, _styledComponents.css)`
58
59
  font-size: var(--fontSizes200);
59
60
  min-height: 48px;
@@ -93,7 +94,7 @@ const StyledButton = _styledComponents.default.button`
93
94
  }) => fullWidth && (0, _styledComponents.css)`
94
95
  width: 100%;
95
96
  `}
96
-
97
+
97
98
  ${({
98
99
  iconOnly,
99
100
  iconPosition,
@@ -5,14 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = exports.Tile = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
- var _tile = _interopRequireWildcard(require("./tile.style"));
8
+ var _tile = _interopRequireDefault(require("./tile.style"));
9
9
  var _tile2 = _interopRequireDefault(require("./__internal__/tile.context"));
10
10
  var _filterStyledSystemPaddingProps = _interopRequireDefault(require("../../style/utils/filter-styled-system-padding-props"));
11
11
  var _filterStyledSystemMarginProps = _interopRequireDefault(require("../../style/utils/filter-styled-system-margin-props"));
12
12
  var _computeContentPadding = _interopRequireDefault(require("./__internal__/compute-content-padding"));
13
13
  var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags"));
14
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
15
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
18
16
  const Tile = ({
@@ -35,13 +33,14 @@ const Tile = ({
35
33
  });
36
34
  const marginProps = (0, _filterStyledSystemMarginProps.default)(rest);
37
35
  const contentPaddingProps = (0, _computeContentPadding.default)(paddingProps, isHorizontal);
38
- const tile = /*#__PURE__*/_react.default.createElement(_tile.default, _extends({
36
+ return /*#__PURE__*/_react.default.createElement(_tile.default, _extends({
39
37
  variant: variant,
40
38
  width: width,
41
39
  height: height,
42
40
  isHorizontal: isHorizontal,
43
41
  p: p,
44
42
  roundness: roundness,
43
+ highlightVariant: highlightVariant,
45
44
  borderWidth: borderWidth,
46
45
  borderVariant: borderVariant
47
46
  }, paddingProps, marginProps, (0, _tags.default)("tile", rest)), /*#__PURE__*/_react.default.createElement(_tile2.default.Provider, {
@@ -50,15 +49,6 @@ const Tile = ({
50
49
  paddingPropsFromTile: contentPaddingProps
51
50
  }
52
51
  }, children));
53
- if (highlightVariant) {
54
- return /*#__PURE__*/_react.default.createElement(_tile.StyledHighlight, {
55
- variant: highlightVariant,
56
- roundness: roundness,
57
- "aria-hidden": true,
58
- "data-role": `tile-${highlightVariant}-highlight`
59
- }, tile);
60
- }
61
- return tile;
62
52
  };
63
53
  exports.Tile = Tile;
64
54
  var _default = exports.default = Tile;
@@ -7,4 +7,4 @@ exports.TILE_THEMES = exports.TILE_ORIENTATIONS = exports.TILE_HIGHLIGHT_VARIANT
7
7
  const TILE_ORIENTATIONS = exports.TILE_ORIENTATIONS = ["horizontal", "vertical"];
8
8
  const TILE_THEMES = exports.TILE_THEMES = ["tile", "transparent", "active", "grey"];
9
9
  const TILE_BORDER_VARIANTS = exports.TILE_BORDER_VARIANTS = ["default", "info", "selected", "negative", "positive", "caution"];
10
- const TILE_HIGHLIGHT_VARIANTS = exports.TILE_HIGHLIGHT_VARIANTS = ["gradient", "success", "neutral", "error", "warning", "info"];
10
+ const TILE_HIGHLIGHT_VARIANTS = exports.TILE_HIGHLIGHT_VARIANTS = ["gradient", "success", "neutral", "error", "warning", "info", "important"];
@@ -3,8 +3,4 @@ import { TileProps } from "./tile.component";
3
3
  declare const StyledTile: import("styled-components").StyledComponent<"div", any, Pick<TileProps, "width" | "height" | "variant" | "roundness" | "borderWidth" | "borderVariant" | "highlightVariant"> & {
4
4
  isHorizontal?: boolean | undefined;
5
5
  } & SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol>, never>;
6
- export declare const StyledHighlight: import("styled-components").StyledComponent<"div", any, {
7
- variant: Required<TileProps["highlightVariant"]>;
8
- roundness: TileProps["roundness"];
9
- }, never>;
10
6
  export default StyledTile;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.StyledHighlight = void 0;
6
+ exports.default = void 0;
7
7
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
8
  var _styledSystem = require("styled-system");
9
9
  var _base = _interopRequireDefault(require("../../style/themes/base"));
@@ -57,6 +57,9 @@ const getHighlightVariant = variant => {
57
57
  return "var(--colorsSemanticCaution500)";
58
58
  case "info":
59
59
  return "var(--colorsSemanticInfo500)";
60
+ // FE-6368 has been raised for the below, change hex values for design tokens (when added)
61
+ case "important":
62
+ return " #8F4CD7";
60
63
  default:
61
64
  // gradient is default
62
65
  return "linear-gradient(0deg, rgb(143, 73, 254) 5%, rgb(0, 146, 219) 50%, rgb(19, 160, 56) 95%)";
@@ -70,10 +73,25 @@ const StyledTile = _styledComponents.default.div`
70
73
  variant,
71
74
  width,
72
75
  roundness,
76
+ highlightVariant,
73
77
  height
74
78
  }) => (0, _styledComponents.css)`
75
79
  ${_styledSystem.space}
76
80
 
81
+ ${highlightVariant && (0, _styledComponents.css)`
82
+ overflow: hidden;
83
+ &::before {
84
+ display: block;
85
+ content: "";
86
+ height: 100%;
87
+ width: 8px;
88
+ position: absolute;
89
+ top: 0;
90
+ left: 0;
91
+ background: ${getHighlightVariant(highlightVariant)};
92
+ }
93
+ `}
94
+
77
95
  box-sizing: border-box;
78
96
  border: var(--${borderWidth}) solid
79
97
  ${getBorderColor(borderVariant, variant)};
@@ -118,21 +136,4 @@ const StyledTile = _styledComponents.default.div`
118
136
  StyledTile.defaultProps = {
119
137
  theme: _base.default
120
138
  };
121
- const StyledHighlight = exports.StyledHighlight = _styledComponents.default.div`
122
- height: 100%;
123
- width: 100%;
124
- position: relative;
125
- background: ${({
126
- variant
127
- }) => getHighlightVariant(variant)};
128
- border-radius: ${({
129
- roundness
130
- }) => getBorderRadius(roundness)};
131
-
132
- ${StyledTile} {
133
- border-left: 0;
134
- left: 4px;
135
- width: calc(100% - 4px);
136
- }
137
- `;
138
139
  var _default = exports.default = StyledTile;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "152.0.1",
3
+ "version": "152.2.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",