carbon-react 119.6.2 → 119.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React, { useCallback, useEffect, useRef, useState } from "react";
2
+ import React, { useEffect, useRef, useState, useCallback } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import throttle from "lodash/throttle";
5
5
  import StyledStickyFooter from "./sticky-footer.style";
@@ -26,7 +26,7 @@ const StickyFooter = _ref => {
26
26
  fullyScrolled = content.scrollHeight - content.scrollTop - stickyOffset <= content.clientHeight;
27
27
  }
28
28
  setIsSticky(!fullyScrolled);
29
- }, SCROLL_THROTTLE), []);
29
+ }, SCROLL_THROTTLE), [containerRef]);
30
30
  useEffect(() => {
31
31
  const content = containerRef.current;
32
32
  content?.addEventListener("scroll", checkFooterPosition, false);
@@ -48,6 +48,7 @@ const keydown = keys.reduce((acc, key) => {
48
48
  });
49
49
  };
50
50
  return acc;
51
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
51
52
  }, {});
52
53
  const simulate = {
53
54
  keydown
@@ -74,7 +74,7 @@ const StyledBadge = styled.span.attrs(_ref => {
74
74
  margin-right: 0;
75
75
 
76
76
  :before {
77
- font-size: 16px;
77
+ font-size: 20px;
78
78
  color: var(--colorsActionMajorYang100);
79
79
  }
80
80
  }
@@ -82,29 +82,22 @@ export const StyledForm = styled.form`
82
82
  height: ${height};
83
83
  `;
84
84
  }}
85
-
86
- ${_ref5 => {
87
- let {
88
- fieldSpacing
89
- } = _ref5;
90
- return css`
91
- ${StyledTextarea}
85
+
86
+ ${StyledTextarea}
92
87
  ${StyledFormField} {
93
- margin-bottom: 4px;
94
- }
95
- `;
96
- }}
88
+ margin-bottom: 4px;
89
+ }
97
90
 
98
91
  ${StyledSearch} ${StyledFormField} {
99
92
  margin-bottom: 0px;
100
93
  }
101
94
 
