@instructure/quiz-core 20.1.0 → 20.1.1-rc.1

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 (31) hide show
  1. package/es/banks/components/BankEntry/presenter.js +43 -56
  2. package/es/banks/components/BankEntry/styles.js +65 -0
  3. package/es/banks/components/BankEntry/theme.js +4 -2
  4. package/es/banks/components/BankEntryRow/presenter.js +55 -65
  5. package/es/banks/components/BankEntryRow/styles.js +50 -0
  6. package/es/banks/components/BankEntryRow/theme.js +4 -2
  7. package/es/banks/components/BankSearch/presenter.js +29 -34
  8. package/es/banks/components/BankSearch/styles.js +17 -0
  9. package/es/banks/components/BankSearch/theme.js +5 -5
  10. package/es/banks/components/Banks/presenter.js +46 -57
  11. package/es/banks/components/Banks/styles.js +32 -0
  12. package/es/banks/components/Banks/theme.js +4 -2
  13. package/es/banks/components/BanksList/presenter.js +80 -90
  14. package/es/banks/components/BanksList/styles.js +45 -0
  15. package/es/banks/components/BanksList/theme.js +4 -2
  16. package/lib/banks/components/BankEntry/presenter.js +41 -57
  17. package/lib/banks/components/BankEntry/styles.js +75 -0
  18. package/lib/banks/components/BankEntry/theme.js +6 -3
  19. package/lib/banks/components/BankEntryRow/presenter.js +54 -69
  20. package/lib/banks/components/BankEntryRow/styles.js +58 -0
  21. package/lib/banks/components/BankEntryRow/theme.js +6 -3
  22. package/lib/banks/components/BankSearch/presenter.js +28 -37
  23. package/lib/banks/components/BankSearch/styles.js +25 -0
  24. package/lib/banks/components/BankSearch/theme.js +7 -6
  25. package/lib/banks/components/Banks/presenter.js +45 -61
  26. package/lib/banks/components/Banks/styles.js +40 -0
  27. package/lib/banks/components/Banks/theme.js +6 -3
  28. package/lib/banks/components/BanksList/presenter.js +73 -88
  29. package/lib/banks/components/BanksList/styles.js +53 -0
  30. package/lib/banks/components/BanksList/theme.js +6 -3
  31. package/package.json +10 -10
@@ -7,7 +7,8 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
7
7
 
8
8
  var _dec, _class, _class2, _temp;
9
9
 
10
- import React, { Component } from 'react';
10
+ /** @jsx jsx */
11
+ import { Component } from 'react';
11
12
  import ReactDOM from 'react-dom';
12
13
  import PropTypes from 'prop-types';
13
14
  import Immutable from 'immutable';
@@ -25,7 +26,7 @@ import { Heading } from '@instructure/ui-heading';
25
26
  import { IconDiscussionLine, IconDiscussionSolid } from '@instructure/ui-icons';
26
27
  import { PresentationContent, ScreenReaderContent } from '@instructure/ui-a11y-content';
27
28
  import { TextInput } from '@instructure/ui-text-input';
28
- import { themeable } from '@instructure/ui-themeable';
29
+ import { withStyle, jsx } from '@instructure/emotion';
29
30
  import EntrySave from "../../../common/components/resources/entry/EntrySave/index.js";
30
31
  import ItemEdit from "../../../common/components/resources/item/ItemEdit/index.js";
31
32
  import ItemFeedbackModal from "../../../building/components/resources/ItemFeedbackModal/index.js";
@@ -42,28 +43,12 @@ import { createStimulus } from "../../../building/api/stimuli.js";
42
43
  import { propsForItemVersioningWrapper, propsForStimulusVersioningWrapper } from "../../../common/util/warningHelpers.js";
43
44
  import NavWrapper from "../NavWrapper/index.js";
44
45
  import { API_INPUT_VALIDATION_ERROR, CLEAR_ALL_INPUT_VALIDATION_ERRORS, ITEM_FEEDBACK_MODAL, ITEM_FEEDBACK_MODAL_ITEM, ITEM_FEEDBACK_MODAL_FEEDBACK, PARENT_TYPE_BANK } from '@instructure/quiz-common';
