@instructure/ui-pages 8.18.0 → 8.18.1-snapshot.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/LICENSE.md ADDED
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: The MIT License (MIT)
3
+ category: Getting Started
4
+ order: 9
5
+ ---
6
+
7
+ # The MIT License (MIT)
8
+
9
+ Copyright (c) 2015 Instructure, Inc.
10
+
11
+ **Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions.**
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
package/es/Pages/index.js CHANGED
@@ -61,10 +61,12 @@ let Pages = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
61
61
  };
62
62
 
63
63
  this.handleBackButtonClick = () => {
64
+ var _this$props$onPageInd, _this$props;
65
+
64
66
  const oldPageIndex = this._history.pop();
65
67
 
66
68
  const newPageIndex = this._history[this._history.length - 1];
67
- this.props.onPageIndexChange?.(newPageIndex || 0, oldPageIndex);
69
+ (_this$props$onPageInd = (_this$props = this.props).onPageIndexChange) === null || _this$props$onPageInd === void 0 ? void 0 : _this$props$onPageInd.call(_this$props, newPageIndex || 0, oldPageIndex);
68
70
  };
69
71
 
70
72
  this._history = [typeof props.defaultPageIndex === 'number' ? props.defaultPageIndex : props.activePageIndex];
@@ -72,7 +74,9 @@ let Pages = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
72
74
  }
73
75
 
74
76
  componentDidMount() {
75
- this.props.makeStyles?.();
77
+ var _this$props$makeStyle, _this$props2;
78
+
79
+ (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
76
80
  }
77
81
 
78
82
  // TODO: componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
@@ -83,11 +87,13 @@ let Pages = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
83
87
  }
84
88
 