102
- ${_ref6 => {
95
+ ${_ref5 => {
103
96
  let {
104
97
  stickyFooter,
105
98
  isInModal,
106
99
  isInSidebar
107
- } = _ref6;
100
+ } = _ref5;
108
101
  return stickyFooter && css`
109
102
  display: flex;
110
103
  flex-direction: column;
@@ -122,16 +115,16 @@ export const StyledForm = styled.form`
122
115
  `;
123
116
  export const StyledRightButtons = styled.div`
124
117
  display: flex;
125
- ${_ref7 => {
118
+ ${_ref6 => {
126
119
  let {
127
120
  fullWidthButtons
128
- } = _ref7;
121
+ } = _ref6;
129
122
  return fullWidthButtons ? `margin-left: 0px;` : `margin-left: 16px;`;
130
123
  }}
131
- ${_ref8 => {
124
+ ${_ref7 => {
132
125
  let {
133
126
  buttonAlignment
134
- } = _ref8;
127
+ } = _ref7;
135
128
  return buttonAlignment === "left" && "flex-grow: 1";
136
129
  }};
137
130
 
@@ -146,16 +139,16 @@ export const StyledFullWidthButtons = styled.div`
146
139
  export const StyledLeftButtons = styled.div`
147
140
  display: flex;
148
141
  justify-content: flex-end;
149
- ${_ref9 => {
142
+ ${_ref8 => {
150
143
  let {
151
144
  fullWidthButtons
152
- } = _ref9;
145
+ } = _ref8;
153
146
  return fullWidthButtons ? `margin-right: 0px;` : `margin-right: 16px;`;
154
147
  }}
155
- ${_ref10 => {
148
+ ${_ref9 => {
156
149
  let {
157
150
  buttonAlignment
158
- } = _ref10;
151
+ } = _ref9;
159
152
  return buttonAlignment === "right" && "flex-grow: 1";
160
153
  }};
161
154
 
@@ -138,7 +138,7 @@ const StyledMenuItemWrapper = styled.a.attrs({
138
138
  }
139
139
 
140
140
  ${StyledIcon} {
141
- bottom: 1px;
141
+ bottom: 3px;
142
142
  }
143
143
  }
144
144
 
@@ -57,9 +57,9 @@ const StyledPill = styled.span`
57
57
  console.error(e);
58
58
  }
59
59
  return css`
60
- font-size: 10px;
60
+ font-size: 12px;
61
61
  letter-spacing: 0.7px;
62
- font-weight: 600;
62
+ font-weight: 700;
63
63
  position: relative;
64
64
  display: inline-flex;
65
65
  text-align: center;
@@ -90,7 +90,7 @@ const StyledPill = styled.span`
90
90
  ${size === "S" && css`
91
91
  min-height: 16px;
92
92
  line-height: 16px;
93
- font-size: 10px;
93
+ font-size: 12px;
94
94
 
95
95
  ${theme.roundedCornersOptOut && css`
96
96
  border-radius: 12px;
@@ -104,7 +104,7 @@ const StyledPill = styled.span`
104
104
  ${size === "M" && css`
105
105
  min-height: 20px;
106
106
  line-height: 20px;
107
- font-size: 12px;
107
+ font-size: 14px;
108
108
 
109
109
  ${theme.roundedCornersOptOut && css`
110
110
  border-radius: 12px;
@@ -130,8 +130,8 @@ const StyledPill = styled.span`
130
130
  `}
131
131
 
132
132
  ${size === "XL" && css`
133
- min-height: 26px;
134
- line-height: 26px;
133
+ min-height: 28px;
134
+ line-height: 28px;
135
135
  font-size: 16px;
136
136
 
137
137
  ${theme.roundedCornersOptOut && css`
@@ -189,8 +189,6 @@ const StyledPill = styled.span`
189
189
  }
190
190
 
191
191
  ${StyledIcon} {
192
- font-size: 12px;
193
- padding: 0 4px;
194
192
  height: unset;
195
193
  width: unset;
196
194
  color: ${contentColor};
@@ -209,52 +207,50 @@ const StyledPill = styled.span`
209
207
  }
210
208
 
211
209
  ${size === "S" && css`
212
- padding: 0 24px 0 7px;
210
+ padding: 0 22px 0 8px;
213
211
 
214
212
  button {
215
213
  padding: 0;
216
- line-height: 14px;
217
- ${addStyleToPillIcon("7px")}
214
+ line-height: 16px;
215
+ top: -2px;
216
+ ${addStyleToPillIcon("16px")}
218
217
  }
219
218
  `}
220
219
 
221
220
  ${size === "M" && css`
222
- padding: 0 32px 0 11px;
221
+ padding: 0 28px 0 8px;
223
222
 
224
223
  button {
225
224
  width: 24px;
226
225
  padding: 0;
227
226
  line-height: 15px;
228
- ${addStyleToPillIcon("10px")}
229
227
  }
230
228
  `}
231
229
 
232
230
  ${size === "L" && css`
233
- padding: 0 36px 0 15px;
231
+ padding: 0 32px 0 8px;
234
232
 
235
233
  button {
236
234
  width: 28px;
237
235
  padding: 0;
238
236
  line-height: 16px;
239
- ${addStyleToPillIcon("12px")}
240
237
  }
241
238
  `}
242
239
 
243
240
  ${size === "XL" && css`
244
- padding: 0 41px 0 19px;
241
+ padding: 0 36px 0 12px;
245
242
 
246
243
  button {
247
244
  width: 32px;
248
245
  padding: 0;
249
246
  line-height: 18px;
250
- ${addStyleToPillIcon("13px")}
251
247
  }
252
248
  `}
253
249
  `}
254
250
 
255
251
  ${!isDeletable && css`
256
252
  ${size === "S" && css`
257
- padding: 0 7px;
253
+ padding: 0 8px;
258
254
 
259
255
  button {
260
256
  padding: 0;
@@ -262,7 +258,7 @@ const StyledPill = styled.span`
262
258
  `}
263
259
 
264
260
  ${size === "M" && css`
265
- padding: 0 11px;
261
+ padding: 0 8px;
266
262
 
267
263
  button {
268
264
  width: 24px;
@@ -271,7 +267,7 @@ const StyledPill = styled.span`
271
267
  `}
272
268
 
273
269
  ${size === "L" && css`
274
- padding: 0 15px;
270
+ padding: 0 8px;
275
271
 
276
272
  button {
277
273
  width: 28px;
@@ -280,7 +276,7 @@ const StyledPill = styled.span`
280
276
  `}
281
277
 
282
278
  ${size === "XL" && css`
283
- padding: 0 19px;
279
+ padding: 0 12px;
284
280
 
285
281
  button {
286
282
  width: 32px;
@@ -7,7 +7,7 @@ export const PORTRAIT_SIZE_PARAMS = {
7
7
  },
8
8
  S: {
9
9
  dimensions: 32,
10
- iconDimensions: 16
10
+ iconDimensions: 20
11
11
  },
12
12
  M: {
13
13
  dimensions: 40,
@@ -76,13 +76,13 @@ const getIconColor = color => {
76
76
  return "var(--colorsUtilityYin090)";
77
77
  };
78
78
  export const StyledTickIcon = styled(Icon)`
79
- height: 22px;
80
- width: 22px;
79
+ height: 20px;
80
+ width: 20px;
81
81
  pointer-events: none;
82
82
  display: block;
83
83
 
84
84
  &::before {
85
- font-size: 22px;
85
+ font-size: 20px;
86
86
  color: ${_ref3 => {
87
87
  let {
88
88
  color
@@ -141,7 +141,9 @@ const Tooltip = /*#__PURE__*/React.forwardRef((_ref, ref) => {
141
141
  const handleTargetRef = useCallback(node => {
142
142
  reference(target || node);
143
143
  targetInternalRef.current = node;
144
- preserveRef(children.ref, node);
144
+ preserveRef(
145
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
146
+ children.ref, node);
145
147
  }, [reference, children, target]);
146
148
  const handleFloatingRef = useCallback(node => {
147
149
  floating(node);
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  import { aegeanTheme } from "..";
2
3
  export default (() => {
3
4
  console.warn(`"Medium Theme" has been renamed to "Aegean".
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  import { mintTheme } from "..";
2
3
  export default (() => {
3
4
  console.warn(`"Small Theme" has been renamed to "Mint".
@@ -35,7 +35,7 @@ const StickyFooter = _ref => {
35
35
  fullyScrolled = content.scrollHeight - content.scrollTop - stickyOffset <= content.clientHeight;
36
36
  }
37
37
  setIsSticky(!fullyScrolled);
38
- }, SCROLL_THROTTLE), []);
38
+ }, SCROLL_THROTTLE), [containerRef]);
39
39
  (0, _react.useEffect)(() => {
40
40
  const content = containerRef.current;
41
41
  content?.addEventListener("scroll", checkFooterPosition, false);
@@ -66,6 +66,7 @@ const keydown = keys.reduce((acc, key) => {
66
66
  });
67
67
  };
68
68
  return acc;
69
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
70
  }, {});
70
71
  const simulate = {
71
72
  keydown
@@ -85,7 +85,7 @@ const StyledBadge = _styledComponents.default.span.attrs(_ref => {
85
85
  margin-right: 0;
86
86
 
87
87
  :before {
88
- font-size: 16px;
88
+ font-size: 20px;
89
89
  color: var(--colorsActionMajorYang100);
90
90
  }
91
91
  }
@@ -93,29 +93,22 @@ const StyledForm = _styledComponents.default.form`
93
93
  height: ${height};
94
94
  `;
95
95
  }}
96
-
97
- ${_ref5 => {
98
- let {
99
- fieldSpacing
100
- } = _ref5;
101
- return (0, _styledComponents.css)`
102
- ${_textarea.default}
96
+
97
+ ${_textarea.default}
103
98
  ${_formField.default} {
104
- margin-bottom: 4px;
105
- }
106
- `;
107
- }}
99
+ margin-bottom: 4px;
100
+ }
108
101
 
109
102
  ${_search.default} ${_formField.default} {
110
103
  margin-bottom: 0px;
111
104
  }
112
105
 
113
- ${_ref6 => {
106
+ ${_ref5 => {
114
107
  let {
115
108
  stickyFooter,
116
109
  isInModal,
117
110
  isInSidebar
118
- } = _ref6;
111
+ } = _ref5;
119
112
  return stickyFooter && (0, _styledComponents.css)`
120
113
  display: flex;
121
114
  flex-direction: column;
@@ -134,16 +127,16 @@ const StyledForm = _styledComponents.default.form`
134
127
  exports.StyledForm = StyledForm;
135
128
  const StyledRightButtons = _styledComponents.default.div`
136
129
  display: flex;
137
- ${_ref7 => {
130
+ ${_ref6 => {
138
131
  let {
139
132
  fullWidthButtons
140
- } = _ref7;
133
+ } = _ref6;
141
134
  return fullWidthButtons ? `margin-left: 0px;` : `margin-left: 16px;`;
142
135
  }}
143
- ${_ref8 => {
136
+ ${_ref7 => {
144
137
  let {
145
138
  buttonAlignment
146
- } = _ref8;
139
+ } = _ref7;
147
140
  return buttonAlignment === "left" && "flex-grow: 1";
148
141
  }};
149
142
 
@@ -160,16 +153,16 @@ exports.StyledFullWidthButtons = StyledFullWidthButtons;
160
153
  const StyledLeftButtons = _styledComponents.default.div`
161
154
  display: flex;
162
155
  justify-content: flex-end;
163
- ${_ref9 => {
156
+ ${_ref8 => {
164
157
  let {
165
158
  fullWidthButtons
166
- } = _ref9;
159
+ } = _ref8;
167
160
  return fullWidthButtons ? `margin-right: 0px;` : `margin-right: 16px;`;
168
161
  }}
169
- ${_ref10 => {
162
+ ${_ref9 => {
170
163
  let {
171
164
  buttonAlignment
172
- } = _ref10;
165
+ } = _ref9;
173
166
  return buttonAlignment === "right" && "flex-grow: 1";
174
167
  }};
175
168
 
@@ -147,7 +147,7 @@ const StyledMenuItemWrapper = _styledComponents.default.a.attrs({
147
147
  }
148
148
 
149
149
  ${_icon.default} {
150
- bottom: 1px;
150
+ bottom: 3px;
151
151
  }
152
152
  }
153
153
 
@@ -66,9 +66,9 @@ const StyledPill = _styledComponents.default.span`
66
66
  console.error(e);
67
67
  }
68
68
  return (0, _styledComponents.css)`
69
- font-size: 10px;
69
+ font-size: 12px;
70
70
  letter-spacing: 0.7px;
71
- font-weight: 600;
71
+ font-weight: 700;
72
72
  position: relative;
73
73
  display: inline-flex;
74
74
  text-align: center;
@@ -99,7 +99,7 @@ const StyledPill = _styledComponents.default.span`
99
99
  ${size === "S" && (0, _styledComponents.css)`
100
100
  min-height: 16px;
101
101
  line-height: 16px;
102
- font-size: 10px;
102
+ font-size: 12px;
103
103
 
104
104
  ${theme.roundedCornersOptOut && (0, _styledComponents.css)`
105
105
  border-radius: 12px;
@@ -113,7 +113,7 @@ const StyledPill = _styledComponents.default.span`
113
113
  ${size === "M" && (0, _styledComponents.css)`
114
114
  min-height: 20px;
115
115
  line-height: 20px;
116
- font-size: 12px;
116
+ font-size: 14px;
117
117
 
118
118
  ${theme.roundedCornersOptOut && (0, _styledComponents.css)`
119
119
  border-radius: 12px;
@@ -139,8 +139,8 @@ const StyledPill = _styledComponents.default.span`
139
139
  `}
140
140
 
141
141
  ${size === "XL" && (0, _styledComponents.css)`
142
- min-height: 26px;
143
- line-height: 26px;
142
+ min-height: 28px;
143
+ line-height: 28px;
144
144
  font-size: 16px;
145
145
 
146
146
  ${theme.roundedCornersOptOut && (0, _styledComponents.css)`
@@ -198,8 +198,6 @@ const StyledPill = _styledComponents.default.span`
198
198
  }
199
199
 
200
200
  ${_icon.default} {
201
- font-size: 12px;
202
- padding: 0 4px;
203
201
  height: unset;
204
202
  width: unset;
205
203
  color: ${contentColor};
@@ -218,52 +216,50 @@ const StyledPill = _styledComponents.default.span`
218
216
  }
219
217
 
220
218
  ${size === "S" && (0, _styledComponents.css)`
221
- padding: 0 24px 0 7px;
219
+ padding: 0 22px 0 8px;
222
220
 
223
221
  button {
224
222
  padding: 0;
225
- line-height: 14px;
226
- ${addStyleToPillIcon("7px")}
223
+ line-height: 16px;
224
+ top: -2px;
225
+ ${addStyleToPillIcon("16px")}
227
226
  }
228
227
  `}
229
228
 
230
229
  ${size === "M" && (0, _styledComponents.css)`
231
- padding: 0 32px 0 11px;
230
+ padding: 0 28px 0 8px;
232
231
 
233
232
  button {
234
233
  width: 24px;
235
234
  padding: 0;
236
235
  line-height: 15px;
237
- ${addStyleToPillIcon("10px")}
238
236
  }
239
237
  `}
240
238
 
241
239
  ${size === "L" && (0, _styledComponents.css)`
242
- padding: 0 36px 0 15px;
240
+ padding: 0 32px 0 8px;
243
241
 
244
242
  button {
245
243
  width: 28px;
246
244
  padding: 0;
247
245
  line-height: 16px;
248
- ${addStyleToPillIcon("12px")}
249
246
  }
250
247
  `}
251
248
 
252
249
  ${size === "XL" && (0, _styledComponents.css)`
253
- padding: 0 41px 0 19px;
250
+ padding: 0 36px 0 12px;
254
251
 
255
252
  button {
256
253
  width: 32px;
257
254
  padding: 0;
258
255
  line-height: 18px;
259
- ${addStyleToPillIcon("13px")}
260
256
  }
261
257
  `}
262
258
  `}
263
259
 
264
260
  ${!isDeletable && (0, _styledComponents.css)`
265
261
  ${size === "S" && (0, _styledComponents.css)`
266
- padding: 0 7px;
262
+ padding: 0 8px;
267
263
 
268
264
  button {
269
265
  padding: 0;
@@ -271,7 +267,7 @@ const StyledPill = _styledComponents.default.span`
271
267
  `}
272
268
 
273
269
  ${size === "M" && (0, _styledComponents.css)`
274
- padding: 0 11px;
270
+ padding: 0 8px;
275
271
 
276
272
  button {
277
273
  width: 24px;
@@ -280,7 +276,7 @@ const StyledPill = _styledComponents.default.span`
280
276
  `}
281
277
 
282
278
  ${size === "L" && (0, _styledComponents.css)`
283
- padding: 0 15px;
279
+ padding: 0 8px;
284
280
 
285
281
  button {
286
282
  width: 28px;
@@ -289,7 +285,7 @@ const StyledPill = _styledComponents.default.span`
289
285
  `}
290
286
 
291
287
  ${size === "XL" && (0, _styledComponents.css)`
292
- padding: 0 19px;
288
+ padding: 0 12px;
293
289
 
294
290
  button {
295
291
  width: 32px;
@@ -15,7 +15,7 @@ const PORTRAIT_SIZE_PARAMS = {
15
15
  },
16
16
  S: {
17
17
  dimensions: 32,
18
- iconDimensions: 16
18
+ iconDimensions: 20
19
19
  },
20
20
  M: {
21
21
  dimensions: 40,
@@ -88,13 +88,13 @@ const getIconColor = color => {
88
88
  return "var(--colorsUtilityYin090)";
89
89
  };
90
90
  const StyledTickIcon = (0, _styledComponents.default)(_icon.default)`
91
- height: 22px;
92
- width: 22px;
91
+ height: 20px;
92
+ width: 20px;
93
93
  pointer-events: none;
94
94
  display: block;
95
95
 
96
96
  &::before {
97
- font-size: 22px;
97
+ font-size: 20px;
98
98
  color: ${_ref3 => {
99
99
  let {
100
100
  color
@@ -150,7 +150,9 @@ const Tooltip = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
150
150
  const handleTargetRef = (0, _react.useCallback)(node => {
151
151
  reference(target || node);
152
152
  targetInternalRef.current = node;
153
- preserveRef(children.ref, node);
153
+ preserveRef(
154
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
155
+ children.ref, node);
154
156
  }, [reference, children, target]);
155
157
  const handleFloatingRef = (0, _react.useCallback)(node => {
156
158
  floating(node);
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _ = require("..");
8
+ /* eslint-disable no-console */
8
9
  var _default = (() => {
9
10
  console.warn(`"Medium Theme" has been renamed to "Aegean".
10
11
  All references to that theme should be updated to:
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _ = require("..");
8
+ /* eslint-disable no-console */
8
9
  var _default = (() => {
9
10
  console.warn(`"Small Theme" has been renamed to "Mint".
10
11
  All references to that theme should be updated to:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "119.6.2",
3
+ "version": "119.6.3",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",