@instructure/quiz-core 20.1.1-rc.3 → 20.1.1-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/banks/components/CreateBankModal/presenter.js +22 -27
- package/es/banks/components/CreateBankModal/styles.js +16 -0
- package/es/banks/components/CreateBankModal/theme.js +4 -2
- package/es/banks/components/EditBankModal/presenter.js +19 -25
- package/es/banks/components/EditBankModal/styles.js +13 -0
- package/es/banks/components/EditBankModal/theme.js +4 -2
- package/es/banks/components/HeaderMenu/presenter.js +15 -18
- package/es/banks/components/HeaderMenu/styles.js +11 -0
- package/es/banks/components/HeaderMenu/theme.js +4 -2
- package/es/banks/components/NavWrapper/presenter.js +27 -25
- package/es/banks/components/NavWrapper/styles.js +31 -0
- package/es/banks/components/NavWrapper/theme.js +4 -2
- package/es/banks/components/SharingModal/ShareList/index.js +33 -37
- package/es/banks/components/SharingModal/ShareList/styles.js +9 -0
- package/es/banks/components/SharingModal/presenter.js +39 -40
- package/es/banks/components/SharingModal/styles.js +13 -0
- package/es/banks/components/SharingModal/theme.js +4 -2
- package/lib/banks/components/CreateBankModal/presenter.js +21 -28
- package/lib/banks/components/CreateBankModal/styles.js +24 -0
- package/lib/banks/components/CreateBankModal/theme.js +6 -3
- package/lib/banks/components/EditBankModal/presenter.js +18 -26
- package/lib/banks/components/EditBankModal/styles.js +21 -0
- package/lib/banks/components/EditBankModal/theme.js +6 -3
- package/lib/banks/components/HeaderMenu/presenter.js +14 -19
- package/lib/banks/components/HeaderMenu/styles.js +19 -0
- package/lib/banks/components/HeaderMenu/theme.js +6 -3
- package/lib/banks/components/NavWrapper/presenter.js +25 -29
- package/lib/banks/components/NavWrapper/styles.js +39 -0
- package/lib/banks/components/NavWrapper/theme.js +6 -3
- package/lib/banks/components/SharingModal/ShareList/index.js +32 -40
- package/lib/banks/components/SharingModal/ShareList/styles.js +17 -0
- package/lib/banks/components/SharingModal/presenter.js +36 -40
- package/lib/banks/components/SharingModal/styles.js +21 -0
- package/lib/banks/components/SharingModal/theme.js +6 -3
- package/package.json +9 -9
- package/es/banks/components/SharingModal/ShareList/theme.js +0 -3
- package/lib/banks/components/SharingModal/ShareList/theme.js +0 -10
|
@@ -5,28 +5,22 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import PropTypes from 'prop-types';
|
|
10
11
|
import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
11
12
|
import { Checkbox } from '@instructure/ui-checkbox';
|
|
12
13
|
import { View } from '@instructure/ui-view';
|
|
13
14
|
import { TextInput } from '@instructure/ui-text-input';
|
|
14
15
|
import { Heading } from '@instructure/ui-heading';
|
|
15
|
-
import {
|
|
16
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
16
17
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
17
18
|
import Bank from "../../../common/records/Bank.js";
|
|
18
19
|
import { toErrors } from "../../../common/util/instUIMessages.js";
|
|
19
20
|
import { Modal, ModalHeader, ModalBody, ModalFooter, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return "\n\n.fTWio_detV{flex:1 1 auto;font-size:".concat(theme.bankNameInputFontSize || 'inherit', ";padding:").concat(theme.bankNamePadding || 'inherit', ";text-overflow:ellipsis;white-space:nowrap}\n\n.fTWio_rOsj{padding:").concat(theme.bankNameLabelPadding || 'inherit', "}");
|
|
24
|
-
},
|
|
25
|
-
'bankNameInput': 'fTWio_detV',
|
|
26
|
-
'bankNameLabel': 'fTWio_rOsj'
|
|
27
|
-
};
|
|
28
|
-
import theme from "./theme.js";
|
|
29
|
-
export var CreateBankModal = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
21
|
+
import generateStyle from "./styles.js";
|
|
22
|
+
import generateComponentTheme from "./theme.js";
|
|
23
|
+
export var CreateBankModal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
30
24
|
_inherits(CreateBankModal, _Component);
|
|
31
25
|
|
|
32
26
|
var _super = _createSuper(CreateBankModal);
|
|
@@ -103,16 +97,15 @@ export var CreateBankModal = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
103
97
|
_createClass(CreateBankModal, [{
|
|
104
98
|
key: "cancelButton",
|
|
105
99
|
value: function cancelButton() {
|
|
106
|
-
return
|
|
100
|
+
return jsx(Button, {
|
|
107
101
|
onClick: this.closeAction,
|
|
108
|
-
className: styles.footerButtonWrapper,
|
|
109
102
|
margin: XSMALL_SIDE_MARGIN
|
|
110
103
|
}, t('Cancel'));
|
|
111
104
|
}
|
|
112
105
|
}, {
|
|
113
106
|
key: "createBankButton",
|
|
114
107
|
value: function createBankButton() {
|
|
115
|
-
return
|
|
108
|
+
return jsx(Button, {
|
|
116
109
|
type: "button",
|
|
117
110
|
color: "primary",
|
|
118
111
|
onClick: this.continueAction,
|
|
@@ -123,13 +116,13 @@ export var CreateBankModal = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
123
116
|
}, {
|
|
124
117
|
key: "renderContent",
|
|
125
118
|
value: function renderContent() {
|
|
126
|
-
return
|
|
127
|
-
|
|
128
|
-
},
|
|
119
|
+
return jsx("div", {
|
|
120
|
+
css: this.props.styles.bankNameInput
|
|
121
|
+
}, jsx(TextInput, {
|
|
129
122
|
messages: this.getErrors(),
|
|
130
123
|
onChange: this.onNameChange,
|
|
131
|
-
renderLabel:
|
|
132
|
-
|
|
124
|
+
renderLabel: jsx("div", {
|
|
125
|
+
css: this.props.styles.bankNameLabel
|
|
133
126
|
}, t('Bank Name')),
|
|
134
127
|
type: "text",
|
|
135
128
|
placeholder: t('Enter a name...'),
|
|
@@ -148,10 +141,10 @@ export var CreateBankModal = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
148
141
|
var label = t('Share with { courseName }', {
|
|
149
142
|
courseName: this.props.itemBanksScope.title
|
|
150
143
|
});
|
|
151
|
-
return
|
|
144
|
+
return jsx(View, {
|
|
152
145
|
margin: "medium 0 0 0",
|
|
153
146
|
as: "div"
|
|
154
|
-
},
|
|
147
|
+
}, jsx(Checkbox, {
|
|
155
148
|
label: label,
|
|
156
149
|
checked: this.state.shareWithCourse,
|
|
157
150
|
onChange: this.toggleCheckbox
|
|
@@ -160,21 +153,21 @@ export var CreateBankModal = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
160
153
|
}, {
|
|
161
154
|
key: "render",
|
|
162
155
|
value: function render() {
|
|
163
|
-
return
|
|
156
|
+
return jsx(Modal, {
|
|
164
157
|
open: this.props.modalOpen,
|
|
165
158
|
onDismiss: this.closeAction,
|
|
166
159
|
size: "small",
|
|
167
160
|
label: t('Item Bank'),
|
|
168
161
|
"data-automation": "sdk-create-bank-modal"
|
|
169
|
-
},
|
|
162
|
+
}, jsx(ModalHeader, null, jsx(Heading, {
|
|
170
163
|
level: "reset",
|
|
171
164
|
as: "h2"
|
|
172
|
-
}, t('New Item Bank')),
|
|
165
|
+
}, t('New Item Bank')), jsx(CloseButton, {
|
|
173
166
|
onClick: this.closeAction,
|
|
174
167
|
placement: "end",
|
|
175
168
|
offset: "medium",
|
|
176
169
|
screenReaderLabel: t('Close')
|
|
177
|
-
})),
|
|
170
|
+
})), jsx(ModalBody, null, this.renderContent()), jsx(ModalFooter, null, this.cancelButton(), this.createBankButton()));
|
|
178
171
|
}
|
|
179
172
|
}]);
|
|
180
173
|
|
|
@@ -199,7 +192,9 @@ export var CreateBankModal = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
199
192
|
type: PropTypes.string,
|
|
200
193
|
uuid: PropTypes.string,
|
|
201
194
|
title: PropTypes.string
|
|
202
|
-
})
|
|
195
|
+
}),
|
|
196
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
197
|
+
styles: PropTypes.object
|
|
203
198
|
}, _class2.defaultProps = {
|
|
204
199
|
displayError: false,
|
|
205
200
|
modalTrigger: null,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
bankNameInput: {
|
|
4
|
+
flex: '1 1 auto',
|
|
5
|
+
fontSize: componentTheme.bankNameInputFontSize,
|
|
6
|
+
whiteSpace: 'nowrap',
|
|
7
|
+
textOverflow: 'ellipsis',
|
|
8
|
+
padding: componentTheme.bankNamePadding
|
|
9
|
+
},
|
|
10
|
+
bankNameLabel: {
|
|
11
|
+
padding: componentTheme.bankNameLabelPadding
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var typography = _ref.typography,
|
|
3
3
|
spacing = _ref.spacing;
|
|
4
4
|
return {
|
|
@@ -6,4 +6,6 @@ export default function generator(_ref) {
|
|
|
6
6
|
bankNamePadding: spacing.xSmall,
|
|
7
7
|
bankNameLabelPadding: spacing.xSmall
|
|
8
8
|
};
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default generateComponentTheme;
|
|
@@ -5,25 +5,20 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import PropTypes from 'prop-types';
|
|
10
11
|
import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
11
12
|
import { TextInput } from '@instructure/ui-text-input';
|
|
12
13
|
import { Heading } from '@instructure/ui-heading';
|
|
13
|
-
import {
|
|
14
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
14
15
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
15
16
|
import { toErrors } from "../../../common/util/instUIMessages.js";
|
|
16
17
|
import { Modal, ModalHeader, ModalBody, ModalFooter, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
|
|
17
18
|
import Bank from "../../../common/records/Bank.js";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return "\n\n.cvAov_detV{flex:1 1 auto;font-size:".concat(theme.bankNameInputFontSize || 'inherit', ";padding:0 ").concat(theme.bankNameInputFontSize || 'inherit', ";text-overflow:ellipsis;white-space:nowrap}");
|
|
22
|
-
},
|
|
23
|
-
'bankNameInput': 'cvAov_detV'
|
|
24
|
-
};
|
|
25
|
-
import theme from "./theme.js";
|
|
26
|
-
export var EditBankModal = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
19
|
+
import generateStyle from "./styles.js";
|
|
20
|
+
import generateComponentTheme from "./theme.js";
|
|
21
|
+
export var EditBankModal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
27
22
|
_inherits(EditBankModal, _Component);
|
|
28
23
|
|
|
29
24
|
var _super = _createSuper(EditBankModal);
|
|
@@ -81,16 +76,15 @@ export var EditBankModal = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
81
76
|
_createClass(EditBankModal, [{
|
|
82
77
|
key: "renderCancelButton",
|
|
83
78
|
value: function renderCancelButton() {
|
|
84
|
-
return
|
|
79
|
+
return jsx(Button, {
|
|
85
80
|
onClick: this.closeAction,
|
|
86
|
-
className: styles.footerButtonWrapper,
|
|
87
81
|
margin: XSMALL_SIDE_MARGIN
|
|
88
82
|
}, t('Cancel'));
|
|
89
83
|
}
|
|
90
84
|
}, {
|
|
91
85
|
key: "renderSaveButton",
|
|
92
86
|
value: function renderSaveButton() {
|
|
93
|
-
return
|
|
87
|
+
return jsx(Button, {
|
|
94
88
|
type: "button",
|
|
95
89
|
color: "primary",
|
|
96
90
|
onClick: this.continueAction,
|
|
@@ -101,15 +95,13 @@ export var EditBankModal = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
101
95
|
}, {
|
|
102
96
|
key: "renderContent",
|
|
103
97
|
value: function renderContent() {
|
|
104
|
-
return
|
|
105
|
-
|
|
106
|
-
},
|
|
98
|
+
return jsx("div", {
|
|
99
|
+
css: this.props.styles.bankNameInput
|
|
100
|
+
}, jsx(TextInput, {
|
|
107
101
|
value: this.props.workingBank.title,
|
|
108
102
|
messages: this.getErrors(),
|
|
109
103
|
onChange: this.onNameChange,
|
|
110
|
-
renderLabel:
|
|
111
|
-
className: styles.bankNameLabel
|
|
112
|
-
}, t('Bank Name')),
|
|
104
|
+
renderLabel: jsx("div", null, t('Bank Name')),
|
|
113
105
|
type: "text",
|
|
114
106
|
placeholder: t('Enter a name...'),
|
|
115
107
|
"data-automation": "sdk-edit-bank-name-textinput"
|
|
@@ -118,21 +110,21 @@ export var EditBankModal = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
118
110
|
}, {
|
|
119
111
|
key: "render",
|
|
120
112
|
value: function render() {
|
|
121
|
-
return
|
|
113
|
+
return jsx(Modal, {
|
|
122
114
|
open: this.props.modalOpen,
|
|
123
115
|
onDismiss: this.closeAction,
|
|
124
116
|
size: "small",
|
|
125
117
|
label: t('Item Bank'),
|
|
126
118
|
"data-automation": "sdk-edit-bank-modal"
|
|
127
|
-
},
|
|
119
|
+
}, jsx(ModalHeader, null, jsx(Heading, {
|
|
128
120
|
level: "reset",
|
|
129
121
|
as: "h2"
|
|
130
|
-
}, t('Edit Item Bank')),
|
|
122
|
+
}, t('Edit Item Bank')), jsx(CloseButton, {
|
|
131
123
|
onClick: this.closeAction,
|
|
132
124
|
placement: "end",
|
|
133
125
|
offset: "medium",
|
|
134
126
|
screenReaderLabel: t('Close')
|
|
135
|
-
})),
|
|
127
|
+
})), jsx(ModalBody, null, this.renderContent()), jsx(ModalFooter, null, this.renderCancelButton(), this.renderSaveButton()));
|
|
136
128
|
}
|
|
137
129
|
}]);
|
|
138
130
|
|
|
@@ -149,7 +141,9 @@ export var EditBankModal = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
149
141
|
clearModifications: PropTypes.func.isRequired,
|
|
150
142
|
showError: PropTypes.func.isRequired,
|
|
151
143
|
hideError: PropTypes.func.isRequired,
|
|
152
|
-
closeModal: PropTypes.func.isRequired
|
|
144
|
+
closeModal: PropTypes.func.isRequired,
|
|
145
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
146
|
+
styles: PropTypes.object
|
|
153
147
|
}, _class2.defaultProps = {
|
|
154
148
|
displayError: false,
|
|
155
149
|
modalTrigger: null
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
bankNameInput: {
|
|
4
|
+
flex: '1 1 auto',
|
|
5
|
+
fontSize: componentTheme.bankNameInputFontSize,
|
|
6
|
+
whiteSpace: 'nowrap',
|
|
7
|
+
textOverflow: 'ellipsis',
|
|
8
|
+
padding: "0 ".concat(componentTheme.bankNameInputFontSize)
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default generateStyle;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var typography = _ref.typography,
|
|
3
3
|
spacing = _ref.spacing;
|
|
4
4
|
return {
|
|
5
5
|
bankNameInputFontSize: typography.fontSizeMedium,
|
|
6
6
|
bankNameInputPadding: spacing.xSmall
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default generateComponentTheme;
|
|
@@ -5,25 +5,20 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import PropTypes from 'prop-types';
|
|
10
11
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
11
12
|
import { Menu } from '@instructure/ui-menu';
|
|
12
13
|
import { IconButton } from '@instructure/ui-buttons';
|
|
13
14
|
import { IconMoreSolid, IconImportLine } from '@instructure/ui-icons';
|
|
14
|
-
import {
|
|
15
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
15
16
|
import QTIImportModal from "../../../building/components/QTIImportModal/index.js";
|
|
16
17
|
import { PARENT_TYPE_BANK } from '@instructure/quiz-common';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
template: function template(theme) {
|
|
20
|
-
return "\n\n.HITck_cLWx{font-size:".concat(theme.menuIconFontSize || 'inherit', ";margin-right:").concat(theme.menuIconMargin || 'inherit', ";vertical-align:middle}");
|
|
21
|
-
},
|
|
22
|
-
'menuIcon': 'HITck_cLWx'
|
|
23
|
-
};
|
|
24
|
-
import theme from "./theme.js";
|
|
18
|
+
import generateStyle from "./styles.js";
|
|
19
|
+
import generateComponentTheme from "./theme.js";
|
|
25
20
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
26
|
-
export var HeaderMenu = (_dec =
|
|
21
|
+
export var HeaderMenu = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
27
22
|
_inherits(HeaderMenu, _Component);
|
|
28
23
|
|
|
29
24
|
var _super = _createSuper(HeaderMenu);
|
|
@@ -37,19 +32,19 @@ export var HeaderMenu = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
37
32
|
_createClass(HeaderMenu, [{
|
|
38
33
|
key: "renderMenu",
|
|
39
34
|
value: function renderMenu() {
|
|
40
|
-
return
|
|
41
|
-
trigger:
|
|
35
|
+
return jsx(Menu, {
|
|
36
|
+
trigger: jsx(IconButton, {
|
|
42
37
|
renderIcon: IconMoreSolid,
|
|
43
38
|
withBackground: false,
|
|
44
39
|
withBorder: false,
|
|
45
40
|
screenReaderLabel: t('More Item Banking Actions')
|
|
46
41
|
})
|
|
47
|
-
},
|
|
42
|
+
}, jsx(Menu.Item, {
|
|
48
43
|
key: "import",
|
|
49
44
|
disabled: !this.props.bank.canImport(),
|
|
50
45
|
onSelect: this.props.openImportModal
|
|
51
|
-
},
|
|
52
|
-
|
|
46
|
+
}, jsx(IconImportLine, {
|
|
47
|
+
css: this.props.styles.menuIcon,
|
|
53
48
|
"data-automation": "sdk-headermenu-import-content"
|
|
54
49
|
}), t('Import Content')));
|
|
55
50
|
}
|
|
@@ -57,7 +52,7 @@ export var HeaderMenu = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
57
52
|
key: "render",
|
|
58
53
|
value: function render() {
|
|
59
54
|
var bank = this.props.bank;
|
|
60
|
-
return
|
|
55
|
+
return jsx("div", null, this.renderMenu(), jsx(QTIImportModal, {
|
|
61
56
|
parentId: bank.id,
|
|
62
57
|
parentType: PARENT_TYPE_BANK,
|
|
63
58
|
qtiImport: bank.getLatestImport(),
|
|
@@ -70,6 +65,8 @@ export var HeaderMenu = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
70
65
|
return HeaderMenu;
|
|
71
66
|
}(Component), _class2.propTypes = {
|
|
72
67
|
openImportModal: PropTypes.func.isRequired,
|
|
73
|
-
bank: ImmutablePropTypes.record.isRequired
|
|
68
|
+
bank: ImmutablePropTypes.record.isRequired,
|
|
69
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
70
|
+
styles: PropTypes.object
|
|
74
71
|
}, _temp)) || _class);
|
|
75
72
|
export default HeaderMenu;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
typography = _ref.typography;
|
|
4
4
|
return {
|
|
5
5
|
menuIconMargin: spacing.xSmall,
|
|
6
6
|
menuIconFontSize: typography.fontSizeLarge
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default generateComponentTheme;
|
|
@@ -5,7 +5,8 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import ReactDOM from 'react-dom';
|
|
10
11
|
import PropTypes from 'prop-types';
|
|
11
12
|
import { Children } from '@instructure/ui-prop-types';
|
|
@@ -14,23 +15,16 @@ import { CloseButton, Button } from '@instructure/ui-buttons';
|
|
|
14
15
|
import { Breadcrumb, BreadcrumbLink } from '@instructure/ui-breadcrumb';
|
|
15
16
|
import { IconBankLine } from '@instructure/ui-icons';
|
|
16
17
|
import { View } from '@instructure/ui-view';
|
|
17
|
-
import {
|
|
18
|
+
import { withStyle, jsx, Global } from '@instructure/emotion';
|
|
18
19
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
'nav': 'fooBc_diTj',
|
|
25
|
-
'crumbs': 'fooBc_ZXRE'
|
|
26
|
-
};
|
|
27
|
-
import theme from "./theme.js";
|
|
28
|
-
|
|
29
|
-
var _ref = /*#__PURE__*/React.createElement(IconBankLine, {
|
|
20
|
+
import generateStyle from "./styles.js";
|
|
21
|
+
import generateComponentTheme from "./theme.js";
|
|
22
|
+
|
|
23
|
+
var _ref = jsx(IconBankLine, {
|
|
30
24
|
size: "x-small"
|
|
31
25
|
});
|
|
32
26
|
|
|
33
|
-
var NavWrapper = (_dec =
|
|
27
|
+
var NavWrapper = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
34
28
|
_inherits(NavWrapper, _Component);
|
|
35
29
|
|
|
36
30
|
var _super = _createSuper(NavWrapper);
|
|
@@ -75,12 +69,12 @@ var NavWrapper = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class
|
|
|
75
69
|
var _this$props = this.props,
|
|
76
70
|
returnToUrl = _this$props.returnToUrl,
|
|
77
71
|
canvasReferrerLinkText = _this$props.canvasReferrerLinkText;
|
|
78
|
-
var canvasReferrerLink = returnToUrl && canvasReferrerLinkText &&
|
|
72
|
+
var canvasReferrerLink = returnToUrl && canvasReferrerLinkText && jsx(BreadcrumbLink, {
|
|
79
73
|
key: "Context",
|
|
80
74
|
href: returnToUrl,
|
|
81
75
|
target: "_top"
|
|
82
76
|
}, canvasReferrerLinkText);
|
|
83
|
-
var banksLinks =
|
|
77
|
+
var banksLinks = jsx(BreadcrumbLink, {
|
|
84
78
|
ref: this.setItemBanksRef,
|
|
85
79
|
renderIcon: _ref,
|
|
86
80
|
key: "Banks",
|
|
@@ -102,11 +96,11 @@ var NavWrapper = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class
|
|
|
102
96
|
returnToUrl = _this$props2.returnToUrl;
|
|
103
97
|
|
|
104
98
|
if (!closeTray && returnToUrl) {
|
|
105
|
-
return
|
|
99
|
+
return jsx(ReturnButton, {
|
|
106
100
|
returnToUrl: returnToUrl
|
|
107
101
|
});
|
|
108
102
|
} else if (navigateToBuild) {
|
|
109
|
-
return
|
|
103
|
+
return jsx(Button, {
|
|
110
104
|
onClick: navigateToBuild
|
|
111
105
|
}, t('Return'));
|
|
112
106
|
}
|
|
@@ -115,7 +109,7 @@ var NavWrapper = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class
|
|
|
115
109
|
key: "renderCloseButton",
|
|
116
110
|
value: function renderCloseButton() {
|
|
117
111
|
if (this.props.closeTray) {
|
|
118
|
-
return
|
|
112
|
+
return jsx(CloseButton, {
|
|
119
113
|
elementRef: this.setCloseButtonRef,
|
|
120
114
|
placement: "start",
|
|
121
115
|
onClick: this.props.closeTray,
|
|
@@ -126,11 +120,17 @@ var NavWrapper = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class
|
|
|
126
120
|
}, {
|
|
127
121
|
key: "render",
|
|
128
122
|
value: function render() {
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
123
|
+
return jsx(View, null, jsx(Global, {
|
|
124
|
+
styles: {
|
|
125
|
+
'body.tox-fullscreen .nav': {
|
|
126
|
+
'display': 'none'
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}), jsx("div", {
|
|
130
|
+
css: this.props.styles.nav
|
|
131
|
+
}, this.renderCloseButton(), jsx("div", {
|
|
132
|
+
css: this.props.styles.crumbs
|
|
133
|
+
}, jsx(Breadcrumb, {
|
|
134
134
|
size: "small",
|
|
135
135
|
label: t('You are here:')
|
|
136
136
|
}, this.renderBreadcrumbLinks())), this.renderReturnButton(), this.props.renderHeaderMenu()));
|
|
@@ -147,7 +147,9 @@ var NavWrapper = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class
|
|
|
147
147
|
renderHeaderMenu: PropTypes.func,
|
|
148
148
|
trayOpen: PropTypes.bool.isRequired,
|
|
149
149
|
returnToUrl: PropTypes.string,
|
|
150
|
-
canvasReferrerLinkText: PropTypes.string
|
|
150
|
+
canvasReferrerLinkText: PropTypes.string,
|
|
151
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
152
|
+
styles: PropTypes.object
|
|
151
153
|
}, _class2.defaultProps = {
|
|
152
154
|
children: null,
|
|
153
155
|
closeTray: null,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
nav: {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
flexDirection: 'row',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
padding: "".concat(componentTheme.navPaddingTopBottom, " ").concat(componentTheme.navPaddingLeftRight),
|
|
8
|
+
borderBottom: "".concat(componentTheme.navBorderWidth, " solid ").concat(componentTheme.navBorderColor),
|
|
9
|
+
backgroundColor: componentTheme.navBackgroundColor,
|
|
10
|
+
position: 'sticky',
|
|
11
|
+
top: 0,
|
|
12
|
+
width: '100%',
|
|
13
|
+
boxSizing: 'border-box',
|
|
14
|
+
zIndex: 4444,
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* For MS Edge
|
|
18
|
+
* When they switch to chromium
|
|
19
|
+
* check to see if sticky works.
|
|
20
|
+
*/
|
|
21
|
+
'@supports (-ms-ime-align: auto)': {
|
|
22
|
+
position: 'relative'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
crumbs: {
|
|
26
|
+
flex: 1
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
borders = _ref.borders,
|
|
4
4
|
colors = _ref.colors,
|
|
@@ -14,4 +14,6 @@ export default function generator(_ref) {
|
|
|
14
14
|
bankIconFontSize: typography.fontSizeLarge,
|
|
15
15
|
bankIconPadding: spacing.xSmall
|
|
16
16
|
};
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default generateComponentTheme;
|