45
- var styles = {
46
- componentId: 'dhhIK',
47
- template: function template(theme) {
48
- return "\n\n.dhhIK_caGd{background-color:".concat(theme.contentBackgroundColor || 'inherit', ";padding:").concat(theme.contentPaddingTopBottom || 'inherit', " ").concat(theme.contentPaddingLeftRight || 'inherit', "}\n\n.dhhIK_blfJ{margin-bottom:").concat(theme.entryRowMargin || 'inherit', "}\n\n.dhhIK_dlpV{color:").concat(theme.headerRowColor || 'inherit', ";flex-direction:row;justify-content:space-between;padding:").concat(theme.headerRowPadding || 'inherit', "}\n\n.dhhIK_dlpV,.dhhIK_cKlw{align-items:flex-start;display:flex}\n\n.dhhIK_cKlw{flex:0 0 auto;flex-direction:column;margin-right:").concat(theme.leftHeaderMargin || 'inherit', "}\n\n.dhhIK_fAhB{font-size:").concat(theme.headerTextFontSize || 'inherit', "}\n\n.dhhIK_fsuY{align-items:center;background-color:").concat(theme.headerBackgroundColor || 'inherit', ";color:").concat(theme.headerColor || 'inherit', ";display:flex;justify-content:space-between;padding:").concat(theme.headerPaddingTopBottom || 'inherit', " ").concat(theme.headerPaddingLeftRight || 'inherit', ";vertical-align:middle}\n\n.dhhIK_IoDT{padding-left:").concat(theme.rightHeaderPaddingLeft || 'inherit', ";text-align:right}\n\n[dir=ltr] .dhhIK_IoDT,[dir=rtl] .dhhIK_IoDT{text-align:right}\n\n.dhhIK_cjWK,.dhhIK_bVuu,.dhhIK_ekxs{display:flex;flex-direction:row}\n\n.dhhIK_cjWK{padding-bottom:").concat(theme.footerPaddingBottom || 'inherit', ";padding-top:").concat(theme.footerPaddingTop || 'inherit', ";text-align:left}\n\n[dir=ltr] .dhhIK_cjWK,[dir=rtl] .dhhIK_cjWK{text-align:left}\n\n.dhhIK_ekxs{flex:8 0 0;justify-content:flex-end;padding-left:").concat(theme.rightFooterPaddingLeftRight || 'inherit', ";padding-right:").concat(theme.rightFooterPaddingLeftRight || 'inherit', "}\n\n.dhhIK_eNDu{border-bottom:").concat(theme.entryEditBorderWidth || 'inherit', " solid ").concat(theme.entryEditBorderColor || 'inherit', "}");
49
- },
50
- 'content': 'dhhIK_caGd',
51
- 'entryRow': 'dhhIK_blfJ',
52
- 'headerRow': 'dhhIK_dlpV',
53
- 'leftHeader': 'dhhIK_cKlw',
54
- 'headerText': 'dhhIK_fAhB',
55
- 'header': 'dhhIK_fsuY',
56
- 'rightHeader': 'dhhIK_IoDT',
57
- 'footer': 'dhhIK_cjWK',
58
- 'leftFooter': 'dhhIK_bVuu',
59
- 'rightFooter': 'dhhIK_ekxs',
60
- 'entryEdit': 'dhhIK_eNDu'
61
- };
62
- import theme from "./theme.js";
63
-
64
- var _ref3 = /*#__PURE__*/React.createElement(Spinner, null);
65
-
66
- export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
46
+ import generateStyle from "./styles.js";
47
+ import generateComponentTheme from "./theme.js";
48
+
49
+ var _ref3 = jsx(Spinner, null);
50
+
51
+ export var BankEntry = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
67
52
  _inherits(BankEntry, _Component);
68
53
 
69
54
  var _super = _createSuper(BankEntry);
@@ -310,17 +295,17 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
310
295
  returnToUrl = _this$props.returnToUrl,
311
296
  bank = _this$props.bank;
312
297
  var isScopeEmpty = !Object.keys(scope).length;
