@zendeskgarden/react-grid 9.12.3 → 9.12.5
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 +34 -35
- package/dist/esm/elements/Grid.js +6 -7
- package/dist/esm/elements/Row.js +22 -23
- package/dist/esm/elements/pane/Pane.js +4 -5
- package/dist/esm/elements/pane/PaneProvider.js +12 -14
- package/dist/esm/elements/pane/components/Splitter.js +14 -15
- package/dist/esm/elements/pane/components/SplitterButton.js +5 -6
- package/dist/esm/styled/StyledCol.js +14 -16
- package/dist/esm/styled/StyledGrid.js +12 -14
- package/dist/esm/styled/StyledRow.js +11 -13
- package/dist/esm/styled/pane/StyledPane.js +3 -3
- package/dist/esm/styled/pane/StyledPaneContent.js +3 -3
- package/dist/esm/styled/pane/StyledPaneSplitter.js +12 -14
- package/dist/esm/styled/pane/StyledPaneSplitterButton.js +10 -12
- package/dist/esm/styled/pane/StyledPaneSplitterButtonContainer.js +13 -16
- package/dist/index.cjs.js +153 -174
- package/package.json +5 -5
package/dist/esm/elements/Col.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
|
-
import {
|
|
9
|
+
import { TEXT_ALIGN, ALIGN_SELF } from '../types/index.js';
|
|
10
10
|
import { StyledCol } from '../styled/StyledCol.js';
|
|
11
11
|
import '../styled/StyledGrid.js';
|
|
12
12
|
import '../styled/StyledRow.js';
|
|
@@ -17,40 +17,39 @@ import '../styled/pane/StyledPaneSplitterButton.js';
|
|
|
17
17
|
import '../styled/pane/StyledPaneSplitterButtonContainer.js';
|
|
18
18
|
import useGridContext from '../utils/useGridContext.js';
|
|
19
19
|
|
|
20
|
-
const Col = React.forwardRef((
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
} = _ref;
|
|
20
|
+
const Col = React.forwardRef(({
|
|
21
|
+
alignSelf,
|
|
22
|
+
alignSelfLg,
|
|
23
|
+
alignSelfMd,
|
|
24
|
+
alignSelfSm,
|
|
25
|
+
alignSelfXl,
|
|
26
|
+
alignSelfXs,
|
|
27
|
+
lg,
|
|
28
|
+
md,
|
|
29
|
+
offset,
|
|
30
|
+
offsetLg,
|
|
31
|
+
offsetMd,
|
|
32
|
+
offsetSm,
|
|
33
|
+
offsetXl,
|
|
34
|
+
offsetXs,
|
|
35
|
+
order,
|
|
36
|
+
orderLg,
|
|
37
|
+
orderMd,
|
|
38
|
+
orderSm,
|
|
39
|
+
orderXl,
|
|
40
|
+
orderXs,
|
|
41
|
+
size,
|
|
42
|
+
sm,
|
|
43
|
+
textAlign,
|
|
44
|
+
textAlignLg,
|
|
45
|
+
textAlignMd,
|
|
46
|
+
textAlignSm,
|
|
47
|
+
textAlignXl,
|
|
48
|
+
textAlignXs,
|
|
49
|
+
xl,
|
|
50
|
+
xs,
|
|
51
|
+
...other
|
|
52
|
+
}, ref) => {
|
|
54
53
|
const {
|
|
55
54
|
columns,
|
|
56
55
|
gutters,
|
|
@@ -19,13 +19,12 @@ import '../styled/pane/StyledPaneSplitterButtonContainer.js';
|
|
|
19
19
|
import { Row } from './Row.js';
|
|
20
20
|
import { Col } from './Col.js';
|
|
21
21
|
|
|
22
|
-
const GridComponent = React.forwardRef((
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = _ref;
|
|
22
|
+
const GridComponent = React.forwardRef(({
|
|
23
|
+
columns = 12,
|
|
24
|
+
gutters = 'md',
|
|
25
|
+
debug,
|
|
26
|
+
...other
|
|
27
|
+
}, ref) => {
|
|
29
28
|
const value = useMemo(() => ({
|
|
30
29
|
columns,
|
|
31
30
|
gutters: gutters,
|
package/dist/esm/elements/Row.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
|
-
import {
|
|
9
|
+
import { WRAP, JUSTIFY_CONTENT, ALIGN_ITEMS } from '../types/index.js';
|
|
10
10
|
import useGridContext from '../utils/useGridContext.js';
|
|
11
11
|
import '../styled/StyledCol.js';
|
|
12
12
|
import '../styled/StyledGrid.js';
|
|
@@ -17,28 +17,27 @@ import '../styled/pane/StyledPaneSplitter.js';
|
|
|
17
17
|
import '../styled/pane/StyledPaneSplitterButton.js';
|
|
18
18
|
import '../styled/pane/StyledPaneSplitterButtonContainer.js';
|
|
19
19
|
|
|
20
|
-
const Row = React.forwardRef((
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} = _ref;
|
|
20
|
+
const Row = React.forwardRef(({
|
|
21
|
+
alignItems,
|
|
22
|
+
alignItemsXs,
|
|
23
|
+
alignItemsSm,
|
|
24
|
+
alignItemsMd,
|
|
25
|
+
alignItemsLg,
|
|
26
|
+
alignItemsXl,
|
|
27
|
+
justifyContent,
|
|
28
|
+
justifyContentXs,
|
|
29
|
+
justifyContentSm,
|
|
30
|
+
justifyContentMd,
|
|
31
|
+
justifyContentLg,
|
|
32
|
+
justifyContentXl,
|
|
33
|
+
wrap,
|
|
34
|
+
wrapXs,
|
|
35
|
+
wrapSm,
|
|
36
|
+
wrapMd,
|
|
37
|
+
wrapLg,
|
|
38
|
+
wrapXl,
|
|
39
|
+
...props
|
|
40
|
+
}, ref) => {
|
|
42
41
|
const {
|
|
43
42
|
gutters,
|
|
44
43
|
debug
|
|
@@ -20,11 +20,10 @@ import '../../styled/pane/StyledPaneSplitterButton.js';
|
|
|
20
20
|
import '../../styled/pane/StyledPaneSplitterButtonContainer.js';
|
|
21
21
|
import { PaneContext } from '../../utils/usePaneContext.js';
|
|
22
22
|
|
|
23
|
-
const PaneComponent = forwardRef((
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} = _ref;
|
|
23
|
+
const PaneComponent = forwardRef(({
|
|
24
|
+
children,
|
|
25
|
+
...props
|
|
26
|
+
}, ref) => {
|
|
28
27
|
const [paneId, setPaneId] = useState();
|
|
29
28
|
const observerRef = useRef(null);
|
|
30
29
|
const {
|
|
@@ -13,24 +13,22 @@ const getPixelsPerFr = (totalFrs, totalDimension) => {
|
|
|
13
13
|
return totalDimension / totalFrs;
|
|
14
14
|
};
|
|
15
15
|
const convertToPixels = (values, pixelsPerFr) => {
|
|
16
|
-
return Object.entries(values).reduce((prev,
|
|
17
|
-
let [key, value] = _ref;
|
|
16
|
+
return Object.entries(values).reduce((prev, [key, value]) => {
|
|
18
17
|
prev[key] = value * pixelsPerFr;
|
|
19
18
|
return prev;
|
|
20
19
|
}, {});
|
|
21
20
|
};
|
|
22
|
-
const PaneProvider =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} = _ref2;
|
|
21
|
+
const PaneProvider = ({
|
|
22
|
+
id,
|
|
23
|
+
totalPanesWidth,
|
|
24
|
+
totalPanesHeight,
|
|
25
|
+
defaultRowValues,
|
|
26
|
+
defaultColumnValues,
|
|
27
|
+
rowValues,
|
|
28
|
+
columnValues,
|
|
29
|
+
onChange,
|
|
30
|
+
children
|
|
31
|
+
}) => {
|
|
34
32
|
const isControlled = rowValues !== undefined && rowValues !== null && columnValues !== undefined && columnValues !== null;
|
|
35
33
|
const [rowState, setRowState] = useState(defaultRowValues || {});
|
|
36
34
|
const [columnState, setColumnState] = useState(defaultColumnValues || {});
|
|
@@ -35,21 +35,20 @@ const orientationToDimension = {
|
|
|
35
35
|
top: 'rows',
|
|
36
36
|
bottom: 'rows'
|
|
37
37
|
};
|
|
38
|
-
const SplitterComponent = forwardRef((
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
} = _ref;
|
|
38
|
+
const SplitterComponent = forwardRef(({
|
|
39
|
+
children,
|
|
40
|
+
providerId,
|
|
41
|
+
layoutKey,
|
|
42
|
+
min,
|
|
43
|
+
max,
|
|
44
|
+
orientation = 'end',
|
|
45
|
+
isFixed,
|
|
46
|
+
onMouseDown,
|
|
47
|
+
onTouchStart,
|
|
48
|
+
onKeyDown,
|
|
49
|
+
onClick,
|
|
50
|
+
...props
|
|
51
|
+
}, ref) => {
|
|
53
52
|
const paneProviderContext = usePaneProviderContextData(providerId);
|
|
54
53
|
const paneContext = usePaneContext();
|
|
55
54
|
const themeContext = useContext(ThemeContext);
|
|
@@ -18,12 +18,11 @@ import { StyledPaneSplitterButtonContainer } from '../../../styled/pane/StyledPa
|
|
|
18
18
|
import usePaneSplitterContext from '../../../utils/usePaneSplitterContext.js';
|
|
19
19
|
import { usePaneProviderContextData } from '../../../utils/usePaneProviderContext.js';
|
|
20
20
|
|
|
21
|
-
const SplitterButtonComponent = forwardRef((
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} = _ref;
|
|
21
|
+
const SplitterButtonComponent = forwardRef(({
|
|
22
|
+
label,
|
|
23
|
+
placement: defaultPlacement,
|
|
24
|
+
...other
|
|
25
|
+
}, ref) => {
|
|
27
26
|
const {
|
|
28
27
|
orientation,
|
|
29
28
|
layoutKey,
|
|
@@ -8,11 +8,10 @@ import styled, { css } from 'styled-components';
|
|
|
8
8
|
import { math } from 'polished';
|
|
9
9
|
import { componentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
|
-
const COMPONENT_ID = 'grid.col';
|
|
12
|
-
const colorStyles =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
11
|
+
const COMPONENT_ID$6 = 'grid.col';
|
|
12
|
+
const colorStyles$4 = ({
|
|
13
|
+
theme
|
|
14
|
+
}) => {
|
|
16
15
|
const backgroundColor = getColor({
|
|
17
16
|
theme,
|
|
18
17
|
variable: 'background.primaryEmphasis',
|
|
@@ -25,7 +24,7 @@ const colorStyles = _ref => {
|
|
|
25
24
|
});
|
|
26
25
|
return css(["background-clip:content-box;background-color:", ";"], backgroundColor);
|
|
27
26
|
};
|
|
28
|
-
const flexStyles = (size, alignSelf, textAlign, offset, order, props) => {
|
|
27
|
+
const flexStyles$1 = (size, alignSelf, textAlign, offset, order, props) => {
|
|
29
28
|
const margin = offset && `${math(`${offset} / ${props.$columns} * 100`)}%`;
|
|
30
29
|
let flexBasis;
|
|
31
30
|
let flexGrow;
|
|
@@ -63,24 +62,23 @@ const flexStyles = (size, alignSelf, textAlign, offset, order, props) => {
|
|
|
63
62
|
}
|
|
64
63
|
return css(["flex-basis:", ";flex-grow:", ";flex-shrink:", ";align-self:", ";order:", ";margin-", ":", ";width:", ";max-width:", ";text-align:", ";"], flexBasis, flexGrow, size && 0, alignSelf === 'start' || alignSelf === 'end' ? `flex-${alignSelf}` : alignSelf, flexOrder, props.theme.rtl ? 'right' : 'left', margin, width, maxWidth, horizontalAlign);
|
|
65
64
|
};
|
|
66
|
-
const mediaStyles = (minWidth, size, alignSelf, textAlign, offset, order, props) => {
|
|
67
|
-
return css(["@media (min-width:", "){", ";}"], minWidth, flexStyles(size, alignSelf, textAlign, offset, order, props));
|
|
65
|
+
const mediaStyles$1 = (minWidth, size, alignSelf, textAlign, offset, order, props) => {
|
|
66
|
+
return css(["@media (min-width:", "){", ";}"], minWidth, flexStyles$1(size, alignSelf, textAlign, offset, order, props));
|
|
68
67
|
};
|
|
69
|
-
const sizeStyles =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} = _ref2;
|
|
68
|
+
const sizeStyles$5 = ({
|
|
69
|
+
theme,
|
|
70
|
+
$gutters
|
|
71
|
+
}) => {
|
|
74
72
|
const padding = $gutters ? math(`${theme.space[$gutters]} / 2`) : 0;
|
|
75
73
|
return css(["padding-right:", ";padding-left:", ";"], padding, padding);
|
|
76
74
|
};
|
|
77
75
|
const StyledCol = styled.div.attrs(props => ({
|
|
78
|
-
'data-garden-id': COMPONENT_ID,
|
|
79
|
-
'data-garden-version': '9.12.
|
|
76
|
+
'data-garden-id': COMPONENT_ID$6,
|
|
77
|
+
'data-garden-version': '9.12.5',
|
|
80
78
|
$columns: props.$columns ?? 12
|
|
81
79
|
})).withConfig({
|
|
82
80
|
displayName: "StyledCol",
|
|
83
81
|
componentId: "sc-inuw62-0"
|
|
84
|
-
})(["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), componentStyles);
|
|
82
|
+
})(["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), componentStyles);
|
|
85
83
|
|
|
86
84
|
export { StyledCol };
|
|
@@ -8,12 +8,11 @@ import styled, { css } from 'styled-components';
|
|
|
8
8
|
import { math } from 'polished';
|
|
9
9
|
import { componentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
|
-
const COMPONENT_ID = 'grid.grid';
|
|
12
|
-
const colorStyles =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} = _ref;
|
|
11
|
+
const COMPONENT_ID$5 = 'grid.grid';
|
|
12
|
+
const colorStyles$3 = ({
|
|
13
|
+
theme,
|
|
14
|
+
$debug
|
|
15
|
+
}) => {
|
|
17
16
|
const borderColor = $debug && getColor({
|
|
18
17
|
theme,
|
|
19
18
|
hue: 'crimson',
|
|
@@ -26,21 +25,20 @@ const colorStyles = _ref => {
|
|
|
26
25
|
${borderWidth} 0 0 0 ${borderColor}
|
|
27
26
|
`);
|
|
28
27
|
};
|
|
29
|
-
const sizeStyles =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} = _ref2;
|
|
28
|
+
const sizeStyles$4 = ({
|
|
29
|
+
theme,
|
|
30
|
+
$gutters
|
|
31
|
+
}) => {
|
|
34
32
|
const padding = $gutters ? math(`${theme.space[$gutters]} / 2`) : 0;
|
|
35
33
|
return css(["padding-right:", ";padding-left:", ";"], padding, padding);
|
|
36
34
|
};
|
|
37
35
|
const StyledGrid = styled.div.attrs(props => ({
|
|
38
|
-
'data-garden-id': COMPONENT_ID,
|
|
39
|
-
'data-garden-version': '9.12.
|
|
36
|
+
'data-garden-id': COMPONENT_ID$5,
|
|
37
|
+
'data-garden-version': '9.12.5',
|
|
40
38
|
$gutters: props.$gutters ?? 'md'
|
|
41
39
|
})).withConfig({
|
|
42
40
|
displayName: "StyledGrid",
|
|
43
41
|
componentId: "sc-oxgg5i-0"
|
|
44
|
-
})(["direction:", ";margin-right:auto;margin-left:auto;width:100%;box-sizing:border-box;", ";", ";", ";"], props => props.theme.rtl && 'rtl', sizeStyles, colorStyles, componentStyles);
|
|
42
|
+
})(["direction:", ";margin-right:auto;margin-left:auto;width:100%;box-sizing:border-box;", ";", ";", ";"], props => props.theme.rtl && 'rtl', sizeStyles$4, colorStyles$3, componentStyles);
|
|
45
43
|
|
|
46
44
|
export { StyledGrid };
|
|
@@ -8,11 +8,10 @@ import styled, { css } from 'styled-components';
|
|
|
8
8
|
import { math } from 'polished';
|
|
9
9
|
import { componentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
|
-
const COMPONENT_ID = 'grid.row';
|
|
12
|
-
const colorStyles =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
11
|
+
const COMPONENT_ID$4 = 'grid.row';
|
|
12
|
+
const colorStyles$2 = ({
|
|
13
|
+
theme
|
|
14
|
+
}) => {
|
|
16
15
|
const borderColor = getColor({
|
|
17
16
|
theme,
|
|
18
17
|
hue: 'mint',
|
|
@@ -42,21 +41,20 @@ const flexStyles = (alignItems, justifyContent, wrap) => {
|
|
|
42
41
|
const mediaStyles = (minWidth, alignItems, justifyContent, wrap) => {
|
|
43
42
|
return css(["@media (min-width:", "){", ";}"], minWidth, flexStyles(alignItems, justifyContent, wrap));
|
|
44
43
|
};
|
|
45
|
-
const sizeStyles =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} = _ref2;
|
|
44
|
+
const sizeStyles$3 = ({
|
|
45
|
+
theme,
|
|
46
|
+
$gutters
|
|
47
|
+
}) => {
|
|
50
48
|
const margin = $gutters ? math(`${theme.space[$gutters]} / 2`) : 0;
|
|
51
49
|
return css(["margin-right:-", ";margin-left:-", ";"], margin, margin);
|
|
52
50
|
};
|
|
53
51
|
const StyledRow = styled.div.attrs(props => ({
|
|
54
|
-
'data-garden-id': COMPONENT_ID,
|
|
55
|
-
'data-garden-version': '9.12.
|
|
52
|
+
'data-garden-id': COMPONENT_ID$4,
|
|
53
|
+
'data-garden-version': '9.12.5',
|
|
56
54
|
$wrapAll: props.$wrapAll ?? 'wrap'
|
|
57
55
|
})).withConfig({
|
|
58
56
|
displayName: "StyledRow",
|
|
59
57
|
componentId: "sc-xjsdg1-0"
|
|
60
|
-
})(["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), componentStyles);
|
|
58
|
+
})(["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), componentStyles);
|
|
61
59
|
|
|
62
60
|
export { StyledRow };
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { componentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
|
-
const COMPONENT_ID = 'pane';
|
|
10
|
+
const COMPONENT_ID$3 = 'pane';
|
|
11
11
|
const StyledPane = styled.div.attrs({
|
|
12
|
-
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.12.
|
|
12
|
+
'data-garden-id': COMPONENT_ID$3,
|
|
13
|
+
'data-garden-version': '9.12.5'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledPane",
|
|
16
16
|
componentId: "sc-1ltjst7-0"
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { componentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
|
-
const COMPONENT_ID = 'pane.content';
|
|
10
|
+
const COMPONENT_ID$2 = 'pane.content';
|
|
11
11
|
const StyledPaneContent = styled.div.attrs({
|
|
12
|
-
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.12.
|
|
12
|
+
'data-garden-id': COMPONENT_ID$2,
|
|
13
|
+
'data-garden-version': '9.12.5'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledPaneContent",
|
|
16
16
|
componentId: "sc-1b38mbh-0"
|
|
@@ -8,11 +8,10 @@ import styled, { css } from 'styled-components';
|
|
|
8
8
|
import { math } from 'polished';
|
|
9
9
|
import { SELECTOR_FOCUS_VISIBLE, componentStyles, getColor, focusStyles } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
|
-
const COMPONENT_ID = 'pane.splitter';
|
|
12
|
-
const colorStyles =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
11
|
+
const COMPONENT_ID$1 = 'pane.splitter';
|
|
12
|
+
const colorStyles$1 = ({
|
|
13
|
+
theme
|
|
14
|
+
}) => {
|
|
16
15
|
const color = getColor({
|
|
17
16
|
theme,
|
|
18
17
|
variable: 'border.default'
|
|
@@ -39,12 +38,11 @@ const colorStyles = _ref => {
|
|
|
39
38
|
selector: '&:focus-visible::before'
|
|
40
39
|
}), activeColor);
|
|
41
40
|
};
|
|
42
|
-
const sizeStyles =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} = _ref2;
|
|
41
|
+
const sizeStyles$2 = ({
|
|
42
|
+
theme,
|
|
43
|
+
$orientation,
|
|
44
|
+
$isFixed
|
|
45
|
+
}) => {
|
|
48
46
|
const size = math(`${theme.shadowWidths.md} * 2`);
|
|
49
47
|
const separatorSize = math(`${theme.borderWidths.sm} * 2`);
|
|
50
48
|
const offset = math(`-${size} / 2`);
|
|
@@ -106,11 +104,11 @@ const sizeStyles = _ref2 => {
|
|
|
106
104
|
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
105
|
};
|
|
108
106
|
const StyledPaneSplitter = styled.div.attrs({
|
|
109
|
-
'data-garden-id': COMPONENT_ID,
|
|
110
|
-
'data-garden-version': '9.12.
|
|
107
|
+
'data-garden-id': COMPONENT_ID$1,
|
|
108
|
+
'data-garden-version': '9.12.5'
|
|
111
109
|
}).withConfig({
|
|
112
110
|
displayName: "StyledPaneSplitter",
|
|
113
111
|
componentId: "sc-jylemn-0"
|
|
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, componentStyles);
|
|
112
|
+
})(["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, SELECTOR_FOCUS_VISIBLE, colorStyles$1, componentStyles);
|
|
115
113
|
|
|
116
114
|
export { StyledPaneSplitter };
|
|
@@ -9,19 +9,17 @@ import { componentStyles } from '@zendeskgarden/react-theming';
|
|
|
9
9
|
import { ChevronButton } from '@zendeskgarden/react-buttons';
|
|
10
10
|
|
|
11
11
|
const getSize = theme => theme.space.base * 6;
|
|
12
|
-
const sizeStyles =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
12
|
+
const sizeStyles$1 = ({
|
|
13
|
+
theme
|
|
14
|
+
}) => {
|
|
16
15
|
const size = `${getSize(theme)}px`;
|
|
17
16
|
return css(["width:", ";min-width:", ";height:", ";"], size, size, size);
|
|
18
17
|
};
|
|
19
|
-
const transformStyles =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = _ref2;
|
|
18
|
+
const transformStyles = ({
|
|
19
|
+
$isRotated,
|
|
20
|
+
$orientation,
|
|
21
|
+
theme
|
|
22
|
+
}) => {
|
|
25
23
|
let degrees = 0;
|
|
26
24
|
if ($isRotated) {
|
|
27
25
|
degrees = theme.rtl ? -180 : 180;
|
|
@@ -36,13 +34,13 @@ const transformStyles = _ref2 => {
|
|
|
36
34
|
return css(["& > svg{transform:rotate(", "deg);}"], degrees);
|
|
37
35
|
};
|
|
38
36
|
const StyledPaneSplitterButton = styled(ChevronButton).attrs({
|
|
39
|
-
'data-garden-version': '9.12.
|
|
37
|
+
'data-garden-version': '9.12.5',
|
|
40
38
|
isBasic: true,
|
|
41
39
|
isPill: true,
|
|
42
40
|
size: 'small'
|
|
43
41
|
}).withConfig({
|
|
44
42
|
displayName: "StyledPaneSplitterButton",
|
|
45
43
|
componentId: "sc-zh032e-0"
|
|
46
|
-
})(["", ";", ";", ";"], sizeStyles, transformStyles, componentStyles);
|
|
44
|
+
})(["", ";", ";", ";"], sizeStyles$1, transformStyles, componentStyles);
|
|
47
45
|
|
|
48
46
|
export { StyledPaneSplitterButton, getSize };
|
|
@@ -11,10 +11,9 @@ import { StyledPaneSplitter } from './StyledPaneSplitter.js';
|
|
|
11
11
|
import { getSize } from './StyledPaneSplitterButton.js';
|
|
12
12
|
|
|
13
13
|
const COMPONENT_ID = 'pane.splitter_button_container';
|
|
14
|
-
const colorStyles =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
14
|
+
const colorStyles = ({
|
|
15
|
+
theme
|
|
16
|
+
}) => {
|
|
18
17
|
const backgroundColor = getColor({
|
|
19
18
|
theme,
|
|
20
19
|
variable: 'background.raised'
|
|
@@ -25,13 +24,12 @@ const colorStyles = _ref => {
|
|
|
25
24
|
}));
|
|
26
25
|
return css(["box-shadow:", ";background-color:", ";"], boxShadow, backgroundColor);
|
|
27
26
|
};
|
|
28
|
-
const positionStyles =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} = _ref2;
|
|
27
|
+
const positionStyles = ({
|
|
28
|
+
theme,
|
|
29
|
+
$orientation,
|
|
30
|
+
$placement,
|
|
31
|
+
$splitterSize
|
|
32
|
+
}) => {
|
|
35
33
|
let top;
|
|
36
34
|
let left;
|
|
37
35
|
let right;
|
|
@@ -109,17 +107,16 @@ const positionStyles = _ref2 => {
|
|
|
109
107
|
}
|
|
110
108
|
return css(["top:", ";right:", ";bottom:", ";left:", ";"], top, right, bottom, left);
|
|
111
109
|
};
|
|
112
|
-
const sizeStyles =
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
} = _ref3;
|
|
110
|
+
const sizeStyles = ({
|
|
111
|
+
theme
|
|
112
|
+
}) => {
|
|
116
113
|
const size = getSize(theme);
|
|
117
114
|
return css(["border-radius:", "px;width:", "px;height:", "px;"], size, size, size);
|
|
118
115
|
};
|
|
119
116
|
const minimumSplitterSize = theme => stripUnit(math(`${theme.shadowWidths.md} * 2 + ${getSize(theme)}`));
|
|
120
117
|
const StyledPaneSplitterButtonContainer = styled.div.attrs({
|
|
121
118
|
'data-garden-id': COMPONENT_ID,
|
|
122
|
-
'data-garden-version': '9.12.
|
|
119
|
+
'data-garden-version': '9.12.5'
|
|
123
120
|
}).withConfig({
|
|
124
121
|
displayName: "StyledPaneSplitterButtonContainer",
|
|
125
122
|
componentId: "sc-1w84y62-0"
|
package/dist/index.cjs.js
CHANGED
|
@@ -35,10 +35,9 @@ const WRAP = ['nowrap', 'wrap', 'wrap-reverse'];
|
|
|
35
35
|
const ORIENTATION = ['top', 'bottom', 'start', 'end'];
|
|
36
36
|
|
|
37
37
|
const COMPONENT_ID$6 = 'grid.col';
|
|
38
|
-
const colorStyles$4 =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} = _ref;
|
|
38
|
+
const colorStyles$4 = ({
|
|
39
|
+
theme
|
|
40
|
+
}) => {
|
|
42
41
|
const backgroundColor = reactTheming.getColor({
|
|
43
42
|
theme,
|
|
44
43
|
variable: 'background.primaryEmphasis',
|
|
@@ -92,17 +91,16 @@ const flexStyles$1 = (size, alignSelf, textAlign, offset, order, props) => {
|
|
|
92
91
|
const mediaStyles$1 = (minWidth, size, alignSelf, textAlign, offset, order, props) => {
|
|
93
92
|
return styled.css(["@media (min-width:", "){", ";}"], minWidth, flexStyles$1(size, alignSelf, textAlign, offset, order, props));
|
|
94
93
|
};
|
|
95
|
-
const sizeStyles$5 =
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
} = _ref2;
|
|
94
|
+
const sizeStyles$5 = ({
|
|
95
|
+
theme,
|
|
96
|
+
$gutters
|
|
97
|
+
}) => {
|
|
100
98
|
const padding = $gutters ? polished.math(`${theme.space[$gutters]} / 2`) : 0;
|
|
101
99
|
return styled.css(["padding-right:", ";padding-left:", ";"], padding, padding);
|
|
102
100
|
};
|
|
103
101
|
const StyledCol = styled__default.default.div.attrs(props => ({
|
|
104
102
|
'data-garden-id': COMPONENT_ID$6,
|
|
105
|
-
'data-garden-version': '9.12.
|
|
103
|
+
'data-garden-version': '9.12.5',
|
|
106
104
|
$columns: props.$columns ?? 12
|
|
107
105
|
})).withConfig({
|
|
108
106
|
displayName: "StyledCol",
|
|
@@ -110,11 +108,10 @@ const StyledCol = styled__default.default.div.attrs(props => ({
|
|
|
110
108
|
})(["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), reactTheming.componentStyles);
|
|
111
109
|
|
|
112
110
|
const COMPONENT_ID$5 = 'grid.grid';
|
|
113
|
-
const colorStyles$3 =
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
} = _ref;
|
|
111
|
+
const colorStyles$3 = ({
|
|
112
|
+
theme,
|
|
113
|
+
$debug
|
|
114
|
+
}) => {
|
|
118
115
|
const borderColor = $debug && reactTheming.getColor({
|
|
119
116
|
theme,
|
|
120
117
|
hue: 'crimson',
|
|
@@ -127,17 +124,16 @@ const colorStyles$3 = _ref => {
|
|
|
127
124
|
${borderWidth} 0 0 0 ${borderColor}
|
|
128
125
|
`);
|
|
129
126
|
};
|
|
130
|
-
const sizeStyles$4 =
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
} = _ref2;
|
|
127
|
+
const sizeStyles$4 = ({
|
|
128
|
+
theme,
|
|
129
|
+
$gutters
|
|
130
|
+
}) => {
|
|
135
131
|
const padding = $gutters ? polished.math(`${theme.space[$gutters]} / 2`) : 0;
|
|
136
132
|
return styled.css(["padding-right:", ";padding-left:", ";"], padding, padding);
|
|
137
133
|
};
|
|
138
134
|
const StyledGrid = styled__default.default.div.attrs(props => ({
|
|
139
135
|
'data-garden-id': COMPONENT_ID$5,
|
|
140
|
-
'data-garden-version': '9.12.
|
|
136
|
+
'data-garden-version': '9.12.5',
|
|
141
137
|
$gutters: props.$gutters ?? 'md'
|
|
142
138
|
})).withConfig({
|
|
143
139
|
displayName: "StyledGrid",
|
|
@@ -145,10 +141,9 @@ const StyledGrid = styled__default.default.div.attrs(props => ({
|
|
|
145
141
|
})(["direction:", ";margin-right:auto;margin-left:auto;width:100%;box-sizing:border-box;", ";", ";", ";"], props => props.theme.rtl && 'rtl', sizeStyles$4, colorStyles$3, reactTheming.componentStyles);
|
|
146
142
|
|
|
147
143
|
const COMPONENT_ID$4 = 'grid.row';
|
|
148
|
-
const colorStyles$2 =
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
} = _ref;
|
|
144
|
+
const colorStyles$2 = ({
|
|
145
|
+
theme
|
|
146
|
+
}) => {
|
|
152
147
|
const borderColor = reactTheming.getColor({
|
|
153
148
|
theme,
|
|
154
149
|
hue: 'mint',
|
|
@@ -178,17 +173,16 @@ const flexStyles = (alignItems, justifyContent, wrap) => {
|
|
|
178
173
|
const mediaStyles = (minWidth, alignItems, justifyContent, wrap) => {
|
|
179
174
|
return styled.css(["@media (min-width:", "){", ";}"], minWidth, flexStyles(alignItems, justifyContent, wrap));
|
|
180
175
|
};
|
|
181
|
-
const sizeStyles$3 =
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
} = _ref2;
|
|
176
|
+
const sizeStyles$3 = ({
|
|
177
|
+
theme,
|
|
178
|
+
$gutters
|
|
179
|
+
}) => {
|
|
186
180
|
const margin = $gutters ? polished.math(`${theme.space[$gutters]} / 2`) : 0;
|
|
187
181
|
return styled.css(["margin-right:-", ";margin-left:-", ";"], margin, margin);
|
|
188
182
|
};
|
|
189
183
|
const StyledRow = styled__default.default.div.attrs(props => ({
|
|
190
184
|
'data-garden-id': COMPONENT_ID$4,
|
|
191
|
-
'data-garden-version': '9.12.
|
|
185
|
+
'data-garden-version': '9.12.5',
|
|
192
186
|
$wrapAll: props.$wrapAll ?? 'wrap'
|
|
193
187
|
})).withConfig({
|
|
194
188
|
displayName: "StyledRow",
|
|
@@ -198,7 +192,7 @@ const StyledRow = styled__default.default.div.attrs(props => ({
|
|
|
198
192
|
const COMPONENT_ID$3 = 'pane';
|
|
199
193
|
const StyledPane = styled__default.default.div.attrs({
|
|
200
194
|
'data-garden-id': COMPONENT_ID$3,
|
|
201
|
-
'data-garden-version': '9.12.
|
|
195
|
+
'data-garden-version': '9.12.5'
|
|
202
196
|
}).withConfig({
|
|
203
197
|
displayName: "StyledPane",
|
|
204
198
|
componentId: "sc-1ltjst7-0"
|
|
@@ -207,17 +201,16 @@ const StyledPane = styled__default.default.div.attrs({
|
|
|
207
201
|
const COMPONENT_ID$2 = 'pane.content';
|
|
208
202
|
const StyledPaneContent = styled__default.default.div.attrs({
|
|
209
203
|
'data-garden-id': COMPONENT_ID$2,
|
|
210
|
-
'data-garden-version': '9.12.
|
|
204
|
+
'data-garden-version': '9.12.5'
|
|
211
205
|
}).withConfig({
|
|
212
206
|
displayName: "StyledPaneContent",
|
|
213
207
|
componentId: "sc-1b38mbh-0"
|
|
214
208
|
})(["height:100%;overflow:auto;color-scheme:only ", ";&[hidden]{display:none;}", ";"], p => p.theme.colors.base, reactTheming.componentStyles);
|
|
215
209
|
|
|
216
210
|
const COMPONENT_ID$1 = 'pane.splitter';
|
|
217
|
-
const colorStyles$1 =
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
} = _ref;
|
|
211
|
+
const colorStyles$1 = ({
|
|
212
|
+
theme
|
|
213
|
+
}) => {
|
|
221
214
|
const color = reactTheming.getColor({
|
|
222
215
|
theme,
|
|
223
216
|
variable: 'border.default'
|
|
@@ -244,12 +237,11 @@ const colorStyles$1 = _ref => {
|
|
|
244
237
|
selector: '&:focus-visible::before'
|
|
245
238
|
}), activeColor);
|
|
246
239
|
};
|
|
247
|
-
const sizeStyles$2 =
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
} = _ref2;
|
|
240
|
+
const sizeStyles$2 = ({
|
|
241
|
+
theme,
|
|
242
|
+
$orientation,
|
|
243
|
+
$isFixed
|
|
244
|
+
}) => {
|
|
253
245
|
const size = polished.math(`${theme.shadowWidths.md} * 2`);
|
|
254
246
|
const separatorSize = polished.math(`${theme.borderWidths.sm} * 2`);
|
|
255
247
|
const offset = polished.math(`-${size} / 2`);
|
|
@@ -312,26 +304,24 @@ const sizeStyles$2 = _ref2 => {
|
|
|
312
304
|
};
|
|
313
305
|
const StyledPaneSplitter = styled__default.default.div.attrs({
|
|
314
306
|
'data-garden-id': COMPONENT_ID$1,
|
|
315
|
-
'data-garden-version': '9.12.
|
|
307
|
+
'data-garden-version': '9.12.5'
|
|
316
308
|
}).withConfig({
|
|
317
309
|
displayName: "StyledPaneSplitter",
|
|
318
310
|
componentId: "sc-jylemn-0"
|
|
319
311
|
})(["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, reactTheming.componentStyles);
|
|
320
312
|
|
|
321
313
|
const getSize = theme => theme.space.base * 6;
|
|
322
|
-
const sizeStyles$1 =
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
} = _ref;
|
|
314
|
+
const sizeStyles$1 = ({
|
|
315
|
+
theme
|
|
316
|
+
}) => {
|
|
326
317
|
const size = `${getSize(theme)}px`;
|
|
327
318
|
return styled.css(["width:", ";min-width:", ";height:", ";"], size, size, size);
|
|
328
319
|
};
|
|
329
|
-
const transformStyles =
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
} = _ref2;
|
|
320
|
+
const transformStyles = ({
|
|
321
|
+
$isRotated,
|
|
322
|
+
$orientation,
|
|
323
|
+
theme
|
|
324
|
+
}) => {
|
|
335
325
|
let degrees = 0;
|
|
336
326
|
if ($isRotated) {
|
|
337
327
|
degrees = theme.rtl ? -180 : 180;
|
|
@@ -346,7 +336,7 @@ const transformStyles = _ref2 => {
|
|
|
346
336
|
return styled.css(["& > svg{transform:rotate(", "deg);}"], degrees);
|
|
347
337
|
};
|
|
348
338
|
const StyledPaneSplitterButton = styled__default.default(reactButtons.ChevronButton).attrs({
|
|
349
|
-
'data-garden-version': '9.12.
|
|
339
|
+
'data-garden-version': '9.12.5',
|
|
350
340
|
isBasic: true,
|
|
351
341
|
isPill: true,
|
|
352
342
|
size: 'small'
|
|
@@ -356,10 +346,9 @@ const StyledPaneSplitterButton = styled__default.default(reactButtons.ChevronBut
|
|
|
356
346
|
})(["", ";", ";", ";"], sizeStyles$1, transformStyles, reactTheming.componentStyles);
|
|
357
347
|
|
|
358
348
|
const COMPONENT_ID = 'pane.splitter_button_container';
|
|
359
|
-
const colorStyles =
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
} = _ref;
|
|
349
|
+
const colorStyles = ({
|
|
350
|
+
theme
|
|
351
|
+
}) => {
|
|
363
352
|
const backgroundColor = reactTheming.getColor({
|
|
364
353
|
theme,
|
|
365
354
|
variable: 'background.raised'
|
|
@@ -370,13 +359,12 @@ const colorStyles = _ref => {
|
|
|
370
359
|
}));
|
|
371
360
|
return styled.css(["box-shadow:", ";background-color:", ";"], boxShadow, backgroundColor);
|
|
372
361
|
};
|
|
373
|
-
const positionStyles =
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
} = _ref2;
|
|
362
|
+
const positionStyles = ({
|
|
363
|
+
theme,
|
|
364
|
+
$orientation,
|
|
365
|
+
$placement,
|
|
366
|
+
$splitterSize
|
|
367
|
+
}) => {
|
|
380
368
|
let top;
|
|
381
369
|
let left;
|
|
382
370
|
let right;
|
|
@@ -454,17 +442,16 @@ const positionStyles = _ref2 => {
|
|
|
454
442
|
}
|
|
455
443
|
return styled.css(["top:", ";right:", ";bottom:", ";left:", ";"], top, right, bottom, left);
|
|
456
444
|
};
|
|
457
|
-
const sizeStyles =
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
} = _ref3;
|
|
445
|
+
const sizeStyles = ({
|
|
446
|
+
theme
|
|
447
|
+
}) => {
|
|
461
448
|
const size = getSize(theme);
|
|
462
449
|
return styled.css(["border-radius:", "px;width:", "px;height:", "px;"], size, size, size);
|
|
463
450
|
};
|
|
464
451
|
const minimumSplitterSize = theme => polished.stripUnit(polished.math(`${theme.shadowWidths.md} * 2 + ${getSize(theme)}`));
|
|
465
452
|
const StyledPaneSplitterButtonContainer = styled__default.default.div.attrs({
|
|
466
453
|
'data-garden-id': COMPONENT_ID,
|
|
467
|
-
'data-garden-version': '9.12.
|
|
454
|
+
'data-garden-version': '9.12.5'
|
|
468
455
|
}).withConfig({
|
|
469
456
|
displayName: "StyledPaneSplitterButtonContainer",
|
|
470
457
|
componentId: "sc-1w84y62-0"
|
|
@@ -477,40 +464,39 @@ const useGridContext = () => {
|
|
|
477
464
|
return React.useContext(GridContext);
|
|
478
465
|
};
|
|
479
466
|
|
|
480
|
-
const Col = React__default.default.forwardRef((
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
} = _ref;
|
|
467
|
+
const Col = React__default.default.forwardRef(({
|
|
468
|
+
alignSelf,
|
|
469
|
+
alignSelfLg,
|
|
470
|
+
alignSelfMd,
|
|
471
|
+
alignSelfSm,
|
|
472
|
+
alignSelfXl,
|
|
473
|
+
alignSelfXs,
|
|
474
|
+
lg,
|
|
475
|
+
md,
|
|
476
|
+
offset,
|
|
477
|
+
offsetLg,
|
|
478
|
+
offsetMd,
|
|
479
|
+
offsetSm,
|
|
480
|
+
offsetXl,
|
|
481
|
+
offsetXs,
|
|
482
|
+
order,
|
|
483
|
+
orderLg,
|
|
484
|
+
orderMd,
|
|
485
|
+
orderSm,
|
|
486
|
+
orderXl,
|
|
487
|
+
orderXs,
|
|
488
|
+
size,
|
|
489
|
+
sm,
|
|
490
|
+
textAlign,
|
|
491
|
+
textAlignLg,
|
|
492
|
+
textAlignMd,
|
|
493
|
+
textAlignSm,
|
|
494
|
+
textAlignXl,
|
|
495
|
+
textAlignXs,
|
|
496
|
+
xl,
|
|
497
|
+
xs,
|
|
498
|
+
...other
|
|
499
|
+
}, ref) => {
|
|
514
500
|
const {
|
|
515
501
|
columns,
|
|
516
502
|
gutters,
|
|
@@ -587,28 +573,27 @@ Col.propTypes = {
|
|
|
587
573
|
orderXl: PropTypes__default.default.oneOfType([PropTypes__default.default.number, PropTypes__default.default.string])
|
|
588
574
|
};
|
|
589
575
|
|
|
590
|
-
const Row = React__default.default.forwardRef((
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
} = _ref;
|
|
576
|
+
const Row = React__default.default.forwardRef(({
|
|
577
|
+
alignItems,
|
|
578
|
+
alignItemsXs,
|
|
579
|
+
alignItemsSm,
|
|
580
|
+
alignItemsMd,
|
|
581
|
+
alignItemsLg,
|
|
582
|
+
alignItemsXl,
|
|
583
|
+
justifyContent,
|
|
584
|
+
justifyContentXs,
|
|
585
|
+
justifyContentSm,
|
|
586
|
+
justifyContentMd,
|
|
587
|
+
justifyContentLg,
|
|
588
|
+
justifyContentXl,
|
|
589
|
+
wrap,
|
|
590
|
+
wrapXs,
|
|
591
|
+
wrapSm,
|
|
592
|
+
wrapMd,
|
|
593
|
+
wrapLg,
|
|
594
|
+
wrapXl,
|
|
595
|
+
...props
|
|
596
|
+
}, ref) => {
|
|
612
597
|
const {
|
|
613
598
|
gutters,
|
|
614
599
|
debug
|
|
@@ -659,13 +644,12 @@ Row.propTypes = {
|
|
|
659
644
|
wrapXl: PropTypes__default.default.oneOf(WRAP)
|
|
660
645
|
};
|
|
661
646
|
|
|
662
|
-
const GridComponent = React__default.default.forwardRef((
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
} = _ref;
|
|
647
|
+
const GridComponent = React__default.default.forwardRef(({
|
|
648
|
+
columns = 12,
|
|
649
|
+
gutters = 'md',
|
|
650
|
+
debug,
|
|
651
|
+
...other
|
|
652
|
+
}, ref) => {
|
|
669
653
|
const value = React.useMemo(() => ({
|
|
670
654
|
columns,
|
|
671
655
|
gutters: gutters,
|
|
@@ -701,24 +685,22 @@ const getPixelsPerFr = (totalFrs, totalDimension) => {
|
|
|
701
685
|
return totalDimension / totalFrs;
|
|
702
686
|
};
|
|
703
687
|
const convertToPixels = (values, pixelsPerFr) => {
|
|
704
|
-
return Object.entries(values).reduce((prev,
|
|
705
|
-
let [key, value] = _ref;
|
|
688
|
+
return Object.entries(values).reduce((prev, [key, value]) => {
|
|
706
689
|
prev[key] = value * pixelsPerFr;
|
|
707
690
|
return prev;
|
|
708
691
|
}, {});
|
|
709
692
|
};
|
|
710
|
-
const PaneProvider =
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
} = _ref2;
|
|
693
|
+
const PaneProvider = ({
|
|
694
|
+
id,
|
|
695
|
+
totalPanesWidth,
|
|
696
|
+
totalPanesHeight,
|
|
697
|
+
defaultRowValues,
|
|
698
|
+
defaultColumnValues,
|
|
699
|
+
rowValues,
|
|
700
|
+
columnValues,
|
|
701
|
+
onChange,
|
|
702
|
+
children
|
|
703
|
+
}) => {
|
|
722
704
|
const isControlled = rowValues !== undefined && rowValues !== null && columnValues !== undefined && columnValues !== null;
|
|
723
705
|
const [rowState, setRowState] = React.useState(defaultRowValues || {});
|
|
724
706
|
const [columnState, setColumnState] = React.useState(defaultColumnValues || {});
|
|
@@ -914,21 +896,20 @@ const orientationToDimension = {
|
|
|
914
896
|
top: 'rows',
|
|
915
897
|
bottom: 'rows'
|
|
916
898
|
};
|
|
917
|
-
const SplitterComponent = React.forwardRef((
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
} = _ref;
|
|
899
|
+
const SplitterComponent = React.forwardRef(({
|
|
900
|
+
children,
|
|
901
|
+
providerId,
|
|
902
|
+
layoutKey,
|
|
903
|
+
min,
|
|
904
|
+
max,
|
|
905
|
+
orientation = 'end',
|
|
906
|
+
isFixed,
|
|
907
|
+
onMouseDown,
|
|
908
|
+
onTouchStart,
|
|
909
|
+
onKeyDown,
|
|
910
|
+
onClick,
|
|
911
|
+
...props
|
|
912
|
+
}, ref) => {
|
|
932
913
|
const paneProviderContext = usePaneProviderContextData(providerId);
|
|
933
914
|
const paneContext = usePaneContext();
|
|
934
915
|
const themeContext = React.useContext(styled.ThemeContext);
|
|
@@ -1013,12 +994,11 @@ const ContentComponent = React.forwardRef((props, ref) => {
|
|
|
1013
994
|
ContentComponent.displayName = 'Pane.Content';
|
|
1014
995
|
const Content = ContentComponent;
|
|
1015
996
|
|
|
1016
|
-
const SplitterButtonComponent = React.forwardRef((
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
} = _ref;
|
|
997
|
+
const SplitterButtonComponent = React.forwardRef(({
|
|
998
|
+
label,
|
|
999
|
+
placement: defaultPlacement,
|
|
1000
|
+
...other
|
|
1001
|
+
}, ref) => {
|
|
1022
1002
|
const {
|
|
1023
1003
|
orientation,
|
|
1024
1004
|
layoutKey,
|
|
@@ -1085,11 +1065,10 @@ const SplitterButtonComponent = React.forwardRef((_ref, ref) => {
|
|
|
1085
1065
|
SplitterButtonComponent.displayName = 'Pane.SplitterButton';
|
|
1086
1066
|
const SplitterButton = SplitterButtonComponent;
|
|
1087
1067
|
|
|
1088
|
-
const PaneComponent = React.forwardRef((
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
} = _ref;
|
|
1068
|
+
const PaneComponent = React.forwardRef(({
|
|
1069
|
+
children,
|
|
1070
|
+
...props
|
|
1071
|
+
}, ref) => {
|
|
1093
1072
|
const [paneId, setPaneId] = React.useState();
|
|
1094
1073
|
const observerRef = React.useRef(null);
|
|
1095
1074
|
const {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-grid",
|
|
3
|
-
"version": "9.12.
|
|
3
|
+
"version": "9.12.5",
|
|
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.22",
|
|
25
25
|
"@zendeskgarden/container-utilities": "^2.0.4",
|
|
26
|
-
"@zendeskgarden/react-buttons": "^9.12.
|
|
27
|
-
"@zendeskgarden/react-tooltips": "^9.12.
|
|
26
|
+
"@zendeskgarden/react-buttons": "^9.12.5",
|
|
27
|
+
"@zendeskgarden/react-tooltips": "^9.12.5",
|
|
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 || ^6.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@zendeskgarden/react-theming": "^9.12.
|
|
40
|
+
"@zendeskgarden/react-theming": "^9.12.5"
|
|
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": "a4edcee778788b0e30fc17671b95a6e239e27912"
|
|
53
53
|
}
|