@instructure/ui-responsive 7.15.0 → 7.16.0
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 +6 -0
- package/es/Responsive/index.js +3 -2
- package/lib/Responsive/index.js +2 -2
- package/package.json +11 -11
- package/src/Responsive/index.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [7.16.0](https://github.com/instructure/instructure-ui/compare/v7.15.0...v7.16.0) (2022-02-08)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **ui-responsive:** modify Responsive "props override" error to warning ([a2eb4b8](https://github.com/instructure/instructure-ui/commit/a2eb4b8))
|
|
11
|
+
|
|
6
12
|
# [7.15.0](https://github.com/instructure/instructure-ui/compare/v7.14.1...v7.15.0) (2022-02-03)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @instructure/ui-responsive
|
package/es/Responsive/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
+
import { warn as _warn } from "@instructure/console";
|
|
5
6
|
import { error as _error } from "@instructure/console";
|
|
6
7
|
|
|
7
8
|
/*
|
|
@@ -147,13 +148,13 @@ var Responsive = /*#__PURE__*/function (_Component) {
|
|
|
147
148
|
var matchProps = props[match]; // Iterate over the props for the current match. If that the prop is
|
|
148
149
|
// already in `mergedProps` that means that the prop was defined for
|
|
149
150
|
// multiple breakpoints, and more than one of those breakpoints is being
|
|
150
|
-
// currently applied so we log
|
|
151
|
+
// currently applied so we log a warning.
|
|
151
152
|
|
|
152
153
|
Object.keys(matchProps).forEach(function (prop) {
|
|
153
154
|
/*#__PURE__*/
|
|
154
155
|
|
|
155
156
|
/*#__PURE__*/
|
|
156
|
-
|
|
157
|
+
_warn(!(prop in mergedProps), ["[Responsive] The prop `".concat(prop, "` is defined at 2 or more breakpoints"), "which are currently applied at the same time. Its current value, `".concat(mergedProps[prop], "`,"), "will be overwritten as `".concat(matchProps[prop], "`.")].join(' '));
|
|
157
158
|
|
|
158
159
|
mergedProps[prop] = matchProps[prop];
|
|
159
160
|
});
|
package/lib/Responsive/index.js
CHANGED
|
@@ -167,11 +167,11 @@ var Responsive = /*#__PURE__*/function (_Component) {
|
|
|
167
167
|
var matchProps = props[match]; // Iterate over the props for the current match. If that the prop is
|
|
168
168
|
// already in `mergedProps` that means that the prop was defined for
|
|
169
169
|
// multiple breakpoints, and more than one of those breakpoints is being
|
|
170
|
-
// currently applied so we log
|
|
170
|
+
// currently applied so we log a warning.
|
|
171
171
|
|
|
172
172
|
Object.keys(matchProps).forEach(function (prop) {
|
|
173
173
|
/*#__PURE__*/
|
|
174
|
-
( /*#__PURE__*/0, _console.
|
|
174
|
+
( /*#__PURE__*/0, _console.warn)(!(prop in mergedProps), ["[Responsive] The prop `".concat(prop, "` is defined at 2 or more breakpoints"), "which are currently applied at the same time. Its current value, `".concat(mergedProps[prop], "`,"), "will be overwritten as `".concat(matchProps[prop], "`.")].join(' '));
|
|
175
175
|
mergedProps[prop] = matchProps[prop];
|
|
176
176
|
});
|
|
177
177
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-responsive",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.16.0",
|
|
4
4
|
"description": "A component that allows for rendering a component differently based on either the element or the viewport size",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@babel/runtime": "^7.9.2",
|
|
26
|
-
"@instructure/console": "^7.
|
|
27
|
-
"@instructure/debounce": "^7.
|
|
28
|
-
"@instructure/ui-dom-utils": "^7.
|
|
29
|
-
"@instructure/ui-react-utils": "^7.
|
|
30
|
-
"@instructure/ui-testable": "^7.
|
|
31
|
-
"@instructure/ui-themeable": "^7.
|
|
32
|
-
"@instructure/ui-utils": "^7.
|
|
26
|
+
"@instructure/console": "^7.16.0",
|
|
27
|
+
"@instructure/debounce": "^7.16.0",
|
|
28
|
+
"@instructure/ui-dom-utils": "^7.16.0",
|
|
29
|
+
"@instructure/ui-react-utils": "^7.16.0",
|
|
30
|
+
"@instructure/ui-testable": "^7.16.0",
|
|
31
|
+
"@instructure/ui-themeable": "^7.16.0",
|
|
32
|
+
"@instructure/ui-utils": "^7.16.0",
|
|
33
33
|
"prop-types": "^15"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@instructure/ui-babel-preset": "^7.
|
|
37
|
-
"@instructure/ui-color-utils": "^7.
|
|
38
|
-
"@instructure/ui-test-utils": "^7.
|
|
36
|
+
"@instructure/ui-babel-preset": "^7.16.0",
|
|
37
|
+
"@instructure/ui-color-utils": "^7.16.0",
|
|
38
|
+
"@instructure/ui-test-utils": "^7.16.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": "^16.8"
|
package/src/Responsive/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import React, { Component } from 'react'
|
|
|
26
26
|
import PropTypes from 'prop-types'
|
|
27
27
|
|
|
28
28
|
import { deepEqual } from '@instructure/ui-utils'
|
|
29
|
-
import { error } from '@instructure/console/macro'
|
|
29
|
+
import { error, warn } from '@instructure/console/macro'
|
|
30
30
|
|
|
31
31
|
import {
|
|
32
32
|
addElementQueryMatchListener,
|
|
@@ -163,9 +163,9 @@ class Responsive extends Component {
|
|
|
163
163
|
// Iterate over the props for the current match. If that the prop is
|
|
164
164
|
// already in `mergedProps` that means that the prop was defined for
|
|
165
165
|
// multiple breakpoints, and more than one of those breakpoints is being
|
|
166
|
-
// currently applied so we log
|
|
166
|
+
// currently applied so we log a warning.
|
|
167
167
|
Object.keys(matchProps).forEach((prop) => {
|
|
168
|
-
|
|
168
|
+
warn(
|
|
169
169
|
!(prop in mergedProps),
|
|
170
170
|
[
|
|
171
171
|
`[Responsive] The prop \`${prop}\` is defined at 2 or more breakpoints`,
|