carbon-react 125.5.0 → 125.5.1

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.
@@ -179,7 +179,8 @@ const FlatTableRow = /*#__PURE__*/React.forwardRef(({
179
179
  totalChildren: cellsArray.length,
180
180
  id: internalId.current,
181
181
  "data-selected": selected && expandableArea === "wholeRow",
182
- "data-highlighted": highlighted && expandableArea === "wholeRow"
182
+ "data-highlighted": highlighted && expandableArea === "wholeRow",
183
+ rowHeight: rowRef?.current?.offsetHeight
183
184
  }, interactiveRowProps, rest), /*#__PURE__*/React.createElement(FlatTableRowContext.Provider, {
184
185
  value: {
185
186
  firstCellId,
@@ -16,6 +16,7 @@ interface StyledFlatTableRowProps extends Pick<FlatTableRowProps, "bgColor" | "h
16
16
  isSubRow?: boolean;
17
17
  isFirstSubRow?: boolean;
18
18
  stickyOffset?: number;
19
+ rowHeight?: number;
19
20
  }
20
21
  declare const StyledFlatTableRow: import("styled-components").StyledComponent<"tr", any, StyledFlatTableRowProps, never>;
21
22
  export default StyledFlatTableRow;
@@ -8,7 +8,6 @@ import StyledIcon from "../../icon/icon.style";
8
8
  import { toColor } from "../../../style/utils/color";
9
9
  import addFocusStyling from "../../../style/utils/add-focus-styling";
10
10
  import { isSafari } from "../../../__internal__/utils/helpers/browser-type-check";
11
- import cellSizes from "../cell-sizes.style";
12
11
  const horizontalBorderSizes = {
13
12
  medium: "2px",
14
13
  large: "4px"
@@ -86,13 +85,6 @@ const verticalBorderColor = colorTheme => {
86
85
  return "var(--colorsUtilityMajor100)";
87
86
  }
88
87
  };
89
- const getFocusHeight = size => {
90
- if (!size) return "40px";
91
- const {
92
- height
93
- } = cellSizes[size];
94
- return height;
95
- };
96
88
  const StyledFlatTableRow = styled.tr`
97
89
  ${({
98
90
  bgColor,
@@ -116,7 +108,8 @@ const StyledFlatTableRow = styled.tr`
116
108
  size,
117
109
  theme,
118
110
  isDragging,
119
- draggable
111
+ draggable,
112
+ rowHeight
120
113
  }) => {
121
114
  const backgroundColor = bgColor ? toColor(theme, bgColor) : undefined;
122
115
  const customBorderColor = horizontalBorderColor ? toColor(theme, horizontalBorderColor) : undefined;
@@ -223,6 +216,7 @@ const StyledFlatTableRow = styled.tr`
223
216
  top: 0px;
224
217
  }
225
218
  }
219
+
226
220
  /* Styling for safari. Position relative does not work on tr elements on Safari */
227
221
  ${isSafari(navigator) && css`
228
222
  ${theme.focusRedesignOptOut && /* istanbul ignore next */
@@ -239,10 +233,10 @@ const StyledFlatTableRow = styled.tr`
239
233
  ${!theme.focusRedesignOptOut && css`
240
234
  position: -webkit-sticky;
241
235
  :after {
242
- content: none;
243
236
  border: none;
244
237
  content: "";
245
- height: ${getFocusHeight(size)} ${newFocusStyling};
238
+ height: ${rowHeight}px;
239
+ ${newFocusStyling}
246
240
  }
247
241
  `}
248
242
  `}
@@ -188,7 +188,8 @@ const FlatTableRow = exports.FlatTableRow = /*#__PURE__*/_react.default.forwardR
188
188
  totalChildren: cellsArray.length,
189
189
  id: internalId.current,
190
190
  "data-selected": selected && expandableArea === "wholeRow",
191
- "data-highlighted": highlighted && expandableArea === "wholeRow"
191
+ "data-highlighted": highlighted && expandableArea === "wholeRow",
192
+ rowHeight: rowRef?.current?.offsetHeight
192
193
  }, interactiveRowProps, rest), /*#__PURE__*/_react.default.createElement(_flatTableRowContext.default.Provider, {
193
194
  value: {
194
195
  firstCellId,
@@ -16,6 +16,7 @@ interface StyledFlatTableRowProps extends Pick<FlatTableRowProps, "bgColor" | "h
16
16
  isSubRow?: boolean;
17
17
  isFirstSubRow?: boolean;
18
18
  stickyOffset?: number;
19
+ rowHeight?: number;
19
20
  }
20
21
  declare const StyledFlatTableRow: import("styled-components").StyledComponent<"tr", any, StyledFlatTableRowProps, never>;
21
22
  export default StyledFlatTableRow;
@@ -14,7 +14,6 @@ var _icon = _interopRequireDefault(require("../../icon/icon.style"));
14
14
  var _color = require("../../../style/utils/color");
15
15
  var _addFocusStyling = _interopRequireDefault(require("../../../style/utils/add-focus-styling"));
16
16
  var _browserTypeCheck = require("../../../__internal__/utils/helpers/browser-type-check");
17
- var _cellSizes = _interopRequireDefault(require("../cell-sizes.style"));
18
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
18
  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); }
20
19
  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 && Object.prototype.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; }
@@ -95,13 +94,6 @@ const verticalBorderColor = colorTheme => {
95
94
  return "var(--colorsUtilityMajor100)";
96
95
  }
97
96
  };
98
- const getFocusHeight = size => {
99
- if (!size) return "40px";
100
- const {
101
- height
102
- } = _cellSizes.default[size];
103
- return height;
104
- };
105
97
  const StyledFlatTableRow = _styledComponents.default.tr`
106
98
  ${({
107
99
  bgColor,
@@ -125,7 +117,8 @@ const StyledFlatTableRow = _styledComponents.default.tr`
125
117
  size,
126
118
  theme,
127
119
  isDragging,
128
- draggable
120
+ draggable,
121
+ rowHeight
129
122
  }) => {
130
123
  const backgroundColor = bgColor ? (0, _color.toColor)(theme, bgColor) : undefined;
131
124
  const customBorderColor = horizontalBorderColor ? (0, _color.toColor)(theme, horizontalBorderColor) : undefined;
@@ -232,6 +225,7 @@ const StyledFlatTableRow = _styledComponents.default.tr`
232
225
  top: 0px;
233
226
  }
234
227
  }
228
+
235
229
  /* Styling for safari. Position relative does not work on tr elements on Safari */
236
230
  ${(0, _browserTypeCheck.isSafari)(navigator) && (0, _styledComponents.css)`
237
231
  ${theme.focusRedesignOptOut && /* istanbul ignore next */
@@ -248,10 +242,10 @@ const StyledFlatTableRow = _styledComponents.default.tr`
248
242
  ${!theme.focusRedesignOptOut && (0, _styledComponents.css)`
249
243
  position: -webkit-sticky;
250
244
  :after {
251
- content: none;
252
245
  border: none;
253
246
  content: "";
254
- height: ${getFocusHeight(size)} ${newFocusStyling};
247
+ height: ${rowHeight}px;
248
+ ${newFocusStyling}
255
249
  }
256
250
  `}
257
251
  `}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "125.5.0",
3
+ "version": "125.5.1",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",