@zendeskgarden/react-tables 8.63.0 → 8.63.2

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.
package/dist/index.cjs.js CHANGED
@@ -53,41 +53,41 @@ function _extends$3() {
53
53
  return _extends$3.apply(this, arguments);
54
54
  }
55
55
 
56
- const COMPONENT_ID$a = 'tables.body';
56
+ const COMPONENT_ID$b = 'tables.body';
57
57
  const StyledBody = styled__default.default.tbody.attrs({
58
- 'data-garden-id': COMPONENT_ID$a,
59
- 'data-garden-version': '8.63.0'
58
+ 'data-garden-id': COMPONENT_ID$b,
59
+ 'data-garden-version': '8.63.2'
60
60
  }).withConfig({
61
61
  displayName: "StyledBody",
62
62
  componentId: "sc-14ud6y-0"
63
- })(["", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
63
+ })(["", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props));
64
64
  StyledBody.defaultProps = {
65
65
  theme: reactTheming.DEFAULT_THEME
66
66
  };
67
67
 
68
- const COMPONENT_ID$9 = 'tables.caption';
68
+ const COMPONENT_ID$a = 'tables.caption';
69
69
  const StyledCaption = styled__default.default.caption.attrs({
70
- 'data-garden-id': COMPONENT_ID$9,
71
- 'data-garden-version': '8.63.0'
70
+ 'data-garden-id': COMPONENT_ID$a,
71
+ 'data-garden-version': '8.63.2'
72
72
  }).withConfig({
73
73
  displayName: "StyledCaption",
74
74
  componentId: "sc-113y327-0"
75
- })(["display:table-caption;text-align:", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
75
+ })(["display:table-caption;text-align:", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
76
76
  StyledCaption.defaultProps = {
77
77
  theme: reactTheming.DEFAULT_THEME
78
78
  };
79
79
 
80
- const COMPONENT_ID$8 = 'tables.table';
80
+ const COMPONENT_ID$9 = 'tables.table';
81
81
  const getLineHeight = props => {
82
82
  return `${props.theme.space.base * 5}px`;
83
83
  };
84
84
  const StyledTable = styled__default.default.table.attrs({
85
- 'data-garden-id': COMPONENT_ID$8,
86
- 'data-garden-version': '8.63.0'
85
+ 'data-garden-id': COMPONENT_ID$9,
86
+ 'data-garden-version': '8.63.2'
87
87
  }).withConfig({
88
88
  displayName: "StyledTable",
89
89
  componentId: "sc-gje7na-0"
90
- })(["display:table;border:none;width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0;line-height:", ";color:", ";font-size:", ";direction:", ";", ";"], props => getLineHeight(props), props => props.theme.colors.foreground, props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
90
+ })(["display:table;border:none;width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0;line-height:", ";color:", ";font-size:", ";direction:", ";", ";"], props => getLineHeight(props), props => props.theme.colors.foreground, props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
91
91
  StyledTable.defaultProps = {
92
92
  theme: reactTheming.DEFAULT_THEME
93
93
  };
@@ -101,7 +101,7 @@ const getRowHeight = props => {
101
101
  return `${props.theme.space.base * 10}px`;
102
102
  };
103
103
 
104
- const COMPONENT_ID$7 = 'tables.cell';
104
+ const COMPONENT_ID$8 = 'tables.cell';
105
105
  const truncatedStyling$1 = styled.css(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
106
106
  const sizeStyling = props => {
107
107
  let boxSizing = 'border-box';
@@ -125,17 +125,17 @@ const sizeStyling = props => {
125
125
  return styled.css(["box-sizing:", ";padding:", ";width:", ";height:", ";"], boxSizing, padding, width, height);
126
126
  };
127
127
  const StyledCell = styled__default.default.td.attrs({
128
- 'data-garden-id': COMPONENT_ID$7,
129
- 'data-garden-version': '8.63.0'
128
+ 'data-garden-id': COMPONENT_ID$8,
129
+ 'data-garden-version': '8.63.2'
130
130
  }).withConfig({
131
131
  displayName: "StyledCell",
132
132
  componentId: "sc-8hpncx-0"
133
- })(["display:table-cell;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out;", ";", ";&[hidden]{", "}", ";"], props => sizeStyling(props), props => props.isTruncated && truncatedStyling$1, polished.hideVisually(), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
133
+ })(["display:table-cell;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out;", ";", ";", ";"], props => sizeStyling(props), props => props.isTruncated && truncatedStyling$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
134
134
  StyledCell.defaultProps = {
135
135
  theme: reactTheming.DEFAULT_THEME
136
136
  };
137
137
 
138
- const COMPONENT_ID$6 = 'tables.overflow_button';
138
+ const COMPONENT_ID$7 = 'tables.overflow_button';
139
139
  const OVERFLOW_BUTTON_SIZE = '2em';
140
140
  const colorStyles$1 = props => {
141
141
  const boxShadow = props.theme.shadows.md(reactTheming.getColor('primaryHue', 600, props.theme, 0.35));
@@ -154,13 +154,13 @@ const colorStyles$1 = props => {
154
154
  return styled.css(["color:", ";&:hover{background-color:", ";color:", ";}&:active{background-color:", ";color:", ";}&:focus{outline:none;}&[data-garden-focus-visible]{box-shadow:inset ", ";}"], foregroundColor, hoverBackgroundColor, hoverForegroundColor, activeBackgroundColor, activeForegroundColor, boxShadow);
155
155
  };
156
156
  const StyledOverflowButton = styled__default.default.button.attrs({
157
- 'data-garden-id': COMPONENT_ID$6,
158
- 'data-garden-version': '8.63.0',
157
+ 'data-garden-id': COMPONENT_ID$7,
158
+ 'data-garden-version': '8.63.2',
159
159
  type: 'button'
160
160
  }).withConfig({
161
161
  displayName: "StyledOverflowButton",
162
162
  componentId: "sc-1eba2ml-0"
163
- })(["display:block;transition:opacity 0.25s ease-in-out,background-color 0.1s ease-in-out;opacity:", ";z-index:", ";margin-top:calc(", " - 1em);border:none;border-radius:50%;background-color:transparent;cursor:pointer;padding:0;width:100%;height:", ";text-decoration:none;font-size:inherit;", " &[aria-expanded='true']{opacity:1;}", ";"], props => props.isHovered || props.isFocused || props.isActive ? '1' : '0', props => props.isActive ? '1' : '0', props => polished.math(`${getRowHeight(props)} / 2`), OVERFLOW_BUTTON_SIZE, props => colorStyles$1(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
163
+ })(["display:block;transition:opacity 0.25s ease-in-out,background-color 0.1s ease-in-out;opacity:", ";z-index:", ";margin-top:calc(", " - 1em);border:none;border-radius:50%;background-color:transparent;cursor:pointer;padding:0;width:100%;height:", ";text-decoration:none;font-size:inherit;", " &[aria-expanded='true']{opacity:1;}", ";"], props => props.isHovered || props.isFocused || props.isActive ? '1' : '0', props => props.isActive ? '1' : '0', props => polished.math(`${getRowHeight(props)} / 2`), OVERFLOW_BUTTON_SIZE, props => colorStyles$1(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
164
164
  StyledOverflowButton.defaultProps = {
165
165
  theme: reactTheming.DEFAULT_THEME
166
166
  };
@@ -172,7 +172,7 @@ StyledOverflowButtonIconWrapper.defaultProps = {
172
172
  theme: reactTheming.DEFAULT_THEME
173
173
  };
174
174
 
175
- const COMPONENT_ID$5 = 'tables.row';
175
+ const COMPONENT_ID$6 = 'tables.row';
176
176
  const StyledBaseRow = styled__default.default.tr.withConfig({
177
177
  displayName: "StyledRow__StyledBaseRow",
178
178
  componentId: "sc-ek66ow-0"
@@ -210,18 +210,18 @@ const colorStyles = props => {
210
210
  return styled.css(["border-bottom-color:", ";background-color:", ";&:hover{border-bottom-color:", ";background-color:", ";", "{opacity:1;}}&:focus{outline:none;}", ":first-of-type{box-shadow:", ";&:focus{box-shadow:", ";}}"], borderColor, backgroundColor, hoverBorderBottomColor, hoverBackgroundColor, StyledOverflowButton, StyledCell, props.isFocused && boxShadow, boxShadow);
211
211
  };
212
212
  const StyledRow = styled__default.default(StyledBaseRow).attrs(props => ({
213
- 'data-garden-id': COMPONENT_ID$5,
214
- 'data-garden-version': '8.63.0',
213
+ 'data-garden-id': COMPONENT_ID$6,
214
+ 'data-garden-version': '8.63.2',
215
215
  tabIndex: props.isReadOnly ? undefined : -1
216
216
  })).withConfig({
217
217
  displayName: "StyledRow",
218
218
  componentId: "sc-ek66ow-1"
219
- })(["height:", ";", " ", ";"], getRowHeight, props => colorStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
219
+ })(["height:", ";", " ", ";"], getRowHeight, props => colorStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
220
220
  StyledRow.defaultProps = {
221
221
  theme: reactTheming.DEFAULT_THEME
222
222
  };
223
223
 
224
- const COMPONENT_ID$4 = 'tables.header_row';
224
+ const COMPONENT_ID$5 = 'tables.header_row';
225
225
  const getHeaderRowHeight = props => {
226
226
  if (props.size === 'large') {
227
227
  return `${props.theme.space.base * 18}px`;
@@ -231,50 +231,50 @@ const getHeaderRowHeight = props => {
231
231
  return `${props.theme.space.base * 12}px`;
232
232
  };
233
233
  const StyledHeaderRow = styled__default.default(StyledBaseRow).attrs({
234
- 'data-garden-id': COMPONENT_ID$4,
235
- 'data-garden-version': '8.63.0'
234
+ 'data-garden-id': COMPONENT_ID$5,
235
+ 'data-garden-version': '8.63.2'
236
236
  }).withConfig({
237
237
  displayName: "StyledHeaderRow",
238
238
  componentId: "sc-16ogvdx-0"
239
- })(["border-bottom-color:", ";height:", ";vertical-align:bottom;font-weight:", ";", "{opacity:1;margin-top:0;margin-bottom:calc(", " - 1em);}", ";"], props => reactTheming.getColor('neutralHue', 300, props.theme), getHeaderRowHeight, props => props.theme.fontWeights.semibold, StyledOverflowButton, props => polished.math(`${getHeaderRowHeight(props)} / 2`), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
239
+ })(["border-bottom-color:", ";height:", ";vertical-align:bottom;font-weight:", ";", "{opacity:1;margin-top:0;margin-bottom:calc(", " - 1em);}", ";"], props => reactTheming.getColor('neutralHue', 300, props.theme), getHeaderRowHeight, props => props.theme.fontWeights.semibold, StyledOverflowButton, props => polished.math(`${getHeaderRowHeight(props)} / 2`), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
240
240
  StyledHeaderRow.defaultProps = {
241
241
  theme: reactTheming.DEFAULT_THEME
242
242
  };
243
243
 
244
- const COMPONENT_ID$3 = 'tables.head';
244
+ const COMPONENT_ID$4 = 'tables.head';
245
245
  const stickyStyles = props => {
246
246
  const borderColor = reactTheming.getColor('neutralHue', 300, props.theme);
247
247
  return styled.css(["position:sticky;top:0;z-index:1;box-shadow:inset 0 -", " 0 ", ";background-color:", ";& > ", ":last-child{border-bottom-color:transparent;}"], props.theme.borderWidths.sm, borderColor, props.theme.colors.background, StyledHeaderRow);
248
248
  };
249
249
  const StyledHead = styled__default.default.thead.attrs({
250
- 'data-garden-id': COMPONENT_ID$3,
251
- 'data-garden-version': '8.63.0'
250
+ 'data-garden-id': COMPONENT_ID$4,
251
+ 'data-garden-version': '8.63.2'
252
252
  }).withConfig({
253
253
  displayName: "StyledHead",
254
254
  componentId: "sc-spf23a-0"
255
- })(["", " ", ";"], props => props.isSticky && stickyStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
255
+ })(["", " ", ";"], props => props.isSticky && stickyStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
256
256
  StyledHead.defaultProps = {
257
257
  theme: reactTheming.DEFAULT_THEME
258
258
  };
259
259
 
260
- const COMPONENT_ID$2 = 'tables.group_row';
260
+ const COMPONENT_ID$3 = 'tables.group_row';
261
261
  const sizeStyles$1 = props => {
262
262
  const height = `${props.theme.space.base * 8}px`;
263
263
  const lineHeight = getLineHeight(props);
264
264
  return styled.css(["height:", ";line-height:", ";font-size:", ";", "{padding:", " ", "px;}"], height, lineHeight, props.theme.fontSizes.sm, StyledCell, polished.math(`(${height} - ${lineHeight}) / 2`), props.theme.space.base * 3);
265
265
  };
266
266
  const StyledGroupRow = styled__default.default(StyledBaseRow).attrs({
267
- 'data-garden-id': COMPONENT_ID$2,
268
- 'data-garden-version': '8.63.0'
267
+ 'data-garden-id': COMPONENT_ID$3,
268
+ 'data-garden-version': '8.63.2'
269
269
  }).withConfig({
270
270
  displayName: "StyledGroupRow",
271
271
  componentId: "sc-mpd0r8-0"
272
- })(["background-color:", ";", " ", ";"], props => reactTheming.getColor('neutralHue', 100, props.theme), props => sizeStyles$1(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
272
+ })(["background-color:", ";", " ", ";"], props => reactTheming.getColor('neutralHue', 100, props.theme), props => sizeStyles$1(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
273
273
  StyledGroupRow.defaultProps = {
274
274
  theme: reactTheming.DEFAULT_THEME
275
275
  };
276
276
 
277
- const COMPONENT_ID$1 = 'tables.sortable';
277
+ const COMPONENT_ID$2 = 'tables.sortable';
278
278
  const StyledBaseIconWrapper = styled__default.default.div.withConfig({
279
279
  displayName: "StyledSortableButton__StyledBaseIconWrapper",
280
280
  componentId: "sc-2s1dli-0"
@@ -297,8 +297,8 @@ StyledSortableFillIconWrapper.defaultProps = {
297
297
  theme: reactTheming.DEFAULT_THEME
298
298
  };
299
299
  const StyledSortableButton = styled__default.default.button.attrs({
300
- 'data-garden-id': COMPONENT_ID$1,
301
- 'data-garden-version': '8.63.0',
300
+ 'data-garden-id': COMPONENT_ID$2,
301
+ 'data-garden-version': '8.63.2',
302
302
  type: 'button'
303
303
  }).withConfig({
304
304
  displayName: "StyledSortableButton",
@@ -337,12 +337,12 @@ const StyledSortableButton = styled__default.default.button.attrs({
337
337
  color: ${reactTheming.getColor('primaryHue', 600, props.theme, 0.25)};
338
338
  fill: ${reactTheming.getColor('primaryHue', 600, props.theme)};
339
339
  }
340
- `, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
340
+ `, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
341
341
  StyledSortableButton.defaultProps = {
342
342
  theme: reactTheming.DEFAULT_THEME
343
343
  };
344
344
 
345
- const COMPONENT_ID = 'tables.header_cell';
345
+ const COMPONENT_ID$1 = 'tables.header_cell';
346
346
  const truncatedStyling = styled.css(["", "{max-width:100%;overflow:hidden;text-overflow:ellipsis;}"], StyledSortableButton);
347
347
  const sizeStyles = props => {
348
348
  let paddingVertical = undefined;
@@ -353,8 +353,8 @@ const sizeStyles = props => {
353
353
  };
354
354
  const StyledHeaderCell = styled__default.default(StyledCell).attrs({
355
355
  as: 'th',
356
- 'data-garden-id': COMPONENT_ID,
357
- 'data-garden-version': '8.63.0'
356
+ 'data-garden-id': COMPONENT_ID$1,
357
+ 'data-garden-version': '8.63.2'
358
358
  }).withConfig({
359
359
  displayName: "StyledHeaderCell",
360
360
  componentId: "sc-fzagoe-0"
@@ -366,11 +366,23 @@ const StyledHeaderCell = styled__default.default(StyledCell).attrs({
366
366
  return 'left';
367
367
  }
368
368
  return undefined;
369
- }, props => sizeStyles(props), props => props.isTruncated && truncatedStyling, props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
369
+ }, props => sizeStyles(props), props => props.isTruncated && truncatedStyling, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
370
370
  StyledHeaderCell.defaultProps = {
371
371
  theme: reactTheming.DEFAULT_THEME
372
372
  };
373
373
 
374
+ const COMPONENT_ID = 'tables.hidden_cell';
375
+ const StyledHiddenCell = styled__default.default.div.attrs({
376
+ 'data-garden-id': COMPONENT_ID,
377
+ 'data-garden-version': '8.63.2'
378
+ }).withConfig({
379
+ displayName: "StyledHiddenCell",
380
+ componentId: "sc-1x454xw-0"
381
+ })(["", " ", ";"], polished.hideVisually(), props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
382
+ StyledHiddenCell.defaultProps = {
383
+ theme: reactTheming.DEFAULT_THEME
384
+ };
385
+
374
386
  const Body = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledBody, _extends$3({
375
387
  ref: ref
376
388
  }, props)));
@@ -389,14 +401,18 @@ const useTableContext = () => {
389
401
  return React.useContext(TableContext);
390
402
  };
391
403
 
392
- const Cell = React__namespace.default.forwardRef((props, ref) => {
404
+ const Cell = React__namespace.default.forwardRef((_ref, ref) => {
405
+ let {
406
+ hidden,
407
+ ...props
408
+ } = _ref;
393
409
  const {
394
410
  size
395
411
  } = useTableContext();
396
412
  return React__namespace.default.createElement(StyledCell, _extends$3({
397
413
  ref: ref,
398
414
  size: size
399
- }, props));
415
+ }, props), hidden && props.children ? React__namespace.default.createElement(StyledHiddenCell, null, props.children) : props.children);
400
416
  });
401
417
  Cell.displayName = 'Cell';
402
418
  Cell.propTypes = {
@@ -422,14 +438,18 @@ const Head = React.forwardRef((props, ref) => React__namespace.default.createEle
422
438
  }, props)));
423
439
  Head.displayName = 'Head';
424
440
 
425
- const HeaderCell = React.forwardRef((props, ref) => {
441
+ const HeaderCell = React.forwardRef((_ref, ref) => {
442
+ let {
443
+ hidden,
444
+ ...props
445
+ } = _ref;
426
446
  const {
427
447
  size
428
448
  } = useTableContext();
429
449
  return React__namespace.default.createElement(StyledHeaderCell, _extends$3({
430
450
  ref: ref,
431
451
  size: size
432
- }, props));
452
+ }, props), hidden && props.children ? React__namespace.default.createElement(StyledHiddenCell, null, props.children) : props.children);
433
453
  });
434
454
  HeaderCell.displayName = 'HeaderCell';
435
455
  HeaderCell.propTypes = Cell.propTypes;
package/dist/index.esm.js CHANGED
@@ -9,7 +9,7 @@ import * as React from 'react';
9
9
  import React__default, { forwardRef, useContext, useState, useMemo } from 'react';
10
10
  import styled, { css } from 'styled-components';
11
11
  import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
12
- import { hideVisually, math } from 'polished';
12
+ import { math, hideVisually } from 'polished';
13
13
  import PropTypes from 'prop-types';
14
14
  import { composeEventHandlers } from '@zendeskgarden/container-utilities';
15
15
 
@@ -28,41 +28,41 @@ function _extends$3() {
28
28
  return _extends$3.apply(this, arguments);
29
29
  }
30
30
 
31
- const COMPONENT_ID$a = 'tables.body';
31
+ const COMPONENT_ID$b = 'tables.body';
32
32
  const StyledBody = styled.tbody.attrs({
33
- 'data-garden-id': COMPONENT_ID$a,
34
- 'data-garden-version': '8.63.0'
33
+ 'data-garden-id': COMPONENT_ID$b,
34
+ 'data-garden-version': '8.63.2'
35
35
  }).withConfig({
36
36
  displayName: "StyledBody",
37
37
  componentId: "sc-14ud6y-0"
38
- })(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$a, props));
38
+ })(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$b, props));
39
39
  StyledBody.defaultProps = {
40
40
  theme: DEFAULT_THEME
41
41
  };
42
42
 
43
- const COMPONENT_ID$9 = 'tables.caption';
43
+ const COMPONENT_ID$a = 'tables.caption';
44
44
  const StyledCaption = styled.caption.attrs({
45
- 'data-garden-id': COMPONENT_ID$9,
46
- 'data-garden-version': '8.63.0'
45
+ 'data-garden-id': COMPONENT_ID$a,
46
+ 'data-garden-version': '8.63.2'
47
47
  }).withConfig({
48
48
  displayName: "StyledCaption",
49
49
  componentId: "sc-113y327-0"
50
- })(["display:table-caption;text-align:", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => retrieveComponentStyles(COMPONENT_ID$9, props));
50
+ })(["display:table-caption;text-align:", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => retrieveComponentStyles(COMPONENT_ID$a, props));
51
51
  StyledCaption.defaultProps = {
52
52
  theme: DEFAULT_THEME
53
53
  };
54
54
 
55
- const COMPONENT_ID$8 = 'tables.table';
55
+ const COMPONENT_ID$9 = 'tables.table';
56
56
  const getLineHeight = props => {
57
57
  return `${props.theme.space.base * 5}px`;
58
58
  };
59
59
  const StyledTable = styled.table.attrs({
60
- 'data-garden-id': COMPONENT_ID$8,
61
- 'data-garden-version': '8.63.0'
60
+ 'data-garden-id': COMPONENT_ID$9,
61
+ 'data-garden-version': '8.63.2'
62
62
  }).withConfig({
63
63
  displayName: "StyledTable",
64
64
  componentId: "sc-gje7na-0"
65
- })(["display:table;border:none;width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0;line-height:", ";color:", ";font-size:", ";direction:", ";", ";"], props => getLineHeight(props), props => props.theme.colors.foreground, props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', props => retrieveComponentStyles(COMPONENT_ID$8, props));
65
+ })(["display:table;border:none;width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0;line-height:", ";color:", ";font-size:", ";direction:", ";", ";"], props => getLineHeight(props), props => props.theme.colors.foreground, props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', props => retrieveComponentStyles(COMPONENT_ID$9, props));
66
66
  StyledTable.defaultProps = {
67
67
  theme: DEFAULT_THEME
68
68
  };
@@ -76,7 +76,7 @@ const getRowHeight = props => {
76
76
  return `${props.theme.space.base * 10}px`;
77
77
  };
78
78
 
79
- const COMPONENT_ID$7 = 'tables.cell';
79
+ const COMPONENT_ID$8 = 'tables.cell';
80
80
  const truncatedStyling$1 = css(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
81
81
  const sizeStyling = props => {
82
82
  let boxSizing = 'border-box';
@@ -100,17 +100,17 @@ const sizeStyling = props => {
100
100
  return css(["box-sizing:", ";padding:", ";width:", ";height:", ";"], boxSizing, padding, width, height);
101
101
  };
102
102
  const StyledCell = styled.td.attrs({
103
- 'data-garden-id': COMPONENT_ID$7,
104
- 'data-garden-version': '8.63.0'
103
+ 'data-garden-id': COMPONENT_ID$8,
104
+ 'data-garden-version': '8.63.2'
105
105
  }).withConfig({
106
106
  displayName: "StyledCell",
107
107
  componentId: "sc-8hpncx-0"
108
- })(["display:table-cell;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out;", ";", ";&[hidden]{", "}", ";"], props => sizeStyling(props), props => props.isTruncated && truncatedStyling$1, hideVisually(), props => retrieveComponentStyles(COMPONENT_ID$7, props));
108
+ })(["display:table-cell;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out;", ";", ";", ";"], props => sizeStyling(props), props => props.isTruncated && truncatedStyling$1, props => retrieveComponentStyles(COMPONENT_ID$8, props));
109
109
  StyledCell.defaultProps = {
110
110
  theme: DEFAULT_THEME
111
111
  };
112
112
 
113
- const COMPONENT_ID$6 = 'tables.overflow_button';
113
+ const COMPONENT_ID$7 = 'tables.overflow_button';
114
114
  const OVERFLOW_BUTTON_SIZE = '2em';
115
115
  const colorStyles$1 = props => {
116
116
  const boxShadow = props.theme.shadows.md(getColor('primaryHue', 600, props.theme, 0.35));
@@ -129,13 +129,13 @@ const colorStyles$1 = props => {
129
129
  return css(["color:", ";&:hover{background-color:", ";color:", ";}&:active{background-color:", ";color:", ";}&:focus{outline:none;}&[data-garden-focus-visible]{box-shadow:inset ", ";}"], foregroundColor, hoverBackgroundColor, hoverForegroundColor, activeBackgroundColor, activeForegroundColor, boxShadow);
130
130
  };
131
131
  const StyledOverflowButton = styled.button.attrs({
132
- 'data-garden-id': COMPONENT_ID$6,
133
- 'data-garden-version': '8.63.0',
132
+ 'data-garden-id': COMPONENT_ID$7,
133
+ 'data-garden-version': '8.63.2',
134
134
  type: 'button'
135
135
  }).withConfig({
136
136
  displayName: "StyledOverflowButton",
137
137
  componentId: "sc-1eba2ml-0"
138
- })(["display:block;transition:opacity 0.25s ease-in-out,background-color 0.1s ease-in-out;opacity:", ";z-index:", ";margin-top:calc(", " - 1em);border:none;border-radius:50%;background-color:transparent;cursor:pointer;padding:0;width:100%;height:", ";text-decoration:none;font-size:inherit;", " &[aria-expanded='true']{opacity:1;}", ";"], props => props.isHovered || props.isFocused || props.isActive ? '1' : '0', props => props.isActive ? '1' : '0', props => math(`${getRowHeight(props)} / 2`), OVERFLOW_BUTTON_SIZE, props => colorStyles$1(props), props => retrieveComponentStyles(COMPONENT_ID$6, props));
138
+ })(["display:block;transition:opacity 0.25s ease-in-out,background-color 0.1s ease-in-out;opacity:", ";z-index:", ";margin-top:calc(", " - 1em);border:none;border-radius:50%;background-color:transparent;cursor:pointer;padding:0;width:100%;height:", ";text-decoration:none;font-size:inherit;", " &[aria-expanded='true']{opacity:1;}", ";"], props => props.isHovered || props.isFocused || props.isActive ? '1' : '0', props => props.isActive ? '1' : '0', props => math(`${getRowHeight(props)} / 2`), OVERFLOW_BUTTON_SIZE, props => colorStyles$1(props), props => retrieveComponentStyles(COMPONENT_ID$7, props));
139
139
  StyledOverflowButton.defaultProps = {
140
140
  theme: DEFAULT_THEME
141
141
  };
@@ -147,7 +147,7 @@ StyledOverflowButtonIconWrapper.defaultProps = {
147
147
  theme: DEFAULT_THEME
148
148
  };
149
149
 
150
- const COMPONENT_ID$5 = 'tables.row';
150
+ const COMPONENT_ID$6 = 'tables.row';
151
151
  const StyledBaseRow = styled.tr.withConfig({
152
152
  displayName: "StyledRow__StyledBaseRow",
153
153
  componentId: "sc-ek66ow-0"
@@ -185,18 +185,18 @@ const colorStyles = props => {
185
185
  return css(["border-bottom-color:", ";background-color:", ";&:hover{border-bottom-color:", ";background-color:", ";", "{opacity:1;}}&:focus{outline:none;}", ":first-of-type{box-shadow:", ";&:focus{box-shadow:", ";}}"], borderColor, backgroundColor, hoverBorderBottomColor, hoverBackgroundColor, StyledOverflowButton, StyledCell, props.isFocused && boxShadow, boxShadow);
186
186
  };
187
187
  const StyledRow = styled(StyledBaseRow).attrs(props => ({
188
- 'data-garden-id': COMPONENT_ID$5,
189
- 'data-garden-version': '8.63.0',
188
+ 'data-garden-id': COMPONENT_ID$6,
189
+ 'data-garden-version': '8.63.2',
190
190
  tabIndex: props.isReadOnly ? undefined : -1
191
191
  })).withConfig({
192
192
  displayName: "StyledRow",
193
193
  componentId: "sc-ek66ow-1"
194
- })(["height:", ";", " ", ";"], getRowHeight, props => colorStyles(props), props => retrieveComponentStyles(COMPONENT_ID$5, props));
194
+ })(["height:", ";", " ", ";"], getRowHeight, props => colorStyles(props), props => retrieveComponentStyles(COMPONENT_ID$6, props));
195
195
  StyledRow.defaultProps = {
196
196
  theme: DEFAULT_THEME
197
197
  };
198
198
 
199
- const COMPONENT_ID$4 = 'tables.header_row';
199
+ const COMPONENT_ID$5 = 'tables.header_row';
200
200
  const getHeaderRowHeight = props => {
201
201
  if (props.size === 'large') {
202
202
  return `${props.theme.space.base * 18}px`;
@@ -206,50 +206,50 @@ const getHeaderRowHeight = props => {
206
206
  return `${props.theme.space.base * 12}px`;
207
207
  };
208
208
  const StyledHeaderRow = styled(StyledBaseRow).attrs({
209
- 'data-garden-id': COMPONENT_ID$4,
210
- 'data-garden-version': '8.63.0'
209
+ 'data-garden-id': COMPONENT_ID$5,
210
+ 'data-garden-version': '8.63.2'
211
211
  }).withConfig({
212
212
  displayName: "StyledHeaderRow",
213
213
  componentId: "sc-16ogvdx-0"
214
- })(["border-bottom-color:", ";height:", ";vertical-align:bottom;font-weight:", ";", "{opacity:1;margin-top:0;margin-bottom:calc(", " - 1em);}", ";"], props => getColor('neutralHue', 300, props.theme), getHeaderRowHeight, props => props.theme.fontWeights.semibold, StyledOverflowButton, props => math(`${getHeaderRowHeight(props)} / 2`), props => retrieveComponentStyles(COMPONENT_ID$4, props));
214
+ })(["border-bottom-color:", ";height:", ";vertical-align:bottom;font-weight:", ";", "{opacity:1;margin-top:0;margin-bottom:calc(", " - 1em);}", ";"], props => getColor('neutralHue', 300, props.theme), getHeaderRowHeight, props => props.theme.fontWeights.semibold, StyledOverflowButton, props => math(`${getHeaderRowHeight(props)} / 2`), props => retrieveComponentStyles(COMPONENT_ID$5, props));
215
215
  StyledHeaderRow.defaultProps = {
216
216
  theme: DEFAULT_THEME
217
217
  };
218
218
 
219
- const COMPONENT_ID$3 = 'tables.head';
219
+ const COMPONENT_ID$4 = 'tables.head';
220
220
  const stickyStyles = props => {
221
221
  const borderColor = getColor('neutralHue', 300, props.theme);
222
222
  return css(["position:sticky;top:0;z-index:1;box-shadow:inset 0 -", " 0 ", ";background-color:", ";& > ", ":last-child{border-bottom-color:transparent;}"], props.theme.borderWidths.sm, borderColor, props.theme.colors.background, StyledHeaderRow);
223
223
  };
224
224
  const StyledHead = styled.thead.attrs({
225
- 'data-garden-id': COMPONENT_ID$3,
226
- 'data-garden-version': '8.63.0'
225
+ 'data-garden-id': COMPONENT_ID$4,
226
+ 'data-garden-version': '8.63.2'
227
227
  }).withConfig({
228
228
  displayName: "StyledHead",
229
229
  componentId: "sc-spf23a-0"
230
- })(["", " ", ";"], props => props.isSticky && stickyStyles(props), props => retrieveComponentStyles(COMPONENT_ID$3, props));
230
+ })(["", " ", ";"], props => props.isSticky && stickyStyles(props), props => retrieveComponentStyles(COMPONENT_ID$4, props));
231
231
  StyledHead.defaultProps = {
232
232
  theme: DEFAULT_THEME
233
233
  };
234
234
 
235
- const COMPONENT_ID$2 = 'tables.group_row';
235
+ const COMPONENT_ID$3 = 'tables.group_row';
236
236
  const sizeStyles$1 = props => {
237
237
  const height = `${props.theme.space.base * 8}px`;
238
238
  const lineHeight = getLineHeight(props);
239
239
  return css(["height:", ";line-height:", ";font-size:", ";", "{padding:", " ", "px;}"], height, lineHeight, props.theme.fontSizes.sm, StyledCell, math(`(${height} - ${lineHeight}) / 2`), props.theme.space.base * 3);
240
240
  };
241
241
  const StyledGroupRow = styled(StyledBaseRow).attrs({
242
- 'data-garden-id': COMPONENT_ID$2,
243
- 'data-garden-version': '8.63.0'
242
+ 'data-garden-id': COMPONENT_ID$3,
243
+ 'data-garden-version': '8.63.2'
244
244
  }).withConfig({
245
245
  displayName: "StyledGroupRow",
246
246
  componentId: "sc-mpd0r8-0"
247
- })(["background-color:", ";", " ", ";"], props => getColor('neutralHue', 100, props.theme), props => sizeStyles$1(props), props => retrieveComponentStyles(COMPONENT_ID$2, props));
247
+ })(["background-color:", ";", " ", ";"], props => getColor('neutralHue', 100, props.theme), props => sizeStyles$1(props), props => retrieveComponentStyles(COMPONENT_ID$3, props));
248
248
  StyledGroupRow.defaultProps = {
249
249
  theme: DEFAULT_THEME
250
250
  };
251
251
 
252
- const COMPONENT_ID$1 = 'tables.sortable';
252
+ const COMPONENT_ID$2 = 'tables.sortable';
253
253
  const StyledBaseIconWrapper = styled.div.withConfig({
254
254
  displayName: "StyledSortableButton__StyledBaseIconWrapper",
255
255
  componentId: "sc-2s1dli-0"
@@ -272,8 +272,8 @@ StyledSortableFillIconWrapper.defaultProps = {
272
272
  theme: DEFAULT_THEME
273
273
  };
274
274
  const StyledSortableButton = styled.button.attrs({
275
- 'data-garden-id': COMPONENT_ID$1,
276
- 'data-garden-version': '8.63.0',
275
+ 'data-garden-id': COMPONENT_ID$2,
276
+ 'data-garden-version': '8.63.2',
277
277
  type: 'button'
278
278
  }).withConfig({
279
279
  displayName: "StyledSortableButton",
@@ -312,12 +312,12 @@ const StyledSortableButton = styled.button.attrs({
312
312
  color: ${getColor('primaryHue', 600, props.theme, 0.25)};
313
313
  fill: ${getColor('primaryHue', 600, props.theme)};
314
314
  }
315
- `, props => retrieveComponentStyles(COMPONENT_ID$1, props));
315
+ `, props => retrieveComponentStyles(COMPONENT_ID$2, props));
316
316
  StyledSortableButton.defaultProps = {
317
317
  theme: DEFAULT_THEME
318
318
  };
319
319
 
320
- const COMPONENT_ID = 'tables.header_cell';
320
+ const COMPONENT_ID$1 = 'tables.header_cell';
321
321
  const truncatedStyling = css(["", "{max-width:100%;overflow:hidden;text-overflow:ellipsis;}"], StyledSortableButton);
322
322
  const sizeStyles = props => {
323
323
  let paddingVertical = undefined;
@@ -328,8 +328,8 @@ const sizeStyles = props => {
328
328
  };
329
329
  const StyledHeaderCell = styled(StyledCell).attrs({
330
330
  as: 'th',
331
- 'data-garden-id': COMPONENT_ID,
332
- 'data-garden-version': '8.63.0'
331
+ 'data-garden-id': COMPONENT_ID$1,
332
+ 'data-garden-version': '8.63.2'
333
333
  }).withConfig({
334
334
  displayName: "StyledHeaderCell",
335
335
  componentId: "sc-fzagoe-0"
@@ -341,11 +341,23 @@ const StyledHeaderCell = styled(StyledCell).attrs({
341
341
  return 'left';
342
342
  }
343
343
  return undefined;
344
- }, props => sizeStyles(props), props => props.isTruncated && truncatedStyling, props => retrieveComponentStyles(COMPONENT_ID, props));
344
+ }, props => sizeStyles(props), props => props.isTruncated && truncatedStyling, props => retrieveComponentStyles(COMPONENT_ID$1, props));
345
345
  StyledHeaderCell.defaultProps = {
346
346
  theme: DEFAULT_THEME
347
347
  };
348
348
 
349
+ const COMPONENT_ID = 'tables.hidden_cell';
350
+ const StyledHiddenCell = styled.div.attrs({
351
+ 'data-garden-id': COMPONENT_ID,
352
+ 'data-garden-version': '8.63.2'
353
+ }).withConfig({
354
+ displayName: "StyledHiddenCell",
355
+ componentId: "sc-1x454xw-0"
356
+ })(["", " ", ";"], hideVisually(), props => retrieveComponentStyles(COMPONENT_ID, props));
357
+ StyledHiddenCell.defaultProps = {
358
+ theme: DEFAULT_THEME
359
+ };
360
+
349
361
  const Body = forwardRef((props, ref) => React__default.createElement(StyledBody, _extends$3({
350
362
  ref: ref
351
363
  }, props)));
@@ -364,14 +376,18 @@ const useTableContext = () => {
364
376
  return useContext(TableContext);
365
377
  };
366
378
 
367
- const Cell = React__default.forwardRef((props, ref) => {
379
+ const Cell = React__default.forwardRef((_ref, ref) => {
380
+ let {
381
+ hidden,
382
+ ...props
383
+ } = _ref;
368
384
  const {
369
385
  size
370
386
  } = useTableContext();
371
387
  return React__default.createElement(StyledCell, _extends$3({
372
388
  ref: ref,
373
389
  size: size
374
- }, props));
390
+ }, props), hidden && props.children ? React__default.createElement(StyledHiddenCell, null, props.children) : props.children);
375
391
  });
376
392
  Cell.displayName = 'Cell';
377
393
  Cell.propTypes = {
@@ -397,14 +413,18 @@ const Head = forwardRef((props, ref) => React__default.createElement(StyledHead,
397
413
  }, props)));
398
414
  Head.displayName = 'Head';
399
415
 
400
- const HeaderCell = forwardRef((props, ref) => {
416
+ const HeaderCell = forwardRef((_ref, ref) => {
417
+ let {
418
+ hidden,
419
+ ...props
420
+ } = _ref;
401
421
  const {
402
422
  size
403
423
  } = useTableContext();
404
424
  return React__default.createElement(StyledHeaderCell, _extends$3({
405
425
  ref: ref,
406
426
  size: size
407
- }, props));
427
+ }, props), hidden && props.children ? React__default.createElement(StyledHiddenCell, null, props.children) : props.children);
408
428
  });
409
429
  HeaderCell.displayName = 'HeaderCell';
410
430
  HeaderCell.propTypes = Cell.propTypes;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ export declare const StyledHiddenCell: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
8
+ 'data-garden-id': string;
9
+ 'data-garden-version': string;
10
+ }, "data-garden-id" | "data-garden-version">;
@@ -12,6 +12,7 @@ export { StyledCell } from './StyledCell';
12
12
  export { StyledGroupRow } from './StyledGroupRow';
13
13
  export { StyledTable } from './StyledTable';
14
14
  export { StyledHeaderCell } from './StyledHeaderCell';
15
+ export { StyledHiddenCell } from './StyledHiddenCell';
15
16
  export { StyledSortableButton, StyledSortableFillIconWrapper, StyledSortableStrokeIconWrapper } from './StyledSortableButton';
16
17
  export { StyledOverflowButton, StyledOverflowButtonIconWrapper } from './StyledOverflowButton';
17
18
  export { StyledRow } from './StyledRow';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-tables",
3
- "version": "8.63.0",
3
+ "version": "8.63.2",
4
4
  "description": "Components relating to tables in the Garden Design System",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -35,7 +35,7 @@
35
35
  "devDependencies": {
36
36
  "@types/react-beautiful-dnd": "13.1.3",
37
37
  "@types/react-window": "1.8.5",
38
- "@zendeskgarden/react-theming": "^8.63.0",
38
+ "@zendeskgarden/react-theming": "^8.63.2",
39
39
  "@zendeskgarden/svg-icons": "6.33.0",
40
40
  "react-beautiful-dnd": "13.1.1",
41
41
  "react-window": "1.8.8"
@@ -50,5 +50,5 @@
50
50
  "access": "public"
51
51
  },
52
52
  "zendeskgarden:src": "src/index.ts",
53
- "gitHead": "4b8715305a769881b143c7195c5b31e687422926"
53
+ "gitHead": "a85eaea9f459576e356ccc831ab9898543463c10"
54
54
  }