carbon-react 102.15.0 → 102.18.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,5 +1,5 @@
1
1
  export default BaseCarousel;
2
- declare function BaseCarousel({ children, className, enableSlideSelector, enablePreviousButton, enableNextButton, initialSlideIndex, onSlideChange, slideIndex, theme, ...props }: {
2
+ declare function BaseCarousel({ children, className, enableSlideSelector, enablePreviousButton, enableNextButton, initialSlideIndex, onSlideChange, slideIndex, ...props }: {
3
3
  [x: string]: any;
4
4
  children: any;
5
5
  className: any;
@@ -9,7 +9,6 @@ declare function BaseCarousel({ children, className, enableSlideSelector, enable
9
9
  initialSlideIndex?: number | undefined;
10
10
  onSlideChange: any;
11
11
  slideIndex: any;
12
- theme?: import("../../style/themes/base").ThemeObject | undefined;
13
12
  }): JSX.Element;
14
13
  declare namespace BaseCarousel {
15
14
  namespace propTypes {
@@ -21,7 +20,6 @@ declare namespace BaseCarousel {
21
20
  const enablePreviousButton: PropTypes.Requireable<boolean>;
22
21
  const enableNextButton: PropTypes.Requireable<boolean>;
23
22
  const onSlideChange: PropTypes.Requireable<(...args: any[]) => any>;
24
- const theme: PropTypes.Requireable<object>;
25
23
  }
26
24
  }
27
25
  export const Carousel: React.ForwardRefExoticComponent<{
@@ -27,8 +27,6 @@ var _carousel = require("./carousel.style");
27
27
 
28
28
  var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid"));
29
29
 
30
- var _base = _interopRequireDefault(require("../../style/themes/base"));
31
-
32
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
31
 
34
32
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -49,7 +47,6 @@ const BaseCarousel = ({
49
47
  initialSlideIndex = 0,
50
48
  onSlideChange,
51
49
  slideIndex,
52
- theme = _base.default,
53
50
  ...props
54
51
  }) => {
55
52
  const [selectedSlideIndex, setSelectedSlideIndex] = (0, _react.useState)(Number(slideIndex) || Number(initialSlideIndex));
@@ -106,7 +103,6 @@ const BaseCarousel = ({
106
103
  key: `slide-${(0, _guid.default)()}`,
107
104
  id: key,
108
105
  selectedIndex: selectedSlideIndex,
109
- theme,
110
106
  ...element.props
111
107
  });
112
108
  });
@@ -200,10 +196,7 @@ BaseCarousel.propTypes = {
200
196
  enableNextButton: _propTypes.default.bool,
201
197
 
202
198
  /** Action to be called on slide change */
203
- onSlideChange: _propTypes.default.func,
204
-
205
- /** theme is used only to support legacy code */
206
- theme: _propTypes.default.object
199
+ onSlideChange: _propTypes.default.func
207
200
  };
208
201
  const Carousel = (0, _styledComponents.withTheme)(BaseCarousel);
209
202
  exports.Carousel = Carousel;
@@ -11,8 +11,6 @@ var _icon = _interopRequireDefault(require("../icon"));
11
11
 
12
12
  var _slide = require("./slide.config");
13
13
 
14
- var _base = _interopRequireDefault(require("../../style/themes/base"));
15
-
16
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
15
 
18
16
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -37,7 +35,8 @@ const CarouselNextButtonWrapperStyle = (0, _styledComponents.default)(CarouselNa
37
35
  exports.CarouselNextButtonWrapperStyle = CarouselNextButtonWrapperStyle;
38
36
  const CarouselStyledIcon = (0, _styledComponents.default)(_icon.default)`
39
37
  cursor: pointer;
40
- &&::before {
38
+ color: var(--colorsActionMajorYang100);
39
+ &::before {
41
40
  font-size: 16px;
42
41
  }
43
42
  `;
@@ -54,22 +53,27 @@ const CarouselButtonStyle = _styledComponents.default.button.attrs({
54
53
  type: "button"
55
54
  })`
56
55
  ${({
57
- theme,
58
56
  disabled
59
57
  }) => (0, _styledComponents.css)`
60
58
  border: none;
61
59
  width: 40px;
62
60
  height: 64px;
63
- background: ${theme.colors.primary};
64
- color: ${theme.colors.white};
65
- opacity: ${disabled ? "0.1" : "1"};
61
+ border-width: var(--borderWidth200);
62
+ border-color: var(--colorsActionMajorTransparent);
63
+ background-color: ${disabled ? "var(--colorsActionDisabled500)" : "var(--colorsActionMajor500)"};
64
+
65
+ ${disabled && (0, _styledComponents.css)`
66
+ ${CarouselStyledIcon} {
67
+ color: var(--colorsActionMajorYin030);
68
+ }
69
+ `}
66
70
 
67
71
  &:hover {
68
- background-color: ${theme.colors.secondary};
72
+ background-color: var(--colorsActionMajor600);
69
73
  cursor: ${disabled ? "default" : "pointer"};
70
74
 
71
75
  ${disabled && (0, _styledComponents.css)`
72
- background-color: ${theme.colors.primary};
76
+ background-color: var(--colorsActionDisabled500);
73
77
  cursor: default;
74
78
 
75
79
  ${CarouselStyledIcon} {
@@ -83,7 +87,7 @@ const CarouselButtonStyle = _styledComponents.default.button.attrs({
83
87
  }
84
88
 
85
89
  &:focus {
86
- outline: 2px solid ${theme.colors.focus};
90
+ outline: 2px solid var(--colorsSemanticFocus500);
87
91
 
88
92
  ::-moz-focus-inner {
89
93
  border: 0;
@@ -104,9 +108,7 @@ const CarouselSelectorLabelStyle = _styledComponents.default.label`
104
108
  display: inline-block;
105
109
  width: 10px;
106
110
  height: 10px;
107
- background: ${({
108
- theme
109
- }) => theme.carousel.inactiveSelectorBackground};
111
+ background: var(--colorsActionMinor200);
110
112
  margin: 0px 4px;
111
113
 
112
114
  &:hover {
@@ -115,20 +117,18 @@ const CarouselSelectorLabelStyle = _styledComponents.default.label`
115
117
  `;
116
118
  exports.CarouselSelectorLabelStyle = CarouselSelectorLabelStyle;
117
119
  const CarouselSelectorWrapperStyle = _styledComponents.default.div`
118
- ${({
119
- theme
120
- }) => (0, _styledComponents.css)`
120
+ ${(0, _styledComponents.css)`
121
121
  height: 20px;
122
122
  margin-top: 25px;
123
123
  text-align: center;
124
124
 
125
125
  ${CarouselSelectorInputStyle}:checked {
126
126
  + ${CarouselSelectorLabelStyle} {
127
- background: ${theme.carousel.activeSelectorBackground};
128
- border-color: transparent;
127
+ width: 10px;
129
128
  height: 10px;
129
+ background: var(--colorsActionMinor400);
130
+ border-color: transparent;
130
131
  position: relative;
131
- width: 10px;
132
132
  }
133
133
  }
134
134
  `}
@@ -158,31 +158,4 @@ const CarouselWrapperStyle = _styledComponents.default.div`
158
158
  ${_slide.slideAnimation};
159
159
  ${_slide.fadeAnimation};
160
160
  `;
161
- exports.CarouselWrapperStyle = CarouselWrapperStyle;
162
- CarouselNavigationStyle.defaultProps = {
163
- theme: _base.default
164
- };
165
- CarouselButtonStyle.defaultProps = {
166
- theme: _base.default
167
- };
168
- CarouselStyledIcon.defaultProps = {
169
- theme: _base.default
170
- };
171
- CarouselSelectorWrapperStyle.defaultProps = {
172
- theme: _base.default
173
- };
174
- CarouselSelectorLabelStyle.defaultProps = {
175
- theme: _base.default
176
- };
177
- CarouselStyledIconLeft.defaultProps = {
178
- theme: _base.default
179
- };
180
- CarouselStyledIconRight.defaultProps = {
181
- theme: _base.default
182
- };
183
- CarouselPreviousButtonWrapperStyle.defaultProps = {
184
- theme: _base.default
185
- };
186
- CarouselNextButtonWrapperStyle.defaultProps = {
187
- theme: _base.default
188
- };
161
+ exports.CarouselWrapperStyle = CarouselWrapperStyle;
@@ -7,17 +7,12 @@ exports.SlideStyle = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
- var _base = _interopRequireDefault(require("../../../style/themes/base"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
15
11
 
16
12
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
13
 
18
14
  const SlideStyle = _styledComponents.default.div`
19
15
  ${({
20
- theme,
21
16
  onClick,
22
17
  id,
23
18
  selectedIndex
@@ -27,30 +22,27 @@ const SlideStyle = _styledComponents.default.div`
27
22
  width: 100%;
28
23
  z-index: 10;
29
24
 
30
- ${theme && (0, _styledComponents.css)`
31
- transition: 0.5s;
32
- min-width: 80%;
33
- transform: scale(0.9);
34
- opacity: 0.3;
35
- margin: 30px 0;
36
- box-shadow: ${theme.shadows.depth2};
37
-
38
- ${id === selectedIndex && (0, _styledComponents.css)`
39
- transform: scale(1);
40
- opacity: 1;
41
-
42
- ${onClick && (0, _styledComponents.css)`
43
- :hover {
44
- transition: all 0.2s ease-in;
45
- transform: scale(1.02);
46
- cursor: pointer;
47
- }
48
- `}
25
+ transition: 0.5s;
26
+ min-width: 80%;
27
+ transform: scale(0.9);
28
+ opacity: 0.3;
29
+ margin: 30px 0;
30
+ box-shadow: var(--boxShadow200);
31
+ background-color: var(--colorsComponentsNavigationYang100);
32
+
33
+ ${id === selectedIndex && (0, _styledComponents.css)`
34
+ transform: scale(1);
35
+ opacity: 1;
36
+
37
+ ${onClick && (0, _styledComponents.css)`
38
+ :hover {
39
+ transition: all 0.2s ease-in;
40
+ transform: scale(1.02);
41
+ cursor: pointer;
42
+ }
49
43
  `}
50
44
  `}
51
45
  `}
52
- `;
53
- exports.SlideStyle = SlideStyle;
54
- SlideStyle.defaultProps = {
55
- theme: _base.default
56
- }; // eslint-disable-next-line import/prefer-default-export
46
+ `; // eslint-disable-next-line import/prefer-default-export
47
+
48
+ exports.SlideStyle = SlideStyle;
@@ -55,21 +55,8 @@ const Drawer = ({
55
55
  const isControlled = (0, _react.useRef)(expanded !== undefined);
56
56
  const [isOpening, setIsOpening] = (0, _react.useState)(false);
57
57
  const [isClosing, setIsClosing] = (0, _react.useState)(false);
58
- const [isExpanded, setIsExpanded] = (0, _react.useState)(defaultExpanded);
58
+ const [isExpanded, setIsExpanded] = (0, _react.useState)(isControlled.current ? expanded : defaultExpanded);
59
59
  const timer = (0, _react.useRef)();
60
- (0, _react.useEffect)(() => {
61
- const message = "Drawer should not switch from uncontrolled to controlled" + " (or vice versa). Decide between using a controlled or uncontrolled Drawer element" + " for the lifetime of the component";
62
- (0, _invariant.default)(isControlled.current === (expanded !== undefined), message);
63
-
64
- if (expanded !== undefined) {
65
- setIsExpanded(expanded);
66
- }
67
- }, [expanded]);
68
- (0, _react.useEffect)(() => {
69
- return function cleanup() {
70
- clearTimeout(timer.current);
71
- };
72
- }, []);
73
60
  const getAnimationDuration = (0, _react.useCallback)(() => {
74
61
  if (animationDuration.indexOf("ms") !== -1) {
75
62
  const animationTime = animationDuration.substring(0, animationDuration.length - 2);
@@ -101,6 +88,33 @@ const Drawer = ({
101
88
  }, timeout);
102
89
  }
103
90
  }, [getAnimationDuration, isExpanded]);
91
+
92
+ function usePrevious(arg) {
93
+ const ref = (0, _react.useRef)();
94
+ (0, _react.useEffect)(() => {
95
+ ref.current = arg;
96
+ });
97
+ return ref.current;
98
+ }
99
+
100
+ const previousValue = usePrevious(expanded);
101
+ (0, _react.useEffect)(() => {
102
+ const message = "Drawer should not switch from uncontrolled to controlled" + " (or vice versa). Decide between using a controlled or uncontrolled Drawer element" + " for the lifetime of the component";
103
+ (0, _invariant.default)(isControlled.current === (expanded !== undefined), message);
104
+
105
+ if (isControlled.current && previousValue !== expanded) {
106
+ setIsExpanded(expanded);
107
+
108
+ if (!showControls && ![expanded, previousValue].includes(undefined)) {
109
+ toggleAnimation();
110
+ }
111
+ }
112
+ }, [expanded, toggleAnimation, previousValue, showControls]);
113
+ (0, _react.useEffect)(() => {
114
+ return function cleanup() {
115
+ clearTimeout(timer.current);
116
+ };
117
+ }, []);
104
118
  const toggleDrawer = (0, _react.useCallback)(ev => {
105
119
  setIsExpanded(!isExpanded);
106
120
  if (onChange) onChange(ev, !isExpanded);
@@ -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;
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
-
10
- var _themes = require("../../../style/themes");
8
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
11
9
 
12
10
  var _button = _interopRequireDefault(require("../../button/button.style"));
13
11
 
@@ -15,44 +13,32 @@ var _icon = _interopRequireDefault(require("../../icon/icon.style"));
15
13
 
16
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
15
 
18
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
19
-
20
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
-
22
16
  const StyledListActionButtonWrapper = _styledComponents.default.div`
23
- ${({
24
- theme
25
- }) => (0, _styledComponents.css)`
26
- padding-top: ${theme.space[1]}px;
27
- padding-bottom: ${theme.space[1]}px;
28
- border-top: 1px solid ${theme.disabled.border};
29
- box-shadow: 0 0px 0 0 rgba(0, 0, 0, 0), 0 -8px 8px 0 rgba(0, 0, 0, 0.03);
30
-
31
- ${_icon.default} {
32
- color: ${theme.text.color};
33
- }
34
-
35
- ${_button.default} {
36
- background: transparent;
37
- border: none;
38
- color: ${theme.text.color};
39
- justify-content: left;
40
- padding-left: ${theme.space[2]}px;
41
- padding-right: ${theme.space[2]}px;
42
- width: 100%;
43
-
44
- :hover {
45
- background-color: ${theme.select.selected};
46
-
47
- ${_icon.default} {
48
- color: ${theme.text.color};
49
- }
17
+ padding-top: var(--spacing100);
18
+ padding-bottom: var(--spacing100);
19
+ border-top: 1px solid var(--colorsUtilityDisabled600);
20
+ box-shadow: 0 0px 0 0 rgba(0, 0, 0, 0), 0 -8px 8px 0 rgba(0, 0, 0, 0.03);
21
+
22
+ ${_icon.default} {
23
+ color: var(--colorsUtilityYin090);
24
+ }
25
+
26
+ ${_button.default} {
27
+ background: transparent;
28
+ border: none;
29
+ color: var(--colorsUtilityYin090);
30
+ justify-content: left;
31
+ padding-left: var(--spacing200);
32
+ padding-right: var(--spacing200);
33
+ width: 100%;
34
+
35
+ :hover {
36
+ background-color: var(--colorsUtilityMajor025);
37
+ ${_icon.default} {
38
+ color: var(--colorsUtilityYin090);
50
39
  }
51
40
  }
52
- `}
41
+ }
53
42
  `;
54
- StyledListActionButtonWrapper.defaultProps = {
55
- theme: _themes.baseTheme
56
- };
57
43
  var _default = StyledListActionButtonWrapper;
58
44
  exports.default = _default;
@@ -9,8 +9,6 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
- var _base = _interopRequireDefault(require("../../../style/themes/base"));
13
-
14
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
13
 
16
14
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -26,10 +24,9 @@ const StyledOption = _styledComponents.default.li`
26
24
  user-select: none;
27
25
 
28
26
  ${({
29
- isHighlighted,
30
- theme
27
+ isHighlighted
31
28
  }) => isHighlighted && (0, _styledComponents.css)`
32
- background-color: ${theme.select.selected};
29
+ background-color: var(--colorsUtilityMajor200);
33
30
  `}
34
31
 
35
32
  ${({
@@ -37,20 +34,12 @@ const StyledOption = _styledComponents.default.li`
37
34
  }) => hidden && "display: none;"}
38
35
 
39
36
  :hover {
40
- ${({
41
- theme
42
- }) => (0, _styledComponents.css)`
43
- background-color: ${theme.select.selected};
44
- `}
37
+ background-color: var(--colorsUtilityMajor200);
45
38
  }
46
39
  `;
47
40
  StyledOption.propTypes = {
48
41
  id: _propTypes.default.any,
49
- isHighlighted: _propTypes.default.bool,
50
- theme: _propTypes.default.object
51
- };
52
- StyledOption.defaultProps = {
53
- theme: _base.default
42
+ isHighlighted: _propTypes.default.bool
54
43
  };
55
44
  var _default = StyledOption;
56
45
  exports.default = _default;
@@ -7,12 +7,8 @@ exports.default = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
 
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
10
  var _icon = _interopRequireDefault(require("../../icon/icon.style"));
13
11
 
14
- var _base = _interopRequireDefault(require("../../../style/themes/base"));
15
-
16
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
13
 
18
14
  const StyledOptionGroupHeader = _styledComponents.default.div`
@@ -30,30 +26,18 @@ const StyledOptionGroupHeader = _styledComponents.default.div`
30
26
  line-height: 18px;
31
27
  text-align: left;
32
28
  margin: 0;
33
- color: ${({
34
- theme
35
- }) => theme.select.optionHeader};
29
+ color: var(--colorsYin055);
36
30
  }
37
31
 
38
32
  ${_icon.default} {
39
33
  margin-right: 4px;
40
34
  margin-left: -5px;
41
- color: ${({
42
- theme
43
- }) => theme.select.optionHeader};
35
+ color: var(--colorsYin055);
44
36
 
45
37
  &:hover {
46
- color: ${({
47
- theme
48
- }) => theme.select.optionHeader};
38
+ color: var(--colorsYin055);
49
39
  }
50
40
  }
51
41
  `;
52
- StyledOptionGroupHeader.propTypes = {
53
- theme: _propTypes.default.object
54
- };
55
- StyledOptionGroupHeader.defaultProps = {
56
- theme: _base.default
57
- };
58
42
  var _default = StyledOptionGroupHeader;
59
43
  exports.default = _default;
@@ -7,10 +7,6 @@ exports.default = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
- var _base = _interopRequireDefault(require("../../../style/themes/base"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
15
11
 
16
12
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -23,16 +19,13 @@ const StyledOptionRow = _styledComponents.default.tr`
23
19
  }) => hidden && "display: none;"}
24
20
 
25
21
  ${({
26
- isHighlighted,
27
- theme
22
+ isHighlighted
28
23
  }) => isHighlighted && (0, _styledComponents.css)`
29
- background-color: ${theme.select.selected};
24
+ background-color: var(--colorsUtilityMajor200);
30
25
  `}
31
26
 
32
27
  :hover {
33
- background-color: ${({
34
- theme
35
- }) => theme.select.selected};
28
+ background-color: var(--colorsUtilityMajor200);
36
29
  }
37
30
 
38
31
  td {
@@ -44,8 +37,5 @@ const StyledOptionRow = _styledComponents.default.tr`
44
37
  }
45
38
  }
46
39
  `;
47
- StyledOptionRow.defaultProps = {
48
- theme: _base.default
49
- };
50
40
  var _default = StyledOptionRow;
51
41
  exports.default = _default;
@@ -13,7 +13,8 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
13
13
 
14
14
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
15
 
16
- const overhang = 4;
16
+ const overhang = 4; // TODO (design-tokens): no elovation/zindex tokens yet
17
+
17
18
  const StyledPopoverContainer = _styledComponents.default.div`
18
19
  position: absolute;
19
20
  z-index: ${({
@@ -72,9 +73,7 @@ const StyledSelectLoaderContainer = _styledComponents.default.li`
72
73
  `;
73
74
  exports.StyledSelectLoaderContainer = StyledSelectLoaderContainer;
74
75
  const StyledSelectListTable = _styledComponents.default.table`
75
- background-color: ${({
76
- theme
77
- }) => theme.colors.white};
76
+ background-color: var(--colorsUtilityYang100);
78
77
  border-collapse: collapse;
79
78
  border-radius: 0px;
80
79
  border-spacing: 0;
@@ -88,29 +87,21 @@ const StyledSelectListTable = _styledComponents.default.table`
88
87
  width: 100%;
89
88
  table-layout: fixed;
90
89
  }
91
- `;
90
+ `; // TODO (design-tokens): to match current style for border bottom colorsUtilityMajor100
91
+
92
92
  exports.StyledSelectListTable = StyledSelectListTable;
93
- StyledSelectListTable.defaultProps = {
94
- theme: _themes.baseTheme
95
- };
96
93
  const StyledSelectListTableHeader = _styledComponents.default.thead`
97
94
  th {
98
95
  position: sticky;
99
96
  top: 0;
100
- padding: ${({
101
- theme
102
- }) => 2 * theme.spacing}px;
103
- border-bottom: 1px solid ${({
104
- theme
105
- }) => theme.select.tableHeaderBorder};
97
+ padding: var(--spacing200);
98
+ border-bottom: 1px solid var(--colorsUtilityMajor050);
106
99
  background-color: white;
107
100
  text-align: left;
108
101
  font-weight: 900;
109
102
  font-size: 12px;
110
103
  text-transform: uppercase;
111
- color: ${({
112
- theme
113
- }) => theme.tileSelect.descriptionColor};
104
+ color: var(--colorsYin055);
114
105
  :after {
115
106
  content: "";
116
107
  display: block;
@@ -118,12 +109,8 @@ const StyledSelectListTableHeader = _styledComponents.default.thead`
118
109
  bottom: -8px;
119
110
  left: 0px;
120
111
  background-image: linear-gradient(
121
- ${({
122
- theme
123
- }) => theme.colors.black},
124
- ${({
125
- theme
126
- }) => theme.colors.white}
112
+ var(--colorsComponentsNavigationYin100),
113
+ var(--colorsYang100)
127
114
  );
128
115
  opacity: 0.03;
129
116
  height: 8px;
@@ -139,7 +126,4 @@ const StyledSelectListTableBody = _styledComponents.default.tbody`
139
126
  table-layout: fixed;
140
127
  max-height: 132px;
141
128
  `;
142
- exports.StyledSelectListTableBody = StyledSelectListTableBody;
143
- StyledSelectListTableHeader.defaultProps = {
144
- theme: _themes.baseTheme
145
- };
129
+ exports.StyledSelectListTableBody = StyledSelectListTableBody;
@@ -27,7 +27,6 @@ const StyledSelect = _styledComponents.default.div`
27
27
  ${({
28
28
  hasTextCursor,
29
29
  disabled,
30
- theme,
31
30
  readOnly,
32
31
  transparent
33
32
  }) => (0, _styledComponents.css)`
@@ -40,13 +39,13 @@ const StyledSelect = _styledComponents.default.div`
40
39
 
41
40
  ${disabled && (0, _styledComponents.css)`
42
41
  cursor: not-allowed;
43
- color: ${theme.disabled.disabled};
42
+ color: var(--colorsUtilityYin030);
44
43
  text-shadow: none;
45
44
  `}
46
45
 
47
46
  ${readOnly && (0, _styledComponents.css)`
48
47
  cursor: ${hasTextCursor ? "text" : "default"};
49
- color: ${theme.readOnly.textboxText};
48
+ color: var(--colorsYin065);
50
49
  text-shadow: none;
51
50
  `}
52
51
  }
@@ -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.18.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {