carbon-react 102.15.0 → 102.16.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,26 +1,31 @@
1
- declare function _default(theme: any): {
1
+ declare function _default(): {
2
2
  status: {
3
3
  neutral: {
4
4
  varietyColor: string;
5
5
  buttonFocus: string;
6
+ content: string;
6
7
  };
7
8
  negative: {
8
9
  varietyColor: string;
9
10
  buttonFocus: string;
11
+ content: string;
10
12
  };
11
13
  warning: {
12
14
  varietyColor: string;
13
15
  buttonFocus: string;
16
+ content: string;
14
17
  };
15
18
  positive: {
16
19
  varietyColor: string;
17
20
  buttonFocus: string;
21
+ content: string;
18
22
  };
19
23
  };
20
24
  tag: {
21
25
  primary: {
22
- varietyColor: any;
23
- buttonFocus: any;
26
+ varietyColor: string;
27
+ buttonFocus: string;
28
+ content: string;
24
29
  };
25
30
  };
26
31
  };
@@ -5,39 +5,35 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _base = _interopRequireDefault(require("../../style/themes/base"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
- const {
13
- colors,
14
- pill
15
- } = _base.default;
16
-
17
- var _default = theme => {
8
+ var _default = () => {
18
9
  return {
19
10
  status: {
20
11
  neutral: {
21
- varietyColor: pill.neutral,
22
- buttonFocus: pill.neutralBackgroundFocus
12
+ varietyColor: "var(--colorsSemanticNeutral500)",
13
+ buttonFocus: "var(--colorsSemanticNeutral600)",
14
+ content: "var(--colorsSemanticNeutralYang100)"
23
15
  },
24
16
  negative: {
25
- varietyColor: colors.error,
26
- buttonFocus: pill.errorButtonFocus
17
+ varietyColor: "var(--colorsSemanticNegative500)",
18
+ buttonFocus: "var(--colorsSemanticNegative600)",
19
+ content: "var(--colorsSemanticNegativeYang100)"
27
20
  },
28
21
  warning: {
29
- varietyColor: pill.warning,
30
- buttonFocus: pill.warningButtonFocus
22
+ varietyColor: "var(--colorsSemanticCaution400)",
23
+ buttonFocus: "var(--colorsSemanticCaution600)",
24
+ content: "var(--colorsSemanticCautionYin090)"
31
25
  },
32
26
  positive: {
33
- varietyColor: colors.secondary,
34
- buttonFocus: colors.tertiary
27
+ varietyColor: "var(--colorsSemanticPositive500)",
28
+ buttonFocus: "var(--colorsSemanticPositive600)",
29
+ content: "var(--colorsSemanticPositiveYang100)"
35
30
  }
36
31
  },
37
32
  tag: {
38
33
  primary: {
39
- varietyColor: theme.colors.primary,
40
- buttonFocus: theme.colors.secondary
34
+ varietyColor: "var(--colorsActionMajor500)",
35
+ buttonFocus: "var(--colorsActionMajor600)",
36
+ content: "var(--colorsActionMajorYang100)"
41
37
  }
42
38
  }
43
39
  };
@@ -49,10 +49,6 @@ const PillStyle = _styledComponents.default.span`
49
49
  size
50
50
  }) => {
51
51
  const isStatus = pillRole === "status";
52
- const {
53
- colors,
54
- text
55
- } = _themes.baseTheme;
56
52
  const variety = isStatus ? colorVariant : "primary";
57
53
  let pillColor;
58
54
  let buttonFocusColor;
@@ -62,16 +58,17 @@ const PillStyle = _styledComponents.default.span`
62
58
  if (borderColor) {
63
59
  pillColor = (0, _color.toColor)(theme, borderColor);
64
60
  buttonFocusColor = (0, _polished.shade)(0.2, pillColor);
61
+ contentColor = (0, _polished.meetsContrastGuidelines)(pillColor, theme.compatibility.colorsUtilityYin090).AAA ? "var(--colorsUtilityYin090)" : "var(--colorsUtilityYang100)";
65
62
  } else {
66
63
  const {
67
64
  varietyColor,
68
- buttonFocus
65
+ buttonFocus,
66
+ content
69
67
  } = (0, _pillStyle.default)(theme)[pillRole][variety];
70
68
  pillColor = varietyColor;
71
69
  buttonFocusColor = buttonFocus;
70
+ contentColor = content;
72
71
  }
73
-
74
- contentColor = (0, _polished.meetsContrastGuidelines)(pillColor, text.color).AAA ? text.color : colors.white;
75
72
  } catch (e) {
76
73
  // eslint-disable-next-line no-console
77
74
  console.error(e);
@@ -90,10 +87,14 @@ const PillStyle = _styledComponents.default.span`
90
87
  border: 2px solid ${pillColor};
91
88
  height: auto;
92
89
  white-space: nowrap;
90
+ color: ${contentColor};
93
91
 
94
92
  ${inFill && (0, _styledComponents.css)`
95
93
  background-color: ${pillColor};
96
- color: ${contentColor};
94
+ `}
95
+
96
+ ${!inFill && (0, _styledComponents.css)`
97
+ color: var(--colorsUtilityYin090);
97
98
  `}
98
99
 
99
100
  ${size === "S" && (0, _styledComponents.css)`
@@ -134,21 +135,9 @@ const PillStyle = _styledComponents.default.span`
134
135
  margin: 0;
135
136
  line-height: 16px;
136
137
 
137
- ${inFill && (0, _styledComponents.css)`
138
- color: ${contentColor};
139
- ${_icon.default} {
140
- color: ${contentColor};
141
- }
142
- `}
143
-
144
- ${!inFill && (0, _styledComponents.css)`
145
- background-color: transparent;
146
- color: ${text.color};
147
- `}
148
-
149
138
  &:focus {
150
139
  outline: none;
151
- box-shadow: 0 0 0 3px ${colors.focus};
140
+ box-shadow: 0 0 0 3px var(--colorsSemanticFocus500);
152
141
  background-color: ${buttonFocusColor};
153
142
  & {
154
143
  color: ${contentColor};
@@ -175,12 +164,19 @@ const PillStyle = _styledComponents.default.span`
175
164
  padding: 0 4px;
176
165
  height: unset;
177
166
  width: unset;
167
+ color: ${contentColor};
178
168
 
179
169
  &:hover,
180
170
  &:focus {
181
171
  color: ${contentColor};
182
172
  }
183
173
  }
174
+
175
+ ${!inFill && (0, _styledComponents.css)`
176
+ ${_icon.default} {
177
+ color: var(--colorsUtilityYin090);
178
+ }
179
+ `}
184
180
  }
185
181
 
186
182
  ${size === "S" && (0, _styledComponents.css)`
@@ -293,7 +289,10 @@ PillStyle.propTypes = {
293
289
  inFill: _propTypes.default.bool,
294
290
  colorVariant: _propTypes.default.oneOf(["neutral", "negative", "positive", "warning"]),
295
291
  isDeletable: _propTypes.default.func,
296
- size: _propTypes.default.oneOf(["S", "M", "L", "XL"])
292
+ size: _propTypes.default.oneOf(["S", "M", "L", "XL"]),
293
+ pillRole: _propTypes.default.oneOf(["tag", "status"]),
294
+ borderColor: _propTypes.default.string,
295
+ theme: _propTypes.default.object
297
296
  };
298
297
  var _default = PillStyle;
299
298
  exports.default = _default;
@@ -361,7 +361,6 @@ declare function _default(palette: any): {
361
361
  colorsActionMajor600: any;
362
362
  colorsActionDisabled500: any;
363
363
  colorsSemanticFocus500: any;
364
- colorsSemanticPositive500: any;
365
364
  colorsSemanticNegative500: any;
366
365
  colorsSemanticNegative600: any;
367
366
  colorsSemanticCaution500: any;
@@ -471,6 +470,7 @@ declare function _default(palette: any): {
471
470
  colorsSemanticNeutralYang100: string;
472
471
  colorsSemanticFocus250: string;
473
472
  colorsSemanticFocusTransparent: string;
473
+ colorsSemanticPositive500: string;
474
474
  colorsSemanticPositive600: string;
475
475
  colorsSemanticPositiveTransparent: string;
476
476
  colorsSemanticPositiveYin030: string;
@@ -384,7 +384,6 @@ var _default = palette => {
384
384
  colorsActionMajor600: this.colors.secondary,
385
385
  colorsActionDisabled500: this.disabled.background,
386
386
  colorsSemanticFocus500: this.colors.focus,
387
- colorsSemanticPositive500: this.colors.success,
388
387
  colorsSemanticNegative500: this.colors.error,
389
388
  colorsSemanticNegative600: this.colors.destructive.hover,
390
389
  colorsSemanticCaution500: this.colors.warning,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "102.15.0",
3
+ "version": "102.16.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {