@zendeskgarden/react-grid 9.0.0-next.4 → 9.0.0-next.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/README.md +10 -10
- package/dist/index.cjs.js +46 -43
- package/dist/index.esm.js +47 -44
- package/dist/typings/elements/Col.d.ts +2 -0
- package/dist/typings/elements/Grid.d.ts +7 -1
- package/dist/typings/elements/Row.d.ts +2 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -34,22 +34,22 @@ npm install react react-dom styled-components @zendeskgarden/react-theming
|
|
|
34
34
|
|
|
35
35
|
```jsx
|
|
36
36
|
import { ThemeProvider } from '@zendeskgarden/react-theming';
|
|
37
|
-
import { Grid
|
|
37
|
+
import { Grid } from '@zendeskgarden/react-grid';
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Place a `ThemeProvider` at the root of your React application
|
|
41
41
|
*/
|
|
42
42
|
<ThemeProvider>
|
|
43
43
|
<Grid>
|
|
44
|
-
<Row>
|
|
45
|
-
<Col md={4}>1 of 3</Col>
|
|
46
|
-
<Col md={4}>2 of 3</Col>
|
|
47
|
-
<Col md={4}>3 of 3</Col>
|
|
48
|
-
</Row>
|
|
49
|
-
<Row>
|
|
50
|
-
<Col md={6}>1 of 2</Col>
|
|
51
|
-
<Col md={6}>2 of 2</Col>
|
|
52
|
-
</Row>
|
|
44
|
+
<Grid.Row>
|
|
45
|
+
<Grid.Col md={4}>1 of 3</Grid.Col>
|
|
46
|
+
<Grid.Col md={4}>2 of 3</Grid.Col>
|
|
47
|
+
<Grid.Col md={4}>3 of 3</Grid.Col>
|
|
48
|
+
</Grid.Row>
|
|
49
|
+
<Grid.Row>
|
|
50
|
+
<Grid.Col md={6}>1 of 2</Grid.Col>
|
|
51
|
+
<Grid.Col md={6}>2 of 2</Grid.Col>
|
|
52
|
+
</Grid.Row>
|
|
53
53
|
</Grid>
|
|
54
54
|
</ThemeProvider>;
|
|
55
55
|
```
|
package/dist/index.cjs.js
CHANGED
|
@@ -52,7 +52,7 @@ const ORIENTATION = ['top', 'bottom', 'start', 'end'];
|
|
|
52
52
|
|
|
53
53
|
const COMPONENT_ID$6 = 'grid.col';
|
|
54
54
|
const colorStyles$4 = props => {
|
|
55
|
-
const backgroundColor = reactTheming.
|
|
55
|
+
const backgroundColor = reactTheming.getColorV8('primaryHue', 600, props.theme, 0.1);
|
|
56
56
|
return styled.css(["background-clip:content-box;background-color:", ";"], backgroundColor);
|
|
57
57
|
};
|
|
58
58
|
const flexStyles$1 = (size, alignSelf, textAlign, offset, order, props) => {
|
|
@@ -102,7 +102,7 @@ const sizeStyles$4 = props => {
|
|
|
102
102
|
};
|
|
103
103
|
const StyledCol = styled__default.default.div.attrs({
|
|
104
104
|
'data-garden-id': COMPONENT_ID$6,
|
|
105
|
-
'data-garden-version': '9.0.0-next.
|
|
105
|
+
'data-garden-version': '9.0.0-next.5'
|
|
106
106
|
}).withConfig({
|
|
107
107
|
displayName: "StyledCol",
|
|
108
108
|
componentId: "sc-inuw62-0"
|
|
@@ -114,7 +114,7 @@ StyledCol.defaultProps = {
|
|
|
114
114
|
|
|
115
115
|
const COMPONENT_ID$5 = 'grid.grid';
|
|
116
116
|
const colorStyles$3 = props => {
|
|
117
|
-
const borderColor = reactTheming.
|
|
117
|
+
const borderColor = reactTheming.getColorV8(props.theme.palette.crimson, 400, props.theme, 0.5);
|
|
118
118
|
const borderWidth = polished.math(`${props.theme.borderWidths.sm} * 2`);
|
|
119
119
|
return styled.css(["box-shadow:-", " 0 0 0 ", ",", " 0 0 0 ", ";"], borderWidth, borderColor, borderWidth, borderColor);
|
|
120
120
|
};
|
|
@@ -124,7 +124,7 @@ const sizeStyles$3 = props => {
|
|
|
124
124
|
};
|
|
125
125
|
const StyledGrid = styled__default.default.div.attrs({
|
|
126
126
|
'data-garden-id': COMPONENT_ID$5,
|
|
127
|
-
'data-garden-version': '9.0.0-next.
|
|
127
|
+
'data-garden-version': '9.0.0-next.5'
|
|
128
128
|
}).withConfig({
|
|
129
129
|
displayName: "StyledGrid",
|
|
130
130
|
componentId: "sc-oxgg5i-0"
|
|
@@ -136,7 +136,7 @@ StyledGrid.defaultProps = {
|
|
|
136
136
|
|
|
137
137
|
const COMPONENT_ID$4 = 'grid.row';
|
|
138
138
|
const colorStyles$2 = props => {
|
|
139
|
-
const borderColor = reactTheming.
|
|
139
|
+
const borderColor = reactTheming.getColorV8(props.theme.palette.mint, 600, props.theme, 0.5);
|
|
140
140
|
const borderWidth = props.theme.borderWidths.sm;
|
|
141
141
|
return styled.css(["box-shadow:inset 0 ", " 0 0 ", ",inset 0 -", " 0 0 ", ";"], borderWidth, borderColor, borderWidth, borderColor);
|
|
142
142
|
};
|
|
@@ -166,7 +166,7 @@ const sizeStyles$2 = props => {
|
|
|
166
166
|
};
|
|
167
167
|
const StyledRow = styled__default.default.div.attrs({
|
|
168
168
|
'data-garden-id': COMPONENT_ID$4,
|
|
169
|
-
'data-garden-version': '9.0.0-next.
|
|
169
|
+
'data-garden-version': '9.0.0-next.5'
|
|
170
170
|
}).withConfig({
|
|
171
171
|
displayName: "StyledRow",
|
|
172
172
|
componentId: "sc-xjsdg1-0"
|
|
@@ -179,7 +179,7 @@ StyledRow.defaultProps = {
|
|
|
179
179
|
const COMPONENT_ID$3 = 'pane';
|
|
180
180
|
const StyledPane = styled__default.default.div.attrs({
|
|
181
181
|
'data-garden-id': COMPONENT_ID$3,
|
|
182
|
-
'data-garden-version': '9.0.0-next.
|
|
182
|
+
'data-garden-version': '9.0.0-next.5'
|
|
183
183
|
}).withConfig({
|
|
184
184
|
displayName: "StyledPane",
|
|
185
185
|
componentId: "sc-1ltjst7-0"
|
|
@@ -191,7 +191,7 @@ StyledPane.defaultProps = {
|
|
|
191
191
|
const COMPONENT_ID$2 = 'pane.content';
|
|
192
192
|
const StyledPaneContent = styled__default.default.div.attrs({
|
|
193
193
|
'data-garden-id': COMPONENT_ID$2,
|
|
194
|
-
'data-garden-version': '9.0.0-next.
|
|
194
|
+
'data-garden-version': '9.0.0-next.5'
|
|
195
195
|
}).withConfig({
|
|
196
196
|
displayName: "StyledPaneContent",
|
|
197
197
|
componentId: "sc-1b38mbh-0"
|
|
@@ -202,9 +202,9 @@ StyledPaneContent.defaultProps = {
|
|
|
202
202
|
|
|
203
203
|
const COMPONENT_ID$1 = 'pane.splitter';
|
|
204
204
|
const colorStyles$1 = props => {
|
|
205
|
-
const color = reactTheming.
|
|
206
|
-
const hoverColor = reactTheming.
|
|
207
|
-
const activeColor = reactTheming.
|
|
205
|
+
const color = reactTheming.getColorV8('neutralHue', 300, props.theme);
|
|
206
|
+
const hoverColor = reactTheming.getColorV8('primaryHue', 600, props.theme);
|
|
207
|
+
const activeColor = reactTheming.getColorV8('primaryHue', 800, props.theme);
|
|
208
208
|
return styled.css(["&::before{background-color:", ";}&:hover::before{background-color:", ";}", " &:active::before{background-color:", ";}"], color, props.isHovered && hoverColor, reactTheming.focusStyles({
|
|
209
209
|
theme: props.theme,
|
|
210
210
|
hue: hoverColor,
|
|
@@ -277,7 +277,7 @@ const sizeStyles$1 = props => {
|
|
|
277
277
|
};
|
|
278
278
|
const StyledPaneSplitter = styled__default.default.div.attrs({
|
|
279
279
|
'data-garden-id': COMPONENT_ID$1,
|
|
280
|
-
'data-garden-version': '9.0.0-next.
|
|
280
|
+
'data-garden-version': '9.0.0-next.5'
|
|
281
281
|
}).withConfig({
|
|
282
282
|
displayName: "StyledPaneSplitter",
|
|
283
283
|
componentId: "sc-jylemn-0"
|
|
@@ -305,7 +305,7 @@ const colorStyles = _ref => {
|
|
|
305
305
|
let {
|
|
306
306
|
theme
|
|
307
307
|
} = _ref;
|
|
308
|
-
const boxShadow = theme.shadows.lg(`${theme.space.base}px`, `${theme.space.base * 2}px`, reactTheming.
|
|
308
|
+
const boxShadow = theme.shadows.lg(`${theme.space.base}px`, `${theme.space.base * 2}px`, reactTheming.getColorV8('chromeHue', 600, theme, 0.15));
|
|
309
309
|
return styled.css(["box-shadow:", ";", ""], boxShadow, reactTheming.focusStyles({
|
|
310
310
|
theme,
|
|
311
311
|
boxShadow
|
|
@@ -342,7 +342,7 @@ const sizeStyles = props => {
|
|
|
342
342
|
};
|
|
343
343
|
const StyledPaneSplitterButton = styled__default.default(reactButtons.ChevronButton).attrs({
|
|
344
344
|
'data-garden-id': COMPONENT_ID,
|
|
345
|
-
'data-garden-version': '9.0.0-next.
|
|
345
|
+
'data-garden-version': '9.0.0-next.5',
|
|
346
346
|
isBasic: true,
|
|
347
347
|
isPill: true,
|
|
348
348
|
size: 'small'
|
|
@@ -413,35 +413,6 @@ Col.propTypes = {
|
|
|
413
413
|
orderXl: PropTypes__default.default.oneOfType([PropTypes__default.default.number, PropTypes__default.default.string])
|
|
414
414
|
};
|
|
415
415
|
|
|
416
|
-
const Grid = React__default.default.forwardRef((_ref, ref) => {
|
|
417
|
-
let {
|
|
418
|
-
columns,
|
|
419
|
-
debug,
|
|
420
|
-
...props
|
|
421
|
-
} = _ref;
|
|
422
|
-
const value = React.useMemo(() => ({
|
|
423
|
-
columns,
|
|
424
|
-
gutters: props.gutters,
|
|
425
|
-
debug
|
|
426
|
-
}), [columns, props.gutters, debug]);
|
|
427
|
-
return React__default.default.createElement(GridContext.Provider, {
|
|
428
|
-
value: value
|
|
429
|
-
}, React__default.default.createElement(StyledGrid, _extends({
|
|
430
|
-
debug: debug,
|
|
431
|
-
ref: ref
|
|
432
|
-
}, props)));
|
|
433
|
-
});
|
|
434
|
-
Grid.displayName = 'Grid';
|
|
435
|
-
Grid.propTypes = {
|
|
436
|
-
columns: PropTypes__default.default.oneOfType([PropTypes__default.default.number, PropTypes__default.default.string]),
|
|
437
|
-
gutters: PropTypes__default.default.oneOf(SPACE),
|
|
438
|
-
debug: PropTypes__default.default.bool
|
|
439
|
-
};
|
|
440
|
-
Grid.defaultProps = {
|
|
441
|
-
columns: 12,
|
|
442
|
-
gutters: 'md'
|
|
443
|
-
};
|
|
444
|
-
|
|
445
416
|
const Row = React__default.default.forwardRef((_ref, ref) => {
|
|
446
417
|
let {
|
|
447
418
|
wrap,
|
|
@@ -480,6 +451,38 @@ Row.propTypes = {
|
|
|
480
451
|
wrapXl: PropTypes__default.default.oneOf(WRAP)
|
|
481
452
|
};
|
|
482
453
|
|
|
454
|
+
const GridComponent = React__default.default.forwardRef((_ref, ref) => {
|
|
455
|
+
let {
|
|
456
|
+
columns,
|
|
457
|
+
debug,
|
|
458
|
+
...props
|
|
459
|
+
} = _ref;
|
|
460
|
+
const value = React.useMemo(() => ({
|
|
461
|
+
columns,
|
|
462
|
+
gutters: props.gutters,
|
|
463
|
+
debug
|
|
464
|
+
}), [columns, props.gutters, debug]);
|
|
465
|
+
return React__default.default.createElement(GridContext.Provider, {
|
|
466
|
+
value: value
|
|
467
|
+
}, React__default.default.createElement(StyledGrid, _extends({
|
|
468
|
+
debug: debug,
|
|
469
|
+
ref: ref
|
|
470
|
+
}, props)));
|
|
471
|
+
});
|
|
472
|
+
GridComponent.displayName = 'Grid';
|
|
473
|
+
GridComponent.propTypes = {
|
|
474
|
+
columns: PropTypes__default.default.oneOfType([PropTypes__default.default.number, PropTypes__default.default.string]),
|
|
475
|
+
gutters: PropTypes__default.default.oneOf(SPACE),
|
|
476
|
+
debug: PropTypes__default.default.bool
|
|
477
|
+
};
|
|
478
|
+
GridComponent.defaultProps = {
|
|
479
|
+
columns: 12,
|
|
480
|
+
gutters: 'md'
|
|
481
|
+
};
|
|
482
|
+
const Grid = GridComponent;
|
|
483
|
+
Grid.Row = Row;
|
|
484
|
+
Grid.Col = Col;
|
|
485
|
+
|
|
483
486
|
const PaneProviderContext = React.createContext({});
|
|
484
487
|
const usePaneProviderContextData = providerId => {
|
|
485
488
|
const context = React.useContext(PaneProviderContext);
|
package/dist/index.esm.js
CHANGED
|
@@ -9,7 +9,7 @@ import React, { createContext, useContext, useMemo, useState, useCallback, forwa
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import styled, { css, ThemeContext } from 'styled-components';
|
|
11
11
|
import { math, stripUnit } from 'polished';
|
|
12
|
-
import { retrieveComponentStyles, DEFAULT_THEME,
|
|
12
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColorV8, SELECTOR_FOCUS_VISIBLE, focusStyles, useDocument, useText } from '@zendeskgarden/react-theming';
|
|
13
13
|
import { ChevronButton } from '@zendeskgarden/react-buttons';
|
|
14
14
|
import { useId, composeEventHandlers } from '@zendeskgarden/container-utilities';
|
|
15
15
|
import useResizeObserver from 'use-resize-observer';
|
|
@@ -43,7 +43,7 @@ const ORIENTATION = ['top', 'bottom', 'start', 'end'];
|
|
|
43
43
|
|
|
44
44
|
const COMPONENT_ID$6 = 'grid.col';
|
|
45
45
|
const colorStyles$4 = props => {
|
|
46
|
-
const backgroundColor =
|
|
46
|
+
const backgroundColor = getColorV8('primaryHue', 600, props.theme, 0.1);
|
|
47
47
|
return css(["background-clip:content-box;background-color:", ";"], backgroundColor);
|
|
48
48
|
};
|
|
49
49
|
const flexStyles$1 = (size, alignSelf, textAlign, offset, order, props) => {
|
|
@@ -93,7 +93,7 @@ const sizeStyles$4 = props => {
|
|
|
93
93
|
};
|
|
94
94
|
const StyledCol = styled.div.attrs({
|
|
95
95
|
'data-garden-id': COMPONENT_ID$6,
|
|
96
|
-
'data-garden-version': '9.0.0-next.
|
|
96
|
+
'data-garden-version': '9.0.0-next.5'
|
|
97
97
|
}).withConfig({
|
|
98
98
|
displayName: "StyledCol",
|
|
99
99
|
componentId: "sc-inuw62-0"
|
|
@@ -105,7 +105,7 @@ StyledCol.defaultProps = {
|
|
|
105
105
|
|
|
106
106
|
const COMPONENT_ID$5 = 'grid.grid';
|
|
107
107
|
const colorStyles$3 = props => {
|
|
108
|
-
const borderColor =
|
|
108
|
+
const borderColor = getColorV8(props.theme.palette.crimson, 400, props.theme, 0.5);
|
|
109
109
|
const borderWidth = math(`${props.theme.borderWidths.sm} * 2`);
|
|
110
110
|
return css(["box-shadow:-", " 0 0 0 ", ",", " 0 0 0 ", ";"], borderWidth, borderColor, borderWidth, borderColor);
|
|
111
111
|
};
|
|
@@ -115,7 +115,7 @@ const sizeStyles$3 = props => {
|
|
|
115
115
|
};
|
|
116
116
|
const StyledGrid = styled.div.attrs({
|
|
117
117
|
'data-garden-id': COMPONENT_ID$5,
|
|
118
|
-
'data-garden-version': '9.0.0-next.
|
|
118
|
+
'data-garden-version': '9.0.0-next.5'
|
|
119
119
|
}).withConfig({
|
|
120
120
|
displayName: "StyledGrid",
|
|
121
121
|
componentId: "sc-oxgg5i-0"
|
|
@@ -127,7 +127,7 @@ StyledGrid.defaultProps = {
|
|
|
127
127
|
|
|
128
128
|
const COMPONENT_ID$4 = 'grid.row';
|
|
129
129
|
const colorStyles$2 = props => {
|
|
130
|
-
const borderColor =
|
|
130
|
+
const borderColor = getColorV8(props.theme.palette.mint, 600, props.theme, 0.5);
|
|
131
131
|
const borderWidth = props.theme.borderWidths.sm;
|
|
132
132
|
return css(["box-shadow:inset 0 ", " 0 0 ", ",inset 0 -", " 0 0 ", ";"], borderWidth, borderColor, borderWidth, borderColor);
|
|
133
133
|
};
|
|
@@ -157,7 +157,7 @@ const sizeStyles$2 = props => {
|
|
|
157
157
|
};
|
|
158
158
|
const StyledRow = styled.div.attrs({
|
|
159
159
|
'data-garden-id': COMPONENT_ID$4,
|
|
160
|
-
'data-garden-version': '9.0.0-next.
|
|
160
|
+
'data-garden-version': '9.0.0-next.5'
|
|
161
161
|
}).withConfig({
|
|
162
162
|
displayName: "StyledRow",
|
|
163
163
|
componentId: "sc-xjsdg1-0"
|
|
@@ -170,7 +170,7 @@ StyledRow.defaultProps = {
|
|
|
170
170
|
const COMPONENT_ID$3 = 'pane';
|
|
171
171
|
const StyledPane = styled.div.attrs({
|
|
172
172
|
'data-garden-id': COMPONENT_ID$3,
|
|
173
|
-
'data-garden-version': '9.0.0-next.
|
|
173
|
+
'data-garden-version': '9.0.0-next.5'
|
|
174
174
|
}).withConfig({
|
|
175
175
|
displayName: "StyledPane",
|
|
176
176
|
componentId: "sc-1ltjst7-0"
|
|
@@ -182,7 +182,7 @@ StyledPane.defaultProps = {
|
|
|
182
182
|
const COMPONENT_ID$2 = 'pane.content';
|
|
183
183
|
const StyledPaneContent = styled.div.attrs({
|
|
184
184
|
'data-garden-id': COMPONENT_ID$2,
|
|
185
|
-
'data-garden-version': '9.0.0-next.
|
|
185
|
+
'data-garden-version': '9.0.0-next.5'
|
|
186
186
|
}).withConfig({
|
|
187
187
|
displayName: "StyledPaneContent",
|
|
188
188
|
componentId: "sc-1b38mbh-0"
|
|
@@ -193,9 +193,9 @@ StyledPaneContent.defaultProps = {
|
|
|
193
193
|
|
|
194
194
|
const COMPONENT_ID$1 = 'pane.splitter';
|
|
195
195
|
const colorStyles$1 = props => {
|
|
196
|
-
const color =
|
|
197
|
-
const hoverColor =
|
|
198
|
-
const activeColor =
|
|
196
|
+
const color = getColorV8('neutralHue', 300, props.theme);
|
|
197
|
+
const hoverColor = getColorV8('primaryHue', 600, props.theme);
|
|
198
|
+
const activeColor = getColorV8('primaryHue', 800, props.theme);
|
|
199
199
|
return css(["&::before{background-color:", ";}&:hover::before{background-color:", ";}", " &:active::before{background-color:", ";}"], color, props.isHovered && hoverColor, focusStyles({
|
|
200
200
|
theme: props.theme,
|
|
201
201
|
hue: hoverColor,
|
|
@@ -268,7 +268,7 @@ const sizeStyles$1 = props => {
|
|
|
268
268
|
};
|
|
269
269
|
const StyledPaneSplitter = styled.div.attrs({
|
|
270
270
|
'data-garden-id': COMPONENT_ID$1,
|
|
271
|
-
'data-garden-version': '9.0.0-next.
|
|
271
|
+
'data-garden-version': '9.0.0-next.5'
|
|
272
272
|
}).withConfig({
|
|
273
273
|
displayName: "StyledPaneSplitter",
|
|
274
274
|
componentId: "sc-jylemn-0"
|
|
@@ -296,7 +296,7 @@ const colorStyles = _ref => {
|
|
|
296
296
|
let {
|
|
297
297
|
theme
|
|
298
298
|
} = _ref;
|
|
299
|
-
const boxShadow = theme.shadows.lg(`${theme.space.base}px`, `${theme.space.base * 2}px`,
|
|
299
|
+
const boxShadow = theme.shadows.lg(`${theme.space.base}px`, `${theme.space.base * 2}px`, getColorV8('chromeHue', 600, theme, 0.15));
|
|
300
300
|
return css(["box-shadow:", ";", ""], boxShadow, focusStyles({
|
|
301
301
|
theme,
|
|
302
302
|
boxShadow
|
|
@@ -333,7 +333,7 @@ const sizeStyles = props => {
|
|
|
333
333
|
};
|
|
334
334
|
const StyledPaneSplitterButton = styled(ChevronButton).attrs({
|
|
335
335
|
'data-garden-id': COMPONENT_ID,
|
|
336
|
-
'data-garden-version': '9.0.0-next.
|
|
336
|
+
'data-garden-version': '9.0.0-next.5',
|
|
337
337
|
isBasic: true,
|
|
338
338
|
isPill: true,
|
|
339
339
|
size: 'small'
|
|
@@ -404,35 +404,6 @@ Col.propTypes = {
|
|
|
404
404
|
orderXl: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
405
405
|
};
|
|
406
406
|
|
|
407
|
-
const Grid = React.forwardRef((_ref, ref) => {
|
|
408
|
-
let {
|
|
409
|
-
columns,
|
|
410
|
-
debug,
|
|
411
|
-
...props
|
|
412
|
-
} = _ref;
|
|
413
|
-
const value = useMemo(() => ({
|
|
414
|
-
columns,
|
|
415
|
-
gutters: props.gutters,
|
|
416
|
-
debug
|
|
417
|
-
}), [columns, props.gutters, debug]);
|
|
418
|
-
return React.createElement(GridContext.Provider, {
|
|
419
|
-
value: value
|
|
420
|
-
}, React.createElement(StyledGrid, _extends({
|
|
421
|
-
debug: debug,
|
|
422
|
-
ref: ref
|
|
423
|
-
}, props)));
|
|
424
|
-
});
|
|
425
|
-
Grid.displayName = 'Grid';
|
|
426
|
-
Grid.propTypes = {
|
|
427
|
-
columns: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
428
|
-
gutters: PropTypes.oneOf(SPACE),
|
|
429
|
-
debug: PropTypes.bool
|
|
430
|
-
};
|
|
431
|
-
Grid.defaultProps = {
|
|
432
|
-
columns: 12,
|
|
433
|
-
gutters: 'md'
|
|
434
|
-
};
|
|
435
|
-
|
|
436
407
|
const Row = React.forwardRef((_ref, ref) => {
|
|
437
408
|
let {
|
|
438
409
|
wrap,
|
|
@@ -471,6 +442,38 @@ Row.propTypes = {
|
|
|
471
442
|
wrapXl: PropTypes.oneOf(WRAP)
|
|
472
443
|
};
|
|
473
444
|
|
|
445
|
+
const GridComponent = React.forwardRef((_ref, ref) => {
|
|
446
|
+
let {
|
|
447
|
+
columns,
|
|
448
|
+
debug,
|
|
449
|
+
...props
|
|
450
|
+
} = _ref;
|
|
451
|
+
const value = useMemo(() => ({
|
|
452
|
+
columns,
|
|
453
|
+
gutters: props.gutters,
|
|
454
|
+
debug
|
|
455
|
+
}), [columns, props.gutters, debug]);
|
|
456
|
+
return React.createElement(GridContext.Provider, {
|
|
457
|
+
value: value
|
|
458
|
+
}, React.createElement(StyledGrid, _extends({
|
|
459
|
+
debug: debug,
|
|
460
|
+
ref: ref
|
|
461
|
+
}, props)));
|
|
462
|
+
});
|
|
463
|
+
GridComponent.displayName = 'Grid';
|
|
464
|
+
GridComponent.propTypes = {
|
|
465
|
+
columns: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
466
|
+
gutters: PropTypes.oneOf(SPACE),
|
|
467
|
+
debug: PropTypes.bool
|
|
468
|
+
};
|
|
469
|
+
GridComponent.defaultProps = {
|
|
470
|
+
columns: 12,
|
|
471
|
+
gutters: 'md'
|
|
472
|
+
};
|
|
473
|
+
const Grid = GridComponent;
|
|
474
|
+
Grid.Row = Row;
|
|
475
|
+
Grid.Col = Col;
|
|
476
|
+
|
|
474
477
|
const PaneProviderContext = createContext({});
|
|
475
478
|
const usePaneProviderContextData = providerId => {
|
|
476
479
|
const context = useContext(PaneProviderContext);
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { IColProps } from '../types';
|
|
9
9
|
/**
|
|
10
|
+
* @deprecated use `Grid.Col` instead
|
|
11
|
+
*
|
|
10
12
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
11
13
|
*/
|
|
12
14
|
export declare const Col: React.ForwardRefExoticComponent<IColProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -6,7 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { IGridProps } from '../types';
|
|
9
|
+
import { Row } from './Row';
|
|
10
|
+
import { Col } from './Col';
|
|
11
|
+
export declare const GridComponent: React.ForwardRefExoticComponent<IGridProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
12
|
/**
|
|
10
13
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
11
14
|
*/
|
|
12
|
-
export declare const Grid: React.ForwardRefExoticComponent<IGridProps & React.RefAttributes<HTMLDivElement
|
|
15
|
+
export declare const Grid: React.ForwardRefExoticComponent<IGridProps & React.RefAttributes<HTMLDivElement>> & {
|
|
16
|
+
Row: typeof Row;
|
|
17
|
+
Col: typeof Col;
|
|
18
|
+
};
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { IRowProps } from '../types';
|
|
9
9
|
/**
|
|
10
|
+
* @deprecated use `Grid.Row` instead
|
|
11
|
+
*
|
|
10
12
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
11
13
|
*/
|
|
12
14
|
export declare const Row: React.ForwardRefExoticComponent<IRowProps & React.RefAttributes<HTMLDivElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-grid",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.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.3",
|
|
25
25
|
"@zendeskgarden/container-utilities": "^2.0.0",
|
|
26
|
-
"@zendeskgarden/react-buttons": "^9.0.0-next.
|
|
27
|
-
"@zendeskgarden/react-tooltips": "^9.0.0-next.
|
|
26
|
+
"@zendeskgarden/react-buttons": "^9.0.0-next.5",
|
|
27
|
+
"@zendeskgarden/react-tooltips": "^9.0.0-next.5",
|
|
28
28
|
"polished": "^4.0.0",
|
|
29
29
|
"prop-types": "^15.5.7",
|
|
30
30
|
"react-merge-refs": "^2.0.0",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"@zendeskgarden/react-theming": "^8.67.0",
|
|
35
35
|
"react": ">=16.8.0",
|
|
36
36
|
"react-dom": ">=16.8.0",
|
|
37
|
-
"styled-components": "^5.1
|
|
37
|
+
"styled-components": "^5.3.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@zendeskgarden/react-theming": "^9.0.0-next.
|
|
40
|
+
"@zendeskgarden/react-theming": "^9.0.0-next.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": "806fa33feb06142c3f69b6a87b53628469117e4d"
|
|
53
53
|
}
|