@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.
@@ -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 vAlign = props.vAlign,
43
- textAlign = props.textAlign,
44
- rowSpacing = props.rowSpacing,
45
- colSpacing = props.colSpacing,
46
- isLastRow = props.isLastRow,
47
- isLastCol = props.isLastCol,
48
- startAt = props.startAt,
49
- visualDebug = props.visualDebug;
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 width = props.width;
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 offset = props.offset;
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];
@@ -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
- const _excluded = ["styles", "makeStyles"],
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 = (_GridRow = class GridRow extends _react.Component {
53
- constructor(...args) {
54
- super(...args);
55
- this.ref = null;
56
- this.handleRef = el => {
57
- this.ref = el;
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
- var _this$props$makeStyle, _this$props;
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
- var _this$props$makeStyle2, _this$props2;
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 _this$props3 = this.props,
70
- styles = _this$props3.styles,
71
- makeStyles = _this$props3.makeStyles,
72
- props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
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 _this$props4 = this.props,
88
- styles = _this$props4.styles,
89
- restProps = (0, _objectWithoutProperties2.default)(_this$props4, _excluded2);
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 === null || styles === void 0 ? void 0 : styles.gridRow,
94
+ css: styles?.gridRow,
94
95
  ref: this.handleRef,
95
96
  children: this.renderChildren()
96
97
  });
97
98
  }
98
- }, _GridRow.displayName = "GridRow", _GridRow.componentId = 'Grid.Row', _GridRow.allowedProps = _props.allowedProps, _GridRow.defaultProps = {
99
- children: null,
100
- isLastRow: false
101
- }, _GridRow)) || _class);
99
+ }) || _class);
102
100
  var _default = exports.default = GridRow;
@@ -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 hAlign = props.hAlign,
43
- vAlign = props.vAlign,
44
- rowSpacing = props.rowSpacing,
45
- colSpacing = props.colSpacing,
46
- isLastRow = props.isLastRow,
47
- startAt = props.startAt,
48
- visualDebug = props.visualDebug;
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: {
@@ -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 spacing = theme.spacing,
38
- media = theme.media;
37
+ const {
38
+ spacing,
39
+ media
40
+ } = theme;
39
41
  const componentVariables = {
40
- spacingSmall: spacing === null || spacing === void 0 ? void 0 : spacing.small,
41
- spacingMedium: spacing === null || spacing === void 0 ? void 0 : spacing.medium,
42
- spacingLarge: spacing === null || spacing === void 0 ? void 0 : spacing.large,
42
+ spacingSmall: spacing?.small,
43
+ spacingMedium: spacing?.medium,
44
+ spacingLarge: spacing?.large,
43
45
  ...media
44
46
  };
45
47
  return {
@@ -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
- const _excluded = ["styles", "makeStyles"],
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 = (_GridRow = class GridRow extends _react.Component {
52
- constructor(...args) {
53
- super(...args);
54
- this.ref = null;
55
- this.handleRef = el => {
56
- this.ref = el;
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
- var _this$props$makeStyle, _this$props;
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
- var _this$props$makeStyle2, _this$props2;
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 _this$props3 = this.props,
69
- styles = _this$props3.styles,
70
- makeStyles = _this$props3.makeStyles,
71
- props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
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 _this$props4 = this.props,
87
- styles = _this$props4.styles,
88
- restProps = (0, _objectWithoutProperties2.default)(_this$props4, _excluded2);
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 === null || styles === void 0 ? void 0 : styles.gridRow,
93
+ css: styles?.gridRow,
93
94
  ref: this.handleRef,
94
95
  children: this.renderChildren()
95
96
  });
96
97
  }
97
- }, _GridRow.displayName = "GridRow", _GridRow.componentId = 'Grid.Row', _GridRow.allowedProps = _props.allowedProps, _GridRow.defaultProps = {
98
- children: null,
99
- isLastRow: false
100
- }, _GridRow)) || _class);
98
+ }) || _class);
101
99
  var _default = exports.default = GridRow;
@@ -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 hAlign = props.hAlign,
43
- vAlign = props.vAlign,
44
- rowSpacing = props.rowSpacing,
45
- colSpacing = props.colSpacing,
46
- isLastRow = props.isLastRow,
47
- startAt = props.startAt,
48
- visualDebug = props.visualDebug;
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-7",
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.27.6",
18
- "@instructure/console": "11.7.3-snapshot-7",
19
- "@instructure/shared-types": "11.7.3-snapshot-7",
20
- "@instructure/ui-a11y-content": "11.7.3-snapshot-7",
21
- "@instructure/emotion": "11.7.3-snapshot-7",
22
- "@instructure/ui-react-utils": "11.7.3-snapshot-7",
23
- "@instructure/ui-utils": "11.7.3-snapshot-7",
24
- "@instructure/ui-themes": "11.7.3-snapshot-7"
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-color-utils": "11.7.3-snapshot-7",
31
- "@instructure/ui-babel-preset": "11.7.3-snapshot-7"
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"