@zendeskgarden/react-grid 9.0.0-next.9 → 9.1.0
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/Col.js +1 -1
- package/dist/esm/elements/Row.js +1 -1
- package/dist/esm/styled/StyledCol.js +23 -7
- package/dist/esm/styled/StyledGrid.js +25 -9
- package/dist/esm/styled/StyledRow.js +20 -8
- package/dist/esm/styled/pane/StyledPane.js +2 -5
- package/dist/esm/styled/pane/StyledPaneContent.js +3 -6
- package/dist/esm/styled/pane/StyledPaneSplitter.js +41 -24
- package/dist/esm/styled/pane/StyledPaneSplitterButton.js +2 -8
- package/dist/esm/styled/pane/StyledPaneSplitterButtonContainer.js +23 -14
- package/dist/index.cjs.js +149 -90
- package/dist/typings/elements/Grid.d.ts +1 -1
- package/dist/typings/elements/pane/Pane.d.ts +3 -1
- package/dist/typings/styled/pane/StyledPaneSplitterButton.d.ts +0 -1
- package/dist/typings/utils/useGridContext.d.ts +0 -1
- package/dist/typings/utils/usePaneContext.d.ts +0 -1
- package/dist/typings/utils/usePaneProviderContext.d.ts +0 -1
- package/dist/typings/utils/usePaneSplitterContext.d.ts +0 -1
- package/package.json +9 -9
package/dist/esm/elements/Col.js
CHANGED
|
@@ -35,7 +35,7 @@ const Col = React.forwardRef((_ref, ref) => {
|
|
|
35
35
|
ref: ref
|
|
36
36
|
}, props));
|
|
37
37
|
});
|
|
38
|
-
Col.displayName = 'Col';
|
|
38
|
+
Col.displayName = 'Grid.Col';
|
|
39
39
|
Col.propTypes = {
|
|
40
40
|
size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
41
41
|
xs: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.bool]),
|
package/dist/esm/elements/Row.js
CHANGED
|
@@ -6,11 +6,23 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import { retrieveComponentStyles, DEFAULT_THEME,
|
|
9
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'grid.col';
|
|
12
|
-
const colorStyles =
|
|
13
|
-
|
|
12
|
+
const colorStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme
|
|
15
|
+
} = _ref;
|
|
16
|
+
const backgroundColor = getColor({
|
|
17
|
+
theme,
|
|
18
|
+
variable: 'background.primaryEmphasis',
|
|
19
|
+
dark: {
|
|
20
|
+
transparency: theme.opacity[200]
|
|
21
|
+
},
|
|
22
|
+
light: {
|
|
23
|
+
transparency: theme.opacity[100]
|
|
24
|
+
}
|
|
25
|
+
});
|
|
14
26
|
return css(["background-clip:content-box;background-color:", ";"], backgroundColor);
|
|
15
27
|
};
|
|
16
28
|
const flexStyles = (size, alignSelf, textAlign, offset, order, props) => {
|
|
@@ -54,17 +66,21 @@ const flexStyles = (size, alignSelf, textAlign, offset, order, props) => {
|
|
|
54
66
|
const mediaStyles = (minWidth, size, alignSelf, textAlign, offset, order, props) => {
|
|
55
67
|
return css(["@media (min-width:", "){", ";}"], minWidth, flexStyles(size, alignSelf, textAlign, offset, order, props));
|
|
56
68
|
};
|
|
57
|
-
const sizeStyles =
|
|
58
|
-
|
|
69
|
+
const sizeStyles = _ref2 => {
|
|
70
|
+
let {
|
|
71
|
+
theme,
|
|
72
|
+
gutters
|
|
73
|
+
} = _ref2;
|
|
74
|
+
const padding = gutters ? math(`${theme.space[gutters]} / 2`) : 0;
|
|
59
75
|
return css(["padding-right:", ";padding-left:", ";"], padding, padding);
|
|
60
76
|
};
|
|
61
77
|
const StyledCol = styled.div.attrs({
|
|
62
78
|
'data-garden-id': COMPONENT_ID,
|
|
63
|
-
'data-garden-version': '9.
|
|
79
|
+
'data-garden-version': '9.1.0'
|
|
64
80
|
}).withConfig({
|
|
65
81
|
displayName: "StyledCol",
|
|
66
82
|
componentId: "sc-inuw62-0"
|
|
67
|
-
})(["box-sizing:border-box;width:100%;", ";", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles(!props.sizeAll && (props.xs || props.sm || props.md || props.lg || props.xl) ? undefined : props.sizeAll || false, props.alignSelf, props.textAlign, props.offset, props.order, props),
|
|
83
|
+
})(["box-sizing:border-box;width:100%;", ";", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles(!props.sizeAll && (props.xs || props.sm || props.md || props.lg || props.xl) ? undefined : props.sizeAll || false, props.alignSelf, props.textAlign, props.offset, props.order, props), sizeStyles, props => props.debug && colorStyles(props), props => mediaStyles(props.theme.breakpoints.xs, props.xs, props.alignSelfXs, props.textAlignXs, props.offsetXs, props.orderXs, props), props => mediaStyles(props.theme.breakpoints.sm, props.sm, props.alignSelfSm, props.textAlignSm, props.offsetSm, props.orderSm, props), props => mediaStyles(props.theme.breakpoints.md, props.md, props.alignSelfMd, props.textAlignMd, props.offsetMd, props.orderMd, props), props => mediaStyles(props.theme.breakpoints.lg, props.lg, props.alignSelfLg, props.textAlignLg, props.offsetLg, props.orderLg, props), props => mediaStyles(props.theme.breakpoints.xl, props.xl, props.alignSelfXl, props.textAlignXl, props.offsetXl, props.orderXl, props), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
68
84
|
StyledCol.defaultProps = {
|
|
69
85
|
columns: 12,
|
|
70
86
|
theme: DEFAULT_THEME
|
|
@@ -6,25 +6,41 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import { retrieveComponentStyles, DEFAULT_THEME,
|
|
9
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'grid.grid';
|
|
12
|
-
const colorStyles =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const colorStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme,
|
|
15
|
+
debug
|
|
16
|
+
} = _ref;
|
|
17
|
+
const borderColor = debug && getColor({
|
|
18
|
+
theme,
|
|
19
|
+
hue: 'crimson',
|
|
20
|
+
shade: 700,
|
|
21
|
+
transparency: theme.opacity[600]
|
|
22
|
+
});
|
|
23
|
+
const borderWidth = debug && math(`${theme.borderWidths.sm} * 2`);
|
|
24
|
+
return css(["color-scheme:only ", ";box-shadow:", ";"], theme.colors.base, debug && `
|
|
25
|
+
-${borderWidth} 0 0 0 ${borderColor},
|
|
26
|
+
${borderWidth} 0 0 0 ${borderColor}
|
|
27
|
+
`);
|
|
16
28
|
};
|
|
17
|
-
const sizeStyles =
|
|
18
|
-
|
|
29
|
+
const sizeStyles = _ref2 => {
|
|
30
|
+
let {
|
|
31
|
+
theme,
|
|
32
|
+
gutters
|
|
33
|
+
} = _ref2;
|
|
34
|
+
const padding = gutters ? math(`${theme.space[gutters]} / 2`) : 0;
|
|
19
35
|
return css(["padding-right:", ";padding-left:", ";"], padding, padding);
|
|
20
36
|
};
|
|
21
37
|
const StyledGrid = styled.div.attrs({
|
|
22
38
|
'data-garden-id': COMPONENT_ID,
|
|
23
|
-
'data-garden-version': '9.
|
|
39
|
+
'data-garden-version': '9.1.0'
|
|
24
40
|
}).withConfig({
|
|
25
41
|
displayName: "StyledGrid",
|
|
26
42
|
componentId: "sc-oxgg5i-0"
|
|
27
|
-
})(["direction:", ";margin-right:auto;margin-left:auto;width:100%;box-sizing:border-box;", ";", ";", ";"], props => props.theme.rtl && 'rtl',
|
|
43
|
+
})(["direction:", ";margin-right:auto;margin-left:auto;width:100%;box-sizing:border-box;", ";", ";", ";"], props => props.theme.rtl && 'rtl', sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
28
44
|
StyledGrid.defaultProps = {
|
|
29
45
|
gutters: 'md',
|
|
30
46
|
theme: DEFAULT_THEME
|
|
@@ -6,12 +6,20 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import { retrieveComponentStyles, DEFAULT_THEME,
|
|
9
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'grid.row';
|
|
12
|
-
const colorStyles =
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const colorStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme
|
|
15
|
+
} = _ref;
|
|
16
|
+
const borderColor = getColor({
|
|
17
|
+
theme,
|
|
18
|
+
hue: 'mint',
|
|
19
|
+
shade: 700,
|
|
20
|
+
transparency: theme.opacity[600]
|
|
21
|
+
});
|
|
22
|
+
const borderWidth = theme.borderWidths.sm;
|
|
15
23
|
return css(["box-shadow:inset 0 ", " 0 0 ", ",inset 0 -", " 0 0 ", ";"], borderWidth, borderColor, borderWidth, borderColor);
|
|
16
24
|
};
|
|
17
25
|
const flexStyles = (alignItems, justifyContent, wrap) => {
|
|
@@ -34,17 +42,21 @@ const flexStyles = (alignItems, justifyContent, wrap) => {
|
|
|
34
42
|
const mediaStyles = (minWidth, alignItems, justifyContent, wrap) => {
|
|
35
43
|
return css(["@media (min-width:", "){", ";}"], minWidth, flexStyles(alignItems, justifyContent, wrap));
|
|
36
44
|
};
|
|
37
|
-
const sizeStyles =
|
|
38
|
-
|
|
45
|
+
const sizeStyles = _ref2 => {
|
|
46
|
+
let {
|
|
47
|
+
theme,
|
|
48
|
+
gutters
|
|
49
|
+
} = _ref2;
|
|
50
|
+
const margin = gutters ? math(`${theme.space[gutters]} / 2`) : 0;
|
|
39
51
|
return css(["margin-right:-", ";margin-left:-", ";"], margin, margin);
|
|
40
52
|
};
|
|
41
53
|
const StyledRow = styled.div.attrs({
|
|
42
54
|
'data-garden-id': COMPONENT_ID,
|
|
43
|
-
'data-garden-version': '9.
|
|
55
|
+
'data-garden-version': '9.1.0'
|
|
44
56
|
}).withConfig({
|
|
45
57
|
displayName: "StyledRow",
|
|
46
58
|
componentId: "sc-xjsdg1-0"
|
|
47
|
-
})(["display:flex;box-sizing:border-box;", " ", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles(props.alignItems, props.justifyContent, props.wrapAll),
|
|
59
|
+
})(["display:flex;box-sizing:border-box;", " ", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles(props.alignItems, props.justifyContent, props.wrapAll), sizeStyles, props => props.debug && colorStyles(props), props => mediaStyles(props.theme.breakpoints.xs, props.alignItemsXs, props.justifyContentXs, props.wrapXs), props => mediaStyles(props.theme.breakpoints.sm, props.alignItemsSm, props.justifyContentSm, props.wrapSm), props => mediaStyles(props.theme.breakpoints.md, props.alignItemsMd, props.justifyContentMd, props.wrapMd), props => mediaStyles(props.theme.breakpoints.lg, props.alignItemsLg, props.justifyContentLg, props.wrapLg), props => mediaStyles(props.theme.breakpoints.xl, props.alignItemsXl, props.justifyContentXl, props.wrapXl), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
48
60
|
StyledRow.defaultProps = {
|
|
49
61
|
wrapAll: 'wrap',
|
|
50
62
|
theme: DEFAULT_THEME
|
|
@@ -5,18 +5,15 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'pane';
|
|
11
11
|
const StyledPane = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.
|
|
13
|
+
'data-garden-version': '9.1.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledPane",
|
|
16
16
|
componentId: "sc-1ltjst7-0"
|
|
17
17
|
})(["position:relative;min-width:0;min-height:0;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledPane.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
21
18
|
|
|
22
19
|
export { StyledPane };
|
|
@@ -5,18 +5,15 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'pane.content';
|
|
11
11
|
const StyledPaneContent = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.
|
|
13
|
+
'data-garden-version': '9.1.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledPaneContent",
|
|
16
16
|
componentId: "sc-1b38mbh-0"
|
|
17
|
-
})(["height:100%;overflow:auto;&[hidden]{display:none;}", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledPaneContent.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
17
|
+
})(["height:100%;overflow:auto;color-scheme:only ", ";&[hidden]{display:none;}", ";"], p => p.theme.colors.base, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
21
18
|
|
|
22
19
|
export { StyledPaneContent };
|
|
@@ -6,27 +6,47 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import { SELECTOR_FOCUS_VISIBLE, retrieveComponentStyles,
|
|
9
|
+
import { SELECTOR_FOCUS_VISIBLE, retrieveComponentStyles, getColor, focusStyles } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'pane.splitter';
|
|
12
|
-
const colorStyles =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
theme
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
const colorStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme
|
|
15
|
+
} = _ref;
|
|
16
|
+
const color = getColor({
|
|
17
|
+
theme,
|
|
18
|
+
variable: 'border.default'
|
|
19
|
+
});
|
|
20
|
+
const options = {
|
|
21
|
+
theme,
|
|
22
|
+
variable: 'border.primaryEmphasis'
|
|
23
|
+
};
|
|
24
|
+
const hoverColor = getColor(options);
|
|
25
|
+
const activeColor = getColor({
|
|
26
|
+
...options,
|
|
27
|
+
dark: {
|
|
28
|
+
offset: -200
|
|
20
29
|
},
|
|
30
|
+
light: {
|
|
31
|
+
offset: 200
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return css(["&::before{background-color:", ";}&:hover::before{background-color:", ";}", " &:active::before{background-color:", ";}"], color, hoverColor, focusStyles({
|
|
35
|
+
theme,
|
|
21
36
|
styles: {
|
|
22
37
|
backgroundColor: hoverColor
|
|
23
38
|
},
|
|
24
39
|
selector: '&:focus-visible::before'
|
|
25
40
|
}), activeColor);
|
|
26
41
|
};
|
|
27
|
-
const sizeStyles =
|
|
28
|
-
|
|
29
|
-
|
|
42
|
+
const sizeStyles = _ref2 => {
|
|
43
|
+
let {
|
|
44
|
+
theme,
|
|
45
|
+
orientation,
|
|
46
|
+
isFixed
|
|
47
|
+
} = _ref2;
|
|
48
|
+
const size = math(`${theme.shadowWidths.md} * 2`);
|
|
49
|
+
const separatorSize = math(`${theme.borderWidths.sm} * 2`);
|
|
30
50
|
const offset = math(`-${size} / 2`);
|
|
31
51
|
let cursor;
|
|
32
52
|
let top;
|
|
@@ -37,14 +57,14 @@ const sizeStyles = props => {
|
|
|
37
57
|
let height;
|
|
38
58
|
let separatorWidth;
|
|
39
59
|
let separatorHeight;
|
|
40
|
-
switch (
|
|
60
|
+
switch (orientation) {
|
|
41
61
|
case 'top':
|
|
42
62
|
cursor = 'row-resize';
|
|
43
63
|
top = offset;
|
|
44
64
|
width = '100%';
|
|
45
65
|
height = size;
|
|
46
66
|
separatorWidth = width;
|
|
47
|
-
separatorHeight =
|
|
67
|
+
separatorHeight = theme.borderWidths.sm;
|
|
48
68
|
break;
|
|
49
69
|
case 'bottom':
|
|
50
70
|
cursor = 'row-resize';
|
|
@@ -52,16 +72,16 @@ const sizeStyles = props => {
|
|
|
52
72
|
width = '100%';
|
|
53
73
|
height = size;
|
|
54
74
|
separatorWidth = width;
|
|
55
|
-
separatorHeight =
|
|
75
|
+
separatorHeight = theme.borderWidths.sm;
|
|
56
76
|
break;
|
|
57
77
|
case 'start':
|
|
58
78
|
cursor = 'col-resize';
|
|
59
79
|
top = 0;
|
|
60
80
|
width = size;
|
|
61
81
|
height = '100%';
|
|
62
|
-
separatorWidth =
|
|
82
|
+
separatorWidth = theme.borderWidths.sm;
|
|
63
83
|
separatorHeight = height;
|
|
64
|
-
if (
|
|
84
|
+
if (theme.rtl) {
|
|
65
85
|
right = offset;
|
|
66
86
|
} else {
|
|
67
87
|
left = offset;
|
|
@@ -73,9 +93,9 @@ const sizeStyles = props => {
|
|
|
73
93
|
top = 0;
|
|
74
94
|
width = size;
|
|
75
95
|
height = '100%';
|
|
76
|
-
separatorWidth =
|
|
96
|
+
separatorWidth = theme.borderWidths.sm;
|
|
77
97
|
separatorHeight = height;
|
|
78
|
-
if (
|
|
98
|
+
if (theme.rtl) {
|
|
79
99
|
left = offset;
|
|
80
100
|
} else {
|
|
81
101
|
right = offset;
|
|
@@ -83,17 +103,14 @@ const sizeStyles = props => {
|
|
|
83
103
|
break;
|
|
84
104
|
}
|
|
85
105
|
const dimensionProperty = width === '100%' ? 'height' : 'width';
|
|
86
|
-
return css(["top:", ";right:", ";bottom:", ";left:", ";cursor:", ";width:", ";height:", ";&::before{width:", ";height:", ";}&:hover::before{", ":", ";}&:focus::before,&:focus-visible::before{", ":", ";}&:focus-visible::before{border-radius:", ";}"], top, right, bottom, left,
|
|
106
|
+
return css(["top:", ";right:", ";bottom:", ";left:", ";cursor:", ";width:", ";height:", ";&::before{width:", ";height:", ";}&:hover::before{", ":", ";}&:focus::before,&:focus-visible::before{", ":", ";}&:focus-visible::before{border-radius:", ";}"], top, right, bottom, left, isFixed ? 'pointer' : cursor, width, height, separatorWidth, separatorHeight, dimensionProperty, separatorSize, dimensionProperty, separatorSize, theme.borderRadii.md);
|
|
87
107
|
};
|
|
88
108
|
const StyledPaneSplitter = styled.div.attrs({
|
|
89
109
|
'data-garden-id': COMPONENT_ID,
|
|
90
|
-
'data-garden-version': '9.
|
|
110
|
+
'data-garden-version': '9.1.0'
|
|
91
111
|
}).withConfig({
|
|
92
112
|
displayName: "StyledPaneSplitter",
|
|
93
113
|
componentId: "sc-jylemn-0"
|
|
94
114
|
})(["display:flex;position:absolute;align-items:center;justify-content:center;z-index:1;user-select:none;", ";", "{z-index:2;}&::before{position:absolute;transition:box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out;z-index:-1;content:'';}", ";", ";"], sizeStyles, SELECTOR_FOCUS_VISIBLE, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
95
|
-
StyledPaneSplitter.defaultProps = {
|
|
96
|
-
theme: DEFAULT_THEME
|
|
97
|
-
};
|
|
98
115
|
|
|
99
116
|
export { StyledPaneSplitter };
|
|
@@ -5,10 +5,8 @@
|
|
|
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 } from '@zendeskgarden/react-theming';
|
|
9
8
|
import { ChevronButton } from '@zendeskgarden/react-buttons';
|
|
10
9
|
|
|
11
|
-
const COMPONENT_ID = 'pane.splitter_button';
|
|
12
10
|
const getSize = theme => theme.space.base * 6;
|
|
13
11
|
const sizeStyles = _ref => {
|
|
14
12
|
let {
|
|
@@ -32,17 +30,13 @@ const transformStyles = props => {
|
|
|
32
30
|
return css(["& > svg{transform:rotate(", "deg);}"], degrees);
|
|
33
31
|
};
|
|
34
32
|
const StyledPaneSplitterButton = styled(ChevronButton).attrs({
|
|
35
|
-
'data-garden-
|
|
36
|
-
'data-garden-version': '9.0.0-next.9',
|
|
33
|
+
'data-garden-version': '9.1.0',
|
|
37
34
|
isBasic: true,
|
|
38
35
|
isPill: true,
|
|
39
36
|
size: 'small'
|
|
40
37
|
}).withConfig({
|
|
41
38
|
displayName: "StyledPaneSplitterButton",
|
|
42
39
|
componentId: "sc-zh032e-0"
|
|
43
|
-
})(["", ";", ";"
|
|
44
|
-
StyledPaneSplitterButton.defaultProps = {
|
|
45
|
-
theme: DEFAULT_THEME
|
|
46
|
-
};
|
|
40
|
+
})(["", ";", ";"], sizeStyles, transformStyles);
|
|
47
41
|
|
|
48
42
|
export { StyledPaneSplitterButton, getSize };
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { stripUnit, math } from 'polished';
|
|
9
|
-
import { retrieveComponentStyles,
|
|
9
|
+
import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
import { StyledPaneSplitter } from './StyledPaneSplitter.js';
|
|
11
11
|
import { getSize } from './StyledPaneSplitterButton.js';
|
|
12
12
|
|
|
@@ -15,20 +15,32 @@ const colorStyles = _ref => {
|
|
|
15
15
|
let {
|
|
16
16
|
theme
|
|
17
17
|
} = _ref;
|
|
18
|
-
const backgroundColor =
|
|
19
|
-
|
|
18
|
+
const backgroundColor = getColor({
|
|
19
|
+
theme,
|
|
20
|
+
variable: 'background.raised'
|
|
21
|
+
});
|
|
22
|
+
const boxShadow = theme.shadows.lg(`${theme.space.base}px`, `${theme.space.base * 2}px`, getColor({
|
|
23
|
+
variable: 'shadow.small',
|
|
24
|
+
theme
|
|
25
|
+
}));
|
|
20
26
|
return css(["box-shadow:", ";background-color:", ";"], boxShadow, backgroundColor);
|
|
21
27
|
};
|
|
22
|
-
const positionStyles =
|
|
28
|
+
const positionStyles = _ref2 => {
|
|
29
|
+
let {
|
|
30
|
+
theme,
|
|
31
|
+
placement,
|
|
32
|
+
splitterSize,
|
|
33
|
+
orientation
|
|
34
|
+
} = _ref2;
|
|
23
35
|
let top;
|
|
24
36
|
let left;
|
|
25
37
|
let right;
|
|
26
38
|
let bottom;
|
|
27
|
-
const size = getSize(
|
|
39
|
+
const size = getSize(theme);
|
|
28
40
|
const inset = `-${size / 2}px`;
|
|
29
|
-
if (
|
|
30
|
-
const center = `${
|
|
31
|
-
switch (`${
|
|
41
|
+
if (placement === 'center' || splitterSize < size * 3) {
|
|
42
|
+
const center = `${splitterSize / 2 - size / 2}px`;
|
|
43
|
+
switch (`${orientation}-${theme.rtl ? 'rtl' : 'ltr'}`) {
|
|
32
44
|
case 'top-ltr':
|
|
33
45
|
case 'top-rtl':
|
|
34
46
|
top = inset;
|
|
@@ -52,7 +64,7 @@ const positionStyles = props => {
|
|
|
52
64
|
}
|
|
53
65
|
} else {
|
|
54
66
|
const offset = `${size}px`;
|
|
55
|
-
switch (`${
|
|
67
|
+
switch (`${orientation}-${placement}-${theme.rtl ? 'rtl' : 'ltr'}`) {
|
|
56
68
|
case 'top-end-ltr':
|
|
57
69
|
case 'top-end-rtl':
|
|
58
70
|
case 'top-start-rtl':
|
|
@@ -97,10 +109,10 @@ const positionStyles = props => {
|
|
|
97
109
|
}
|
|
98
110
|
return css(["top:", ";right:", ";bottom:", ";left:", ";"], top, right, bottom, left);
|
|
99
111
|
};
|
|
100
|
-
const sizeStyles =
|
|
112
|
+
const sizeStyles = _ref3 => {
|
|
101
113
|
let {
|
|
102
114
|
theme
|
|
103
|
-
} =
|
|
115
|
+
} = _ref3;
|
|
104
116
|
const size = getSize(theme);
|
|
105
117
|
return css(["border-radius:", "px;width:", "px;height:", "px;"], size, size, size);
|
|
106
118
|
};
|
|
@@ -109,8 +121,5 @@ const StyledPaneSplitterButtonContainer = styled.div.withConfig({
|
|
|
109
121
|
displayName: "StyledPaneSplitterButtonContainer",
|
|
110
122
|
componentId: "sc-1w84y62-0"
|
|
111
123
|
})(["display:", ";position:absolute;transition:box-shadow 0.1s ease-in-out,opacity 0.25s ease-in-out 0.1s;opacity:0;z-index:2;", ";", ";", ";&:hover,&:focus-within,", ":hover ~ &,", ":focus-visible ~ &{opacity:1;}", ";"], props => props.splitterSize <= minimumSplitterSize(props.theme) ? 'none' : undefined, positionStyles, sizeStyles, colorStyles, StyledPaneSplitter, StyledPaneSplitter, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
112
|
-
StyledPaneSplitterButtonContainer.defaultProps = {
|
|
113
|
-
theme: DEFAULT_THEME
|
|
114
|
-
};
|
|
115
124
|
|
|
116
125
|
export { StyledPaneSplitterButtonContainer };
|
package/dist/index.cjs.js
CHANGED
|
@@ -34,9 +34,21 @@ const SPACE = [false, 'xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
|
|
|
34
34
|
const WRAP = ['nowrap', 'wrap', 'wrap-reverse'];
|
|
35
35
|
const ORIENTATION = ['top', 'bottom', 'start', 'end'];
|
|
36
36
|
|
|
37
|
-
const COMPONENT_ID$
|
|
38
|
-
const colorStyles$4 =
|
|
39
|
-
|
|
37
|
+
const COMPONENT_ID$6 = 'grid.col';
|
|
38
|
+
const colorStyles$4 = _ref => {
|
|
39
|
+
let {
|
|
40
|
+
theme
|
|
41
|
+
} = _ref;
|
|
42
|
+
const backgroundColor = reactTheming.getColor({
|
|
43
|
+
theme,
|
|
44
|
+
variable: 'background.primaryEmphasis',
|
|
45
|
+
dark: {
|
|
46
|
+
transparency: theme.opacity[200]
|
|
47
|
+
},
|
|
48
|
+
light: {
|
|
49
|
+
transparency: theme.opacity[100]
|
|
50
|
+
}
|
|
51
|
+
});
|
|
40
52
|
return styled.css(["background-clip:content-box;background-color:", ";"], backgroundColor);
|
|
41
53
|
};
|
|
42
54
|
const flexStyles$1 = (size, alignSelf, textAlign, offset, order, props) => {
|
|
@@ -80,48 +92,76 @@ const flexStyles$1 = (size, alignSelf, textAlign, offset, order, props) => {
|
|
|
80
92
|
const mediaStyles$1 = (minWidth, size, alignSelf, textAlign, offset, order, props) => {
|
|
81
93
|
return styled.css(["@media (min-width:", "){", ";}"], minWidth, flexStyles$1(size, alignSelf, textAlign, offset, order, props));
|
|
82
94
|
};
|
|
83
|
-
const sizeStyles$5 =
|
|
84
|
-
|
|
95
|
+
const sizeStyles$5 = _ref2 => {
|
|
96
|
+
let {
|
|
97
|
+
theme,
|
|
98
|
+
gutters
|
|
99
|
+
} = _ref2;
|
|
100
|
+
const padding = gutters ? polished.math(`${theme.space[gutters]} / 2`) : 0;
|
|
85
101
|
return styled.css(["padding-right:", ";padding-left:", ";"], padding, padding);
|
|
86
102
|
};
|
|
87
103
|
const StyledCol = styled__default.default.div.attrs({
|
|
88
|
-
'data-garden-id': COMPONENT_ID$
|
|
89
|
-
'data-garden-version': '9.
|
|
104
|
+
'data-garden-id': COMPONENT_ID$6,
|
|
105
|
+
'data-garden-version': '9.1.0'
|
|
90
106
|
}).withConfig({
|
|
91
107
|
displayName: "StyledCol",
|
|
92
108
|
componentId: "sc-inuw62-0"
|
|
93
|
-
})(["box-sizing:border-box;width:100%;", ";", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles$1(!props.sizeAll && (props.xs || props.sm || props.md || props.lg || props.xl) ? undefined : props.sizeAll || false, props.alignSelf, props.textAlign, props.offset, props.order, props),
|
|
109
|
+
})(["box-sizing:border-box;width:100%;", ";", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles$1(!props.sizeAll && (props.xs || props.sm || props.md || props.lg || props.xl) ? undefined : props.sizeAll || false, props.alignSelf, props.textAlign, props.offset, props.order, props), sizeStyles$5, props => props.debug && colorStyles$4(props), props => mediaStyles$1(props.theme.breakpoints.xs, props.xs, props.alignSelfXs, props.textAlignXs, props.offsetXs, props.orderXs, props), props => mediaStyles$1(props.theme.breakpoints.sm, props.sm, props.alignSelfSm, props.textAlignSm, props.offsetSm, props.orderSm, props), props => mediaStyles$1(props.theme.breakpoints.md, props.md, props.alignSelfMd, props.textAlignMd, props.offsetMd, props.orderMd, props), props => mediaStyles$1(props.theme.breakpoints.lg, props.lg, props.alignSelfLg, props.textAlignLg, props.offsetLg, props.orderLg, props), props => mediaStyles$1(props.theme.breakpoints.xl, props.xl, props.alignSelfXl, props.textAlignXl, props.offsetXl, props.orderXl, props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
94
110
|
StyledCol.defaultProps = {
|
|
95
111
|
columns: 12,
|
|
96
112
|
theme: reactTheming.DEFAULT_THEME
|
|
97
113
|
};
|
|
98
114
|
|
|
99
|
-
const COMPONENT_ID$
|
|
100
|
-
const colorStyles$3 =
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
};
|
|
105
|
-
const
|
|
106
|
-
|
|
115
|
+
const COMPONENT_ID$5 = 'grid.grid';
|
|
116
|
+
const colorStyles$3 = _ref => {
|
|
117
|
+
let {
|
|
118
|
+
theme,
|
|
119
|
+
debug
|
|
120
|
+
} = _ref;
|
|
121
|
+
const borderColor = debug && reactTheming.getColor({
|
|
122
|
+
theme,
|
|
123
|
+
hue: 'crimson',
|
|
124
|
+
shade: 700,
|
|
125
|
+
transparency: theme.opacity[600]
|
|
126
|
+
});
|
|
127
|
+
const borderWidth = debug && polished.math(`${theme.borderWidths.sm} * 2`);
|
|
128
|
+
return styled.css(["color-scheme:only ", ";box-shadow:", ";"], theme.colors.base, debug && `
|
|
129
|
+
-${borderWidth} 0 0 0 ${borderColor},
|
|
130
|
+
${borderWidth} 0 0 0 ${borderColor}
|
|
131
|
+
`);
|
|
132
|
+
};
|
|
133
|
+
const sizeStyles$4 = _ref2 => {
|
|
134
|
+
let {
|
|
135
|
+
theme,
|
|
136
|
+
gutters
|
|
137
|
+
} = _ref2;
|
|
138
|
+
const padding = gutters ? polished.math(`${theme.space[gutters]} / 2`) : 0;
|
|
107
139
|
return styled.css(["padding-right:", ";padding-left:", ";"], padding, padding);
|
|
108
140
|
};
|
|
109
141
|
const StyledGrid = styled__default.default.div.attrs({
|
|
110
|
-
'data-garden-id': COMPONENT_ID$
|
|
111
|
-
'data-garden-version': '9.
|
|
142
|
+
'data-garden-id': COMPONENT_ID$5,
|
|
143
|
+
'data-garden-version': '9.1.0'
|
|
112
144
|
}).withConfig({
|
|
113
145
|
displayName: "StyledGrid",
|
|
114
146
|
componentId: "sc-oxgg5i-0"
|
|
115
|
-
})(["direction:", ";margin-right:auto;margin-left:auto;width:100%;box-sizing:border-box;", ";", ";", ";"], props => props.theme.rtl && 'rtl',
|
|
147
|
+
})(["direction:", ";margin-right:auto;margin-left:auto;width:100%;box-sizing:border-box;", ";", ";", ";"], props => props.theme.rtl && 'rtl', sizeStyles$4, colorStyles$3, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
116
148
|
StyledGrid.defaultProps = {
|
|
117
149
|
gutters: 'md',
|
|
118
150
|
theme: reactTheming.DEFAULT_THEME
|
|
119
151
|
};
|
|
120
152
|
|
|
121
|
-
const COMPONENT_ID$
|
|
122
|
-
const colorStyles$2 =
|
|
123
|
-
|
|
124
|
-
|
|
153
|
+
const COMPONENT_ID$4 = 'grid.row';
|
|
154
|
+
const colorStyles$2 = _ref => {
|
|
155
|
+
let {
|
|
156
|
+
theme
|
|
157
|
+
} = _ref;
|
|
158
|
+
const borderColor = reactTheming.getColor({
|
|
159
|
+
theme,
|
|
160
|
+
hue: 'mint',
|
|
161
|
+
shade: 700,
|
|
162
|
+
transparency: theme.opacity[600]
|
|
163
|
+
});
|
|
164
|
+
const borderWidth = theme.borderWidths.sm;
|
|
125
165
|
return styled.css(["box-shadow:inset 0 ", " 0 0 ", ",inset 0 -", " 0 0 ", ";"], borderWidth, borderColor, borderWidth, borderColor);
|
|
126
166
|
};
|
|
127
167
|
const flexStyles = (alignItems, justifyContent, wrap) => {
|
|
@@ -144,65 +184,83 @@ const flexStyles = (alignItems, justifyContent, wrap) => {
|
|
|
144
184
|
const mediaStyles = (minWidth, alignItems, justifyContent, wrap) => {
|
|
145
185
|
return styled.css(["@media (min-width:", "){", ";}"], minWidth, flexStyles(alignItems, justifyContent, wrap));
|
|
146
186
|
};
|
|
147
|
-
const sizeStyles$3 =
|
|
148
|
-
|
|
187
|
+
const sizeStyles$3 = _ref2 => {
|
|
188
|
+
let {
|
|
189
|
+
theme,
|
|
190
|
+
gutters
|
|
191
|
+
} = _ref2;
|
|
192
|
+
const margin = gutters ? polished.math(`${theme.space[gutters]} / 2`) : 0;
|
|
149
193
|
return styled.css(["margin-right:-", ";margin-left:-", ";"], margin, margin);
|
|
150
194
|
};
|
|
151
195
|
const StyledRow = styled__default.default.div.attrs({
|
|
152
|
-
'data-garden-id': COMPONENT_ID$
|
|
153
|
-
'data-garden-version': '9.
|
|
196
|
+
'data-garden-id': COMPONENT_ID$4,
|
|
197
|
+
'data-garden-version': '9.1.0'
|
|
154
198
|
}).withConfig({
|
|
155
199
|
displayName: "StyledRow",
|
|
156
200
|
componentId: "sc-xjsdg1-0"
|
|
157
|
-
})(["display:flex;box-sizing:border-box;", " ", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles(props.alignItems, props.justifyContent, props.wrapAll),
|
|
201
|
+
})(["display:flex;box-sizing:border-box;", " ", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles(props.alignItems, props.justifyContent, props.wrapAll), sizeStyles$3, props => props.debug && colorStyles$2(props), props => mediaStyles(props.theme.breakpoints.xs, props.alignItemsXs, props.justifyContentXs, props.wrapXs), props => mediaStyles(props.theme.breakpoints.sm, props.alignItemsSm, props.justifyContentSm, props.wrapSm), props => mediaStyles(props.theme.breakpoints.md, props.alignItemsMd, props.justifyContentMd, props.wrapMd), props => mediaStyles(props.theme.breakpoints.lg, props.alignItemsLg, props.justifyContentLg, props.wrapLg), props => mediaStyles(props.theme.breakpoints.xl, props.alignItemsXl, props.justifyContentXl, props.wrapXl), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
158
202
|
StyledRow.defaultProps = {
|
|
159
203
|
wrapAll: 'wrap',
|
|
160
204
|
theme: reactTheming.DEFAULT_THEME
|
|
161
205
|
};
|
|
162
206
|
|
|
163
|
-
const COMPONENT_ID$
|
|
207
|
+
const COMPONENT_ID$3 = 'pane';
|
|
164
208
|
const StyledPane = styled__default.default.div.attrs({
|
|
165
|
-
'data-garden-id': COMPONENT_ID$
|
|
166
|
-
'data-garden-version': '9.
|
|
209
|
+
'data-garden-id': COMPONENT_ID$3,
|
|
210
|
+
'data-garden-version': '9.1.0'
|
|
167
211
|
}).withConfig({
|
|
168
212
|
displayName: "StyledPane",
|
|
169
213
|
componentId: "sc-1ltjst7-0"
|
|
170
|
-
})(["position:relative;min-width:0;min-height:0;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$
|
|
171
|
-
StyledPane.defaultProps = {
|
|
172
|
-
theme: reactTheming.DEFAULT_THEME
|
|
173
|
-
};
|
|
214
|
+
})(["position:relative;min-width:0;min-height:0;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
174
215
|
|
|
175
|
-
const COMPONENT_ID$
|
|
216
|
+
const COMPONENT_ID$2 = 'pane.content';
|
|
176
217
|
const StyledPaneContent = styled__default.default.div.attrs({
|
|
177
|
-
'data-garden-id': COMPONENT_ID$
|
|
178
|
-
'data-garden-version': '9.
|
|
218
|
+
'data-garden-id': COMPONENT_ID$2,
|
|
219
|
+
'data-garden-version': '9.1.0'
|
|
179
220
|
}).withConfig({
|
|
180
221
|
displayName: "StyledPaneContent",
|
|
181
222
|
componentId: "sc-1b38mbh-0"
|
|
182
|
-
})(["height:100%;overflow:auto;&[hidden]{display:none;}", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$
|
|
183
|
-
StyledPaneContent.defaultProps = {
|
|
184
|
-
theme: reactTheming.DEFAULT_THEME
|
|
185
|
-
};
|
|
223
|
+
})(["height:100%;overflow:auto;color-scheme:only ", ";&[hidden]{display:none;}", ";"], p => p.theme.colors.base, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
186
224
|
|
|
187
|
-
const COMPONENT_ID$
|
|
188
|
-
const colorStyles$1 =
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
theme
|
|
194
|
-
|
|
195
|
-
|
|
225
|
+
const COMPONENT_ID$1 = 'pane.splitter';
|
|
226
|
+
const colorStyles$1 = _ref => {
|
|
227
|
+
let {
|
|
228
|
+
theme
|
|
229
|
+
} = _ref;
|
|
230
|
+
const color = reactTheming.getColor({
|
|
231
|
+
theme,
|
|
232
|
+
variable: 'border.default'
|
|
233
|
+
});
|
|
234
|
+
const options = {
|
|
235
|
+
theme,
|
|
236
|
+
variable: 'border.primaryEmphasis'
|
|
237
|
+
};
|
|
238
|
+
const hoverColor = reactTheming.getColor(options);
|
|
239
|
+
const activeColor = reactTheming.getColor({
|
|
240
|
+
...options,
|
|
241
|
+
dark: {
|
|
242
|
+
offset: -200
|
|
196
243
|
},
|
|
244
|
+
light: {
|
|
245
|
+
offset: 200
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
return styled.css(["&::before{background-color:", ";}&:hover::before{background-color:", ";}", " &:active::before{background-color:", ";}"], color, hoverColor, reactTheming.focusStyles({
|
|
249
|
+
theme,
|
|
197
250
|
styles: {
|
|
198
251
|
backgroundColor: hoverColor
|
|
199
252
|
},
|
|
200
253
|
selector: '&:focus-visible::before'
|
|
201
254
|
}), activeColor);
|
|
202
255
|
};
|
|
203
|
-
const sizeStyles$2 =
|
|
204
|
-
|
|
205
|
-
|
|
256
|
+
const sizeStyles$2 = _ref2 => {
|
|
257
|
+
let {
|
|
258
|
+
theme,
|
|
259
|
+
orientation,
|
|
260
|
+
isFixed
|
|
261
|
+
} = _ref2;
|
|
262
|
+
const size = polished.math(`${theme.shadowWidths.md} * 2`);
|
|
263
|
+
const separatorSize = polished.math(`${theme.borderWidths.sm} * 2`);
|
|
206
264
|
const offset = polished.math(`-${size} / 2`);
|
|
207
265
|
let cursor;
|
|
208
266
|
let top;
|
|
@@ -213,14 +271,14 @@ const sizeStyles$2 = props => {
|
|
|
213
271
|
let height;
|
|
214
272
|
let separatorWidth;
|
|
215
273
|
let separatorHeight;
|
|
216
|
-
switch (
|
|
274
|
+
switch (orientation) {
|
|
217
275
|
case 'top':
|
|
218
276
|
cursor = 'row-resize';
|
|
219
277
|
top = offset;
|
|
220
278
|
width = '100%';
|
|
221
279
|
height = size;
|
|
222
280
|
separatorWidth = width;
|
|
223
|
-
separatorHeight =
|
|
281
|
+
separatorHeight = theme.borderWidths.sm;
|
|
224
282
|
break;
|
|
225
283
|
case 'bottom':
|
|
226
284
|
cursor = 'row-resize';
|
|
@@ -228,16 +286,16 @@ const sizeStyles$2 = props => {
|
|
|
228
286
|
width = '100%';
|
|
229
287
|
height = size;
|
|
230
288
|
separatorWidth = width;
|
|
231
|
-
separatorHeight =
|
|
289
|
+
separatorHeight = theme.borderWidths.sm;
|
|
232
290
|
break;
|
|
233
291
|
case 'start':
|
|
234
292
|
cursor = 'col-resize';
|
|
235
293
|
top = 0;
|
|
236
294
|
width = size;
|
|
237
295
|
height = '100%';
|
|
238
|
-
separatorWidth =
|
|
296
|
+
separatorWidth = theme.borderWidths.sm;
|
|
239
297
|
separatorHeight = height;
|
|
240
|
-
if (
|
|
298
|
+
if (theme.rtl) {
|
|
241
299
|
right = offset;
|
|
242
300
|
} else {
|
|
243
301
|
left = offset;
|
|
@@ -249,9 +307,9 @@ const sizeStyles$2 = props => {
|
|
|
249
307
|
top = 0;
|
|
250
308
|
width = size;
|
|
251
309
|
height = '100%';
|
|
252
|
-
separatorWidth =
|
|
310
|
+
separatorWidth = theme.borderWidths.sm;
|
|
253
311
|
separatorHeight = height;
|
|
254
|
-
if (
|
|
312
|
+
if (theme.rtl) {
|
|
255
313
|
left = offset;
|
|
256
314
|
} else {
|
|
257
315
|
right = offset;
|
|
@@ -259,20 +317,16 @@ const sizeStyles$2 = props => {
|
|
|
259
317
|
break;
|
|
260
318
|
}
|
|
261
319
|
const dimensionProperty = width === '100%' ? 'height' : 'width';
|
|
262
|
-
return styled.css(["top:", ";right:", ";bottom:", ";left:", ";cursor:", ";width:", ";height:", ";&::before{width:", ";height:", ";}&:hover::before{", ":", ";}&:focus::before,&:focus-visible::before{", ":", ";}&:focus-visible::before{border-radius:", ";}"], top, right, bottom, left,
|
|
320
|
+
return styled.css(["top:", ";right:", ";bottom:", ";left:", ";cursor:", ";width:", ";height:", ";&::before{width:", ";height:", ";}&:hover::before{", ":", ";}&:focus::before,&:focus-visible::before{", ":", ";}&:focus-visible::before{border-radius:", ";}"], top, right, bottom, left, isFixed ? 'pointer' : cursor, width, height, separatorWidth, separatorHeight, dimensionProperty, separatorSize, dimensionProperty, separatorSize, theme.borderRadii.md);
|
|
263
321
|
};
|
|
264
322
|
const StyledPaneSplitter = styled__default.default.div.attrs({
|
|
265
|
-
'data-garden-id': COMPONENT_ID$
|
|
266
|
-
'data-garden-version': '9.
|
|
323
|
+
'data-garden-id': COMPONENT_ID$1,
|
|
324
|
+
'data-garden-version': '9.1.0'
|
|
267
325
|
}).withConfig({
|
|
268
326
|
displayName: "StyledPaneSplitter",
|
|
269
327
|
componentId: "sc-jylemn-0"
|
|
270
|
-
})(["display:flex;position:absolute;align-items:center;justify-content:center;z-index:1;user-select:none;", ";", "{z-index:2;}&::before{position:absolute;transition:box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out;z-index:-1;content:'';}", ";", ";"], sizeStyles$2, reactTheming.SELECTOR_FOCUS_VISIBLE, colorStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$
|
|
271
|
-
StyledPaneSplitter.defaultProps = {
|
|
272
|
-
theme: reactTheming.DEFAULT_THEME
|
|
273
|
-
};
|
|
328
|
+
})(["display:flex;position:absolute;align-items:center;justify-content:center;z-index:1;user-select:none;", ";", "{z-index:2;}&::before{position:absolute;transition:box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out;z-index:-1;content:'';}", ";", ";"], sizeStyles$2, reactTheming.SELECTOR_FOCUS_VISIBLE, colorStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
274
329
|
|
|
275
|
-
const COMPONENT_ID$1 = 'pane.splitter_button';
|
|
276
330
|
const getSize = theme => theme.space.base * 6;
|
|
277
331
|
const sizeStyles$1 = _ref => {
|
|
278
332
|
let {
|
|
@@ -296,38 +350,46 @@ const transformStyles = props => {
|
|
|
296
350
|
return styled.css(["& > svg{transform:rotate(", "deg);}"], degrees);
|
|
297
351
|
};
|
|
298
352
|
const StyledPaneSplitterButton = styled__default.default(reactButtons.ChevronButton).attrs({
|
|
299
|
-
'data-garden-
|
|
300
|
-
'data-garden-version': '9.0.0-next.9',
|
|
353
|
+
'data-garden-version': '9.1.0',
|
|
301
354
|
isBasic: true,
|
|
302
355
|
isPill: true,
|
|
303
356
|
size: 'small'
|
|
304
357
|
}).withConfig({
|
|
305
358
|
displayName: "StyledPaneSplitterButton",
|
|
306
359
|
componentId: "sc-zh032e-0"
|
|
307
|
-
})(["", ";", ";"
|
|
308
|
-
StyledPaneSplitterButton.defaultProps = {
|
|
309
|
-
theme: reactTheming.DEFAULT_THEME
|
|
310
|
-
};
|
|
360
|
+
})(["", ";", ";"], sizeStyles$1, transformStyles);
|
|
311
361
|
|
|
312
362
|
const COMPONENT_ID = 'pane.splitter_button_container';
|
|
313
363
|
const colorStyles = _ref => {
|
|
314
364
|
let {
|
|
315
365
|
theme
|
|
316
366
|
} = _ref;
|
|
317
|
-
const backgroundColor = reactTheming.
|
|
318
|
-
|
|
367
|
+
const backgroundColor = reactTheming.getColor({
|
|
368
|
+
theme,
|
|
369
|
+
variable: 'background.raised'
|
|
370
|
+
});
|
|
371
|
+
const boxShadow = theme.shadows.lg(`${theme.space.base}px`, `${theme.space.base * 2}px`, reactTheming.getColor({
|
|
372
|
+
variable: 'shadow.small',
|
|
373
|
+
theme
|
|
374
|
+
}));
|
|
319
375
|
return styled.css(["box-shadow:", ";background-color:", ";"], boxShadow, backgroundColor);
|
|
320
376
|
};
|
|
321
|
-
const positionStyles =
|
|
377
|
+
const positionStyles = _ref2 => {
|
|
378
|
+
let {
|
|
379
|
+
theme,
|
|
380
|
+
placement,
|
|
381
|
+
splitterSize,
|
|
382
|
+
orientation
|
|
383
|
+
} = _ref2;
|
|
322
384
|
let top;
|
|
323
385
|
let left;
|
|
324
386
|
let right;
|
|
325
387
|
let bottom;
|
|
326
|
-
const size = getSize(
|
|
388
|
+
const size = getSize(theme);
|
|
327
389
|
const inset = `-${size / 2}px`;
|
|
328
|
-
if (
|
|
329
|
-
const center = `${
|
|
330
|
-
switch (`${
|
|
390
|
+
if (placement === 'center' || splitterSize < size * 3) {
|
|
391
|
+
const center = `${splitterSize / 2 - size / 2}px`;
|
|
392
|
+
switch (`${orientation}-${theme.rtl ? 'rtl' : 'ltr'}`) {
|
|
331
393
|
case 'top-ltr':
|
|
332
394
|
case 'top-rtl':
|
|
333
395
|
top = inset;
|
|
@@ -351,7 +413,7 @@ const positionStyles = props => {
|
|
|
351
413
|
}
|
|
352
414
|
} else {
|
|
353
415
|
const offset = `${size}px`;
|
|
354
|
-
switch (`${
|
|
416
|
+
switch (`${orientation}-${placement}-${theme.rtl ? 'rtl' : 'ltr'}`) {
|
|
355
417
|
case 'top-end-ltr':
|
|
356
418
|
case 'top-end-rtl':
|
|
357
419
|
case 'top-start-rtl':
|
|
@@ -396,10 +458,10 @@ const positionStyles = props => {
|
|
|
396
458
|
}
|
|
397
459
|
return styled.css(["top:", ";right:", ";bottom:", ";left:", ";"], top, right, bottom, left);
|
|
398
460
|
};
|
|
399
|
-
const sizeStyles =
|
|
461
|
+
const sizeStyles = _ref3 => {
|
|
400
462
|
let {
|
|
401
463
|
theme
|
|
402
|
-
} =
|
|
464
|
+
} = _ref3;
|
|
403
465
|
const size = getSize(theme);
|
|
404
466
|
return styled.css(["border-radius:", "px;width:", "px;height:", "px;"], size, size, size);
|
|
405
467
|
};
|
|
@@ -408,9 +470,6 @@ const StyledPaneSplitterButtonContainer = styled__default.default.div.withConfig
|
|
|
408
470
|
displayName: "StyledPaneSplitterButtonContainer",
|
|
409
471
|
componentId: "sc-1w84y62-0"
|
|
410
472
|
})(["display:", ";position:absolute;transition:box-shadow 0.1s ease-in-out,opacity 0.25s ease-in-out 0.1s;opacity:0;z-index:2;", ";", ";", ";&:hover,&:focus-within,", ":hover ~ &,", ":focus-visible ~ &{opacity:1;}", ";"], props => props.splitterSize <= minimumSplitterSize(props.theme) ? 'none' : undefined, positionStyles, sizeStyles, colorStyles, StyledPaneSplitter, StyledPaneSplitter, props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
411
|
-
StyledPaneSplitterButtonContainer.defaultProps = {
|
|
412
|
-
theme: reactTheming.DEFAULT_THEME
|
|
413
|
-
};
|
|
414
473
|
|
|
415
474
|
const GridContext = React.createContext({
|
|
416
475
|
gutters: 'md'
|
|
@@ -437,7 +496,7 @@ const Col = React__default.default.forwardRef((_ref, ref) => {
|
|
|
437
496
|
ref: ref
|
|
438
497
|
}, props));
|
|
439
498
|
});
|
|
440
|
-
Col.displayName = 'Col';
|
|
499
|
+
Col.displayName = 'Grid.Col';
|
|
441
500
|
Col.propTypes = {
|
|
442
501
|
size: PropTypes__default.default.oneOfType([PropTypes__default.default.number, PropTypes__default.default.string]),
|
|
443
502
|
xs: PropTypes__default.default.oneOfType([PropTypes__default.default.number, PropTypes__default.default.string, PropTypes__default.default.bool]),
|
|
@@ -487,7 +546,7 @@ const Row = React__default.default.forwardRef((_ref, ref) => {
|
|
|
487
546
|
ref: ref
|
|
488
547
|
}, props));
|
|
489
548
|
});
|
|
490
|
-
Row.displayName = 'Row';
|
|
549
|
+
Row.displayName = 'Grid.Row';
|
|
491
550
|
Row.propTypes = {
|
|
492
551
|
alignItems: PropTypes__default.default.oneOf(ALIGN_ITEMS),
|
|
493
552
|
alignItemsXs: PropTypes__default.default.oneOf(ALIGN_ITEMS),
|
|
@@ -12,7 +12,7 @@ export declare const GridComponent: React.ForwardRefExoticComponent<IGridProps &
|
|
|
12
12
|
/**
|
|
13
13
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
14
14
|
*/
|
|
15
|
-
export declare const Grid:
|
|
15
|
+
export declare const Grid: typeof GridComponent & {
|
|
16
16
|
Row: typeof Row;
|
|
17
17
|
Col: typeof Col;
|
|
18
18
|
};
|
|
@@ -8,11 +8,13 @@ import React from 'react';
|
|
|
8
8
|
import { Splitter } from './components/Splitter';
|
|
9
9
|
import { Content } from './components/Content';
|
|
10
10
|
import { SplitterButton } from './components/SplitterButton';
|
|
11
|
+
declare const PaneComponent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
11
12
|
/**
|
|
12
13
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
13
14
|
*/
|
|
14
|
-
export declare const Pane:
|
|
15
|
+
export declare const Pane: typeof PaneComponent & {
|
|
15
16
|
Content: typeof Content;
|
|
16
17
|
Splitter: typeof Splitter;
|
|
17
18
|
SplitterButton: typeof SplitterButton;
|
|
18
19
|
};
|
|
20
|
+
export {};
|
|
@@ -4,7 +4,6 @@
|
|
|
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
|
-
/// <reference types="react" />
|
|
8
7
|
import { DefaultTheme } from 'styled-components';
|
|
9
8
|
import { Orientation } from '../../types';
|
|
10
9
|
interface IStyledSplitterButtonProps {
|
|
@@ -4,7 +4,6 @@
|
|
|
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
|
-
/// <reference types="react" />
|
|
8
7
|
import { GridNumber, Space } from '../types';
|
|
9
8
|
interface IGridContext {
|
|
10
9
|
columns?: GridNumber;
|
|
@@ -4,7 +4,6 @@
|
|
|
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
|
-
/// <reference types="react" />
|
|
8
7
|
interface IPaneProviderContextData {
|
|
9
8
|
rowState: Record<string, number>;
|
|
10
9
|
columnState: Record<string, number>;
|
|
@@ -4,7 +4,6 @@
|
|
|
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
|
-
/// <reference types="react" />
|
|
8
7
|
import { ISplitterProps, Orientation } from '../types';
|
|
9
8
|
interface IPaneSplitterContext {
|
|
10
9
|
orientation?: Orientation;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-grid",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "Components relating to layout grids in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -21,23 +21,23 @@
|
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"types": "dist/typings/index.d.ts",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@zendeskgarden/container-splitter": "^2.0.
|
|
24
|
+
"@zendeskgarden/container-splitter": "^2.0.17",
|
|
25
25
|
"@zendeskgarden/container-utilities": "^2.0.0",
|
|
26
|
-
"@zendeskgarden/react-buttons": "^9.
|
|
27
|
-
"@zendeskgarden/react-tooltips": "^9.
|
|
28
|
-
"polished": "^4.
|
|
26
|
+
"@zendeskgarden/react-buttons": "^9.1.0",
|
|
27
|
+
"@zendeskgarden/react-tooltips": "^9.1.0",
|
|
28
|
+
"polished": "^4.3.1",
|
|
29
29
|
"prop-types": "^15.5.7",
|
|
30
30
|
"react-merge-refs": "^2.0.0",
|
|
31
31
|
"use-resize-observer": "^9.1.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@zendeskgarden/react-theming": ">=9.0.0-next",
|
|
35
|
-
"react": "
|
|
36
|
-
"react-dom": "
|
|
35
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
36
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
37
37
|
"styled-components": "^5.3.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@zendeskgarden/react-theming": "^9.
|
|
40
|
+
"@zendeskgarden/react-theming": "^9.1.0"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
43
43
|
"components",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
51
|
"zendeskgarden:src": "src/index.ts",
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "a2842d18615ad057d75988fde4df5a0c79d2714e"
|
|
53
53
|
}
|