@instructure/quiz-core 18.4.1-rc.0 → 18.4.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.
Files changed (39) hide show
  1. package/es/banks/components/BanksList/presenter.js +1 -1
  2. package/es/common/components/resources/stimulus/StimulusShowInfo/index.js +1 -1
  3. package/es/common/components/shared/TagDisplay/index.js +1 -1
  4. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisMetric/presenter.js +12 -16
  5. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisMetric/styles.js +11 -0
  6. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisPopoverMetric/presenter.js +17 -23
  7. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisPopoverMetric/styles.js +18 -0
  8. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/ChoiceTypeTableRow/presenter.js +30 -43
  9. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/ChoiceTypeTableRow/styles.js +36 -0
  10. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/ChoiceTypeTableRow/theme.js +6 -3
  11. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/presenter.js +26 -29
  12. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/styles.js +12 -0
  13. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/theme.js +5 -3
  14. package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +2 -2
  15. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +1 -1
  16. package/es/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +1 -1
  17. package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +1 -1
  18. package/lib/banks/components/BanksList/presenter.js +1 -1
  19. package/lib/common/components/resources/stimulus/StimulusShowInfo/index.js +1 -1
  20. package/lib/common/components/shared/TagDisplay/index.js +1 -1
  21. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisMetric/presenter.js +13 -20
  22. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisMetric/styles.js +19 -0
  23. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisPopoverMetric/presenter.js +16 -25
  24. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisPopoverMetric/styles.js +26 -0
  25. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/ChoiceTypeTableRow/presenter.js +32 -50
  26. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/ChoiceTypeTableRow/styles.js +46 -0
  27. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/ChoiceTypeTableRow/theme.js +8 -4
  28. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/presenter.js +28 -33
  29. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/styles.js +20 -0
  30. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/theme.js +7 -4
  31. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +2 -2
  32. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +1 -1
  33. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +1 -1
  34. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +1 -1
  35. package/package.json +57 -56
  36. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisMetric/theme.js +0 -3
  37. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisPopoverMetric/theme.js +0 -6
  38. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisMetric/theme.js +0 -10
  39. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisPopoverMetric/theme.js +0 -13
@@ -266,7 +266,7 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
266
266
  className: styles.bankTitle
