@zendeskgarden/react-tables 8.62.2 → 8.63.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.
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$
|
|
56
|
+
const COMPONENT_ID$b = 'tables.body';
|
|
57
57
|
const StyledBody = styled__default.default.tbody.attrs({
|
|
58
|
-
'data-garden-id': COMPONENT_ID$
|
|
59
|
-
'data-garden-version': '8.
|
|
58
|
+
'data-garden-id': COMPONENT_ID$b,
|
|
59
|
+
'data-garden-version': '8.63.1'
|
|
60
60
|
}).withConfig({
|
|
61
61
|
displayName: "StyledBody",
|
|
62
62
|
componentId: "sc-14ud6y-0"
|
|
63
|
-
})(["", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$
|
|
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$
|
|
68
|
+
const COMPONENT_ID$a = 'tables.caption';
|
|
69
69
|
const StyledCaption = styled__default.default.caption.attrs({
|
|
70
|
-
'data-garden-id': COMPONENT_ID$
|
|
71
|
-
'data-garden-version': '8.
|
|
70
|
+
'data-garden-id': COMPONENT_ID$a,
|
|
71
|
+
'data-garden-version': '8.63.1'
|
|
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$
|
|
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$
|
|
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$
|
|
86
|
-
'data-garden-version': '8.
|
|
85
|
+
'data-garden-id': COMPONENT_ID$9,
|
|
86
|
+
'data-garden-version': '8.63.1'
|
|
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$
|
|
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$
|
|
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$
|
|
129
|
-
'data-garden-version': '8.
|
|
128
|
+
'data-garden-id': COMPONENT_ID$8,
|
|
129
|
+
'data-garden-version': '8.63.1'
|
|
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;", ";", ";", ";"], props => sizeStyling(props), props => props.isTruncated && truncatedStyling$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$
|
|
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$
|
|
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$
|
|
158
|
-
'data-garden-version': '8.
|
|
157
|
+
'data-garden-id': COMPONENT_ID$7,
|
|
158
|
+
'data-garden-version': '8.63.1',
|
|
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$
|
|
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$
|
|
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$
|
|
214
|
-
'data-garden-version': '8.
|
|
213
|
+
'data-garden-id': COMPONENT_ID$6,
|
|
214
|
+
'data-garden-version': '8.63.1',
|
|
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$
|
|
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$
|
|
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$
|
|
235
|
-
'data-garden-version': '8.
|
|
234
|
+
'data-garden-id': COMPONENT_ID$5,
|
|
235
|
+
'data-garden-version': '8.63.1'
|
|
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$
|
|
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$
|
|
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$
|
|
251
|
-
'data-garden-version': '8.
|
|
250
|
+
'data-garden-id': COMPONENT_ID$4,
|
|
251
|
+
'data-garden-version': '8.63.1'
|
|
252
252
|
}).withConfig({
|
|
253
253
|
displayName: "StyledHead",
|
|
254
254
|
componentId: "sc-spf23a-0"
|
|
255
|
-
})(["", " ", ";"], props => props.isSticky && stickyStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$
|
|
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$
|
|
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$
|
|
268
|
-
'data-garden-version': '8.
|
|
267
|
+
'data-garden-id': COMPONENT_ID$3,
|
|
268
|
+
'data-garden-version': '8.63.1'
|
|
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$
|
|
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$
|
|
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$
|
|
301
|
-
'data-garden-version': '8.
|
|
300
|
+
'data-garden-id': COMPONENT_ID$2,
|
|
301
|
+
'data-garden-version': '8.63.1',
|
|
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$
|
|
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.
|
|
356
|
+
'data-garden-id': COMPONENT_ID$1,
|
|
357
|
+
'data-garden-version': '8.63.1'
|
|
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.1'
|
|
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((
|
|
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((
|
|
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;
|
|
@@ -446,9 +466,7 @@ const HeaderRow = React__namespace.default.forwardRef((props, ref) => {
|
|
|
446
466
|
HeaderRow.displayName = 'HeaderRow';
|
|
447
467
|
|
|
448
468
|
var _g;
|
|
449
|
-
|
|
450
469
|
function _extends$2() { _extends$2 = 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$2.apply(this, arguments); }
|
|
451
|
-
|
|
452
470
|
var SvgOverflowStroke = function SvgOverflowStroke(props) {
|
|
453
471
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
454
472
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -456,8 +474,7 @@ var SvgOverflowStroke = function SvgOverflowStroke(props) {
|
|
|
456
474
|
height: 16,
|
|
457
475
|
focusable: "false",
|
|
458
476
|
viewBox: "0 0 16 16",
|
|
459
|
-
"aria-hidden": "true"
|
|
460
|
-
role: "img"
|
|
477
|
+
"aria-hidden": "true"
|
|
461
478
|
}, props), _g || (_g = /*#__PURE__*/React__namespace.createElement("g", {
|
|
462
479
|
fill: "currentColor"
|
|
463
480
|
}, /*#__PURE__*/React__namespace.createElement("circle", {
|
|
@@ -550,9 +567,7 @@ Row.propTypes = {
|
|
|
550
567
|
};
|
|
551
568
|
|
|
552
569
|
var _path$1;
|
|
553
|
-
|
|
554
570
|
function _extends$1() { _extends$1 = 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$1.apply(this, arguments); }
|
|
555
|
-
|
|
556
571
|
var SvgSortStroke = function SvgSortStroke(props) {
|
|
557
572
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
558
573
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -560,8 +575,7 @@ var SvgSortStroke = function SvgSortStroke(props) {
|
|
|
560
575
|
height: 12,
|
|
561
576
|
focusable: "false",
|
|
562
577
|
viewBox: "0 0 12 12",
|
|
563
|
-
"aria-hidden": "true"
|
|
564
|
-
role: "img"
|
|
578
|
+
"aria-hidden": "true"
|
|
565
579
|
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
566
580
|
fill: "none",
|
|
567
581
|
stroke: "currentColor",
|
|
@@ -571,9 +585,7 @@ var SvgSortStroke = function SvgSortStroke(props) {
|
|
|
571
585
|
};
|
|
572
586
|
|
|
573
587
|
var _path, _path2;
|
|
574
|
-
|
|
575
588
|
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); }
|
|
576
|
-
|
|
577
589
|
var SvgSortFill = function SvgSortFill(props) {
|
|
578
590
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
579
591
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -581,8 +593,7 @@ var SvgSortFill = function SvgSortFill(props) {
|
|
|
581
593
|
height: 12,
|
|
582
594
|
focusable: "false",
|
|
583
595
|
viewBox: "0 0 12 12",
|
|
584
|
-
"aria-hidden": "true"
|
|
585
|
-
role: "img"
|
|
596
|
+
"aria-hidden": "true"
|
|
586
597
|
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
587
598
|
fill: "currentColor",
|
|
588
599
|
d: "M10 5H2a.5.5 0 01-.46-.31.47.47 0 01.11-.54L5.29.5A1 1 0 016.7.5l3.65 3.65a.49.49 0 01.11.54A.51.51 0 0110 5z"
|
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 { 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$
|
|
31
|
+
const COMPONENT_ID$b = 'tables.body';
|
|
32
32
|
const StyledBody = styled.tbody.attrs({
|
|
33
|
-
'data-garden-id': COMPONENT_ID$
|
|
34
|
-
'data-garden-version': '8.
|
|
33
|
+
'data-garden-id': COMPONENT_ID$b,
|
|
34
|
+
'data-garden-version': '8.63.1'
|
|
35
35
|
}).withConfig({
|
|
36
36
|
displayName: "StyledBody",
|
|
37
37
|
componentId: "sc-14ud6y-0"
|
|
38
|
-
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$
|
|
38
|
+
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$b, props));
|
|
39
39
|
StyledBody.defaultProps = {
|
|
40
40
|
theme: DEFAULT_THEME
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
const COMPONENT_ID$
|
|
43
|
+
const COMPONENT_ID$a = 'tables.caption';
|
|
44
44
|
const StyledCaption = styled.caption.attrs({
|
|
45
|
-
'data-garden-id': COMPONENT_ID$
|
|
46
|
-
'data-garden-version': '8.
|
|
45
|
+
'data-garden-id': COMPONENT_ID$a,
|
|
46
|
+
'data-garden-version': '8.63.1'
|
|
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$
|
|
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$
|
|
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$
|
|
61
|
-
'data-garden-version': '8.
|
|
60
|
+
'data-garden-id': COMPONENT_ID$9,
|
|
61
|
+
'data-garden-version': '8.63.1'
|
|
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$
|
|
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$
|
|
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$
|
|
104
|
-
'data-garden-version': '8.
|
|
103
|
+
'data-garden-id': COMPONENT_ID$8,
|
|
104
|
+
'data-garden-version': '8.63.1'
|
|
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;", ";", ";", ";"], props => sizeStyling(props), props => props.isTruncated && truncatedStyling$1, props => retrieveComponentStyles(COMPONENT_ID$
|
|
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$
|
|
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$
|
|
133
|
-
'data-garden-version': '8.
|
|
132
|
+
'data-garden-id': COMPONENT_ID$7,
|
|
133
|
+
'data-garden-version': '8.63.1',
|
|
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$
|
|
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$
|
|
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$
|
|
189
|
-
'data-garden-version': '8.
|
|
188
|
+
'data-garden-id': COMPONENT_ID$6,
|
|
189
|
+
'data-garden-version': '8.63.1',
|
|
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$
|
|
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$
|
|
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$
|
|
210
|
-
'data-garden-version': '8.
|
|
209
|
+
'data-garden-id': COMPONENT_ID$5,
|
|
210
|
+
'data-garden-version': '8.63.1'
|
|
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$
|
|
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$
|
|
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$
|
|
226
|
-
'data-garden-version': '8.
|
|
225
|
+
'data-garden-id': COMPONENT_ID$4,
|
|
226
|
+
'data-garden-version': '8.63.1'
|
|
227
227
|
}).withConfig({
|
|
228
228
|
displayName: "StyledHead",
|
|
229
229
|
componentId: "sc-spf23a-0"
|
|
230
|
-
})(["", " ", ";"], props => props.isSticky && stickyStyles(props), props => retrieveComponentStyles(COMPONENT_ID$
|
|
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$
|
|
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$
|
|
243
|
-
'data-garden-version': '8.
|
|
242
|
+
'data-garden-id': COMPONENT_ID$3,
|
|
243
|
+
'data-garden-version': '8.63.1'
|
|
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$
|
|
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$
|
|
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$
|
|
276
|
-
'data-garden-version': '8.
|
|
275
|
+
'data-garden-id': COMPONENT_ID$2,
|
|
276
|
+
'data-garden-version': '8.63.1',
|
|
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$
|
|
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.
|
|
331
|
+
'data-garden-id': COMPONENT_ID$1,
|
|
332
|
+
'data-garden-version': '8.63.1'
|
|
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.1'
|
|
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((
|
|
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((
|
|
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;
|
|
@@ -421,9 +441,7 @@ const HeaderRow = React__default.forwardRef((props, ref) => {
|
|
|
421
441
|
HeaderRow.displayName = 'HeaderRow';
|
|
422
442
|
|
|
423
443
|
var _g;
|
|
424
|
-
|
|
425
444
|
function _extends$2() { _extends$2 = 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$2.apply(this, arguments); }
|
|
426
|
-
|
|
427
445
|
var SvgOverflowStroke = function SvgOverflowStroke(props) {
|
|
428
446
|
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
429
447
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -431,8 +449,7 @@ var SvgOverflowStroke = function SvgOverflowStroke(props) {
|
|
|
431
449
|
height: 16,
|
|
432
450
|
focusable: "false",
|
|
433
451
|
viewBox: "0 0 16 16",
|
|
434
|
-
"aria-hidden": "true"
|
|
435
|
-
role: "img"
|
|
452
|
+
"aria-hidden": "true"
|
|
436
453
|
}, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
|
|
437
454
|
fill: "currentColor"
|
|
438
455
|
}, /*#__PURE__*/React.createElement("circle", {
|
|
@@ -525,9 +542,7 @@ Row.propTypes = {
|
|
|
525
542
|
};
|
|
526
543
|
|
|
527
544
|
var _path$1;
|
|
528
|
-
|
|
529
545
|
function _extends$1() { _extends$1 = 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$1.apply(this, arguments); }
|
|
530
|
-
|
|
531
546
|
var SvgSortStroke = function SvgSortStroke(props) {
|
|
532
547
|
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
533
548
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -535,8 +550,7 @@ var SvgSortStroke = function SvgSortStroke(props) {
|
|
|
535
550
|
height: 12,
|
|
536
551
|
focusable: "false",
|
|
537
552
|
viewBox: "0 0 12 12",
|
|
538
|
-
"aria-hidden": "true"
|
|
539
|
-
role: "img"
|
|
553
|
+
"aria-hidden": "true"
|
|
540
554
|
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
541
555
|
fill: "none",
|
|
542
556
|
stroke: "currentColor",
|
|
@@ -546,9 +560,7 @@ var SvgSortStroke = function SvgSortStroke(props) {
|
|
|
546
560
|
};
|
|
547
561
|
|
|
548
562
|
var _path, _path2;
|
|
549
|
-
|
|
550
563
|
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); }
|
|
551
|
-
|
|
552
564
|
var SvgSortFill = function SvgSortFill(props) {
|
|
553
565
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
554
566
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -556,8 +568,7 @@ var SvgSortFill = function SvgSortFill(props) {
|
|
|
556
568
|
height: 12,
|
|
557
569
|
focusable: "false",
|
|
558
570
|
viewBox: "0 0 12 12",
|
|
559
|
-
"aria-hidden": "true"
|
|
560
|
-
role: "img"
|
|
571
|
+
"aria-hidden": "true"
|
|
561
572
|
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
562
573
|
fill: "currentColor",
|
|
563
574
|
d: "M10 5H2a.5.5 0 01-.46-.31.47.47 0 01.11-.54L5.29.5A1 1 0 016.7.5l3.65 3.65a.49.49 0 01.11.54A.51.51 0 0110 5z"
|
|
@@ -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';
|
|
@@ -9,7 +9,7 @@ export declare const SIZE: readonly ["small", "medium", "large"];
|
|
|
9
9
|
export declare const SORT: string[];
|
|
10
10
|
export interface ITableProps extends TableHTMLAttributes<HTMLTableElement> {
|
|
11
11
|
/** Sets the table size */
|
|
12
|
-
size?: typeof SIZE[number];
|
|
12
|
+
size?: (typeof SIZE)[number];
|
|
13
13
|
/** Removes interactive styling from table rows */
|
|
14
14
|
isReadOnly?: boolean;
|
|
15
15
|
}
|
|
@@ -44,7 +44,7 @@ export interface IHeaderCellProps extends Pick<ICellProps, 'isMinimum' | 'isTrun
|
|
|
44
44
|
}
|
|
45
45
|
export interface ISortableCellProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
46
46
|
/** Sets the sort order */
|
|
47
|
-
sort?: typeof SORT[number];
|
|
47
|
+
sort?: (typeof SORT)[number];
|
|
48
48
|
/** Sets the width of the cell */
|
|
49
49
|
width?: ICellProps['width'];
|
|
50
50
|
/** Passes props to the cell */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-tables",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.63.1",
|
|
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>",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"types": "dist/typings/index.d.ts",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@zendeskgarden/container-utilities": "^0.
|
|
24
|
+
"@zendeskgarden/container-utilities": "^1.0.0",
|
|
25
25
|
"dom-helpers": "^5.1.0",
|
|
26
26
|
"polished": "^4.0.0",
|
|
27
27
|
"prop-types": "^15.5.7"
|
|
@@ -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.
|
|
38
|
+
"@zendeskgarden/react-theming": "^8.63.1",
|
|
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": "
|
|
53
|
+
"gitHead": "1c1d67d2b98ee0539975cee53f457081e5ae479a"
|
|
54
54
|
}
|