@zendeskgarden/react-tables 9.0.0-next.13 → 9.0.0-next.15
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/LICENSE.md +176 -0
- package/dist/esm/elements/Cell.js +7 -1
- package/dist/esm/elements/GroupRow.js +1 -1
- package/dist/esm/elements/Head.js +10 -3
- package/dist/esm/elements/HeaderCell.js +7 -1
- package/dist/esm/elements/HeaderRow.js +1 -1
- package/dist/esm/elements/OverflowButton.js +9 -27
- package/dist/esm/elements/Row.js +13 -5
- package/dist/esm/elements/SortableCell.js +13 -5
- package/dist/esm/elements/Table.js +9 -4
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/{overflow-stroke.svg.js → overflow-vertical-stroke.svg.js} +7 -18
- package/dist/esm/styled/StyledBaseRow.js +46 -0
- package/dist/esm/styled/StyledBody.js +1 -1
- package/dist/esm/styled/StyledCaption.js +1 -1
- package/dist/esm/styled/StyledCell.js +4 -4
- package/dist/esm/styled/StyledGroupRow.js +20 -4
- package/dist/esm/styled/StyledHead.js +19 -6
- package/dist/esm/styled/StyledHeaderCell.js +4 -4
- package/dist/esm/styled/StyledHeaderRow.js +20 -7
- package/dist/esm/styled/StyledHiddenCell.js +1 -1
- package/dist/esm/styled/StyledOverflowButton.js +7 -32
- package/dist/esm/styled/StyledRow.js +71 -27
- package/dist/esm/styled/StyledSortableButton.js +63 -40
- package/dist/esm/styled/StyledTable.js +6 -3
- package/dist/esm/styled/style-utils.js +2 -2
- package/dist/index.cjs.js +395 -260
- package/dist/typings/elements/OverflowButton.d.ts +2 -10
- package/dist/typings/styled/StyledBaseRow.d.ts +11 -0
- package/dist/typings/styled/StyledCell.d.ts +5 -2
- package/dist/typings/styled/StyledGroupRow.d.ts +7 -3
- package/dist/typings/styled/StyledHead.d.ts +1 -1
- package/dist/typings/styled/StyledHeaderRow.d.ts +7 -3
- package/dist/typings/styled/StyledOverflowButton.d.ts +7 -9
- package/dist/typings/styled/StyledRow.d.ts +10 -8
- package/dist/typings/styled/StyledSortableButton.d.ts +5 -4
- package/dist/typings/styled/StyledTable.d.ts +4 -6
- package/dist/typings/styled/index.d.ts +1 -1
- package/dist/typings/styled/style-utils.d.ts +1 -1
- package/package.json +5 -3
|
@@ -16,7 +16,7 @@ const COMPONENT_ID = 'tables.header_cell';
|
|
|
16
16
|
const truncatedStyling = css(["", "{max-width:100%;overflow:hidden;text-overflow:ellipsis;}"], StyledSortableButton);
|
|
17
17
|
const sizeStyles = props => {
|
|
18
18
|
let paddingVertical = undefined;
|
|
19
|
-
if (!props
|
|
19
|
+
if (!props.$hasOverflow) {
|
|
20
20
|
paddingVertical = math(`(${getRowHeight(props)} - ${getLineHeight(props)}) / 2`);
|
|
21
21
|
}
|
|
22
22
|
return css(["padding-top:", ";padding-bottom:", ";"], paddingVertical, paddingVertical);
|
|
@@ -24,19 +24,19 @@ const sizeStyles = props => {
|
|
|
24
24
|
const StyledHeaderCell = styled(StyledCell).attrs({
|
|
25
25
|
as: 'th',
|
|
26
26
|
'data-garden-id': COMPONENT_ID,
|
|
27
|
-
'data-garden-version': '9.0.0-next.
|
|
27
|
+
'data-garden-version': '9.0.0-next.15'
|
|
28
28
|
}).withConfig({
|
|
29
29
|
displayName: "StyledHeaderCell",
|
|
30
30
|
componentId: "sc-fzagoe-0"
|
|
31
31
|
})(["text-align:", ";font-weight:inherit;", " ", " ", ";"], props => {
|
|
32
|
-
if (!props
|
|
32
|
+
if (!props.$hasOverflow) {
|
|
33
33
|
if (props.theme.rtl) {
|
|
34
34
|
return 'right';
|
|
35
35
|
}
|
|
36
36
|
return 'left';
|
|
37
37
|
}
|
|
38
38
|
return undefined;
|
|
39
|
-
}, props => sizeStyles(props), props => props
|
|
39
|
+
}, props => sizeStyles(props), props => props.$isTruncated && truncatedStyling, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
40
40
|
StyledHeaderCell.defaultProps = {
|
|
41
41
|
theme: DEFAULT_THEME
|
|
42
42
|
};
|
|
@@ -4,28 +4,41 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import styled from 'styled-components';
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import {
|
|
10
|
-
import { StyledBaseRow } from './
|
|
9
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
10
|
+
import { StyledBaseRow } from './StyledBaseRow.js';
|
|
11
11
|
import { StyledOverflowButton } from './StyledOverflowButton.js';
|
|
12
12
|
|
|
13
13
|
const COMPONENT_ID = 'tables.header_row';
|
|
14
14
|
const getHeaderRowHeight = props => {
|
|
15
|
-
if (props
|
|
15
|
+
if (props.$size === 'large') {
|
|
16
16
|
return `${props.theme.space.base * 18}px`;
|
|
17
|
-
} else if (props
|
|
17
|
+
} else if (props.$size === 'small') {
|
|
18
18
|
return `${props.theme.space.base * 10}px`;
|
|
19
19
|
}
|
|
20
20
|
return `${props.theme.space.base * 12}px`;
|
|
21
21
|
};
|
|
22
|
+
const colorStyles = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
theme
|
|
25
|
+
} = _ref;
|
|
26
|
+
return css(["border-bottom-color:", ";"], getColor({
|
|
27
|
+
variable: 'border.default',
|
|
28
|
+
theme
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
const sizeStyles = props => {
|
|
32
|
+
const rowHeight = getHeaderRowHeight(props);
|
|
33
|
+
return css(["height:", ";vertical-align:bottom;", "{margin-top:0;margin-bottom:calc(", " - 1em);}"], rowHeight, StyledOverflowButton, math(`${rowHeight} / 2`));
|
|
34
|
+
};
|
|
22
35
|
const StyledHeaderRow = styled(StyledBaseRow).attrs({
|
|
23
36
|
'data-garden-id': COMPONENT_ID,
|
|
24
|
-
'data-garden-version': '9.0.0-next.
|
|
37
|
+
'data-garden-version': '9.0.0-next.15'
|
|
25
38
|
}).withConfig({
|
|
26
39
|
displayName: "StyledHeaderRow",
|
|
27
40
|
componentId: "sc-16ogvdx-0"
|
|
28
|
-
})(["
|
|
41
|
+
})(["font-weight:", ";", " ", " ", "{opacity:1;}", ";"], props => props.theme.fontWeights.semibold, sizeStyles, colorStyles, StyledOverflowButton, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
29
42
|
StyledHeaderRow.defaultProps = {
|
|
30
43
|
theme: DEFAULT_THEME
|
|
31
44
|
};
|
|
@@ -11,7 +11,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
11
11
|
const COMPONENT_ID = 'tables.hidden_cell';
|
|
12
12
|
const StyledHiddenCell = styled.div.attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.15'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledHiddenCell",
|
|
17
17
|
componentId: "sc-1x454xw-0"
|
|
@@ -4,48 +4,23 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import styled
|
|
7
|
+
import styled from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import { retrieveComponentStyles, DEFAULT_THEME
|
|
9
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
10
10
|
import { getRowHeight } from './style-utils.js';
|
|
11
|
+
import { IconButton } from '@zendeskgarden/react-buttons';
|
|
11
12
|
|
|
12
13
|
const COMPONENT_ID = 'tables.overflow_button';
|
|
13
14
|
const OVERFLOW_BUTTON_SIZE = '2em';
|
|
14
|
-
const
|
|
15
|
-
const hoverBackgroundColor = getColorV8('primaryHue', 600, props.theme, 0.08);
|
|
16
|
-
const hoverForegroundColor = getColorV8('neutralHue', 700, props.theme);
|
|
17
|
-
const activeBackgroundColor = getColorV8('primaryHue', 600, props.theme, 0.2);
|
|
18
|
-
const activeForegroundColor = getColorV8('neutralHue', 800, props.theme);
|
|
19
|
-
let foregroundColor;
|
|
20
|
-
if (props.isHovered) {
|
|
21
|
-
foregroundColor = hoverForegroundColor;
|
|
22
|
-
} else if (props.isActive) {
|
|
23
|
-
foregroundColor = activeForegroundColor;
|
|
24
|
-
} else {
|
|
25
|
-
foregroundColor = getColorV8('neutralHue', 600, props.theme);
|
|
26
|
-
}
|
|
27
|
-
return css(["color:", ";&:hover{background-color:", ";color:", ";}", " &:active{background-color:", ";color:", ";}"], foregroundColor, hoverBackgroundColor, hoverForegroundColor, focusStyles({
|
|
28
|
-
theme: props.theme,
|
|
29
|
-
inset: true
|
|
30
|
-
}), activeBackgroundColor, activeForegroundColor);
|
|
31
|
-
};
|
|
32
|
-
const StyledOverflowButton = styled.button.attrs({
|
|
15
|
+
const StyledOverflowButton = styled(IconButton).attrs({
|
|
33
16
|
'data-garden-id': COMPONENT_ID,
|
|
34
|
-
'data-garden-version': '9.0.0-next.
|
|
35
|
-
type: 'button'
|
|
17
|
+
'data-garden-version': '9.0.0-next.15'
|
|
36
18
|
}).withConfig({
|
|
37
19
|
displayName: "StyledOverflowButton",
|
|
38
20
|
componentId: "sc-1eba2ml-0"
|
|
39
|
-
})(["
|
|
21
|
+
})(["margin-top:calc(", " - 1em);width:100%;min-width:unset;height:", ";font-size:inherit;", ";"], props => math(`${getRowHeight(props)} / 2`), OVERFLOW_BUTTON_SIZE, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
40
22
|
StyledOverflowButton.defaultProps = {
|
|
41
23
|
theme: DEFAULT_THEME
|
|
42
24
|
};
|
|
43
|
-
const StyledOverflowButtonIconWrapper = styled.div.withConfig({
|
|
44
|
-
displayName: "StyledOverflowButton__StyledOverflowButtonIconWrapper",
|
|
45
|
-
componentId: "sc-1eba2ml-1"
|
|
46
|
-
})(["display:flex;align-items:center;justify-content:center;transform:rotate(90deg);transition:background-color 0.1s ease-in-out;width:", ";height:", ";"], OVERFLOW_BUTTON_SIZE, OVERFLOW_BUTTON_SIZE);
|
|
47
|
-
StyledOverflowButtonIconWrapper.defaultProps = {
|
|
48
|
-
theme: DEFAULT_THEME
|
|
49
|
-
};
|
|
50
25
|
|
|
51
|
-
export { StyledOverflowButton
|
|
26
|
+
export { StyledOverflowButton };
|
|
@@ -5,32 +5,74 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import {
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledCell } from './StyledCell.js';
|
|
10
|
+
import { StyledBaseRow } from './StyledBaseRow.js';
|
|
10
11
|
import { StyledOverflowButton } from './StyledOverflowButton.js';
|
|
11
12
|
import { getRowHeight } from './style-utils.js';
|
|
12
13
|
|
|
13
14
|
const COMPONENT_ID = 'tables.row';
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
const colorStyles = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
theme,
|
|
18
|
+
$isFocused,
|
|
19
|
+
$isSelected,
|
|
20
|
+
$isHovered,
|
|
21
|
+
$isReadOnly
|
|
22
|
+
} = _ref;
|
|
23
|
+
const hoveredBackgroundColor = getColor({
|
|
24
|
+
variable: 'background.primaryEmphasis',
|
|
25
|
+
transparency: theme.opacity[100],
|
|
26
|
+
dark: {
|
|
27
|
+
offset: -100
|
|
28
|
+
},
|
|
29
|
+
theme
|
|
30
|
+
});
|
|
31
|
+
const hoveredBorderColor = getColor({
|
|
32
|
+
variable: 'border.primaryEmphasis',
|
|
33
|
+
transparency: theme.opacity[200],
|
|
34
|
+
dark: {
|
|
35
|
+
offset: -100
|
|
36
|
+
},
|
|
37
|
+
theme
|
|
38
|
+
});
|
|
39
|
+
const selectedBackgroundColor = getColor({
|
|
40
|
+
variable: 'background.primaryEmphasis',
|
|
41
|
+
transparency: theme.opacity[200],
|
|
42
|
+
dark: {
|
|
43
|
+
offset: -100
|
|
44
|
+
},
|
|
45
|
+
theme
|
|
46
|
+
});
|
|
47
|
+
const selectedBorderColor = getColor({
|
|
48
|
+
variable: 'border.primaryEmphasis',
|
|
49
|
+
light: {
|
|
50
|
+
offset: -400
|
|
51
|
+
},
|
|
52
|
+
dark: {
|
|
53
|
+
offset: 300
|
|
54
|
+
},
|
|
55
|
+
theme
|
|
56
|
+
});
|
|
57
|
+
const hoveredSelectedBackgroundColor = getColor({
|
|
58
|
+
variable: 'background.primaryEmphasis',
|
|
59
|
+
transparency: theme.opacity[300],
|
|
60
|
+
dark: {
|
|
61
|
+
offset: -100
|
|
62
|
+
},
|
|
63
|
+
theme
|
|
64
|
+
});
|
|
65
|
+
const boxShadowColor = getColor({
|
|
66
|
+
variable: 'border.primaryEmphasis',
|
|
67
|
+
theme
|
|
68
|
+
});
|
|
69
|
+
const boxShadow = `inset ${theme.rtl ? '-' : ''}${theme.shadowWidths.md} 0 0 0 ${boxShadowColor}`;
|
|
28
70
|
let backgroundColor = undefined;
|
|
29
71
|
let borderColor = undefined;
|
|
30
72
|
let hoverBorderBottomColor = undefined;
|
|
31
73
|
let hoverBackgroundColor = undefined;
|
|
32
|
-
if (
|
|
33
|
-
if (
|
|
74
|
+
if ($isSelected) {
|
|
75
|
+
if ($isHovered) {
|
|
34
76
|
backgroundColor = hoveredSelectedBackgroundColor;
|
|
35
77
|
} else {
|
|
36
78
|
backgroundColor = selectedBackgroundColor;
|
|
@@ -38,25 +80,27 @@ const colorStyles = props => {
|
|
|
38
80
|
borderColor = selectedBorderColor;
|
|
39
81
|
hoverBorderBottomColor = selectedBorderColor;
|
|
40
82
|
hoverBackgroundColor = hoveredSelectedBackgroundColor;
|
|
41
|
-
} else if (
|
|
83
|
+
} else if ($isHovered) {
|
|
42
84
|
backgroundColor = hoveredBackgroundColor;
|
|
43
85
|
borderColor = hoveredBorderColor;
|
|
44
|
-
} else if (
|
|
86
|
+
} else if (!$isReadOnly) {
|
|
45
87
|
hoverBorderBottomColor = hoveredBorderColor;
|
|
46
88
|
hoverBackgroundColor = hoveredBackgroundColor;
|
|
47
89
|
}
|
|
48
|
-
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,
|
|
90
|
+
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, $isFocused && boxShadow, boxShadow);
|
|
49
91
|
};
|
|
50
|
-
const
|
|
92
|
+
const sizeStyles = props => {
|
|
93
|
+
return css(["height:", ";"], getRowHeight(props));
|
|
94
|
+
};
|
|
95
|
+
const StyledRow = styled(StyledBaseRow).attrs({
|
|
51
96
|
'data-garden-id': COMPONENT_ID,
|
|
52
|
-
'data-garden-version': '9.0.0-next.
|
|
53
|
-
|
|
54
|
-
})).withConfig({
|
|
97
|
+
'data-garden-version': '9.0.0-next.15'
|
|
98
|
+
}).withConfig({
|
|
55
99
|
displayName: "StyledRow",
|
|
56
|
-
componentId: "sc-ek66ow-
|
|
57
|
-
})(["
|
|
100
|
+
componentId: "sc-ek66ow-0"
|
|
101
|
+
})(["", " ", " ", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
58
102
|
StyledRow.defaultProps = {
|
|
59
103
|
theme: DEFAULT_THEME
|
|
60
104
|
};
|
|
61
105
|
|
|
62
|
-
export {
|
|
106
|
+
export { StyledRow };
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import styled from 'styled-components';
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import { DEFAULT_THEME,
|
|
9
|
+
import { DEFAULT_THEME, SELECTOR_FOCUS_VISIBLE, retrieveComponentStyles, getColor, focusStyles } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'tables.sortable';
|
|
12
12
|
const StyledBaseIconWrapper = styled.div.withConfig({
|
|
@@ -30,50 +30,73 @@ const StyledSortableFillIconWrapper = styled(StyledBaseIconWrapper).withConfig({
|
|
|
30
30
|
StyledSortableFillIconWrapper.defaultProps = {
|
|
31
31
|
theme: DEFAULT_THEME
|
|
32
32
|
};
|
|
33
|
+
const colorStyles = _ref => {
|
|
34
|
+
let {
|
|
35
|
+
theme,
|
|
36
|
+
$sort
|
|
37
|
+
} = _ref;
|
|
38
|
+
const fgInactive = getColor({
|
|
39
|
+
variable: 'foreground.subtle',
|
|
40
|
+
transparency: theme.opacity[200],
|
|
41
|
+
theme
|
|
42
|
+
});
|
|
43
|
+
const fgActive = getColor({
|
|
44
|
+
variable: 'foreground.subtle',
|
|
45
|
+
theme
|
|
46
|
+
});
|
|
47
|
+
const fgPrimaryActive = getColor({
|
|
48
|
+
variable: 'foreground.primary',
|
|
49
|
+
theme
|
|
50
|
+
});
|
|
51
|
+
const fgPrimaryInactive = getColor({
|
|
52
|
+
variable: 'foreground.primary',
|
|
53
|
+
theme,
|
|
54
|
+
dark: {
|
|
55
|
+
offset: -100
|
|
56
|
+
},
|
|
57
|
+
transparency: theme.opacity[200]
|
|
58
|
+
});
|
|
59
|
+
let color = fgActive;
|
|
60
|
+
let fill = fgActive;
|
|
61
|
+
if ($sort === 'asc') {
|
|
62
|
+
color = fgActive;
|
|
63
|
+
fill = fgInactive;
|
|
64
|
+
} else if ($sort === 'desc') {
|
|
65
|
+
color = fgInactive;
|
|
66
|
+
fill = fgActive;
|
|
67
|
+
}
|
|
68
|
+
return css(["", "{color:", ";fill:", ";}", "{color:", ";fill:", ";}&:hover,", "{color:", ";", ";", " ", "}", ""], StyledSortableStrokeIconWrapper, fgActive, fgActive, StyledSortableFillIconWrapper, color, fill, SELECTOR_FOCUS_VISIBLE, fgPrimaryActive, $sort === undefined && `
|
|
69
|
+
${StyledSortableFillIconWrapper} {
|
|
70
|
+
opacity: 1;
|
|
71
|
+
color: ${fgPrimaryActive};
|
|
72
|
+
fill: ${fgPrimaryActive};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
${StyledSortableStrokeIconWrapper} {
|
|
76
|
+
opacity: 0;
|
|
77
|
+
}
|
|
78
|
+
`, $sort === 'asc' && `
|
|
79
|
+
${StyledSortableFillIconWrapper} {
|
|
80
|
+
color: ${fgPrimaryActive};
|
|
81
|
+
fill: ${fgPrimaryInactive};
|
|
82
|
+
}
|
|
83
|
+
`, $sort === 'desc' && `
|
|
84
|
+
${StyledSortableFillIconWrapper} {
|
|
85
|
+
color: ${fgPrimaryInactive};
|
|
86
|
+
fill: ${fgPrimaryActive};
|
|
87
|
+
}
|
|
88
|
+
`, focusStyles({
|
|
89
|
+
theme
|
|
90
|
+
}));
|
|
91
|
+
};
|
|
33
92
|
const StyledSortableButton = styled.button.attrs({
|
|
34
93
|
'data-garden-id': COMPONENT_ID,
|
|
35
|
-
'data-garden-version': '9.0.0-next.
|
|
94
|
+
'data-garden-version': '9.0.0-next.15',
|
|
36
95
|
type: 'button'
|
|
37
96
|
}).withConfig({
|
|
38
97
|
displayName: "StyledSortableButton",
|
|
39
98
|
componentId: "sc-2s1dli-3"
|
|
40
|
-
})(["position:relative;transition:box-shadow 0.1s ease-in-out;border:none;border-radius:", ";background-color:transparent;cursor:pointer;padding:0;padding-", ":", ";width:", ";text-decoration:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:", ";", "{opacity:", ";}", "{opacity:", ";
|
|
41
|
-
if (props.sort === 'asc') {
|
|
42
|
-
return getColorV8('neutralHue', 600, props.theme);
|
|
43
|
-
} else if (props.sort === 'desc') {
|
|
44
|
-
return getColorV8('neutralHue', 400, props.theme);
|
|
45
|
-
}
|
|
46
|
-
return undefined;
|
|
47
|
-
}, props => {
|
|
48
|
-
if (props.sort === 'asc') {
|
|
49
|
-
return getColorV8('neutralHue', 400, props.theme);
|
|
50
|
-
} else if (props.sort === 'desc') {
|
|
51
|
-
return getColorV8('neutralHue', 600, props.theme);
|
|
52
|
-
}
|
|
53
|
-
return undefined;
|
|
54
|
-
}, SELECTOR_FOCUS_VISIBLE, props => getColorV8('primaryHue', 600, props.theme), props => props.sort === undefined && `
|
|
55
|
-
${StyledSortableFillIconWrapper} {
|
|
56
|
-
opacity: 1;
|
|
57
|
-
color: ${getColorV8('primaryHue', 600, props.theme)};
|
|
58
|
-
fill: ${getColorV8('primaryHue', 600, props.theme)};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
${StyledSortableStrokeIconWrapper} {
|
|
62
|
-
opacity: 0;
|
|
63
|
-
}
|
|
64
|
-
`, props => props.sort === 'asc' && `
|
|
65
|
-
${StyledSortableFillIconWrapper} {
|
|
66
|
-
color: ${getColorV8('primaryHue', 600, props.theme)};
|
|
67
|
-
fill: ${getColorV8('primaryHue', 600, props.theme, 0.25)};
|
|
68
|
-
}
|
|
69
|
-
`, props => props.sort === 'desc' && `
|
|
70
|
-
${StyledSortableFillIconWrapper} {
|
|
71
|
-
color: ${getColorV8('primaryHue', 600, props.theme, 0.25)};
|
|
72
|
-
fill: ${getColorV8('primaryHue', 600, props.theme)};
|
|
73
|
-
}
|
|
74
|
-
`, props => focusStyles({
|
|
75
|
-
theme: props.theme
|
|
76
|
-
}), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
99
|
+
})(["position:relative;transition:box-shadow 0.1s ease-in-out;border:none;border-radius:", ";background-color:transparent;cursor:pointer;padding:0;padding-", ":", ";width:", ";text-decoration:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:", ";", "{opacity:", ";}", "{opacity:", ";}&:hover,", "{text-decoration:none;}", " ", ";"], props => props.theme.borderRadii.sm, props => props.theme.rtl ? 'left' : 'right', props => math(`${props.theme.space.base} + ${props.theme.iconSizes.sm}`), props => props.width, props => props.theme.fontWeights.semibold, StyledSortableStrokeIconWrapper, props => props.$sort === undefined && 1, StyledSortableFillIconWrapper, props => props.$sort !== undefined && 1, SELECTOR_FOCUS_VISIBLE, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
77
100
|
StyledSortableButton.defaultProps = {
|
|
78
101
|
theme: DEFAULT_THEME
|
|
79
102
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import {
|
|
8
|
+
import { getColor, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'tables.table';
|
|
11
11
|
const getLineHeight = props => {
|
|
@@ -13,11 +13,14 @@ const getLineHeight = props => {
|
|
|
13
13
|
};
|
|
14
14
|
const StyledTable = styled.table.attrs({
|
|
15
15
|
'data-garden-id': COMPONENT_ID,
|
|
16
|
-
'data-garden-version': '9.0.0-next.
|
|
16
|
+
'data-garden-version': '9.0.0-next.15'
|
|
17
17
|
}).withConfig({
|
|
18
18
|
displayName: "StyledTable",
|
|
19
19
|
componentId: "sc-gje7na-0"
|
|
20
|
-
})(["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 =>
|
|
20
|
+
})(["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 => getColor({
|
|
21
|
+
variable: 'foreground.default',
|
|
22
|
+
theme: props.theme
|
|
23
|
+
}), props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
21
24
|
StyledTable.defaultProps = {
|
|
22
25
|
theme: DEFAULT_THEME
|
|
23
26
|
};
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
const getRowHeight = props => {
|
|
8
|
-
if (props
|
|
8
|
+
if (props.$size === 'large') {
|
|
9
9
|
return `${props.theme.space.base * 16}px`;
|
|
10
|
-
} else if (props
|
|
10
|
+
} else if (props.$size === 'small') {
|
|
11
11
|
return `${props.theme.space.base * 8}px`;
|
|
12
12
|
}
|
|
13
13
|
return `${props.theme.space.base * 10}px`;
|