@instructure/ui-responsive 8.25.1-snapshot-10 → 8.25.1-snapshot-13

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 CHANGED
@@ -3,7 +3,7 @@
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
- ## [8.25.1-snapshot-10](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-10) (2022-06-20)
6
+ ## [8.25.1-snapshot-13](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-13) (2022-06-22)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-responsive
9
9
 
@@ -36,20 +36,25 @@ category: components
36
36
  **/
37
37
 
38
38
  class Responsive extends Component {
39
- static displayName = "Responsive";
40
- static allowedProps = allowedProps;
41
- static propTypes = propTypes;
42
- static defaultProps = {
43
- children: null,
44
- match: 'element',
45
- props: null
46
- };
47
- ref = /*#__PURE__*/createRef();
48
- _matchListener = null;
49
- state = {
50
- matches: [],
51
- hasRendered: false
52
- };
39
+ constructor() {
40
+ super(...arguments);
41
+ this.ref = /*#__PURE__*/createRef();
42
+ this._matchListener = null;
43
+ this.state = {
44
+ matches: [],
45
+ hasRendered: false
46
+ };
47
+
48
+ this.updateMatches = (matches, cb) => {
49
+ this.setState({
50
+ matches
51
+ }, () => {
52
+ if (typeof cb === 'function') {
53
+ cb();
54
+ }
55
+ });
56
+ };
57
+ }
53
58
 
54
59
  componentDidMount() {
55
60
  error(!!(this.props.render || this.props.children), `[Responsive] must have either a \`render\` prop or \`children\` prop.`);
@@ -99,16 +104,6 @@ class Responsive extends Component {
99
104
  }
100
105
  }
101
106
 
102
- updateMatches = (matches, cb) => {
103
- this.setState({
104
- matches
105
- }, () => {
106
- if (typeof cb === 'function') {
107
- cb();
108
- }
109
- });
110
- };
111
-
112
107
  mergeProps(matches, props) {
113
108
  if (!props) {
114
109
  return null;
@@ -155,5 +150,13 @@ class Responsive extends Component {
155
150
 
156
151
  }
157
152
 
153
+ Responsive.displayName = "Responsive";
154
+ Responsive.allowedProps = allowedProps;
155
+ Responsive.propTypes = propTypes;
156
+ Responsive.defaultProps = {
157
+ children: null,
158
+ match: 'element',
159
+ props: null
160
+ };
158
161
  export default Responsive;
159
162
  export { Responsive };
package/lib/QueryType.js CHANGED
@@ -1 +1,5 @@
1
- "use strict";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -52,20 +52,25 @@ category: components
52
52
  @tsProps
53
53
  **/
54
54
  class Responsive extends _react.Component {
55
- static displayName = "Responsive";
56
- static allowedProps = _props.allowedProps;
57
- static propTypes = _props.propTypes;
58
- static defaultProps = {
59
- children: null,
60
- match: 'element',
61
- props: null
62
- };
63
- ref = /*#__PURE__*/(0, _react.createRef)();
64
- _matchListener = null;
65
- state = {
66
- matches: [],
67
- hasRendered: false
68
- };
55
+ constructor() {
56
+ super(...arguments);
57
+ this.ref = /*#__PURE__*/(0, _react.createRef)();
58
+ this._matchListener = null;
59
+ this.state = {
60
+ matches: [],
61
+ hasRendered: false
62
+ };
63
+
64
+ this.updateMatches = (matches, cb) => {
65
+ this.setState({
66
+ matches
67
+ }, () => {
68
+ if (typeof cb === 'function') {
69
+ cb();
70
+ }
71
+ });
72
+ };
73
+ }
69
74
 
70
75
  componentDidMount() {
71
76
  (0, _console.logError)(!!(this.props.render || this.props.children), `[Responsive] must have either a \`render\` prop or \`children\` prop.`);
@@ -115,16 +120,6 @@ class Responsive extends _react.Component {
115
120
  }
116
121
  }
117
122
 
118
- updateMatches = (matches, cb) => {
119
- this.setState({
120
- matches
121
- }, () => {
122
- if (typeof cb === 'function') {
123
- cb();
124
- }
125
- });
126
- };
127
-
128
123
  mergeProps(matches, props) {
129
124
  if (!props) {
130
125
  return null;
@@ -172,5 +167,13 @@ class Responsive extends _react.Component {
172
167
  }
173
168
 
174
169
  exports.Responsive = Responsive;
170
+ Responsive.displayName = "Responsive";
171
+ Responsive.allowedProps = _props.allowedProps;
172
+ Responsive.propTypes = _props.propTypes;
173
+ Responsive.defaultProps = {
174
+ children: null,
175
+ match: 'element',
176
+ props: null
177
+ };
175
178
  var _default = Responsive;
176
179
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-responsive",
3
- "version": "8.25.1-snapshot-10",
3
+ "version": "8.25.1-snapshot-13",
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
  "module": "./es/index.js",
@@ -24,19 +24,19 @@
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
26
  "@babel/runtime": "^7.13.10",
27
- "@instructure/console": "8.25.1-snapshot-10",
28
- "@instructure/debounce": "8.25.1-snapshot-10",
29
- "@instructure/shared-types": "8.25.1-snapshot-10",
30
- "@instructure/ui-dom-utils": "8.25.1-snapshot-10",
31
- "@instructure/ui-react-utils": "8.25.1-snapshot-10",
32
- "@instructure/ui-testable": "8.25.1-snapshot-10",
33
- "@instructure/ui-utils": "8.25.1-snapshot-10",
27
+ "@instructure/console": "8.25.1-snapshot-13",
28
+ "@instructure/debounce": "8.25.1-snapshot-13",
29
+ "@instructure/shared-types": "8.25.1-snapshot-13",
30
+ "@instructure/ui-dom-utils": "8.25.1-snapshot-13",
31
+ "@instructure/ui-react-utils": "8.25.1-snapshot-13",
32
+ "@instructure/ui-testable": "8.25.1-snapshot-13",
33
+ "@instructure/ui-utils": "8.25.1-snapshot-13",
34
34
  "prop-types": "^15"
35
35
  },
36
36
  "devDependencies": {
37
- "@instructure/ui-babel-preset": "8.25.1-snapshot-10",
38
- "@instructure/ui-color-utils": "8.25.1-snapshot-10",
39
- "@instructure/ui-test-utils": "8.25.1-snapshot-10"
37
+ "@instructure/ui-babel-preset": "8.25.1-snapshot-13",
38
+ "@instructure/ui-color-utils": "8.25.1-snapshot-13",
39
+ "@instructure/ui-test-utils": "8.25.1-snapshot-13"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=16.8 <=17"