@zendeskgarden/react-tabs 9.0.0-next.14 → 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/dist/esm/elements/Tab.js +3 -3
- package/dist/esm/elements/TabList.js +1 -1
- package/dist/esm/elements/TabPanel.js +1 -1
- package/dist/esm/elements/Tabs.js +1 -1
- package/dist/esm/styled/StyledTab.js +26 -13
- package/dist/esm/styled/StyledTabList.js +14 -8
- package/dist/esm/styled/StyledTabPanel.js +4 -4
- package/dist/esm/styled/StyledTabs.js +2 -2
- package/dist/index.cjs.js +50 -31
- package/dist/typings/styled/StyledTab.d.ts +2 -2
- package/dist/typings/styled/StyledTabList.d.ts +1 -1
- package/dist/typings/styled/StyledTabPanel.d.ts +1 -1
- package/dist/typings/styled/StyledTabs.d.ts +1 -1
- package/package.json +3 -3
package/dist/esm/elements/Tab.js
CHANGED
|
@@ -25,7 +25,7 @@ const Tab = React.forwardRef((_ref, ref) => {
|
|
|
25
25
|
role: "tab",
|
|
26
26
|
"aria-disabled": disabled,
|
|
27
27
|
ref: ref,
|
|
28
|
-
isVertical: tabsPropGetters?.isVertical
|
|
28
|
+
$isVertical: tabsPropGetters?.isVertical
|
|
29
29
|
}, otherProps));
|
|
30
30
|
}
|
|
31
31
|
const {
|
|
@@ -35,8 +35,8 @@ const Tab = React.forwardRef((_ref, ref) => {
|
|
|
35
35
|
value: item
|
|
36
36
|
});
|
|
37
37
|
return React.createElement(StyledTab, Object.assign({
|
|
38
|
-
isSelected: item === tabsPropGetters.selectedValue,
|
|
39
|
-
isVertical: tabsPropGetters.isVertical
|
|
38
|
+
$isSelected: item === tabsPropGetters.selectedValue,
|
|
39
|
+
$isVertical: tabsPropGetters.isVertical
|
|
40
40
|
}, tabProps, otherProps, {
|
|
41
41
|
ref: mergeRefs([tabRef, ref])
|
|
42
42
|
}));
|
|
@@ -20,7 +20,7 @@ const TabList = React.forwardRef((props, ref) => {
|
|
|
20
20
|
}
|
|
21
21
|
const tabListProps = tabsPropGetters.getTabListProps();
|
|
22
22
|
return React.createElement(StyledTabList, Object.assign({
|
|
23
|
-
isVertical: tabsPropGetters.isVertical
|
|
23
|
+
$isVertical: tabsPropGetters.isVertical
|
|
24
24
|
}, tabListProps, props, {
|
|
25
25
|
ref: ref
|
|
26
26
|
}));
|
|
@@ -28,7 +28,7 @@ const TabPanel = React.forwardRef((_ref, ref) => {
|
|
|
28
28
|
});
|
|
29
29
|
return React.createElement(StyledTabPanel, Object.assign({
|
|
30
30
|
"aria-hidden": tabsPropGetters.selectedValue !== item,
|
|
31
|
-
isVertical: tabsPropGetters.isVertical
|
|
31
|
+
$isVertical: tabsPropGetters.isVertical
|
|
32
32
|
}, tabPanelProps, otherProps, {
|
|
33
33
|
ref: ref
|
|
34
34
|
}));
|
|
@@ -50,7 +50,7 @@ const TabsComponent = forwardRef((_ref, ref) => {
|
|
|
50
50
|
return React.createElement(TabsContext.Provider, {
|
|
51
51
|
value: contextValue
|
|
52
52
|
}, React.createElement(StyledTabs, Object.assign({
|
|
53
|
-
isVertical: isVertical
|
|
53
|
+
$isVertical: isVertical
|
|
54
54
|
}, otherProps, {
|
|
55
55
|
ref: ref
|
|
56
56
|
}), children));
|
|
@@ -5,19 +5,32 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles, DEFAULT_THEME,
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor, focusStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { stripUnit } from 'polished';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'tabs.tab';
|
|
12
12
|
const colorStyles = _ref => {
|
|
13
13
|
let {
|
|
14
14
|
theme,
|
|
15
|
-
isSelected,
|
|
16
|
-
isVertical
|
|
15
|
+
$isSelected,
|
|
16
|
+
$isVertical
|
|
17
17
|
} = _ref;
|
|
18
|
-
const borderColor = isSelected ?
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const borderColor = $isSelected ? getColor({
|
|
19
|
+
theme,
|
|
20
|
+
variable: 'border.primaryEmphasis'
|
|
21
|
+
}) : 'transparent';
|
|
22
|
+
const borderBlockEndColor = $isVertical ? undefined : borderColor;
|
|
23
|
+
const borderInlineColor = $isVertical ? borderColor : undefined;
|
|
24
|
+
const selectedColor = getColor({
|
|
25
|
+
theme,
|
|
26
|
+
variable: 'foreground.primary'
|
|
27
|
+
});
|
|
28
|
+
const foregroundColor = $isSelected ? selectedColor : 'inherit';
|
|
29
|
+
const disabledColor = getColor({
|
|
30
|
+
theme,
|
|
31
|
+
variable: 'foreground.disabled'
|
|
32
|
+
});
|
|
33
|
+
return css(["border-bottom-color:", ";border-", "-color:", ";color:", ";&:hover{color:", ";}", " &:active{border-color:currentcolor;color:", ";}&[aria-disabled='true']{border-color:transparent;color:", ";}"], borderBlockEndColor, theme.rtl ? 'right' : 'left', borderInlineColor, foregroundColor, selectedColor, focusStyles({
|
|
21
34
|
theme,
|
|
22
35
|
inset: true,
|
|
23
36
|
spacerWidth: null,
|
|
@@ -26,18 +39,18 @@ const colorStyles = _ref => {
|
|
|
26
39
|
styles: {
|
|
27
40
|
color: selectedColor
|
|
28
41
|
}
|
|
29
|
-
}), selectedColor,
|
|
42
|
+
}), selectedColor, disabledColor);
|
|
30
43
|
};
|
|
31
44
|
const sizeStyles = _ref2 => {
|
|
32
45
|
let {
|
|
33
46
|
theme,
|
|
34
|
-
isVertical
|
|
47
|
+
$isVertical
|
|
35
48
|
} = _ref2;
|
|
36
49
|
const borderWidth = theme.borderWidths.md;
|
|
37
50
|
const focusHeight = `${theme.space.base * 5}px`;
|
|
38
51
|
let marginBottom;
|
|
39
52
|
let padding;
|
|
40
|
-
if (isVertical) {
|
|
53
|
+
if ($isVertical) {
|
|
41
54
|
marginBottom = `${theme.space.base * 5}px`;
|
|
42
55
|
padding = `${theme.space.base}px ${theme.space.base * 2}px`;
|
|
43
56
|
} else {
|
|
@@ -50,16 +63,16 @@ const sizeStyles = _ref2 => {
|
|
|
50
63
|
};
|
|
51
64
|
const StyledTab = styled.div.attrs({
|
|
52
65
|
'data-garden-id': COMPONENT_ID,
|
|
53
|
-
'data-garden-version': '9.0.0-next.
|
|
66
|
+
'data-garden-version': '9.0.0-next.15'
|
|
54
67
|
}).withConfig({
|
|
55
68
|
displayName: "StyledTab",
|
|
56
69
|
componentId: "sc-x2pbow-0"
|
|
57
|
-
})(["display:", ";position:relative;transition:color 0.25s ease-in-out;border-bottom:", ";border-", ":", ";cursor:pointer;overflow:hidden;vertical-align:top;user-select:none;text-align:", ";text-decoration:none;text-overflow:ellipsis;", ";", ";&:focus{text-decoration:none;}&::before{transition:box-shadow 0.1s ease-in-out;content:'';}&:focus-visible::before{position:absolute;top:", "px;right:", "px;left:", "px;border-radius:", ";pointer-events:none;}&:active::before{box-shadow:none;}&[aria-disabled='true']{cursor:default;}", ";"], props => props
|
|
58
|
-
if (props
|
|
70
|
+
})(["display:", ";position:relative;transition:color 0.25s ease-in-out;border-bottom:", ";border-", ":", ";cursor:pointer;overflow:hidden;vertical-align:top;user-select:none;text-align:", ";text-decoration:none;text-overflow:ellipsis;", ";", ";&:focus{text-decoration:none;}&::before{transition:box-shadow 0.1s ease-in-out;content:'';}&:focus-visible::before{position:absolute;top:", "px;right:", "px;left:", "px;border-radius:", ";pointer-events:none;}&:active::before{box-shadow:none;}&[aria-disabled='true']{cursor:default;}", ";"], props => props.$isVertical ? 'block' : 'inline-block', props => props.$isVertical ? undefined : props.theme.borderStyles.solid, props => props.theme.rtl ? 'right' : 'left', props => props.$isVertical ? props.theme.borderStyles.solid : undefined, props => {
|
|
71
|
+
if (props.$isVertical) {
|
|
59
72
|
return props.theme.rtl ? 'right' : 'left';
|
|
60
73
|
}
|
|
61
74
|
return 'center';
|
|
62
|
-
}, sizeStyles, colorStyles, props => props.theme.space.base * (props
|
|
75
|
+
}, sizeStyles, colorStyles, props => props.theme.space.base * (props.$isVertical ? 1 : 2.5), props => props.theme.space.base * (props.$isVertical ? 1 : 6), props => props.theme.space.base * (props.$isVertical ? 1 : 6), props => props.theme.borderRadii.md, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
63
76
|
StyledTab.defaultProps = {
|
|
64
77
|
theme: DEFAULT_THEME
|
|
65
78
|
};
|
|
@@ -5,35 +5,41 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles, DEFAULT_THEME,
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor, getLineHeight } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'tabs.tablist';
|
|
11
11
|
const colorStyles = _ref => {
|
|
12
12
|
let {
|
|
13
13
|
theme
|
|
14
14
|
} = _ref;
|
|
15
|
-
const borderColor =
|
|
16
|
-
|
|
15
|
+
const borderColor = getColor({
|
|
16
|
+
theme,
|
|
17
|
+
variable: 'border.default'
|
|
18
|
+
});
|
|
19
|
+
const foregroundColor = getColor({
|
|
20
|
+
theme,
|
|
21
|
+
variable: 'foreground.default'
|
|
22
|
+
});
|
|
17
23
|
return css(["border-bottom-color:", ";color:", ";"], borderColor, foregroundColor);
|
|
18
24
|
};
|
|
19
25
|
const sizeStyles = _ref2 => {
|
|
20
26
|
let {
|
|
21
27
|
theme,
|
|
22
|
-
isVertical
|
|
28
|
+
$isVertical
|
|
23
29
|
} = _ref2;
|
|
24
|
-
const marginBottom = isVertical ? 0 : `${theme.space.base * 5}px`;
|
|
25
|
-
const borderBottom = isVertical ? undefined : theme.borderWidths.sm;
|
|
30
|
+
const marginBottom = $isVertical ? 0 : `${theme.space.base * 5}px`;
|
|
31
|
+
const borderBottom = $isVertical ? undefined : theme.borderWidths.sm;
|
|
26
32
|
const fontSize = theme.fontSizes.md;
|
|
27
33
|
const lineHeight = getLineHeight(theme.space.base * 5, fontSize);
|
|
28
34
|
return css(["margin-top:0;margin-bottom:", ";border-bottom-width:", ";padding:0;line-height:", ";font-size:", ";"], marginBottom, borderBottom, lineHeight, fontSize);
|
|
29
35
|
};
|
|
30
36
|
const StyledTabList = styled.div.attrs({
|
|
31
37
|
'data-garden-id': COMPONENT_ID,
|
|
32
|
-
'data-garden-version': '9.0.0-next.
|
|
38
|
+
'data-garden-version': '9.0.0-next.15'
|
|
33
39
|
}).withConfig({
|
|
34
40
|
displayName: "StyledTabList",
|
|
35
41
|
componentId: "sc-wa5aaj-0"
|
|
36
|
-
})(["display:", ";border-bottom:", ";vertical-align:", ";white-space:nowrap;", ";", ";", ";"], props => props
|
|
42
|
+
})(["display:", ";border-bottom:", ";vertical-align:", ";white-space:nowrap;", ";", ";", ";"], props => props.$isVertical ? 'table-cell' : 'block', props => props.$isVertical ? 'none' : props.theme.borderStyles.solid, props => props.$isVertical ? 'top' : undefined, sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
37
43
|
StyledTabList.defaultProps = {
|
|
38
44
|
theme: DEFAULT_THEME
|
|
39
45
|
};
|
|
@@ -11,18 +11,18 @@ const COMPONENT_ID = 'tabs.tabpanel';
|
|
|
11
11
|
const sizeStyles = _ref => {
|
|
12
12
|
let {
|
|
13
13
|
theme,
|
|
14
|
-
isVertical
|
|
14
|
+
$isVertical
|
|
15
15
|
} = _ref;
|
|
16
|
-
const margin = isVertical ? `${theme.space.base * 8}px` : undefined;
|
|
16
|
+
const margin = $isVertical ? `${theme.space.base * 8}px` : undefined;
|
|
17
17
|
return css(["margin-", ":", ";"], theme.rtl ? 'right' : 'left', margin);
|
|
18
18
|
};
|
|
19
19
|
const StyledTabPanel = styled.div.attrs({
|
|
20
20
|
'data-garden-id': COMPONENT_ID,
|
|
21
|
-
'data-garden-version': '9.0.0-next.
|
|
21
|
+
'data-garden-version': '9.0.0-next.15'
|
|
22
22
|
}).withConfig({
|
|
23
23
|
displayName: "StyledTabPanel",
|
|
24
24
|
componentId: "sc-7lhrmp-0"
|
|
25
|
-
})(["display:block;vertical-align:", ";", ";&[aria-hidden='true']{display:none;}", ";"], props => props
|
|
25
|
+
})(["display:block;vertical-align:", ";", ";&[aria-hidden='true']{display:none;}", ";"], props => props.$isVertical && 'top', sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
26
26
|
StyledTabPanel.defaultProps = {
|
|
27
27
|
theme: DEFAULT_THEME
|
|
28
28
|
};
|
|
@@ -10,11 +10,11 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
10
10
|
const COMPONENT_ID = 'tabs.tabs';
|
|
11
11
|
const StyledTabs = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.15'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledTabs",
|
|
16
16
|
componentId: "sc-1qaor65-0"
|
|
17
|
-
})(["display:", ";overflow:hidden;direction:", ";", ";"], props => props
|
|
17
|
+
})(["display:", ";overflow:hidden;direction:", ";", ";"], props => props.$isVertical ? 'table' : 'block', props => props.theme.rtl && 'rtl', props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
18
|
StyledTabs.defaultProps = {
|
|
19
19
|
theme: DEFAULT_THEME
|
|
20
20
|
};
|
package/dist/index.cjs.js
CHANGED
|
@@ -25,12 +25,25 @@ const COMPONENT_ID$3 = 'tabs.tab';
|
|
|
25
25
|
const colorStyles$1 = _ref => {
|
|
26
26
|
let {
|
|
27
27
|
theme,
|
|
28
|
-
isSelected,
|
|
29
|
-
isVertical
|
|
28
|
+
$isSelected,
|
|
29
|
+
$isVertical
|
|
30
30
|
} = _ref;
|
|
31
|
-
const borderColor = isSelected ?
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const borderColor = $isSelected ? reactTheming.getColor({
|
|
32
|
+
theme,
|
|
33
|
+
variable: 'border.primaryEmphasis'
|
|
34
|
+
}) : 'transparent';
|
|
35
|
+
const borderBlockEndColor = $isVertical ? undefined : borderColor;
|
|
36
|
+
const borderInlineColor = $isVertical ? borderColor : undefined;
|
|
37
|
+
const selectedColor = reactTheming.getColor({
|
|
38
|
+
theme,
|
|
39
|
+
variable: 'foreground.primary'
|
|
40
|
+
});
|
|
41
|
+
const foregroundColor = $isSelected ? selectedColor : 'inherit';
|
|
42
|
+
const disabledColor = reactTheming.getColor({
|
|
43
|
+
theme,
|
|
44
|
+
variable: 'foreground.disabled'
|
|
45
|
+
});
|
|
46
|
+
return styled.css(["border-bottom-color:", ";border-", "-color:", ";color:", ";&:hover{color:", ";}", " &:active{border-color:currentcolor;color:", ";}&[aria-disabled='true']{border-color:transparent;color:", ";}"], borderBlockEndColor, theme.rtl ? 'right' : 'left', borderInlineColor, foregroundColor, selectedColor, reactTheming.focusStyles({
|
|
34
47
|
theme,
|
|
35
48
|
inset: true,
|
|
36
49
|
spacerWidth: null,
|
|
@@ -39,18 +52,18 @@ const colorStyles$1 = _ref => {
|
|
|
39
52
|
styles: {
|
|
40
53
|
color: selectedColor
|
|
41
54
|
}
|
|
42
|
-
}), selectedColor,
|
|
55
|
+
}), selectedColor, disabledColor);
|
|
43
56
|
};
|
|
44
57
|
const sizeStyles$2 = _ref2 => {
|
|
45
58
|
let {
|
|
46
59
|
theme,
|
|
47
|
-
isVertical
|
|
60
|
+
$isVertical
|
|
48
61
|
} = _ref2;
|
|
49
62
|
const borderWidth = theme.borderWidths.md;
|
|
50
63
|
const focusHeight = `${theme.space.base * 5}px`;
|
|
51
64
|
let marginBottom;
|
|
52
65
|
let padding;
|
|
53
|
-
if (isVertical) {
|
|
66
|
+
if ($isVertical) {
|
|
54
67
|
marginBottom = `${theme.space.base * 5}px`;
|
|
55
68
|
padding = `${theme.space.base}px ${theme.space.base * 2}px`;
|
|
56
69
|
} else {
|
|
@@ -63,16 +76,16 @@ const sizeStyles$2 = _ref2 => {
|
|
|
63
76
|
};
|
|
64
77
|
const StyledTab = styled__default.default.div.attrs({
|
|
65
78
|
'data-garden-id': COMPONENT_ID$3,
|
|
66
|
-
'data-garden-version': '9.0.0-next.
|
|
79
|
+
'data-garden-version': '9.0.0-next.15'
|
|
67
80
|
}).withConfig({
|
|
68
81
|
displayName: "StyledTab",
|
|
69
82
|
componentId: "sc-x2pbow-0"
|
|
70
|
-
})(["display:", ";position:relative;transition:color 0.25s ease-in-out;border-bottom:", ";border-", ":", ";cursor:pointer;overflow:hidden;vertical-align:top;user-select:none;text-align:", ";text-decoration:none;text-overflow:ellipsis;", ";", ";&:focus{text-decoration:none;}&::before{transition:box-shadow 0.1s ease-in-out;content:'';}&:focus-visible::before{position:absolute;top:", "px;right:", "px;left:", "px;border-radius:", ";pointer-events:none;}&:active::before{box-shadow:none;}&[aria-disabled='true']{cursor:default;}", ";"], props => props
|
|
71
|
-
if (props
|
|
83
|
+
})(["display:", ";position:relative;transition:color 0.25s ease-in-out;border-bottom:", ";border-", ":", ";cursor:pointer;overflow:hidden;vertical-align:top;user-select:none;text-align:", ";text-decoration:none;text-overflow:ellipsis;", ";", ";&:focus{text-decoration:none;}&::before{transition:box-shadow 0.1s ease-in-out;content:'';}&:focus-visible::before{position:absolute;top:", "px;right:", "px;left:", "px;border-radius:", ";pointer-events:none;}&:active::before{box-shadow:none;}&[aria-disabled='true']{cursor:default;}", ";"], props => props.$isVertical ? 'block' : 'inline-block', props => props.$isVertical ? undefined : props.theme.borderStyles.solid, props => props.theme.rtl ? 'right' : 'left', props => props.$isVertical ? props.theme.borderStyles.solid : undefined, props => {
|
|
84
|
+
if (props.$isVertical) {
|
|
72
85
|
return props.theme.rtl ? 'right' : 'left';
|
|
73
86
|
}
|
|
74
87
|
return 'center';
|
|
75
|
-
}, sizeStyles$2, colorStyles$1, props => props.theme.space.base * (props
|
|
88
|
+
}, sizeStyles$2, colorStyles$1, props => props.theme.space.base * (props.$isVertical ? 1 : 2.5), props => props.theme.space.base * (props.$isVertical ? 1 : 6), props => props.theme.space.base * (props.$isVertical ? 1 : 6), props => props.theme.borderRadii.md, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
76
89
|
StyledTab.defaultProps = {
|
|
77
90
|
theme: reactTheming.DEFAULT_THEME
|
|
78
91
|
};
|
|
@@ -82,28 +95,34 @@ const colorStyles = _ref => {
|
|
|
82
95
|
let {
|
|
83
96
|
theme
|
|
84
97
|
} = _ref;
|
|
85
|
-
const borderColor = reactTheming.
|
|
86
|
-
|
|
98
|
+
const borderColor = reactTheming.getColor({
|
|
99
|
+
theme,
|
|
100
|
+
variable: 'border.default'
|
|
101
|
+
});
|
|
102
|
+
const foregroundColor = reactTheming.getColor({
|
|
103
|
+
theme,
|
|
104
|
+
variable: 'foreground.default'
|
|
105
|
+
});
|
|
87
106
|
return styled.css(["border-bottom-color:", ";color:", ";"], borderColor, foregroundColor);
|
|
88
107
|
};
|
|
89
108
|
const sizeStyles$1 = _ref2 => {
|
|
90
109
|
let {
|
|
91
110
|
theme,
|
|
92
|
-
isVertical
|
|
111
|
+
$isVertical
|
|
93
112
|
} = _ref2;
|
|
94
|
-
const marginBottom = isVertical ? 0 : `${theme.space.base * 5}px`;
|
|
95
|
-
const borderBottom = isVertical ? undefined : theme.borderWidths.sm;
|
|
113
|
+
const marginBottom = $isVertical ? 0 : `${theme.space.base * 5}px`;
|
|
114
|
+
const borderBottom = $isVertical ? undefined : theme.borderWidths.sm;
|
|
96
115
|
const fontSize = theme.fontSizes.md;
|
|
97
116
|
const lineHeight = reactTheming.getLineHeight(theme.space.base * 5, fontSize);
|
|
98
117
|
return styled.css(["margin-top:0;margin-bottom:", ";border-bottom-width:", ";padding:0;line-height:", ";font-size:", ";"], marginBottom, borderBottom, lineHeight, fontSize);
|
|
99
118
|
};
|
|
100
119
|
const StyledTabList = styled__default.default.div.attrs({
|
|
101
120
|
'data-garden-id': COMPONENT_ID$2,
|
|
102
|
-
'data-garden-version': '9.0.0-next.
|
|
121
|
+
'data-garden-version': '9.0.0-next.15'
|
|
103
122
|
}).withConfig({
|
|
104
123
|
displayName: "StyledTabList",
|
|
105
124
|
componentId: "sc-wa5aaj-0"
|
|
106
|
-
})(["display:", ";border-bottom:", ";vertical-align:", ";white-space:nowrap;", ";", ";", ";"], props => props
|
|
125
|
+
})(["display:", ";border-bottom:", ";vertical-align:", ";white-space:nowrap;", ";", ";", ";"], props => props.$isVertical ? 'table-cell' : 'block', props => props.$isVertical ? 'none' : props.theme.borderStyles.solid, props => props.$isVertical ? 'top' : undefined, sizeStyles$1, colorStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
107
126
|
StyledTabList.defaultProps = {
|
|
108
127
|
theme: reactTheming.DEFAULT_THEME
|
|
109
128
|
};
|
|
@@ -112,18 +131,18 @@ const COMPONENT_ID$1 = 'tabs.tabpanel';
|
|
|
112
131
|
const sizeStyles = _ref => {
|
|
113
132
|
let {
|
|
114
133
|
theme,
|
|
115
|
-
isVertical
|
|
134
|
+
$isVertical
|
|
116
135
|
} = _ref;
|
|
117
|
-
const margin = isVertical ? `${theme.space.base * 8}px` : undefined;
|
|
136
|
+
const margin = $isVertical ? `${theme.space.base * 8}px` : undefined;
|
|
118
137
|
return styled.css(["margin-", ":", ";"], theme.rtl ? 'right' : 'left', margin);
|
|
119
138
|
};
|
|
120
139
|
const StyledTabPanel = styled__default.default.div.attrs({
|
|
121
140
|
'data-garden-id': COMPONENT_ID$1,
|
|
122
|
-
'data-garden-version': '9.0.0-next.
|
|
141
|
+
'data-garden-version': '9.0.0-next.15'
|
|
123
142
|
}).withConfig({
|
|
124
143
|
displayName: "StyledTabPanel",
|
|
125
144
|
componentId: "sc-7lhrmp-0"
|
|
126
|
-
})(["display:block;vertical-align:", ";", ";&[aria-hidden='true']{display:none;}", ";"], props => props
|
|
145
|
+
})(["display:block;vertical-align:", ";", ";&[aria-hidden='true']{display:none;}", ";"], props => props.$isVertical && 'top', sizeStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
127
146
|
StyledTabPanel.defaultProps = {
|
|
128
147
|
theme: reactTheming.DEFAULT_THEME
|
|
129
148
|
};
|
|
@@ -131,11 +150,11 @@ StyledTabPanel.defaultProps = {
|
|
|
131
150
|
const COMPONENT_ID = 'tabs.tabs';
|
|
132
151
|
const StyledTabs = styled__default.default.div.attrs({
|
|
133
152
|
'data-garden-id': COMPONENT_ID,
|
|
134
|
-
'data-garden-version': '9.0.0-next.
|
|
153
|
+
'data-garden-version': '9.0.0-next.15'
|
|
135
154
|
}).withConfig({
|
|
136
155
|
displayName: "StyledTabs",
|
|
137
156
|
componentId: "sc-1qaor65-0"
|
|
138
|
-
})(["display:", ";overflow:hidden;direction:", ";", ";"], props => props
|
|
157
|
+
})(["display:", ";overflow:hidden;direction:", ";", ";"], props => props.$isVertical ? 'table' : 'block', props => props.theme.rtl && 'rtl', props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
139
158
|
StyledTabs.defaultProps = {
|
|
140
159
|
theme: reactTheming.DEFAULT_THEME
|
|
141
160
|
};
|
|
@@ -157,7 +176,7 @@ const Tab = React__default.default.forwardRef((_ref, ref) => {
|
|
|
157
176
|
role: "tab",
|
|
158
177
|
"aria-disabled": disabled,
|
|
159
178
|
ref: ref,
|
|
160
|
-
isVertical: tabsPropGetters?.isVertical
|
|
179
|
+
$isVertical: tabsPropGetters?.isVertical
|
|
161
180
|
}, otherProps));
|
|
162
181
|
}
|
|
163
182
|
const {
|
|
@@ -167,8 +186,8 @@ const Tab = React__default.default.forwardRef((_ref, ref) => {
|
|
|
167
186
|
value: item
|
|
168
187
|
});
|
|
169
188
|
return React__default.default.createElement(StyledTab, Object.assign({
|
|
170
|
-
isSelected: item === tabsPropGetters.selectedValue,
|
|
171
|
-
isVertical: tabsPropGetters.isVertical
|
|
189
|
+
$isSelected: item === tabsPropGetters.selectedValue,
|
|
190
|
+
$isVertical: tabsPropGetters.isVertical
|
|
172
191
|
}, tabProps, otherProps, {
|
|
173
192
|
ref: reactMergeRefs.mergeRefs([tabRef, ref])
|
|
174
193
|
}));
|
|
@@ -188,7 +207,7 @@ const TabList = React__default.default.forwardRef((props, ref) => {
|
|
|
188
207
|
}
|
|
189
208
|
const tabListProps = tabsPropGetters.getTabListProps();
|
|
190
209
|
return React__default.default.createElement(StyledTabList, Object.assign({
|
|
191
|
-
isVertical: tabsPropGetters.isVertical
|
|
210
|
+
$isVertical: tabsPropGetters.isVertical
|
|
192
211
|
}, tabListProps, props, {
|
|
193
212
|
ref: ref
|
|
194
213
|
}));
|
|
@@ -211,7 +230,7 @@ const TabPanel = React__default.default.forwardRef((_ref, ref) => {
|
|
|
211
230
|
});
|
|
212
231
|
return React__default.default.createElement(StyledTabPanel, Object.assign({
|
|
213
232
|
"aria-hidden": tabsPropGetters.selectedValue !== item,
|
|
214
|
-
isVertical: tabsPropGetters.isVertical
|
|
233
|
+
$isVertical: tabsPropGetters.isVertical
|
|
215
234
|
}, tabPanelProps, otherProps, {
|
|
216
235
|
ref: ref
|
|
217
236
|
}));
|
|
@@ -271,7 +290,7 @@ const TabsComponent = React.forwardRef((_ref, ref) => {
|
|
|
271
290
|
return React__default.default.createElement(TabsContext.Provider, {
|
|
272
291
|
value: contextValue
|
|
273
292
|
}, React__default.default.createElement(StyledTabs, Object.assign({
|
|
274
|
-
isVertical: isVertical
|
|
293
|
+
$isVertical: isVertical
|
|
275
294
|
}, otherProps, {
|
|
276
295
|
ref: ref
|
|
277
296
|
}), children));
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { DefaultTheme } from 'styled-components';
|
|
8
8
|
interface IStyledTabProps {
|
|
9
|
-
isSelected?: boolean;
|
|
10
|
-
isVertical?: boolean;
|
|
9
|
+
$isSelected?: boolean;
|
|
10
|
+
$isVertical?: boolean;
|
|
11
11
|
}
|
|
12
12
|
export declare const StyledTab: import("styled-components").StyledComponent<"div", DefaultTheme, {
|
|
13
13
|
'data-garden-id': string;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { DefaultTheme } from 'styled-components';
|
|
8
8
|
interface IStyledTabListProps {
|
|
9
|
-
isVertical?: boolean;
|
|
9
|
+
$isVertical?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare const StyledTabList: import("styled-components").StyledComponent<"div", DefaultTheme, {
|
|
12
12
|
'data-garden-id': string;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { DefaultTheme } from 'styled-components';
|
|
8
8
|
interface IStyledTabPanelProps {
|
|
9
|
-
isVertical?: boolean;
|
|
9
|
+
$isVertical?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare const StyledTabPanel: import("styled-components").StyledComponent<"div", DefaultTheme, {
|
|
12
12
|
'data-garden-id': string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-tabs",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.15",
|
|
4
4
|
"description": "Components and render prop containers relating to the Garden Design System.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"styled-components": "^5.3.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@zendeskgarden/react-theming": "^9.0.0-next.
|
|
37
|
+
"@zendeskgarden/react-theming": "^9.0.0-next.15"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
40
40
|
"components",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"zendeskgarden:src": "src/index.ts",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "f165ebfd3f53d4cbc2ac788bb3c1cd07348a16de"
|
|
50
50
|
}
|