267
267
  }, /*#__PURE__*/React.createElement(Link, {
268
268
  onClick: navigateToBank(bank.id),
269
- theme: {
269
+ themeOverride: {
270
270
  color: _this.theme.bankTitleLinkColor,
271
271
  hoverColor: _this.theme.bankTitleLinkHoverColor
272
272
  },
@@ -51,7 +51,7 @@ var StimulusShowInfo = /*#__PURE__*/function (_Component) {
51
51
  as: "h2",
52
52
  color: "primary",
53
53
  margin: "0 0 small",
54
- theme: {
54
+ themeOverride: {
55
55
  h2FontWeight: '700'
56
56
  }
57
57
  }, this.props.stimulus.title), instructions, /*#__PURE__*/React.createElement("div", {
@@ -54,7 +54,7 @@ export var TagDisplay = (_dec = themeable(theme, styles), _dec(_class = (_temp =
54
54
  className: styles.tags,
55
55
  "aria-label": t('question tags')
56
56
  }, visible, extra > 0 && /*#__PURE__*/React.createElement(Tag, {
57
- theme: {
57
+ themeOverride: {
58
58
  defaultBackground: '#FFFFFF'
59
59
  },
60
60
  text: /*#__PURE__*/React.createElement(AccessibleContent, {
@@ -5,20 +5,14 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
 
6
6
  var _dec, _class, _class2, _temp;
7
7
 
8
- import { themeable } from '@instructure/ui-themeable';
9
- import theme from "./theme.js";
10
- var styles = {
11
- componentId: 'ethsC',
12
- template: function template(theme) {
13
- return "\n\n.ethsC_eckF{margin:0;max-width:159px;text-transform:capitalize}";
14
- },
15
- 'metricLabel': 'ethsC_eckF'
16
- };
17
- import React, { Component } from 'react';
8
+ /** @jsx jsx */
9
+ import { Component } from 'react';
18
10
  import { getSanitizedMetricValue } from "../utils.js";
19
11
  import { Metric } from '@instructure/ui-metric';
20
12
  import PropTypes from 'prop-types';
21
- export var AnalysisMetric = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
13
+ import { withStyle, jsx } from '@instructure/emotion';
14
+ import generateStyle from "./styles.js";
15
+ export var AnalysisMetric = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
22
16
  _inherits(AnalysisMetric, _Component);
23
17
 
24
18
  var _super = _createSuper(AnalysisMetric);
@@ -37,15 +31,15 @@ export var AnalysisMetric = (_dec = themeable(theme, styles), _dec(_class = (_te
37
31
  label = _this$props.label,
38
32
  value = _this$props.value,
39
33
  suffix = _this$props.suffix;
40
- return /*#__PURE__*/React.createElement(Metric, {
41
- theme: {
34
+ return jsx(Metric, {
35
+ themeOverride: {
42
36
  valueFontWeight: 500,
43
37
  padding: '0'
44
38
  },
45
39
  textAlign: "start",
46
40
  key: metricKey,
47
- renderLabel: /*#__PURE__*/React.createElement("p", {
48
- className: styles.metricLabel
41
+ renderLabel: jsx("p", {
42
+ css: this.props.styles.metricLabel
49
43
  }, label),
50
44
  renderValue: getSanitizedMetricValue(value, suffix)
51
45
  });
@@ -58,7 +52,9 @@ export var AnalysisMetric = (_dec = themeable(theme, styles), _dec(_class = (_te
58
52
  metricKey: PropTypes.string.isRequired,
59
53
  label: PropTypes.string.isRequired,
60
54
  value: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.array]),
61
- suffix: PropTypes.string
55
+ suffix: PropTypes.string,
56
+ // eslint-disable-next-line react/require-default-props,react/forbid-prop-types
57
+ styles: PropTypes.object
62
58
  }, _class2.defaultProps = {
63
59
  value: void 0,
64
60
  suffix: ''
@@ -0,0 +1,11 @@
1
+ var generateStyle = function generateStyle() {
2
+ return {
3
+ metricLabel: {
4
+ margin: 0,
5
+ maxWidth: '159px',
6
+ textTransform: 'capitalize'
7
+ }
8
+ };
9
+ };
10
+
11
+ export default generateStyle;
@@ -5,23 +5,15 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
 
6
6
  var _dec, _class, _class2, _temp;
7
7
 
8
- import React, { Component } from 'react';
8
+ /** @jsx jsx */
9
+ import { Component } from 'react';
9
10
  import { Metric } from '@instructure/ui-metric';
10
11
  import { getSanitizedMetricValue } from "../utils.js";
11
- var styles = {
12
- componentId: 'dpcwk',
13
- template: function template(theme) {
14
- return "\n\n.dpcwk_elNf{max-width:159px}\n\n.dpcwk_eckF{margin:0;padding-right:24px;text-transform:capitalize}\n\n.dpcwk_dqHR{margin-left:-24px;padding-left:5px}";
15
- },
16
- 'metricLabelContainer': 'dpcwk_elNf',
17
- 'metricLabel': 'dpcwk_eckF',
18
- 'popoverContainer': 'dpcwk_dqHR'
19
- };
20
12
  import MetricPopover from "../MetricPopover/index.js";
21
- import { themeable } from '@instructure/ui-themeable';
22
- import theme from "./theme.js";
13
+ import { withStyle, jsx } from '@instructure/emotion';
14
+ import generateStyle from "./styles.js";
23
15
  import PropTypes from 'prop-types';
24
- export var AnalysisPopoverMetric = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
16
+ export var AnalysisPopoverMetric = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
25
17
  _inherits(AnalysisPopoverMetric, _Component);
26
18
 
27
19
  var _super = _createSuper(AnalysisPopoverMetric);
@@ -35,13 +27,13 @@ export var AnalysisPopoverMetric = (_dec = themeable(theme, styles), _dec(_class
35
27
  _createClass(AnalysisPopoverMetric, [{
36
28
  key: "renderLabelWithPopover",
37
29
  value: function renderLabelWithPopover(texts) {
38
- return /*#__PURE__*/React.createElement("div", {
39
- className: styles.metricLabelContainer
40
- }, /*#__PURE__*/React.createElement("span", {
41
- className: styles.metricLabel
42
- }, this.props.label), /*#__PURE__*/React.createElement("span", {
43
- className: styles.popoverContainer
44
- }, /*#__PURE__*/React.createElement(MetricPopover, texts)));
30
+ return jsx("div", {
31
+ css: this.props.styles.metricLabelContainer
32
+ }, jsx("span", {
33
+ css: this.props.styles.metricLabel
34
+ }, this.props.label), jsx("span", {
35
+ css: this.props.styles.popoverContainer
36
+ }, jsx(MetricPopover, texts)));
45
37
  }
46
38
  }, {
47
39
  key: "render",
@@ -50,8 +42,8 @@ export var AnalysisPopoverMetric = (_dec = themeable(theme, styles), _dec(_class
50
42
  metricKey = _this$props.metricKey,
51
43
  popoverDescription = _this$props.popoverDescription,
52
44
  value = _this$props.value;
53
- return /*#__PURE__*/React.createElement(Metric, {
54
- theme: {
45
+ return jsx(Metric, {
46
+ themeOverride: {
55
47
  valueFontWeight: 500,
56
48
  padding: '0'
57
49
  },
@@ -74,7 +66,9 @@ export var AnalysisPopoverMetric = (_dec = themeable(theme, styles), _dec(_class
74
66
  subtitle: PropTypes.string,
75
67
  body: PropTypes.string,
76
68
  screenReaderLabel: PropTypes.string
77
- }).isRequired
69
+ }).isRequired,
70
+ // eslint-disable-next-line react/require-default-props,react/forbid-prop-types
71
+ styles: PropTypes.object
78
72
  }, _class2.defaultProps = {
79
73
  value: void 0
80
74
  }, _temp)) || _class);
@@ -0,0 +1,18 @@
1
+ var generateStyle = function generateStyle() {
2
+ return {
3
+ metricLabelContainer: {
4
+ maxWidth: '159px'
5
+ },
6
+ metricLabel: {
7
+ margin: '0',
8
+ textTransform: 'capitalize',
9
+ paddingRight: '24px'
10
+ },
11
+ popoverContainer: {
12
+ paddingLeft: '5px',
13
+ marginLeft: '-24px'
14
+ }
15
+ };
16
+ };
17
+
18
+ export default generateStyle;
@@ -1,36 +1,26 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
1
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
2
  import _inherits from "@babel/runtime/helpers/esm/inherits";
4
3
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
4
 
6
5
  var _dec, _class, _class2, _temp;
7
6
 
8
- import React, { Component } from 'react';
7
+ /** @jsx jsx */
8
+ import { Component } from 'react';
9
9
  import { Table } from '@instructure/ui-table';
10
10
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
11
- import { themeable } from '@instructure/ui-themeable';
12
- import theme from "./theme.js";
13
- var styles = {
14
- componentId: 'cInnW',
15
- template: function template(theme) {
16
- return "\n\n.cInnW_cvRx{align-items:center;display:flex;height:48px;justify-content:center;width:46px}\n\n.cInnW_EKAb{background-color:".concat(theme.colorGreen || 'inherit', ";border-radius:4px 0 0 4px}\n\n.cInnW_EKAb svg{fill:#fff}\n\n.cInnW_tnta{border-color:").concat(theme.colorGreen || 'inherit', ";border-style:solid;border-width:2px 0;padding:").concat(theme.cellPadding || 'inherit', "}\n\n.cInnW_fvqY{border-radius:0 4px 4px 0;border-width:2px 2px 2px 0}");
17
- },
18
- 'iconWrapper': 'cInnW_cvRx',
19
- 'iconCorrect': 'cInnW_EKAb',
20
- 'correctRowBorder': 'cInnW_tnta',
21
- 'correctRowBorderRadius': 'cInnW_fvqY'
22
- };
23
- import PropTypes from 'prop-types';
24
11
  import { IconXSolid, IconCheckSolid } from '@instructure/ui-icons';
25
- import classNames from 'classnames';
26
12
  import { extractTextFromHtml } from '@instructure/quiz-interactions';
27
13
  import t from '@instructure/quiz-i18n/es/format-message';
14
+ import { withStyle, jsx } from '@instructure/emotion';
15
+ import generateComponentTheme from "./theme.js";
16
+ import generateStyle from "./styles.js";
17
+ import PropTypes from 'prop-types';
28
18
 
29
- var _ref = /*#__PURE__*/React.createElement(IconCheckSolid, null);
19
+ var _ref = jsx(IconCheckSolid, null);
30
20
 
31
- var _ref2 = /*#__PURE__*/React.createElement(IconXSolid, null);
21
+ var _ref2 = jsx(IconXSolid, null);
32
22
 
33
- export var ChoiceTypeTableRow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
23
+ export var ChoiceTypeTableRow = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
34
24
  _inherits(ChoiceTypeTableRow, _Component);
35
25
 
36
26
  var _super = _createSuper(ChoiceTypeTableRow);
@@ -47,25 +37,20 @@ export var ChoiceTypeTableRow = (_dec = themeable(theme, styles), _dec(_class =
47
37
  _this = _super.call.apply(_super, [this].concat(args));
48
38
 
49
39
  _this.renderIcon = function (correct) {
50
- var className = classNames(styles.iconWrapper, _defineProperty({}, styles.iconCorrect, correct));
51
- return /*#__PURE__*/React.createElement("div", {
52
- className: className
40
+ return jsx("div", {
41
+ css: _this.props.styles.iconWrapper
53
42
  }, correct ? _ref : _ref2);
54
43
  };
55
44
 
56
45
  _this.renderMiddleCell = function (correct, content) {
57
- var className = classNames(_defineProperty({}, styles.correctRowBorder, correct));
58
- return /*#__PURE__*/React.createElement("div", {
59
- className: className
46
+ return jsx("div", {
47
+ css: _this.props.styles.middleCell
60
48
  }, content);
61
49
  };
62
50
 
63
51
  _this.renderLastCell = function (correct, content) {
64
- var _classNames3;
65
-
66
- var className = classNames((_classNames3 = {}, _defineProperty(_classNames3, styles.correctRowBorder, correct), _defineProperty(_classNames3, styles.correctRowBorderRadius, correct), _classNames3));
67
- return /*#__PURE__*/React.createElement("div", {
68
- className: className
52
+ return jsx("div", {
53
+ css: _this.props.styles.lastCell
69
54
  }, content);
70
55
  };
71
56
 
@@ -82,26 +67,26 @@ export var ChoiceTypeTableRow = (_dec = themeable(theme, styles), _dec(_class =
82
67
  _this.render = function () {
83
68
  var correct = _this.props.choice.correct;
84
69
  var choiceBody = _this.props.choice.body;
85
- var cellPadding = correct ? '0' : _this.theme.cellPadding;
86
- return /*#__PURE__*/React.createElement(Table.Row, {
70
+ var cellPadding = correct ? '0' : _this.props.styles.cellPadding;
71
+ return jsx(Table.Row, {
87
72
  key: _this.props.choiceIndex
88
- }, /*#__PURE__*/React.createElement(Table.Cell, {
89
- theme: {
73
+ }, jsx(Table.Cell, {
74
+ themeOverride: {
90
75
  padding: '0px',
91
76
  fontWeight: 'bold'
92
77
  }
93
- }, /*#__PURE__*/React.createElement(ScreenReaderContent, null, _this.answerLabel(correct)), _this.renderIcon(correct)), /*#__PURE__*/React.createElement(Table.RowHeader, {
94
- theme: {
78
+ }, jsx(ScreenReaderContent, null, _this.answerLabel(correct)), _this.renderIcon(correct)), jsx(Table.RowHeader, {
79
+ themeOverride: {
95
80
  padding: cellPadding,
96
81
  fontWeight: 'bold'
97
82
  }
98
- }, _this.renderMiddleCell(correct, _this.extractChoiceText(choiceBody, correct))), /*#__PURE__*/React.createElement(Table.Cell, {
99
- theme: {
83
+ }, _this.renderMiddleCell(correct, _this.extractChoiceText(choiceBody, correct))), jsx(Table.Cell, {
84
+ themeOverride: {
100
85
  padding: cellPadding,
101
86
  fontWeight: 'bold'
102
87
  }
103
- }, _this.renderMiddleCell(correct, _this.props.choice.count)), /*#__PURE__*/React.createElement(Table.Cell, {
104
- theme: {
88
+ }, _this.renderMiddleCell(correct, _this.props.choice.count)), jsx(Table.Cell, {
89
+ themeOverride: {
105
90
  padding: cellPadding,
106
91
  fontWeight: 'bold'
107
92
  },
@@ -119,6 +104,8 @@ export var ChoiceTypeTableRow = (_dec = themeable(theme, styles), _dec(_class =
119
104
  correct: PropTypes.bool,
120
105
  count: PropTypes.number,
121
106
  percentage: PropTypes.number
122
- }),
123
- choiceIndex: PropTypes.number
124
- }.isRequired, _temp)) || _class);
107
+ }).isRequired,
108
+ choiceIndex: PropTypes.number.isRequired,
109
+ // eslint-disable-next-line react/require-default-props,react/forbid-prop-types
110
+ styles: PropTypes.object
111
+ }, _temp)) || _class);
@@ -0,0 +1,36 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+
3
+ var generateStyle = function generateStyle(componentTheme, props) {
4
+ var correct = props.choice.correct;
5
+ var correctRowBorder = {
6
+ borderColor: componentTheme.correctAnswerBackgroundColor,
7
+ borderWidth: '2px 0',
8
+ borderStyle: 'solid',
9
+ padding: componentTheme.cellPadding
10
+ };
11
+ var correctRowBorderRadius = {
12
+ borderWidth: '2px 2px 2px 0',
13
+ borderRadius: '0 4px 4px 0'
14
+ };
15
+ var iconCorrect = {
16
+ backgroundColor: componentTheme.correctAnswerBackgroundColor,
17
+ borderRadius: '4px 0 0 4px',
18
+ svg: {
19
+ fill: 'white'
20
+ }
21
+ };
22
+ return {
23
+ cellPadding: componentTheme.cellPadding,
24
+ iconWrapper: _objectSpread({
25
+ display: 'flex',
26
+ height: '48px',
27
+ width: '46px',
28
+ justifyContent: 'center',
29
+ alignItems: 'center'
30
+ }, correct && _objectSpread({}, iconCorrect)),
31
+ middleCell: _objectSpread({}, correct && _objectSpread({}, correctRowBorder)),
32
+ lastCell: _objectSpread({}, correct && _objectSpread(_objectSpread({}, correctRowBorder), correctRowBorderRadius))
33
+ };
34
+ };
35
+
36
+ export default generateStyle;
@@ -1,6 +1,9 @@
1
- export default function generator() {
1
+ var generateComponentTheme = function generateComponentTheme(_ref) {
2
+ var colors = _ref.colors;
2
3
  return {
3
- colorGreen: '#0b874b',
4
+ correctAnswerBackgroundColor: colors.shamrock,
4
5
  cellPadding: '0.75rem 0.75rem'
5
6
  };
6
- }
7
+ };
8
+
9
+ 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
- import React, { Component } from 'react';
8
+ /** @jsx jsx */
9
+ import { Component } from 'react';
9
10
  import t from '@instructure/quiz-i18n/es/format-message';
10
11
  import { Table } from '@instructure/ui-table';
11
12
  import { Flex } from '@instructure/ui-flex';
12
13
  import { Heading } from '@instructure/ui-heading';
13
- import { themeable } from '@instructure/ui-themeable';
14
14
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
15
- import PropTypes from 'prop-types';
16
15
  import ChoiceTypeTableRow from "./ChoiceTypeTableRow/index.js";
17
16
  import { choiceTypeAnswerSummaryPropType } from "../../propTypes.js";
18
- var styles = {
19
- componentId: 'ZuPLN',
20
- template: function template(theme) {
21
- return "\n\n.ZuPLN_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}");
22
- },
23
- 'tableWrapper': 'ZuPLN_rMrG'
24
- };
25
- import theme from "./theme.js";
26
- export var ChoiceType = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
17
+ import { withStyle, jsx } from '@instructure/emotion';
18
+ import generateComponentTheme from "./theme.js";
19
+ import generateStyle from "./styles.js";
20
+ import PropTypes from 'prop-types';
21
+ export var ChoiceType = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
27
22
  _inherits(ChoiceType, _Component);
28
23
 
29
24
  var _super = _createSuper(ChoiceType);
@@ -40,7 +35,7 @@ export var ChoiceType = (_dec = themeable(theme, styles), _dec(_class = (_temp =
40
35
  _this = _super.call.apply(_super, [this].concat(args));
41
36
 
42
37
  _this.renderRow = function (choice, choiceIndex) {
43
- return /*#__PURE__*/React.createElement(ChoiceTypeTableRow, {
38
+ return jsx(ChoiceTypeTableRow, {
44
39
  key: choiceIndex,
45
40
  choice: choice,
46
41
  choiceIndex: choiceIndex
@@ -54,7 +49,7 @@ export var ChoiceType = (_dec = themeable(theme, styles), _dec(_class = (_temp =
54
49
  correct: false,
55
50
  count: payload.count
56
51
  };
57
- return /*#__PURE__*/React.createElement(ChoiceTypeTableRow, {
52
+ return jsx(ChoiceTypeTableRow, {
58
53
  key: choiceIndex,
59
54
  choice: asChoice,
60
55
  choiceIndex: choiceIndex
@@ -77,40 +72,42 @@ export var ChoiceType = (_dec = themeable(theme, styles), _dec(_class = (_temp =
77
72
  var answerHeaderId = "answer-frequency-summary-answer-".concat(itemId);
78
73
  var respondentsHeaderId = "answer-frequency-summary-respondents-".concat(itemId);
79
74
  var percentageHeaderId = "answer-frequency-summary-percentage-".concat(itemId);
80
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Flex, {
75
+ return jsx("div", null, jsx(Flex, {
81
76
  direction: "row"
82
- }, /*#__PURE__*/React.createElement(Flex.Item, {
77
+ }, jsx(Flex.Item, {
83
78
  shouldGrow: true
84
- }, /*#__PURE__*/React.createElement("div", {
85
- className: styles.tableWrapper
86
- }, /*#__PURE__*/React.createElement(Heading, {
79
+ }, jsx("div", {
80
+ css: this.props.styles.tableWrapper
81
+ }, jsx(Heading, {
87
82
  margin: "large 0 small 0",
88
83
  level: "h4",
89
- theme: {
84
+ themeOverride: {
90
85
  h4FontWeight: 'normal'
91
86
  }
92
- }, t('Answer Frequency Summary')), /*#__PURE__*/React.createElement(Table, {
87
+ }, t('Answer Frequency Summary')), jsx(Table, {
93
88
  caption: t('Answer Frequency Summary')
94
- }, /*#__PURE__*/React.createElement(Table.Head, null, /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.ColHeader, {
89
+ }, jsx(Table.Head, null, jsx(Table.Row, null, jsx(Table.ColHeader, {
95
90
  id: spacingHeaderId,
96
91
  width: "46px"
97
- }, /*#__PURE__*/React.createElement(ScreenReaderContent, null, t('Answer correctness'))), /*#__PURE__*/React.createElement(Table.ColHeader, {
92
+ }, jsx(ScreenReaderContent, null, t('Answer correctness'))), jsx(Table.ColHeader, {
98
93
  id: answerHeaderId,
99
94
  height: "47px"
100
- }, t('Answer')), /*#__PURE__*/React.createElement(Table.ColHeader, {
95
+ }, t('Answer')), jsx(Table.ColHeader, {
101
96
  id: respondentsHeaderId,
102
97
  height: "47px"
103
- }, t('Respondents')), /*#__PURE__*/React.createElement(Table.ColHeader, {
98
+ }, t('Respondents')), jsx(Table.ColHeader, {
104
99
  id: percentageHeaderId,
105
100
  height: "47px",
106
101
  textAlign: "center"
107
- }, t('%')))), /*#__PURE__*/React.createElement(Table.Body, null, choices.map(this.renderRow), this.renderNoAnswer(noAnswer, numberOfChoices)))))));
102
+ }, t('%')))), jsx(Table.Body, null, choices.map(this.renderRow), this.renderNoAnswer(noAnswer, numberOfChoices)))))));
108
103
  }
109
104
  }]);
110
105
 
111
106
  ChoiceType.displayName = "ChoiceType";
112
107
  return ChoiceType;
113
108
  }(Component), _class2.propTypes = {
114
- itemId: PropTypes.number,
115
- answerSummary: choiceTypeAnswerSummaryPropType
116
- }.isRequired, _temp)) || _class);
109
+ itemId: PropTypes.number.isRequired,
110
+ answerSummary: choiceTypeAnswerSummaryPropType.isRequired,
111
+ // eslint-disable-next-line react/require-default-props,react/forbid-prop-types
112
+ styles: PropTypes.object
113
+ }, _temp)) || _class);
@@ -0,0 +1,12 @@
1
+ var generateStyle = function generateStyle(componentTheme) {
2
+ return {
3
+ tableWrapper: {
4
+ display: 'flex',
5
+ flexBasis: '100%',
6
+ flexDirection: 'column',
7
+ paddingBottom: componentTheme.tableBottomPadding
8
+ }
9
+ };
10
+ };
11
+
12
+ export default generateStyle;
@@ -1,6 +1,8 @@
1
- export default function generator(_ref) {
1
+ var generateComponentTheme = function generateComponentTheme(_ref) {
2
2
  var spacing = _ref.spacing;
3
3
  return {
4
- tableBottomPadding: spacing.medium
4
+ tableBottomPadding: spacing === null || spacing === void 0 ? void 0 : spacing.medium
5
5
  };
6
- }
6
+ };
7
+
8
+ export default generateComponentTheme;
@@ -86,7 +86,7 @@ export var MetricPopover = (_dec = themeable(theme, styles), _dec(_class = (_tem
86
86
  className: styles.popoverTitle,
87
87
  level: "h3"
88
88
  }, _this.props.title)), /*#__PURE__*/React.createElement("div", null, _this.props.subtitle && /*#__PURE__*/React.createElement(Heading, {
89
- theme: {
89
+ themeOverride: {
90
90
  h5FontWeight: 700
91
91
  },
92
92
  level: "h5"
@@ -103,7 +103,7 @@ export var MetricPopover = (_dec = themeable(theme, styles), _dec(_class = (_tem
103
103
  value: function renderPopoverTrigger() {
104
104
  return /*#__PURE__*/React.createElement(IconButton, {
105
105
  size: "small",
106
- theme: {
106
+ themeOverride: {
107
107
  smallHeight: '18px',
108
108
  transform: 'translateY(-1px)'
109
109
  },
@@ -89,7 +89,7 @@ export var NewQuizAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
89
89
  className: styles.heading
90
90
  }, /*#__PURE__*/React.createElement(Heading, {
91
91
  level: "h2",
92
- theme: {
92
+ themeOverride: {
93
93
  h2FontWeight: 700
94
94
  },
95
95
  margin: "0 x-large 0 0",
@@ -56,7 +56,7 @@ export var ScoreDistribution = (_dec = themeable(theme, styles), _dec(_class = (
56
56
  className: styles.headingContainer
57
57
  }, /*#__PURE__*/React.createElement(Heading, {
58
58
  level: "h3",
59
- theme: {
59
+ themeOverride: {
60
60
  h3FontWeight: 700
61
61
  }
62
62
  }, t('Score Distribution'))), /*#__PURE__*/React.createElement(QuintileDistribution, {
@@ -137,7 +137,7 @@ export var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component)
137
137
  color: "primary-inverse",
138
138
  margin: "0 0 x-small 0",
139
139
  onClick: _this.handleGeneration,
140
- theme: {
140
+ themeOverride: {
141
141
  lineHeight: '24px'
142
142
  }
143
143
  }, /*#__PURE__*/React.createElement(Text, {
@@ -303,7 +303,7 @@ var BanksList = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
303
303
  className: styles.bankTitle
304
304
  }, /*#__PURE__*/_react.default.createElement(_uiLink.Link, {
305
305
  onClick: navigateToBank(bank.id),
306
- theme: {
306
+ themeOverride: {
307
307
  color: _this.theme.bankTitleLinkColor,
308
308
  hoverColor: _this.theme.bankTitleLinkHoverColor
309
309
  },
@@ -72,7 +72,7 @@ var StimulusShowInfo = /*#__PURE__*/function (_Component) {
72
72
  as: "h2",
73
73
  color: "primary",
74
74
  margin: "0 0 small",
75
- theme: {
75
+ themeOverride: {
76
76
  h2FontWeight: '700'
77
77
  }
78
78
  }, this.props.stimulus.title), instructions, /*#__PURE__*/_react.default.createElement("div", {
@@ -76,7 +76,7 @@ var TagDisplay = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
76
76
  className: styles.tags,
77
77
  "aria-label": (0, _formatMessage.default)('question tags')
78
78
  }, visible, extra > 0 && /*#__PURE__*/_react.default.createElement(_uiTag.Tag, {
79
- theme: {
79
+ themeOverride: {
80
80
  defaultBackground: '#FFFFFF'
81
81
  },
82
82
  text: /*#__PURE__*/_react.default.createElement(_uiA11yContent.AccessibleContent, {