@instructure/quiz-core 20.11.3-rc.4 → 20.11.3-rc.5
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/es/common/components/layout/navbar/presenter.js +24 -18
- package/es/common/components/layout/navbar/styles.js +8 -0
- package/es/common/components/layout/navbar/theme.js +10 -0
- package/lib/common/components/layout/navbar/presenter.js +26 -22
- package/lib/common/components/layout/navbar/styles.js +16 -0
- package/lib/common/components/layout/navbar/theme.js +18 -0
- package/package.json +9 -9
|
@@ -3,18 +3,25 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
5
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
var _dec, _class, _class2, _temp;
|
|
8
|
+
|
|
9
|
+
/** @jsx jsx */
|
|
10
|
+
import { Component } from 'react';
|
|
7
11
|
import PropTypes from 'prop-types';
|
|
8
12
|
import { TopNavBar } from '@instructure/ui-top-nav-bar';
|
|
9
13
|
import { IconQuizLine } from '@instructure/ui-icons';
|
|
10
14
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
15
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
16
|
+
import generateStyle from "./styles.js";
|
|
17
|
+
import generateComponentTheme from "./theme.js";
|
|
11
18
|
|
|
12
|
-
var _ref =
|
|
19
|
+
var _ref = jsx(IconQuizLine, {
|
|
13
20
|
color: "primary",
|
|
14
21
|
size: "small"
|
|
15
22
|
});
|
|
16
23
|
|
|
17
|
-
export var NavBar = /*#__PURE__*/function (_Component) {
|
|
24
|
+
export var NavBar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
18
25
|
_inherits(NavBar, _Component);
|
|
19
26
|
|
|
20
27
|
var _super = _createSuper(NavBar);
|
|
@@ -50,15 +57,15 @@ export var NavBar = /*#__PURE__*/function (_Component) {
|
|
|
50
57
|
value: function render() {
|
|
51
58
|
var _this2 = this;
|
|
52
59
|
|
|
53
|
-
return
|
|
54
|
-
breakpoint:
|
|
60
|
+
return jsx(TopNavBar, {
|
|
61
|
+
breakpoint: this.props.styles.phoneBreakPoint,
|
|
55
62
|
mediaQueryMatch: "element",
|
|
56
63
|
inverseColor: true
|
|
57
64
|
}, function () {
|
|
58
|
-
return
|
|
65
|
+
return jsx(TopNavBar.Layout, {
|
|
59
66
|
themeOverride: {
|
|
60
|
-
desktopBackgroundInverse:
|
|
61
|
-
smallViewportBackgroundInverse:
|
|
67
|
+
desktopBackgroundInverse: _this2.props.styles.backgroundColor,
|
|
68
|
+
smallViewportBackgroundInverse: _this2.props.styles.backgroundColor
|
|
62
69
|
},
|
|
63
70
|
navLabel: t('Quizzes navigation bar'),
|
|
64
71
|
desktopConfig: {
|
|
@@ -68,16 +75,16 @@ export var NavBar = /*#__PURE__*/function (_Component) {
|
|
|
68
75
|
dropdownMenuToggleButtonLabel: t('Toggle Menu'),
|
|
69
76
|
dropdownMenuLabel: t('Main Menu')
|
|
70
77
|
},
|
|
71
|
-
renderBrand:
|
|
78
|
+
renderBrand: jsx(TopNavBar.Brand, {
|
|
72
79
|
screenReaderLabel: t('Quizzes'),
|
|
73
80
|
renderIcon: _ref
|
|
74
81
|
}),
|
|
75
|
-
renderMenuItems:
|
|
82
|
+
renderMenuItems: jsx(TopNavBar.MenuItems, {
|
|
76
83
|
listLabel: t('Page navigation'),
|
|
77
84
|
currentPageId: window.location.pathname,
|
|
78
85
|
renderHiddenItemsMenuTriggerLabel: _this2.hiddenMenuItemsMenuTriggerLabel
|
|
79
86
|
}, _this2.props.menuItems.map(function (menuItem) {
|
|
80
|
-
return
|
|
87
|
+
return jsx(TopNavBar.Item, {
|
|
81
88
|
id: menuItem.path,
|
|
82
89
|
key: menuItem.path,
|
|
83
90
|
onClick: function onClick() {
|
|
@@ -86,7 +93,7 @@ export var NavBar = /*#__PURE__*/function (_Component) {
|
|
|
86
93
|
|
|
87
94
|
}, menuItem.text);
|
|
88
95
|
})),
|
|
89
|
-
renderActionItems:
|
|
96
|
+
renderActionItems: jsx(TopNavBar.ActionItems, {
|
|
90
97
|
listLabel: t('Actions'),
|
|
91
98
|
renderHiddenItemsMenuTriggerLabel: _this2.hiddenActionItemsMenuTriggerLabel
|
|
92
99
|
}, _toConsumableArray(_this2.props.actionItems))
|
|
@@ -97,18 +104,17 @@ export var NavBar = /*#__PURE__*/function (_Component) {
|
|
|
97
104
|
|
|
98
105
|
NavBar.displayName = "NavBar";
|
|
99
106
|
return NavBar;
|
|
100
|
-
}(Component)
|
|
101
|
-
NavBar.propTypes = {
|
|
107
|
+
}(Component), _class2.propTypes = {
|
|
102
108
|
menuItems: PropTypes.arrayOf(PropTypes.shape({
|
|
103
109
|
path: PropTypes.string.isRequired,
|
|
104
110
|
text: PropTypes.string.isRequired
|
|
105
111
|
})),
|
|
106
112
|
handleMenuItemChange: PropTypes.func,
|
|
107
|
-
actionItems: PropTypes.arrayOf(PropTypes.node)
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
actionItems: PropTypes.arrayOf(PropTypes.node),
|
|
114
|
+
styles: PropTypes.object
|
|
115
|
+
}, _class2.defaultProps = {
|
|
110
116
|
menuItems: [],
|
|
111
117
|
handleMenuItemChange: function handleMenuItemChange() {},
|
|
112
118
|
actionItems: []
|
|
113
|
-
};
|
|
119
|
+
}, _temp)) || _class);
|
|
114
120
|
export default NavBar;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
|
+
var breakpoints = _ref.breakpoints,
|
|
3
|
+
colors = _ref.colors;
|
|
4
|
+
return {
|
|
5
|
+
backgroundColor: colors.porcelain,
|
|
6
|
+
phoneBreakPoint: breakpoints.medium
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default generateComponentTheme;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -19,7 +17,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
19
17
|
|
|
20
18
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
21
19
|
|
|
22
|
-
var _react =
|
|
20
|
+
var _react = require("react");
|
|
23
21
|
|
|
24
22
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
23
|
|
|
@@ -29,12 +27,20 @@ var _uiIcons = require("@instructure/ui-icons");
|
|
|
29
27
|
|
|
30
28
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
31
29
|
|
|
32
|
-
var
|
|
30
|
+
var _emotion = require("@instructure/emotion");
|
|
31
|
+
|
|
32
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
33
|
+
|
|
34
|
+
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
35
|
+
|
|
36
|
+
var _dec, _class, _class2, _temp;
|
|
37
|
+
|
|
38
|
+
var _ref = (0, _emotion.jsx)(_uiIcons.IconQuizLine, {
|
|
33
39
|
color: "primary",
|
|
34
40
|
size: "small"
|
|
35
41
|
});
|
|
36
42
|
|
|
37
|
-
var NavBar = /*#__PURE__*/function (_Component) {
|
|
43
|
+
var NavBar = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
38
44
|
(0, _inherits2.default)(NavBar, _Component);
|
|
39
45
|
|
|
40
46
|
var _super = (0, _createSuper2.default)(NavBar);
|
|
@@ -70,15 +76,15 @@ var NavBar = /*#__PURE__*/function (_Component) {
|
|
|
70
76
|
value: function render() {
|
|
71
77
|
var _this2 = this;
|
|
72
78
|
|
|
73
|
-
return
|
|
74
|
-
breakpoint:
|
|
79
|
+
return (0, _emotion.jsx)(_uiTopNavBar.TopNavBar, {
|
|
80
|
+
breakpoint: this.props.styles.phoneBreakPoint,
|
|
75
81
|
mediaQueryMatch: "element",
|
|
76
82
|
inverseColor: true
|
|
77
83
|
}, function () {
|
|
78
|
-
return
|
|
84
|
+
return (0, _emotion.jsx)(_uiTopNavBar.TopNavBar.Layout, {
|
|
79
85
|
themeOverride: {
|
|
80
|
-
desktopBackgroundInverse:
|
|
81
|
-
smallViewportBackgroundInverse:
|
|
86
|
+
desktopBackgroundInverse: _this2.props.styles.backgroundColor,
|
|
87
|
+
smallViewportBackgroundInverse: _this2.props.styles.backgroundColor
|
|
82
88
|
},
|
|
83
89
|
navLabel: (0, _formatMessage.default)('Quizzes navigation bar'),
|
|
84
90
|
desktopConfig: {
|
|
@@ -88,16 +94,16 @@ var NavBar = /*#__PURE__*/function (_Component) {
|
|
|
88
94
|
dropdownMenuToggleButtonLabel: (0, _formatMessage.default)('Toggle Menu'),
|
|
89
95
|
dropdownMenuLabel: (0, _formatMessage.default)('Main Menu')
|
|
90
96
|
},
|
|
91
|
-
renderBrand:
|
|
97
|
+
renderBrand: (0, _emotion.jsx)(_uiTopNavBar.TopNavBar.Brand, {
|
|
92
98
|
screenReaderLabel: (0, _formatMessage.default)('Quizzes'),
|
|
93
99
|
renderIcon: _ref
|
|
94
100
|
}),
|
|
95
|
-
renderMenuItems:
|
|
101
|
+
renderMenuItems: (0, _emotion.jsx)(_uiTopNavBar.TopNavBar.MenuItems, {
|
|
96
102
|
listLabel: (0, _formatMessage.default)('Page navigation'),
|
|
97
103
|
currentPageId: window.location.pathname,
|
|
98
104
|
renderHiddenItemsMenuTriggerLabel: _this2.hiddenMenuItemsMenuTriggerLabel
|
|
99
105
|
}, _this2.props.menuItems.map(function (menuItem) {
|
|
100
|
-
return
|
|
106
|
+
return (0, _emotion.jsx)(_uiTopNavBar.TopNavBar.Item, {
|
|
101
107
|
id: menuItem.path,
|
|
102
108
|
key: menuItem.path,
|
|
103
109
|
onClick: function onClick() {
|
|
@@ -106,7 +112,7 @@ var NavBar = /*#__PURE__*/function (_Component) {
|
|
|
106
112
|
|
|
107
113
|
}, menuItem.text);
|
|
108
114
|
})),
|
|
109
|
-
renderActionItems:
|
|
115
|
+
renderActionItems: (0, _emotion.jsx)(_uiTopNavBar.TopNavBar.ActionItems, {
|
|
110
116
|
listLabel: (0, _formatMessage.default)('Actions'),
|
|
111
117
|
renderHiddenItemsMenuTriggerLabel: _this2.hiddenActionItemsMenuTriggerLabel
|
|
112
118
|
}, (0, _toConsumableArray2.default)(_this2.props.actionItems))
|
|
@@ -116,21 +122,19 @@ var NavBar = /*#__PURE__*/function (_Component) {
|
|
|
116
122
|
}]);
|
|
117
123
|
NavBar.displayName = "NavBar";
|
|
118
124
|
return NavBar;
|
|
119
|
-
}(_react.Component)
|
|
120
|
-
|
|
121
|
-
exports.NavBar = NavBar;
|
|
122
|
-
NavBar.propTypes = {
|
|
125
|
+
}(_react.Component), _class2.propTypes = {
|
|
123
126
|
menuItems: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
124
127
|
path: _propTypes.default.string.isRequired,
|
|
125
128
|
text: _propTypes.default.string.isRequired
|
|
126
129
|
})),
|
|
127
130
|
handleMenuItemChange: _propTypes.default.func,
|
|
128
|
-
actionItems: _propTypes.default.arrayOf(_propTypes.default.node)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
actionItems: _propTypes.default.arrayOf(_propTypes.default.node),
|
|
132
|
+
styles: _propTypes.default.object
|
|
133
|
+
}, _class2.defaultProps = {
|
|
131
134
|
menuItems: [],
|
|
132
135
|
handleMenuItemChange: function handleMenuItemChange() {},
|
|
133
136
|
actionItems: []
|
|
134
|
-
};
|
|
137
|
+
}, _temp)) || _class);
|
|
138
|
+
exports.NavBar = NavBar;
|
|
135
139
|
var _default = NavBar;
|
|
136
140
|
exports.default = _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
9
|
+
return {
|
|
10
|
+
backgroundColor: componentTheme.backgroundColor,
|
|
11
|
+
phoneBreakPoint: componentTheme.phoneBreakPoint
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var _default = generateStyle;
|
|
16
|
+
exports.default = _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
|
+
var breakpoints = _ref.breakpoints,
|
|
10
|
+
colors = _ref.colors;
|
|
11
|
+
return {
|
|
12
|
+
backgroundColor: colors.porcelain,
|
|
13
|
+
phoneBreakPoint: breakpoints.medium
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var _default = generateComponentTheme;
|
|
18
|
+
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "20.11.3-rc.
|
|
3
|
+
"version": "20.11.3-rc.5+4a959564f",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@instructure/emotion": "^8.51.0",
|
|
45
45
|
"@instructure/grading-utils": "^1.0.0",
|
|
46
46
|
"@instructure/outcomes-ui": "^3.2.0",
|
|
47
|
-
"@instructure/quiz-common": "20.11.3-rc.
|
|
48
|
-
"@instructure/quiz-i18n": "20.11.3-rc.
|
|
49
|
-
"@instructure/quiz-interactions": "20.11.3-rc.
|
|
50
|
-
"@instructure/quiz-number-input": "20.11.3-rc.
|
|
51
|
-
"@instructure/quiz-rce": "20.11.3-rc.
|
|
47
|
+
"@instructure/quiz-common": "20.11.3-rc.5+4a959564f",
|
|
48
|
+
"@instructure/quiz-i18n": "20.11.3-rc.5+4a959564f",
|
|
49
|
+
"@instructure/quiz-interactions": "20.11.3-rc.5+4a959564f",
|
|
50
|
+
"@instructure/quiz-number-input": "20.11.3-rc.5+4a959564f",
|
|
51
|
+
"@instructure/quiz-rce": "20.11.3-rc.5+4a959564f",
|
|
52
52
|
"@instructure/ui-a11y-content": "^8.51.0",
|
|
53
53
|
"@instructure/ui-alerts": "^8.51.0",
|
|
54
54
|
"@instructure/ui-avatar": "^8.51.0",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"file-saver": "~2.0.5",
|
|
113
113
|
"humps": "^2.0.0",
|
|
114
114
|
"immutable": "^3.8.1",
|
|
115
|
-
"instructure-validations": "20.11.3-rc.
|
|
115
|
+
"instructure-validations": "20.11.3-rc.5+4a959564f",
|
|
116
116
|
"ipaddr.js": "^1.5.4",
|
|
117
117
|
"isomorphic-fetch": "^2.2.0",
|
|
118
118
|
"isuuid": "^0.1.0",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"intl": "^1.2.4",
|
|
164
164
|
"jquery": "^2.2.3",
|
|
165
165
|
"most-subject": "^5.3.0",
|
|
166
|
-
"quiz-presets": "20.11.3-rc.
|
|
166
|
+
"quiz-presets": "20.11.3-rc.5+4a959564f",
|
|
167
167
|
"react": "^16.8.6",
|
|
168
168
|
"react-addons-test-utils": "^15.6.2",
|
|
169
169
|
"react-dom": "^16.8.6",
|
|
@@ -179,5 +179,5 @@
|
|
|
179
179
|
"publishConfig": {
|
|
180
180
|
"access": "public"
|
|
181
181
|
},
|
|
182
|
-
"gitHead": "
|
|
182
|
+
"gitHead": "4a959564fc538c3cc7059e99002ddda868c0bc81"
|
|
183
183
|
}
|