@instructure/ui-grid 8.12.1-snapshot.15 → 8.12.1-snapshot.16
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 +15 -10
- package/es/GridCol/index.js +11 -6
- package/es/GridCol/props.js +0 -4
- package/es/GridCol/styles.js +2 -2
- package/es/GridRow/index.js +15 -10
- package/lib/Grid/index.js +15 -10
- package/lib/GridCol/index.js +11 -6
- package/lib/GridCol/props.js +0 -4
- package/lib/GridCol/styles.js +2 -2
- package/lib/GridRow/index.js +15 -10
- package/package.json +13 -13
- package/src/Grid/index.tsx +6 -8
- package/src/Grid/props.ts +3 -0
- package/src/GridCol/index.tsx +4 -6
- package/src/GridCol/props.ts +15 -14
- package/src/GridCol/styles.ts +10 -10
- package/src/GridRow/index.tsx +6 -8
- package/src/GridRow/props.ts +3 -0
- package/types/Grid/index.d.ts +2 -1
- package/types/Grid/index.d.ts.map +1 -1
- package/types/Grid/props.d.ts +3 -0
- package/types/Grid/props.d.ts.map +1 -1
- package/types/GridCol/index.d.ts +26 -5
- package/types/GridCol/index.d.ts.map +1 -1
- package/types/GridCol/props.d.ts +14 -10
- package/types/GridCol/props.d.ts.map +1 -1
- package/types/GridCol/styles.d.ts.map +1 -1
- package/types/GridRow/index.d.ts +2 -1
- package/types/GridRow/index.d.ts.map +1 -1
- package/types/GridRow/props.d.ts +3 -0
- package/types/GridRow/props.d.ts.map +1 -1
package/es/Grid/index.js
CHANGED
|
@@ -42,6 +42,7 @@ import { propTypes, allowedProps } from './props';
|
|
|
42
42
|
---
|
|
43
43
|
category: components
|
|
44
44
|
---
|
|
45
|
+
@tsProps
|
|
45
46
|
**/
|
|
46
47
|
let Grid = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class Grid extends Component {
|
|
47
48
|
constructor(...args) {
|
|
@@ -54,18 +55,22 @@ let Grid = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
componentDidMount() {
|
|
57
|
-
|
|
58
|
+
var _this$props$makeStyle, _this$props;
|
|
59
|
+
|
|
60
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
componentDidUpdate(
|
|
61
|
-
|
|
63
|
+
componentDidUpdate() {
|
|
64
|
+
var _this$props$makeStyle2, _this$props2;
|
|
65
|
+
|
|
66
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
renderChildren() {
|
|
65
|
-
const _this$
|
|
66
|
-
styles = _this$
|
|
67
|
-
makeStyles = _this$
|
|
68
|
-
props = _objectWithoutProperties(_this$
|
|
70
|
+
const _this$props3 = this.props,
|
|
71
|
+
styles = _this$props3.styles,
|
|
72
|
+
makeStyles = _this$props3.makeStyles,
|
|
73
|
+
props = _objectWithoutProperties(_this$props3, _excluded);
|
|
69
74
|
|
|
70
75
|
const children = Children.toArray(this.props.children);
|
|
71
76
|
return children.map((child, index) => {
|
|
@@ -83,9 +88,9 @@ let Grid = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
|
83
88
|
}
|
|
84
89
|
|
|
85
90
|
render() {
|
|
86
|
-
const _this$
|
|
87
|
-
styles = _this$
|
|
88
|
-
restProps = _objectWithoutProperties(_this$
|
|
91
|
+
const _this$props4 = this.props,
|
|
92
|
+
styles = _this$props4.styles,
|
|
93
|
+
restProps = _objectWithoutProperties(_this$props4, _excluded2);
|
|
89
94
|
|
|
90
95
|
const props = omitProps(restProps, Grid.allowedProps);
|
|
91
96
|
return jsx("span", Object.assign({}, props, {
|
package/es/GridCol/index.js
CHANGED
|
@@ -37,6 +37,7 @@ import { propTypes, allowedProps } from './props';
|
|
|
37
37
|
parent: Grid
|
|
38
38
|
id: Grid.Col
|
|
39
39
|
---
|
|
40
|
+
@tsProps
|
|
40
41
|
**/
|
|
41
42
|
let GridCol = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class GridCol extends Component {
|
|
42
43
|
constructor(...args) {
|
|
@@ -54,17 +55,21 @@ let GridCol = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_cl
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
componentDidMount() {
|
|
57
|
-
|
|
58
|
+
var _this$props$makeStyle, _this$props;
|
|
59
|
+
|
|
60
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
componentDidUpdate(
|
|
61
|
-
|
|
63
|
+
componentDidUpdate() {
|
|
64
|
+
var _this$props$makeStyle2, _this$props2;
|
|
65
|
+
|
|
66
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
render() {
|
|
65
|
-
const _this$
|
|
66
|
-
children = _this$
|
|
67
|
-
styles = _this$
|
|
70
|
+
const _this$props3 = this.props,
|
|
71
|
+
children = _this$props3.children,
|
|
72
|
+
styles = _this$props3.styles;
|
|
68
73
|
const props = omitProps(this.props, GridCol.allowedProps);
|
|
69
74
|
return jsx("span", Object.assign({}, props, {
|
|
70
75
|
ref: this.handleRef,
|
package/es/GridCol/props.js
CHANGED
|
@@ -47,10 +47,6 @@ const propTypes = {
|
|
|
47
47
|
})]),
|
|
48
48
|
isLastRow: PropTypes.bool,
|
|
49
49
|
isLastCol: PropTypes.bool,
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* provides a reference to the underlying html root element
|
|
53
|
-
*/
|
|
54
50
|
elementRef: PropTypes.func
|
|
55
51
|
};
|
|
56
52
|
const allowedProps = ['children', 'colSpacing', 'rowSpacing', 'textAlign', 'hAlign', 'vAlign', 'startAt', 'visualDebug', 'width', 'offset', 'isLastRow', 'isLastCol', 'elementRef'];
|
package/es/GridCol/styles.js
CHANGED
|
@@ -123,7 +123,7 @@ const generateStyle = (componentTheme, props) => {
|
|
|
123
123
|
if (!width) return;
|
|
124
124
|
|
|
125
125
|
if (width && typeof width === 'object') {
|
|
126
|
-
width = width[breakpoint];
|
|
126
|
+
width = width[breakpoint === 'x-large' ? 'xLarge' : breakpoint];
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
return width;
|
|
@@ -134,7 +134,7 @@ const generateStyle = (componentTheme, props) => {
|
|
|
134
134
|
if (!offset) return;
|
|
135
135
|
|
|
136
136
|
if (offset && typeof offset === 'object') {
|
|
137
|
-
offset = offset[breakpoint];
|
|
137
|
+
offset = offset[breakpoint === 'x-large' ? 'xLarge' : breakpoint];
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
return offset;
|
package/es/GridRow/index.js
CHANGED
|
@@ -42,6 +42,7 @@ import { propTypes, allowedProps } from './props';
|
|
|
42
42
|
parent: Grid
|
|
43
43
|
id: Grid.Row
|
|
44
44
|
---
|
|
45
|
+
@tsProps
|
|
45
46
|
**/
|
|
46
47
|
let GridRow = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class GridRow extends Component {
|
|
47
48
|
constructor(...args) {
|
|
@@ -54,18 +55,22 @@ let GridRow = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_cl
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
componentDidMount() {
|
|
57
|
-
|
|
58
|
+
var _this$props$makeStyle, _this$props;
|
|
59
|
+
|
|
60
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
componentDidUpdate(
|
|
61
|
-
|
|
63
|
+
componentDidUpdate() {
|
|
64
|
+
var _this$props$makeStyle2, _this$props2;
|
|
65
|
+
|
|
66
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
renderChildren() {
|
|
65
|
-
const _this$
|
|
66
|
-
styles = _this$
|
|
67
|
-
makeStyles = _this$
|
|
68
|
-
props = _objectWithoutProperties(_this$
|
|
70
|
+
const _this$props3 = this.props,
|
|
71
|
+
styles = _this$props3.styles,
|
|
72
|
+
makeStyles = _this$props3.makeStyles,
|
|
73
|
+
props = _objectWithoutProperties(_this$props3, _excluded);
|
|
69
74
|
|
|
70
75
|
return Children.map(this.props.children, (child, index) => {
|
|
71
76
|
if (matchComponentTypes(child, [GridCol])) {
|
|
@@ -83,9 +88,9 @@ let GridRow = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_cl
|
|
|
83
88
|
}
|
|
84
89
|
|
|
85
90
|
render() {
|
|
86
|
-
const _this$
|
|
87
|
-
styles = _this$
|
|
88
|
-
restProps = _objectWithoutProperties(_this$
|
|
91
|
+
const _this$props4 = this.props,
|
|
92
|
+
styles = _this$props4.styles,
|
|
93
|
+
restProps = _objectWithoutProperties(_this$props4, _excluded2);
|
|
89
94
|
|
|
90
95
|
const props = omitProps(restProps, GridRow.allowedProps);
|
|
91
96
|
return jsx("span", Object.assign({}, props, {
|
package/lib/Grid/index.js
CHANGED
|
@@ -52,6 +52,7 @@ var _dec, _class, _class2, _temp;
|
|
|
52
52
|
---
|
|
53
53
|
category: components
|
|
54
54
|
---
|
|
55
|
+
@tsProps
|
|
55
56
|
**/
|
|
56
57
|
let Grid = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class Grid extends _react.Component {
|
|
57
58
|
constructor(...args) {
|
|
@@ -64,18 +65,22 @@ let Grid = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
componentDidMount() {
|
|
67
|
-
|
|
68
|
+
var _this$props$makeStyle, _this$props;
|
|
69
|
+
|
|
70
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
68
71
|
}
|
|
69
72
|
|
|
70
|
-
componentDidUpdate(
|
|
71
|
-
|
|
73
|
+
componentDidUpdate() {
|
|
74
|
+
var _this$props$makeStyle2, _this$props2;
|
|
75
|
+
|
|
76
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
renderChildren() {
|
|
75
|
-
const _this$
|
|
76
|
-
styles = _this$
|
|
77
|
-
makeStyles = _this$
|
|
78
|
-
props = (0, _objectWithoutProperties2.default)(_this$
|
|
80
|
+
const _this$props3 = this.props,
|
|
81
|
+
styles = _this$props3.styles,
|
|
82
|
+
makeStyles = _this$props3.makeStyles,
|
|
83
|
+
props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
79
84
|
|
|
80
85
|
const children = _react.Children.toArray(this.props.children);
|
|
81
86
|
|
|
@@ -94,9 +99,9 @@ let Grid = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
render() {
|
|
97
|
-
const _this$
|
|
98
|
-
styles = _this$
|
|
99
|
-
restProps = (0, _objectWithoutProperties2.default)(_this$
|
|
102
|
+
const _this$props4 = this.props,
|
|
103
|
+
styles = _this$props4.styles,
|
|
104
|
+
restProps = (0, _objectWithoutProperties2.default)(_this$props4, _excluded2);
|
|
100
105
|
const props = (0, _omitProps.omitProps)(restProps, Grid.allowedProps);
|
|
101
106
|
return (0, _emotion.jsx)("span", Object.assign({}, props, {
|
|
102
107
|
css: styles === null || styles === void 0 ? void 0 : styles.grid,
|
package/lib/GridCol/index.js
CHANGED
|
@@ -26,6 +26,7 @@ var _dec, _class, _class2, _temp;
|
|
|
26
26
|
parent: Grid
|
|
27
27
|
id: Grid.Col
|
|
28
28
|
---
|
|
29
|
+
@tsProps
|
|
29
30
|
**/
|
|
30
31
|
let GridCol = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class GridCol extends _react.Component {
|
|
31
32
|
constructor(...args) {
|
|
@@ -43,17 +44,21 @@ let GridCol = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
componentDidMount() {
|
|
46
|
-
|
|
47
|
+
var _this$props$makeStyle, _this$props;
|
|
48
|
+
|
|
49
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
componentDidUpdate(
|
|
50
|
-
|
|
52
|
+
componentDidUpdate() {
|
|
53
|
+
var _this$props$makeStyle2, _this$props2;
|
|
54
|
+
|
|
55
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
render() {
|
|
54
|
-
const _this$
|
|
55
|
-
children = _this$
|
|
56
|
-
styles = _this$
|
|
59
|
+
const _this$props3 = this.props,
|
|
60
|
+
children = _this$props3.children,
|
|
61
|
+
styles = _this$props3.styles;
|
|
57
62
|
const props = (0, _omitProps.omitProps)(this.props, GridCol.allowedProps);
|
|
58
63
|
return (0, _emotion.jsx)("span", Object.assign({}, props, {
|
|
59
64
|
ref: this.handleRef,
|
package/lib/GridCol/props.js
CHANGED
|
@@ -57,10 +57,6 @@ const propTypes = {
|
|
|
57
57
|
})]),
|
|
58
58
|
isLastRow: _propTypes.default.bool,
|
|
59
59
|
isLastCol: _propTypes.default.bool,
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* provides a reference to the underlying html root element
|
|
63
|
-
*/
|
|
64
60
|
elementRef: _propTypes.default.func
|
|
65
61
|
};
|
|
66
62
|
exports.propTypes = propTypes;
|
package/lib/GridCol/styles.js
CHANGED
|
@@ -130,7 +130,7 @@ const generateStyle = (componentTheme, props) => {
|
|
|
130
130
|
if (!width) return;
|
|
131
131
|
|
|
132
132
|
if (width && typeof width === 'object') {
|
|
133
|
-
width = width[breakpoint];
|
|
133
|
+
width = width[breakpoint === 'x-large' ? 'xLarge' : breakpoint];
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
return width;
|
|
@@ -141,7 +141,7 @@ const generateStyle = (componentTheme, props) => {
|
|
|
141
141
|
if (!offset) return;
|
|
142
142
|
|
|
143
143
|
if (offset && typeof offset === 'object') {
|
|
144
|
-
offset = offset[breakpoint];
|
|
144
|
+
offset = offset[breakpoint === 'x-large' ? 'xLarge' : breakpoint];
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
return offset;
|
package/lib/GridRow/index.js
CHANGED
|
@@ -39,6 +39,7 @@ var _dec, _class, _class2, _temp;
|
|
|
39
39
|
parent: Grid
|
|
40
40
|
id: Grid.Row
|
|
41
41
|
---
|
|
42
|
+
@tsProps
|
|
42
43
|
**/
|
|
43
44
|
let GridRow = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class GridRow extends _react.Component {
|
|
44
45
|
constructor(...args) {
|
|
@@ -51,18 +52,22 @@ let GridRow = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
componentDidMount() {
|
|
54
|
-
|
|
55
|
+
var _this$props$makeStyle, _this$props;
|
|
56
|
+
|
|
57
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
componentDidUpdate(
|
|
58
|
-
|
|
60
|
+
componentDidUpdate() {
|
|
61
|
+
var _this$props$makeStyle2, _this$props2;
|
|
62
|
+
|
|
63
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
renderChildren() {
|
|
62
|
-
const _this$
|
|
63
|
-
styles = _this$
|
|
64
|
-
makeStyles = _this$
|
|
65
|
-
props = (0, _objectWithoutProperties2.default)(_this$
|
|
67
|
+
const _this$props3 = this.props,
|
|
68
|
+
styles = _this$props3.styles,
|
|
69
|
+
makeStyles = _this$props3.makeStyles,
|
|
70
|
+
props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
66
71
|
return _react.Children.map(this.props.children, (child, index) => {
|
|
67
72
|
if ((0, _matchComponentTypes.matchComponentTypes)(child, [_GridCol.GridCol])) {
|
|
68
73
|
return (0, _safeCloneElement.safeCloneElement)(child, { ...(0, _pickProps.pickProps)(props, GridRow.allowedProps),
|
|
@@ -79,9 +84,9 @@ let GridRow = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
render() {
|
|
82
|
-
const _this$
|
|
83
|
-
styles = _this$
|
|
84
|
-
restProps = (0, _objectWithoutProperties2.default)(_this$
|
|
87
|
+
const _this$props4 = this.props,
|
|
88
|
+
styles = _this$props4.styles,
|
|
89
|
+
restProps = (0, _objectWithoutProperties2.default)(_this$props4, _excluded2);
|
|
85
90
|
const props = (0, _omitProps.omitProps)(restProps, GridRow.allowedProps);
|
|
86
91
|
return (0, _emotion.jsx)("span", Object.assign({}, props, {
|
|
87
92
|
css: styles === null || styles === void 0 ? void 0 : styles.gridRow,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-grid",
|
|
3
|
-
"version": "8.12.1-snapshot.
|
|
3
|
+
"version": "8.12.1-snapshot.16+1160d54f5",
|
|
4
4
|
"description": "A Grid component.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -25,20 +25,20 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.13.10",
|
|
28
|
-
"@instructure/emotion": "8.12.1-snapshot.
|
|
29
|
-
"@instructure/shared-types": "8.12.1-snapshot.
|
|
30
|
-
"@instructure/ui-a11y-content": "8.12.1-snapshot.
|
|
31
|
-
"@instructure/ui-prop-types": "8.12.1-snapshot.
|
|
32
|
-
"@instructure/ui-react-utils": "8.12.1-snapshot.
|
|
33
|
-
"@instructure/ui-testable": "8.12.1-snapshot.
|
|
34
|
-
"@instructure/ui-utils": "8.12.1-snapshot.
|
|
28
|
+
"@instructure/emotion": "8.12.1-snapshot.16+1160d54f5",
|
|
29
|
+
"@instructure/shared-types": "8.12.1-snapshot.16+1160d54f5",
|
|
30
|
+
"@instructure/ui-a11y-content": "8.12.1-snapshot.16+1160d54f5",
|
|
31
|
+
"@instructure/ui-prop-types": "8.12.1-snapshot.16+1160d54f5",
|
|
32
|
+
"@instructure/ui-react-utils": "8.12.1-snapshot.16+1160d54f5",
|
|
33
|
+
"@instructure/ui-testable": "8.12.1-snapshot.16+1160d54f5",
|
|
34
|
+
"@instructure/ui-utils": "8.12.1-snapshot.16+1160d54f5",
|
|
35
35
|
"prop-types": "^15"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@instructure/ui-babel-preset": "8.12.1-snapshot.
|
|
39
|
-
"@instructure/ui-color-utils": "8.12.1-snapshot.
|
|
40
|
-
"@instructure/ui-test-utils": "8.12.1-snapshot.
|
|
41
|
-
"@instructure/ui-themes": "8.12.1-snapshot.
|
|
38
|
+
"@instructure/ui-babel-preset": "8.12.1-snapshot.16+1160d54f5",
|
|
39
|
+
"@instructure/ui-color-utils": "8.12.1-snapshot.16+1160d54f5",
|
|
40
|
+
"@instructure/ui-test-utils": "8.12.1-snapshot.16+1160d54f5",
|
|
41
|
+
"@instructure/ui-themes": "8.12.1-snapshot.16+1160d54f5"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": ">=16.8 <=17"
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"sideEffects": false,
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "1160d54f5e25365b0204d2c0fcf72537eefd9017"
|
|
51
51
|
}
|
package/src/Grid/index.tsx
CHANGED
|
@@ -47,6 +47,7 @@ import type { GridProps } from './props'
|
|
|
47
47
|
---
|
|
48
48
|
category: components
|
|
49
49
|
---
|
|
50
|
+
@tsProps
|
|
50
51
|
**/
|
|
51
52
|
@withStyle(generateStyle, generateComponentTheme)
|
|
52
53
|
class Grid extends Component<GridProps> {
|
|
@@ -74,14 +75,11 @@ class Grid extends Component<GridProps> {
|
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
componentDidMount() {
|
|
77
|
-
|
|
78
|
-
this.props.makeStyles()
|
|
78
|
+
this.props.makeStyles?.()
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
|
|
84
|
-
this.props.makeStyles()
|
|
81
|
+
componentDidUpdate() {
|
|
82
|
+
this.props.makeStyles?.()
|
|
85
83
|
}
|
|
86
84
|
|
|
87
85
|
renderChildren() {
|
|
@@ -92,8 +90,8 @@ class Grid extends Component<GridProps> {
|
|
|
92
90
|
if (matchComponentTypes(child, [GridRow])) {
|
|
93
91
|
return safeCloneElement(child as ReactElement, {
|
|
94
92
|
...pickProps(props, Grid.allowedProps),
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
...(child as ReactElement)
|
|
94
|
+
.props /* child props should override parent */,
|
|
97
95
|
isLastRow: index + 1 === children.length
|
|
98
96
|
})
|
|
99
97
|
} else {
|
package/src/Grid/props.ts
CHANGED
|
@@ -37,6 +37,9 @@ import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
|
37
37
|
import type { GridBreakpoints } from '../GridTypes'
|
|
38
38
|
|
|
39
39
|
type GridOwnProps = {
|
|
40
|
+
/**
|
|
41
|
+
* One of: `Grid.Row`, `ScreenReaderContent`
|
|
42
|
+
*/
|
|
40
43
|
children?: React.ReactNode // TODO: oneOf([GridRow, ScreenReaderContent])
|
|
41
44
|
colSpacing?: 'none' | 'small' | 'medium' | 'large'
|
|
42
45
|
rowSpacing?: 'none' | 'small' | 'medium' | 'large'
|
package/src/GridCol/index.tsx
CHANGED
|
@@ -40,6 +40,7 @@ import type { GridColProps } from './props'
|
|
|
40
40
|
parent: Grid
|
|
41
41
|
id: Grid.Col
|
|
42
42
|
---
|
|
43
|
+
@tsProps
|
|
43
44
|
**/
|
|
44
45
|
@withStyle(generateStyle, generateComponentTheme)
|
|
45
46
|
class GridCol extends Component<GridColProps> {
|
|
@@ -67,14 +68,11 @@ class GridCol extends Component<GridColProps> {
|
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
componentDidMount() {
|
|
70
|
-
|
|
71
|
-
this.props.makeStyles()
|
|
71
|
+
this.props.makeStyles?.()
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
|
|
77
|
-
this.props.makeStyles()
|
|
74
|
+
componentDidUpdate() {
|
|
75
|
+
this.props.makeStyles?.()
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
render() {
|
package/src/GridCol/props.ts
CHANGED
|
@@ -33,7 +33,8 @@ import type {
|
|
|
33
33
|
import type { GridBreakpoints } from '../GridTypes'
|
|
34
34
|
|
|
35
35
|
// TODO: get numcols from theme config
|
|
36
|
-
const COL_WIDTHS = ['auto', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
|
|
36
|
+
const COL_WIDTHS: ColWidths[] = ['auto', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
|
|
37
|
+
type ColWidths = 'auto' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
|
37
38
|
|
|
38
39
|
type GridColOwnProps = {
|
|
39
40
|
children?: React.ReactNode
|
|
@@ -45,23 +46,26 @@ type GridColOwnProps = {
|
|
|
45
46
|
startAt?: GridBreakpoints
|
|
46
47
|
visualDebug?: boolean
|
|
47
48
|
width?:
|
|
48
|
-
|
|
|
49
|
+
| ColWidths
|
|
49
50
|
| {
|
|
50
|
-
small?:
|
|
51
|
-
medium?:
|
|
52
|
-
large?:
|
|
53
|
-
xLarge?:
|
|
51
|
+
small?: ColWidths
|
|
52
|
+
medium?: ColWidths
|
|
53
|
+
large?: ColWidths
|
|
54
|
+
xLarge?: ColWidths
|
|
54
55
|
}
|
|
55
56
|
offset?:
|
|
56
|
-
|
|
|
57
|
+
| ColWidths
|
|
57
58
|
| {
|
|
58
|
-
small?:
|
|
59
|
-
medium?:
|
|
60
|
-
large?:
|
|
61
|
-
xLarge?:
|
|
59
|
+
small?: ColWidths
|
|
60
|
+
medium?: ColWidths
|
|
61
|
+
large?: ColWidths
|
|
62
|
+
xLarge?: ColWidths
|
|
62
63
|
}
|
|
63
64
|
isLastRow?: boolean
|
|
64
65
|
isLastCol?: boolean
|
|
66
|
+
/**
|
|
67
|
+
* provides a reference to the underlying html root element
|
|
68
|
+
*/
|
|
65
69
|
elementRef?: (element: Element | null) => void
|
|
66
70
|
}
|
|
67
71
|
|
|
@@ -110,9 +114,6 @@ const propTypes: PropValidators<PropKeys> = {
|
|
|
110
114
|
]),
|
|
111
115
|
isLastRow: PropTypes.bool,
|
|
112
116
|
isLastCol: PropTypes.bool,
|
|
113
|
-
/**
|
|
114
|
-
* provides a reference to the underlying html root element
|
|
115
|
-
*/
|
|
116
117
|
elementRef: PropTypes.func
|
|
117
118
|
}
|
|
118
119
|
|
package/src/GridCol/styles.ts
CHANGED
|
@@ -26,6 +26,8 @@ import type { GridTheme } from '@instructure/shared-types'
|
|
|
26
26
|
import type { GridBreakpoints } from '../GridTypes'
|
|
27
27
|
import type { GridColProps, GridColStyle } from './props'
|
|
28
28
|
|
|
29
|
+
type BreakPoints = NonNullable<GridBreakpoints>
|
|
30
|
+
|
|
29
31
|
/**
|
|
30
32
|
* ---
|
|
31
33
|
* private: true
|
|
@@ -111,31 +113,29 @@ const generateStyle = (
|
|
|
111
113
|
return breakpoints.slice(breakpoints.indexOf(startAt!))
|
|
112
114
|
}
|
|
113
115
|
|
|
114
|
-
const breakpointIsEnabled = (breakpoint:
|
|
116
|
+
const breakpointIsEnabled = (breakpoint: BreakPoints) => {
|
|
115
117
|
return enabledBreakpoints().includes(breakpoint)
|
|
116
118
|
}
|
|
117
119
|
|
|
118
|
-
const getColSize = (breakpoint:
|
|
120
|
+
const getColSize = (breakpoint: BreakPoints) => {
|
|
119
121
|
let { width } = props
|
|
120
122
|
|
|
121
123
|
if (!width) return
|
|
122
124
|
|
|
123
125
|
if (width && typeof width === 'object') {
|
|
124
|
-
|
|
125
|
-
width = width[breakpoint]
|
|
126
|
+
width = width[breakpoint === 'x-large' ? 'xLarge' : breakpoint]
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
return width
|
|
129
130
|
}
|
|
130
131
|
|
|
131
|
-
const getColOffset = (breakpoint:
|
|
132
|
+
const getColOffset = (breakpoint: BreakPoints) => {
|
|
132
133
|
let { offset } = props
|
|
133
134
|
|
|
134
135
|
if (!offset) return
|
|
135
136
|
|
|
136
137
|
if (offset && typeof offset === 'object') {
|
|
137
|
-
|
|
138
|
-
offset = offset[breakpoint]
|
|
138
|
+
offset = offset[breakpoint === 'x-large' ? 'xLarge' : breakpoint]
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
return offset
|
|
@@ -170,10 +170,10 @@ const generateStyle = (
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
const getStartAtVariants = (breakpoint:
|
|
173
|
+
const getStartAtVariants = (breakpoint: BreakPoints) =>
|
|
174
174
|
!!startAt && startAt === breakpoint ? { ...getStartGridColumnStyle() } : {}
|
|
175
175
|
|
|
176
|
-
const getGridColumnsForBreakpoint = (breakpoint:
|
|
176
|
+
const getGridColumnsForBreakpoint = (breakpoint: BreakPoints) => {
|
|
177
177
|
const size = getColSize(breakpoint)
|
|
178
178
|
const offset = getColOffset(breakpoint)
|
|
179
179
|
|
|
@@ -185,7 +185,7 @@ const generateStyle = (
|
|
|
185
185
|
: {}
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
const getBreakpointStyles = (breakpoint:
|
|
188
|
+
const getBreakpointStyles = (breakpoint: BreakPoints) => ({
|
|
189
189
|
...getStartAtVariants(breakpoint),
|
|
190
190
|
...getGridColumnsForBreakpoint(breakpoint)
|
|
191
191
|
})
|
package/src/GridRow/index.tsx
CHANGED
|
@@ -47,6 +47,7 @@ import type { GridRowProps } from './props'
|
|
|
47
47
|
parent: Grid
|
|
48
48
|
id: Grid.Row
|
|
49
49
|
---
|
|
50
|
+
@tsProps
|
|
50
51
|
**/
|
|
51
52
|
@withStyle(generateStyle, generateComponentTheme)
|
|
52
53
|
class GridRow extends Component<GridRowProps> {
|
|
@@ -66,14 +67,11 @@ class GridRow extends Component<GridRowProps> {
|
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
componentDidMount() {
|
|
69
|
-
|
|
70
|
-
this.props.makeStyles()
|
|
70
|
+
this.props.makeStyles?.()
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
|
|
76
|
-
this.props.makeStyles()
|
|
73
|
+
componentDidUpdate() {
|
|
74
|
+
this.props.makeStyles?.()
|
|
77
75
|
}
|
|
78
76
|
|
|
79
77
|
renderChildren() {
|
|
@@ -83,8 +81,8 @@ class GridRow extends Component<GridRowProps> {
|
|
|
83
81
|
if (matchComponentTypes(child, [GridCol])) {
|
|
84
82
|
return safeCloneElement(child as ReactElement, {
|
|
85
83
|
...pickProps(props, GridRow.allowedProps),
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
...(child as ReactElement)
|
|
85
|
+
.props /* child props should override parent */,
|
|
88
86
|
isLastRow: props.isLastRow,
|
|
89
87
|
isLastCol: index + 1 === Children.count(this.props.children)
|
|
90
88
|
})
|
package/src/GridRow/props.ts
CHANGED
|
@@ -38,6 +38,9 @@ import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
|
38
38
|
import type { GridBreakpoints } from '../GridTypes'
|
|
39
39
|
|
|
40
40
|
type GridRowOwnProps = {
|
|
41
|
+
/**
|
|
42
|
+
* One of: `Grid.Col`, `ScreenReaderContent`
|
|
43
|
+
*/
|
|
41
44
|
children?: React.ReactNode // TODO: oneOf([GridCol, ScreenReaderContent])
|
|
42
45
|
rowSpacing?: 'none' | 'small' | 'medium' | 'large'
|
|
43
46
|
colSpacing?: 'none' | 'small' | 'medium' | 'large'
|
package/types/Grid/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { GridProps } from './props';
|
|
|
8
8
|
---
|
|
9
9
|
category: components
|
|
10
10
|
---
|
|
11
|
+
@tsProps
|
|
11
12
|
**/
|
|
12
13
|
declare class Grid extends Component<GridProps> {
|
|
13
14
|
static readonly componentId = "Grid";
|
|
@@ -43,7 +44,7 @@ declare class Grid extends Component<GridProps> {
|
|
|
43
44
|
ref: Element | null;
|
|
44
45
|
handleRef: (el: Element | null) => void;
|
|
45
46
|
componentDidMount(): void;
|
|
46
|
-
componentDidUpdate(
|
|
47
|
+
componentDidUpdate(): void;
|
|
47
48
|
renderChildren(): {}[];
|
|
48
49
|
render(): jsx.JSX.Element;
|
|
49
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Grid/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AASzD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Grid/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AASzD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;GAKG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,SAAS,CAAC;IACrC,MAAM,CAAC,QAAQ,CAAC,WAAW,UAAS;IAEpC,MAAM,CAAC,SAAS;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;MAQlB;IAED,MAAM,CAAC,GAAG,iBAAU;IACpB,MAAM,CAAC,GAAG,iBAAU;IAEpB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAE9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,cAAc;IAkBd,MAAM;CAWP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
package/types/Grid/props.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import type { PropValidators, GridTheme, OtherHTMLAttributes } from '@instructur
|
|
|
3
3
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
4
|
import type { GridBreakpoints } from '../GridTypes';
|
|
5
5
|
declare type GridOwnProps = {
|
|
6
|
+
/**
|
|
7
|
+
* One of: `Grid.Row`, `ScreenReaderContent`
|
|
8
|
+
*/
|
|
6
9
|
children?: React.ReactNode;
|
|
7
10
|
colSpacing?: 'none' | 'small' | 'medium' | 'large';
|
|
8
11
|
rowSpacing?: 'none' | 'small' | 'medium' | 'large';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Grid/props.ts"],"names":[],"mappings":";AA8BA,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEnD,aAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IAClD,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IAClD,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,cAAc,GAAG,eAAe,CAAA;IACtE,MAAM,CAAC,EAAE,KAAK,GA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AK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACpC,OAAO,CAAC,EAAE,eAAe,CAAA;IACzB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,YAAY,CAAA;AAElC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,SAAS,GAAG,YAAY,GAC3B,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,GACpC,mBAAmB,CAAC,YAAY,CAAC,CAAA;AAEnC,aAAK,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;AAEvC,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAcvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAQnB,CAAA;AAED,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/GridCol/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { GridColProps } from './props';
|
|
|
7
7
|
parent: Grid
|
|
8
8
|
id: Grid.Col
|
|
9
9
|
---
|
|
10
|
+
@tsProps
|
|
10
11
|
**/
|
|
11
12
|
declare class GridCol extends Component<GridColProps> {
|
|
12
13
|
static readonly componentId = "Grid.Col";
|
|
@@ -19,8 +20,18 @@ declare class GridCol extends Component<GridColProps> {
|
|
|
19
20
|
vAlign?: "top" | "middle" | "bottom" | undefined;
|
|
20
21
|
startAt?: import("..").GridBreakpoints | undefined;
|
|
21
22
|
visualDebug?: boolean | undefined;
|
|
22
|
-
width?:
|
|
23
|
-
|
|
23
|
+
width?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | {
|
|
24
|
+
small?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
25
|
+
medium?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
26
|
+
large?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
27
|
+
xLarge?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
offset?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | {
|
|
30
|
+
small?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
31
|
+
medium?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
32
|
+
large?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
33
|
+
xLarge?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
34
|
+
} | undefined;
|
|
24
35
|
isLastRow?: boolean | undefined;
|
|
25
36
|
isLastCol?: boolean | undefined;
|
|
26
37
|
elementRef?: ((element: Element | null) => void) | undefined;
|
|
@@ -34,8 +45,18 @@ declare class GridCol extends Component<GridColProps> {
|
|
|
34
45
|
vAlign?: "top" | "middle" | "bottom" | undefined;
|
|
35
46
|
startAt?: import("..").GridBreakpoints | undefined;
|
|
36
47
|
visualDebug?: boolean | undefined;
|
|
37
|
-
width?:
|
|
38
|
-
|
|
48
|
+
width?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | {
|
|
49
|
+
small?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
50
|
+
medium?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
51
|
+
large?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
52
|
+
xLarge?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
53
|
+
} | undefined;
|
|
54
|
+
offset?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | {
|
|
55
|
+
small?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
56
|
+
medium?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
57
|
+
large?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
58
|
+
xLarge?: ("auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) | undefined;
|
|
59
|
+
} | undefined;
|
|
39
60
|
isLastRow?: boolean | undefined;
|
|
40
61
|
isLastCol?: boolean | undefined;
|
|
41
62
|
elementRef?: ((element: Element | null) => void) | undefined;
|
|
@@ -49,7 +70,7 @@ declare class GridCol extends Component<GridColProps> {
|
|
|
49
70
|
ref: Element | null;
|
|
50
71
|
handleRef: (el: Element | null) => void;
|
|
51
72
|
componentDidMount(): void;
|
|
52
|
-
componentDidUpdate(
|
|
73
|
+
componentDidUpdate(): void;
|
|
53
74
|
render(): jsx.JSX.Element;
|
|
54
75
|
}
|
|
55
76
|
export default GridCol;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/GridCol/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/GridCol/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C;;;;;;GAMG;AACH,cACM,OAAQ,SAAQ,SAAS,CAAC,YAAY,CAAC;IAC3C,MAAM,CAAC,QAAQ,CAAC,WAAW,cAAa;IAExC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;MAKlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM;CAWP;AAED,eAAe,OAAO,CAAA;AACtB,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
package/types/GridCol/props.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
3
3
|
import type { PropValidators, GridTheme, OtherHTMLAttributes } from '@instructure/shared-types';
|
|
4
4
|
import type { GridBreakpoints } from '../GridTypes';
|
|
5
|
+
declare type ColWidths = 'auto' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
5
6
|
declare type GridColOwnProps = {
|
|
6
7
|
children?: React.ReactNode;
|
|
7
8
|
colSpacing?: 'none' | 'small' | 'medium' | 'large';
|
|
@@ -11,20 +12,23 @@ declare type GridColOwnProps = {
|
|
|
11
12
|
vAlign?: 'top' | 'middle' | 'bottom';
|
|
12
13
|
startAt?: GridBreakpoints;
|
|
13
14
|
visualDebug?: boolean;
|
|
14
|
-
width?:
|
|
15
|
-
small?:
|
|
16
|
-
medium?:
|
|
17
|
-
large?:
|
|
18
|
-
xLarge?:
|
|
15
|
+
width?: ColWidths | {
|
|
16
|
+
small?: ColWidths;
|
|
17
|
+
medium?: ColWidths;
|
|
18
|
+
large?: ColWidths;
|
|
19
|
+
xLarge?: ColWidths;
|
|
19
20
|
};
|
|
20
|
-
offset?:
|
|
21
|
-
small?:
|
|
22
|
-
medium?:
|
|
23
|
-
large?:
|
|
24
|
-
xLarge?:
|
|
21
|
+
offset?: ColWidths | {
|
|
22
|
+
small?: ColWidths;
|
|
23
|
+
medium?: ColWidths;
|
|
24
|
+
large?: ColWidths;
|
|
25
|
+
xLarge?: ColWidths;
|
|
25
26
|
};
|
|
26
27
|
isLastRow?: boolean;
|
|
27
28
|
isLastCol?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* provides a reference to the underlying html root element
|
|
31
|
+
*/
|
|
28
32
|
elementRef?: (element: Element | null) => void;
|
|
29
33
|
};
|
|
30
34
|
declare type PropKeys = keyof GridColOwnProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/GridCol/props.ts"],"names":[],"mappings":";AA0BA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/GridCol/props.ts"],"names":[],"mappings":";AA0BA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,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AS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;CAC/C,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,eAAe,CAAA;AAErC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,YAAY,GAAG,eAAe,GACjC,cAAc,CAAC,SAAS,EAAE,YAAY,CAAC,GACvC,mBAAmB,CAAC,eAAe,CAAC,CAAA;AAEtC,aAAK,YAAY,GAAG,cAAc,CAAC,SAAS,CAAC,CAAA;AAE7C,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAoCvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAcnB,CAAA;AAED,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/GridCol/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/GridCol/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAIzD;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,SAAS,SAClB,YAAY,KAClB,YA8KF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
package/types/GridRow/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { GridRowProps } from './props';
|
|
|
7
7
|
parent: Grid
|
|
8
8
|
id: Grid.Row
|
|
9
9
|
---
|
|
10
|
+
@tsProps
|
|
10
11
|
**/
|
|
11
12
|
declare class GridRow extends Component<GridRowProps> {
|
|
12
13
|
static readonly componentId = "Grid.Row";
|
|
@@ -37,7 +38,7 @@ declare class GridRow extends Component<GridRowProps> {
|
|
|
37
38
|
ref: Element | null;
|
|
38
39
|
handleRef: (el: Element | null) => void;
|
|
39
40
|
componentDidMount(): void;
|
|
40
|
-
componentDidUpdate(
|
|
41
|
+
componentDidUpdate(): void;
|
|
41
42
|
renderChildren(): {}[] | null | undefined;
|
|
42
43
|
render(): jsx.JSX.Element;
|
|
43
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/GridRow/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AAWzD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/GridRow/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AAWzD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C;;;;;;GAMG;AACH,cACM,OAAQ,SAAQ,SAAS,CAAC,YAAY,CAAC;IAC3C,MAAM,CAAC,QAAQ,CAAC,WAAW,cAAa;IAExC,MAAM,CAAC,SAAS;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;MAGlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAE9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,cAAc;IAkBd,MAAM;CAWP;AAED,eAAe,OAAO,CAAA;AACtB,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
package/types/GridRow/props.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import type { PropValidators, GridTheme, OtherHTMLAttributes } from '@instructur
|
|
|
3
3
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
4
|
import type { GridBreakpoints } from '../GridTypes';
|
|
5
5
|
declare type GridRowOwnProps = {
|
|
6
|
+
/**
|
|
7
|
+
* One of: `Grid.Col`, `ScreenReaderContent`
|
|
8
|
+
*/
|
|
6
9
|
children?: React.ReactNode;
|
|
7
10
|
rowSpacing?: 'none' | 'small' | 'medium' | 'large';
|
|
8
11
|
colSpacing?: 'none' | 'small' | 'medium' | 'large';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/GridRow/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEnD,aAAK,eAAe,GAAG;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IAClD,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IAClD,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,cAAc,GAAG,eAAe,CAAA;IACtE,MAAM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