@instructure/ui-pages 8.56.0 → 8.56.2-pr-snapshot-1721749364069
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 +16 -0
- package/lib/Pages/Page/index.js +5 -6
- package/lib/Pages/index.js +8 -10
- package/lib/Pages/props.js +3 -4
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.56.2-pr-snapshot-1721749364069](https://github.com/instructure/instructure-ui/compare/v8.56.1...v8.56.2-pr-snapshot-1721749364069) (2024-07-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-pages
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [8.56.1](https://github.com/instructure/instructure-ui/compare/v8.56.0...v8.56.1) (2024-06-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @instructure/ui-pages
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [8.56.0](https://github.com/instructure/instructure-ui/compare/v8.55.1...v8.56.0) (2024-05-06)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @instructure/ui-pages
|
package/lib/Pages/Page/index.js
CHANGED
|
@@ -9,10 +9,9 @@ exports.default = exports.Page = void 0;
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var
|
|
13
|
-
var _findTabbable = require("@instructure/ui-dom-utils/lib/findTabbable.js");
|
|
12
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
14
13
|
var _console = require("@instructure/console");
|
|
15
|
-
var
|
|
14
|
+
var _uiView = require("@instructure/ui-view");
|
|
16
15
|
var _PagesContext = require("../PagesContext");
|
|
17
16
|
var _props = require("./props");
|
|
18
17
|
const _excluded = ["children"];
|
|
@@ -62,10 +61,10 @@ class Page extends _react.Component {
|
|
|
62
61
|
defaultFocusElement = defaultFocusElement();
|
|
63
62
|
}
|
|
64
63
|
if (defaultFocusElement) {
|
|
65
|
-
defaultFocusElement = (0,
|
|
64
|
+
defaultFocusElement = (0, _uiDomUtils.findDOMNode)(defaultFocusElement);
|
|
66
65
|
}
|
|
67
66
|
if (!defaultFocusElement) {
|
|
68
|
-
const tabbable = (0,
|
|
67
|
+
const tabbable = (0, _uiDomUtils.findTabbable)(this.ref);
|
|
69
68
|
defaultFocusElement = tabbable && tabbable[0];
|
|
70
69
|
}
|
|
71
70
|
(0, _console.logError)(defaultFocusElement && !!defaultFocusElement.focus, '[Page] A default focusable element is required or focus will be lost.');
|
|
@@ -88,7 +87,7 @@ class Page extends _react.Component {
|
|
|
88
87
|
return /*#__PURE__*/_react.default.createElement(_PagesContext.PagesContext.Consumer, null, ({
|
|
89
88
|
history,
|
|
90
89
|
navigateToPreviousPage
|
|
91
|
-
}) => /*#__PURE__*/_react.default.createElement(
|
|
90
|
+
}) => /*#__PURE__*/_react.default.createElement(_uiView.View, {
|
|
92
91
|
as: "div",
|
|
93
92
|
padding: props.padding,
|
|
94
93
|
textAlign: props.textAlign,
|
package/lib/Pages/index.js
CHANGED
|
@@ -13,11 +13,9 @@ Object.defineProperty(exports, "Page", {
|
|
|
13
13
|
});
|
|
14
14
|
exports.default = exports.Pages = void 0;
|
|
15
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
20
|
-
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
16
|
+
var _uiView = require("@instructure/ui-view");
|
|
17
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
18
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
21
19
|
var _console = require("@instructure/console");
|
|
22
20
|
var _Page = require("./Page");
|
|
23
21
|
var _emotion = require("@instructure/emotion");
|
|
@@ -55,7 +53,7 @@ var _dec, _dec2, _class, _class2;
|
|
|
55
53
|
category: components
|
|
56
54
|
---
|
|
57
55
|
**/
|
|
58
|
-
let Pages = exports.Pages = (_dec = (0,
|
|
56
|
+
let Pages = exports.Pages = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = (_class2 = class Pages extends _react.Component {
|
|
59
57
|
get _contentElement() {
|
|
60
58
|
return this.ref;
|
|
61
59
|
}
|
|
@@ -105,7 +103,7 @@ let Pages = exports.Pages = (_dec = (0, _withDeterministicId.withDeterministicId
|
|
|
105
103
|
this._timeouts.forEach(clearTimeout);
|
|
106
104
|
}
|
|
107
105
|
get focused() {
|
|
108
|
-
return (0,
|
|
106
|
+
return (0, _uiDomUtils.containsActiveElement)(this.ref);
|
|
109
107
|
}
|
|
110
108
|
focus() {
|
|
111
109
|
this._timeouts.push(setTimeout(() => {
|
|
@@ -116,7 +114,7 @@ let Pages = exports.Pages = (_dec = (0, _withDeterministicId.withDeterministicId
|
|
|
116
114
|
activePage.focus();
|
|
117
115
|
} else {
|
|
118
116
|
// Use first tabbable as last ditch effort
|
|
119
|
-
const tabbable = (0,
|
|
117
|
+
const tabbable = (0, _uiDomUtils.findTabbable)(this.ref);
|
|
120
118
|
const element = tabbable && tabbable[0];
|
|
121
119
|
element && element.focus();
|
|
122
120
|
}
|
|
@@ -129,7 +127,7 @@ let Pages = exports.Pages = (_dec = (0, _withDeterministicId.withDeterministicId
|
|
|
129
127
|
const pages = _react.default.Children.toArray(children);
|
|
130
128
|
const activePage = activePageIndex < pages.length ? pages[activePageIndex] : null;
|
|
131
129
|
(0, _console.logError)(!!activePage, '[Pages] Invalid `activePageIndex`.');
|
|
132
|
-
return activePage ? (0,
|
|
130
|
+
return activePage ? (0, _uiReactUtils.safeCloneElement)(activePage, {
|
|
133
131
|
ref: el => {
|
|
134
132
|
this._activePage = el;
|
|
135
133
|
}
|
|
@@ -145,7 +143,7 @@ let Pages = exports.Pages = (_dec = (0, _withDeterministicId.withDeterministicId
|
|
|
145
143
|
this.handleBackButtonClick();
|
|
146
144
|
}
|
|
147
145
|
}
|
|
148
|
-
}, (0, _emotion.jsx)(
|
|
146
|
+
}, (0, _emotion.jsx)(_uiView.View, {
|
|
149
147
|
as: "div",
|
|
150
148
|
id: this._contentId,
|
|
151
149
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.pages,
|
package/lib/Pages/props.js
CHANGED
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.propTypes = exports.allowedProps = void 0;
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var
|
|
10
|
-
var _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
|
|
9
|
+
var _uiPropTypes = require("@instructure/ui-prop-types");
|
|
11
10
|
var _emotion = require("@instructure/emotion");
|
|
12
11
|
var _Page = require("./Page");
|
|
13
12
|
/*
|
|
@@ -35,9 +34,9 @@ var _Page = require("./Page");
|
|
|
35
34
|
*/
|
|
36
35
|
|
|
37
36
|
const propTypes = exports.propTypes = {
|
|
38
|
-
children:
|
|
37
|
+
children: _uiPropTypes.Children.oneOf([_Page.Page]),
|
|
39
38
|
defaultPageIndex: _propTypes.default.number,
|
|
40
|
-
activePageIndex: (0,
|
|
39
|
+
activePageIndex: (0, _uiPropTypes.controllable)(_propTypes.default.number, 'onPageIndexChange', 'defaultPageIndex'),
|
|
41
40
|
onPageIndexChange: _propTypes.default.func,
|
|
42
41
|
margin: _emotion.ThemeablePropTypes.spacing
|
|
43
42
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-pages",
|
|
3
|
-
"version": "8.56.
|
|
3
|
+
"version": "8.56.2-pr-snapshot-1721749364069",
|
|
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.56.
|
|
27
|
-
"@instructure/ui-color-utils": "8.56.
|
|
28
|
-
"@instructure/ui-test-utils": "8.56.
|
|
29
|
-
"@instructure/ui-themes": "8.56.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.56.2-pr-snapshot-1721749364069",
|
|
27
|
+
"@instructure/ui-color-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
28
|
+
"@instructure/ui-test-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
29
|
+
"@instructure/ui-themes": "8.56.2-pr-snapshot-1721749364069"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/runtime": "^7.23.2",
|
|
33
|
-
"@instructure/console": "8.56.
|
|
34
|
-
"@instructure/emotion": "8.56.
|
|
35
|
-
"@instructure/shared-types": "8.56.
|
|
36
|
-
"@instructure/ui-dom-utils": "8.56.
|
|
37
|
-
"@instructure/ui-prop-types": "8.56.
|
|
38
|
-
"@instructure/ui-react-utils": "8.56.
|
|
39
|
-
"@instructure/ui-utils": "8.56.
|
|
40
|
-
"@instructure/ui-view": "8.56.
|
|
33
|
+
"@instructure/console": "8.56.2-pr-snapshot-1721749364069",
|
|
34
|
+
"@instructure/emotion": "8.56.2-pr-snapshot-1721749364069",
|
|
35
|
+
"@instructure/shared-types": "8.56.2-pr-snapshot-1721749364069",
|
|
36
|
+
"@instructure/ui-dom-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
37
|
+
"@instructure/ui-prop-types": "8.56.2-pr-snapshot-1721749364069",
|
|
38
|
+
"@instructure/ui-react-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
39
|
+
"@instructure/ui-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
40
|
+
"@instructure/ui-view": "8.56.2-pr-snapshot-1721749364069",
|
|
41
41
|
"prop-types": "^15.8.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|