@instructure/ui-grid 11.7.3-snapshot-7 → 11.7.3-snapshot-26
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/CHANGELOG.md +5 -2
- package/es/Grid/v1/index.js +33 -33
- package/es/Grid/v1/styles.js +4 -2
- package/es/Grid/v1/theme.js +7 -5
- package/es/Grid/v2/index.js +33 -33
- package/es/Grid/v2/styles.js +4 -2
- package/es/GridCol/v1/index.js +32 -28
- package/es/GridCol/v1/styles.js +17 -10
- package/es/GridCol/v1/theme.js +7 -5
- package/es/GridCol/v2/index.js +32 -28
- package/es/GridCol/v2/styles.js +17 -10
- package/es/GridRow/v1/index.js +26 -28
- package/es/GridRow/v1/styles.js +9 -7
- package/es/GridRow/v1/theme.js +7 -5
- package/es/GridRow/v2/index.js +26 -28
- package/es/GridRow/v2/styles.js +9 -7
- package/lib/Grid/v1/index.js +33 -33
- package/lib/Grid/v1/styles.js +4 -2
- package/lib/Grid/v1/theme.js +7 -5
- package/lib/Grid/v2/index.js +33 -33
- package/lib/Grid/v2/styles.js +4 -2
- package/lib/GridCol/v1/index.js +32 -28
- package/lib/GridCol/v1/styles.js +17 -10
- package/lib/GridCol/v1/theme.js +7 -5
- package/lib/GridCol/v2/index.js +32 -28
- package/lib/GridCol/v2/styles.js +17 -10
- package/lib/GridRow/v1/index.js +26 -28
- package/lib/GridRow/v1/styles.js +9 -7
- package/lib/GridRow/v1/theme.js +7 -5
- package/lib/GridRow/v2/index.js +26 -28
- package/lib/GridRow/v2/styles.js +9 -7
- package/package.json +11 -11
- package/tsconfig.build.tsbuildinfo +1 -1
package/lib/GridCol/v2/styles.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
require("core-js/modules/es.array.includes.js");
|
|
7
8
|
/*
|
|
8
9
|
* The MIT License (MIT)
|
|
9
10
|
*
|
|
@@ -39,14 +40,16 @@ exports.default = void 0;
|
|
|
39
40
|
* @return {Object} The final style object, which will be used in the component
|
|
40
41
|
*/
|
|
41
42
|
const generateStyle = (componentTheme, props) => {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
const {
|
|
44
|
+
vAlign,
|
|
45
|
+
textAlign,
|
|
46
|
+
rowSpacing,
|
|
47
|
+
colSpacing,
|
|
48
|
+
isLastRow,
|
|
49
|
+
isLastCol,
|
|
50
|
+
startAt,
|
|
51
|
+
visualDebug
|
|
52
|
+
} = props;
|
|
50
53
|
const rowSpacingVariants = {
|
|
51
54
|
small: {
|
|
52
55
|
marginBottom: componentTheme.spacingSmall
|
|
@@ -124,7 +127,9 @@ const generateStyle = (componentTheme, props) => {
|
|
|
124
127
|
return enabledBreakpoints().includes(breakpoint);
|
|
125
128
|
};
|
|
126
129
|
const getColSize = breakpoint => {
|
|
127
|
-
let
|
|
130
|
+
let {
|
|
131
|
+
width
|
|
132
|
+
} = props;
|
|
128
133
|
if (!width) return;
|
|
129
134
|
if (width && typeof width === 'object') {
|
|
130
135
|
width = width[breakpoint === 'x-large' ? 'xLarge' : breakpoint];
|
|
@@ -132,7 +137,9 @@ const generateStyle = (componentTheme, props) => {
|
|
|
132
137
|
return width;
|
|
133
138
|
};
|
|
134
139
|
const getColOffset = breakpoint => {
|
|
135
|
-
let
|
|
140
|
+
let {
|
|
141
|
+
offset
|
|
142
|
+
} = props;
|
|
136
143
|
if (!offset) return;
|
|
137
144
|
if (offset && typeof offset === 'object') {
|
|
138
145
|
offset = offset[breakpoint === 'x-large' ? 'xLarge' : breakpoint];
|
package/lib/GridRow/v1/index.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.GridRow = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
11
10
|
var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
|
|
@@ -17,9 +16,7 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
17
16
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
18
17
|
var _props = require("./props");
|
|
19
18
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
20
|
-
|
|
21
|
-
_excluded2 = ["styles"];
|
|
22
|
-
var _dec, _class, _GridRow;
|
|
19
|
+
var _dec, _class;
|
|
23
20
|
/*
|
|
24
21
|
* The MIT License (MIT)
|
|
25
22
|
*
|
|
@@ -49,27 +46,30 @@ parent: Grid
|
|
|
49
46
|
id: Grid.Row
|
|
50
47
|
---
|
|
51
48
|
**/
|
|
52
|
-
let GridRow = exports.GridRow = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
49
|
+
let GridRow = exports.GridRow = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class GridRow extends _react.Component {
|
|
50
|
+
static displayName = "GridRow";
|
|
51
|
+
static componentId = 'Grid.Row';
|
|
52
|
+
static allowedProps = _props.allowedProps;
|
|
53
|
+
static defaultProps = {
|
|
54
|
+
children: null,
|
|
55
|
+
isLastRow: false
|
|
56
|
+
};
|
|
57
|
+
ref = null;
|
|
58
|
+
handleRef = el => {
|
|
59
|
+
this.ref = el;
|
|
60
|
+
};
|
|
60
61
|
componentDidMount() {
|
|
61
|
-
|
|
62
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
62
|
+
this.props.makeStyles?.();
|
|
63
63
|
}
|
|
64
64
|
componentDidUpdate() {
|
|
65
|
-
|
|
66
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
65
|
+
this.props.makeStyles?.();
|
|
67
66
|
}
|
|
68
67
|
renderChildren() {
|
|
69
|
-
const
|
|
70
|
-
styles
|
|
71
|
-
makeStyles
|
|
72
|
-
props
|
|
68
|
+
const {
|
|
69
|
+
styles,
|
|
70
|
+
makeStyles,
|
|
71
|
+
...props
|
|
72
|
+
} = this.props;
|
|
73
73
|
return _react.Children.map(this.props.children, (child, index) => {
|
|
74
74
|
if ((0, _matchComponentTypes.matchComponentTypes)(child, [_v.GridCol])) {
|
|
75
75
|
return (0, _safeCloneElement.safeCloneElement)(child, {
|
|
@@ -84,19 +84,17 @@ let GridRow = exports.GridRow = (_dec = (0, _emotion.withStyleLegacy)(_styles.de
|
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
render() {
|
|
87
|
-
const
|
|
88
|
-
styles
|
|
89
|
-
restProps
|
|
87
|
+
const {
|
|
88
|
+
styles,
|
|
89
|
+
...restProps
|
|
90
|
+
} = this.props;
|
|
90
91
|
const props = (0, _omitProps.omitProps)(restProps, GridRow.allowedProps);
|
|
91
92
|
return (0, _jsxRuntime.jsx)("span", {
|
|
92
93
|
...props,
|
|
93
|
-
css: styles
|
|
94
|
+
css: styles?.gridRow,
|
|
94
95
|
ref: this.handleRef,
|
|
95
96
|
children: this.renderChildren()
|
|
96
97
|
});
|
|
97
98
|
}
|
|
98
|
-
}
|
|
99
|
-
children: null,
|
|
100
|
-
isLastRow: false
|
|
101
|
-
}, _GridRow)) || _class);
|
|
99
|
+
}) || _class);
|
|
102
100
|
var _default = exports.default = GridRow;
|
package/lib/GridRow/v1/styles.js
CHANGED
|
@@ -39,13 +39,15 @@ exports.default = void 0;
|
|
|
39
39
|
* @return {Object} The final style object, which will be used in the component
|
|
40
40
|
*/
|
|
41
41
|
const generateStyle = (componentTheme, props) => {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
const {
|
|
43
|
+
hAlign,
|
|
44
|
+
vAlign,
|
|
45
|
+
rowSpacing,
|
|
46
|
+
colSpacing,
|
|
47
|
+
isLastRow,
|
|
48
|
+
startAt,
|
|
49
|
+
visualDebug
|
|
50
|
+
} = props;
|
|
49
51
|
const getGridRowStyle = () => {
|
|
50
52
|
const hAlignVariants = {
|
|
51
53
|
center: {
|
package/lib/GridRow/v1/theme.js
CHANGED
|
@@ -34,12 +34,14 @@ exports.default = void 0;
|
|
|
34
34
|
* @return {Object} The final theme object with the overrides and component variables
|
|
35
35
|
*/
|
|
36
36
|
const generateComponentTheme = theme => {
|
|
37
|
-
const
|
|
38
|
-
|
|
37
|
+
const {
|
|
38
|
+
spacing,
|
|
39
|
+
media
|
|
40
|
+
} = theme;
|
|
39
41
|
const componentVariables = {
|
|
40
|
-
spacingSmall: spacing
|
|
41
|
-
spacingMedium: spacing
|
|
42
|
-
spacingLarge: spacing
|
|
42
|
+
spacingSmall: spacing?.small,
|
|
43
|
+
spacingMedium: spacing?.medium,
|
|
44
|
+
spacingLarge: spacing?.large,
|
|
43
45
|
...media
|
|
44
46
|
};
|
|
45
47
|
return {
|
package/lib/GridRow/v2/index.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.GridRow = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
11
10
|
var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
|
|
@@ -16,9 +15,7 @@ var _emotion = require("@instructure/emotion");
|
|
|
16
15
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
17
16
|
var _props = require("./props");
|
|
18
17
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
19
|
-
|
|
20
|
-
_excluded2 = ["styles"];
|
|
21
|
-
var _dec, _class, _GridRow;
|
|
18
|
+
var _dec, _class;
|
|
22
19
|
/*
|
|
23
20
|
* The MIT License (MIT)
|
|
24
21
|
*
|
|
@@ -48,27 +45,30 @@ parent: Grid
|
|
|
48
45
|
id: Grid.Row
|
|
49
46
|
---
|
|
50
47
|
**/
|
|
51
|
-
let GridRow = exports.GridRow = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
48
|
+
let GridRow = exports.GridRow = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = class GridRow extends _react.Component {
|
|
49
|
+
static displayName = "GridRow";
|
|
50
|
+
static componentId = 'Grid.Row';
|
|
51
|
+
static allowedProps = _props.allowedProps;
|
|
52
|
+
static defaultProps = {
|
|
53
|
+
children: null,
|
|
54
|
+
isLastRow: false
|
|
55
|
+
};
|
|
56
|
+
ref = null;
|
|
57
|
+
handleRef = el => {
|
|
58
|
+
this.ref = el;
|
|
59
|
+
};
|
|
59
60
|
componentDidMount() {
|
|
60
|
-
|
|
61
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
61
|
+
this.props.makeStyles?.();
|
|
62
62
|
}
|
|
63
63
|
componentDidUpdate() {
|
|
64
|
-
|
|
65
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
64
|
+
this.props.makeStyles?.();
|
|
66
65
|
}
|
|
67
66
|
renderChildren() {
|
|
68
|
-
const
|
|
69
|
-
styles
|
|
70
|
-
makeStyles
|
|
71
|
-
props
|
|
67
|
+
const {
|
|
68
|
+
styles,
|
|
69
|
+
makeStyles,
|
|
70
|
+
...props
|
|
71
|
+
} = this.props;
|
|
72
72
|
return _react.Children.map(this.props.children, (child, index) => {
|
|
73
73
|
if ((0, _matchComponentTypes.matchComponentTypes)(child, [_v.GridCol])) {
|
|
74
74
|
return (0, _safeCloneElement.safeCloneElement)(child, {
|
|
@@ -83,19 +83,17 @@ let GridRow = exports.GridRow = (_dec = (0, _emotion.withStyle)(_styles.default)
|
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
render() {
|
|
86
|
-
const
|
|
87
|
-
styles
|
|
88
|
-
restProps
|
|
86
|
+
const {
|
|
87
|
+
styles,
|
|
88
|
+
...restProps
|
|
89
|
+
} = this.props;
|
|
89
90
|
const props = (0, _omitProps.omitProps)(restProps, GridRow.allowedProps);
|
|
90
91
|
return (0, _jsxRuntime.jsx)("span", {
|
|
91
92
|
...props,
|
|
92
|
-
css: styles
|
|
93
|
+
css: styles?.gridRow,
|
|
93
94
|
ref: this.handleRef,
|
|
94
95
|
children: this.renderChildren()
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
|
-
}
|
|
98
|
-
children: null,
|
|
99
|
-
isLastRow: false
|
|
100
|
-
}, _GridRow)) || _class);
|
|
98
|
+
}) || _class);
|
|
101
99
|
var _default = exports.default = GridRow;
|
package/lib/GridRow/v2/styles.js
CHANGED
|
@@ -39,13 +39,15 @@ exports.default = void 0;
|
|
|
39
39
|
* @return {Object} The final style object, which will be used in the component
|
|
40
40
|
*/
|
|
41
41
|
const generateStyle = (componentTheme, props) => {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
const {
|
|
43
|
+
hAlign,
|
|
44
|
+
vAlign,
|
|
45
|
+
rowSpacing,
|
|
46
|
+
colSpacing,
|
|
47
|
+
isLastRow,
|
|
48
|
+
startAt,
|
|
49
|
+
visualDebug
|
|
50
|
+
} = props;
|
|
49
51
|
const getGridRowStyle = () => {
|
|
50
52
|
const hAlignVariants = {
|
|
51
53
|
center: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-grid",
|
|
3
|
-
"version": "11.7.3-snapshot-
|
|
3
|
+
"version": "11.7.3-snapshot-26",
|
|
4
4
|
"description": "A Grid component.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
"bugs": "https://github.com/instructure/instructure-ui/issues",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@babel/runtime": "^7.
|
|
18
|
-
"@instructure/console": "11.7.3-snapshot-
|
|
19
|
-
"@instructure/shared-types": "11.7.3-snapshot-
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/
|
|
22
|
-
"@instructure/ui-react-utils": "11.7.3-snapshot-
|
|
23
|
-
"@instructure/ui-utils": "11.7.3-snapshot-
|
|
24
|
-
"@instructure/ui-themes": "11.7.3-snapshot-
|
|
17
|
+
"@babel/runtime": "^7.29.2",
|
|
18
|
+
"@instructure/console": "11.7.3-snapshot-26",
|
|
19
|
+
"@instructure/shared-types": "11.7.3-snapshot-26",
|
|
20
|
+
"@instructure/emotion": "11.7.3-snapshot-26",
|
|
21
|
+
"@instructure/ui-a11y-content": "11.7.3-snapshot-26",
|
|
22
|
+
"@instructure/ui-react-utils": "11.7.3-snapshot-26",
|
|
23
|
+
"@instructure/ui-utils": "11.7.3-snapshot-26",
|
|
24
|
+
"@instructure/ui-themes": "11.7.3-snapshot-26"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@testing-library/jest-dom": "^6.6.3",
|
|
28
28
|
"@testing-library/react": "15.0.7",
|
|
29
29
|
"vitest": "^3.2.2",
|
|
30
|
-
"@instructure/ui-
|
|
31
|
-
"@instructure/ui-
|
|
30
|
+
"@instructure/ui-babel-preset": "11.7.3-snapshot-26",
|
|
31
|
+
"@instructure/ui-color-utils": "11.7.3-snapshot-26"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": ">=18 <=19"
|