@zendeskgarden/react-grid 9.1.1 → 9.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/elements/Col.js +64 -6
- package/dist/esm/elements/Grid.js +7 -5
- package/dist/esm/elements/Row.js +37 -3
- package/dist/esm/elements/pane/components/Splitter.js +2 -2
- package/dist/esm/elements/pane/components/SplitterButton.js +6 -5
- package/dist/esm/styled/StyledCol.js +8 -8
- package/dist/esm/styled/StyledGrid.js +8 -8
- package/dist/esm/styled/StyledRow.js +5 -5
- package/dist/esm/styled/pane/StyledPane.js +1 -1
- package/dist/esm/styled/pane/StyledPaneContent.js +1 -1
- package/dist/esm/styled/pane/StyledPaneSplitter.js +5 -5
- package/dist/esm/styled/pane/StyledPaneSplitterButton.js +14 -9
- package/dist/esm/styled/pane/StyledPaneSplitterButtonContainer.js +8 -8
- package/dist/index.cjs.js +166 -66
- package/dist/typings/styled/StyledCol.d.ts +34 -5
- package/dist/typings/styled/StyledGrid.d.ts +3 -1
- package/dist/typings/styled/StyledRow.d.ts +22 -5
- package/dist/typings/styled/pane/StyledPaneSplitter.d.ts +2 -2
- package/dist/typings/styled/pane/StyledPaneSplitterButton.d.ts +2 -2
- package/dist/typings/styled/pane/StyledPaneSplitterButtonContainer.d.ts +3 -3
- package/package.json +5 -5
package/dist/esm/elements/Col.js
CHANGED
|
@@ -19,8 +19,37 @@ import useGridContext from '../utils/useGridContext.js';
|
|
|
19
19
|
|
|
20
20
|
const Col = React.forwardRef((_ref, ref) => {
|
|
21
21
|
let {
|
|
22
|
+
alignSelf,
|
|
23
|
+
alignSelfLg,
|
|
24
|
+
alignSelfMd,
|
|
25
|
+
alignSelfSm,
|
|
26
|
+
alignSelfXl,
|
|
27
|
+
alignSelfXs,
|
|
28
|
+
lg,
|
|
29
|
+
md,
|
|
30
|
+
offset,
|
|
31
|
+
offsetLg,
|
|
32
|
+
offsetMd,
|
|
33
|
+
offsetSm,
|
|
34
|
+
offsetXl,
|
|
35
|
+
offsetXs,
|
|
36
|
+
order,
|
|
37
|
+
orderLg,
|
|
38
|
+
orderMd,
|
|
39
|
+
orderSm,
|
|
40
|
+
orderXl,
|
|
41
|
+
orderXs,
|
|
22
42
|
size,
|
|
23
|
-
|
|
43
|
+
sm,
|
|
44
|
+
textAlign,
|
|
45
|
+
textAlignLg,
|
|
46
|
+
textAlignMd,
|
|
47
|
+
textAlignSm,
|
|
48
|
+
textAlignXl,
|
|
49
|
+
textAlignXs,
|
|
50
|
+
xl,
|
|
51
|
+
xs,
|
|
52
|
+
...other
|
|
24
53
|
} = _ref;
|
|
25
54
|
const {
|
|
26
55
|
columns,
|
|
@@ -28,12 +57,41 @@ const Col = React.forwardRef((_ref, ref) => {
|
|
|
28
57
|
debug
|
|
29
58
|
} = useGridContext();
|
|
30
59
|
return React.createElement(StyledCol, Object.assign({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
60
|
+
$xs: xs,
|
|
61
|
+
$sm: sm,
|
|
62
|
+
$md: md,
|
|
63
|
+
$lg: lg,
|
|
64
|
+
$xl: xl,
|
|
65
|
+
$alignSelf: alignSelf,
|
|
66
|
+
$alignSelfXs: alignSelfXs,
|
|
67
|
+
$alignSelfSm: alignSelfSm,
|
|
68
|
+
$alignSelfMd: alignSelfMd,
|
|
69
|
+
$alignSelfLg: alignSelfLg,
|
|
70
|
+
$alignSelfXl: alignSelfXl,
|
|
71
|
+
$textAlign: textAlign,
|
|
72
|
+
$textAlignXs: textAlignXs,
|
|
73
|
+
$textAlignSm: textAlignSm,
|
|
74
|
+
$textAlignMd: textAlignMd,
|
|
75
|
+
$textAlignLg: textAlignLg,
|
|
76
|
+
$textAlignXl: textAlignXl,
|
|
77
|
+
$offset: offset,
|
|
78
|
+
$offsetXs: offsetXs,
|
|
79
|
+
$offsetSm: offsetSm,
|
|
80
|
+
$offsetMd: offsetMd,
|
|
81
|
+
$offsetLg: offsetLg,
|
|
82
|
+
$offsetXl: offsetXl,
|
|
83
|
+
$order: order,
|
|
84
|
+
$orderXs: orderXs,
|
|
85
|
+
$orderSm: orderSm,
|
|
86
|
+
$orderMd: orderMd,
|
|
87
|
+
$orderLg: orderLg,
|
|
88
|
+
$orderXl: orderXl,
|
|
89
|
+
$sizeAll: size,
|
|
90
|
+
$columns: columns,
|
|
91
|
+
$gutters: gutters,
|
|
92
|
+
$debug: debug,
|
|
35
93
|
ref: ref
|
|
36
|
-
},
|
|
94
|
+
}, other));
|
|
37
95
|
});
|
|
38
96
|
Col.displayName = 'Grid.Col';
|
|
39
97
|
Col.propTypes = {
|
|
@@ -22,20 +22,22 @@ import { Col } from './Col.js';
|
|
|
22
22
|
const GridComponent = React.forwardRef((_ref, ref) => {
|
|
23
23
|
let {
|
|
24
24
|
columns,
|
|
25
|
+
gutters,
|
|
25
26
|
debug,
|
|
26
|
-
...
|
|
27
|
+
...other
|
|
27
28
|
} = _ref;
|
|
28
29
|
const value = useMemo(() => ({
|
|
29
30
|
columns,
|
|
30
|
-
gutters:
|
|
31
|
+
gutters: gutters,
|
|
31
32
|
debug
|
|
32
|
-
}), [columns,
|
|
33
|
+
}), [columns, gutters, debug]);
|
|
33
34
|
return React.createElement(GridContext.Provider, {
|
|
34
35
|
value: value
|
|
35
36
|
}, React.createElement(StyledGrid, Object.assign({
|
|
36
|
-
debug: debug,
|
|
37
|
+
$debug: debug,
|
|
38
|
+
$gutters: gutters,
|
|
37
39
|
ref: ref
|
|
38
|
-
},
|
|
40
|
+
}, other)));
|
|
39
41
|
});
|
|
40
42
|
GridComponent.displayName = 'Grid';
|
|
41
43
|
GridComponent.propTypes = {
|
package/dist/esm/elements/Row.js
CHANGED
|
@@ -19,7 +19,24 @@ import '../styled/pane/StyledPaneSplitterButtonContainer.js';
|
|
|
19
19
|
|
|
20
20
|
const Row = React.forwardRef((_ref, ref) => {
|
|
21
21
|
let {
|
|
22
|
+
alignItems,
|
|
23
|
+
alignItemsXs,
|
|
24
|
+
alignItemsSm,
|
|
25
|
+
alignItemsMd,
|
|
26
|
+
alignItemsLg,
|
|
27
|
+
alignItemsXl,
|
|
28
|
+
justifyContent,
|
|
29
|
+
justifyContentXs,
|
|
30
|
+
justifyContentSm,
|
|
31
|
+
justifyContentMd,
|
|
32
|
+
justifyContentLg,
|
|
33
|
+
justifyContentXl,
|
|
22
34
|
wrap,
|
|
35
|
+
wrapXs,
|
|
36
|
+
wrapSm,
|
|
37
|
+
wrapMd,
|
|
38
|
+
wrapLg,
|
|
39
|
+
wrapXl,
|
|
23
40
|
...props
|
|
24
41
|
} = _ref;
|
|
25
42
|
const {
|
|
@@ -27,9 +44,26 @@ const Row = React.forwardRef((_ref, ref) => {
|
|
|
27
44
|
debug
|
|
28
45
|
} = useGridContext();
|
|
29
46
|
return React.createElement(StyledRow, Object.assign({
|
|
30
|
-
gutters: gutters,
|
|
31
|
-
debug: debug,
|
|
32
|
-
|
|
47
|
+
$gutters: gutters,
|
|
48
|
+
$debug: debug,
|
|
49
|
+
$alignItems: alignItems,
|
|
50
|
+
$alignItemsXs: alignItemsXs,
|
|
51
|
+
$alignItemsSm: alignItemsSm,
|
|
52
|
+
$alignItemsMd: alignItemsMd,
|
|
53
|
+
$alignItemsLg: alignItemsLg,
|
|
54
|
+
$alignItemsXl: alignItemsXl,
|
|
55
|
+
$justifyContent: justifyContent,
|
|
56
|
+
$justifyContentXs: justifyContentXs,
|
|
57
|
+
$justifyContentSm: justifyContentSm,
|
|
58
|
+
$justifyContentMd: justifyContentMd,
|
|
59
|
+
$justifyContentLg: justifyContentLg,
|
|
60
|
+
$justifyContentXl: justifyContentXl,
|
|
61
|
+
$wrapAll: wrap,
|
|
62
|
+
$wrapXs: wrapXs,
|
|
63
|
+
$wrapSm: wrapSm,
|
|
64
|
+
$wrapMd: wrapMd,
|
|
65
|
+
$wrapLg: wrapLg,
|
|
66
|
+
$wrapXl: wrapXl,
|
|
33
67
|
ref: ref
|
|
34
68
|
}, props));
|
|
35
69
|
});
|
|
@@ -106,8 +106,8 @@ const SplitterComponent = forwardRef((_ref, ref) => {
|
|
|
106
106
|
isRow
|
|
107
107
|
}), [orientation, layoutKey, min, max, valueInFr, size, isRow])
|
|
108
108
|
}, React.createElement(StyledPaneSplitter, Object.assign({
|
|
109
|
-
isFixed: isFixed,
|
|
110
|
-
orientation: orientation
|
|
109
|
+
$isFixed: isFixed,
|
|
110
|
+
$orientation: orientation
|
|
111
111
|
}, separatorProps, props, {
|
|
112
112
|
ref: mergeRefs([separatorRef, ref])
|
|
113
113
|
})), children );
|
|
@@ -64,11 +64,12 @@ const SplitterButtonComponent = forwardRef((props, ref) => {
|
|
|
64
64
|
const onMouseDown = composeEventHandlers(props.onMouseDown, event => event.stopPropagation()
|
|
65
65
|
);
|
|
66
66
|
return React.createElement(StyledPaneSplitterButtonContainer, {
|
|
67
|
-
orientation: orientation,
|
|
68
|
-
placement: placement,
|
|
69
|
-
splitterSize: size || 0
|
|
67
|
+
$orientation: orientation,
|
|
68
|
+
$placement: placement,
|
|
69
|
+
$splitterSize: size || 0
|
|
70
70
|
}, React.createElement(Tooltip, {
|
|
71
71
|
content: label,
|
|
72
|
+
placement: "auto",
|
|
72
73
|
zIndex: 2,
|
|
73
74
|
style: {
|
|
74
75
|
cursor: 'default'
|
|
@@ -77,8 +78,8 @@ const SplitterButtonComponent = forwardRef((props, ref) => {
|
|
|
77
78
|
}, React.createElement(StyledPaneSplitterButton, Object.assign({
|
|
78
79
|
"aria-label": label
|
|
79
80
|
}, props, {
|
|
80
|
-
orientation: orientation,
|
|
81
|
-
isRotated: isMin,
|
|
81
|
+
$orientation: orientation,
|
|
82
|
+
$isRotated: isMin,
|
|
82
83
|
ref: ref,
|
|
83
84
|
onClick: onClick,
|
|
84
85
|
onKeyDown: onKeyDown,
|
|
@@ -26,7 +26,7 @@ const colorStyles = _ref => {
|
|
|
26
26
|
return css(["background-clip:content-box;background-color:", ";"], backgroundColor);
|
|
27
27
|
};
|
|
28
28
|
const flexStyles = (size, alignSelf, textAlign, offset, order, props) => {
|
|
29
|
-
const margin = offset && `${math(`${offset} / ${props
|
|
29
|
+
const margin = offset && `${math(`${offset} / ${props.$columns} * 100`)}%`;
|
|
30
30
|
let flexBasis;
|
|
31
31
|
let flexGrow;
|
|
32
32
|
let maxWidth;
|
|
@@ -41,7 +41,7 @@ const flexStyles = (size, alignSelf, textAlign, offset, order, props) => {
|
|
|
41
41
|
maxWidth = '100%';
|
|
42
42
|
width = 'auto';
|
|
43
43
|
} else if (size !== undefined) {
|
|
44
|
-
flexBasis = `${math(`${size} / ${props
|
|
44
|
+
flexBasis = `${math(`${size} / ${props.$columns} * 100`)}%`;
|
|
45
45
|
flexGrow = 0;
|
|
46
46
|
maxWidth = flexBasis;
|
|
47
47
|
}
|
|
@@ -57,7 +57,7 @@ const flexStyles = (size, alignSelf, textAlign, offset, order, props) => {
|
|
|
57
57
|
if (order === 'first') {
|
|
58
58
|
flexOrder = -1;
|
|
59
59
|
} else if (order === 'last') {
|
|
60
|
-
flexOrder = math(`${props
|
|
60
|
+
flexOrder = math(`${props.$columns} + 1`);
|
|
61
61
|
} else {
|
|
62
62
|
flexOrder = order;
|
|
63
63
|
}
|
|
@@ -69,20 +69,20 @@ const mediaStyles = (minWidth, size, alignSelf, textAlign, offset, order, props)
|
|
|
69
69
|
const sizeStyles = _ref2 => {
|
|
70
70
|
let {
|
|
71
71
|
theme,
|
|
72
|
-
gutters
|
|
72
|
+
$gutters
|
|
73
73
|
} = _ref2;
|
|
74
|
-
const padding = gutters ? math(`${theme.space[gutters]} / 2`) : 0;
|
|
74
|
+
const padding = $gutters ? math(`${theme.space[$gutters]} / 2`) : 0;
|
|
75
75
|
return css(["padding-right:", ";padding-left:", ";"], padding, padding);
|
|
76
76
|
};
|
|
77
77
|
const StyledCol = styled.div.attrs({
|
|
78
78
|
'data-garden-id': COMPONENT_ID,
|
|
79
|
-
'data-garden-version': '9.1.
|
|
79
|
+
'data-garden-version': '9.1.2'
|
|
80
80
|
}).withConfig({
|
|
81
81
|
displayName: "StyledCol",
|
|
82
82
|
componentId: "sc-inuw62-0"
|
|
83
|
-
})(["box-sizing:border-box;width:100%;", ";", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles(!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));
|
|
84
84
|
StyledCol.defaultProps = {
|
|
85
|
-
columns: 12,
|
|
85
|
+
$columns: 12,
|
|
86
86
|
theme: DEFAULT_THEME
|
|
87
87
|
};
|
|
88
88
|
|
|
@@ -12,16 +12,16 @@ const COMPONENT_ID = 'grid.grid';
|
|
|
12
12
|
const colorStyles = _ref => {
|
|
13
13
|
let {
|
|
14
14
|
theme,
|
|
15
|
-
debug
|
|
15
|
+
$debug
|
|
16
16
|
} = _ref;
|
|
17
|
-
const borderColor = debug && getColor({
|
|
17
|
+
const borderColor = $debug && getColor({
|
|
18
18
|
theme,
|
|
19
19
|
hue: 'crimson',
|
|
20
20
|
shade: 700,
|
|
21
21
|
transparency: theme.opacity[600]
|
|
22
22
|
});
|
|
23
|
-
const borderWidth = debug && math(`${theme.borderWidths.sm} * 2`);
|
|
24
|
-
return css(["color-scheme:only ", ";box-shadow:", ";"], theme.colors.base, debug && `
|
|
23
|
+
const borderWidth = $debug && math(`${theme.borderWidths.sm} * 2`);
|
|
24
|
+
return css(["color-scheme:only ", ";box-shadow:", ";"], theme.colors.base, $debug && `
|
|
25
25
|
-${borderWidth} 0 0 0 ${borderColor},
|
|
26
26
|
${borderWidth} 0 0 0 ${borderColor}
|
|
27
27
|
`);
|
|
@@ -29,20 +29,20 @@ const colorStyles = _ref => {
|
|
|
29
29
|
const sizeStyles = _ref2 => {
|
|
30
30
|
let {
|
|
31
31
|
theme,
|
|
32
|
-
gutters
|
|
32
|
+
$gutters
|
|
33
33
|
} = _ref2;
|
|
34
|
-
const padding = gutters ? math(`${theme.space[gutters]} / 2`) : 0;
|
|
34
|
+
const padding = $gutters ? math(`${theme.space[$gutters]} / 2`) : 0;
|
|
35
35
|
return css(["padding-right:", ";padding-left:", ";"], padding, padding);
|
|
36
36
|
};
|
|
37
37
|
const StyledGrid = styled.div.attrs({
|
|
38
38
|
'data-garden-id': COMPONENT_ID,
|
|
39
|
-
'data-garden-version': '9.1.
|
|
39
|
+
'data-garden-version': '9.1.2'
|
|
40
40
|
}).withConfig({
|
|
41
41
|
displayName: "StyledGrid",
|
|
42
42
|
componentId: "sc-oxgg5i-0"
|
|
43
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));
|
|
44
44
|
StyledGrid.defaultProps = {
|
|
45
|
-
gutters: 'md',
|
|
45
|
+
$gutters: 'md',
|
|
46
46
|
theme: DEFAULT_THEME
|
|
47
47
|
};
|
|
48
48
|
|
|
@@ -45,20 +45,20 @@ const mediaStyles = (minWidth, alignItems, justifyContent, wrap) => {
|
|
|
45
45
|
const sizeStyles = _ref2 => {
|
|
46
46
|
let {
|
|
47
47
|
theme,
|
|
48
|
-
gutters
|
|
48
|
+
$gutters
|
|
49
49
|
} = _ref2;
|
|
50
|
-
const margin = gutters ? math(`${theme.space[gutters]} / 2`) : 0;
|
|
50
|
+
const margin = $gutters ? math(`${theme.space[$gutters]} / 2`) : 0;
|
|
51
51
|
return css(["margin-right:-", ";margin-left:-", ";"], margin, margin);
|
|
52
52
|
};
|
|
53
53
|
const StyledRow = styled.div.attrs({
|
|
54
54
|
'data-garden-id': COMPONENT_ID,
|
|
55
|
-
'data-garden-version': '9.1.
|
|
55
|
+
'data-garden-version': '9.1.2'
|
|
56
56
|
}).withConfig({
|
|
57
57
|
displayName: "StyledRow",
|
|
58
58
|
componentId: "sc-xjsdg1-0"
|
|
59
|
-
})(["display:flex;box-sizing:border-box;", " ", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles(props
|
|
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));
|
|
60
60
|
StyledRow.defaultProps = {
|
|
61
|
-
wrapAll: 'wrap',
|
|
61
|
+
$wrapAll: 'wrap',
|
|
62
62
|
theme: DEFAULT_THEME
|
|
63
63
|
};
|
|
64
64
|
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
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.1.
|
|
13
|
+
'data-garden-version': '9.1.2'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledPane",
|
|
16
16
|
componentId: "sc-1ltjst7-0"
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
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.1.
|
|
13
|
+
'data-garden-version': '9.1.2'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledPaneContent",
|
|
16
16
|
componentId: "sc-1b38mbh-0"
|
|
@@ -42,8 +42,8 @@ const colorStyles = _ref => {
|
|
|
42
42
|
const sizeStyles = _ref2 => {
|
|
43
43
|
let {
|
|
44
44
|
theme,
|
|
45
|
-
orientation,
|
|
46
|
-
isFixed
|
|
45
|
+
$orientation,
|
|
46
|
+
$isFixed
|
|
47
47
|
} = _ref2;
|
|
48
48
|
const size = math(`${theme.shadowWidths.md} * 2`);
|
|
49
49
|
const separatorSize = math(`${theme.borderWidths.sm} * 2`);
|
|
@@ -57,7 +57,7 @@ const sizeStyles = _ref2 => {
|
|
|
57
57
|
let height;
|
|
58
58
|
let separatorWidth;
|
|
59
59
|
let separatorHeight;
|
|
60
|
-
switch (orientation) {
|
|
60
|
+
switch ($orientation) {
|
|
61
61
|
case 'top':
|
|
62
62
|
cursor = 'row-resize';
|
|
63
63
|
top = offset;
|
|
@@ -103,11 +103,11 @@ const sizeStyles = _ref2 => {
|
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
105
105
|
const dimensionProperty = width === '100%' ? 'height' : 'width';
|
|
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);
|
|
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);
|
|
107
107
|
};
|
|
108
108
|
const StyledPaneSplitter = styled.div.attrs({
|
|
109
109
|
'data-garden-id': COMPONENT_ID,
|
|
110
|
-
'data-garden-version': '9.1.
|
|
110
|
+
'data-garden-version': '9.1.2'
|
|
111
111
|
}).withConfig({
|
|
112
112
|
displayName: "StyledPaneSplitter",
|
|
113
113
|
componentId: "sc-jylemn-0"
|
|
@@ -15,22 +15,27 @@ const sizeStyles = _ref => {
|
|
|
15
15
|
const size = `${getSize(theme)}px`;
|
|
16
16
|
return css(["width:", ";min-width:", ";height:", ";"], size, size, size);
|
|
17
17
|
};
|
|
18
|
-
const transformStyles =
|
|
18
|
+
const transformStyles = _ref2 => {
|
|
19
|
+
let {
|
|
20
|
+
$isRotated,
|
|
21
|
+
$orientation,
|
|
22
|
+
theme
|
|
23
|
+
} = _ref2;
|
|
19
24
|
let degrees = 0;
|
|
20
|
-
if (
|
|
21
|
-
degrees =
|
|
25
|
+
if ($isRotated) {
|
|
26
|
+
degrees = theme.rtl ? -180 : 180;
|
|
22
27
|
}
|
|
23
|
-
if (
|
|
24
|
-
degrees +=
|
|
25
|
-
} else if (
|
|
26
|
-
degrees +=
|
|
27
|
-
} else if (
|
|
28
|
+
if ($orientation === 'end') {
|
|
29
|
+
degrees += theme.rtl ? -90 : 90;
|
|
30
|
+
} else if ($orientation === 'start') {
|
|
31
|
+
degrees += theme.rtl ? 90 : -90;
|
|
32
|
+
} else if ($orientation === 'bottom') {
|
|
28
33
|
degrees += 180;
|
|
29
34
|
}
|
|
30
35
|
return css(["& > svg{transform:rotate(", "deg);}"], degrees);
|
|
31
36
|
};
|
|
32
37
|
const StyledPaneSplitterButton = styled(ChevronButton).attrs({
|
|
33
|
-
'data-garden-version': '9.1.
|
|
38
|
+
'data-garden-version': '9.1.2',
|
|
34
39
|
isBasic: true,
|
|
35
40
|
isPill: true,
|
|
36
41
|
size: 'small'
|
|
@@ -28,9 +28,9 @@ const colorStyles = _ref => {
|
|
|
28
28
|
const positionStyles = _ref2 => {
|
|
29
29
|
let {
|
|
30
30
|
theme,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
$orientation,
|
|
32
|
+
$placement,
|
|
33
|
+
$splitterSize
|
|
34
34
|
} = _ref2;
|
|
35
35
|
let top;
|
|
36
36
|
let left;
|
|
@@ -38,9 +38,9 @@ const positionStyles = _ref2 => {
|
|
|
38
38
|
let bottom;
|
|
39
39
|
const size = getSize(theme);
|
|
40
40
|
const inset = `-${size / 2}px`;
|
|
41
|
-
if (placement === 'center' || splitterSize < size * 3) {
|
|
42
|
-
const center = `${splitterSize / 2 - size / 2}px`;
|
|
43
|
-
switch (`${orientation}-${theme.rtl ? 'rtl' : 'ltr'}`) {
|
|
41
|
+
if ($placement === 'center' || $splitterSize < size * 3) {
|
|
42
|
+
const center = `${$splitterSize / 2 - size / 2}px`;
|
|
43
|
+
switch (`${$orientation}-${theme.rtl ? 'rtl' : 'ltr'}`) {
|
|
44
44
|
case 'top-ltr':
|
|
45
45
|
case 'top-rtl':
|
|
46
46
|
top = inset;
|
|
@@ -64,7 +64,7 @@ const positionStyles = _ref2 => {
|
|
|
64
64
|
}
|
|
65
65
|
} else {
|
|
66
66
|
const offset = `${size}px`;
|
|
67
|
-
switch (`${orientation}-${placement}-${theme.rtl ? 'rtl' : 'ltr'}`) {
|
|
67
|
+
switch (`${$orientation}-${$placement}-${theme.rtl ? 'rtl' : 'ltr'}`) {
|
|
68
68
|
case 'top-end-ltr':
|
|
69
69
|
case 'top-end-rtl':
|
|
70
70
|
case 'top-start-rtl':
|
|
@@ -120,6 +120,6 @@ const minimumSplitterSize = theme => stripUnit(math(`${theme.shadowWidths.md} *
|
|
|
120
120
|
const StyledPaneSplitterButtonContainer = styled.div.withConfig({
|
|
121
121
|
displayName: "StyledPaneSplitterButtonContainer",
|
|
122
122
|
componentId: "sc-1w84y62-0"
|
|
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
|
|
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));
|
|
124
124
|
|
|
125
125
|
export { StyledPaneSplitterButtonContainer };
|
package/dist/index.cjs.js
CHANGED
|
@@ -52,7 +52,7 @@ const colorStyles$4 = _ref => {
|
|
|
52
52
|
return styled.css(["background-clip:content-box;background-color:", ";"], backgroundColor);
|
|
53
53
|
};
|
|
54
54
|
const flexStyles$1 = (size, alignSelf, textAlign, offset, order, props) => {
|
|
55
|
-
const margin = offset && `${polished.math(`${offset} / ${props
|
|
55
|
+
const margin = offset && `${polished.math(`${offset} / ${props.$columns} * 100`)}%`;
|
|
56
56
|
let flexBasis;
|
|
57
57
|
let flexGrow;
|
|
58
58
|
let maxWidth;
|
|
@@ -67,7 +67,7 @@ const flexStyles$1 = (size, alignSelf, textAlign, offset, order, props) => {
|
|
|
67
67
|
maxWidth = '100%';
|
|
68
68
|
width = 'auto';
|
|
69
69
|
} else if (size !== undefined) {
|
|
70
|
-
flexBasis = `${polished.math(`${size} / ${props
|
|
70
|
+
flexBasis = `${polished.math(`${size} / ${props.$columns} * 100`)}%`;
|
|
71
71
|
flexGrow = 0;
|
|
72
72
|
maxWidth = flexBasis;
|
|
73
73
|
}
|
|
@@ -83,7 +83,7 @@ const flexStyles$1 = (size, alignSelf, textAlign, offset, order, props) => {
|
|
|
83
83
|
if (order === 'first') {
|
|
84
84
|
flexOrder = -1;
|
|
85
85
|
} else if (order === 'last') {
|
|
86
|
-
flexOrder = polished.math(`${props
|
|
86
|
+
flexOrder = polished.math(`${props.$columns} + 1`);
|
|
87
87
|
} else {
|
|
88
88
|
flexOrder = order;
|
|
89
89
|
}
|
|
@@ -95,20 +95,20 @@ const mediaStyles$1 = (minWidth, size, alignSelf, textAlign, offset, order, prop
|
|
|
95
95
|
const sizeStyles$5 = _ref2 => {
|
|
96
96
|
let {
|
|
97
97
|
theme,
|
|
98
|
-
gutters
|
|
98
|
+
$gutters
|
|
99
99
|
} = _ref2;
|
|
100
|
-
const padding = gutters ? polished.math(`${theme.space[gutters]} / 2`) : 0;
|
|
100
|
+
const padding = $gutters ? polished.math(`${theme.space[$gutters]} / 2`) : 0;
|
|
101
101
|
return styled.css(["padding-right:", ";padding-left:", ";"], padding, padding);
|
|
102
102
|
};
|
|
103
103
|
const StyledCol = styled__default.default.div.attrs({
|
|
104
104
|
'data-garden-id': COMPONENT_ID$6,
|
|
105
|
-
'data-garden-version': '9.1.
|
|
105
|
+
'data-garden-version': '9.1.2'
|
|
106
106
|
}).withConfig({
|
|
107
107
|
displayName: "StyledCol",
|
|
108
108
|
componentId: "sc-inuw62-0"
|
|
109
|
-
})(["box-sizing:border-box;width:100%;", ";", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles$1(!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));
|
|
110
110
|
StyledCol.defaultProps = {
|
|
111
|
-
columns: 12,
|
|
111
|
+
$columns: 12,
|
|
112
112
|
theme: reactTheming.DEFAULT_THEME
|
|
113
113
|
};
|
|
114
114
|
|
|
@@ -116,16 +116,16 @@ const COMPONENT_ID$5 = 'grid.grid';
|
|
|
116
116
|
const colorStyles$3 = _ref => {
|
|
117
117
|
let {
|
|
118
118
|
theme,
|
|
119
|
-
debug
|
|
119
|
+
$debug
|
|
120
120
|
} = _ref;
|
|
121
|
-
const borderColor = debug && reactTheming.getColor({
|
|
121
|
+
const borderColor = $debug && reactTheming.getColor({
|
|
122
122
|
theme,
|
|
123
123
|
hue: 'crimson',
|
|
124
124
|
shade: 700,
|
|
125
125
|
transparency: theme.opacity[600]
|
|
126
126
|
});
|
|
127
|
-
const borderWidth = debug && polished.math(`${theme.borderWidths.sm} * 2`);
|
|
128
|
-
return styled.css(["color-scheme:only ", ";box-shadow:", ";"], theme.colors.base, debug && `
|
|
127
|
+
const borderWidth = $debug && polished.math(`${theme.borderWidths.sm} * 2`);
|
|
128
|
+
return styled.css(["color-scheme:only ", ";box-shadow:", ";"], theme.colors.base, $debug && `
|
|
129
129
|
-${borderWidth} 0 0 0 ${borderColor},
|
|
130
130
|
${borderWidth} 0 0 0 ${borderColor}
|
|
131
131
|
`);
|
|
@@ -133,20 +133,20 @@ const colorStyles$3 = _ref => {
|
|
|
133
133
|
const sizeStyles$4 = _ref2 => {
|
|
134
134
|
let {
|
|
135
135
|
theme,
|
|
136
|
-
gutters
|
|
136
|
+
$gutters
|
|
137
137
|
} = _ref2;
|
|
138
|
-
const padding = gutters ? polished.math(`${theme.space[gutters]} / 2`) : 0;
|
|
138
|
+
const padding = $gutters ? polished.math(`${theme.space[$gutters]} / 2`) : 0;
|
|
139
139
|
return styled.css(["padding-right:", ";padding-left:", ";"], padding, padding);
|
|
140
140
|
};
|
|
141
141
|
const StyledGrid = styled__default.default.div.attrs({
|
|
142
142
|
'data-garden-id': COMPONENT_ID$5,
|
|
143
|
-
'data-garden-version': '9.1.
|
|
143
|
+
'data-garden-version': '9.1.2'
|
|
144
144
|
}).withConfig({
|
|
145
145
|
displayName: "StyledGrid",
|
|
146
146
|
componentId: "sc-oxgg5i-0"
|
|
147
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));
|
|
148
148
|
StyledGrid.defaultProps = {
|
|
149
|
-
gutters: 'md',
|
|
149
|
+
$gutters: 'md',
|
|
150
150
|
theme: reactTheming.DEFAULT_THEME
|
|
151
151
|
};
|
|
152
152
|
|
|
@@ -187,27 +187,27 @@ const mediaStyles = (minWidth, alignItems, justifyContent, wrap) => {
|
|
|
187
187
|
const sizeStyles$3 = _ref2 => {
|
|
188
188
|
let {
|
|
189
189
|
theme,
|
|
190
|
-
gutters
|
|
190
|
+
$gutters
|
|
191
191
|
} = _ref2;
|
|
192
|
-
const margin = gutters ? polished.math(`${theme.space[gutters]} / 2`) : 0;
|
|
192
|
+
const margin = $gutters ? polished.math(`${theme.space[$gutters]} / 2`) : 0;
|
|
193
193
|
return styled.css(["margin-right:-", ";margin-left:-", ";"], margin, margin);
|
|
194
194
|
};
|
|
195
195
|
const StyledRow = styled__default.default.div.attrs({
|
|
196
196
|
'data-garden-id': COMPONENT_ID$4,
|
|
197
|
-
'data-garden-version': '9.1.
|
|
197
|
+
'data-garden-version': '9.1.2'
|
|
198
198
|
}).withConfig({
|
|
199
199
|
displayName: "StyledRow",
|
|
200
200
|
componentId: "sc-xjsdg1-0"
|
|
201
|
-
})(["display:flex;box-sizing:border-box;", " ", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles(props
|
|
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));
|
|
202
202
|
StyledRow.defaultProps = {
|
|
203
|
-
wrapAll: 'wrap',
|
|
203
|
+
$wrapAll: 'wrap',
|
|
204
204
|
theme: reactTheming.DEFAULT_THEME
|
|
205
205
|
};
|
|
206
206
|
|
|
207
207
|
const COMPONENT_ID$3 = 'pane';
|
|
208
208
|
const StyledPane = styled__default.default.div.attrs({
|
|
209
209
|
'data-garden-id': COMPONENT_ID$3,
|
|
210
|
-
'data-garden-version': '9.1.
|
|
210
|
+
'data-garden-version': '9.1.2'
|
|
211
211
|
}).withConfig({
|
|
212
212
|
displayName: "StyledPane",
|
|
213
213
|
componentId: "sc-1ltjst7-0"
|
|
@@ -216,7 +216,7 @@ const StyledPane = styled__default.default.div.attrs({
|
|
|
216
216
|
const COMPONENT_ID$2 = 'pane.content';
|
|
217
217
|
const StyledPaneContent = styled__default.default.div.attrs({
|
|
218
218
|
'data-garden-id': COMPONENT_ID$2,
|
|
219
|
-
'data-garden-version': '9.1.
|
|
219
|
+
'data-garden-version': '9.1.2'
|
|
220
220
|
}).withConfig({
|
|
221
221
|
displayName: "StyledPaneContent",
|
|
222
222
|
componentId: "sc-1b38mbh-0"
|
|
@@ -256,8 +256,8 @@ const colorStyles$1 = _ref => {
|
|
|
256
256
|
const sizeStyles$2 = _ref2 => {
|
|
257
257
|
let {
|
|
258
258
|
theme,
|
|
259
|
-
orientation,
|
|
260
|
-
isFixed
|
|
259
|
+
$orientation,
|
|
260
|
+
$isFixed
|
|
261
261
|
} = _ref2;
|
|
262
262
|
const size = polished.math(`${theme.shadowWidths.md} * 2`);
|
|
263
263
|
const separatorSize = polished.math(`${theme.borderWidths.sm} * 2`);
|
|
@@ -271,7 +271,7 @@ const sizeStyles$2 = _ref2 => {
|
|
|
271
271
|
let height;
|
|
272
272
|
let separatorWidth;
|
|
273
273
|
let separatorHeight;
|
|
274
|
-
switch (orientation) {
|
|
274
|
+
switch ($orientation) {
|
|
275
275
|
case 'top':
|
|
276
276
|
cursor = 'row-resize';
|
|
277
277
|
top = offset;
|
|
@@ -317,11 +317,11 @@ const sizeStyles$2 = _ref2 => {
|
|
|
317
317
|
break;
|
|
318
318
|
}
|
|
319
319
|
const dimensionProperty = width === '100%' ? 'height' : 'width';
|
|
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);
|
|
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);
|
|
321
321
|
};
|
|
322
322
|
const StyledPaneSplitter = styled__default.default.div.attrs({
|
|
323
323
|
'data-garden-id': COMPONENT_ID$1,
|
|
324
|
-
'data-garden-version': '9.1.
|
|
324
|
+
'data-garden-version': '9.1.2'
|
|
325
325
|
}).withConfig({
|
|
326
326
|
displayName: "StyledPaneSplitter",
|
|
327
327
|
componentId: "sc-jylemn-0"
|
|
@@ -335,22 +335,27 @@ const sizeStyles$1 = _ref => {
|
|
|
335
335
|
const size = `${getSize(theme)}px`;
|
|
336
336
|
return styled.css(["width:", ";min-width:", ";height:", ";"], size, size, size);
|
|
337
337
|
};
|
|
338
|
-
const transformStyles =
|
|
338
|
+
const transformStyles = _ref2 => {
|
|
339
|
+
let {
|
|
340
|
+
$isRotated,
|
|
341
|
+
$orientation,
|
|
342
|
+
theme
|
|
343
|
+
} = _ref2;
|
|
339
344
|
let degrees = 0;
|
|
340
|
-
if (
|
|
341
|
-
degrees =
|
|
345
|
+
if ($isRotated) {
|
|
346
|
+
degrees = theme.rtl ? -180 : 180;
|
|
342
347
|
}
|
|
343
|
-
if (
|
|
344
|
-
degrees +=
|
|
345
|
-
} else if (
|
|
346
|
-
degrees +=
|
|
347
|
-
} else if (
|
|
348
|
+
if ($orientation === 'end') {
|
|
349
|
+
degrees += theme.rtl ? -90 : 90;
|
|
350
|
+
} else if ($orientation === 'start') {
|
|
351
|
+
degrees += theme.rtl ? 90 : -90;
|
|
352
|
+
} else if ($orientation === 'bottom') {
|
|
348
353
|
degrees += 180;
|
|
349
354
|
}
|
|
350
355
|
return styled.css(["& > svg{transform:rotate(", "deg);}"], degrees);
|
|
351
356
|
};
|
|
352
357
|
const StyledPaneSplitterButton = styled__default.default(reactButtons.ChevronButton).attrs({
|
|
353
|
-
'data-garden-version': '9.1.
|
|
358
|
+
'data-garden-version': '9.1.2',
|
|
354
359
|
isBasic: true,
|
|
355
360
|
isPill: true,
|
|
356
361
|
size: 'small'
|
|
@@ -377,9 +382,9 @@ const colorStyles = _ref => {
|
|
|
377
382
|
const positionStyles = _ref2 => {
|
|
378
383
|
let {
|
|
379
384
|
theme,
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
385
|
+
$orientation,
|
|
386
|
+
$placement,
|
|
387
|
+
$splitterSize
|
|
383
388
|
} = _ref2;
|
|
384
389
|
let top;
|
|
385
390
|
let left;
|
|
@@ -387,9 +392,9 @@ const positionStyles = _ref2 => {
|
|
|
387
392
|
let bottom;
|
|
388
393
|
const size = getSize(theme);
|
|
389
394
|
const inset = `-${size / 2}px`;
|
|
390
|
-
if (placement === 'center' || splitterSize < size * 3) {
|
|
391
|
-
const center = `${splitterSize / 2 - size / 2}px`;
|
|
392
|
-
switch (`${orientation}-${theme.rtl ? 'rtl' : 'ltr'}`) {
|
|
395
|
+
if ($placement === 'center' || $splitterSize < size * 3) {
|
|
396
|
+
const center = `${$splitterSize / 2 - size / 2}px`;
|
|
397
|
+
switch (`${$orientation}-${theme.rtl ? 'rtl' : 'ltr'}`) {
|
|
393
398
|
case 'top-ltr':
|
|
394
399
|
case 'top-rtl':
|
|
395
400
|
top = inset;
|
|
@@ -413,7 +418,7 @@ const positionStyles = _ref2 => {
|
|
|
413
418
|
}
|
|
414
419
|
} else {
|
|
415
420
|
const offset = `${size}px`;
|
|
416
|
-
switch (`${orientation}-${placement}-${theme.rtl ? 'rtl' : 'ltr'}`) {
|
|
421
|
+
switch (`${$orientation}-${$placement}-${theme.rtl ? 'rtl' : 'ltr'}`) {
|
|
417
422
|
case 'top-end-ltr':
|
|
418
423
|
case 'top-end-rtl':
|
|
419
424
|
case 'top-start-rtl':
|
|
@@ -469,7 +474,7 @@ const minimumSplitterSize = theme => polished.stripUnit(polished.math(`${theme.s
|
|
|
469
474
|
const StyledPaneSplitterButtonContainer = styled__default.default.div.withConfig({
|
|
470
475
|
displayName: "StyledPaneSplitterButtonContainer",
|
|
471
476
|
componentId: "sc-1w84y62-0"
|
|
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
|
|
477
|
+
})(["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));
|
|
473
478
|
|
|
474
479
|
const GridContext = React.createContext({
|
|
475
480
|
gutters: 'md'
|
|
@@ -480,8 +485,37 @@ const useGridContext = () => {
|
|
|
480
485
|
|
|
481
486
|
const Col = React__default.default.forwardRef((_ref, ref) => {
|
|
482
487
|
let {
|
|
488
|
+
alignSelf,
|
|
489
|
+
alignSelfLg,
|
|
490
|
+
alignSelfMd,
|
|
491
|
+
alignSelfSm,
|
|
492
|
+
alignSelfXl,
|
|
493
|
+
alignSelfXs,
|
|
494
|
+
lg,
|
|
495
|
+
md,
|
|
496
|
+
offset,
|
|
497
|
+
offsetLg,
|
|
498
|
+
offsetMd,
|
|
499
|
+
offsetSm,
|
|
500
|
+
offsetXl,
|
|
501
|
+
offsetXs,
|
|
502
|
+
order,
|
|
503
|
+
orderLg,
|
|
504
|
+
orderMd,
|
|
505
|
+
orderSm,
|
|
506
|
+
orderXl,
|
|
507
|
+
orderXs,
|
|
483
508
|
size,
|
|
484
|
-
|
|
509
|
+
sm,
|
|
510
|
+
textAlign,
|
|
511
|
+
textAlignLg,
|
|
512
|
+
textAlignMd,
|
|
513
|
+
textAlignSm,
|
|
514
|
+
textAlignXl,
|
|
515
|
+
textAlignXs,
|
|
516
|
+
xl,
|
|
517
|
+
xs,
|
|
518
|
+
...other
|
|
485
519
|
} = _ref;
|
|
486
520
|
const {
|
|
487
521
|
columns,
|
|
@@ -489,12 +523,41 @@ const Col = React__default.default.forwardRef((_ref, ref) => {
|
|
|
489
523
|
debug
|
|
490
524
|
} = useGridContext();
|
|
491
525
|
return React__default.default.createElement(StyledCol, Object.assign({
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
526
|
+
$xs: xs,
|
|
527
|
+
$sm: sm,
|
|
528
|
+
$md: md,
|
|
529
|
+
$lg: lg,
|
|
530
|
+
$xl: xl,
|
|
531
|
+
$alignSelf: alignSelf,
|
|
532
|
+
$alignSelfXs: alignSelfXs,
|
|
533
|
+
$alignSelfSm: alignSelfSm,
|
|
534
|
+
$alignSelfMd: alignSelfMd,
|
|
535
|
+
$alignSelfLg: alignSelfLg,
|
|
536
|
+
$alignSelfXl: alignSelfXl,
|
|
537
|
+
$textAlign: textAlign,
|
|
538
|
+
$textAlignXs: textAlignXs,
|
|
539
|
+
$textAlignSm: textAlignSm,
|
|
540
|
+
$textAlignMd: textAlignMd,
|
|
541
|
+
$textAlignLg: textAlignLg,
|
|
542
|
+
$textAlignXl: textAlignXl,
|
|
543
|
+
$offset: offset,
|
|
544
|
+
$offsetXs: offsetXs,
|
|
545
|
+
$offsetSm: offsetSm,
|
|
546
|
+
$offsetMd: offsetMd,
|
|
547
|
+
$offsetLg: offsetLg,
|
|
548
|
+
$offsetXl: offsetXl,
|
|
549
|
+
$order: order,
|
|
550
|
+
$orderXs: orderXs,
|
|
551
|
+
$orderSm: orderSm,
|
|
552
|
+
$orderMd: orderMd,
|
|
553
|
+
$orderLg: orderLg,
|
|
554
|
+
$orderXl: orderXl,
|
|
555
|
+
$sizeAll: size,
|
|
556
|
+
$columns: columns,
|
|
557
|
+
$gutters: gutters,
|
|
558
|
+
$debug: debug,
|
|
496
559
|
ref: ref
|
|
497
|
-
},
|
|
560
|
+
}, other));
|
|
498
561
|
});
|
|
499
562
|
Col.displayName = 'Grid.Col';
|
|
500
563
|
Col.propTypes = {
|
|
@@ -532,7 +595,24 @@ Col.propTypes = {
|
|
|
532
595
|
|
|
533
596
|
const Row = React__default.default.forwardRef((_ref, ref) => {
|
|
534
597
|
let {
|
|
598
|
+
alignItems,
|
|
599
|
+
alignItemsXs,
|
|
600
|
+
alignItemsSm,
|
|
601
|
+
alignItemsMd,
|
|
602
|
+
alignItemsLg,
|
|
603
|
+
alignItemsXl,
|
|
604
|
+
justifyContent,
|
|
605
|
+
justifyContentXs,
|
|
606
|
+
justifyContentSm,
|
|
607
|
+
justifyContentMd,
|
|
608
|
+
justifyContentLg,
|
|
609
|
+
justifyContentXl,
|
|
535
610
|
wrap,
|
|
611
|
+
wrapXs,
|
|
612
|
+
wrapSm,
|
|
613
|
+
wrapMd,
|
|
614
|
+
wrapLg,
|
|
615
|
+
wrapXl,
|
|
536
616
|
...props
|
|
537
617
|
} = _ref;
|
|
538
618
|
const {
|
|
@@ -540,9 +620,26 @@ const Row = React__default.default.forwardRef((_ref, ref) => {
|
|
|
540
620
|
debug
|
|
541
621
|
} = useGridContext();
|
|
542
622
|
return React__default.default.createElement(StyledRow, Object.assign({
|
|
543
|
-
gutters: gutters,
|
|
544
|
-
debug: debug,
|
|
545
|
-
|
|
623
|
+
$gutters: gutters,
|
|
624
|
+
$debug: debug,
|
|
625
|
+
$alignItems: alignItems,
|
|
626
|
+
$alignItemsXs: alignItemsXs,
|
|
627
|
+
$alignItemsSm: alignItemsSm,
|
|
628
|
+
$alignItemsMd: alignItemsMd,
|
|
629
|
+
$alignItemsLg: alignItemsLg,
|
|
630
|
+
$alignItemsXl: alignItemsXl,
|
|
631
|
+
$justifyContent: justifyContent,
|
|
632
|
+
$justifyContentXs: justifyContentXs,
|
|
633
|
+
$justifyContentSm: justifyContentSm,
|
|
634
|
+
$justifyContentMd: justifyContentMd,
|
|
635
|
+
$justifyContentLg: justifyContentLg,
|
|
636
|
+
$justifyContentXl: justifyContentXl,
|
|
637
|
+
$wrapAll: wrap,
|
|
638
|
+
$wrapXs: wrapXs,
|
|
639
|
+
$wrapSm: wrapSm,
|
|
640
|
+
$wrapMd: wrapMd,
|
|
641
|
+
$wrapLg: wrapLg,
|
|
642
|
+
$wrapXl: wrapXl,
|
|
546
643
|
ref: ref
|
|
547
644
|
}, props));
|
|
548
645
|
});
|
|
@@ -571,20 +668,22 @@ Row.propTypes = {
|
|
|
571
668
|
const GridComponent = React__default.default.forwardRef((_ref, ref) => {
|
|
572
669
|
let {
|
|
573
670
|
columns,
|
|
671
|
+
gutters,
|
|
574
672
|
debug,
|
|
575
|
-
...
|
|
673
|
+
...other
|
|
576
674
|
} = _ref;
|
|
577
675
|
const value = React.useMemo(() => ({
|
|
578
676
|
columns,
|
|
579
|
-
gutters:
|
|
677
|
+
gutters: gutters,
|
|
580
678
|
debug
|
|
581
|
-
}), [columns,
|
|
679
|
+
}), [columns, gutters, debug]);
|
|
582
680
|
return React__default.default.createElement(GridContext.Provider, {
|
|
583
681
|
value: value
|
|
584
682
|
}, React__default.default.createElement(StyledGrid, Object.assign({
|
|
585
|
-
debug: debug,
|
|
683
|
+
$debug: debug,
|
|
684
|
+
$gutters: gutters,
|
|
586
685
|
ref: ref
|
|
587
|
-
},
|
|
686
|
+
}, other)));
|
|
588
687
|
});
|
|
589
688
|
GridComponent.displayName = 'Grid';
|
|
590
689
|
GridComponent.propTypes = {
|
|
@@ -896,8 +995,8 @@ const SplitterComponent = React.forwardRef((_ref, ref) => {
|
|
|
896
995
|
isRow
|
|
897
996
|
}), [orientation, layoutKey, min, max, valueInFr, size, isRow])
|
|
898
997
|
}, React__default.default.createElement(StyledPaneSplitter, Object.assign({
|
|
899
|
-
isFixed: isFixed,
|
|
900
|
-
orientation: orientation
|
|
998
|
+
$isFixed: isFixed,
|
|
999
|
+
$orientation: orientation
|
|
901
1000
|
}, separatorProps, props, {
|
|
902
1001
|
ref: reactMergeRefs.mergeRefs([separatorRef, ref])
|
|
903
1002
|
})), children );
|
|
@@ -973,11 +1072,12 @@ const SplitterButtonComponent = React.forwardRef((props, ref) => {
|
|
|
973
1072
|
const onMouseDown = containerUtilities.composeEventHandlers(props.onMouseDown, event => event.stopPropagation()
|
|
974
1073
|
);
|
|
975
1074
|
return React__default.default.createElement(StyledPaneSplitterButtonContainer, {
|
|
976
|
-
orientation: orientation,
|
|
977
|
-
placement: placement,
|
|
978
|
-
splitterSize: size || 0
|
|
1075
|
+
$orientation: orientation,
|
|
1076
|
+
$placement: placement,
|
|
1077
|
+
$splitterSize: size || 0
|
|
979
1078
|
}, React__default.default.createElement(reactTooltips.Tooltip, {
|
|
980
1079
|
content: label,
|
|
1080
|
+
placement: "auto",
|
|
981
1081
|
zIndex: 2,
|
|
982
1082
|
style: {
|
|
983
1083
|
cursor: 'default'
|
|
@@ -986,8 +1086,8 @@ const SplitterButtonComponent = React.forwardRef((props, ref) => {
|
|
|
986
1086
|
}, React__default.default.createElement(StyledPaneSplitterButton, Object.assign({
|
|
987
1087
|
"aria-label": label
|
|
988
1088
|
}, props, {
|
|
989
|
-
orientation: orientation,
|
|
990
|
-
isRotated: isMin,
|
|
1089
|
+
$orientation: orientation,
|
|
1090
|
+
$isRotated: isMin,
|
|
991
1091
|
ref: ref,
|
|
992
1092
|
onClick: onClick,
|
|
993
1093
|
onKeyDown: onKeyDown,
|
|
@@ -6,11 +6,40 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { ThemeProps, DefaultTheme } from 'styled-components';
|
|
8
8
|
import { IColProps, IGridProps } from '../types';
|
|
9
|
-
interface IStyledColProps extends
|
|
10
|
-
columns?: IGridProps['columns'];
|
|
11
|
-
gutters?: IGridProps['gutters'];
|
|
12
|
-
sizeAll?: IColProps['size'];
|
|
13
|
-
debug?: IGridProps['debug'];
|
|
9
|
+
interface IStyledColProps extends ThemeProps<DefaultTheme> {
|
|
10
|
+
$columns?: IGridProps['columns'];
|
|
11
|
+
$gutters?: IGridProps['gutters'];
|
|
12
|
+
$sizeAll?: IColProps['size'];
|
|
13
|
+
$debug?: IGridProps['debug'];
|
|
14
|
+
$xs?: IColProps['xs'];
|
|
15
|
+
$sm?: IColProps['sm'];
|
|
16
|
+
$md?: IColProps['md'];
|
|
17
|
+
$lg?: IColProps['lg'];
|
|
18
|
+
$xl?: IColProps['xl'];
|
|
19
|
+
$alignSelf?: IColProps['alignSelf'];
|
|
20
|
+
$alignSelfXs?: IColProps['alignSelfXs'];
|
|
21
|
+
$alignSelfSm?: IColProps['alignSelfSm'];
|
|
22
|
+
$alignSelfMd?: IColProps['alignSelfMd'];
|
|
23
|
+
$alignSelfLg?: IColProps['alignSelfLg'];
|
|
24
|
+
$alignSelfXl?: IColProps['alignSelfXl'];
|
|
25
|
+
$textAlign?: IColProps['textAlign'];
|
|
26
|
+
$textAlignXs?: IColProps['textAlignXs'];
|
|
27
|
+
$textAlignSm?: IColProps['textAlignSm'];
|
|
28
|
+
$textAlignMd?: IColProps['textAlignMd'];
|
|
29
|
+
$textAlignLg?: IColProps['textAlignLg'];
|
|
30
|
+
$textAlignXl?: IColProps['textAlignXl'];
|
|
31
|
+
$offset?: IColProps['offset'];
|
|
32
|
+
$offsetXs?: IColProps['offsetXs'];
|
|
33
|
+
$offsetSm?: IColProps['offsetSm'];
|
|
34
|
+
$offsetMd?: IColProps['offsetMd'];
|
|
35
|
+
$offsetLg?: IColProps['offsetLg'];
|
|
36
|
+
$offsetXl?: IColProps['offsetXl'];
|
|
37
|
+
$order?: IColProps['order'];
|
|
38
|
+
$orderXs?: IColProps['orderXs'];
|
|
39
|
+
$orderSm?: IColProps['orderSm'];
|
|
40
|
+
$orderMd?: IColProps['orderMd'];
|
|
41
|
+
$orderLg?: IColProps['orderLg'];
|
|
42
|
+
$orderXl?: IColProps['orderXl'];
|
|
14
43
|
}
|
|
15
44
|
export declare const StyledCol: import("styled-components").StyledComponent<"div", DefaultTheme, IStyledColProps, never>;
|
|
16
45
|
export {};
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { ThemeProps, DefaultTheme } from 'styled-components';
|
|
8
8
|
import { IGridProps } from '../types';
|
|
9
|
-
interface IStyledGridProps extends
|
|
9
|
+
interface IStyledGridProps extends ThemeProps<DefaultTheme> {
|
|
10
|
+
$debug?: IGridProps['debug'];
|
|
11
|
+
$gutters?: IGridProps['gutters'];
|
|
10
12
|
}
|
|
11
13
|
export declare const StyledGrid: import("styled-components").StyledComponent<"div", DefaultTheme, IStyledGridProps, never>;
|
|
12
14
|
export {};
|
|
@@ -5,11 +5,28 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import { ThemeProps, DefaultTheme } from 'styled-components';
|
|
8
|
-
import { IGridProps, IRowProps } from '../types';
|
|
9
|
-
interface IStyledRowProps extends
|
|
10
|
-
gutters?: IGridProps['gutters'];
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import { AlignItems, IGridProps, IRowProps, JustifyContent, Wrap } from '../types';
|
|
9
|
+
interface IStyledRowProps extends ThemeProps<DefaultTheme> {
|
|
10
|
+
$gutters?: IGridProps['gutters'];
|
|
11
|
+
$debug?: IGridProps['debug'];
|
|
12
|
+
$alignItems?: AlignItems;
|
|
13
|
+
$alignItemsXs?: AlignItems;
|
|
14
|
+
$alignItemsSm?: AlignItems;
|
|
15
|
+
$alignItemsMd?: AlignItems;
|
|
16
|
+
$alignItemsLg?: AlignItems;
|
|
17
|
+
$alignItemsXl?: AlignItems;
|
|
18
|
+
$justifyContent?: JustifyContent;
|
|
19
|
+
$justifyContentXs?: JustifyContent;
|
|
20
|
+
$justifyContentSm?: JustifyContent;
|
|
21
|
+
$justifyContentMd?: JustifyContent;
|
|
22
|
+
$justifyContentLg?: JustifyContent;
|
|
23
|
+
$justifyContentXl?: JustifyContent;
|
|
24
|
+
$wrapAll?: IRowProps['wrap'];
|
|
25
|
+
$wrapXs?: Wrap;
|
|
26
|
+
$wrapSm?: Wrap;
|
|
27
|
+
$wrapMd?: Wrap;
|
|
28
|
+
$wrapLg?: Wrap;
|
|
29
|
+
$wrapXl?: Wrap;
|
|
13
30
|
}
|
|
14
31
|
export declare const StyledRow: import("styled-components").StyledComponent<"div", DefaultTheme, IStyledRowProps, never>;
|
|
15
32
|
export {};
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
import { DefaultTheme } from 'styled-components';
|
|
8
8
|
import { Orientation } from '../../types';
|
|
9
9
|
interface IStyledPaneSplitterProps {
|
|
10
|
-
orientation?: Orientation;
|
|
11
|
-
isFixed?: boolean;
|
|
10
|
+
$orientation?: Orientation;
|
|
11
|
+
$isFixed?: boolean;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* 1. Elevated initial context to pickup full-width hover
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
import { DefaultTheme } from 'styled-components';
|
|
8
8
|
import { Orientation } from '../../types';
|
|
9
9
|
interface IStyledSplitterButtonProps {
|
|
10
|
-
orientation: Orientation;
|
|
11
|
-
isRotated: boolean;
|
|
10
|
+
$orientation: Orientation;
|
|
11
|
+
$isRotated: boolean;
|
|
12
12
|
}
|
|
13
13
|
export declare const getSize: (theme: DefaultTheme) => number;
|
|
14
14
|
export declare const StyledPaneSplitterButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@zendeskgarden/react-buttons").IIconButtonProps & import("react").RefAttributes<HTMLButtonElement>>, DefaultTheme, IStyledSplitterButtonProps, never>;
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
import { DefaultTheme } from 'styled-components';
|
|
8
8
|
import { Orientation, PLACEMENT } from '../../types';
|
|
9
9
|
interface IStyledSplitterButtonContainerProps {
|
|
10
|
-
orientation: Orientation;
|
|
11
|
-
placement: (typeof PLACEMENT)[number];
|
|
12
|
-
splitterSize: number;
|
|
10
|
+
$orientation: Orientation;
|
|
11
|
+
$placement: (typeof PLACEMENT)[number];
|
|
12
|
+
$splitterSize: number;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* 1. Match focused `Splitter` z-index
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-grid",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.2",
|
|
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>",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@zendeskgarden/container-splitter": "^2.0.17",
|
|
25
25
|
"@zendeskgarden/container-utilities": "^2.0.0",
|
|
26
|
-
"@zendeskgarden/react-buttons": "^9.1.
|
|
27
|
-
"@zendeskgarden/react-tooltips": "^9.1.
|
|
26
|
+
"@zendeskgarden/react-buttons": "^9.1.2",
|
|
27
|
+
"@zendeskgarden/react-tooltips": "^9.1.2",
|
|
28
28
|
"polished": "^4.3.1",
|
|
29
29
|
"prop-types": "^15.5.7",
|
|
30
30
|
"react-merge-refs": "^2.0.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"styled-components": "^5.3.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@zendeskgarden/react-theming": "^9.1.
|
|
40
|
+
"@zendeskgarden/react-theming": "^9.1.2"
|
|
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": "dd7b2e7fb6747ef39a028b4e7b9924c2098deea0"
|
|
53
53
|
}
|