85
89
  componentDidUpdate() {
90
+ var _this$props$makeStyle2, _this$props3;
91
+
86
92
  this._timeouts.push(setTimeout(() => {
87
93
  !this.focused && this.focus();
88
94
  }, 0));
89
95
 
90
- this.props.makeStyles?.();
96
+ (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
91
97
  }
92
98
 
93
99
  componentWillUnmount() {
@@ -114,9 +120,9 @@ let Pages = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
114
120
  }
115
121
 
116
122
  get activePage() {
117
- const _this$props = this.props,
118
- activePageIndex = _this$props.activePageIndex,
119
- children = _this$props.children;
123
+ const _this$props4 = this.props,
124
+ activePageIndex = _this$props4.activePageIndex,
125
+ children = _this$props4.children;
120
126
  const pages = React.Children.toArray(children);
121
127
  const activePage = activePageIndex < pages.length ? pages[activePageIndex] : null;
122
128
  error(!!activePage, '[Pages] Invalid `activePageIndex`.');
@@ -128,6 +134,8 @@ let Pages = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
128
134
  }
129
135
 
130
136
  render() {
137
+ var _this$props$styles;
138
+
131
139
  const activePage = this.activePage;
132
140
  return activePage ? jsx(PagesContext.Provider, {
133
141
  value: {
@@ -139,7 +147,7 @@ let Pages = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
139
147
  }, jsx(View, {
140
148
  as: "div",
141
149
  id: this._contentId,
142
- css: this.props.styles?.pages,
150
+ css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.pages,
143
151
  margin: this.props.margin,
144
152
  role: "region",
145
153
  elementRef: this.handleRef
package/es/Pages/theme.js CHANGED
@@ -31,11 +31,11 @@ const generateComponentTheme = theme => {
31
31
  const colors = theme.colors,
32
32
  typography = theme.typography;
33
33
  return {
34
- fontSize: typography?.fontSizeMedium,
35
- fontFamily: typography?.fontFamily,
36
- fontWeight: typography?.fontWeightNormal,
37
- color: colors?.textDarkest,
38
- background: colors?.backgroundLightest
34
+ fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
35
+ fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
36
+ fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
37
+ color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
38
+ background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest
39
39
  };
40
40
  };
41
41
 
@@ -67,10 +67,12 @@ let Pages = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
67
67
  };
68
68
 
69
69
  this.handleBackButtonClick = () => {
70
+ var _this$props$onPageInd, _this$props;
71
+
70
72
  const oldPageIndex = this._history.pop();
71
73
 
72
74
  const newPageIndex = this._history[this._history.length - 1];
73
- this.props.onPageIndexChange?.(newPageIndex || 0, oldPageIndex);
75
+ (_this$props$onPageInd = (_this$props = this.props).onPageIndexChange) === null || _this$props$onPageInd === void 0 ? void 0 : _this$props$onPageInd.call(_this$props, newPageIndex || 0, oldPageIndex);
74
76
  };
75
77
 
76
78
  this._history = [typeof props.defaultPageIndex === 'number' ? props.defaultPageIndex : props.activePageIndex];
@@ -78,7 +80,9 @@ let Pages = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
78
80
  }
79
81
 
80
82
  componentDidMount() {
81
- this.props.makeStyles?.();
83
+ var _this$props$makeStyle, _this$props2;
84
+
85
+ (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
82
86
  }
83
87
 
84
88
  // TODO: componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
@@ -89,11 +93,13 @@ let Pages = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
89
93
  }
90
94
 
91
95
  componentDidUpdate() {
96
+ var _this$props$makeStyle2, _this$props3;
97
+
92
98
  this._timeouts.push(setTimeout(() => {
93
99
  !this.focused && this.focus();
94
100
  }, 0));
95
101
 
96
- this.props.makeStyles?.();
102
+ (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
97
103
  }
98
104
 
99
105
  componentWillUnmount() {
@@ -120,9 +126,9 @@ let Pages = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
120
126
  }
121
127
 
122
128
  get activePage() {
123
- const _this$props = this.props,
124
- activePageIndex = _this$props.activePageIndex,
125
- children = _this$props.children;
129
+ const _this$props4 = this.props,
130
+ activePageIndex = _this$props4.activePageIndex,
131
+ children = _this$props4.children;
126
132
 
127
133
  const pages = _react.default.Children.toArray(children);
128
134
 
@@ -136,6 +142,8 @@ let Pages = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
136
142
  }
137
143
 
138
144
  render() {
145
+ var _this$props$styles;
146
+
139
147
  const activePage = this.activePage;
140
148
  return activePage ? (0, _emotion.jsx)(_PagesContext.PagesContext.Provider, {
141
149
  value: {
@@ -147,7 +155,7 @@ let Pages = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
147
155
  }, (0, _emotion.jsx)(_View.View, {
148
156
  as: "div",
149
157
  id: this._contentId,
150
- css: this.props.styles?.pages,
158
+ css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.pages,
151
159
  margin: this.props.margin,
152
160
  role: "region",
153
161
  elementRef: this.handleRef
@@ -38,11 +38,11 @@ const generateComponentTheme = theme => {
38
38
  const colors = theme.colors,
39
39
  typography = theme.typography;
40
40
  return {
41
- fontSize: typography?.fontSizeMedium,
42
- fontFamily: typography?.fontFamily,
43
- fontWeight: typography?.fontWeightNormal,
44
- color: colors?.textDarkest,
45
- background: colors?.backgroundLightest
41
+ fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
42
+ fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
43
+ fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
44
+ color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
45
+ background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest
46
46
  };
47
47
  };
48
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-pages",
3
- "version": "8.18.0",
3
+ "version": "8.18.1-snapshot.0+435c9ae79",
4
4
  "description": "A UI component library made by Instructure Inc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,21 +23,21 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.18.0",
27
- "@instructure/ui-color-utils": "8.18.0",
28
- "@instructure/ui-test-utils": "8.18.0",
29
- "@instructure/ui-themes": "8.18.0"
26
+ "@instructure/ui-babel-preset": "8.18.1-snapshot.0+435c9ae79",
27
+ "@instructure/ui-color-utils": "8.18.1-snapshot.0+435c9ae79",
28
+ "@instructure/ui-test-utils": "8.18.1-snapshot.0+435c9ae79",
29
+ "@instructure/ui-themes": "8.18.1-snapshot.0+435c9ae79"
30
30
  },
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.13.10",
33
- "@instructure/console": "8.18.0",
34
- "@instructure/emotion": "8.18.0",
35
- "@instructure/shared-types": "8.18.0",
36
- "@instructure/ui-dom-utils": "8.18.0",
37
- "@instructure/ui-prop-types": "8.18.0",
38
- "@instructure/ui-react-utils": "8.18.0",
39
- "@instructure/ui-utils": "8.18.0",
40
- "@instructure/ui-view": "8.18.0",
33
+ "@instructure/console": "8.18.1-snapshot.0+435c9ae79",
34
+ "@instructure/emotion": "8.18.1-snapshot.0+435c9ae79",
35
+ "@instructure/shared-types": "8.18.1-snapshot.0+435c9ae79",
36
+ "@instructure/ui-dom-utils": "8.18.1-snapshot.0+435c9ae79",
37
+ "@instructure/ui-prop-types": "8.18.1-snapshot.0+435c9ae79",
38
+ "@instructure/ui-react-utils": "8.18.1-snapshot.0+435c9ae79",
39
+ "@instructure/ui-utils": "8.18.1-snapshot.0+435c9ae79",
40
+ "@instructure/ui-view": "8.18.1-snapshot.0+435c9ae79",
41
41
  "prop-types": "^15"
42
42
  },
43
43
  "peerDependencies": {
@@ -46,5 +46,6 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "sideEffects": false
49
+ "sideEffects": false,
50
+ "gitHead": "435c9ae794c15e2bd103f700f8c4e946d91c1b59"
50
51
  }