@instructure/quiz-core 20.3.1-rc.0 → 20.3.1-rc.2
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/PrintFontSizeModal/presenter.js +19 -22
- package/es/common/components/PrintFontSizeModal/styles.js +13 -0
- package/es/common/components/PrintFontSizeModal/theme.js +4 -2
- package/es/common/components/alerts/presenter.js +20 -24
- package/es/common/components/alerts/styles.js +24 -0
- package/es/common/components/alerts/theme.js +4 -2
- package/lib/common/components/PrintFontSizeModal/presenter.js +18 -24
- package/lib/common/components/PrintFontSizeModal/styles.js +21 -0
- package/lib/common/components/PrintFontSizeModal/theme.js +6 -3
- package/lib/common/components/alerts/presenter.js +19 -25
- package/lib/common/components/alerts/styles.js +34 -0
- package/lib/common/components/alerts/theme.js +6 -3
- package/package.json +9 -9
|
@@ -5,24 +5,19 @@ 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 { Modal, ModalHeader, ModalBody, ModalFooter } from '@instructure/quiz-common';
|
|
11
12
|
import { Heading } from '@instructure/ui-heading';
|
|
12
13
|
import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
template: function template(theme) {
|
|
17
|
-
return "\n\n.ccksF_fatK{border-bottom:solid ".concat(theme.separatorBorderWidth || 'inherit', ";border-color:").concat(theme.separatorColor || 'inherit', ";margin:").concat(theme.separatorMargin || 'inherit', " 0;padding:0;width:100%}");
|
|
18
|
-
},
|
|
19
|
-
'separator': 'ccksF_fatK'
|
|
20
|
-
};
|
|
21
|
-
import theme from "./theme.js";
|
|
14
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
15
|
+
import generateStyle from "./styles.js";
|
|
16
|
+
import generateComponentTheme from "./theme.js";
|
|
22
17
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
23
18
|
import { RadioInputGroup, RadioInput } from '@instructure/ui-radio-input';
|
|
24
19
|
import { Checkbox } from '@instructure/ui-checkbox';
|
|
25
|
-
export var PrintFontSizeModal = (_dec =
|
|
20
|
+
export var PrintFontSizeModal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
26
21
|
_inherits(PrintFontSizeModal, _Component);
|
|
27
22
|
|
|
28
23
|
var _super = _createSuper(PrintFontSizeModal);
|
|
@@ -109,18 +104,18 @@ export var PrintFontSizeModal = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
109
104
|
}, {
|
|
110
105
|
key: "render",
|
|
111
106
|
value: function render() {
|
|
112
|
-
return
|
|
107
|
+
return jsx(Modal, {
|
|
113
108
|
open: this.props.isOpen,
|
|
114
109
|
onDismiss: this.props.onCancel,
|
|
115
110
|
onExited: this.props.onExited,
|
|
116
111
|
size: "small",
|
|
117
112
|
label: this.text.printQuiz
|
|
118
|
-
},
|
|
113
|
+
}, jsx(ModalHeader, null, jsx(Heading, null, this.text.printQuiz), jsx(CloseButton, {
|
|
119
114
|
onClick: this.props.onCancel,
|
|
120
115
|
placement: "end",
|
|
121
116
|
offset: "medium",
|
|
122
117
|
screenReaderLabel: this.text.close
|
|
123
|
-
})),
|
|
118
|
+
})), jsx(ModalBody, null, jsx(RadioInputGroup, {
|
|
124
119
|
onChange: this.handleFontSizeChange,
|
|
125
120
|
name: "print-font-size",
|
|
126
121
|
value: this.state.selectedFontSize,
|
|
@@ -128,7 +123,7 @@ export var PrintFontSizeModal = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
128
123
|
description: t('Text size'),
|
|
129
124
|
"data-automation": "print-font-size-modal-radio-group"
|
|
130
125
|
}, this.sizes.map(function (size) {
|
|
131
|
-
var label =
|
|
126
|
+
var label = jsx("div", null, jsx("span", null, size.label), " ", jsx("p", {
|
|
132
127
|
"aria-hidden": "true",
|
|
133
128
|
style: {
|
|
134
129
|
fontSize: "".concat(size.size, "rem"),
|
|
@@ -138,25 +133,25 @@ export var PrintFontSizeModal = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
138
133
|
}, t('Printed quiz question')));
|
|
139
134
|
var key = "print-font-size-modal-radio-button-key-".concat(size.value);
|
|
140
135
|
var dataAutomation = "print-font-size-modal-radio-button-".concat(size.value);
|
|
141
|
-
return
|
|
136
|
+
return jsx(RadioInput, {
|
|
142
137
|
key: key,
|
|
143
138
|
"data-automation": dataAutomation,
|
|
144
139
|
inline: true,
|
|
145
140
|
label: label,
|
|
146
141
|
value: size.value
|
|
147
142
|
});
|
|
148
|
-
})),
|
|
149
|
-
|
|
150
|
-
}),
|
|
143
|
+
})), jsx("div", {
|
|
144
|
+
css: this.props.styles.separator
|
|
145
|
+
}), jsx(Checkbox, {
|
|
151
146
|
label: this.text.rememberTextSizeSetting,
|
|
152
147
|
checked: this.state.rememberTextSizeSetting,
|
|
153
148
|
onChange: this.handleRememberFontSize
|
|
154
|
-
})),
|
|
149
|
+
})), jsx(ModalFooter, null, jsx(Button, {
|
|
155
150
|
"data-automation": "sdk-print-font-size-cancel-button",
|
|
156
151
|
color: "primary-inverse",
|
|
157
152
|
onClick: this.props.onCancel,
|
|
158
153
|
margin: "0 x-small 0 0"
|
|
159
|
-
}, this.text.cancel),
|
|
154
|
+
}, this.text.cancel), jsx(Button, {
|
|
160
155
|
"data-automation": "sdk-print-font-size-print-preview-button",
|
|
161
156
|
color: "primary",
|
|
162
157
|
onClick: this.handleSubmit,
|
|
@@ -172,7 +167,9 @@ export var PrintFontSizeModal = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
172
167
|
persistedPrintFontSize: PropTypes.string,
|
|
173
168
|
onSubmit: PropTypes.func.isRequired,
|
|
174
169
|
onCancel: PropTypes.func.isRequired,
|
|
175
|
-
onExited: PropTypes.func.isRequired
|
|
170
|
+
onExited: PropTypes.func.isRequired,
|
|
171
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
172
|
+
styles: PropTypes.object
|
|
176
173
|
}, _class2.defaultProps = {
|
|
177
174
|
isOpen: false,
|
|
178
175
|
persistedPrintFontSize: 'medium'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
separator: {
|
|
4
|
+
width: '100%',
|
|
5
|
+
margin: "".concat(componentTheme.separatorMargin, " 0"),
|
|
6
|
+
padding: 0,
|
|
7
|
+
borderBottom: "solid ".concat(componentTheme.separatorBorderWidth),
|
|
8
|
+
borderColor: componentTheme.separatorColor
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var colors = _ref.colors,
|
|
3
3
|
borders = _ref.borders,
|
|
4
4
|
spacing = _ref.spacing;
|
|
@@ -7,4 +7,6 @@ export default function generator(_ref) {
|
|
|
7
7
|
separatorBorderWidth: borders.widthSmall,
|
|
8
8
|
separatorMargin: spacing.medium
|
|
9
9
|
};
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default generateComponentTheme;
|
|
@@ -5,24 +5,18 @@ 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 partial from 'lodash/partial';
|
|
12
13
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
13
14
|
import { Alert } from '@instructure/ui-alerts';
|
|
14
|
-
import {
|
|
15
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
15
16
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return "\n\n.cYPGH_ddjo{box-sizing:border-box;padding-left:".concat(theme.alertsPadding || 'inherit', ";padding-right:").concat(theme.alertsPadding || 'inherit', ";padding-top:").concat(theme.alertsTopPadding || 'inherit', ";pointer-events:none;position:fixed;width:100%;z-index:").concat(theme.alertsZIndex || 'inherit', "}\n\n.cYPGH_eVxh{pointer-events:auto}\n\n@media screen and (--phoneBreakPoint){.cYPGH_ddjo{padding:").concat(theme.alertsMobilePadding || 'inherit', "}}");
|
|
20
|
-
},
|
|
21
|
-
'alerts': 'cYPGH_ddjo',
|
|
22
|
-
'alertHolder': 'cYPGH_eVxh'
|
|
23
|
-
};
|
|
24
|
-
import theme from "./theme.js";
|
|
25
|
-
export var Alerts = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
17
|
+
import generateStyle from "./styles.js";
|
|
18
|
+
import generateComponentTheme from "./theme.js";
|
|
19
|
+
export var Alerts = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
26
20
|
_inherits(Alerts, _Component);
|
|
27
21
|
|
|
28
22
|
var _super = _createSuper(Alerts);
|
|
@@ -46,10 +40,10 @@ export var Alerts = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
46
40
|
}
|
|
47
41
|
|
|
48
42
|
if (alert.variant === 'stickyerror') {
|
|
49
|
-
return
|
|
43
|
+
return jsx("div", {
|
|
50
44
|
key: alert.uuid,
|
|
51
|
-
|
|
52
|
-
},
|
|
45
|
+
css: _this.props.styles.alertHolder
|
|
46
|
+
}, jsx(Alert, {
|
|
53
47
|
variant: "error",
|
|
54
48
|
onDismiss: closeAlert,
|
|
55
49
|
renderCloseButtonLabel: t('Close'),
|
|
@@ -57,10 +51,10 @@ export var Alerts = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
57
51
|
}, alert.message));
|
|
58
52
|
}
|
|
59
53
|
|
|
60
|
-
return
|
|
54
|
+
return jsx("div", {
|
|
61
55
|
key: alert.uuid,
|
|
62
|
-
|
|
63
|
-
},
|
|
56
|
+
css: _this.props.styles.alertHolder
|
|
57
|
+
}, jsx(Alert, {
|
|
64
58
|
variant: alert.variant,
|
|
65
59
|
onDismiss: closeAlert,
|
|
66
60
|
renderCloseButtonLabel: t('Close'),
|
|
@@ -74,7 +68,7 @@ export var Alerts = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
74
68
|
_createClass(Alerts, [{
|
|
75
69
|
key: "renderScreenreaderAlert",
|
|
76
70
|
value: function renderScreenreaderAlert(alert) {
|
|
77
|
-
return
|
|
71
|
+
return jsx(ScreenReaderContent, {
|
|
78
72
|
key: alert.uuid
|
|
79
73
|
}, alert.message);
|
|
80
74
|
}
|
|
@@ -91,16 +85,16 @@ export var Alerts = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
91
85
|
});
|
|
92
86
|
|
|
93
87
|
if (hasStickyErrors) {
|
|
94
|
-
return
|
|
95
|
-
|
|
88
|
+
return jsx("div", {
|
|
89
|
+
css: this.props.styles.alerts,
|
|
96
90
|
style: {
|
|
97
91
|
zIndex: '99999'
|
|
98
92
|
}
|
|
99
93
|
}, this.renderAlerts());
|
|
100
94
|
}
|
|
101
95
|
|
|
102
|
-
return
|
|
103
|
-
|
|
96
|
+
return jsx("div", {
|
|
97
|
+
css: this.props.styles.alerts
|
|
104
98
|
}, this.renderAlerts());
|
|
105
99
|
}
|
|
106
100
|
}]);
|
|
@@ -109,7 +103,9 @@ export var Alerts = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
109
103
|
return Alerts;
|
|
110
104
|
}(Component), _class2.propTypes = {
|
|
111
105
|
removeAlert: PropTypes.func.isRequired,
|
|
112
|
-
alerts: ImmutablePropTypes.list.isRequired
|
|
106
|
+
alerts: ImmutablePropTypes.list.isRequired,
|
|
107
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
108
|
+
styles: PropTypes.object
|
|
113
109
|
}, _class2.defaultProps = {
|
|
114
110
|
sidebarOpen: false
|
|
115
111
|
}, _temp)) || _class);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
4
|
+
var mq = "@media screen and (".concat(componentTheme.phoneBreakPoint, ")");
|
|
5
|
+
return {
|
|
6
|
+
alerts: _defineProperty({
|
|
7
|
+
position: 'fixed',
|
|
8
|
+
pointerEvents: 'none',
|
|
9
|
+
width: '100%',
|
|
10
|
+
boxSizing: 'border-box',
|
|
11
|
+
zIndex: componentTheme.alertsZIndex,
|
|
12
|
+
paddingLeft: componentTheme.alertsPadding,
|
|
13
|
+
paddingRight: componentTheme.alertsPadding,
|
|
14
|
+
paddingTop: componentTheme.alertsTopPadding
|
|
15
|
+
}, mq, {
|
|
16
|
+
padding: componentTheme.alertsMobilePadding
|
|
17
|
+
}),
|
|
18
|
+
alertHolder: {
|
|
19
|
+
pointerEvents: 'auto'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var breakpoints = _ref.breakpoints,
|
|
3
3
|
spacing = _ref.spacing;
|
|
4
4
|
return {
|
|
@@ -8,4 +8,6 @@ export default function generator(_ref) {
|
|
|
8
8
|
alertsZIndex: '7777',
|
|
9
9
|
phoneBreakPoint: "max-width: ".concat(breakpoints.medium)
|
|
10
10
|
};
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default generateComponentTheme;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -17,7 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
15
|
|
|
18
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
17
|
|
|
20
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
21
19
|
|
|
22
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
@@ -27,7 +25,9 @@ var _uiHeading = require("@instructure/ui-heading");
|
|
|
27
25
|
|
|
28
26
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
29
27
|
|
|
30
|
-
var
|
|
28
|
+
var _emotion = require("@instructure/emotion");
|
|
29
|
+
|
|
30
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
31
31
|
|
|
32
32
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
33
33
|
|
|
@@ -39,14 +39,7 @@ var _uiCheckbox = require("@instructure/ui-checkbox");
|
|
|
39
39
|
|
|
40
40
|
var _dec, _class, _class2, _temp;
|
|
41
41
|
|
|
42
|
-
var
|
|
43
|
-
componentId: 'ccksF',
|
|
44
|
-
template: function template(theme) {
|
|
45
|
-
return "\n\n.ccksF_fatK{border-bottom:solid ".concat(theme.separatorBorderWidth || 'inherit', ";border-color:").concat(theme.separatorColor || 'inherit', ";margin:").concat(theme.separatorMargin || 'inherit', " 0;padding:0;width:100%}");
|
|
46
|
-
},
|
|
47
|
-
'separator': 'ccksF_fatK'
|
|
48
|
-
};
|
|
49
|
-
var PrintFontSizeModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
42
|
+
var PrintFontSizeModal = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
50
43
|
(0, _inherits2.default)(PrintFontSizeModal, _Component);
|
|
51
44
|
|
|
52
45
|
var _super = (0, _createSuper2.default)(PrintFontSizeModal);
|
|
@@ -133,18 +126,18 @@ var PrintFontSizeModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, sty
|
|
|
133
126
|
}, {
|
|
134
127
|
key: "render",
|
|
135
128
|
value: function render() {
|
|
136
|
-
return
|
|
129
|
+
return (0, _emotion.jsx)(_quizCommon.Modal, {
|
|
137
130
|
open: this.props.isOpen,
|
|
138
131
|
onDismiss: this.props.onCancel,
|
|
139
132
|
onExited: this.props.onExited,
|
|
140
133
|
size: "small",
|
|
141
134
|
label: this.text.printQuiz
|
|
142
|
-
},
|
|
135
|
+
}, (0, _emotion.jsx)(_quizCommon.ModalHeader, null, (0, _emotion.jsx)(_uiHeading.Heading, null, this.text.printQuiz), (0, _emotion.jsx)(_uiButtons.CloseButton, {
|
|
143
136
|
onClick: this.props.onCancel,
|
|
144
137
|
placement: "end",
|
|
145
138
|
offset: "medium",
|
|
146
139
|
screenReaderLabel: this.text.close
|
|
147
|
-
})),
|
|
140
|
+
})), (0, _emotion.jsx)(_quizCommon.ModalBody, null, (0, _emotion.jsx)(_uiRadioInput.RadioInputGroup, {
|
|
148
141
|
onChange: this.handleFontSizeChange,
|
|
149
142
|
name: "print-font-size",
|
|
150
143
|
value: this.state.selectedFontSize,
|
|
@@ -152,7 +145,7 @@ var PrintFontSizeModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, sty
|
|
|
152
145
|
description: (0, _formatMessage.default)('Text size'),
|
|
153
146
|
"data-automation": "print-font-size-modal-radio-group"
|
|
154
147
|
}, this.sizes.map(function (size) {
|
|
155
|
-
var label =
|
|
148
|
+
var label = (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("span", null, size.label), " ", (0, _emotion.jsx)("p", {
|
|
156
149
|
"aria-hidden": "true",
|
|
157
150
|
style: {
|
|
158
151
|
fontSize: "".concat(size.size, "rem"),
|
|
@@ -160,28 +153,27 @@ var PrintFontSizeModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, sty
|
|
|
160
153
|
margin: '1rem 0'
|
|
161
154
|
}
|
|
162
155
|
}, (0, _formatMessage.default)('Printed quiz question')));
|
|
163
|
-
|
|
164
156
|
var key = "print-font-size-modal-radio-button-key-".concat(size.value);
|
|
165
157
|
var dataAutomation = "print-font-size-modal-radio-button-".concat(size.value);
|
|
166
|
-
return
|
|
158
|
+
return (0, _emotion.jsx)(_uiRadioInput.RadioInput, {
|
|
167
159
|
key: key,
|
|
168
160
|
"data-automation": dataAutomation,
|
|
169
161
|
inline: true,
|
|
170
162
|
label: label,
|
|
171
163
|
value: size.value
|
|
172
164
|
});
|
|
173
|
-
})),
|
|
174
|
-
|
|
175
|
-
}),
|
|
165
|
+
})), (0, _emotion.jsx)("div", {
|
|
166
|
+
css: this.props.styles.separator
|
|
167
|
+
}), (0, _emotion.jsx)(_uiCheckbox.Checkbox, {
|
|
176
168
|
label: this.text.rememberTextSizeSetting,
|
|
177
169
|
checked: this.state.rememberTextSizeSetting,
|
|
178
170
|
onChange: this.handleRememberFontSize
|
|
179
|
-
})),
|
|
171
|
+
})), (0, _emotion.jsx)(_quizCommon.ModalFooter, null, (0, _emotion.jsx)(_uiButtons.Button, {
|
|
180
172
|
"data-automation": "sdk-print-font-size-cancel-button",
|
|
181
173
|
color: "primary-inverse",
|
|
182
174
|
onClick: this.props.onCancel,
|
|
183
175
|
margin: "0 x-small 0 0"
|
|
184
|
-
}, this.text.cancel),
|
|
176
|
+
}, this.text.cancel), (0, _emotion.jsx)(_uiButtons.Button, {
|
|
185
177
|
"data-automation": "sdk-print-font-size-print-preview-button",
|
|
186
178
|
color: "primary",
|
|
187
179
|
onClick: this.handleSubmit,
|
|
@@ -196,7 +188,9 @@ var PrintFontSizeModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, sty
|
|
|
196
188
|
persistedPrintFontSize: _propTypes.default.string,
|
|
197
189
|
onSubmit: _propTypes.default.func.isRequired,
|
|
198
190
|
onCancel: _propTypes.default.func.isRequired,
|
|
199
|
-
onExited: _propTypes.default.func.isRequired
|
|
191
|
+
onExited: _propTypes.default.func.isRequired,
|
|
192
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
193
|
+
styles: _propTypes.default.object
|
|
200
194
|
}, _class2.defaultProps = {
|
|
201
195
|
isOpen: false,
|
|
202
196
|
persistedPrintFontSize: 'medium'
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
separator: {
|
|
11
|
+
width: '100%',
|
|
12
|
+
margin: "".concat(componentTheme.separatorMargin, " 0"),
|
|
13
|
+
padding: 0,
|
|
14
|
+
borderBottom: "solid ".concat(componentTheme.separatorBorderWidth),
|
|
15
|
+
borderColor: componentTheme.separatorColor
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var _default = generateStyle;
|
|
21
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var colors = _ref.colors,
|
|
10
10
|
borders = _ref.borders,
|
|
11
11
|
spacing = _ref.spacing;
|
|
@@ -14,4 +14,7 @@ function generator(_ref) {
|
|
|
14
14
|
separatorBorderWidth: borders.widthSmall,
|
|
15
15
|
separatorMargin: spacing.medium
|
|
16
16
|
};
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var _default = generateComponentTheme;
|
|
20
|
+
exports.default = _default;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -17,7 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
15
|
|
|
18
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
17
|
|
|
20
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
21
19
|
|
|
22
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
@@ -29,23 +27,17 @@ var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
|
29
27
|
|
|
30
28
|
var _uiAlerts = require("@instructure/ui-alerts");
|
|
31
29
|
|
|
32
|
-
var
|
|
30
|
+
var _emotion = require("@instructure/emotion");
|
|
33
31
|
|
|
34
32
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
35
33
|
|
|
34
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
35
|
+
|
|
36
36
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
37
37
|
|
|
38
38
|
var _dec, _class, _class2, _temp;
|
|
39
39
|
|
|
40
|
-
var
|
|
41
|
-
componentId: 'cYPGH',
|
|
42
|
-
template: function template(theme) {
|
|
43
|
-
return "\n\n.cYPGH_ddjo{box-sizing:border-box;padding-left:".concat(theme.alertsPadding || 'inherit', ";padding-right:").concat(theme.alertsPadding || 'inherit', ";padding-top:").concat(theme.alertsTopPadding || 'inherit', ";pointer-events:none;position:fixed;width:100%;z-index:").concat(theme.alertsZIndex || 'inherit', "}\n\n.cYPGH_eVxh{pointer-events:auto}\n\n@media screen and (--phoneBreakPoint){.cYPGH_ddjo{padding:").concat(theme.alertsMobilePadding || 'inherit', "}}");
|
|
44
|
-
},
|
|
45
|
-
'alerts': 'cYPGH_ddjo',
|
|
46
|
-
'alertHolder': 'cYPGH_eVxh'
|
|
47
|
-
};
|
|
48
|
-
var Alerts = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
40
|
+
var Alerts = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
49
41
|
(0, _inherits2.default)(Alerts, _Component);
|
|
50
42
|
|
|
51
43
|
var _super = (0, _createSuper2.default)(Alerts);
|
|
@@ -69,10 +61,10 @@ var Alerts = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
|
|
|
69
61
|
}
|
|
70
62
|
|
|
71
63
|
if (alert.variant === 'stickyerror') {
|
|
72
|
-
return
|
|
64
|
+
return (0, _emotion.jsx)("div", {
|
|
73
65
|
key: alert.uuid,
|
|
74
|
-
|
|
75
|
-
},
|
|
66
|
+
css: _this.props.styles.alertHolder
|
|
67
|
+
}, (0, _emotion.jsx)(_uiAlerts.Alert, {
|
|
76
68
|
variant: "error",
|
|
77
69
|
onDismiss: closeAlert,
|
|
78
70
|
renderCloseButtonLabel: (0, _formatMessage.default)('Close'),
|
|
@@ -80,10 +72,10 @@ var Alerts = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
|
|
|
80
72
|
}, alert.message));
|
|
81
73
|
}
|
|
82
74
|
|
|
83
|
-
return
|
|
75
|
+
return (0, _emotion.jsx)("div", {
|
|
84
76
|
key: alert.uuid,
|
|
85
|
-
|
|
86
|
-
},
|
|
77
|
+
css: _this.props.styles.alertHolder
|
|
78
|
+
}, (0, _emotion.jsx)(_uiAlerts.Alert, {
|
|
87
79
|
variant: alert.variant,
|
|
88
80
|
onDismiss: closeAlert,
|
|
89
81
|
renderCloseButtonLabel: (0, _formatMessage.default)('Close'),
|
|
@@ -97,7 +89,7 @@ var Alerts = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
|
|
|
97
89
|
(0, _createClass2.default)(Alerts, [{
|
|
98
90
|
key: "renderScreenreaderAlert",
|
|
99
91
|
value: function renderScreenreaderAlert(alert) {
|
|
100
|
-
return
|
|
92
|
+
return (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, {
|
|
101
93
|
key: alert.uuid
|
|
102
94
|
}, alert.message);
|
|
103
95
|
}
|
|
@@ -114,16 +106,16 @@ var Alerts = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
|
|
|
114
106
|
});
|
|
115
107
|
|
|
116
108
|
if (hasStickyErrors) {
|
|
117
|
-
return
|
|
118
|
-
|
|
109
|
+
return (0, _emotion.jsx)("div", {
|
|
110
|
+
css: this.props.styles.alerts,
|
|
119
111
|
style: {
|
|
120
112
|
zIndex: '99999'
|
|
121
113
|
}
|
|
122
114
|
}, this.renderAlerts());
|
|
123
115
|
}
|
|
124
116
|
|
|
125
|
-
return
|
|
126
|
-
|
|
117
|
+
return (0, _emotion.jsx)("div", {
|
|
118
|
+
css: this.props.styles.alerts
|
|
127
119
|
}, this.renderAlerts());
|
|
128
120
|
}
|
|
129
121
|
}]);
|
|
@@ -131,7 +123,9 @@ var Alerts = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
|
|
|
131
123
|
return Alerts;
|
|
132
124
|
}(_react.Component), _class2.propTypes = {
|
|
133
125
|
removeAlert: _propTypes.default.func.isRequired,
|
|
134
|
-
alerts: _reactImmutableProptypes.default.list.isRequired
|
|
126
|
+
alerts: _reactImmutableProptypes.default.list.isRequired,
|
|
127
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
128
|
+
styles: _propTypes.default.object
|
|
135
129
|
}, _class2.defaultProps = {
|
|
136
130
|
sidebarOpen: false
|
|
137
131
|
}, _temp)) || _class);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
13
|
+
var mq = "@media screen and (".concat(componentTheme.phoneBreakPoint, ")");
|
|
14
|
+
return {
|
|
15
|
+
alerts: (0, _defineProperty2.default)({
|
|
16
|
+
position: 'fixed',
|
|
17
|
+
pointerEvents: 'none',
|
|
18
|
+
width: '100%',
|
|
19
|
+
boxSizing: 'border-box',
|
|
20
|
+
zIndex: componentTheme.alertsZIndex,
|
|
21
|
+
paddingLeft: componentTheme.alertsPadding,
|
|
22
|
+
paddingRight: componentTheme.alertsPadding,
|
|
23
|
+
paddingTop: componentTheme.alertsTopPadding
|
|
24
|
+
}, mq, {
|
|
25
|
+
padding: componentTheme.alertsMobilePadding
|
|
26
|
+
}),
|
|
27
|
+
alertHolder: {
|
|
28
|
+
pointerEvents: 'auto'
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var _default = generateStyle;
|
|
34
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var breakpoints = _ref.breakpoints,
|
|
10
10
|
spacing = _ref.spacing;
|
|
11
11
|
return {
|
|
@@ -15,4 +15,7 @@ function generator(_ref) {
|
|
|
15
15
|
alertsZIndex: '7777',
|
|
16
16
|
phoneBreakPoint: "max-width: ".concat(breakpoints.medium)
|
|
17
17
|
};
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var _default = generateComponentTheme;
|
|
21
|
+
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "20.3.1-rc.
|
|
3
|
+
"version": "20.3.1-rc.2+4d8c8b568",
|
|
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.0.0",
|
|
47
|
-
"@instructure/quiz-common": "20.3.1-rc.
|
|
48
|
-
"@instructure/quiz-i18n": "20.3.1-rc.
|
|
49
|
-
"@instructure/quiz-interactions": "20.3.1-rc.
|
|
50
|
-
"@instructure/quiz-number-input": "20.3.1-rc.
|
|
51
|
-
"@instructure/quiz-rce": "20.3.1-rc.
|
|
47
|
+
"@instructure/quiz-common": "20.3.1-rc.2+4d8c8b568",
|
|
48
|
+
"@instructure/quiz-i18n": "20.3.1-rc.2+4d8c8b568",
|
|
49
|
+
"@instructure/quiz-interactions": "20.3.1-rc.2+4d8c8b568",
|
|
50
|
+
"@instructure/quiz-number-input": "20.3.1-rc.2+4d8c8b568",
|
|
51
|
+
"@instructure/quiz-rce": "20.3.1-rc.2+4d8c8b568",
|
|
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",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"file-saver": "~2.0.5",
|
|
111
111
|
"humps": "^2.0.0",
|
|
112
112
|
"immutable": "^3.8.1",
|
|
113
|
-
"instructure-validations": "20.3.1-rc.
|
|
113
|
+
"instructure-validations": "20.3.1-rc.2+4d8c8b568",
|
|
114
114
|
"ipaddr.js": "^1.5.4",
|
|
115
115
|
"isomorphic-fetch": "^2.2.0",
|
|
116
116
|
"isuuid": "^0.1.0",
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"intl": "^1.2.4",
|
|
163
163
|
"jquery": "^2.2.3",
|
|
164
164
|
"most-subject": "^5.3.0",
|
|
165
|
-
"quiz-presets": "20.3.1-rc.
|
|
165
|
+
"quiz-presets": "20.3.1-rc.2+4d8c8b568",
|
|
166
166
|
"react": "^16.8.6",
|
|
167
167
|
"react-addons-test-utils": "^15.6.2",
|
|
168
168
|
"react-dom": "^16.8.6",
|
|
@@ -178,5 +178,5 @@
|
|
|
178
178
|
"publishConfig": {
|
|
179
179
|
"access": "public"
|
|
180
180
|
},
|
|
181
|
-
"gitHead": "
|
|
181
|
+
"gitHead": "4d8c8b56898f815f160d01adb663ed7ff8bdaad7"
|
|
182
182
|
}
|