@instructure/ui-grid 8.8.1-snapshot.3 → 8.8.1-snapshot.63
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/es/Grid/index.js +3 -17
- package/{src/Grid/types.ts → es/Grid/props.js} +15 -13
- package/es/GridCol/index.js +5 -39
- package/es/GridCol/props.js +53 -0
- package/es/GridRow/index.js +3 -21
- package/{src/GridRow/types.ts → es/GridRow/props.js} +16 -14
- package/lib/Grid/index.js +4 -20
- package/lib/Grid/props.js +52 -0
- package/lib/GridCol/index.js +5 -40
- package/lib/GridCol/props.js +64 -0
- package/lib/GridRow/index.js +4 -24
- package/lib/GridRow/props.js +53 -0
- package/package.json +13 -13
- package/src/Grid/index.tsx +6 -25
- package/src/Grid/props.ts +78 -0
- package/src/Grid/styles.ts +1 -1
- package/src/GridCol/index.tsx +6 -51
- package/src/GridCol/{types.ts → props.ts} +73 -4
- package/src/GridCol/styles.ts +1 -1
- package/src/GridRow/index.tsx +6 -28
- package/src/GridRow/props.ts +82 -0
- package/src/GridRow/styles.ts +1 -1
- package/src/index.ts +3 -3
- package/types/Grid/index.d.ts +19 -16
- package/types/Grid/index.d.ts.map +1 -1
- package/types/Grid/props.d.ts +21 -0
- package/types/Grid/props.d.ts.map +1 -0
- package/types/Grid/styles.d.ts +1 -1
- package/types/GridCol/index.d.ts +31 -30
- package/types/GridCol/index.d.ts.map +1 -1
- package/types/GridCol/{types.d.ts → props.d.ts} +14 -5
- package/types/GridCol/props.d.ts.map +1 -0
- package/types/GridCol/styles.d.ts +1 -1
- package/types/GridRow/index.d.ts +21 -17
- package/types/GridRow/index.d.ts.map +1 -1
- package/types/GridRow/props.d.ts +22 -0
- package/types/GridRow/props.d.ts.map +1 -0
- package/types/GridRow/styles.d.ts +1 -1
- package/types/index.d.ts +3 -3
- package/es/Grid/types.js +0 -1
- package/es/GridCol/types.js +0 -1
- package/es/GridRow/types.js +0 -1
- package/lib/Grid/types.js +0 -1
- package/lib/GridCol/types.js +0 -1
- package/lib/GridRow/types.js +0 -1
- package/types/Grid/types.d.ts +0 -12
- package/types/Grid/types.d.ts.map +0 -1
- package/types/GridCol/types.d.ts.map +0 -1
- package/types/GridRow/types.d.ts +0 -13
- package/types/GridRow/types.d.ts.map +0 -1
package/es/Grid/index.js
CHANGED
|
@@ -30,15 +30,13 @@ var _dec, _class, _class2, _temp;
|
|
|
30
30
|
|
|
31
31
|
/** @jsx jsx */
|
|
32
32
|
import { Component, Children } from 'react';
|
|
33
|
-
import PropTypes from 'prop-types';
|
|
34
|
-
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
35
33
|
import { safeCloneElement, matchComponentTypes, omitProps, pickProps } from '@instructure/ui-react-utils';
|
|
36
|
-
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
37
34
|
import { GridRow } from '../GridRow';
|
|
38
35
|
import { GridCol } from '../GridCol';
|
|
39
36
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
40
37
|
import generateStyle from './styles';
|
|
41
38
|
import generateComponentTheme from './theme';
|
|
39
|
+
import { propTypes, allowedProps } from './props';
|
|
42
40
|
|
|
43
41
|
/**
|
|
44
42
|
---
|
|
@@ -82,23 +80,11 @@ let Grid = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
|
82
80
|
|
|
83
81
|
const props = omitProps(restProps, Grid.propTypes);
|
|
84
82
|
return jsx("span", Object.assign({}, props, {
|
|
85
|
-
css: styles.grid
|
|
83
|
+
css: styles === null || styles === void 0 ? void 0 : styles.grid
|
|
86
84
|
}), this.renderChildren());
|
|
87
85
|
}
|
|
88
86
|
|
|
89
|
-
}, _class2.displayName = "Grid", _class2.componentId = 'Grid', _class2.propTypes = {
|
|
90
|
-
// eslint-disable-next-line react/require-default-props
|
|
91
|
-
makeStyles: PropTypes.func,
|
|
92
|
-
// eslint-disable-next-line react/require-default-props
|
|
93
|
-
styles: PropTypes.object,
|
|
94
|
-
children: ChildrenPropTypes.oneOf([GridRow, ScreenReaderContent]),
|
|
95
|
-
colSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
96
|
-
rowSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
97
|
-
hAlign: PropTypes.oneOf(['start', 'center', 'end', 'space-around', 'space-between']),
|
|
98
|
-
vAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
99
|
-
startAt: PropTypes.oneOf(['small', 'medium', 'large', 'x-large', null]),
|
|
100
|
-
visualDebug: PropTypes.bool
|
|
101
|
-
}, _class2.defaultProps = {
|
|
87
|
+
}, _class2.displayName = "Grid", _class2.componentId = 'Grid', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
102
88
|
colSpacing: 'medium',
|
|
103
89
|
rowSpacing: 'medium',
|
|
104
90
|
hAlign: 'start',
|
|
@@ -21,16 +21,18 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
colSpacing
|
|
31
|
-
rowSpacing
|
|
32
|
-
hAlign
|
|
33
|
-
vAlign
|
|
34
|
-
startAt
|
|
35
|
-
visualDebug
|
|
36
|
-
}
|
|
24
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
26
|
+
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
27
|
+
import { GridRow } from '../GridRow';
|
|
28
|
+
const propTypes = {
|
|
29
|
+
children: ChildrenPropTypes.oneOf([GridRow, ScreenReaderContent]),
|
|
30
|
+
colSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
31
|
+
rowSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
32
|
+
hAlign: PropTypes.oneOf(['start', 'center', 'end', 'space-around', 'space-between']),
|
|
33
|
+
vAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
34
|
+
startAt: PropTypes.oneOf(['small', 'medium', 'large', 'x-large', null]),
|
|
35
|
+
visualDebug: PropTypes.bool
|
|
36
|
+
};
|
|
37
|
+
const allowedProps = ['children', 'colSpacing', 'rowSpacing', 'hAlign', 'vAlign', 'startAt', 'visualDebug'];
|
|
38
|
+
export { propTypes, allowedProps };
|
package/es/GridCol/index.js
CHANGED
|
@@ -26,24 +26,19 @@ var _dec, _class, _class2, _temp;
|
|
|
26
26
|
|
|
27
27
|
/** @jsx jsx */
|
|
28
28
|
import { Component } from 'react';
|
|
29
|
-
import PropTypes from 'prop-types';
|
|
30
29
|
import { omitProps } from '@instructure/ui-react-utils';
|
|
31
30
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
32
31
|
import generateStyle from './styles';
|
|
33
32
|
import generateComponentTheme from './theme';
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
import { propTypes, allowedProps } from './props';
|
|
34
|
+
|
|
36
35
|
/**
|
|
37
36
|
---
|
|
38
37
|
parent: Grid
|
|
39
38
|
id: Grid.Col
|
|
40
39
|
---
|
|
41
40
|
**/
|
|
42
|
-
|
|
43
41
|
let GridCol = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class GridCol extends Component {
|
|
44
|
-
/* eslint-disable react/require-default-props */
|
|
45
|
-
|
|
46
|
-
/* eslint-enable react/require-default-props */
|
|
47
42
|
componentDidMount() {
|
|
48
43
|
this.props.makeStyles();
|
|
49
44
|
}
|
|
@@ -59,44 +54,15 @@ let GridCol = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_cl
|
|
|
59
54
|
const props = omitProps(this.props, GridCol.propTypes);
|
|
60
55
|
return jsx("span", Object.assign({}, props, {
|
|
61
56
|
ref: this.props.elementRef,
|
|
62
|
-
css: styles.gridCol
|
|
57
|
+
css: styles === null || styles === void 0 ? void 0 : styles.gridCol
|
|
63
58
|
}), children);
|
|
64
59
|
}
|
|
65
60
|
|
|
66
|
-
}, _class2.displayName = "GridCol", _class2.componentId = 'Grid.Col', _class2.propTypes = {
|
|
67
|
-
// eslint-disable-next-line react/require-default-props
|
|
68
|
-
makeStyles: PropTypes.func,
|
|
69
|
-
// eslint-disable-next-line react/require-default-props
|
|
70
|
-
styles: PropTypes.object,
|
|
71
|
-
children: PropTypes.node,
|
|
72
|
-
colSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
73
|
-
rowSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
74
|
-
textAlign: PropTypes.oneOf(['start', 'end', 'center', 'inherit']),
|
|
75
|
-
hAlign: PropTypes.oneOf(['start', 'center', 'end', 'space-around', 'space-between']),
|
|
76
|
-
vAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
77
|
-
startAt: PropTypes.oneOf(['small', 'medium', 'large', 'x-large', null]),
|
|
78
|
-
visualDebug: PropTypes.bool,
|
|
79
|
-
width: PropTypes.oneOfType([PropTypes.oneOf(COL_WIDTHS), PropTypes.shape({
|
|
80
|
-
small: PropTypes.oneOf(COL_WIDTHS),
|
|
81
|
-
medium: PropTypes.oneOf(COL_WIDTHS),
|
|
82
|
-
large: PropTypes.oneOf(COL_WIDTHS),
|
|
83
|
-
xLarge: PropTypes.oneOf(COL_WIDTHS)
|
|
84
|
-
})]),
|
|
85
|
-
offset: PropTypes.oneOfType([PropTypes.oneOf(COL_WIDTHS), PropTypes.shape({
|
|
86
|
-
small: PropTypes.oneOf(COL_WIDTHS),
|
|
87
|
-
medium: PropTypes.oneOf(COL_WIDTHS),
|
|
88
|
-
large: PropTypes.oneOf(COL_WIDTHS),
|
|
89
|
-
xLarge: PropTypes.oneOf(COL_WIDTHS)
|
|
90
|
-
})]),
|
|
91
|
-
isLastRow: PropTypes.bool,
|
|
92
|
-
isLastCol: PropTypes.bool,
|
|
93
|
-
elementRef: PropTypes.func
|
|
94
|
-
}, _class2.defaultProps = {
|
|
61
|
+
}, _class2.displayName = "GridCol", _class2.componentId = 'Grid.Col', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
95
62
|
textAlign: 'inherit',
|
|
96
63
|
children: null,
|
|
97
64
|
isLastCol: false,
|
|
98
|
-
isLastRow: false
|
|
99
|
-
elementRef: void 0
|
|
65
|
+
isLastRow: false
|
|
100
66
|
}, _temp)) || _class);
|
|
101
67
|
export default GridCol;
|
|
102
68
|
export { GridCol };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
// TODO: get numcols from theme config
|
|
26
|
+
const COL_WIDTHS = ['auto', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
27
|
+
const propTypes = {
|
|
28
|
+
children: PropTypes.node,
|
|
29
|
+
colSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
30
|
+
rowSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
31
|
+
textAlign: PropTypes.oneOf(['start', 'end', 'center', 'inherit']),
|
|
32
|
+
hAlign: PropTypes.oneOf(['start', 'center', 'end', 'space-around', 'space-between']),
|
|
33
|
+
vAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
34
|
+
startAt: PropTypes.oneOf(['small', 'medium', 'large', 'x-large', null]),
|
|
35
|
+
visualDebug: PropTypes.bool,
|
|
36
|
+
width: PropTypes.oneOfType([PropTypes.oneOf(COL_WIDTHS), PropTypes.shape({
|
|
37
|
+
small: PropTypes.oneOf(COL_WIDTHS),
|
|
38
|
+
medium: PropTypes.oneOf(COL_WIDTHS),
|
|
39
|
+
large: PropTypes.oneOf(COL_WIDTHS),
|
|
40
|
+
xLarge: PropTypes.oneOf(COL_WIDTHS)
|
|
41
|
+
})]),
|
|
42
|
+
offset: PropTypes.oneOfType([PropTypes.oneOf(COL_WIDTHS), PropTypes.shape({
|
|
43
|
+
small: PropTypes.oneOf(COL_WIDTHS),
|
|
44
|
+
medium: PropTypes.oneOf(COL_WIDTHS),
|
|
45
|
+
large: PropTypes.oneOf(COL_WIDTHS),
|
|
46
|
+
xLarge: PropTypes.oneOf(COL_WIDTHS)
|
|
47
|
+
})]),
|
|
48
|
+
isLastRow: PropTypes.bool,
|
|
49
|
+
isLastCol: PropTypes.bool,
|
|
50
|
+
elementRef: PropTypes.func
|
|
51
|
+
};
|
|
52
|
+
const allowedProps = ['children', 'colSpacing', 'rowSpacing', 'textAlign', 'hAlign', 'vAlign', 'startAt', 'visualDebug', 'width', 'offset', 'isLastRow', 'isLastCol', 'elementRef'];
|
|
53
|
+
export { propTypes, allowedProps };
|
package/es/GridRow/index.js
CHANGED
|
@@ -30,14 +30,12 @@ var _dec, _class, _class2, _temp;
|
|
|
30
30
|
|
|
31
31
|
/** @jsx jsx */
|
|
32
32
|
import { Component, Children } from 'react';
|
|
33
|
-
import PropTypes from 'prop-types';
|
|
34
|
-
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
35
33
|
import { safeCloneElement, matchComponentTypes, omitProps, pickProps } from '@instructure/ui-react-utils';
|
|
36
|
-
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
37
34
|
import { GridCol } from '../GridCol';
|
|
38
35
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
39
36
|
import generateStyle from './styles';
|
|
40
37
|
import generateComponentTheme from './theme';
|
|
38
|
+
import { propTypes, allowedProps } from './props';
|
|
41
39
|
|
|
42
40
|
/**
|
|
43
41
|
---
|
|
@@ -46,9 +44,6 @@ id: Grid.Row
|
|
|
46
44
|
---
|
|
47
45
|
**/
|
|
48
46
|
let GridRow = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class GridRow extends Component {
|
|
49
|
-
/* eslint-disable react/require-default-props */
|
|
50
|
-
|
|
51
|
-
/* eslint-enable react/require-default-props */
|
|
52
47
|
componentDidMount() {
|
|
53
48
|
this.props.makeStyles();
|
|
54
49
|
}
|
|
@@ -85,24 +80,11 @@ let GridRow = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_cl
|
|
|
85
80
|
|
|
86
81
|
const props = omitProps(restProps, GridRow.propTypes);
|
|
87
82
|
return jsx("span", Object.assign({}, props, {
|
|
88
|
-
css: styles.gridRow
|
|
83
|
+
css: styles === null || styles === void 0 ? void 0 : styles.gridRow
|
|
89
84
|
}), this.renderChildren());
|
|
90
85
|
}
|
|
91
86
|
|
|
92
|
-
}, _class2.displayName = "GridRow", _class2.componentId = 'Grid.Row', _class2.propTypes = {
|
|
93
|
-
// eslint-disable-next-line react/require-default-props
|
|
94
|
-
makeStyles: PropTypes.func,
|
|
95
|
-
// eslint-disable-next-line react/require-default-props
|
|
96
|
-
styles: PropTypes.object,
|
|
97
|
-
children: ChildrenPropTypes.oneOf([GridCol, ScreenReaderContent]),
|
|
98
|
-
rowSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
99
|
-
colSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
100
|
-
hAlign: PropTypes.oneOf(['start', 'center', 'end', 'space-around', 'space-between']),
|
|
101
|
-
vAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
102
|
-
startAt: PropTypes.oneOf(['small', 'medium', 'large', 'x-large', null]),
|
|
103
|
-
visualDebug: PropTypes.bool,
|
|
104
|
-
isLastRow: PropTypes.bool
|
|
105
|
-
}, _class2.defaultProps = {
|
|
87
|
+
}, _class2.displayName = "GridRow", _class2.componentId = 'Grid.Row', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
106
88
|
children: null,
|
|
107
89
|
isLastRow: false
|
|
108
90
|
}, _temp)) || _class);
|
|
@@ -21,17 +21,19 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
rowSpacing
|
|
31
|
-
colSpacing
|
|
32
|
-
hAlign
|
|
33
|
-
vAlign
|
|
34
|
-
startAt
|
|
35
|
-
visualDebug
|
|
36
|
-
isLastRow
|
|
37
|
-
}
|
|
24
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
26
|
+
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
27
|
+
import { GridCol } from '../GridCol';
|
|
28
|
+
const propTypes = {
|
|
29
|
+
children: ChildrenPropTypes.oneOf([GridCol, ScreenReaderContent]),
|
|
30
|
+
rowSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
31
|
+
colSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
32
|
+
hAlign: PropTypes.oneOf(['start', 'center', 'end', 'space-around', 'space-between']),
|
|
33
|
+
vAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
34
|
+
startAt: PropTypes.oneOf(['small', 'medium', 'large', 'x-large', null]),
|
|
35
|
+
visualDebug: PropTypes.bool,
|
|
36
|
+
isLastRow: PropTypes.bool
|
|
37
|
+
};
|
|
38
|
+
const allowedProps = ['children', 'rowSpacing', 'colSpacing', 'hAlign', 'vAlign', 'startAt', 'visualDebug', 'isLastRow'];
|
|
39
|
+
export { propTypes, allowedProps };
|
package/lib/Grid/index.js
CHANGED
|
@@ -23,10 +23,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
23
23
|
|
|
24
24
|
var _react = require("react");
|
|
25
25
|
|
|
26
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
-
|
|
28
|
-
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
29
|
-
|
|
30
26
|
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
31
27
|
|
|
32
28
|
var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
|
|
@@ -35,8 +31,6 @@ var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
|
35
31
|
|
|
36
32
|
var _pickProps = require("@instructure/ui-react-utils/lib/pickProps.js");
|
|
37
33
|
|
|
38
|
-
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
39
|
-
|
|
40
34
|
var _GridRow = require("../GridRow");
|
|
41
35
|
|
|
42
36
|
var _GridCol = require("../GridCol");
|
|
@@ -47,6 +41,8 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
47
41
|
|
|
48
42
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
49
43
|
|
|
44
|
+
var _props = require("./props");
|
|
45
|
+
|
|
50
46
|
const _excluded = ["styles", "makeStyles"],
|
|
51
47
|
_excluded2 = ["styles"];
|
|
52
48
|
|
|
@@ -94,23 +90,11 @@ let Grid = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
94
90
|
restProps = (0, _objectWithoutProperties2.default)(_this$props2, _excluded2);
|
|
95
91
|
const props = (0, _omitProps.omitProps)(restProps, Grid.propTypes);
|
|
96
92
|
return (0, _emotion.jsx)("span", Object.assign({}, props, {
|
|
97
|
-
css: styles.grid
|
|
93
|
+
css: styles === null || styles === void 0 ? void 0 : styles.grid
|
|
98
94
|
}), this.renderChildren());
|
|
99
95
|
}
|
|
100
96
|
|
|
101
|
-
}, _class2.displayName = "Grid", _class2.componentId = 'Grid', _class2.propTypes = {
|
|
102
|
-
// eslint-disable-next-line react/require-default-props
|
|
103
|
-
makeStyles: _propTypes.default.func,
|
|
104
|
-
// eslint-disable-next-line react/require-default-props
|
|
105
|
-
styles: _propTypes.default.object,
|
|
106
|
-
children: _Children.Children.oneOf([_GridRow.GridRow, _ScreenReaderContent.ScreenReaderContent]),
|
|
107
|
-
colSpacing: _propTypes.default.oneOf(['none', 'small', 'medium', 'large']),
|
|
108
|
-
rowSpacing: _propTypes.default.oneOf(['none', 'small', 'medium', 'large']),
|
|
109
|
-
hAlign: _propTypes.default.oneOf(['start', 'center', 'end', 'space-around', 'space-between']),
|
|
110
|
-
vAlign: _propTypes.default.oneOf(['top', 'middle', 'bottom']),
|
|
111
|
-
startAt: _propTypes.default.oneOf(['small', 'medium', 'large', 'x-large', null]),
|
|
112
|
-
visualDebug: _propTypes.default.bool
|
|
113
|
-
}, _class2.defaultProps = {
|
|
97
|
+
}, _class2.displayName = "Grid", _class2.componentId = 'Grid', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
114
98
|
colSpacing: 'medium',
|
|
115
99
|
rowSpacing: 'medium',
|
|
116
100
|
hAlign: 'start',
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.allowedProps = exports.propTypes = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
13
|
+
|
|
14
|
+
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
15
|
+
|
|
16
|
+
var _GridRow = require("../GridRow");
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* The MIT License (MIT)
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
22
|
+
*
|
|
23
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
24
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
25
|
+
* in the Software without restriction, including without limitation the rights
|
|
26
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
27
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
28
|
+
* furnished to do so, subject to the following conditions:
|
|
29
|
+
*
|
|
30
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
31
|
+
* copies or substantial portions of the Software.
|
|
32
|
+
*
|
|
33
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
34
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
35
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
36
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
37
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
38
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
39
|
+
* SOFTWARE.
|
|
40
|
+
*/
|
|
41
|
+
const propTypes = {
|
|
42
|
+
children: _Children.Children.oneOf([_GridRow.GridRow, _ScreenReaderContent.ScreenReaderContent]),
|
|
43
|
+
colSpacing: _propTypes.default.oneOf(['none', 'small', 'medium', 'large']),
|
|
44
|
+
rowSpacing: _propTypes.default.oneOf(['none', 'small', 'medium', 'large']),
|
|
45
|
+
hAlign: _propTypes.default.oneOf(['start', 'center', 'end', 'space-around', 'space-between']),
|
|
46
|
+
vAlign: _propTypes.default.oneOf(['top', 'middle', 'bottom']),
|
|
47
|
+
startAt: _propTypes.default.oneOf(['small', 'medium', 'large', 'x-large', null]),
|
|
48
|
+
visualDebug: _propTypes.default.bool
|
|
49
|
+
};
|
|
50
|
+
exports.propTypes = propTypes;
|
|
51
|
+
const allowedProps = ['children', 'colSpacing', 'rowSpacing', 'hAlign', 'vAlign', 'startAt', 'visualDebug'];
|
|
52
|
+
exports.allowedProps = allowedProps;
|
package/lib/GridCol/index.js
CHANGED
|
@@ -9,8 +9,6 @@ exports.GridCol = exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
12
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
15
13
|
|
|
16
14
|
var _emotion = require("@instructure/emotion");
|
|
@@ -19,21 +17,17 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
19
17
|
|
|
20
18
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
21
19
|
|
|
20
|
+
var _props = require("./props");
|
|
21
|
+
|
|
22
22
|
var _dec, _class, _class2, _temp;
|
|
23
23
|
|
|
24
|
-
// TODO: get numcols from theme config
|
|
25
|
-
const COL_WIDTHS = ['auto', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
26
24
|
/**
|
|
27
25
|
---
|
|
28
26
|
parent: Grid
|
|
29
27
|
id: Grid.Col
|
|
30
28
|
---
|
|
31
29
|
**/
|
|
32
|
-
|
|
33
30
|
let GridCol = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class GridCol extends _react.Component {
|
|
34
|
-
/* eslint-disable react/require-default-props */
|
|
35
|
-
|
|
36
|
-
/* eslint-enable react/require-default-props */
|
|
37
31
|
componentDidMount() {
|
|
38
32
|
this.props.makeStyles();
|
|
39
33
|
}
|
|
@@ -49,44 +43,15 @@ let GridCol = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
49
43
|
const props = (0, _omitProps.omitProps)(this.props, GridCol.propTypes);
|
|
50
44
|
return (0, _emotion.jsx)("span", Object.assign({}, props, {
|
|
51
45
|
ref: this.props.elementRef,
|
|
52
|
-
css: styles.gridCol
|
|
46
|
+
css: styles === null || styles === void 0 ? void 0 : styles.gridCol
|
|
53
47
|
}), children);
|
|
54
48
|
}
|
|
55
49
|
|
|
56
|
-
}, _class2.displayName = "GridCol", _class2.componentId = 'Grid.Col', _class2.propTypes = {
|
|
57
|
-
// eslint-disable-next-line react/require-default-props
|
|
58
|
-
makeStyles: _propTypes.default.func,
|
|
59
|
-
// eslint-disable-next-line react/require-default-props
|
|
60
|
-
styles: _propTypes.default.object,
|
|
61
|
-
children: _propTypes.default.node,
|
|
62
|
-
colSpacing: _propTypes.default.oneOf(['none', 'small', 'medium', 'large']),
|
|
63
|
-
rowSpacing: _propTypes.default.oneOf(['none', 'small', 'medium', 'large']),
|
|
64
|
-
textAlign: _propTypes.default.oneOf(['start', 'end', 'center', 'inherit']),
|
|
65
|
-
hAlign: _propTypes.default.oneOf(['start', 'center', 'end', 'space-around', 'space-between']),
|
|
66
|
-
vAlign: _propTypes.default.oneOf(['top', 'middle', 'bottom']),
|
|
67
|
-
startAt: _propTypes.default.oneOf(['small', 'medium', 'large', 'x-large', null]),
|
|
68
|
-
visualDebug: _propTypes.default.bool,
|
|
69
|
-
width: _propTypes.default.oneOfType([_propTypes.default.oneOf(COL_WIDTHS), _propTypes.default.shape({
|
|
70
|
-
small: _propTypes.default.oneOf(COL_WIDTHS),
|
|
71
|
-
medium: _propTypes.default.oneOf(COL_WIDTHS),
|
|
72
|
-
large: _propTypes.default.oneOf(COL_WIDTHS),
|
|
73
|
-
xLarge: _propTypes.default.oneOf(COL_WIDTHS)
|
|
74
|
-
})]),
|
|
75
|
-
offset: _propTypes.default.oneOfType([_propTypes.default.oneOf(COL_WIDTHS), _propTypes.default.shape({
|
|
76
|
-
small: _propTypes.default.oneOf(COL_WIDTHS),
|
|
77
|
-
medium: _propTypes.default.oneOf(COL_WIDTHS),
|
|
78
|
-
large: _propTypes.default.oneOf(COL_WIDTHS),
|
|
79
|
-
xLarge: _propTypes.default.oneOf(COL_WIDTHS)
|
|
80
|
-
})]),
|
|
81
|
-
isLastRow: _propTypes.default.bool,
|
|
82
|
-
isLastCol: _propTypes.default.bool,
|
|
83
|
-
elementRef: _propTypes.default.func
|
|
84
|
-
}, _class2.defaultProps = {
|
|
50
|
+
}, _class2.displayName = "GridCol", _class2.componentId = 'Grid.Col', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
85
51
|
textAlign: 'inherit',
|
|
86
52
|
children: null,
|
|
87
53
|
isLastCol: false,
|
|
88
|
-
isLastRow: false
|
|
89
|
-
elementRef: void 0
|
|
54
|
+
isLastRow: false
|
|
90
55
|
}, _temp)) || _class);
|
|
91
56
|
exports.GridCol = GridCol;
|
|
92
57
|
var _default = GridCol;
|