313
- return /*#__PURE__*/React.createElement(NavWrapper, {
298
+ return jsx(NavWrapper, {
314
299
  closeTray: closeTray,
315
300
  navigateToBanks: navigateToBanks,
316
301
  navigateToBuild: navigateToBuild,
317
302
  returnToUrl: isScopeEmpty ? null : returnToUrl,
318
303
  canvasReferrerLinkText: isScopeEmpty ? null : scope.title
319
- }, /*#__PURE__*/React.createElement(BreadcrumbLink, {
304
+ }, jsx(BreadcrumbLink, {
320
305
  key: "bank",
321
306
  onClick: this.navigateToBank,
322
307
  ref: this.setNavToBankRef
323
- }, bank.title), /*#__PURE__*/React.createElement(BreadcrumbLink, {
308
+ }, bank.title), jsx(BreadcrumbLink, {
324
309
  key: "bankEntry"
325
310
  }, this.entryLinkName()));
326
311
  }
@@ -328,8 +313,8 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
328
313
  key: "renderTitle",
329
314
  value: function renderTitle(entry) {
330
315
  if (this.isItemEntry()) {
331
- return /*#__PURE__*/React.createElement(TextInput, {
332
- renderLabel: /*#__PURE__*/React.createElement(ScreenReaderContent, null, t('Edit question title')),
316
+ return jsx(TextInput, {
317
+ renderLabel: jsx(ScreenReaderContent, null, t('Edit question title')),
333
318
  type: "text",
334
319
  placeholder: t('Question Title'),
335
320
  onChange: this.handleTitleChange,
@@ -351,18 +336,18 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
351
336
  var itemIdentifier = this.isTemporary() ? tempIdentifier : identifier;
352
337
  var entryName = this.isItemEntry() ? entry.getInteractionType().name : t('Stimulus');
353
338
  var separator = ' | ';
354
- return /*#__PURE__*/React.createElement("div", {
355
- className: styles.header
356
- }, /*#__PURE__*/React.createElement("div", {
357
- className: styles.leftHeader
358
- }, /*#__PURE__*/React.createElement("div", {
359
- className: styles.headerText
360
- }, /*#__PURE__*/React.createElement(Heading, {
339
+ return jsx("div", {
340
+ css: this.props.styles.header
341
+ }, jsx("div", {
342
+ css: this.props.styles.leftHeader
343
+ }, jsx("div", {
344
+ css: this.props.styles.headerText
345
+ }, jsx(Heading, {
361
346
  level: "reset",
362
347
  as: "h2"
363
- }, entryName, /*#__PURE__*/React.createElement(PresentationContent, null, separator), itemIdentifier))), this.renderTitle(entry), /*#__PURE__*/React.createElement("div", {
364
- className: styles.rightHeader
365
- }, /*#__PURE__*/React.createElement(EntrySave, props)));
348
+ }, entryName, jsx(PresentationContent, null, separator), itemIdentifier))), this.renderTitle(entry), jsx("div", {
349
+ css: this.props.styles.rightHeader
350
+ }, jsx(EntrySave, props)));
366
351
  }
367
352
  }, {
368
353
  key: "hasPendingTagModifications",
@@ -544,7 +529,7 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
544
529
  text = t('Edit Question Level Feedback');
545
530
  }
546
531
 
547
- return /*#__PURE__*/React.createElement(IconButton, {
532
+ return jsx(IconButton, {
548
533
  onClick: this.openFeedbackModal,
549
534
  withBackground: false,
550
535
  withBorder: false,
@@ -607,7 +592,7 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
607
592
  var entryId = this.getBankEntryId(bankEntry);
608
593
 
609
594
  var tags = function tags() {
610
- return /*#__PURE__*/React.createElement(TagSuggestSelect, {
595
+ return jsx(TagSuggestSelect, {
611
596
  allowNewTags: true,
612
597
  noMatchText: t('Enter a tag to find or create'),
613
598
  parentType: entryType,
@@ -618,20 +603,20 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
618
603
  };
619
604
 
620
605
  var editWarning = this.isItemEntry() ? t('Edits made here will appear on any assessment using this question.') : t('Edits made here will appear on any assessment using this stimulus.');
621
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
622
- className: styles.entryEdit
623
- }, /*#__PURE__*/React.createElement(WarningWrapper, versioningProps, canEdit && /*#__PURE__*/React.createElement(Alert, {
606
+ return jsx("div", null, jsx("div", {
607
+ css: this.props.styles.entryEdit
608
+ }, jsx(WarningWrapper, versioningProps, canEdit && jsx(Alert, {
624
609
  renderCloseButtonLabel: t('Dismiss'),
625
610
  margin: "0 0 medium 0"
626
- }, /*#__PURE__*/React.createElement(Text, {
611
+ }, jsx(Text, {
627
612
  color: "primary"
628
- }, editWarning)), /*#__PURE__*/React.createElement(EntryComponent, props), useBankTags && tags())), /*#__PURE__*/React.createElement("div", {
629
- className: styles.footer
630
- }, /*#__PURE__*/React.createElement("div", {
631
- className: styles.leftFooter
632
- }, this.renderFeedbackSection()), /*#__PURE__*/React.createElement("div", {
633
- className: styles.rightFooter
634
- }, /*#__PURE__*/React.createElement(EntrySave, props))));
613
+ }, editWarning)), jsx(EntryComponent, props), useBankTags && tags())), jsx("div", {
614
+ css: this.props.styles.footer
615
+ }, jsx("div", {
616
+ css: this.props.styles.leftFooter
617
+ }, this.renderFeedbackSection()), jsx("div", {
618
+ css: this.props.styles.rightFooter
619
+ }, jsx(EntrySave, props))));
635
620
  }
636
621
  }, {
637
622
  key: "render",
@@ -642,9 +627,9 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
642
627
  return _ref3;
643
628
  }
644
629
 
645
- return /*#__PURE__*/React.createElement(Page, null, this.renderNav(), /*#__PURE__*/React.createElement("div", {
646
- className: styles.content
647
- }, this.renderHeader(entry), this.renderEntry(entry), !this.props.isCompact && /*#__PURE__*/React.createElement(ItemFeedbackModal, {
630
+ return jsx(Page, null, this.renderNav(), jsx("div", {
631
+ css: this.props.styles.content
632
+ }, this.renderHeader(entry), this.renderEntry(entry), !this.props.isCompact && jsx(ItemFeedbackModal, {
648
633
  parentId: this.props.bankId,
649
634
  parentType: PARENT_TYPE_BANK
650
635
  })));
@@ -697,7 +682,9 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
697
682
  tagInput: PropTypes.string,
698
683
  updateItem: PropTypes.func.isRequired,
699
684
  updateStimulus: PropTypes.func.isRequired,
700
- useBankTags: PropTypes.bool
685
+ useBankTags: PropTypes.bool,
686
+ // eslint-disable-next-line react/require-default-props,react/forbid-prop-types
687
+ styles: PropTypes.object
701
688
  }, _class2.defaultProps = {
702
689
  closeTray: function closeTray() {},
703
690
  entry: null,
@@ -0,0 +1,65 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+
3
+ var generateStyle = function generateStyle(componentTheme) {
4
+ var footerStyles = {
5
+ display: 'flex',
6
+ flexDirection: 'row'
7
+ };
8
+ return {
9
+ content: {
10
+ padding: "".concat(componentTheme.contentPaddingTopBottom, " ").concat(componentTheme.contentPaddingLeftRight),
11
+ backgroundColor: componentTheme.contentBackgroundColor
12
+ },
13
+ entryRow: {
14
+ marginBottom: componentTheme.entryRowMargin
15
+ },
16
+ headerRow: {
17
+ display: 'flex',
18
+ flexDirection: 'row',
19
+ justifyContent: 'space-between',
20
+ alignItems: 'flex-start',
21
+ color: componentTheme.headerRowColor,
22
+ padding: componentTheme.headerRowPadding
23
+ },
24
+ leftHeader: {
25
+ flex: '0 0 auto',
26
+ display: 'flex',
27
+ flexDirection: 'column',
28
+ alignItems: 'flex-start',
29
+ marginRight: componentTheme.leftHeaderMargin
30
+ },
31
+ headerText: {
32
+ fontSize: componentTheme.headerTextFontSize
33
+ },
34
+ header: {
35
+ backgroundColor: componentTheme.headerBackgroundColor,
36
+ color: componentTheme.headerColor,
37
+ padding: "".concat(componentTheme.headerPaddingTopBottom, " ").concat(componentTheme.headerPaddingLeftRight),
38
+ display: 'flex',
39
+ justifyContent: 'space-between',
40
+ verticalAlign: 'middle',
41
+ alignItems: 'center'
42
+ },
43
+ rightHeader: {
44
+ textAlign: 'right',
45
+ paddingLeft: componentTheme.rightHeaderPaddingLeft
46
+ },
47
+ footer: _objectSpread(_objectSpread({}, footerStyles), {}, {
48
+ textAlign: 'left',
49
+ paddingBottom: componentTheme.footerPaddingBottom,
50
+ paddingTop: componentTheme.footerPaddingTop
51
+ }),
52
+ leftFooter: footerStyles,
53
+ rightFooter: _objectSpread(_objectSpread({}, footerStyles), {}, {
54
+ flex: '8 0 0',
55
+ justifyContent: 'flex-end',
56
+ paddingLeft: componentTheme.rightFooterPaddingLeftRight,
57
+ paddingRight: componentTheme.rightFooterPaddingLeftRight
58
+ }),
59
+ entryEdit: {
60
+ borderBottom: "".concat(componentTheme.entryEditBorderWidth, " solid ").concat(componentTheme.entryEditBorderColor)
61
+ }
62
+ };
63
+ };
64
+
65
+ export default generateStyle;
@@ -1,4 +1,4 @@
1
- export default function generator(_ref) {
1
+ var generateComponentTheme = function generateComponentTheme(_ref) {
2
2
  var spacing = _ref.spacing,
3
3
  colors = _ref.colors,
4
4
  typography = _ref.typography,
@@ -21,4 +21,6 @@ export default function generator(_ref) {
21
21
  entryEditBorderWidth: borders.widthSmall,
22
22
  entryEditBorderColor: colors.tiara
23
23
  };
24
- }
24
+ };
25
+
26
+ export default generateComponentTheme;
@@ -5,10 +5,12 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
 
6
6
  var _dec, _class, _class2, _temp;
7
7
 
8
+ /** @jsx jsx */
9
+
10
+ /* eslint-disable-next-line no-unused-vars */
8
11
  import React, { Component } from 'react';
9
12
  import PropTypes from 'prop-types';
10
13
  import partial from 'lodash/partial';
11
- import classNames from 'classnames';
12
14
  import ImmutablePropTypes from 'react-immutable-proptypes';
13
15
  import Immutable from 'immutable';
14
16
  import { IconEditLine, IconPlusLine, IconCopyLine, IconTrashLine } from '@instructure/ui-icons';
@@ -18,9 +20,9 @@ import { List } from '@instructure/ui-list';
18
20
  import { Heading } from '@instructure/ui-heading';
19
21
  import { PresentationContent } from '@instructure/ui-a11y-content';
20
22
  import { Alert } from '@instructure/ui-alerts';
21
- import { themeable } from '@instructure/ui-themeable';
22
- import { RichContentRenderer } from '@instructure/quiz-rce';
23
+ import { withStyle, jsx } from '@instructure/emotion';
23
24
  import { BUILD_TRAY_POSITION, COPY_MOVE_BANK_ENTRY_MODAL, SET_EDIT_BUTTON_FOCUS, withI18nSupport } from '@instructure/quiz-common';
25
+ import { RichContentRendererEmotion } from '@instructure/quiz-rce';
24
26
  import { extractTextFromHtml } from '@instructure/quiz-interactions';
25
27
  import t from '@instructure/quiz-i18n/es/format-message';
26
28
  import CopyMoveBankEntryModal from "../CopyMoveBankEntryModal/index.js";
@@ -30,27 +32,12 @@ import Overlay from "../../../common/components/shared/overlay/Overlay.js";
30
32
  import ItemShow from "../../../common/components/resources/item/ItemShow/index.js";
31
33
  import StimulusShowInfo from "../../../common/components/resources/stimulus/StimulusShowInfo/index.js";
32
34
  import TagDisplay from "../../../common/components/shared/TagDisplay/index.js";
33
- var styles = {
34
- componentId: 'eQXFj',
35
- template: function template(theme) {
36
- return "\n\n.eQXFj_IXXK{padding:".concat(theme.entryDetailPadding || 'inherit', "}\n\n.eQXFj_dlpV{align-items:flex-start;color:").concat(theme.headerRowColor || 'inherit', ";display:flex;flex-direction:row;justify-content:space-between}\n\n.eQXFj_exDh{display:inline-flex;position:relative;z-index:").concat(theme.buttonsZIndex || 'inherit', "}\n\n.eQXFj_bTHH{border-left:").concat(theme.expandButtonContainerBorderWidth || 'inherit', " solid ").concat(theme.expandButtonContainerBorderColor || 'inherit', "}\n\n.eQXFj_AHIw{display:block}\n\n.eQXFj_eTBd{margin-bottom:").concat(theme.deletePrefaceMargin || 'inherit', "}\n\n.eQXFj_ftIe{margin-bottom:").concat(theme.addButtonMargin || 'inherit', "}\n\n.eQXFj_fAhB{color:").concat(theme.headerTextColor || 'inherit', ";font-size:").concat(theme.headerTextFontSize || 'inherit', "}\n\n.eQXFj_cloC{font-size:").concat(theme.stemFontSize || 'inherit', ";line-height:").concat(theme.stemLineHeight || 'inherit', ";overflow-x:auto}\n\n.eQXFj_cloC p{margin:0}\n\n.eQXFj_cjWK{border-top:").concat(theme.footerBorderWidth || 'inherit', " solid ").concat(theme.footerBorderColor || 'inherit', ";font-size:").concat(theme.footerFontSize || 'inherit', ";padding:").concat(theme.footerPadding || 'inherit', "}");
37
- },
38
- 'entryDetail': 'eQXFj_IXXK',
39
- 'headerRow': 'eQXFj_dlpV',
40
- 'buttons': 'eQXFj_exDh',
41
- 'expandButtonContainer': 'eQXFj_bTHH',
42
- 'deleteAlert': 'eQXFj_AHIw',
43
- 'deletePreface': 'eQXFj_eTBd',
44
- 'addButton': 'eQXFj_ftIe',
45
- 'headerText': 'eQXFj_fAhB',
46
- 'stem': 'eQXFj_cloC',
47
- 'footer': 'eQXFj_cjWK'
48
- };
49
- import theme from "./theme.js";
35
+ import generateStyle from "./styles.js";
36
+ import generateComponentTheme from "./theme.js";
50
37
 
51
- var _ref2 = /*#__PURE__*/React.createElement("div", null);
38
+ var _ref2 = jsx("div", null);
52
39
 
53
- export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
40
+ export var BankEntryRow = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
54
41
  _inherits(BankEntryRow, _withI18nSupport);
55
42
 
56
43
  var _super = _createSuper(BankEntryRow);
@@ -72,20 +59,20 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
72
59
 
73
60
  _this.deleteBankEntry = function () {
74
61
  var deletePreface = _this.isItemEntry() ? t('Deleting this question:') : t('Deleting this stimulus:');
75
- var confirmBody = /*#__PURE__*/React.createElement(Alert, {
62
+ var confirmBody = jsx(Alert, {
76
63
  variant: "error",
77
64
  padding: "0"
78
- }, /*#__PURE__*/React.createElement("div", {
79
- className: styles.deleteAlert
80
- }, /*#__PURE__*/React.createElement("div", {
81
- className: styles.deletePreface
82
- }, deletePreface), /*#__PURE__*/React.createElement(List, null, /*#__PURE__*/React.createElement(List.Item, null, t.rich('will <0>NOT</0> remove it from any assessments', [function (_ref) {
65
+ }, jsx("div", {
66
+ css: _this.props.styles.deleteAlert
67
+ }, jsx("div", {
68
+ css: _this.props.styles.deletePreface
69
+ }, deletePreface), jsx(List, null, jsx(List.Item, null, t.rich('will <0>NOT</0> remove it from any assessments', [function (_ref) {
83
70
  var children = _ref.children;
84
- return /*#__PURE__*/React.createElement(Text, {
71
+ return jsx(Text, {
85
72
  weight: "bold",
86
73
  key: "0"
87
74
  }, children);
88
- }])), /*#__PURE__*/React.createElement(List.Item, null, t('will lose its statistical link in reporting')), /*#__PURE__*/React.createElement(List.Item, null, t('will remove access for all users with whom this bank has been shared')))));
75
+ }])), jsx(List.Item, null, t('will lose its statistical link in reporting')), jsx(List.Item, null, t('will remove access for all users with whom this bank has been shared')))));
89
76
 
90
77
  _this.props.withConfirm(partial(_this.props.removeBankEntry, _this.props.bank.id, _this.props.bankEntry.id), {
91
78
  title: t('Delete {type}', {
@@ -138,7 +125,7 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
138
125
  var title = t('Delete {type}', {
139
126
  type: _this.type()
140
127
  });
141
- return /*#__PURE__*/React.createElement(IconButton, {
128
+ return jsx(IconButton, {
142
129
  size: "medium",
143
130
  withBackground: false,
144
131
  withBorder: false,
@@ -207,12 +194,13 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
207
194
  }) : t('Expand {type} details', {
208
195
  type: type
209
196
  });
210
- return /*#__PURE__*/React.createElement("div", {
211
- className: styles.expandButtonContainer
212
- }, /*#__PURE__*/React.createElement(ExpandButton, {
197
+ return jsx("div", {
198
+ css: this.props.styles.expandButtonContainer
199
+ }, jsx(ExpandButton, {
213
200
  onClick: this.props.toggleExpanded,
214
201
  title: title,
215
- isExpanded: this.props.isExpanded
202
+ isExpanded: this.props.isExpanded,
203
+ "data-automation": "expand-bank-question-button"
216
204
  }));
217
205
  }
218
206
  }, {
@@ -222,9 +210,9 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
222
210
  var title = t('Add {type} to this quiz', {
223
211
  type: this.type()
224
212
  });
225
- return /*#__PURE__*/React.createElement("div", {
226
- className: classNames(styles.buttons, styles.addButton)
227
- }, /*#__PURE__*/React.createElement(IconButton, {
213
+ return jsx("div", {
214
+ css: [this.props.styles.buttons, this.props.styles.addButton]
215
+ }, jsx(IconButton, {
228
216
  color: "primary",
229
217
  shape: "circle",
230
218
  size: "small",
@@ -244,7 +232,7 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
244
232
  key: "renderMoveButton",
245
233
  value: function renderMoveButton() {
246
234
  var title = this.moveModalTitle();
247
- return /*#__PURE__*/React.createElement(IconButton, {
235
+ return jsx(IconButton, {
248
236
  ref: this.storeCopyMoveBankEntryButtonRef,
249
237
  size: "medium",
250
238
  withBackground: false,
@@ -265,16 +253,16 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
265
253
  key: "renderHeader",
266
254
  value: function renderHeader() {
267
255
  var separator = ' | ';
268
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
269
- className: styles.headerRow
270
- }, this.renderAddButton(), /*#__PURE__*/React.createElement("div", {
271
- className: styles.buttons
272
- }, this.props.bank.canEdit() && /*#__PURE__*/React.createElement(React.Fragment, null, this.renderEditButton(), this.renderMoveButton(), this.renderTrashButton()), this.renderExpandButton())), /*#__PURE__*/React.createElement("div", {
273
- className: styles.headerText
274
- }, /*#__PURE__*/React.createElement(Heading, {
256
+ return jsx("div", null, jsx("div", {
257
+ css: this.props.styles.headerRow
258
+ }, this.renderAddButton(), jsx("div", {
259
+ css: this.props.styles.buttons
260
+ }, this.props.bank.canEdit() && jsx(React.Fragment, null, this.renderEditButton(), this.renderMoveButton(), this.renderTrashButton()), this.renderExpandButton())), jsx("div", {
261
+ css: this.props.styles.headerText
262
+ }, jsx(Heading, {
275
263
  level: "reset",
276
264
  as: "h2"
277
- }, this.entryHeader(), /*#__PURE__*/React.createElement(PresentationContent, null, separator), this.entryIdentifier())));
265
+ }, this.entryHeader(), jsx(PresentationContent, null, separator), this.entryIdentifier())));
278
266
  }
279
267
  }, {
280
268
  key: "renderEntryCollapsed",
@@ -283,13 +271,13 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
283
271
  // or title plain text
284
272
 
285
273
  if (itemOrStimulus.itemBody) {
286
- return /*#__PURE__*/React.createElement(RichContentRenderer, {
287
- customStyles: styles.stem,
274
+ return jsx(RichContentRendererEmotion, {
275
+ customStyles: this.props.styles.stem,
288
276
  content: itemOrStimulus.itemBody
289
277
  });
290
278
  } else {
291
- return /*#__PURE__*/React.createElement("div", {
292
- className: styles.stem
279
+ return jsx("div", {
280
+ css: this.props.styles.stem
293
281
  }, itemOrStimulus.title);
294
282
  }
295
283
  }
@@ -299,12 +287,12 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
299
287
  var entry = this.getEntry();
300
288
 
301
289
  if (this.isItemEntry()) {
302
- return /*#__PURE__*/React.createElement(ItemShow, {
290
+ return jsx(ItemShow, {
303
291
  entry: entry,
304
292
  guid: this.props.bankEntry.id
305
293
  });
306
294
  } else {
307
- return /*#__PURE__*/React.createElement(StimulusShowInfo, {
295
+ return jsx(StimulusShowInfo, {
308
296
  stimulus: entry
309
297
  });
310
298
  }
@@ -315,7 +303,7 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
315
303
  var title = t('Edit {type}', {
316
304
  type: this.type()
317
305
  });
318
- return /*#__PURE__*/React.createElement(IconButton, {
306
+ return jsx(IconButton, {
319
307
  ref: this.storeEditButtonRef,
320
308
  size: "medium",
321
309
  withBackground: false,
@@ -334,7 +322,7 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
334
322
  return null;
335
323
  }
336
324
 
337
- return /*#__PURE__*/React.createElement(TagDisplay, {
325
+ return jsx(TagDisplay, {
338
326
  tagAssociations: this.props.tagAssociations
339
327
  });
340
328
  }
@@ -344,7 +332,7 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
344
332
  var lastUpdate = t.rich('<0>Last Update</0> { updatedAt }', {
345
333
  0: function _(_ref3) {
346
334
  var children = _ref3.children;
347
- return /*#__PURE__*/React.createElement(Text, {
335
+ return jsx(Text, {
348
336
  key: "lastUpdate",
349
337
  weight: "bold",
350
338
  color: "primary"
@@ -352,24 +340,24 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
352
340
  },
353
341
  updatedAt: this.formatDatetimeMedium(this.props.bankEntry.get('updatedAt'))
354
342
  });
355
- return /*#__PURE__*/React.createElement("div", {
356
- className: styles.footer
357
- }, /*#__PURE__*/React.createElement("span", null, lastUpdate), this.renderTags());
343
+ return jsx("div", {
344
+ css: this.props.styles.footer
345
+ }, jsx("span", null, lastUpdate), this.renderTags());
358
346
  }
359
347
  }, {
360
348
  key: "render",
361
349
  value: function render() {
362
350
  var isExpanded = this.props.isExpanded;
363
- return /*#__PURE__*/React.createElement(Overlay, {
351
+ return jsx(Overlay, {
364
352
  onClick: this.props.toggleExpanded,
365
353
  tabIndex: "-1",
366
354
  ariaLabel: this.entryIdentifier()
367
- }, /*#__PURE__*/React.createElement("div", {
355
+ }, jsx("div", {
368
356
  role: "group"
369
- }, /*#__PURE__*/React.createElement("div", {
370
- className: styles.entryDetail,
357
+ }, jsx("div", {
358
+ css: this.props.styles.entryDetail,
371
359
  "data-automation": "sdk-bankEntryItem"
372
- }, this.renderHeader(), isExpanded ? this.renderEntryExpanded() : this.renderEntryCollapsed()), isExpanded && this.renderFooter()), /*#__PURE__*/React.createElement(CopyMoveBankEntryModal, {
360
+ }, this.renderHeader(), isExpanded ? this.renderEntryExpanded() : this.renderEntryCollapsed()), isExpanded && this.renderFooter()), jsx(CopyMoveBankEntryModal, {
373
361
  createEntry: this.createEntryForBank,
374
362
  label: this.moveModalTitle(),
375
363
  sourceBankId: this.props.bank.id,
@@ -405,7 +393,9 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
405
393
  toggleExpanded: PropTypes.func.isRequired,
406
394
  withConfirm: PropTypes.func.isRequired,
407
395
  locale: PropTypes.string,
408
- timezone: PropTypes.string
396
+ timezone: PropTypes.string,
397
+ // eslint-disable-next-line react/require-default-props,react/forbid-prop-types
398
+ styles: PropTypes.object
409
399
  }, _class2.defaultProps = {
410
400
  activeQuizId: null,
411
401
  addEntryToQuiz: null,
@@ -0,0 +1,50 @@
1
+ var generateStyle = function generateStyle(componentTheme) {
2
+ return {
3
+ entryDetail: {
4
+ padding: componentTheme.entryDetailPadding
5
+ },
6
+ headerRow: {
7
+ display: 'flex',
8
+ flexDirection: 'row',
9
+ justifyContent: 'space-between',
10
+ alignItems: 'flex-start',
11
+ color: componentTheme.headerRowColor
12
+ },
13
+ buttons: {
14
+ position: 'relative',
15
+ display: 'inline-flex',
16
+ zIndex: componentTheme.buttonsZIndex
17
+ },
18
+ expandButtonContainer: {
19
+ borderLeft: "".concat(componentTheme.expandButtonContainerBorderWidth, " solid ").concat(componentTheme.expandButtonContainerBorderColor)
20
+ },
21
+ deleteAlert: {
22
+ display: 'block'
23
+ },
24
+ deletePreface: {
25
+ marginBottom: componentTheme.deletePrefaceMargin
26
+ },
27
+ addButton: {
28
+ marginBottom: componentTheme.addButtonMargin
29
+ },
30
+ headerText: {
31
+ color: componentTheme.headerTextColor,
32
+ fontSize: componentTheme.headerTextFontSize
33
+ },
34
+ stem: {
35
+ overflowX: 'auto',
36
+ fontSize: componentTheme.stemFontSize,
37
+ lineHeight: componentTheme.stemLineHeight,
38
+ '& p': {
39
+ margin: 0
40
+ }
41
+ },
42
+ footer: {
43
+ padding: componentTheme.footerPadding,
44
+ borderTop: "".concat(componentTheme.footerBorderWidth, " solid ").concat(componentTheme.footerBorderColor),
45
+ fontSize: componentTheme.footerFontSize
46
+ }
47
+ };
48
+ };
49
+
50
+ export default generateStyle;
@@ -1,4 +1,4 @@
1
- export default function generator(_ref) {
1
+ var generateComponentTheme = function generateComponentTheme(_ref) {
2
2
  var spacing = _ref.spacing,
3
3
  colors = _ref.colors,
4
4
  borders = _ref.borders,
@@ -20,4 +20,6 @@ export default function generator(_ref) {
20
20
  footerFontSize: typography.fontSizeXSmall,
21
21
  deletePrefaceMargin: spacing.xxSmall
22
22
  };
23
- }
23
+ };
24
+
25
+ export default generateComponentTheme;